vibe64 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{VRadioGroup-D6WRdUau.js → VRadioGroup-BuRMvs7d.js} +1 -1
- package/dist/assets/{VTabs-BGX5dGoS.js → VTabs-CQq9CAuT.js} +1 -1
- package/dist/assets/{VTextarea-CD6H_mtJ.js → VTextarea-Duvzvmjq.js} +1 -1
- package/dist/assets/{Vibe64AsyncModuleState-Cel3OePx.js → Vibe64AsyncModuleState-DuuzlJDp.js} +1 -1
- package/dist/assets/{Vibe64AuthSettingsButton-CMMeacsl.js → Vibe64AuthSettingsButton-CKOCL-kl.js} +1 -1
- package/dist/assets/{Vibe64DashboardShell-C2UhX2ke.js → Vibe64DashboardShell-DMT8aOp1.js} +1 -1
- package/dist/assets/{Vibe64DatabaseWorkspace-C43TE5-O.js → Vibe64DatabaseWorkspace-CqH0zfFZ.js} +1 -1
- package/dist/assets/{Vibe64OutputControls-BmzH2ASf.js → Vibe64OutputControls-DDILWOYb.js} +1 -1
- package/dist/assets/{Vibe64RepositoryWorkspace-CT9tkvHh.js → Vibe64RepositoryWorkspace-D11BZHtF.js} +1 -1
- package/dist/assets/Vibe64SessionFiles-BSoB7Xrs.js +1 -0
- package/dist/assets/{Vibe64SessionFiles-CH5PCxwg.css → Vibe64SessionFiles-DVux69YS.css} +1 -1
- package/dist/assets/{Vibe64SubsystemsView-DNx-pZp8.js → Vibe64SubsystemsView-tLlxmK3M.js} +1 -1
- package/dist/assets/{Vibe64SystemWorldView-UdNJZbqX.js → Vibe64SystemWorldView-8og8TPyL.js} +1 -1
- package/dist/assets/{_sessionId_-DZTmI19N.js → _sessionId_-Dts6gv4W.js} +1 -1
- package/dist/assets/{_sessionTool_-CugJWIK4.js → _sessionTool_-bHJUlHCW.js} +1 -1
- package/dist/assets/_slug_-B3fqw8Sl.js +12 -0
- package/dist/assets/_slug_-DfHqx2_b.css +1 -0
- package/dist/assets/{dashboard-D4NXqPY1.js → dashboard-CcD6GIaB.js} +1 -1
- package/dist/assets/{definitions-CyUCoqu-.js → definitions-ChGXm26a.js} +1 -1
- package/dist/assets/{error-kYKTA8fu.js → error-CStS-Kbt.js} +1 -1
- package/dist/assets/{index-hy7AAm-B.js → index-B262pg9q.js} +1 -1
- package/dist/assets/{index-DX6Rm6jZ.js → index-B_grpOta.js} +1 -1
- package/dist/assets/{index-Cpt19GIW.js → index-BtHA_DX9.js} +1 -1
- package/dist/assets/{index-SBc6H2In.js → index-C4KnwA0g.js} +4 -4
- package/dist/assets/{index-DeRx59Iq.js → index-CC7BFJAg.js} +1 -1
- package/dist/assets/{index-6Kv-7k0S.js → index-CKFrWxnr.js} +1 -1
- package/dist/assets/{index-BDe3NnFP.js → index-CPG-_bMW.js} +1 -1
- package/dist/assets/{index-CuEZOpKL.js → index-CV9pOpbQ.js} +1 -1
- package/dist/assets/{index-D4p1hWbM.js → index-DIQxSy1c.js} +1 -1
- package/dist/assets/{index-D5vnCntG.js → index-DVaJ8fEr.js} +1 -1
- package/dist/assets/{index-BGu7hfTb.js → index-DtGqjUin.js} +1 -1
- package/dist/assets/{index-Cca4WXur.js → index-YQALXwL4.js} +1 -1
- package/dist/assets/{placement-Nw6LF6xp.js → placement-Cyt3SnRe.js} +1 -1
- package/dist/assets/{studioGateApi-B2eiydiA.js → studioGateApi-BwBnOYBp.js} +1 -1
- package/dist/assets/{useArchivedVibe64Sessions-LeGda1Y9.js → useArchivedVibe64Sessions-_FKt1-qN.js} +1 -1
- package/dist/assets/{useVibe64ConversationLog-BPyKYbvH.js → useVibe64ConversationLog-BjnpqM9K.js} +1 -1
- package/dist/assets/{useVibe64ProjectScope-n5T5l2pY.js → useVibe64ProjectScope-DcDkjbLT.js} +1 -1
- package/dist/assets/{useVibe64SessionData-BToODuTg.js → useVibe64SessionData-BHLSmuPm.js} +1 -1
- package/dist/assets/{useVibe64SessionSelection-D1wXIWTm.js → useVibe64SessionSelection-G6KQKJxb.js} +1 -1
- package/dist/assets/{vibe64RepositoryRealtime-Xo7aIksE.js → vibe64RepositoryRealtime-C2WPn5do.js} +1 -1
- package/dist/assets/{vibe64SessionInfo-Dy_4bL3a.js → vibe64SessionInfo-8kuxgD5r.js} +1 -1
- package/dist/assets/{vibe64SessionPanelModel-5UED-6V-.js → vibe64SessionPanelModel-DDaXjAJ_.js} +1 -1
- package/dist/assets/{vibe64SessionRequestConfig-B7Llggdb.js → vibe64SessionRequestConfig-uGWcyQY6.js} +1 -1
- package/dist/assets/{vibe64SessionToolDefinitions-C4maKOfp.js → vibe64SessionToolDefinitions-D5CgOIqa.js} +1 -1
- package/dist/assets/{vueRefOrGetterValue-_KqAOFjr.js → vueRefOrGetterValue-CV9c3oBd.js} +1 -1
- package/dist/index.html +1 -1
- package/node_modules/@jskit-ai/connector-google-calendar/package.json +3 -3
- package/node_modules/@jskit-ai/connector-google-calendar/patterns/calendar-cli/example/package.json +4 -4
- package/node_modules/@jskit-ai/connectors-catalog/package.json +3 -3
- package/node_modules/@jskit-ai/connectors-catalog/test/dbt-semantic-layer.test.js +3 -0
- package/node_modules/@jskit-ai/connectors-catalog/test/google-ads.test.js +3 -0
- package/node_modules/@jskit-ai/connectors-catalog/test/salesforce.test.js +3 -0
- package/node_modules/@jskit-ai/connectors-catalog/test/xero.test.js +3 -0
- package/node_modules/@jskit-ai/connectors-core/package.json +4 -4
- package/node_modules/@jskit-ai/http-web/package.json +6 -6
- package/node_modules/@jskit-ai/kernel/package.json +1 -1
- package/node_modules/@jskit-ai/kernel/server/runtime/fastifyBootstrap.js +50 -10
- package/node_modules/@jskit-ai/kernel/server/runtime/fastifyBootstrap.test.js +38 -0
- package/node_modules/@jskit-ai/kernel/shared/support/normalize.js +8 -0
- package/node_modules/@jskit-ai/kernel/shared/support/normalize.test.js +10 -0
- package/node_modules/@jskit-ai/payments-core/package.json +1 -1
- package/node_modules/@jskit-ai/realtime/package.json +3 -3
- package/node_modules/@jskit-ai/realtime/patterns/realtime-application/example/package.json +2 -2
- package/node_modules/@jskit-ai/resource-core/package.json +2 -2
- package/node_modules/@jskit-ai/resource-crud-core/package.json +3 -3
- package/node_modules/@jskit-ai/shell-web/package.json +2 -2
- package/node_modules/@jskit-ai/uploads-runtime/package.json +2 -2
- package/node_modules/@local/current-app/package.json +1 -1
- package/node_modules/@local/main/package.json +2 -2
- package/node_modules/@local/studio-health/package.json +1 -1
- package/node_modules/@local/vibe64-accounts/package.json +3 -3
- package/node_modules/@local/vibe64-core/package.json +1 -1
- package/node_modules/@local/vibe64-database-tools/package.json +3 -3
- package/node_modules/@local/vibe64-project/package.json +1 -1
- package/node_modules/@local/vibe64-runtime/src/server/codexAppServerProvider.js +34 -0
- package/node_modules/@local/vibe64-sessions/package.json +1 -1
- package/node_modules/@local/vibe64-sessions/src/server/sessionRenewal.js +4 -1
- package/node_modules/@local/vibe64-source-editor/package.json +5 -5
- package/node_modules/@local/vibe64-system-graph/package.json +3 -3
- package/node_modules/@local/vibe64-terminals/package.json +2 -2
- package/node_modules/@local/vibe64-terminals/src/server/agent/providers/codexSessionAgentProvider.js +6 -0
- package/node_modules/@local/vibe64-terminals/src/server/agent/sessionAgentManager.js +16 -0
- package/node_modules/@local/vibe64-terminals/src/server/codexTerminal.js +180 -64
- package/node_modules/@local/vibe64-terminals/src/server/registerRoutes.js +12 -0
- package/node_modules/@local/vibe64-terminals/src/server/service.js +57 -16
- package/node_modules/@local/vibe64-terminals/src/server/sessionPromptHints.js +9 -1
- package/node_modules/@local/vibe64-terminals/src/server/sessionSaveCommitMessage.js +1 -1
- package/package.json +15 -15
- package/packages/current-app/package.json +1 -1
- package/packages/main/package.json +2 -2
- package/packages/studio-health/package.json +1 -1
- package/packages/vibe64-accounts/package.json +3 -3
- package/packages/vibe64-core/package.json +1 -1
- package/packages/vibe64-database-tools/package.json +3 -3
- package/packages/vibe64-project/package.json +1 -1
- package/packages/vibe64-runtime/src/server/codexAppServerProvider.js +34 -0
- package/packages/vibe64-sessions/package.json +1 -1
- package/packages/vibe64-sessions/src/server/sessionRenewal.js +4 -1
- package/packages/vibe64-source-editor/package.json +5 -5
- package/packages/vibe64-system-graph/package.json +3 -3
- package/packages/vibe64-terminals/package.json +2 -2
- package/packages/vibe64-terminals/src/server/agent/providers/codexSessionAgentProvider.js +6 -0
- package/packages/vibe64-terminals/src/server/agent/sessionAgentManager.js +16 -0
- package/packages/vibe64-terminals/src/server/codexTerminal.js +180 -64
- package/packages/vibe64-terminals/src/server/registerRoutes.js +12 -0
- package/packages/vibe64-terminals/src/server/service.js +57 -16
- package/packages/vibe64-terminals/src/server/sessionPromptHints.js +9 -1
- package/packages/vibe64-terminals/src/server/sessionSaveCommitMessage.js +1 -1
- package/dist/assets/Vibe64SessionFiles-BS5MW7Qz.js +0 -1
- package/dist/assets/_slug_-BzRzebKA.js +0 -12
- package/dist/assets/_slug_-Q7ibe3SE.css +0 -1
package/dist/assets/{useVibe64ConversationLog-BPyKYbvH.js → useVibe64ConversationLog-BjnpqM9K.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as connectorDefinitions}from"./definitions-CyUCoqu-.js";import{P as usePaths,dc as useQueryClient,D as useEndpointResource,A as computed,aW as useRealtimeSocket,ag as onScopeDispose,M as useRealtimeEvent,H as watch,aP as shallowRef,B as ref,L as getHttpWebClient,Q as VIBE64_SURFACE_ID,R as ROUTE_VISIBILITY_PUBLIC}from"./index-SBc6H2In.js";import{u as useVibe64ProjectSlug}from"./useVibe64ProjectScope-n5T5l2pY.js";import{V as VIBE64_SESSION_CHANGED_EVENT,v as vibe64SessionPath,c as VIBE64_SESSIONS_API_SUFFIX,P as vibe64ConversationLogQueryKey,Q as vibe64ConversationLogPath}from"./vibe64SessionRequestConfig-B7Llggdb.js";import{r as readRefOrGetterValue}from"./vueRefOrGetterValue-_KqAOFjr.js";import{a as vibe64SessionDebugLog,b as vibe64SessionDebugError}from"./vibe64SessionPanelModel-5UED-6V-.js";const VIBE64_AGENT_EXECUTION_PROFILE_IDS=Object.freeze({ECONOMY:"economy"});const VIBE64_AGENT_EXECUTION_WORKLOAD_IDS=Object.freeze({COMMIT_TITLE:"commit_title",CONVERSATION_SUMMARY:"conversation_summary",DATABASE_ASSISTANT:"database_assistant",PROMPT_HINT:"prompt_hint",SESSION_TITLE:"session_title",SOURCE_EXPLANATION:"source_explanation"});Object.freeze({[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.COMMIT_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.CONVERSATION_SUMMARY]:Object.freeze({maxInputCharacters:2e5,maxOutputCharacters:16e3,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.DATABASE_ASSISTANT]:Object.freeze({maxInputCharacters:5e5,maxOutputCharacters:16e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.PROMPT_HINT]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:2500,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SESSION_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:3e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SOURCE_EXPLANATION]:Object.freeze({maxInputCharacters:1e5,maxOutputCharacters:32e3,timeoutMs:18e4})});const VIBE64_AGENT_EXECUTION_TOOL_POLICIES=Object.freeze({NONE:"none"});const VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS=Object.freeze({MAX_INPUT_CHARACTERS:5e5,MAX_OUTPUT_CHARACTERS:32e3,MAX_TIMEOUT_MS:3e5});const VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES=Object.freeze({INVALID:"vibe64_agent_execution_profile_invalid",MODEL_UNAVAILABLE:"vibe64_agent_execution_profile_model_unavailable",POLICY_UNENFORCEABLE:"vibe64_agent_execution_profile_policy_unenforceable",PROFILE_UNKNOWN:"vibe64_agent_execution_profile_unknown",REASONING_UNSUPPORTED:"vibe64_agent_execution_profile_reasoning_unsupported",UNBOUNDED:"vibe64_agent_execution_profile_unbounded",UNSAFE:"vibe64_agent_execution_profile_unsafe",WORKLOAD_UNSUPPORTED:"vibe64_agent_execution_profile_workload_unsupported"});const VIBE64_AGENT_EXECUTION_PROFILE_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_PROFILE_IDS));const VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_WORKLOAD_IDS));class Vibe64AgentExecutionProfileError extends Error{constructor(code,message,details={}){super(message);this.name="Vibe64AgentExecutionProfileError";this.code=code;this.details=Object.freeze({...details});for(const[name,value]of Object.entries(this.details)){if(!["code","details","message","name"].includes(name)){this[name]=value}}}}function executionProfileError(code,message,details={}){return new Vibe64AgentExecutionProfileError(code,message,details)}function isPlainRecord(value){if(!value||typeof value!=="object"||Array.isArray(value)){return false}const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}function requiredRecord(value,fieldName){if(!isPlainRecord(value)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be an object.`,{field:fieldName})}return value}function requireOnlyFields(value,allowedFields,fieldName){const allowed=new Set(allowedFields);const unexpected=Object.keys(value).find(name=>!allowed.has(name));if(unexpected){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} contains an unsupported field: ${unexpected}.`,{field:`${fieldName}.${unexpected}`})}}function requiredText(value,fieldName,maximumLength=256){if(typeof value!=="string"){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be text.`,{field:fieldName})}const normalized=value.trim();if(!normalized||normalized.length>maximumLength){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} is invalid.`,{field:fieldName})}return normalized}function requiredBoolean(value,fieldName){if(typeof value!=="boolean"){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be a boolean.`,{field:fieldName})}return value}function requireSafeFalse(value,fieldName){if(requiredBoolean(value,fieldName)!==false){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile ${fieldName} must be disabled.`,{field:fieldName})}return false}function boundedPositiveInteger(value,fieldName,maximum){if(!Number.isSafeInteger(value)||value<=0||value>maximum){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile ${fieldName} must be a positive integer no greater than ${maximum}.`,{field:fieldName,maximum})}return value}function requiredLimits(value){if(!isPlainRecord(value)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,"Execution profile limits are required.",{field:"limits"})}return value}function normalizeProfileId(value){const profileId=requiredText(value,"profileId",64);if(!VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(profileId)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.PROFILE_UNKNOWN,`Unknown execution profile: ${profileId}.`,{profileId})}return profileId}function normalizeWorkloadId(value){const workloadId=requiredText(value,"workloadId",64);if(!VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES.has(workloadId)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.WORKLOAD_UNSUPPORTED,`Unsupported execution profile workload: ${workloadId}.`,{workloadId})}return workloadId}function normalizedExecutionProfileRequest(input){return Object.freeze({profileId:normalizeProfileId(input.profileId),workloadId:normalizeWorkloadId(input.workloadId)})}function defineVibe64AgentExecutionProfileResolution(value){const input=requiredRecord(value,"resolution");const executionProfile=normalizedExecutionProfileRequest(input);const request=requiredRecord(input.request,"request policy");const policy=requiredRecord(input.policy,"tool policy");const limits=requiredLimits(input.limits);requireOnlyFields(request,["allowProviderModelFallback","reasoning","summary"],"request");requireOnlyFields(policy,["environmentAccess","networkAccess","repositoryWrite","tools"],"policy");requireOnlyFields(limits,["maxInputCharacters","maxOutputCharacters","timeoutMs"],"limits");const reasoning=requiredBoolean(request.reasoning,"request.reasoning");if(typeof input.thinking!=="string"){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,"Execution profile thinking must be text.",{field:"thinking"})}const thinking=input.thinking.trim();if(reasoning&&!thinking||!reasoning&&thinking){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,"Execution profile thinking must agree with its reasoning request.",{field:"thinking"})}if(thinking.length>64){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,"Execution profile thinking is invalid.",{field:"thinking"})}if(policy.tools!==VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,"Execution profile tools must be disabled.",{field:"policy.tools"})}return Object.freeze({limits:Object.freeze({maxInputCharacters:boundedPositiveInteger(limits.maxInputCharacters,"limits.maxInputCharacters",VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_INPUT_CHARACTERS),maxOutputCharacters:boundedPositiveInteger(limits.maxOutputCharacters,"limits.maxOutputCharacters",VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_OUTPUT_CHARACTERS),timeoutMs:boundedPositiveInteger(limits.timeoutMs,"limits.timeoutMs",VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_TIMEOUT_MS)}),model:requiredText(input.model,"model"),policy:Object.freeze({environmentAccess:requireSafeFalse(policy.environmentAccess,"policy.environmentAccess"),networkAccess:requireSafeFalse(policy.networkAccess,"policy.networkAccess"),repositoryWrite:requireSafeFalse(policy.repositoryWrite,"policy.repositoryWrite"),tools:VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE}),profileId:executionProfile.profileId,providerId:requiredText(input.providerId,"providerId",64),request:Object.freeze({allowProviderModelFallback:requireSafeFalse(request.allowProviderModelFallback,"request.allowProviderModelFallback"),reasoning,summary:requireSafeFalse(request.summary,"request.summary")}),revision:requiredText(input.revision,"revision",128),thinking,workloadId:executionProfile.workloadId})}function vibe64AgentExecutionProfileAuditSnapshot(value){return defineVibe64AgentExecutionProfileResolution(value)}const VIBE64_AGENT_PROVIDER_IDS=Object.freeze({CLAUDE:"claude",CODEX:"codex",OPENCODE:"opencode"});const VIBE64_AGENT_PROVIDER_UNKNOWN_CODE="vibe64_agent_provider_unknown";const VIBE64_AGENT_PARAMETER_IDS=Object.freeze({MODEL:"model",THINKING:"thinking"});const VIBE64_DEFAULT_AGENT_PROVIDER_ID=VIBE64_AGENT_PROVIDER_IDS.CODEX;const VIBE64_CODEX_SOL_MODEL="gpt-5.6-sol";const VIBE64_CODEX_GPT_5_5_MODEL="gpt-5.5";const VIBE64_CODEX_DEFAULT_MODEL=VIBE64_CODEX_SOL_MODEL;const VIBE64_CODEX_DEFAULT_THINKING="xhigh";const VIBE64_CODEX_SPARK_MODEL="gpt-5.3-codex-spark";const VIBE64_CODEX_STANDARD_THINKING_VALUES=Object.freeze(["low","medium","high","xhigh"]);const VIBE64_CODEX_SOL_THINKING_VALUES=Object.freeze([...VIBE64_CODEX_STANDARD_THINKING_VALUES,"max"]);const VIBE64_AGENT_PROVIDERS=Object.freeze([Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.ECONOMY]),id:VIBE64_AGENT_PROVIDER_IDS.CODEX,implemented:true,label:"Codex",parameters:Object.freeze([Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.MODEL,defaultValue:VIBE64_CODEX_DEFAULT_MODEL,label:"Model",options:Object.freeze([Object.freeze({label:"Automatic (GPT-5.6 Sol)",value:""}),Object.freeze({label:"GPT-5.6 Sol",supportedThinking:VIBE64_CODEX_SOL_THINKING_VALUES,value:VIBE64_CODEX_DEFAULT_MODEL}),Object.freeze({label:"GPT-5.5",supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_GPT_5_5_MODEL}),Object.freeze({label:"Codex Spark",request:Object.freeze({summary:false}),supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_SPARK_MODEL})])}),Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.THINKING,defaultValue:VIBE64_CODEX_DEFAULT_THINKING,label:"Thinking",options:Object.freeze([Object.freeze({label:"Automatic",value:""}),Object.freeze({label:"Low",value:"low"}),Object.freeze({label:"Medium",value:"medium"}),Object.freeze({label:"High",value:"high"}),Object.freeze({label:"X High",value:"xhigh"}),Object.freeze({label:"Max",value:"max"})])})])}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_AGENT_PROVIDER_IDS.CLAUDE,implemented:false,label:"Claude",parameters:Object.freeze([])}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_AGENT_PROVIDER_IDS.OPENCODE,implemented:false,label:"OpenCode",parameters:Object.freeze([])})]);function agentProviderDefinition(providerId=""){const normalizedProviderId=normalizeAgentSettingText(providerId)||VIBE64_DEFAULT_AGENT_PROVIDER_ID;const provider=VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedProviderId);if(provider){return provider}const error=new Error(`Unknown assistant provider: ${normalizedProviderId}.`);error.code=VIBE64_AGENT_PROVIDER_UNKNOWN_CODE;error.providerId=normalizedProviderId;throw error}function agentProviderParameter(provider={},parameterId=""){const normalizedParameterId=normalizeAgentSettingText(parameterId);return(Array.isArray(provider.parameters)?provider.parameters:[]).find(parameter=>parameter.id===normalizedParameterId)||null}function normalizeAgentSettingText(value=""){return String(value||"").trim()}function normalizedParameterValue(provider={},parameterId="",value=""){const parameter=agentProviderParameter(provider,parameterId);if(!parameter){return""}const requested=normalizeAgentSettingText(value);if(provider.id===VIBE64_AGENT_PROVIDER_IDS.CODEX){return requested}const options=Array.isArray(parameter.options)?parameter.options:[];const supported=options.some(option=>normalizeAgentSettingText(option.value)===requested);if(supported){return requested}return normalizeAgentSettingText(parameter.defaultValue)}function normalizeVibe64AgentSettings(value={}){const input=value&&typeof value==="object"&&!Array.isArray(value)?value:{};const provider=agentProviderDefinition(input.providerId||input.provider);const model=normalizedParameterValue(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,input.model);return{model,providerId:provider.id,thinking:normalizedAgentThinkingValue(provider,model,input.thinking)}}function defaultVibe64AgentSettings(providerId=VIBE64_DEFAULT_AGENT_PROVIDER_ID){return normalizeVibe64AgentSettings({providerId})}function effectiveAgentParameterValue(provider={},parameterId="",value=""){const parameter=agentProviderParameter(provider,parameterId);const normalizedValue=normalizedParameterValue(provider,parameterId,value);return normalizedValue||normalizeAgentSettingText(parameter==null?void 0:parameter.defaultValue)}function effectiveAgentParameterOption(provider={},parameterId="",value=""){const parameter=agentProviderParameter(provider,parameterId);const effectiveValue=effectiveAgentParameterValue(provider,parameterId,value);return(Array.isArray(parameter==null?void 0:parameter.options)?parameter.options:[]).find(option=>normalizeAgentSettingText(option.value)===effectiveValue)||null}function supportedAgentThinkingValues(provider={},model=""){const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,model);return Array.isArray(modelOption==null?void 0:modelOption.supportedThinking)?new Set(modelOption.supportedThinking.map(value=>normalizeAgentSettingText(value))):null}function normalizedAgentThinkingValue(provider={},model="",value=""){var _a;const normalized=normalizedParameterValue(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING,value);if(provider.id===VIBE64_AGENT_PROVIDER_IDS.CODEX)return normalized;const supported=supportedAgentThinkingValues(provider,model);if(!supported||!normalized||supported.has(normalized)){return normalized}const fallback=normalizeAgentSettingText((_a=agentProviderParameter(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING))==null?void 0:_a.defaultValue);return supported.has(fallback)?fallback:""}function vibe64AgentSettingParameters(value={}){const normalized=normalizeVibe64AgentSettings(value);const provider=agentProviderDefinition(normalized.providerId);const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,normalized.model);const requestsReasoning=agentOptionRequestValue(modelOption,"reasoning",true);const supportedThinking=supportedAgentThinkingValues(provider,normalized.model);return(Array.isArray(provider.parameters)?provider.parameters:[]).flatMap(parameter=>{if(parameter.id===VIBE64_AGENT_PARAMETER_IDS.THINKING&&requestsReasoning===false){return[]}if(parameter.id!==VIBE64_AGENT_PARAMETER_IDS.THINKING||!supportedThinking){return[parameter]}return[{...parameter,options:parameter.options.filter(option=>!normalizeAgentSettingText(option.value)||supportedThinking.has(normalizeAgentSettingText(option.value)))}]})}function agentOptionRequestValue(option={},name="",fallback=true){const request=option&&typeof option.request==="object"&&!Array.isArray(option.request)?option.request:{};return Object.hasOwn(request,name)?request[name]:fallback}function displayVibe64AgentSetting(providerId="",parameterId="",value=""){const provider=agentProviderDefinition(providerId);const parameter=agentProviderParameter(provider,parameterId);const normalizedValue=normalizeAgentSettingText(value);const option=(Array.isArray(parameter==null?void 0:parameter.options)?parameter.options:[]).find(candidate=>normalizeAgentSettingText(candidate.value)===normalizedValue);return(option==null?void 0:option.label)||normalizedValue||"Automatic"}const VIBE64_AGENT_TASK_STATES=Object.freeze({COMPLETED:"completed",RUNNING:"running",STARTING:"starting",STOPPED:"stopped",STOPPING:"stopping",WAITING:"waiting"});new Set([VIBE64_AGENT_TASK_STATES.RUNNING,VIBE64_AGENT_TASK_STATES.STARTING,VIBE64_AGENT_TASK_STATES.STOPPING,VIBE64_AGENT_TASK_STATES.WAITING]);const VIBE64_AGENT_TASK_RESULT_KINDS=Object.freeze({COMPLETE:"complete",CONTINUE:"continue"});Object.freeze({additionalProperties:false,properties:{kind:{enum:Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),type:"string"},message:{description:"Normal Markdown shown to the user for this task turn.",type:"string"},report:{description:"A concise factual handoff for the main conversation when the task is complete; otherwise an empty string.",type:"string"}},required:["kind","message","report"],type:"object"});const VIBE64_ASSISTANT_ENGINE_IDS=Object.freeze({CODEX:"codex",OPENCODE:"opencode"});new Set(Object.values(VIBE64_ASSISTANT_ENGINE_IDS));const VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS=10;const VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS=160;const ATTACHMENT_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;const IMAGE_TYPES=Object.freeze({avif:"image/avif",bmp:"image/bmp",gif:"image/gif",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",webp:"image/webp"});function conversationAttachmentContentType(fileName=""){const extension=String(fileName).split(".").at(-1).toLowerCase();return Object.hasOwn(IMAGE_TYPES,extension)?IMAGE_TYPES[extension]:"application/octet-stream"}function conversationAttachmentReference(attachment={},number=1){const kind=conversationAttachmentContentType(attachment.fileName).startsWith("image/")?"Image":"File";return`[${kind} #${number}]`}function conversationAttachmentFileName(value=""){const normalized=Array.from(String(value??""),character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127?" ":character}).join("").trim();return Array.from(normalized).slice(0,VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS).join("")}function normalizeVibe64ConversationAttachments(value=[]){return(Array.isArray(value)?value:[]).slice(0,VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS).map(candidate=>{if(!candidate||typeof candidate!=="object"||Array.isArray(candidate)||typeof candidate.fileName!=="string"){return null}const fileName=conversationAttachmentFileName(candidate.fileName);if(!fileName){return null}return{...ATTACHMENT_ID_PATTERN.test(String(candidate.attachmentId||""))?{attachmentId:candidate.attachmentId}:{},.../^\[(?:Image|File) #[1-9][0-9]{0,3}\]$/u.test(candidate.reference||"")?{reference:candidate.reference}:{},fileName,...Number.isSafeInteger(candidate.size)&&candidate.size>=0?{size:candidate.size}:{}}}).filter(Boolean)}const THINKING_HEADING_PATTERN=/^thinking(?:\.{3}|…|:)?$/iu;function normalizeThinkingMessageText(value=""){const lines=String(value||"").trim().split(/\r?\n/u);while(lines.length&&THINKING_HEADING_PATTERN.test(lines[0].trim())){lines.shift()}return lines.join("\n").trim()}const CONVERSATION_LOG_REALTIME_REASONS=new Set(["integration-setup-skipped","integration-setup-completed","assistant-response-bundle","codex-app-server-agent-result","codex-app-server-agent-result-invalid","codex-app-server-agent-result-missing","codex-app-server-agent-result-provider-failed","codex-app-server-commentary","codex-app-server-final-assistant-message","codex-app-server-live-progress","codex-app-server-reasoning-summary","codex-app-server-terminal-assistant-message","codex-app-server-terminal-thinking-message","codex-app-server-terminal-user-message","codex-turn-outcome","codex-app-server-message-delivered","opencode-credential-failure","opencode-provider-failure","opencode-server-assistant-message","opencode-server-message-delivered","opencode-server-reasoning","opencode-server-tool","opencode-server-turn-idle","session-agent-message-cancelled","session-agent-message-accepted","session-agent-message-delivered","session-agent-message-failed"]);const CONVERSATION_LOG_PAGE_LIMIT=20;function normalizeConversationMessage(message={}){if(!message||typeof message!=="object"||Array.isArray(message)){return null}const role=String(message.role||"").trim();const text=role==="thinking"?normalizeThinkingMessageText(message.text):String(message.text||"").trim();if(!role||!text){return null}const attachments=normalizeVibe64ConversationAttachments(message.attachments);return{at:String(message.at||"").trim(),...attachments.length?{attachments}:{},...String(message.messageId||"").trim()?{messageId:String(message.messageId).trim()}:{},role,text}}function chronologicalConversationActivity(messages=[]){return[...messages].sort((left,right)=>String((left==null?void 0:left.at)||"").localeCompare(String((right==null?void 0:right.at)||"")))}function normalizeConversationTurn(turn={},index=0){if(!turn||typeof turn!=="object"||Array.isArray(turn)){return null}const user=normalizeConversationMessage(turn.user);const assistant=normalizeConversationMessage(turn.assistant);const normalizedCommentary=Array.isArray(turn.commentary)?turn.commentary.map(normalizeConversationMessage).filter(Boolean):[];const system=normalizeConversationMessage(turn.system);const normalizedThinking=Array.isArray(turn.thinking)?turn.thinking.map(normalizeConversationMessage).filter(Boolean):[];const activityFromMessages=Array.isArray(turn.messages)?turn.messages.map(normalizeConversationMessage).filter(message=>["commentary","thinking"].includes(message==null?void 0:message.role)):[];const activity=activityFromMessages.length?activityFromMessages:chronologicalConversationActivity([...normalizedThinking,...normalizedCommentary]);const commentary=activity.filter(message=>message.role==="commentary");const thinking=activity.filter(message=>message.role==="thinking");if(!system&&!user&&!assistant&&!activity.length){return null}return{assistant,commentary,messages:[system,user,...activity,assistant].filter(Boolean),...isRecord(turn.integrationSetup)?{integrationSetup:turn.integrationSetup}:{},...system?{system}:{},thinking,turnId:String(turn.turnId||index+1).trim(),user}}function isRecord(value){return Boolean(value&&typeof value==="object"&&!Array.isArray(value))}function normalizeConversationLog(payload={},options={}){const turns=Array.isArray(payload==null?void 0:payload.conversationLog)?payload.conversationLog:[];const normalizedTurns=turns.map((turn,index)=>normalizeConversationTurn(turn,index)).filter(Boolean);const pendingTurnIndex=options.pending===true?normalizedTurns.length-1:-1;return normalizedTurns.map((turn,index)=>{if(index===pendingTurnIndex&&turn.user&&!turn.assistant){return{...turn,pending:true}}return turn})}function normalizeConversationLogPagination(pagination={}){const source=isRecord(pagination)?pagination:{};return{beforeTurnId:String(source.beforeTurnId||"").trim(),count:Number.isFinite(Number(source.count))?Number(source.count):0,hasMoreBefore:source.hasMoreBefore===true,limit:Number.isFinite(Number(source.limit))?Number(source.limit):0,newestTurnId:String(source.newestTurnId||"").trim(),nextBeforeTurnId:String(source.nextBeforeTurnId||"").trim(),oldestTurnId:String(source.oldestTurnId||"").trim(),totalTurnCount:Number.isFinite(Number(source.totalTurnCount))?Number(source.totalTurnCount):0}}function normalizeConversationLogPage(payload={}){var _a,_b;const source=isRecord(payload)?payload:{};const conversationLog=Array.isArray(source.conversationLog)?source.conversationLog:[];const pagination=normalizeConversationLogPagination(source.pagination);return{...source,conversationLog,pagination:{...pagination,count:pagination.count||conversationLog.length,newestTurnId:pagination.newestTurnId||String(((_a=conversationLog.at(-1))==null?void 0:_a.turnId)||"").trim(),oldestTurnId:pagination.oldestTurnId||String(((_b=conversationLog[0])==null?void 0:_b.turnId)||"").trim()}}}function mergeConversationLogPages(pages=[]){const orderedTurns=[];const indexes=new Map;for(const page of Array.isArray(pages)?pages:[]){const normalized=normalizeConversationLogPage(page);for(const turn of normalized.conversationLog){const turnId=String((turn==null?void 0:turn.turnId)||"").trim();if(!turnId){orderedTurns.push(turn);continue}if(indexes.has(turnId)){orderedTurns[indexes.get(turnId)]=turn;continue}indexes.set(turnId,orderedTurns.length);orderedTurns.push(turn)}}return{conversationLog:orderedTurns}}function conversationLogReadQuery({beforeTurnId="",limit=CONVERSATION_LOG_PAGE_LIMIT}={}){return{...beforeTurnId?{beforeTurnId}:{},limit:String(limit)}}function conversationLogRealtimePatch(payload={}){const reason=String((payload==null?void 0:payload.reason)||"").trim();const patch=isRecord(payload==null?void 0:payload.conversationLogPatch)?payload.conversationLogPatch:null;if(!["assistant-response-bundle","codex-app-server-commentary","codex-app-server-final-assistant-message","codex-app-server-reasoning-summary","codex-app-server-live-progress","codex-app-server-terminal-assistant-message","codex-app-server-terminal-thinking-message","codex-app-server-terminal-user-message","codex-app-server-message-delivered","opencode-credential-failure","opencode-provider-failure","opencode-server-assistant-message","opencode-server-message-delivered","opencode-server-reasoning","opencode-server-tool"].includes(reason)||(patch==null?void 0:patch.type)!=="upsert-turn"||!isRecord(patch.turn)){return null}const assistant=normalizeConversationMessage(patch.turn.assistant);const commentary=Array.isArray(patch.turn.commentary)?patch.turn.commentary.map(normalizeConversationMessage).filter(Boolean):[];const thinking=Array.isArray(patch.turn.thinking)?patch.turn.thinking.map(normalizeConversationMessage).filter(Boolean):[];if(["codex-app-server-reasoning-summary","codex-app-server-live-progress"].includes(reason)&&(!thinking.length||assistant)){return null}if(reason==="codex-app-server-commentary"&&(!commentary.length||assistant)){return null}if(["assistant-response-bundle","codex-app-server-final-assistant-message"].includes(reason)&&!assistant){return null}return{turn:patch.turn,type:"upsert-turn"}}function applyConversationLogPatch(payload={},patch=null,options={}){var _a,_b;if((patch==null?void 0:patch.type)!=="upsert-turn"||!isRecord(patch.turn)){return null}const source=isRecord(payload)?payload:{};const turns=Array.isArray(source.conversationLog)?source.conversationLog:[];const turnId=String(patch.turn.turnId||"").trim();if(!turnId){return null}const existingIndex=turns.findIndex(turn=>String((turn==null?void 0:turn.turnId)||"").trim()===turnId);const nextTurns=(existingIndex>=0?turns.map((turn,index)=>index===existingIndex?patch.turn:turn):[...turns,patch.turn]).sort((left,right)=>String((left==null?void 0:left.turnId)||"").localeCompare(String((right==null?void 0:right.turnId)||""),void 0,{numeric:true}));const limit=Number.parseInt(String(options.limit||""),10);const limitedTurns=Number.isFinite(limit)&&limit>0?nextTurns.slice(-limit):nextTurns;const wasTrimmed=limitedTurns.length<nextTurns.length;const pagination=normalizeConversationLogPagination(source.pagination);const hasMoreBefore=pagination.hasMoreBefore||wasTrimmed;const oldestTurnId=String(((_a=limitedTurns[0])==null?void 0:_a.turnId)||"").trim();return{...source,conversationLog:limitedTurns,pagination:{...pagination,count:limitedTurns.length,hasMoreBefore,newestTurnId:String(((_b=limitedTurns.at(-1))==null?void 0:_b.turnId)||"").trim(),nextBeforeTurnId:hasMoreBefore?oldestTurnId:"",oldestTurnId}}}function sessionIsAwaitingCodex(session={}){var _a,_b;const source=session&&typeof session==="object"&&!Array.isArray(session)?session:{};return((_b=(_a=source.agentSession)==null?void 0:_a.turn)==null?void 0:_b.active)===true}function conversationLogRealtimeShouldRefresh({payload={}}={},sessionId=""){const normalizedSessionId=String(sessionId||"").trim();const changedSessionId=String(payload.sessionId||payload.entityId||"").trim();if(!normalizedSessionId||changedSessionId!==normalizedSessionId){return false}const reason=String(payload.reason||"").trim();return!reason||CONVERSATION_LOG_REALTIME_REASONS.has(reason)}function conversationLogRecoveryStateKey(session={}){var _a,_b,_c,_d;const source=session&&typeof session==="object"&&!Array.isArray(session)?session:{};return[source.sessionId,source.status,source.revision,source.updatedAt,((_b=(_a=source.agentSession)==null?void 0:_a.turn)==null?void 0:_b.active)?"active":"idle",(_d=(_c=source.agentSession)==null?void 0:_c.turn)==null?void 0:_d.id].map(value=>String(value||"").trim()).join("|")}function conversationLogCompletedTurnKey(session={}){var _a;const source=isRecord(session)?session:{};const turn=isRecord((_a=source.agentSession)==null?void 0:_a.turn)?source.agentSession.turn:{};const sessionId=String(source.sessionId||"").trim();const turnId=String(turn.id||"").trim();const revision=Number(source.revision);if(!sessionId||!turnId||turn.active!==false||!Number.isSafeInteger(revision)||revision<0){return""}return`${sessionId}|${revision}|${turnId}`}function useVibe64ConversationLog({active=true,session}={}){const paths=usePaths();const httpClient=getHttpWebClient();const queryClient=useQueryClient();const projectSlug=useVibe64ProjectSlug();const currentSession=computed(()=>readRefOrGetterValue(session)||null);const sessionId=computed(()=>{var _a;return String(((_a=currentSession.value)==null?void 0:_a.sessionId)||"").trim()});const olderPages=ref([]);const loadingMore=ref(false);const loadMoreError=ref("");const integrationActionPending=shallowRef(null);const integrationActionError=ref(null);const enabled=computed(()=>Boolean(readRefOrGetterValue(active)!==false&&sessionId.value));const sessionsApiPath=computed(()=>paths.api(VIBE64_SESSIONS_API_SUFFIX,{surface:VIBE64_SURFACE_ID}));const queryKey=computed(()=>[...vibe64ConversationLogQueryKey(VIBE64_SURFACE_ID,ROUTE_VISIBILITY_PUBLIC,sessionId.value,projectSlug.value)]);const conversationLogPath=computed(()=>sessionId.value?vibe64ConversationLogPath(sessionsApiPath.value,sessionId.value):"");const resource=useEndpointResource({enabled,fallbackLoadError:"Conversation history could not be loaded.",path:conversationLogPath,queryKey,queryOptions:{placeholderData:previousData=>previousData,refetchOnMount:false,refetchOnWindowFocus:false},readMethod:"GET",readQuery:computed(()=>conversationLogReadQuery()),refreshOnPull:true,requestRecoveryLabel:"Conversation history",realtime:null});let reloadInFlight=null;let reloadQueued=false;let recoveredErrorKey="";let realtimeCompletionKey="";async function reloadConversationLog(){if(reloadInFlight){reloadQueued=true;vibe64SessionDebugLog("client.conversationLog.reload.join",{sessionId:sessionId.value});return reloadInFlight}olderPages.value=[];loadMoreError.value="";vibe64SessionDebugLog("client.conversationLog.reload.start",{sessionId:sessionId.value});reloadInFlight=resource.reload();try{const result=await reloadInFlight;vibe64SessionDebugLog("client.conversationLog.reload.done",{sessionId:sessionId.value});return result}finally{reloadInFlight=null;if(reloadQueued){reloadQueued=false;void reloadConversationLog()}}}const realtimeSocket=useRealtimeSocket({required:false});const reconcileConversationAfterRealtimeConnect=()=>{if(enabled.value){void reloadConversationLog().catch(()=>{})}};realtimeSocket.on("connect",reconcileConversationAfterRealtimeConnect);onScopeDispose(()=>{realtimeSocket.off("connect",reconcileConversationAfterRealtimeConnect)});function applyRealtimeConversationLogPatch(payload={}){var _a;const patch=conversationLogRealtimePatch(payload);if(!patch){return false}const key=queryKey.value;const currentPayload=queryClient.getQueryData(key);const nextPayload=applyConversationLogPatch(currentPayload,patch,{limit:CONVERSATION_LOG_PAGE_LIMIT});if(!nextPayload){vibe64SessionDebugLog("client.conversationLog.patch.miss",{hasCurrentPayload:Boolean(currentPayload),patchType:String((patch==null?void 0:patch.type)||""),sessionId:sessionId.value});return false}queryClient.setQueryData(key,nextPayload);vibe64SessionDebugLog("client.conversationLog.patch.done",{patchType:String(patch.type||""),sessionId:sessionId.value,turnId:String(((_a=patch.turn)==null?void 0:_a.turnId)||"")});return true}const realtime=useRealtimeEvent({enabled,event:VIBE64_SESSION_CHANGED_EVENT,matches:context=>conversationLogRealtimeShouldRefresh(context,sessionId.value),onEvent:({payload={}}={})=>{realtimeCompletionKey=conversationLogCompletedTurnKey(payload)||realtimeCompletionKey;vibe64SessionDebugLog("client.conversationLog.realtime",{hasPatch:Boolean(conversationLogRealtimePatch(payload)),reason:String(payload.reason||""),sessionId:sessionId.value});if(applyRealtimeConversationLogPatch(payload)){return null}return reloadConversationLog()}});const recoveryStateKey=computed(()=>conversationLogRecoveryStateKey(currentSession.value));const completedTurnKey=computed(()=>conversationLogCompletedTurnKey(currentSession.value));watch(completedTurnKey,key=>{if(!enabled.value||!key){return}if(key===realtimeCompletionKey){realtimeCompletionKey="";return}vibe64SessionDebugLog("client.conversationLog.completion.reconcile",{completedTurnKey:key,sessionId:sessionId.value});void reloadConversationLog().catch(()=>{})},{flush:"post"});const recoveryErrorKey=computed(()=>[enabled.value?"enabled":"disabled",sessionId.value,recoveryStateKey.value,resource.loadError.value].join("|"));watch(recoveryErrorKey,()=>{const loadError=String(resource.loadError.value||"").trim();if(!enabled.value||!loadError){recoveredErrorKey="";return}const key=recoveryErrorKey.value;if(recoveredErrorKey===key){return}recoveredErrorKey=key;vibe64SessionDebugLog("client.conversationLog.recover.start",{error:loadError,recoveryStateKey:recoveryStateKey.value,sessionId:sessionId.value});void reloadConversationLog().then(()=>{vibe64SessionDebugLog("client.conversationLog.recover.done",{recoveryStateKey:recoveryStateKey.value,sessionId:sessionId.value})}).catch(error=>{vibe64SessionDebugLog("client.conversationLog.recover.error",{error:vibe64SessionDebugError(error),recoveryStateKey:recoveryStateKey.value,sessionId:sessionId.value})})},{flush:"post"});const latestPage=computed(()=>normalizeConversationLogPage(resource.data.value||{}));const loadedPages=computed(()=>[...olderPages.value,latestPage.value]);const oldestLoadedPage=computed(()=>olderPages.value[0]||latestPage.value);const hasMoreBefore=computed(()=>{var _a;return Boolean(normalizeConversationLogPagination((_a=oldestLoadedPage.value)==null?void 0:_a.pagination).hasMoreBefore)});const turns=computed(()=>normalizeConversationLog(mergeConversationLogPages(loadedPages.value),{pending:sessionIsAwaitingCodex(currentSession.value)}));const visible=computed(()=>Boolean(resource.isLoading.value||resource.loadError.value||turns.value.length));async function loadMoreConversationLog({complete}={}){var _a,_b,_c,_d;const finish=result=>{if(typeof complete==="function"){complete(result)}};const beforeTurnId=normalizeConversationLogPagination((_a=oldestLoadedPage.value)==null?void 0:_a.pagination).oldestTurnId||String(((_b=turns.value[0])==null?void 0:_b.turnId)||"").trim();if(!enabled.value||!conversationLogPath.value||!hasMoreBefore.value||loadingMore.value||!beforeTurnId){finish({changed:false,loaded:false});return false}loadingMore.value=true;loadMoreError.value="";vibe64SessionDebugLog("client.conversationLog.loadMore.start",{beforeTurnId,sessionId:sessionId.value});try{const page=await httpClient.request(conversationLogPath.value,{method:"GET",query:conversationLogReadQuery({beforeTurnId,limit:CONVERSATION_LOG_PAGE_LIMIT})});const previousOldestTurnId=String(((_c=turns.value[0])==null?void 0:_c.turnId)||"").trim();olderPages.value=[normalizeConversationLogPage(page),...olderPages.value];const nextOldestTurnId=String(((_d=turns.value[0])==null?void 0:_d.turnId)||"").trim();const changed=Boolean(nextOldestTurnId&&nextOldestTurnId!==previousOldestTurnId);vibe64SessionDebugLog("client.conversationLog.loadMore.done",{beforeTurnId,sessionId:sessionId.value,turnCount:Array.isArray(page==null?void 0:page.conversationLog)?page.conversationLog.length:0});finish({changed,loaded:true});return true}catch(error){loadMoreError.value=String((error==null?void 0:error.message)||error||"Older conversation history could not be loaded.");vibe64SessionDebugLog("client.conversationLog.loadMore.error",{beforeTurnId,error:vibe64SessionDebugError(error),sessionId:sessionId.value});finish({changed:false,loaded:false});return false}finally{loadingMore.value=false}}const integrationConnections=shallowRef({});function connectIntegrationRequest(request={}){return runIntegrationRequestAction(request,"connect")}function checkIntegrationRequest(request={}){return runIntegrationRequestAction(request,"status")}function cancelIntegrationRequest(request={}){return runIntegrationRequestAction(request,"cancel")}function skipIntegrationRequest(request={}){return runIntegrationRequestAction(request,"skip")}function resumeIntegrationRequest(request={}){return runIntegrationRequestAction(request,"resume")}async function runIntegrationRequestAction(request,action){var _a,_b,_c,_d,_e;const turn=turns.value.find(entry=>entry.turnId===request.turnId);if(!enabled.value||request.sessionId!==sessionId.value||integrationActionPending.value||((_a=turn==null?void 0:turn.integrationSetup)==null?void 0:_a.outcome)!==(action==="resume"?"completed":"pending")||turn.integrationSetup.requestId!==request.requestId)return false;const selection={sessionId:sessionId.value,turnId:request.turnId,requestId:request.requestId};integrationActionPending.value=selection;integrationActionError.value=null;try{if(["connect","cancel","status"].includes(action)){const path=vibe64SessionPath(sessionsApiPath.value,selection.sessionId,"/integrations");const config=await httpClient.request(path);if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false;const integrationId=turn.integrationSetup.integrationId;const integration=(_c=(_b=config==null?void 0:config.configuration)==null?void 0:_b.integrations)==null?void 0:_c[integrationId];if(!integration)throw new Error("Choose Configure to set up this integration first.");if(connectorDefinitions.some(provider=>{var _a2;return provider.id===integration.provider&&(provider.configurationOnly||((_a2=provider.configurationOnlyForSettings)==null?void 0:_a2.call(provider,(integration==null?void 0:integration.settings)||{})))})){integrationConnections.value={...integrationConnections.value,[selection.requestId]:{status:"configuration-only"}};return true}if(integration.accountMode==="per-user")throw new Error("Each app user connects their account inside the application. Choose Configure for setup instructions.");const endpoint=`${path}/${encodeURIComponent(integrationId)}/setup`;const previous=integrationConnections.value[selection.requestId];if(action==="cancel"&&!(previous==null?void 0:previous.attemptId))return false;let connection=await httpClient.request(endpoint,{method:"POST",body:{operation:action,...action==="cancel"?{attemptId:previous.attemptId}:{setupRequest:{turnId:selection.turnId,requestId:selection.requestId,configurationHash:config.baseHash}}}});if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false;if(action==="cancel"){connection=await httpClient.request(endpoint,{method:"POST",body:{operation:"status"}});if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false}integrationConnections.value={...integrationConnections.value,[selection.requestId]:connection};if(((_d=connection.integrationSetup)==null?void 0:_d.outcome)==="completed"&&((_e=connection.integrationSetup.continuation)==null?void 0:_e.status)!=="accepted"){const resumed=await httpClient.request(vibe64SessionPath(sessionsApiPath.value,selection.sessionId,"/integration-setup/resume"),{method:"POST",body:{turnId:selection.turnId,requestId:selection.requestId}});if((resumed==null?void 0:resumed.ok)!==true)throw new Error((resumed==null?void 0:resumed.error)||"Assistant continuation is not yet confirmed.")}if(integrationActionPending.value===selection&&sessionId.value===selection.sessionId)await reloadConversationLog();return true}const result=await httpClient.request(vibe64SessionPath(sessionsApiPath.value,selection.sessionId,`/integration-setup/${action}`),{method:"POST",body:{turnId:selection.turnId,requestId:selection.requestId}});if((result==null?void 0:result.ok)!==true)throw new Error((result==null?void 0:result.error)||"Could not update integration setup.");if(integrationActionPending.value===selection&&sessionId.value===selection.sessionId){await reloadConversationLog()}return true}catch(error){if(sessionId.value===selection.sessionId&&integrationActionPending.value===selection){integrationActionError.value={turnId:selection.turnId,message:String((error==null?void 0:error.message)||"Could not update integration setup.")};if(action==="resume"||action==="connect"||action==="status")await reloadConversationLog()}return false}finally{if(sessionId.value===selection.sessionId&&integrationActionPending.value===selection){integrationActionPending.value=null}}}onScopeDispose(()=>{integrationActionPending.value=null});watch([sessionId,projectSlug],()=>{integrationActionPending.value=null;integrationActionError.value=null;integrationConnections.value={};olderPages.value=[];loadMoreError.value=""});return{integrationConnections,connectIntegrationRequest,checkIntegrationRequest,cancelIntegrationRequest,integrationActionPending,integrationActionError,skipIntegrationRequest,resumeIntegrationRequest,error:resource.loadError,hasMoreBefore,loadMore:loadMoreConversationLog,loadMoreError,loading:resource.isLoading,loadingMore,reload:reloadConversationLog,realtime,turns,visible}}export{VIBE64_AGENT_PROVIDERS as V,normalizeVibe64ConversationAttachments as a,defaultVibe64AgentSettings as b,VIBE64_DEFAULT_AGENT_PROVIDER_ID as c,displayVibe64AgentSetting as d,conversationAttachmentReference as e,conversationAttachmentContentType as f,normalizeThinkingMessageText as g,vibe64AgentExecutionProfileAuditSnapshot as h,normalizeVibe64AgentSettings as n,useVibe64ConversationLog as u,vibe64AgentSettingParameters as v};
|
|
1
|
+
import{c as connectorDefinitions}from"./definitions-ChGXm26a.js";import{P as usePaths,dc as useQueryClient,D as useEndpointResource,A as computed,aW as useRealtimeSocket,ag as onScopeDispose,M as useRealtimeEvent,H as watch,aP as shallowRef,B as ref,L as getHttpWebClient,Q as VIBE64_SURFACE_ID,R as ROUTE_VISIBILITY_PUBLIC}from"./index-C4KnwA0g.js";import{u as useVibe64ProjectSlug}from"./useVibe64ProjectScope-DcDkjbLT.js";import{V as VIBE64_SESSION_CHANGED_EVENT,v as vibe64SessionPath,c as VIBE64_SESSIONS_API_SUFFIX,P as vibe64ConversationLogQueryKey,Q as vibe64ConversationLogPath}from"./vibe64SessionRequestConfig-uGWcyQY6.js";import{r as readRefOrGetterValue}from"./vueRefOrGetterValue-CV9c3oBd.js";import{a as vibe64SessionDebugLog,b as vibe64SessionDebugError}from"./vibe64SessionPanelModel-DDaXjAJ_.js";const VIBE64_AGENT_EXECUTION_PROFILE_IDS=Object.freeze({ECONOMY:"economy"});const VIBE64_AGENT_EXECUTION_WORKLOAD_IDS=Object.freeze({COMMIT_TITLE:"commit_title",CONVERSATION_SUMMARY:"conversation_summary",DATABASE_ASSISTANT:"database_assistant",PROMPT_HINT:"prompt_hint",SESSION_TITLE:"session_title",SOURCE_EXPLANATION:"source_explanation"});Object.freeze({[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.COMMIT_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.CONVERSATION_SUMMARY]:Object.freeze({maxInputCharacters:2e5,maxOutputCharacters:16e3,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.DATABASE_ASSISTANT]:Object.freeze({maxInputCharacters:5e5,maxOutputCharacters:16e3,timeoutMs:18e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.PROMPT_HINT]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:2500,timeoutMs:12e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SESSION_TITLE]:Object.freeze({maxInputCharacters:24e3,maxOutputCharacters:512,timeoutMs:3e4}),[VIBE64_AGENT_EXECUTION_WORKLOAD_IDS.SOURCE_EXPLANATION]:Object.freeze({maxInputCharacters:1e5,maxOutputCharacters:32e3,timeoutMs:18e4})});const VIBE64_AGENT_EXECUTION_TOOL_POLICIES=Object.freeze({NONE:"none"});const VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS=Object.freeze({MAX_INPUT_CHARACTERS:5e5,MAX_OUTPUT_CHARACTERS:32e3,MAX_TIMEOUT_MS:3e5});const VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES=Object.freeze({INVALID:"vibe64_agent_execution_profile_invalid",MODEL_UNAVAILABLE:"vibe64_agent_execution_profile_model_unavailable",POLICY_UNENFORCEABLE:"vibe64_agent_execution_profile_policy_unenforceable",PROFILE_UNKNOWN:"vibe64_agent_execution_profile_unknown",REASONING_UNSUPPORTED:"vibe64_agent_execution_profile_reasoning_unsupported",UNBOUNDED:"vibe64_agent_execution_profile_unbounded",UNSAFE:"vibe64_agent_execution_profile_unsafe",WORKLOAD_UNSUPPORTED:"vibe64_agent_execution_profile_workload_unsupported"});const VIBE64_AGENT_EXECUTION_PROFILE_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_PROFILE_IDS));const VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES=new Set(Object.values(VIBE64_AGENT_EXECUTION_WORKLOAD_IDS));class Vibe64AgentExecutionProfileError extends Error{constructor(code,message,details={}){super(message);this.name="Vibe64AgentExecutionProfileError";this.code=code;this.details=Object.freeze({...details});for(const[name,value]of Object.entries(this.details)){if(!["code","details","message","name"].includes(name)){this[name]=value}}}}function executionProfileError(code,message,details={}){return new Vibe64AgentExecutionProfileError(code,message,details)}function isPlainRecord(value){if(!value||typeof value!=="object"||Array.isArray(value)){return false}const prototype=Object.getPrototypeOf(value);return prototype===Object.prototype||prototype===null}function requiredRecord(value,fieldName){if(!isPlainRecord(value)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be an object.`,{field:fieldName})}return value}function requireOnlyFields(value,allowedFields,fieldName){const allowed=new Set(allowedFields);const unexpected=Object.keys(value).find(name=>!allowed.has(name));if(unexpected){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} contains an unsupported field: ${unexpected}.`,{field:`${fieldName}.${unexpected}`})}}function requiredText(value,fieldName,maximumLength=256){if(typeof value!=="string"){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be text.`,{field:fieldName})}const normalized=value.trim();if(!normalized||normalized.length>maximumLength){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} is invalid.`,{field:fieldName})}return normalized}function requiredBoolean(value,fieldName){if(typeof value!=="boolean"){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,`Execution profile ${fieldName} must be a boolean.`,{field:fieldName})}return value}function requireSafeFalse(value,fieldName){if(requiredBoolean(value,fieldName)!==false){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,`Execution profile ${fieldName} must be disabled.`,{field:fieldName})}return false}function boundedPositiveInteger(value,fieldName,maximum){if(!Number.isSafeInteger(value)||value<=0||value>maximum){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,`Execution profile ${fieldName} must be a positive integer no greater than ${maximum}.`,{field:fieldName,maximum})}return value}function requiredLimits(value){if(!isPlainRecord(value)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNBOUNDED,"Execution profile limits are required.",{field:"limits"})}return value}function normalizeProfileId(value){const profileId=requiredText(value,"profileId",64);if(!VIBE64_AGENT_EXECUTION_PROFILE_VALUES.has(profileId)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.PROFILE_UNKNOWN,`Unknown execution profile: ${profileId}.`,{profileId})}return profileId}function normalizeWorkloadId(value){const workloadId=requiredText(value,"workloadId",64);if(!VIBE64_AGENT_EXECUTION_WORKLOAD_VALUES.has(workloadId)){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.WORKLOAD_UNSUPPORTED,`Unsupported execution profile workload: ${workloadId}.`,{workloadId})}return workloadId}function normalizedExecutionProfileRequest(input){return Object.freeze({profileId:normalizeProfileId(input.profileId),workloadId:normalizeWorkloadId(input.workloadId)})}function defineVibe64AgentExecutionProfileResolution(value){const input=requiredRecord(value,"resolution");const executionProfile=normalizedExecutionProfileRequest(input);const request=requiredRecord(input.request,"request policy");const policy=requiredRecord(input.policy,"tool policy");const limits=requiredLimits(input.limits);requireOnlyFields(request,["allowProviderModelFallback","reasoning","summary"],"request");requireOnlyFields(policy,["environmentAccess","networkAccess","repositoryWrite","tools"],"policy");requireOnlyFields(limits,["maxInputCharacters","maxOutputCharacters","timeoutMs"],"limits");const reasoning=requiredBoolean(request.reasoning,"request.reasoning");if(typeof input.thinking!=="string"){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,"Execution profile thinking must be text.",{field:"thinking"})}const thinking=input.thinking.trim();if(reasoning&&!thinking||!reasoning&&thinking){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,"Execution profile thinking must agree with its reasoning request.",{field:"thinking"})}if(thinking.length>64){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.INVALID,"Execution profile thinking is invalid.",{field:"thinking"})}if(policy.tools!==VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE){throw executionProfileError(VIBE64_AGENT_EXECUTION_PROFILE_ERROR_CODES.UNSAFE,"Execution profile tools must be disabled.",{field:"policy.tools"})}return Object.freeze({limits:Object.freeze({maxInputCharacters:boundedPositiveInteger(limits.maxInputCharacters,"limits.maxInputCharacters",VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_INPUT_CHARACTERS),maxOutputCharacters:boundedPositiveInteger(limits.maxOutputCharacters,"limits.maxOutputCharacters",VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_OUTPUT_CHARACTERS),timeoutMs:boundedPositiveInteger(limits.timeoutMs,"limits.timeoutMs",VIBE64_AGENT_EXECUTION_PROFILE_LIMIT_CEILINGS.MAX_TIMEOUT_MS)}),model:requiredText(input.model,"model"),policy:Object.freeze({environmentAccess:requireSafeFalse(policy.environmentAccess,"policy.environmentAccess"),networkAccess:requireSafeFalse(policy.networkAccess,"policy.networkAccess"),repositoryWrite:requireSafeFalse(policy.repositoryWrite,"policy.repositoryWrite"),tools:VIBE64_AGENT_EXECUTION_TOOL_POLICIES.NONE}),profileId:executionProfile.profileId,providerId:requiredText(input.providerId,"providerId",64),request:Object.freeze({allowProviderModelFallback:requireSafeFalse(request.allowProviderModelFallback,"request.allowProviderModelFallback"),reasoning,summary:requireSafeFalse(request.summary,"request.summary")}),revision:requiredText(input.revision,"revision",128),thinking,workloadId:executionProfile.workloadId})}function vibe64AgentExecutionProfileAuditSnapshot(value){return defineVibe64AgentExecutionProfileResolution(value)}const VIBE64_AGENT_PROVIDER_IDS=Object.freeze({CLAUDE:"claude",CODEX:"codex",OPENCODE:"opencode"});const VIBE64_AGENT_PROVIDER_UNKNOWN_CODE="vibe64_agent_provider_unknown";const VIBE64_AGENT_PARAMETER_IDS=Object.freeze({MODEL:"model",THINKING:"thinking"});const VIBE64_DEFAULT_AGENT_PROVIDER_ID=VIBE64_AGENT_PROVIDER_IDS.CODEX;const VIBE64_CODEX_SOL_MODEL="gpt-5.6-sol";const VIBE64_CODEX_GPT_5_5_MODEL="gpt-5.5";const VIBE64_CODEX_DEFAULT_MODEL=VIBE64_CODEX_SOL_MODEL;const VIBE64_CODEX_DEFAULT_THINKING="xhigh";const VIBE64_CODEX_SPARK_MODEL="gpt-5.3-codex-spark";const VIBE64_CODEX_STANDARD_THINKING_VALUES=Object.freeze(["low","medium","high","xhigh"]);const VIBE64_CODEX_SOL_THINKING_VALUES=Object.freeze([...VIBE64_CODEX_STANDARD_THINKING_VALUES,"max"]);const VIBE64_AGENT_PROVIDERS=Object.freeze([Object.freeze({executionProfiles:Object.freeze([VIBE64_AGENT_EXECUTION_PROFILE_IDS.ECONOMY]),id:VIBE64_AGENT_PROVIDER_IDS.CODEX,implemented:true,label:"Codex",parameters:Object.freeze([Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.MODEL,defaultValue:VIBE64_CODEX_DEFAULT_MODEL,label:"Model",options:Object.freeze([Object.freeze({label:"Automatic (GPT-5.6 Sol)",value:""}),Object.freeze({label:"GPT-5.6 Sol",supportedThinking:VIBE64_CODEX_SOL_THINKING_VALUES,value:VIBE64_CODEX_DEFAULT_MODEL}),Object.freeze({label:"GPT-5.5",supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_GPT_5_5_MODEL}),Object.freeze({label:"Codex Spark",request:Object.freeze({summary:false}),supportedThinking:VIBE64_CODEX_STANDARD_THINKING_VALUES,value:VIBE64_CODEX_SPARK_MODEL})])}),Object.freeze({id:VIBE64_AGENT_PARAMETER_IDS.THINKING,defaultValue:VIBE64_CODEX_DEFAULT_THINKING,label:"Thinking",options:Object.freeze([Object.freeze({label:"Automatic",value:""}),Object.freeze({label:"Low",value:"low"}),Object.freeze({label:"Medium",value:"medium"}),Object.freeze({label:"High",value:"high"}),Object.freeze({label:"X High",value:"xhigh"}),Object.freeze({label:"Max",value:"max"})])})])}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_AGENT_PROVIDER_IDS.CLAUDE,implemented:false,label:"Claude",parameters:Object.freeze([])}),Object.freeze({executionProfiles:Object.freeze([]),id:VIBE64_AGENT_PROVIDER_IDS.OPENCODE,implemented:false,label:"OpenCode",parameters:Object.freeze([])})]);function agentProviderDefinition(providerId=""){const normalizedProviderId=normalizeAgentSettingText(providerId)||VIBE64_DEFAULT_AGENT_PROVIDER_ID;const provider=VIBE64_AGENT_PROVIDERS.find(candidate=>candidate.id===normalizedProviderId);if(provider){return provider}const error=new Error(`Unknown assistant provider: ${normalizedProviderId}.`);error.code=VIBE64_AGENT_PROVIDER_UNKNOWN_CODE;error.providerId=normalizedProviderId;throw error}function agentProviderParameter(provider={},parameterId=""){const normalizedParameterId=normalizeAgentSettingText(parameterId);return(Array.isArray(provider.parameters)?provider.parameters:[]).find(parameter=>parameter.id===normalizedParameterId)||null}function normalizeAgentSettingText(value=""){return String(value||"").trim()}function normalizedParameterValue(provider={},parameterId="",value=""){const parameter=agentProviderParameter(provider,parameterId);if(!parameter){return""}const requested=normalizeAgentSettingText(value);if(provider.id===VIBE64_AGENT_PROVIDER_IDS.CODEX){return requested}const options=Array.isArray(parameter.options)?parameter.options:[];const supported=options.some(option=>normalizeAgentSettingText(option.value)===requested);if(supported){return requested}return normalizeAgentSettingText(parameter.defaultValue)}function normalizeVibe64AgentSettings(value={}){const input=value&&typeof value==="object"&&!Array.isArray(value)?value:{};const provider=agentProviderDefinition(input.providerId||input.provider);const model=normalizedParameterValue(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,input.model);return{model,providerId:provider.id,thinking:normalizedAgentThinkingValue(provider,model,input.thinking)}}function defaultVibe64AgentSettings(providerId=VIBE64_DEFAULT_AGENT_PROVIDER_ID){return normalizeVibe64AgentSettings({providerId})}function effectiveAgentParameterValue(provider={},parameterId="",value=""){const parameter=agentProviderParameter(provider,parameterId);const normalizedValue=normalizedParameterValue(provider,parameterId,value);return normalizedValue||normalizeAgentSettingText(parameter==null?void 0:parameter.defaultValue)}function effectiveAgentParameterOption(provider={},parameterId="",value=""){const parameter=agentProviderParameter(provider,parameterId);const effectiveValue=effectiveAgentParameterValue(provider,parameterId,value);return(Array.isArray(parameter==null?void 0:parameter.options)?parameter.options:[]).find(option=>normalizeAgentSettingText(option.value)===effectiveValue)||null}function supportedAgentThinkingValues(provider={},model=""){const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,model);return Array.isArray(modelOption==null?void 0:modelOption.supportedThinking)?new Set(modelOption.supportedThinking.map(value=>normalizeAgentSettingText(value))):null}function normalizedAgentThinkingValue(provider={},model="",value=""){var _a;const normalized=normalizedParameterValue(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING,value);if(provider.id===VIBE64_AGENT_PROVIDER_IDS.CODEX)return normalized;const supported=supportedAgentThinkingValues(provider,model);if(!supported||!normalized||supported.has(normalized)){return normalized}const fallback=normalizeAgentSettingText((_a=agentProviderParameter(provider,VIBE64_AGENT_PARAMETER_IDS.THINKING))==null?void 0:_a.defaultValue);return supported.has(fallback)?fallback:""}function vibe64AgentSettingParameters(value={}){const normalized=normalizeVibe64AgentSettings(value);const provider=agentProviderDefinition(normalized.providerId);const modelOption=effectiveAgentParameterOption(provider,VIBE64_AGENT_PARAMETER_IDS.MODEL,normalized.model);const requestsReasoning=agentOptionRequestValue(modelOption,"reasoning",true);const supportedThinking=supportedAgentThinkingValues(provider,normalized.model);return(Array.isArray(provider.parameters)?provider.parameters:[]).flatMap(parameter=>{if(parameter.id===VIBE64_AGENT_PARAMETER_IDS.THINKING&&requestsReasoning===false){return[]}if(parameter.id!==VIBE64_AGENT_PARAMETER_IDS.THINKING||!supportedThinking){return[parameter]}return[{...parameter,options:parameter.options.filter(option=>!normalizeAgentSettingText(option.value)||supportedThinking.has(normalizeAgentSettingText(option.value)))}]})}function agentOptionRequestValue(option={},name="",fallback=true){const request=option&&typeof option.request==="object"&&!Array.isArray(option.request)?option.request:{};return Object.hasOwn(request,name)?request[name]:fallback}function displayVibe64AgentSetting(providerId="",parameterId="",value=""){const provider=agentProviderDefinition(providerId);const parameter=agentProviderParameter(provider,parameterId);const normalizedValue=normalizeAgentSettingText(value);const option=(Array.isArray(parameter==null?void 0:parameter.options)?parameter.options:[]).find(candidate=>normalizeAgentSettingText(candidate.value)===normalizedValue);return(option==null?void 0:option.label)||normalizedValue||"Automatic"}const VIBE64_AGENT_TASK_STATES=Object.freeze({COMPLETED:"completed",RUNNING:"running",STARTING:"starting",STOPPED:"stopped",STOPPING:"stopping",WAITING:"waiting"});new Set([VIBE64_AGENT_TASK_STATES.RUNNING,VIBE64_AGENT_TASK_STATES.STARTING,VIBE64_AGENT_TASK_STATES.STOPPING,VIBE64_AGENT_TASK_STATES.WAITING]);const VIBE64_AGENT_TASK_RESULT_KINDS=Object.freeze({COMPLETE:"complete",CONTINUE:"continue"});Object.freeze({additionalProperties:false,properties:{kind:{enum:Object.values(VIBE64_AGENT_TASK_RESULT_KINDS),type:"string"},message:{description:"Normal Markdown shown to the user for this task turn.",type:"string"},report:{description:"A concise factual handoff for the main conversation when the task is complete; otherwise an empty string.",type:"string"}},required:["kind","message","report"],type:"object"});const VIBE64_ASSISTANT_ENGINE_IDS=Object.freeze({CODEX:"codex",OPENCODE:"opencode"});new Set(Object.values(VIBE64_ASSISTANT_ENGINE_IDS));const VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS=10;const VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS=160;const ATTACHMENT_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;const IMAGE_TYPES=Object.freeze({avif:"image/avif",bmp:"image/bmp",gif:"image/gif",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",webp:"image/webp"});function conversationAttachmentContentType(fileName=""){const extension=String(fileName).split(".").at(-1).toLowerCase();return Object.hasOwn(IMAGE_TYPES,extension)?IMAGE_TYPES[extension]:"application/octet-stream"}function conversationAttachmentReference(attachment={},number=1){const kind=conversationAttachmentContentType(attachment.fileName).startsWith("image/")?"Image":"File";return`[${kind} #${number}]`}function conversationAttachmentFileName(value=""){const normalized=Array.from(String(value??""),character=>{const codePoint=character.codePointAt(0);return codePoint<=31||codePoint===127?" ":character}).join("").trim();return Array.from(normalized).slice(0,VIBE64_CONVERSATION_ATTACHMENT_FILE_NAME_MAX_CHARACTERS).join("")}function normalizeVibe64ConversationAttachments(value=[]){return(Array.isArray(value)?value:[]).slice(0,VIBE64_CONVERSATION_ATTACHMENT_MAX_ITEMS).map(candidate=>{if(!candidate||typeof candidate!=="object"||Array.isArray(candidate)||typeof candidate.fileName!=="string"){return null}const fileName=conversationAttachmentFileName(candidate.fileName);if(!fileName){return null}return{...ATTACHMENT_ID_PATTERN.test(String(candidate.attachmentId||""))?{attachmentId:candidate.attachmentId}:{},.../^\[(?:Image|File) #[1-9][0-9]{0,3}\]$/u.test(candidate.reference||"")?{reference:candidate.reference}:{},fileName,...Number.isSafeInteger(candidate.size)&&candidate.size>=0?{size:candidate.size}:{}}}).filter(Boolean)}const THINKING_HEADING_PATTERN=/^thinking(?:\.{3}|…|:)?$/iu;function normalizeThinkingMessageText(value=""){const lines=String(value||"").trim().split(/\r?\n/u);while(lines.length&&THINKING_HEADING_PATTERN.test(lines[0].trim())){lines.shift()}return lines.join("\n").trim()}const CONVERSATION_LOG_REALTIME_REASONS=new Set(["integration-setup-skipped","integration-setup-completed","assistant-response-bundle","codex-app-server-agent-result","codex-app-server-agent-result-invalid","codex-app-server-agent-result-missing","codex-app-server-agent-result-provider-failed","codex-app-server-commentary","codex-app-server-final-assistant-message","codex-app-server-live-progress","codex-app-server-reasoning-summary","codex-app-server-terminal-assistant-message","codex-app-server-terminal-thinking-message","codex-app-server-terminal-user-message","codex-turn-outcome","codex-app-server-message-delivered","opencode-credential-failure","opencode-provider-failure","opencode-server-assistant-message","opencode-server-message-delivered","opencode-server-reasoning","opencode-server-tool","opencode-server-turn-idle","session-agent-message-cancelled","session-agent-message-accepted","session-agent-message-delivered","session-agent-message-failed"]);const CONVERSATION_LOG_PAGE_LIMIT=20;function normalizeConversationMessage(message={}){if(!message||typeof message!=="object"||Array.isArray(message)){return null}const role=String(message.role||"").trim();const text=role==="thinking"?normalizeThinkingMessageText(message.text):String(message.text||"").trim();if(!role||!text){return null}const attachments=normalizeVibe64ConversationAttachments(message.attachments);return{at:String(message.at||"").trim(),...attachments.length?{attachments}:{},...String(message.messageId||"").trim()?{messageId:String(message.messageId).trim()}:{},role,text}}function chronologicalConversationActivity(messages=[]){return[...messages].sort((left,right)=>String((left==null?void 0:left.at)||"").localeCompare(String((right==null?void 0:right.at)||"")))}function normalizeConversationTurn(turn={},index=0){if(!turn||typeof turn!=="object"||Array.isArray(turn)){return null}const user=normalizeConversationMessage(turn.user);const assistant=normalizeConversationMessage(turn.assistant);const normalizedCommentary=Array.isArray(turn.commentary)?turn.commentary.map(normalizeConversationMessage).filter(Boolean):[];const system=normalizeConversationMessage(turn.system);const normalizedThinking=Array.isArray(turn.thinking)?turn.thinking.map(normalizeConversationMessage).filter(Boolean):[];const activityFromMessages=Array.isArray(turn.messages)?turn.messages.map(normalizeConversationMessage).filter(message=>["commentary","thinking"].includes(message==null?void 0:message.role)):[];const activity=activityFromMessages.length?activityFromMessages:chronologicalConversationActivity([...normalizedThinking,...normalizedCommentary]);const commentary=activity.filter(message=>message.role==="commentary");const thinking=activity.filter(message=>message.role==="thinking");if(!system&&!user&&!assistant&&!activity.length){return null}return{assistant,commentary,messages:[system,user,...activity,assistant].filter(Boolean),...isRecord(turn.integrationSetup)?{integrationSetup:turn.integrationSetup}:{},...system?{system}:{},thinking,turnId:String(turn.turnId||index+1).trim(),user}}function isRecord(value){return Boolean(value&&typeof value==="object"&&!Array.isArray(value))}function normalizeConversationLog(payload={},options={}){const turns=Array.isArray(payload==null?void 0:payload.conversationLog)?payload.conversationLog:[];const normalizedTurns=turns.map((turn,index)=>normalizeConversationTurn(turn,index)).filter(Boolean);const pendingTurnIndex=options.pending===true?normalizedTurns.length-1:-1;return normalizedTurns.map((turn,index)=>{if(index===pendingTurnIndex&&turn.user&&!turn.assistant){return{...turn,pending:true}}return turn})}function normalizeConversationLogPagination(pagination={}){const source=isRecord(pagination)?pagination:{};return{beforeTurnId:String(source.beforeTurnId||"").trim(),count:Number.isFinite(Number(source.count))?Number(source.count):0,hasMoreBefore:source.hasMoreBefore===true,limit:Number.isFinite(Number(source.limit))?Number(source.limit):0,newestTurnId:String(source.newestTurnId||"").trim(),nextBeforeTurnId:String(source.nextBeforeTurnId||"").trim(),oldestTurnId:String(source.oldestTurnId||"").trim(),totalTurnCount:Number.isFinite(Number(source.totalTurnCount))?Number(source.totalTurnCount):0}}function normalizeConversationLogPage(payload={}){var _a,_b;const source=isRecord(payload)?payload:{};const conversationLog=Array.isArray(source.conversationLog)?source.conversationLog:[];const pagination=normalizeConversationLogPagination(source.pagination);return{...source,conversationLog,pagination:{...pagination,count:pagination.count||conversationLog.length,newestTurnId:pagination.newestTurnId||String(((_a=conversationLog.at(-1))==null?void 0:_a.turnId)||"").trim(),oldestTurnId:pagination.oldestTurnId||String(((_b=conversationLog[0])==null?void 0:_b.turnId)||"").trim()}}}function mergeConversationLogPages(pages=[]){const orderedTurns=[];const indexes=new Map;for(const page of Array.isArray(pages)?pages:[]){const normalized=normalizeConversationLogPage(page);for(const turn of normalized.conversationLog){const turnId=String((turn==null?void 0:turn.turnId)||"").trim();if(!turnId){orderedTurns.push(turn);continue}if(indexes.has(turnId)){orderedTurns[indexes.get(turnId)]=turn;continue}indexes.set(turnId,orderedTurns.length);orderedTurns.push(turn)}}return{conversationLog:orderedTurns}}function conversationLogReadQuery({beforeTurnId="",limit=CONVERSATION_LOG_PAGE_LIMIT}={}){return{...beforeTurnId?{beforeTurnId}:{},limit:String(limit)}}function conversationLogRealtimePatch(payload={}){const reason=String((payload==null?void 0:payload.reason)||"").trim();const patch=isRecord(payload==null?void 0:payload.conversationLogPatch)?payload.conversationLogPatch:null;if(!["assistant-response-bundle","codex-app-server-commentary","codex-app-server-final-assistant-message","codex-app-server-reasoning-summary","codex-app-server-live-progress","codex-app-server-terminal-assistant-message","codex-app-server-terminal-thinking-message","codex-app-server-terminal-user-message","codex-app-server-message-delivered","opencode-credential-failure","opencode-provider-failure","opencode-server-assistant-message","opencode-server-message-delivered","opencode-server-reasoning","opencode-server-tool"].includes(reason)||(patch==null?void 0:patch.type)!=="upsert-turn"||!isRecord(patch.turn)){return null}const assistant=normalizeConversationMessage(patch.turn.assistant);const commentary=Array.isArray(patch.turn.commentary)?patch.turn.commentary.map(normalizeConversationMessage).filter(Boolean):[];const thinking=Array.isArray(patch.turn.thinking)?patch.turn.thinking.map(normalizeConversationMessage).filter(Boolean):[];if(["codex-app-server-reasoning-summary","codex-app-server-live-progress"].includes(reason)&&(!thinking.length||assistant)){return null}if(reason==="codex-app-server-commentary"&&(!commentary.length||assistant)){return null}if(["assistant-response-bundle","codex-app-server-final-assistant-message"].includes(reason)&&!assistant){return null}return{turn:patch.turn,type:"upsert-turn"}}function applyConversationLogPatch(payload={},patch=null,options={}){var _a,_b;if((patch==null?void 0:patch.type)!=="upsert-turn"||!isRecord(patch.turn)){return null}const source=isRecord(payload)?payload:{};const turns=Array.isArray(source.conversationLog)?source.conversationLog:[];const turnId=String(patch.turn.turnId||"").trim();if(!turnId){return null}const existingIndex=turns.findIndex(turn=>String((turn==null?void 0:turn.turnId)||"").trim()===turnId);const nextTurns=(existingIndex>=0?turns.map((turn,index)=>index===existingIndex?patch.turn:turn):[...turns,patch.turn]).sort((left,right)=>String((left==null?void 0:left.turnId)||"").localeCompare(String((right==null?void 0:right.turnId)||""),void 0,{numeric:true}));const limit=Number.parseInt(String(options.limit||""),10);const limitedTurns=Number.isFinite(limit)&&limit>0?nextTurns.slice(-limit):nextTurns;const wasTrimmed=limitedTurns.length<nextTurns.length;const pagination=normalizeConversationLogPagination(source.pagination);const hasMoreBefore=pagination.hasMoreBefore||wasTrimmed;const oldestTurnId=String(((_a=limitedTurns[0])==null?void 0:_a.turnId)||"").trim();return{...source,conversationLog:limitedTurns,pagination:{...pagination,count:limitedTurns.length,hasMoreBefore,newestTurnId:String(((_b=limitedTurns.at(-1))==null?void 0:_b.turnId)||"").trim(),nextBeforeTurnId:hasMoreBefore?oldestTurnId:"",oldestTurnId}}}function sessionIsAwaitingCodex(session={}){var _a,_b;const source=session&&typeof session==="object"&&!Array.isArray(session)?session:{};return((_b=(_a=source.agentSession)==null?void 0:_a.turn)==null?void 0:_b.active)===true}function conversationLogRealtimeShouldRefresh({payload={}}={},sessionId=""){const normalizedSessionId=String(sessionId||"").trim();const changedSessionId=String(payload.sessionId||payload.entityId||"").trim();if(!normalizedSessionId||changedSessionId!==normalizedSessionId){return false}const reason=String(payload.reason||"").trim();return!reason||CONVERSATION_LOG_REALTIME_REASONS.has(reason)}function conversationLogRecoveryStateKey(session={}){var _a,_b,_c,_d;const source=session&&typeof session==="object"&&!Array.isArray(session)?session:{};return[source.sessionId,source.status,source.revision,source.updatedAt,((_b=(_a=source.agentSession)==null?void 0:_a.turn)==null?void 0:_b.active)?"active":"idle",(_d=(_c=source.agentSession)==null?void 0:_c.turn)==null?void 0:_d.id].map(value=>String(value||"").trim()).join("|")}function conversationLogCompletedTurnKey(session={}){var _a;const source=isRecord(session)?session:{};const turn=isRecord((_a=source.agentSession)==null?void 0:_a.turn)?source.agentSession.turn:{};const sessionId=String(source.sessionId||"").trim();const turnId=String(turn.id||"").trim();const revision=Number(source.revision);if(!sessionId||!turnId||turn.active!==false||!Number.isSafeInteger(revision)||revision<0){return""}return`${sessionId}|${revision}|${turnId}`}function useVibe64ConversationLog({active=true,session}={}){const paths=usePaths();const httpClient=getHttpWebClient();const queryClient=useQueryClient();const projectSlug=useVibe64ProjectSlug();const currentSession=computed(()=>readRefOrGetterValue(session)||null);const sessionId=computed(()=>{var _a;return String(((_a=currentSession.value)==null?void 0:_a.sessionId)||"").trim()});const olderPages=ref([]);const loadingMore=ref(false);const loadMoreError=ref("");const integrationActionPending=shallowRef(null);const integrationActionError=ref(null);const enabled=computed(()=>Boolean(readRefOrGetterValue(active)!==false&&sessionId.value));const sessionsApiPath=computed(()=>paths.api(VIBE64_SESSIONS_API_SUFFIX,{surface:VIBE64_SURFACE_ID}));const queryKey=computed(()=>[...vibe64ConversationLogQueryKey(VIBE64_SURFACE_ID,ROUTE_VISIBILITY_PUBLIC,sessionId.value,projectSlug.value)]);const conversationLogPath=computed(()=>sessionId.value?vibe64ConversationLogPath(sessionsApiPath.value,sessionId.value):"");const resource=useEndpointResource({enabled,fallbackLoadError:"Conversation history could not be loaded.",path:conversationLogPath,queryKey,queryOptions:{placeholderData:previousData=>previousData,refetchOnMount:false,refetchOnWindowFocus:false},readMethod:"GET",readQuery:computed(()=>conversationLogReadQuery()),refreshOnPull:true,requestRecoveryLabel:"Conversation history",realtime:null});let reloadInFlight=null;let reloadQueued=false;let recoveredErrorKey="";let realtimeCompletionKey="";async function reloadConversationLog(){if(reloadInFlight){reloadQueued=true;vibe64SessionDebugLog("client.conversationLog.reload.join",{sessionId:sessionId.value});return reloadInFlight}olderPages.value=[];loadMoreError.value="";vibe64SessionDebugLog("client.conversationLog.reload.start",{sessionId:sessionId.value});reloadInFlight=resource.reload();try{const result=await reloadInFlight;vibe64SessionDebugLog("client.conversationLog.reload.done",{sessionId:sessionId.value});return result}finally{reloadInFlight=null;if(reloadQueued){reloadQueued=false;void reloadConversationLog()}}}const realtimeSocket=useRealtimeSocket({required:false});const reconcileConversationAfterRealtimeConnect=()=>{if(enabled.value){void reloadConversationLog().catch(()=>{})}};realtimeSocket.on("connect",reconcileConversationAfterRealtimeConnect);onScopeDispose(()=>{realtimeSocket.off("connect",reconcileConversationAfterRealtimeConnect)});function applyRealtimeConversationLogPatch(payload={}){var _a;const patch=conversationLogRealtimePatch(payload);if(!patch){return false}const key=queryKey.value;const currentPayload=queryClient.getQueryData(key);const nextPayload=applyConversationLogPatch(currentPayload,patch,{limit:CONVERSATION_LOG_PAGE_LIMIT});if(!nextPayload){vibe64SessionDebugLog("client.conversationLog.patch.miss",{hasCurrentPayload:Boolean(currentPayload),patchType:String((patch==null?void 0:patch.type)||""),sessionId:sessionId.value});return false}queryClient.setQueryData(key,nextPayload);vibe64SessionDebugLog("client.conversationLog.patch.done",{patchType:String(patch.type||""),sessionId:sessionId.value,turnId:String(((_a=patch.turn)==null?void 0:_a.turnId)||"")});return true}const realtime=useRealtimeEvent({enabled,event:VIBE64_SESSION_CHANGED_EVENT,matches:context=>conversationLogRealtimeShouldRefresh(context,sessionId.value),onEvent:({payload={}}={})=>{realtimeCompletionKey=conversationLogCompletedTurnKey(payload)||realtimeCompletionKey;vibe64SessionDebugLog("client.conversationLog.realtime",{hasPatch:Boolean(conversationLogRealtimePatch(payload)),reason:String(payload.reason||""),sessionId:sessionId.value});if(applyRealtimeConversationLogPatch(payload)){return null}return reloadConversationLog()}});const recoveryStateKey=computed(()=>conversationLogRecoveryStateKey(currentSession.value));const completedTurnKey=computed(()=>conversationLogCompletedTurnKey(currentSession.value));watch(completedTurnKey,key=>{if(!enabled.value||!key){return}if(key===realtimeCompletionKey){realtimeCompletionKey="";return}vibe64SessionDebugLog("client.conversationLog.completion.reconcile",{completedTurnKey:key,sessionId:sessionId.value});void reloadConversationLog().catch(()=>{})},{flush:"post"});const recoveryErrorKey=computed(()=>[enabled.value?"enabled":"disabled",sessionId.value,recoveryStateKey.value,resource.loadError.value].join("|"));watch(recoveryErrorKey,()=>{const loadError=String(resource.loadError.value||"").trim();if(!enabled.value||!loadError){recoveredErrorKey="";return}const key=recoveryErrorKey.value;if(recoveredErrorKey===key){return}recoveredErrorKey=key;vibe64SessionDebugLog("client.conversationLog.recover.start",{error:loadError,recoveryStateKey:recoveryStateKey.value,sessionId:sessionId.value});void reloadConversationLog().then(()=>{vibe64SessionDebugLog("client.conversationLog.recover.done",{recoveryStateKey:recoveryStateKey.value,sessionId:sessionId.value})}).catch(error=>{vibe64SessionDebugLog("client.conversationLog.recover.error",{error:vibe64SessionDebugError(error),recoveryStateKey:recoveryStateKey.value,sessionId:sessionId.value})})},{flush:"post"});const latestPage=computed(()=>normalizeConversationLogPage(resource.data.value||{}));const loadedPages=computed(()=>[...olderPages.value,latestPage.value]);const oldestLoadedPage=computed(()=>olderPages.value[0]||latestPage.value);const hasMoreBefore=computed(()=>{var _a;return Boolean(normalizeConversationLogPagination((_a=oldestLoadedPage.value)==null?void 0:_a.pagination).hasMoreBefore)});const turns=computed(()=>normalizeConversationLog(mergeConversationLogPages(loadedPages.value),{pending:sessionIsAwaitingCodex(currentSession.value)}));const visible=computed(()=>Boolean(resource.isLoading.value||resource.loadError.value||turns.value.length));async function loadMoreConversationLog({complete}={}){var _a,_b,_c,_d;const finish=result=>{if(typeof complete==="function"){complete(result)}};const beforeTurnId=normalizeConversationLogPagination((_a=oldestLoadedPage.value)==null?void 0:_a.pagination).oldestTurnId||String(((_b=turns.value[0])==null?void 0:_b.turnId)||"").trim();if(!enabled.value||!conversationLogPath.value||!hasMoreBefore.value||loadingMore.value||!beforeTurnId){finish({changed:false,loaded:false});return false}loadingMore.value=true;loadMoreError.value="";vibe64SessionDebugLog("client.conversationLog.loadMore.start",{beforeTurnId,sessionId:sessionId.value});try{const page=await httpClient.request(conversationLogPath.value,{method:"GET",query:conversationLogReadQuery({beforeTurnId,limit:CONVERSATION_LOG_PAGE_LIMIT})});const previousOldestTurnId=String(((_c=turns.value[0])==null?void 0:_c.turnId)||"").trim();olderPages.value=[normalizeConversationLogPage(page),...olderPages.value];const nextOldestTurnId=String(((_d=turns.value[0])==null?void 0:_d.turnId)||"").trim();const changed=Boolean(nextOldestTurnId&&nextOldestTurnId!==previousOldestTurnId);vibe64SessionDebugLog("client.conversationLog.loadMore.done",{beforeTurnId,sessionId:sessionId.value,turnCount:Array.isArray(page==null?void 0:page.conversationLog)?page.conversationLog.length:0});finish({changed,loaded:true});return true}catch(error){loadMoreError.value=String((error==null?void 0:error.message)||error||"Older conversation history could not be loaded.");vibe64SessionDebugLog("client.conversationLog.loadMore.error",{beforeTurnId,error:vibe64SessionDebugError(error),sessionId:sessionId.value});finish({changed:false,loaded:false});return false}finally{loadingMore.value=false}}const integrationConnections=shallowRef({});function connectIntegrationRequest(request={}){return runIntegrationRequestAction(request,"connect")}function checkIntegrationRequest(request={}){return runIntegrationRequestAction(request,"status")}function cancelIntegrationRequest(request={}){return runIntegrationRequestAction(request,"cancel")}function skipIntegrationRequest(request={}){return runIntegrationRequestAction(request,"skip")}function resumeIntegrationRequest(request={}){return runIntegrationRequestAction(request,"resume")}async function runIntegrationRequestAction(request,action){var _a,_b,_c,_d,_e;const turn=turns.value.find(entry=>entry.turnId===request.turnId);if(!enabled.value||request.sessionId!==sessionId.value||integrationActionPending.value||((_a=turn==null?void 0:turn.integrationSetup)==null?void 0:_a.outcome)!==(action==="resume"?"completed":"pending")||turn.integrationSetup.requestId!==request.requestId)return false;const selection={sessionId:sessionId.value,turnId:request.turnId,requestId:request.requestId};integrationActionPending.value=selection;integrationActionError.value=null;try{if(["connect","cancel","status"].includes(action)){const path=vibe64SessionPath(sessionsApiPath.value,selection.sessionId,"/integrations");const config=await httpClient.request(path);if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false;const integrationId=turn.integrationSetup.integrationId;const integration=(_c=(_b=config==null?void 0:config.configuration)==null?void 0:_b.integrations)==null?void 0:_c[integrationId];if(!integration)throw new Error("Choose Configure to set up this integration first.");if(connectorDefinitions.some(provider=>{var _a2;return provider.id===integration.provider&&(provider.configurationOnly||((_a2=provider.configurationOnlyForSettings)==null?void 0:_a2.call(provider,(integration==null?void 0:integration.settings)||{})))})){integrationConnections.value={...integrationConnections.value,[selection.requestId]:{status:"configuration-only"}};return true}if(integration.accountMode==="per-user")throw new Error("Each app user connects their account inside the application. Choose Configure for setup instructions.");const endpoint=`${path}/${encodeURIComponent(integrationId)}/setup`;const previous=integrationConnections.value[selection.requestId];if(action==="cancel"&&!(previous==null?void 0:previous.attemptId))return false;let connection=await httpClient.request(endpoint,{method:"POST",body:{operation:action,...action==="cancel"?{attemptId:previous.attemptId}:{setupRequest:{turnId:selection.turnId,requestId:selection.requestId,configurationHash:config.baseHash}}}});if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false;if(action==="cancel"){connection=await httpClient.request(endpoint,{method:"POST",body:{operation:"status"}});if(integrationActionPending.value!==selection||sessionId.value!==selection.sessionId)return false}integrationConnections.value={...integrationConnections.value,[selection.requestId]:connection};if(((_d=connection.integrationSetup)==null?void 0:_d.outcome)==="completed"&&((_e=connection.integrationSetup.continuation)==null?void 0:_e.status)!=="accepted"){const resumed=await httpClient.request(vibe64SessionPath(sessionsApiPath.value,selection.sessionId,"/integration-setup/resume"),{method:"POST",body:{turnId:selection.turnId,requestId:selection.requestId}});if((resumed==null?void 0:resumed.ok)!==true)throw new Error((resumed==null?void 0:resumed.error)||"Assistant continuation is not yet confirmed.")}if(integrationActionPending.value===selection&&sessionId.value===selection.sessionId)await reloadConversationLog();return true}const result=await httpClient.request(vibe64SessionPath(sessionsApiPath.value,selection.sessionId,`/integration-setup/${action}`),{method:"POST",body:{turnId:selection.turnId,requestId:selection.requestId}});if((result==null?void 0:result.ok)!==true)throw new Error((result==null?void 0:result.error)||"Could not update integration setup.");if(integrationActionPending.value===selection&&sessionId.value===selection.sessionId){await reloadConversationLog()}return true}catch(error){if(sessionId.value===selection.sessionId&&integrationActionPending.value===selection){integrationActionError.value={turnId:selection.turnId,message:String((error==null?void 0:error.message)||"Could not update integration setup.")};if(action==="resume"||action==="connect"||action==="status")await reloadConversationLog()}return false}finally{if(sessionId.value===selection.sessionId&&integrationActionPending.value===selection){integrationActionPending.value=null}}}onScopeDispose(()=>{integrationActionPending.value=null});watch([sessionId,projectSlug],()=>{integrationActionPending.value=null;integrationActionError.value=null;integrationConnections.value={};olderPages.value=[];loadMoreError.value=""});return{integrationConnections,connectIntegrationRequest,checkIntegrationRequest,cancelIntegrationRequest,integrationActionPending,integrationActionError,skipIntegrationRequest,resumeIntegrationRequest,error:resource.loadError,hasMoreBefore,loadMore:loadMoreConversationLog,loadMoreError,loading:resource.isLoading,loadingMore,reload:reloadConversationLog,realtime,turns,visible}}export{VIBE64_AGENT_PROVIDERS as V,normalizeVibe64ConversationAttachments as a,defaultVibe64AgentSettings as b,VIBE64_DEFAULT_AGENT_PROVIDER_ID as c,displayVibe64AgentSetting as d,conversationAttachmentReference as e,conversationAttachmentContentType as f,normalizeThinkingMessageText as g,vibe64AgentExecutionProfileAuditSnapshot as h,normalizeVibe64AgentSettings as n,useVibe64ConversationLog as u,vibe64AgentSettingParameters as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as computed,aR as useRoute,bH as projectSlugFromRoute}from"./index-
|
|
1
|
+
import{A as computed,aR as useRoute,bH as projectSlugFromRoute}from"./index-C4KnwA0g.js";function useVibe64ProjectSlug(route=useRoute()){return computed(()=>projectSlugFromRoute(route))}export{useVibe64ProjectSlug as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as useCommand,R as ROUTE_VISIBILITY_PUBLIC,Q as VIBE64_SURFACE_ID,A as computed,B as ref,i as unref,dc as useQueryClient,P as usePaths,D as useEndpointResource,by as proxyRefs,ag as onScopeDispose,af as useUiFeedback,H as watch,M as useRealtimeEvent}from"./index-SBc6H2In.js";import{c as VIBE64_SESSIONS_API_SUFFIX,v as vibe64SessionPath,V as VIBE64_SESSION_CHANGED_EVENT,X as VIBE64_CURRENT_SESSION_API_SUFFIX,O as vibe64SessionsQueryKey,n as vibe64SessionQueryKey}from"./vibe64SessionRequestConfig-B7Llggdb.js";import{r as readRefOrGetterValue}from"./vueRefOrGetterValue-_KqAOFjr.js";import{v as vibe64RealtimeOriginPayload}from"./vibe64BrowserTabOrigin-DDSCqr3B.js";import{u as useVibe64ProjectSlug}from"./useVibe64ProjectScope-n5T5l2pY.js";import{u as useVibe64SessionSelection}from"./useVibe64SessionSelection-D1wXIWTm.js";import{a as vibe64SessionDebugLog,b as vibe64SessionDebugError,c as vibe64SessionDebugDurationMs,d as vibe64SessionDebugSummary,g as visibleVibe64Sessions,e as enrichVibe64SessionForDisplay}from"./vibe64SessionPanelModel-5UED-6V-.js";import{v as vibe64SessionStatusLabel,a as vibe64SessionStatusColor,s as shortVibe64SessionId,i as isArchivedVibe64Session,c as vibe64SessionDisplayTitle}from"./vibe64SessionViewModel-C4e2otoM.js";function useVibe64SessionDialogs({beginArchive=()=>null,finishArchive=()=>null,isSelectedSessionArchived,refreshSessionData=async()=>null,selectedSessionId,selectedSessionTitle,sessionsApiPath}={}){const archiveDialogOpen=ref(false);const archiveDialogSessionId=ref("");const archiveDialogSessionTitle=ref("");const archivingSessionId=ref("");const resolvedSessionsApiPath=computed(()=>String(readRefOrGetterValue(sessionsApiPath)||""));const archiveCommand=useCommand({access:"never",apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildRawPayload:()=>vibe64RealtimeOriginPayload(),buildCommandOptions:(_payload,{context})=>({method:"POST",path:vibe64SessionPath(resolvedSessionsApiPath.value,context==null?void 0:context.sessionId,"/archive")}),fallbackRunError:"Vibe64 session could not be archived.",messages:{error:"Vibe64 session could not be archived.",success:"Vibe64 session archived."},onRunSuccess:async response=>{var _a,_b;if((response==null?void 0:response.ok)!==true){throw new Error(((_b=(_a=response==null?void 0:response.errors)==null?void 0:_a[0])==null?void 0:_b.message)||(response==null?void 0:response.error)||"Vibe64 session could not be archived.")}},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.sessions.archive",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});function clearArchiveDialog(){archiveDialogOpen.value=false;archiveDialogSessionId.value="";archiveDialogSessionTitle.value=""}function requestArchiveSelectedSession(){if(!unref(selectedSessionId)||archivingSessionId.value||archiveCommand.isRunning||unref(isSelectedSessionArchived)){return}archiveDialogSessionId.value=unref(selectedSessionId);archiveDialogSessionTitle.value=unref(selectedSessionTitle);archiveDialogOpen.value=true}function cancelArchiveSession(){if(!archiveCommand.isRunning){clearArchiveDialog()}}async function confirmArchiveSession(){if(!archiveDialogSessionId.value||archivingSessionId.value||archiveCommand.isRunning){return false}const sessionId=archiveDialogSessionId.value;archivingSessionId.value=sessionId;clearArchiveDialog();const archiveScope=beginArchive(sessionId);let succeeded=false;try{const response=await archiveCommand.run({sessionId});succeeded=(response==null?void 0:response.ok)===true;return response}catch{return false}finally{finishArchive(sessionId,succeeded,archiveScope);if(archivingSessionId.value===sessionId){archivingSessionId.value=""}void refreshSessionData({includeList:true,reason:"archive-session"}).catch(()=>null)}}function clear(){clearArchiveDialog()}return{archive:{archiving:computed(()=>Boolean(archivingSessionId.value)),archivingSessionId,cancel:cancelArchiveSession,command:archiveCommand,confirm:confirmArchiveSession,open:archiveDialogOpen,request:requestArchiveSelectedSession,sessionId:archiveDialogSessionId,sessionTitle:archiveDialogSessionTitle},busy:computed(()=>Boolean(archivingSessionId.value)),clear}}function createVibe64CurrentSessionPublisher({onError=()=>null,publish}={}){if(typeof publish!=="function"){throw new TypeError("Current Vibe64 session publisher requires publish().")}let pendingPublication=null;let publicationChain=Promise.resolve();let lastPublishedIdentity=null;let stopped=false;function request(publication={}){if(stopped){return publicationChain}const apiPath=String((publication==null?void 0:publication.apiPath)||"");const sessionId=String((publication==null?void 0:publication.sessionId)||"").trim();pendingPublication={apiPath,identity:JSON.stringify([apiPath,sessionId]),sessionId};publicationChain=publicationChain.catch(()=>null).then(async()=>{if(stopped||!pendingPublication){return}const publication2=pendingPublication;pendingPublication=null;if(publication2.identity===lastPublishedIdentity){return}try{await publish({apiPath:publication2.apiPath,sessionId:publication2.sessionId});lastPublishedIdentity=publication2.identity}catch(error){onError(error,publication2)}});return publicationChain}function stop(){stopped=true;pendingPublication=null}return Object.freeze({request,stop})}function vibe64SessionListRefreshRequested(payload={}){var _a;return((_a=payload==null?void 0:payload.clientRefresh)==null?void 0:_a.includeList)===true}const SESSION_LIST_IGNORED_REALTIME_REASONS=new Set(["assistant-response-bundle","codex-app-server-ready","codex-app-server-agent-result","codex-app-server-agent-result-invalid","codex-app-server-agent-result-missing","codex-app-server-agent-result-provider-failed","codex-app-server-blocked","codex-app-server-commentary","codex-app-server-failed","codex-app-server-final-assistant-message","codex-app-server-live-progress","codex-app-server-prompt-injected","codex-app-server-reasoning-summary","codex-app-server-running","codex-app-server-terminal-assistant-message","codex-app-server-terminal-thinking-message","codex-app-server-terminal-user-message","codex-app-server-turn-active","codex-app-server-turn-claimed","codex-app-server-turn-finalizing","codex-app-server-turn-idle","codex-app-server-turn-state","codex-app-server-message-delivered","codex-prompt-injected","codex-context-replaced","agent-terminal-started","agent-terminal-closed","output-target-started","output-target-ready","output-target-closed","output-target-stopped"]);function sessionArchiveOperation(session){var _a;try{return JSON.parse(((_a=session==null?void 0:session.metadata)==null?void 0:_a.session_archive_operation)||"null")}catch{return{status:"failed",error:"Session archive state could not be read."}}}function sessionIdExistsInList(sessionId="",nextSessions=[]){const normalizedSessionId=String(sessionId||"").trim();return Boolean(normalizedSessionId)&&nextSessions.some(session=>session.sessionId===normalizedSessionId)}function renewedSuccessorSessionId({predecessorSessionId="",sessions=[]}={}){var _a;const predecessorId=String(predecessorSessionId||"").trim();if(!predecessorId){return""}const matches=sessions.filter(session=>{var _a2;return String(((_a2=session==null?void 0:session.metadata)==null?void 0:_a2.renewed_from)||"").trim()===predecessorId});return matches.length===1?String(((_a=matches[0])==null?void 0:_a.sessionId)||"").trim():""}function shouldPreserveSelectedSessionDuringRefresh({createSessionRunning=false,currentSessionId="",nextSessions=[],selectedSessionLoading=false,sessionListLoading=false}={}){const normalizedSessionId=String(currentSessionId||"").trim();if(!normalizedSessionId||sessionIdExistsInList(normalizedSessionId,nextSessions)){return false}return Boolean(sessionListLoading||createSessionRunning||selectedSessionLoading)}function selectedSessionIdForCurrentAlias({createSessionRunning=false,selectedSessionId="",selectedSessionLoading=false,sessionListLoaded=true,sessionListLoadError="",sessionListLoading=false,sessions=[]}={}){if(!sessionListLoaded||sessionListLoading||String(sessionListLoadError||"").trim()){return null}const normalizedSessionId=String(selectedSessionId||"").trim();if(sessionIdExistsInList(normalizedSessionId,sessions)){return normalizedSessionId}if(sessions.length>0||createSessionRunning||selectedSessionLoading){return null}return""}function sessionChangedReason(payload={}){return String((payload==null?void 0:payload.reason)||"").trim()}function sessionListRealtimeShouldRefresh({payload={}}={}){if(vibe64SessionListRefreshRequested(payload)){return true}const reason=sessionChangedReason(payload);return!reason||!SESSION_LIST_IGNORED_REALTIME_REASONS.has(reason)}function refetchEndpointResource(resource){var _a,_b;if(typeof((_a=resource==null?void 0:resource.query)==null?void 0:_a.refetch)==="function"){return resource.query.refetch({cancelRefetch:false})}return(_b=resource==null?void 0:resource.reload)==null?void 0:_b.call(resource)}function useVibe64SessionData({onTitleChange=null}={}){const notifyTitleChange=typeof onTitleChange==="function"?onTitleChange:()=>null;const queryClient=useQueryClient();const projectSlug=useVibe64ProjectSlug();const paths=usePaths();const sessionSelection=useVibe64SessionSelection({projectSlug});const selectedSessionId=sessionSelection.selectedId;const sessionsApiPath=computed(()=>paths.api(VIBE64_SESSIONS_API_SUFFIX,{surface:VIBE64_SURFACE_ID}));const currentSessionApiPath=computed(()=>paths.api(VIBE64_CURRENT_SESSION_API_SUFFIX,{surface:VIBE64_SURFACE_ID}));const sessionListQueryKey=computed(()=>vibe64SessionsQueryKey(VIBE64_SURFACE_ID,ROUTE_VISIBILITY_PUBLIC,projectSlug.value));const sessionListResource=useEndpointResource({fallbackLoadError:"Vibe64 sessions could not be loaded.",path:sessionsApiPath,queryKey:sessionListQueryKey,readQuery:{limit:20},queryOptions:{refetchOnMount:false,refetchOnWindowFocus:false},requestRecoveryLabel:"Vibe64 sessions",realtime:{event:VIBE64_SESSION_CHANGED_EVENT,matches:sessionListRealtimeShouldRefresh}});const sessionList=proxyRefs({items:computed(()=>{const payload=sessionListResource.data.value||{};return Array.isArray(payload.sessions)?payload.sessions:[]}),loadError:sessionListResource.loadError,isInitialLoading:sessionListResource.isInitialLoading,isLoading:sessionListResource.isLoading,pages:computed(()=>{const payload=sessionListResource.data.value;return payload&&typeof payload==="object"&&!Array.isArray(payload)?[payload]:[]}),reload:sessionListResource.reload,resource:sessionListResource});let emptySessionListObservedForProject="";const createSessionCommand=useCommand({access:"never",apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildRawPayload:(_model,{context})=>vibe64RealtimeOriginPayload({assistantSelection:(context==null?void 0:context.assistantSelection)||{}}),fallbackRunError:"Vibe64 session could not be created.",messages:{error:"Vibe64 session could not be created.",success:"Vibe64 session created."},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.sessions.create",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});const createSessionPending=ref(false);const createSessionRunning=computed(()=>createSessionPending.value);const updateCurrentSessionCommand=useCommand({access:"never",apiSuffix:VIBE64_CURRENT_SESSION_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:"PUT",path:String((context==null?void 0:context.apiPath)||"")}),buildRawPayload:(_model,{context})=>({sessionId:String((context==null?void 0:context.sessionId)||"").trim()}),fallbackRunError:"The current session shortcut could not be updated.",messages:{error:"The current session shortcut could not be updated."},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.sessions.current.update",suppressSuccessMessage:true,surfaceId:VIBE64_SURFACE_ID,writeMethod:"PUT"});const currentSessionPublisher=createVibe64CurrentSessionPublisher({async publish({apiPath,sessionId}){const response=await updateCurrentSessionCommand.run({apiPath,sessionId});if(!response||response.ok===false){throw new Error(String((response==null?void 0:response.error)||"The current session shortcut could not be updated."))}},onError(error,publication){vibe64SessionDebugLog("client.sessionData.currentSession.error",{error:vibe64SessionDebugError(error),sessionId:publication.sessionId})}});let sessionDataDisposed=false;onScopeDispose(()=>{sessionDataDisposed=true;currentSessionPublisher.stop()});const archiveAttempts=ref({});const sessions=computed(()=>{const items=new Map((sessionList.items||[]).map(session=>[session.sessionId,session]));for(const[id,attempt]of Object.entries(archiveAttempts.value)){if(attempt.succeeded){items.delete(id)}else{items.set(id,{...items.get(id)||attempt.session,archiving:true})}}return visibleVibe64Sessions([...items.values()]).map(session=>{var _a;const operation=sessionArchiveOperation(session);return{...session,archiveError:(operation==null?void 0:operation.status)==="failed"?operation.error:"",archiving:Boolean(session.archiving||(operation==null?void 0:operation.status)==="running"||(operation==null?void 0:operation.status)!=="failed"&&((_a=session.metadata)==null?void 0:_a.session_closing_reason)==="archived")}})});const availableSessions=computed(()=>sessions.value.filter(session=>!session.archiving));const selectedListSession=computed(()=>{return sessions.value.find(session=>session.sessionId===selectedSessionId.value)||null});const selectedSessionMissing=computed(()=>{const selectedId=String(selectedSessionId.value||"").trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||"").trim()||sessionIdExistsInList(selectedId,sessions.value)){return false}return true});const selectionRenewalPredecessorId=computed(()=>{var _a,_b;const selectedId=String(selectedSessionId.value||"").trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||"").trim()){return""}if(selectedSessionMissing.value){return selectedId}return String(((_b=(_a=selectedListSession.value)==null?void 0:_a.metadata)==null?void 0:_b.renewed_from)||"").trim()});const selectionRenewalPath=computed(()=>selectionRenewalPredecessorId.value?vibe64SessionPath(sessionsApiPath.value,selectionRenewalPredecessorId.value,"/renewal"):"");const selectionRenewalResource=useEndpointResource({enabled:computed(()=>Boolean(selectionRenewalPredecessorId.value)),fallbackLoadError:"The selected session renewal could not be checked.",path:selectionRenewalPath,queryKey:computed(()=>[...vibe64SessionQueryKey(VIBE64_SURFACE_ID,ROUTE_VISIBILITY_PUBLIC,projectSlug.value),selectionRenewalPredecessorId.value,"renewal"]),queryOptions:{refetchOnMount:"always",refetchOnWindowFocus:false},readMethod:"GET",realtime:{event:VIBE64_SESSION_CHANGED_EVENT,matches:({payload={}}={})=>String((payload==null?void 0:payload.sessionId)||"").trim()===selectionRenewalPredecessorId.value},requestRecoveryLabel:"Selected session renewal"});const creationOptions=computed(()=>{var _a,_b;return((_b=(_a=sessionList.pages)==null?void 0:_a[0])==null?void 0:_b.creation)||{}});const selectedSession=computed(()=>enrichVibe64SessionForDisplay(selectedListSession.value));const isSelectedSessionArchived=computed(()=>isArchivedVibe64Session(selectedSession.value||{}));const pageLoading=computed(()=>Boolean(sessionList.isLoading));const canCreateSession=computed(()=>{return creationOptions.value.canCreate===true});const createSessionVisible=computed(()=>creationOptions.value.showCreateAction===true);const createSessionTitle=computed(()=>{if(creationOptions.value.disabledReason){return String(creationOptions.value.disabledReason)}if(creationOptions.value.canCreate!==true){return"Session creation is unavailable."}return"Create a new Vibe64 session"});const selectedSessionTitle=computed(()=>{return vibe64SessionDisplayTitle(selectedSession.value||{})||`Session ${shortVibe64SessionId(selectedSessionId.value)}`});async function refreshSessionList(){return refetchEndpointResource(sessionListResource)}let refreshSessionDataInFlight=null;async function refreshSessionData(options={}){const reason=typeof options==="string"?options:String((options==null?void 0:options.reason)||"");if(refreshSessionDataInFlight){vibe64SessionDebugLog("client.sessionData.refresh.join",{reason,selectedSessionId:String(selectedSessionId.value||"")});return refreshSessionDataInFlight}const startedAtMs=Date.now();vibe64SessionDebugLog("client.sessionData.refresh.start",{reason,selectedSessionId:String(selectedSessionId.value||"")});refreshSessionDataInFlight=refreshSessionList();try{const result=await refreshSessionDataInFlight;vibe64SessionDebugLog("client.sessionData.refresh.done",{durationMs:vibe64SessionDebugDurationMs(startedAtMs),reason,selectedSessionId:String(selectedSessionId.value||""),sessionCount:sessions.value.length});return result}catch(error){vibe64SessionDebugLog("client.sessionData.refresh.error",{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error),reason,selectedSessionId:String(selectedSessionId.value||"")});throw error}finally{refreshSessionDataInFlight=null}}function refreshSessionDataInBackground(options={}){void refreshSessionData(options).catch(()=>{})}function selectSessionId(sessionId=""){const normalizedSessionId=String(sessionId||"").trim();if(sessions.value.some(session=>session.sessionId===normalizedSessionId&&session.archiving)){return}vibe64SessionDebugLog("client.sessionData.selectSession",{fromSessionId:String(selectedSessionId.value||""),toSessionId:normalizedSessionId});if(normalizedSessionId){emptySessionListObservedForProject=""}sessionSelection.select(normalizedSessionId)}function clearSelectedSession(){emptySessionListObservedForProject=String(projectSlug.value||"").trim();sessionSelection.clear()}function selectPreviousSession(sessionId){var _a;const index=sessions.value.findIndex(session=>session.sessionId===sessionId);const previous=sessions.value.slice(0,Math.max(0,index)).filter(session=>!session.archiving).at(-1);selectSessionId((previous==null?void 0:previous.sessionId)||((_a=availableSessions.value.at(-1))==null?void 0:_a.sessionId)||"")}const archive=proxyRefs(useVibe64SessionDialogs({beginArchive(sessionId){archiveAttempts.value[sessionId]={session:sessions.value.find(session=>session.sessionId===sessionId)};if(selectedSessionId.value===sessionId){selectPreviousSession(sessionId)}return projectSlug.value},finishArchive(sessionId,succeeded,archiveProject){if(projectSlug.value!==archiveProject)return;if(succeeded){archiveAttempts.value[sessionId]={succeeded:true}}else{delete archiveAttempts.value[sessionId]}},isSelectedSessionArchived,refreshSessionData,selectedSessionId,selectedSessionTitle,sessionsApiPath}).archive);const archiveFeedback=useUiFeedback({source:"vibe64.sessions.archive.remote"});const shownArchiveFailures=new Set;watch(projectSlug,()=>{archiveAttempts.value={};shownArchiveFailures.clear()});useRealtimeEvent({event:VIBE64_SESSION_CHANGED_EVENT,matches:({payload={}}={})=>payload.projectSlug===projectSlug.value,onEvent:({payload={}}={})=>{const id=String(payload.sessionId||"");if(!id)return;if(payload.reason==="session-archiving"){const session=sessions.value.find(item=>item.sessionId===id);if(session)archiveAttempts.value[id]={session};if(selectedSessionId.value===id)selectPreviousSession(id)}else if(payload.reason==="session-archived"){archiveAttempts.value[id]={succeeded:true}}else if(payload.reason==="session-archive-failed"){delete archiveAttempts.value[id]}}});watch(()=>sessionList.items,items=>{var _a;for(const[id,attempt]of Object.entries(archiveAttempts.value)){if(attempt.succeeded||archive.archivingSessionId===id)continue;const session=items.find(item=>item.sessionId===id);const operation=sessionArchiveOperation(session);if(!session||(operation==null?void 0:operation.status)==="failed"||(operation==null?void 0:operation.status)!=="running"&&((_a=session.metadata)==null?void 0:_a.session_closing_reason)!=="archived"){delete archiveAttempts.value[id]}}});watch(sessions,items=>{var _a;for(const session of items){const key=`${session.sessionId}:${(_a=session.metadata)==null?void 0:_a.session_archive_operation}`;if(!session.archiveError||shownArchiveFailures.has(key))continue;shownArchiveFailures.add(key);if(archive.archivingSessionId!==session.sessionId){archiveFeedback.error(new Error(session.archiveError))}}},{immediate:true});let createSessionInFlight=null;async function createSession(assistantSelection={}){if(createSessionInFlight){return createSessionInFlight}const startedAtMs=Date.now();const creationProjectSlug=String(projectSlug.value||"").trim();vibe64SessionDebugLog("client.sessionData.createSession.start");createSessionPending.value=true;createSessionInFlight=(async()=>{var _a,_b;try{const response=await createSessionCommand.run({assistantSelection});if(!sessionDataDisposed&&creationProjectSlug===String(projectSlug.value||"").trim()){if((response==null?void 0:response.creation)&&(response==null?void 0:response.limits)){queryClient.setQueryData(sessionListQueryKey.value,currentPayload=>{if(!currentPayload||typeof currentPayload!=="object"||Array.isArray(currentPayload)){return currentPayload}const currentSessions=Array.isArray(currentPayload.sessions)?currentPayload.sessions:[];const createdSession=response.sessionId?Object.fromEntries(Object.entries(response).filter(([key])=>!["creation","limits","ok"].includes(key))):null;return{...currentPayload,creation:response.creation,limits:response.limits,...createdSession&&!currentSessions.some(item=>(item==null?void 0:item.sessionId)===createdSession.sessionId)?{sessions:[...currentSessions,createdSession]}:{}}})}if(response==null?void 0:response.sessionId){selectSessionId(response.sessionId)}refreshSessionDataInBackground({includeList:true,reason:"create-session"})}vibe64SessionDebugLog("client.sessionData.createSession.done",{...vibe64SessionDebugSummary(response||{}),code:String((response==null?void 0:response.code)||((_b=(_a=response==null?void 0:response.errors)==null?void 0:_a[0])==null?void 0:_b.code)||""),durationMs:vibe64SessionDebugDurationMs(startedAtMs),ok:(response==null?void 0:response.ok)!==false});return response}catch(error){vibe64SessionDebugLog("client.sessionData.createSession.error",{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error)});throw error}finally{createSessionPending.value=false;createSessionInFlight=null}})();return createSessionInFlight}const selectionReconciliationState=computed(()=>{var _a,_b,_c,_d;const nextSessions=availableSessions.value;return{createSessionRunning:createSessionRunning.value,currentSessionApiPath:currentSessionApiPath.value,selectionRenewal:((_a=selectionRenewalResource.data.value)==null?void 0:_a.renewal)||null,selectionRenewalLoadError:String(((_b=selectionRenewalResource.loadError)==null?void 0:_b.value)||""),selectionRenewalLoaded:Boolean(selectionRenewalResource.data.value&&typeof selectionRenewalResource.data.value==="object"&&!Array.isArray(selectionRenewalResource.data.value)),selectionRenewalLoading:Boolean(((_c=selectionRenewalResource.isInitialLoading)==null?void 0:_c.value)||((_d=selectionRenewalResource.isLoading)==null?void 0:_d.value)),selectionRenewalPredecessorId:selectionRenewalPredecessorId.value,projectSlug:String(projectSlug.value||"").trim(),selectedSessionMissing:selectedSessionMissing.value,nextSessions,selectedSessionId:String(selectedSessionId.value||""),sessionIds:nextSessions.map(session=>session.sessionId).join("|"),sessionListInitialLoading:sessionList.isInitialLoading,sessionListLoaded:sessionList.pages.length>0,sessionListLoadError:String(sessionList.loadError||""),sessionListLoading:sessionList.isLoading}});watch(selectionReconciliationState,state=>{var _a;const nextSessions=state.nextSessions;if(sessions.value.some(session=>session.sessionId===state.selectedSessionId&&session.archiving)){selectPreviousSession(state.selectedSessionId);return}vibe64SessionDebugLog("client.sessionData.sessions.changed",{selectedSessionId:String(selectedSessionId.value||""),sessionCount:nextSessions.length});if(state.sessionListInitialLoading||state.sessionListLoadError||shouldPreserveSelectedSessionDuringRefresh({createSessionRunning:state.createSessionRunning,currentSessionId:state.selectedSessionId,nextSessions,sessionListLoading:state.sessionListLoading})){return}if(!state.selectedSessionId&&nextSessions.length===0){emptySessionListObservedForProject=state.projectSlug}if(state.selectionRenewalPredecessorId){if(state.selectionRenewalLoading||state.selectionRenewalLoadError||!state.selectionRenewalLoaded){return}const selectionRenewal=state.selectionRenewal;if(selectionRenewal&&String(selectionRenewal.sessionId||"").trim()===state.selectionRenewalPredecessorId){const renewalStatus=String(selectionRenewal.status||"").trim();if(state.selectedSessionMissing){if(renewalStatus==="completed"){const renewedSuccessorId=renewedSuccessorSessionId({predecessorSessionId:state.selectedSessionId,sessions:nextSessions});if(renewedSuccessorId){sessionSelection.selectAvailableId(nextSessions,{fallbackId:renewedSuccessorId,getId:session=>session.sessionId})}return}if(["failed","running"].includes(renewalStatus)){return}}if(["failed","running"].includes(renewalStatus)){sessionSelection.select(state.selectionRenewalPredecessorId);return}}}if(!state.selectedSessionId&&emptySessionListObservedForProject===state.projectSlug){return}sessionSelection.selectAvailableId(nextSessions,{fallbackId:((_a=nextSessions.at(-1))==null?void 0:_a.sessionId)||"",getId:session=>session.sessionId})},{immediate:true});watch(selectionReconciliationState,state=>{const publicationSessionId=selectedSessionIdForCurrentAlias({createSessionRunning:state.createSessionRunning,selectedSessionId:state.selectedSessionId,sessionListLoaded:state.sessionListLoaded,sessionListLoadError:state.sessionListLoadError,sessionListLoading:state.sessionListLoading,sessions:state.nextSessions});if(publicationSessionId===null||!state.currentSessionApiPath){return}void currentSessionPublisher.request({apiPath:state.currentSessionApiPath,sessionId:publicationSessionId})},{flush:"post",immediate:true});watch(selectedSessionTitle,title=>{notifyTitleChange(title||"")},{immediate:true});return{archive,canCreateSession,clearSelectedSession,createSession,createSessionCommand,createSessionRunning,createSessionVisible,createSessionTitle,isSelectedSessionArchived,pageLoading,refreshSessionData,selectSessionId,selectedSession,selectedSessionId,selectedSessionTitle,sessionList,sessions,sessionsApiPath,shortSessionId:shortVibe64SessionId,statusColor:vibe64SessionStatusColor,statusLabel:vibe64SessionStatusLabel,updateCurrentSessionCommand}}export{sessionListRealtimeShouldRefresh as s,useVibe64SessionData as u};
|
|
1
|
+
import{E as useCommand,R as ROUTE_VISIBILITY_PUBLIC,Q as VIBE64_SURFACE_ID,A as computed,B as ref,i as unref,dc as useQueryClient,P as usePaths,D as useEndpointResource,by as proxyRefs,ag as onScopeDispose,af as useUiFeedback,H as watch,M as useRealtimeEvent}from"./index-C4KnwA0g.js";import{c as VIBE64_SESSIONS_API_SUFFIX,v as vibe64SessionPath,V as VIBE64_SESSION_CHANGED_EVENT,X as VIBE64_CURRENT_SESSION_API_SUFFIX,O as vibe64SessionsQueryKey,n as vibe64SessionQueryKey}from"./vibe64SessionRequestConfig-uGWcyQY6.js";import{r as readRefOrGetterValue}from"./vueRefOrGetterValue-CV9c3oBd.js";import{v as vibe64RealtimeOriginPayload}from"./vibe64BrowserTabOrigin-DDSCqr3B.js";import{u as useVibe64ProjectSlug}from"./useVibe64ProjectScope-DcDkjbLT.js";import{u as useVibe64SessionSelection}from"./useVibe64SessionSelection-G6KQKJxb.js";import{a as vibe64SessionDebugLog,b as vibe64SessionDebugError,c as vibe64SessionDebugDurationMs,d as vibe64SessionDebugSummary,g as visibleVibe64Sessions,e as enrichVibe64SessionForDisplay}from"./vibe64SessionPanelModel-DDaXjAJ_.js";import{v as vibe64SessionStatusLabel,a as vibe64SessionStatusColor,s as shortVibe64SessionId,i as isArchivedVibe64Session,c as vibe64SessionDisplayTitle}from"./vibe64SessionViewModel-C4e2otoM.js";function useVibe64SessionDialogs({beginArchive=()=>null,finishArchive=()=>null,isSelectedSessionArchived,refreshSessionData=async()=>null,selectedSessionId,selectedSessionTitle,sessionsApiPath}={}){const archiveDialogOpen=ref(false);const archiveDialogSessionId=ref("");const archiveDialogSessionTitle=ref("");const archivingSessionId=ref("");const resolvedSessionsApiPath=computed(()=>String(readRefOrGetterValue(sessionsApiPath)||""));const archiveCommand=useCommand({access:"never",apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildRawPayload:()=>vibe64RealtimeOriginPayload(),buildCommandOptions:(_payload,{context})=>({method:"POST",path:vibe64SessionPath(resolvedSessionsApiPath.value,context==null?void 0:context.sessionId,"/archive")}),fallbackRunError:"Vibe64 session could not be archived.",messages:{error:"Vibe64 session could not be archived.",success:"Vibe64 session archived."},onRunSuccess:async response=>{var _a,_b;if((response==null?void 0:response.ok)!==true){throw new Error(((_b=(_a=response==null?void 0:response.errors)==null?void 0:_a[0])==null?void 0:_b.message)||(response==null?void 0:response.error)||"Vibe64 session could not be archived.")}},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.sessions.archive",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});function clearArchiveDialog(){archiveDialogOpen.value=false;archiveDialogSessionId.value="";archiveDialogSessionTitle.value=""}function requestArchiveSelectedSession(){if(!unref(selectedSessionId)||archivingSessionId.value||archiveCommand.isRunning||unref(isSelectedSessionArchived)){return}archiveDialogSessionId.value=unref(selectedSessionId);archiveDialogSessionTitle.value=unref(selectedSessionTitle);archiveDialogOpen.value=true}function cancelArchiveSession(){if(!archiveCommand.isRunning){clearArchiveDialog()}}async function confirmArchiveSession(){if(!archiveDialogSessionId.value||archivingSessionId.value||archiveCommand.isRunning){return false}const sessionId=archiveDialogSessionId.value;archivingSessionId.value=sessionId;clearArchiveDialog();const archiveScope=beginArchive(sessionId);let succeeded=false;try{const response=await archiveCommand.run({sessionId});succeeded=(response==null?void 0:response.ok)===true;return response}catch{return false}finally{finishArchive(sessionId,succeeded,archiveScope);if(archivingSessionId.value===sessionId){archivingSessionId.value=""}void refreshSessionData({includeList:true,reason:"archive-session"}).catch(()=>null)}}function clear(){clearArchiveDialog()}return{archive:{archiving:computed(()=>Boolean(archivingSessionId.value)),archivingSessionId,cancel:cancelArchiveSession,command:archiveCommand,confirm:confirmArchiveSession,open:archiveDialogOpen,request:requestArchiveSelectedSession,sessionId:archiveDialogSessionId,sessionTitle:archiveDialogSessionTitle},busy:computed(()=>Boolean(archivingSessionId.value)),clear}}function createVibe64CurrentSessionPublisher({onError=()=>null,publish}={}){if(typeof publish!=="function"){throw new TypeError("Current Vibe64 session publisher requires publish().")}let pendingPublication=null;let publicationChain=Promise.resolve();let lastPublishedIdentity=null;let stopped=false;function request(publication={}){if(stopped){return publicationChain}const apiPath=String((publication==null?void 0:publication.apiPath)||"");const sessionId=String((publication==null?void 0:publication.sessionId)||"").trim();pendingPublication={apiPath,identity:JSON.stringify([apiPath,sessionId]),sessionId};publicationChain=publicationChain.catch(()=>null).then(async()=>{if(stopped||!pendingPublication){return}const publication2=pendingPublication;pendingPublication=null;if(publication2.identity===lastPublishedIdentity){return}try{await publish({apiPath:publication2.apiPath,sessionId:publication2.sessionId});lastPublishedIdentity=publication2.identity}catch(error){onError(error,publication2)}});return publicationChain}function stop(){stopped=true;pendingPublication=null}return Object.freeze({request,stop})}function vibe64SessionListRefreshRequested(payload={}){var _a;return((_a=payload==null?void 0:payload.clientRefresh)==null?void 0:_a.includeList)===true}const SESSION_LIST_IGNORED_REALTIME_REASONS=new Set(["assistant-response-bundle","codex-app-server-ready","codex-app-server-agent-result","codex-app-server-agent-result-invalid","codex-app-server-agent-result-missing","codex-app-server-agent-result-provider-failed","codex-app-server-blocked","codex-app-server-commentary","codex-app-server-failed","codex-app-server-final-assistant-message","codex-app-server-live-progress","codex-app-server-prompt-injected","codex-app-server-reasoning-summary","codex-app-server-running","codex-app-server-terminal-assistant-message","codex-app-server-terminal-thinking-message","codex-app-server-terminal-user-message","codex-app-server-turn-active","codex-app-server-turn-claimed","codex-app-server-turn-finalizing","codex-app-server-turn-idle","codex-app-server-turn-state","codex-app-server-message-delivered","codex-prompt-injected","codex-context-replaced","agent-terminal-started","agent-terminal-closed","output-target-started","output-target-ready","output-target-closed","output-target-stopped"]);function sessionArchiveOperation(session){var _a;try{return JSON.parse(((_a=session==null?void 0:session.metadata)==null?void 0:_a.session_archive_operation)||"null")}catch{return{status:"failed",error:"Session archive state could not be read."}}}function sessionIdExistsInList(sessionId="",nextSessions=[]){const normalizedSessionId=String(sessionId||"").trim();return Boolean(normalizedSessionId)&&nextSessions.some(session=>session.sessionId===normalizedSessionId)}function renewedSuccessorSessionId({predecessorSessionId="",sessions=[]}={}){var _a;const predecessorId=String(predecessorSessionId||"").trim();if(!predecessorId){return""}const matches=sessions.filter(session=>{var _a2;return String(((_a2=session==null?void 0:session.metadata)==null?void 0:_a2.renewed_from)||"").trim()===predecessorId});return matches.length===1?String(((_a=matches[0])==null?void 0:_a.sessionId)||"").trim():""}function shouldPreserveSelectedSessionDuringRefresh({createSessionRunning=false,currentSessionId="",nextSessions=[],selectedSessionLoading=false,sessionListLoading=false}={}){const normalizedSessionId=String(currentSessionId||"").trim();if(!normalizedSessionId||sessionIdExistsInList(normalizedSessionId,nextSessions)){return false}return Boolean(sessionListLoading||createSessionRunning||selectedSessionLoading)}function selectedSessionIdForCurrentAlias({createSessionRunning=false,selectedSessionId="",selectedSessionLoading=false,sessionListLoaded=true,sessionListLoadError="",sessionListLoading=false,sessions=[]}={}){if(!sessionListLoaded||sessionListLoading||String(sessionListLoadError||"").trim()){return null}const normalizedSessionId=String(selectedSessionId||"").trim();if(sessionIdExistsInList(normalizedSessionId,sessions)){return normalizedSessionId}if(sessions.length>0||createSessionRunning||selectedSessionLoading){return null}return""}function sessionChangedReason(payload={}){return String((payload==null?void 0:payload.reason)||"").trim()}function sessionListRealtimeShouldRefresh({payload={}}={}){if(vibe64SessionListRefreshRequested(payload)){return true}const reason=sessionChangedReason(payload);return!reason||!SESSION_LIST_IGNORED_REALTIME_REASONS.has(reason)}function refetchEndpointResource(resource){var _a,_b;if(typeof((_a=resource==null?void 0:resource.query)==null?void 0:_a.refetch)==="function"){return resource.query.refetch({cancelRefetch:false})}return(_b=resource==null?void 0:resource.reload)==null?void 0:_b.call(resource)}function useVibe64SessionData({onTitleChange=null}={}){const notifyTitleChange=typeof onTitleChange==="function"?onTitleChange:()=>null;const queryClient=useQueryClient();const projectSlug=useVibe64ProjectSlug();const paths=usePaths();const sessionSelection=useVibe64SessionSelection({projectSlug});const selectedSessionId=sessionSelection.selectedId;const sessionsApiPath=computed(()=>paths.api(VIBE64_SESSIONS_API_SUFFIX,{surface:VIBE64_SURFACE_ID}));const currentSessionApiPath=computed(()=>paths.api(VIBE64_CURRENT_SESSION_API_SUFFIX,{surface:VIBE64_SURFACE_ID}));const sessionListQueryKey=computed(()=>vibe64SessionsQueryKey(VIBE64_SURFACE_ID,ROUTE_VISIBILITY_PUBLIC,projectSlug.value));const sessionListResource=useEndpointResource({fallbackLoadError:"Vibe64 sessions could not be loaded.",path:sessionsApiPath,queryKey:sessionListQueryKey,readQuery:{limit:20},queryOptions:{refetchOnMount:false,refetchOnWindowFocus:false},requestRecoveryLabel:"Vibe64 sessions",realtime:{event:VIBE64_SESSION_CHANGED_EVENT,matches:sessionListRealtimeShouldRefresh}});const sessionList=proxyRefs({items:computed(()=>{const payload=sessionListResource.data.value||{};return Array.isArray(payload.sessions)?payload.sessions:[]}),loadError:sessionListResource.loadError,isInitialLoading:sessionListResource.isInitialLoading,isLoading:sessionListResource.isLoading,pages:computed(()=>{const payload=sessionListResource.data.value;return payload&&typeof payload==="object"&&!Array.isArray(payload)?[payload]:[]}),reload:sessionListResource.reload,resource:sessionListResource});let emptySessionListObservedForProject="";const createSessionCommand=useCommand({access:"never",apiSuffix:VIBE64_SESSIONS_API_SUFFIX,buildRawPayload:(_model,{context})=>vibe64RealtimeOriginPayload({assistantSelection:(context==null?void 0:context.assistantSelection)||{}}),fallbackRunError:"Vibe64 session could not be created.",messages:{error:"Vibe64 session could not be created.",success:"Vibe64 session created."},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.sessions.create",surfaceId:VIBE64_SURFACE_ID,writeMethod:"POST"});const createSessionPending=ref(false);const createSessionRunning=computed(()=>createSessionPending.value);const updateCurrentSessionCommand=useCommand({access:"never",apiSuffix:VIBE64_CURRENT_SESSION_API_SUFFIX,buildCommandOptions:(_model,{context})=>({method:"PUT",path:String((context==null?void 0:context.apiPath)||"")}),buildRawPayload:(_model,{context})=>({sessionId:String((context==null?void 0:context.sessionId)||"").trim()}),fallbackRunError:"The current session shortcut could not be updated.",messages:{error:"The current session shortcut could not be updated."},ownershipFilter:ROUTE_VISIBILITY_PUBLIC,placementSource:"vibe64.sessions.current.update",suppressSuccessMessage:true,surfaceId:VIBE64_SURFACE_ID,writeMethod:"PUT"});const currentSessionPublisher=createVibe64CurrentSessionPublisher({async publish({apiPath,sessionId}){const response=await updateCurrentSessionCommand.run({apiPath,sessionId});if(!response||response.ok===false){throw new Error(String((response==null?void 0:response.error)||"The current session shortcut could not be updated."))}},onError(error,publication){vibe64SessionDebugLog("client.sessionData.currentSession.error",{error:vibe64SessionDebugError(error),sessionId:publication.sessionId})}});let sessionDataDisposed=false;onScopeDispose(()=>{sessionDataDisposed=true;currentSessionPublisher.stop()});const archiveAttempts=ref({});const sessions=computed(()=>{const items=new Map((sessionList.items||[]).map(session=>[session.sessionId,session]));for(const[id,attempt]of Object.entries(archiveAttempts.value)){if(attempt.succeeded){items.delete(id)}else{items.set(id,{...items.get(id)||attempt.session,archiving:true})}}return visibleVibe64Sessions([...items.values()]).map(session=>{var _a;const operation=sessionArchiveOperation(session);return{...session,archiveError:(operation==null?void 0:operation.status)==="failed"?operation.error:"",archiving:Boolean(session.archiving||(operation==null?void 0:operation.status)==="running"||(operation==null?void 0:operation.status)!=="failed"&&((_a=session.metadata)==null?void 0:_a.session_closing_reason)==="archived")}})});const availableSessions=computed(()=>sessions.value.filter(session=>!session.archiving));const selectedListSession=computed(()=>{return sessions.value.find(session=>session.sessionId===selectedSessionId.value)||null});const selectedSessionMissing=computed(()=>{const selectedId=String(selectedSessionId.value||"").trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||"").trim()||sessionIdExistsInList(selectedId,sessions.value)){return false}return true});const selectionRenewalPredecessorId=computed(()=>{var _a,_b;const selectedId=String(selectedSessionId.value||"").trim();if(!selectedId||sessionList.pages.length<1||String(sessionList.loadError||"").trim()){return""}if(selectedSessionMissing.value){return selectedId}return String(((_b=(_a=selectedListSession.value)==null?void 0:_a.metadata)==null?void 0:_b.renewed_from)||"").trim()});const selectionRenewalPath=computed(()=>selectionRenewalPredecessorId.value?vibe64SessionPath(sessionsApiPath.value,selectionRenewalPredecessorId.value,"/renewal"):"");const selectionRenewalResource=useEndpointResource({enabled:computed(()=>Boolean(selectionRenewalPredecessorId.value)),fallbackLoadError:"The selected session renewal could not be checked.",path:selectionRenewalPath,queryKey:computed(()=>[...vibe64SessionQueryKey(VIBE64_SURFACE_ID,ROUTE_VISIBILITY_PUBLIC,projectSlug.value),selectionRenewalPredecessorId.value,"renewal"]),queryOptions:{refetchOnMount:"always",refetchOnWindowFocus:false},readMethod:"GET",realtime:{event:VIBE64_SESSION_CHANGED_EVENT,matches:({payload={}}={})=>String((payload==null?void 0:payload.sessionId)||"").trim()===selectionRenewalPredecessorId.value},requestRecoveryLabel:"Selected session renewal"});const creationOptions=computed(()=>{var _a,_b;return((_b=(_a=sessionList.pages)==null?void 0:_a[0])==null?void 0:_b.creation)||{}});const selectedSession=computed(()=>enrichVibe64SessionForDisplay(selectedListSession.value));const isSelectedSessionArchived=computed(()=>isArchivedVibe64Session(selectedSession.value||{}));const pageLoading=computed(()=>Boolean(sessionList.isLoading));const canCreateSession=computed(()=>{return creationOptions.value.canCreate===true});const createSessionVisible=computed(()=>creationOptions.value.showCreateAction===true);const createSessionTitle=computed(()=>{if(creationOptions.value.disabledReason){return String(creationOptions.value.disabledReason)}if(creationOptions.value.canCreate!==true){return"Session creation is unavailable."}return"Create a new Vibe64 session"});const selectedSessionTitle=computed(()=>{return vibe64SessionDisplayTitle(selectedSession.value||{})||`Session ${shortVibe64SessionId(selectedSessionId.value)}`});async function refreshSessionList(){return refetchEndpointResource(sessionListResource)}let refreshSessionDataInFlight=null;async function refreshSessionData(options={}){const reason=typeof options==="string"?options:String((options==null?void 0:options.reason)||"");if(refreshSessionDataInFlight){vibe64SessionDebugLog("client.sessionData.refresh.join",{reason,selectedSessionId:String(selectedSessionId.value||"")});return refreshSessionDataInFlight}const startedAtMs=Date.now();vibe64SessionDebugLog("client.sessionData.refresh.start",{reason,selectedSessionId:String(selectedSessionId.value||"")});refreshSessionDataInFlight=refreshSessionList();try{const result=await refreshSessionDataInFlight;vibe64SessionDebugLog("client.sessionData.refresh.done",{durationMs:vibe64SessionDebugDurationMs(startedAtMs),reason,selectedSessionId:String(selectedSessionId.value||""),sessionCount:sessions.value.length});return result}catch(error){vibe64SessionDebugLog("client.sessionData.refresh.error",{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error),reason,selectedSessionId:String(selectedSessionId.value||"")});throw error}finally{refreshSessionDataInFlight=null}}function refreshSessionDataInBackground(options={}){void refreshSessionData(options).catch(()=>{})}function selectSessionId(sessionId=""){const normalizedSessionId=String(sessionId||"").trim();if(sessions.value.some(session=>session.sessionId===normalizedSessionId&&session.archiving)){return}vibe64SessionDebugLog("client.sessionData.selectSession",{fromSessionId:String(selectedSessionId.value||""),toSessionId:normalizedSessionId});if(normalizedSessionId){emptySessionListObservedForProject=""}sessionSelection.select(normalizedSessionId)}function clearSelectedSession(){emptySessionListObservedForProject=String(projectSlug.value||"").trim();sessionSelection.clear()}function selectPreviousSession(sessionId){var _a;const index=sessions.value.findIndex(session=>session.sessionId===sessionId);const previous=sessions.value.slice(0,Math.max(0,index)).filter(session=>!session.archiving).at(-1);selectSessionId((previous==null?void 0:previous.sessionId)||((_a=availableSessions.value.at(-1))==null?void 0:_a.sessionId)||"")}const archive=proxyRefs(useVibe64SessionDialogs({beginArchive(sessionId){archiveAttempts.value[sessionId]={session:sessions.value.find(session=>session.sessionId===sessionId)};if(selectedSessionId.value===sessionId){selectPreviousSession(sessionId)}return projectSlug.value},finishArchive(sessionId,succeeded,archiveProject){if(projectSlug.value!==archiveProject)return;if(succeeded){archiveAttempts.value[sessionId]={succeeded:true}}else{delete archiveAttempts.value[sessionId]}},isSelectedSessionArchived,refreshSessionData,selectedSessionId,selectedSessionTitle,sessionsApiPath}).archive);const archiveFeedback=useUiFeedback({source:"vibe64.sessions.archive.remote"});const shownArchiveFailures=new Set;watch(projectSlug,()=>{archiveAttempts.value={};shownArchiveFailures.clear()});useRealtimeEvent({event:VIBE64_SESSION_CHANGED_EVENT,matches:({payload={}}={})=>payload.projectSlug===projectSlug.value,onEvent:({payload={}}={})=>{const id=String(payload.sessionId||"");if(!id)return;if(payload.reason==="session-archiving"){const session=sessions.value.find(item=>item.sessionId===id);if(session)archiveAttempts.value[id]={session};if(selectedSessionId.value===id)selectPreviousSession(id)}else if(payload.reason==="session-archived"){archiveAttempts.value[id]={succeeded:true}}else if(payload.reason==="session-archive-failed"){delete archiveAttempts.value[id]}}});watch(()=>sessionList.items,items=>{var _a;for(const[id,attempt]of Object.entries(archiveAttempts.value)){if(attempt.succeeded||archive.archivingSessionId===id)continue;const session=items.find(item=>item.sessionId===id);const operation=sessionArchiveOperation(session);if(!session||(operation==null?void 0:operation.status)==="failed"||(operation==null?void 0:operation.status)!=="running"&&((_a=session.metadata)==null?void 0:_a.session_closing_reason)!=="archived"){delete archiveAttempts.value[id]}}});watch(sessions,items=>{var _a;for(const session of items){const key=`${session.sessionId}:${(_a=session.metadata)==null?void 0:_a.session_archive_operation}`;if(!session.archiveError||shownArchiveFailures.has(key))continue;shownArchiveFailures.add(key);if(archive.archivingSessionId!==session.sessionId){archiveFeedback.error(new Error(session.archiveError))}}},{immediate:true});let createSessionInFlight=null;async function createSession(assistantSelection={}){if(createSessionInFlight){return createSessionInFlight}const startedAtMs=Date.now();const creationProjectSlug=String(projectSlug.value||"").trim();vibe64SessionDebugLog("client.sessionData.createSession.start");createSessionPending.value=true;createSessionInFlight=(async()=>{var _a,_b;try{const response=await createSessionCommand.run({assistantSelection});if(!sessionDataDisposed&&creationProjectSlug===String(projectSlug.value||"").trim()){if((response==null?void 0:response.creation)&&(response==null?void 0:response.limits)){queryClient.setQueryData(sessionListQueryKey.value,currentPayload=>{if(!currentPayload||typeof currentPayload!=="object"||Array.isArray(currentPayload)){return currentPayload}const currentSessions=Array.isArray(currentPayload.sessions)?currentPayload.sessions:[];const createdSession=response.sessionId?Object.fromEntries(Object.entries(response).filter(([key])=>!["creation","limits","ok"].includes(key))):null;return{...currentPayload,creation:response.creation,limits:response.limits,...createdSession&&!currentSessions.some(item=>(item==null?void 0:item.sessionId)===createdSession.sessionId)?{sessions:[...currentSessions,createdSession]}:{}}})}if(response==null?void 0:response.sessionId){selectSessionId(response.sessionId)}refreshSessionDataInBackground({includeList:true,reason:"create-session"})}vibe64SessionDebugLog("client.sessionData.createSession.done",{...vibe64SessionDebugSummary(response||{}),code:String((response==null?void 0:response.code)||((_b=(_a=response==null?void 0:response.errors)==null?void 0:_a[0])==null?void 0:_b.code)||""),durationMs:vibe64SessionDebugDurationMs(startedAtMs),ok:(response==null?void 0:response.ok)!==false});return response}catch(error){vibe64SessionDebugLog("client.sessionData.createSession.error",{durationMs:vibe64SessionDebugDurationMs(startedAtMs),error:vibe64SessionDebugError(error)});throw error}finally{createSessionPending.value=false;createSessionInFlight=null}})();return createSessionInFlight}const selectionReconciliationState=computed(()=>{var _a,_b,_c,_d;const nextSessions=availableSessions.value;return{createSessionRunning:createSessionRunning.value,currentSessionApiPath:currentSessionApiPath.value,selectionRenewal:((_a=selectionRenewalResource.data.value)==null?void 0:_a.renewal)||null,selectionRenewalLoadError:String(((_b=selectionRenewalResource.loadError)==null?void 0:_b.value)||""),selectionRenewalLoaded:Boolean(selectionRenewalResource.data.value&&typeof selectionRenewalResource.data.value==="object"&&!Array.isArray(selectionRenewalResource.data.value)),selectionRenewalLoading:Boolean(((_c=selectionRenewalResource.isInitialLoading)==null?void 0:_c.value)||((_d=selectionRenewalResource.isLoading)==null?void 0:_d.value)),selectionRenewalPredecessorId:selectionRenewalPredecessorId.value,projectSlug:String(projectSlug.value||"").trim(),selectedSessionMissing:selectedSessionMissing.value,nextSessions,selectedSessionId:String(selectedSessionId.value||""),sessionIds:nextSessions.map(session=>session.sessionId).join("|"),sessionListInitialLoading:sessionList.isInitialLoading,sessionListLoaded:sessionList.pages.length>0,sessionListLoadError:String(sessionList.loadError||""),sessionListLoading:sessionList.isLoading}});watch(selectionReconciliationState,state=>{var _a;const nextSessions=state.nextSessions;if(sessions.value.some(session=>session.sessionId===state.selectedSessionId&&session.archiving)){selectPreviousSession(state.selectedSessionId);return}vibe64SessionDebugLog("client.sessionData.sessions.changed",{selectedSessionId:String(selectedSessionId.value||""),sessionCount:nextSessions.length});if(state.sessionListInitialLoading||state.sessionListLoadError||shouldPreserveSelectedSessionDuringRefresh({createSessionRunning:state.createSessionRunning,currentSessionId:state.selectedSessionId,nextSessions,sessionListLoading:state.sessionListLoading})){return}if(!state.selectedSessionId&&nextSessions.length===0){emptySessionListObservedForProject=state.projectSlug}if(state.selectionRenewalPredecessorId){if(state.selectionRenewalLoading||state.selectionRenewalLoadError||!state.selectionRenewalLoaded){return}const selectionRenewal=state.selectionRenewal;if(selectionRenewal&&String(selectionRenewal.sessionId||"").trim()===state.selectionRenewalPredecessorId){const renewalStatus=String(selectionRenewal.status||"").trim();if(state.selectedSessionMissing){if(renewalStatus==="completed"){const renewedSuccessorId=renewedSuccessorSessionId({predecessorSessionId:state.selectedSessionId,sessions:nextSessions});if(renewedSuccessorId){sessionSelection.selectAvailableId(nextSessions,{fallbackId:renewedSuccessorId,getId:session=>session.sessionId})}return}if(["failed","running"].includes(renewalStatus)){return}}if(["failed","running"].includes(renewalStatus)){sessionSelection.select(state.selectionRenewalPredecessorId);return}}}if(!state.selectedSessionId&&emptySessionListObservedForProject===state.projectSlug){return}sessionSelection.selectAvailableId(nextSessions,{fallbackId:((_a=nextSessions.at(-1))==null?void 0:_a.sessionId)||"",getId:session=>session.sessionId})},{immediate:true});watch(selectionReconciliationState,state=>{const publicationSessionId=selectedSessionIdForCurrentAlias({createSessionRunning:state.createSessionRunning,selectedSessionId:state.selectedSessionId,sessionListLoaded:state.sessionListLoaded,sessionListLoadError:state.sessionListLoadError,sessionListLoading:state.sessionListLoading,sessions:state.nextSessions});if(publicationSessionId===null||!state.currentSessionApiPath){return}void currentSessionPublisher.request({apiPath:state.currentSessionApiPath,sessionId:publicationSessionId})},{flush:"post",immediate:true});watch(selectedSessionTitle,title=>{notifyTitleChange(title||"")},{immediate:true});return{archive,canCreateSession,clearSelectedSession,createSession,createSessionCommand,createSessionRunning,createSessionVisible,createSessionTitle,isSelectedSessionArchived,pageLoading,refreshSessionData,selectSessionId,selectedSession,selectedSessionId,selectedSessionTitle,sessionList,sessions,sessionsApiPath,shortSessionId:shortVibe64SessionId,statusColor:vibe64SessionStatusColor,statusLabel:vibe64SessionStatusLabel,updateCurrentSessionCommand}}export{sessionListRealtimeShouldRefresh as s,useVibe64SessionData as u};
|
package/dist/assets/{useVibe64SessionSelection-D1wXIWTm.js → useVibe64SessionSelection-G6KQKJxb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as ref,H as watch,A as computed,i as unref,aR as useRoute}from"./index-
|
|
1
|
+
import{B as ref,H as watch,A as computed,i as unref,aR as useRoute}from"./index-C4KnwA0g.js";import{u as useVibe64ProjectSlug}from"./useVibe64ProjectScope-DcDkjbLT.js";import{Y as selectedSessionStorageKey}from"./vibe64SessionRequestConfig-uGWcyQY6.js";function browserSessionStorage(){if(typeof window==="undefined"||!window.sessionStorage){return null}return window.sessionStorage}function readStoredValue(storageKey=""){var _a;try{return String(((_a=browserSessionStorage())==null?void 0:_a.getItem(storageKey))||"")}catch{return""}}function writeStoredValue(storageKey="",value=""){try{const storage=browserSessionStorage();if(!storage){return}const normalizedValue=String(value||"").trim();if(normalizedValue){storage.setItem(storageKey,normalizedValue);return}storage.removeItem(storageKey)}catch{}}function readStorageKey(storageKey=""){return String(typeof storageKey==="function"?storageKey():unref(storageKey)||"").trim()}function readPreferredId(preferredId=""){return String(typeof preferredId==="function"?preferredId():unref(preferredId)||"").trim()}function useStoredSelection({preferredId="",storageKey=""}={}){const activeStorageKey=computed(()=>readStorageKey(storageKey));const activePreferredId=computed(()=>readPreferredId(preferredId));const selectedId=ref(activePreferredId.value||readStoredValue(activeStorageKey.value));function select(id=""){selectedId.value=String(id||"").trim();writeStoredValue(activeStorageKey.value,selectedId.value)}function clear(){select("")}function selectAvailableId(items=[],{fallbackId="",getId=item=>item==null?void 0:item.id}={}){if(items.length===0){clear();return""}const itemIds=items.map(item=>String(getId(item)||"").trim()).filter(Boolean);const preferredSelectionId=activePreferredId.value;if(itemIds.includes(preferredSelectionId)){select(preferredSelectionId);return selectedId.value}if(itemIds.includes(selectedId.value)){select(selectedId.value);return selectedId.value}const rememberedId=readStoredValue(activeStorageKey.value);const nextId=itemIds.includes(rememberedId)?rememberedId:String(fallbackId||"").trim();select(nextId);return selectedId.value}watch(activeStorageKey,nextStorageKey=>{selectedId.value=activePreferredId.value||readStoredValue(nextStorageKey)});watch(activePreferredId,nextPreferredId=>{if(nextPreferredId){selectedId.value=nextPreferredId}});return{clear,select,selectAvailableId,selectedId}}function selectedSessionIdFromRoute(route={}){var _a;const rawValue=(_a=route==null?void 0:route.query)==null?void 0:_a.session;const value=Array.isArray(rawValue)?rawValue[0]:rawValue;return String(value||"").trim()}function useVibe64SessionSelection({projectSlug=useVibe64ProjectSlug(),route=useRoute()}={}){return useStoredSelection({preferredId:computed(()=>selectedSessionIdFromRoute(route)),storageKey:computed(()=>selectedSessionStorageKey(unref(projectSlug)))})}export{useVibe64SessionSelection as u};
|
package/dist/assets/{vibe64RepositoryRealtime-Xo7aIksE.js → vibe64RepositoryRealtime-C2WPn5do.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as _export_sfc,a as openBlock,b as createBlock,w as withCtx,j as createTextVNode,t as toDisplayString,i as unref,aB as mdiRobotOutline,n as VBtn}from"./index-
|
|
1
|
+
import{_ as _export_sfc,a as openBlock,b as createBlock,w as withCtx,j as createTextVNode,t as toDisplayString,i as unref,aB as mdiRobotOutline,n as VBtn}from"./index-C4KnwA0g.js";const _sfc_main={__name:"Vibe64TemporaryAiFixAction",props:{disabled:{default:false,type:Boolean},pending:{default:false,type:Boolean},title:{default:"Open Temporary AI to diagnose and repair this problem",type:String}},emits:["click"],setup(__props,{emit:__emit}){const emit=__emit;return(_ctx,_cache)=>{return openBlock(),createBlock(VBtn,{"aria-label":"Fix it with AI","aria-busy":__props.pending?"true":void 0,class:"vibe64-temporary-ai-fix-action",disabled:__props.disabled||__props.pending,"prepend-icon":unref(mdiRobotOutline),size:"small",title:__props.title,type:"button",variant:"tonal",onClick:_cache[0]||(_cache[0]=$event=>emit("click"))},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.pending?"Opening…":"Fix it with AI"),1)]),_:1},8,["aria-busy","disabled","prepend-icon","title"])}}};const Vibe64TemporaryAiFixAction=_export_sfc(_sfc_main,[["__scopeId","data-v-2256ab67"]]);const REPOSITORY_STATUS_SESSION_REASONS=new Set(["codex-app-server-turn-idle","codex-turn-checkpoint-failed","codex-turn-checkpoint-updated","opencode-server-turn-idle","repository-canonical-changed","session-repository-checked","session-save-completed","session-save-failed","session-save-started","session-update-completed","session-update-failed","session-update-started","session-work-saved","session-work-updated"]);const REPOSITORY_CANONICAL_RECHECK_REASONS=new Set(["repository-canonical-changed","session-save-failed","session-update-failed"]);function repositoryStatusSessionId(payload={}){var _a;return String((payload==null?void 0:payload.sessionId)||((_a=payload==null?void 0:payload.session)==null?void 0:_a.sessionId)||"").trim()}function repositoryStatusRealtimeShouldRefresh(payload={}){return REPOSITORY_STATUS_SESSION_REASONS.has(String((payload==null?void 0:payload.reason)||"").trim())}function repositoryStatusRealtimeNeedsCanonicalCheck(payload={}){return REPOSITORY_CANONICAL_RECHECK_REASONS.has(String((payload==null?void 0:payload.reason)||"").trim())}export{Vibe64TemporaryAiFixAction as V,repositoryStatusRealtimeShouldRefresh as a,repositoryStatusRealtimeNeedsCanonicalCheck as b,repositoryStatusSessionId as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dw as mdiIdentifier,cu as mdiFolderOutline,dx as mdiFolderHomeOutline,d9 as mdiSourceBranch,db as mdiSourceCommit,aB as mdiRobotOutline,dy as mdiCalendarClockOutline,aX as mdiGithub}from"./index-
|
|
1
|
+
import{dw as mdiIdentifier,cu as mdiFolderOutline,dx as mdiFolderHomeOutline,d9 as mdiSourceBranch,db as mdiSourceCommit,aB as mdiRobotOutline,dy as mdiCalendarClockOutline,aX as mdiGithub}from"./index-C4KnwA0g.js";import{s as shortVibe64SessionId}from"./vibe64SessionViewModel-C4e2otoM.js";function text(value=""){return String(value||"").trim()}function plainObject(value=null){return value&&typeof value==="object"&&!Array.isArray(value)?value:{}}function safeRepositoryRemote(value=""){const remote=text(value);if(!remote||/[\r\n\0]/u.test(remote)){return""}try{const url=new URL(remote);url.username="";url.password="";url.search="";url.hash="";return url.toString()}catch{return/^git@[^\s/:]+:[^\s]+$/u.test(remote)?remote:""}}function githubRepositoryName(project={}){var _a;const github=plainObject(project.githubRepository||((_a=project.repository)==null?void 0:_a.github));return text(github.fullName||github.repository||github.name)}function repositoryFact(session={},project={}){var _a,_b,_c,_d;const metadata=plainObject(session.metadata);const fullName=githubRepositoryName(project);const remote=safeRepositoryRemote(metadata.source_remote_url||((_b=(_a=project.repository)==null?void 0:_a.github)==null?void 0:_b.cloneUrl)||((_c=project.githubRepository)==null?void 0:_c.cloneUrl)||((_d=project.repository)==null?void 0:_d.remoteUrl));if(!fullName&&!remote){return null}const href=remote.startsWith("https://")||remote.startsWith("http://")?remote.replace(/\.git$/u,""):"";return{copyValue:remote||fullName,detail:remote&&fullName?remote:"Canonical Git remote",href,icon:mdiGithub,key:"repository",label:"Repository",value:fullName||remote}}function vibe64SessionInfoFacts(session=null,project={}){var _a;if(!session||typeof session!=="object"||Array.isArray(session)){return[]}const metadata=plainObject(session.metadata);const agentSession=plainObject(session.agentSession);const agentThread=plainObject(agentSession.thread);const agentTurn=plainObject(agentSession.turn);const sessionId=text(session.sessionId);const sessionRoot=text(session.sessionRoot);const sourcePath=text(session.sourcePath||session.source||metadata.source_path);const projectSource=text(project.sourceRoot);const branch=text(metadata.branch||session.branch);const baseBranch=text(metadata.base_branch||metadata.source_default_branch);const baseCommit=text(metadata.base_commit);const threadId=text(agentThread.id||agentTurn.threadId);const turnId=text(agentTurn.id||agentTurn.turnId);const createdAt=text(((_a=session.manifest)==null?void 0:_a.createdAt)||session.createdAt);const repository=repositoryFact(session,project);return[{copyValue:sessionId,detail:"Vibe64 session identifier",icon:mdiIdentifier,key:"session",label:"Session",value:shortVibe64SessionId(sessionId),visible:Boolean(sessionId)},{copyValue:sourcePath,detail:session.sourceReady===false?"Session source is not ready":"Session source",icon:mdiFolderOutline,key:"source",label:"Source",value:sourcePath,visible:Boolean(sourcePath)},{copyValue:projectSource,detail:"Project checkout used as the session baseline",icon:mdiFolderHomeOutline,key:"project-source",label:"Project baseline",value:projectSource,visible:Boolean(projectSource&&projectSource!==sourcePath)},{copyValue:sessionRoot,detail:"Vibe64 conversation and runtime state",icon:mdiFolderOutline,key:"session-state",label:"Session state",value:sessionRoot,visible:Boolean(sessionRoot)},{copyValue:branch,detail:"Session branch remains recoverable in Git",icon:mdiSourceBranch,key:"branch",label:"Branch",value:branch,visible:Boolean(branch)},{copyValue:baseBranch,detail:baseCommit?`Based on ${baseCommit.slice(0,12)}`:"Project branch cloned for this session",icon:mdiSourceBranch,key:"base-branch",label:"Base branch",value:baseBranch,visible:Boolean(baseBranch)},{copyValue:baseCommit,detail:"Exact project baseline commit",icon:mdiSourceCommit,key:"base-commit",label:"Base commit",value:baseCommit.slice(0,12),visible:Boolean(baseCommit)},repository,{copyValue:threadId,detail:"Provider thread used to continue this conversation",icon:mdiRobotOutline,key:"agent-thread",label:"Agent thread",value:threadId,visible:Boolean(threadId)},{copyValue:turnId,detail:"Most recently observed provider turn",icon:mdiRobotOutline,key:"agent-turn",label:"Agent turn",value:turnId,visible:Boolean(turnId)},{copyValue:createdAt,detail:"Session creation time",icon:mdiCalendarClockOutline,key:"created-at",label:"Created",value:createdAt,visible:Boolean(createdAt)}].filter(fact=>(fact==null?void 0:fact.visible)!==false&&(fact==null?void 0:fact.value))}function vibe64SessionInfoText(facts=[],{status=""}={}){const lines=(Array.isArray(facts)?facts:[]).map(fact=>{const value=text((fact==null?void 0:fact.copyValue)||(fact==null?void 0:fact.value));return value?`${text(fact==null?void 0:fact.label)||"Value"}: ${value}`:""}).filter(Boolean);const normalizedStatus=text(status);if(normalizedStatus){lines.splice(1,0,`Status: ${normalizedStatus.replaceAll("_"," ")}`)}return lines.join("\n")}export{vibe64SessionInfoText as a,vibe64SessionInfoFacts as v};
|
package/dist/assets/{vibe64SessionPanelModel-5UED-6V-.js → vibe64SessionPanelModel-DDaXjAJ_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dA as isVibe64DebugLoggingEnabled,dB as isVibe64BrowserFlagEnabled}from"./index-
|
|
1
|
+
import{dA as isVibe64DebugLoggingEnabled,dB as isVibe64BrowserFlagEnabled}from"./index-C4KnwA0g.js";import{d as isOpenVibe64Session}from"./vibe64SessionViewModel-C4e2otoM.js";const VIBE64_SESSION_DEBUG_MARKER="VIBE64_SESSION_DEBUG";const VIBE64_SESSION_DEBUG_ENV="VIBE64_SESSION_DEBUG";const VIBE64_SESSION_DEBUG_QUERY_PARAM="vibe64_session_debug";const VIBE64_SESSION_DEBUG_STORAGE_KEY="vibe64:session-debug";function normalizeErrorStatus(error={}){const status=Number((error==null?void 0:error.status)??(error==null?void 0:error.statusCode));return Number.isInteger(status)?status:null}function normalizeErrorStack(error={}){return typeof(error==null?void 0:error.stack)==="string"?error.stack:""}function normalizeErrorCause(error={}){const cause=error==null?void 0:error.cause;if(!cause){return null}return{code:String((cause==null?void 0:cause.code)||""),message:String((cause==null?void 0:cause.message)||cause||""),name:String((cause==null?void 0:cause.name)||""),status:normalizeErrorStatus(cause),stack:normalizeErrorStack(cause)}}function vibe64SessionDebugError(error={}){return{code:String((error==null?void 0:error.code)||""),message:String((error==null?void 0:error.message)||error||""),name:String((error==null?void 0:error.name)||""),status:normalizeErrorStatus(error),stack:normalizeErrorStack(error),cause:normalizeErrorCause(error)}}function vibe64SessionDebugDurationMs(startedAtMs){return Math.max(0,Date.now()-Number(startedAtMs||Date.now()))}function vibe64SessionDebugEnabled({env=(_a=>(_a=globalThis==null?void 0:globalThis.process)==null?void 0:_a.env)()||{},globalObject=globalThis,level=""}={}){return isVibe64DebugLoggingEnabled({env,flagName:VIBE64_SESSION_DEBUG_ENV,level})||isVibe64BrowserFlagEnabled({globalObject,queryParam:VIBE64_SESSION_DEBUG_QUERY_PARAM,storageKey:VIBE64_SESSION_DEBUG_STORAGE_KEY})}function vibe64SessionDebugLog(event="",details={},options={}){const timestamp=new Date().toISOString();const entry={marker:VIBE64_SESSION_DEBUG_MARKER,timestamp,event:String(event||""),...details&&typeof details==="object"&&!Array.isArray(details)?details:{}};entry.marker=VIBE64_SESSION_DEBUG_MARKER;entry.timestamp=timestamp;if(!vibe64SessionDebugEnabled(options)){return entry}const logger=globalThis.console;if(!logger||typeof logger.info!=="function"){return entry}try{logger.info(`[${VIBE64_SESSION_DEBUG_MARKER}] ${JSON.stringify(entry)}`)}catch{logger.info(`[${VIBE64_SESSION_DEBUG_MARKER}] ${timestamp} ${entry.event}`)}return entry}function vibe64SessionDebugSummary(session={}){return{revision:Number(session==null?void 0:session.revision)||0,sessionId:String((session==null?void 0:session.sessionId)||""),sourceReady:(session==null?void 0:session.sourceReady)===true,status:String((session==null?void 0:session.status)||"")}}const MANAGED_SESSION_SOURCE_AUTHORITY="managed_session_source";function normalizePath(value=""){return String(value||"").trim().replace(/\/+$/u,"")}function pathInsideOrEqual(parentPath="",childPath=""){const parent=normalizePath(parentPath);const child=normalizePath(childPath);return Boolean(parent&&child&&(child===parent||child.startsWith(`${parent}/`)))}function explicitPathIsManagedSessionSource(session={},explicitPath=""){const metadata=(session==null?void 0:session.metadata)||{};if(String(metadata.source_path_authority||"").trim()!==MANAGED_SESSION_SOURCE_AUTHORITY){return false}if(String(metadata.source_kind||"").trim()!=="session_clone"){return false}const normalizedPath=normalizePath(explicitPath);const sessionRoot=normalizePath(session==null?void 0:session.sessionRoot);const sessionId=String((session==null?void 0:session.sessionId)||(session==null?void 0:session.id)||"").trim();if(!normalizedPath||!sessionId||sessionRoot&&pathInsideOrEqual(sessionRoot,normalizedPath)){return false}return normalizedPath.endsWith(`/sessions/active/${sessionId}/source`)}function explicitSessionSourcePath(session={}){const metadata=(session==null?void 0:session.metadata)||{};if(String(metadata.source_removed||"").trim().toLowerCase()==="yes"){return""}const explicitPath=normalizePath(metadata.source_path||metadata.source||(session==null?void 0:session.source)||(session==null?void 0:session.sourcePath));if(!explicitPath){return""}return explicitPathIsManagedSessionSource(session,explicitPath)?explicitPath:""}function vibe64SessionSourcePath(session={}){return explicitSessionSourcePath(session)}function visibleVibe64Sessions(sessions=[]){return sessions.filter(isOpenVibe64Session).sort((left,right)=>{var _a,_b;return String(left.createdAt||((_a=left.manifest)==null?void 0:_a.createdAt)||left.sessionId||"").localeCompare(String(right.createdAt||((_b=right.manifest)==null?void 0:_b.createdAt)||right.sessionId||""))})}function blockingVibe64SessionPageError({hasMountedRuntime=false,runtimePageError="",selectedSession=null,selectedSessionLoadError="",sessionListLoadError="",sessions=[]}={}){const runtimeError=String(runtimePageError||"").trim();if(runtimeError){return runtimeError}const hasSelectedSession=Boolean((selectedSession==null?void 0:selectedSession.sessionId)||selectedSession);const listError=String(sessionListLoadError||"").trim();if(listError&&!hasMountedRuntime&&!hasSelectedSession&&sessions.length<1){return listError}const selectedError=String(selectedSessionLoadError||"").trim();return selectedError&&!hasMountedRuntime&&!hasSelectedSession?selectedError:""}function enrichVibe64SessionForDisplay(session=null){if(!session){return null}const metadata=session.metadata||{};const source=vibe64SessionSourcePath(session);const sourceRemoved=String(metadata.source_removed||"").trim().toLowerCase()==="yes";return{...session,sessionName:session.sessionName||metadata.label||"",source,sourceReady:!sourceRemoved&&(session.sourceReady===true||Boolean(source))}}export{vibe64SessionDebugLog as a,vibe64SessionDebugError as b,vibe64SessionDebugDurationMs as c,vibe64SessionDebugSummary as d,enrichVibe64SessionForDisplay as e,blockingVibe64SessionPageError as f,visibleVibe64Sessions as g,vibe64SessionSourcePath as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dz as vibe64ProjectQueryScope,aJ as vibe64ProjectScopedStorageKey}from"./index-SBc6H2In.js";const VIBE64_SESSIONS_API_SUFFIX="/vibe64/sessions";const VIBE64_ARCHIVED_SESSIONS_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/archived`;const VIBE64_ASSISTANTS_API_SUFFIX="/vibe64/assistants/capabilities";const VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX="/vibe64/assistants/model-access";const VIBE64_CURRENT_SESSION_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/current`;const VIBE64_API_SUFFIX="/vibe64";const VIBE64_SESSION_CHANGED_EVENT="vibe64.session.changed";const VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT="vibe64.source-editor.file.changed";const VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT="vibe64.source-editor.sync.error";const VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT="vibe64.source-editor.sync.ready";const SELECTED_SESSION_STORAGE_KEY="vibe64:selected-session-id";function selectedSessionStorageKey(projectSlug){return vibe64ProjectScopedStorageKey(SELECTED_SESSION_STORAGE_KEY,projectSlug)}function vibe64SessionsQueryKey(surfaceId,ownershipFilter,projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"sessions"]}function vibe64SessionQueryKey(surfaceId,ownershipFilter,projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"session"]}function vibe64AssistantCapabilitiesQueryKey(surfaceId,ownershipFilter,projectSlug,scope="overview"){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"assistant-capabilities",String(scope||"overview")]}function encodePathSegment(value=""){return encodeURIComponent(String(value||"").trim())}function vibe64SessionPath(sessionsApiPath="",sessionId="",suffix=""){return`${sessionsApiPath}/${encodePathSegment(sessionId)}${suffix}`}function vibe64AssistantModelAccessPath(capabilitiesApiPath=""){return String(capabilitiesApiPath||"").replace(/\/assistants\/capabilities(?=\?|#|$)/u,"/assistants/model-access")}function vibe64RepositoryApiPath(sessionsApiPath=""){const normalized=String(sessionsApiPath||"").replace(/\/+$/u,"");return normalized.endsWith(VIBE64_SESSIONS_API_SUFFIX)?`${normalized.slice(0,-VIBE64_SESSIONS_API_SUFFIX.length)}/vibe64/repository`:`${normalized}/repository`}function vibe64RepositoryHistoryPath(sessionsApiPath="",options={}){const params=new URLSearchParams;const sessionId=String((options==null?void 0:options.sessionId)||"").trim();const cursor=String((options==null?void 0:options.cursor)||"").trim();if(sessionId){params.set("sessionId",sessionId)}if(cursor){params.set("cursor",cursor)}const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionFilesPath(sessionsApiPath="",commit="",options={}){const params=new URLSearchParams;const sessionId=String((options==null?void 0:options.sessionId)||"").trim();const historySnapshotCommit=String((options==null?void 0:options.historySnapshotCommit)||"").trim();if(sessionId){params.set("sessionId",sessionId)}if(historySnapshotCommit){params.set("historySnapshotCommit",historySnapshotCommit)}if(Number.isInteger(Number(options==null?void 0:options.offset))&&Number(options.offset)>0){params.set("offset",String(Number(options.offset)))}if(Number.isInteger(Number(options==null?void 0:options.limit))&&Number(options.limit)>0){params.set("limit",String(Number(options.limit)))}const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/files`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionDiffPath(sessionsApiPath="",commit="",sourcePath="",options={}){const params=new URLSearchParams({path:String(sourcePath||"")});const sessionId=String((options==null?void 0:options.sessionId)||"").trim();const historySnapshotCommit=String((options==null?void 0:options.historySnapshotCommit)||"").trim();if(sessionId){params.set("sessionId",sessionId)}if(historySnapshotCommit){params.set("historySnapshotCommit",historySnapshotCommit)}return`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/diff?${params.toString()}`}function vibe64SessionChangesPath(sessionsApiPath="",sessionId="",options={}){const params=new URLSearchParams;if(Number.isInteger(Number(options==null?void 0:options.offset))&&Number(options.offset)>0){params.set("offset",String(Number(options.offset)))}if(Number.isInteger(Number(options==null?void 0:options.limit))&&Number(options.limit)>0){params.set("limit",String(Number(options.limit)))}const query=params.toString();const base=vibe64SessionPath(sessionsApiPath,sessionId,"/changes");return query?`${base}?${query}`:base}function vibe64SessionCheckUpdatesPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/updates/check")}function vibe64SessionChangeDiffPath(sessionsApiPath="",sessionId="",sourcePath=""){return`${vibe64SessionPath(sessionsApiPath,sessionId,"/changes/diff")}?path=${encodeURIComponent(String(sourcePath||""))}`}function vibe64AgentAttachmentPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/agent-attachments")}function vibe64AgentAttachmentFilePath(sessionsApiPath="",sessionId="",attachmentId=""){return`${vibe64AgentAttachmentPath(sessionsApiPath,sessionId)}/${encodePathSegment(attachmentId)}`}function vibe64TemporaryConversationsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/temporary-conversations")}function vibe64TemporaryConversationPath(sessionsApiPath="",sessionId="",conversationId=""){return`${vibe64TemporaryConversationsPath(sessionsApiPath,sessionId)}/${encodePathSegment(conversationId)}`}function vibe64TemporaryConversationTurnsPath(sessionsApiPath="",sessionId="",conversationId=""){return`${vibe64TemporaryConversationPath(sessionsApiPath,sessionId,conversationId)}/turns`}function vibe64TemporaryConversationStopPath(sessionsApiPath="",sessionId="",conversationId=""){return`${vibe64TemporaryConversationPath(sessionsApiPath,sessionId,conversationId)}/stop`}function vibe64AgentTerminalPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/agent-terminal/${encodePathSegment(terminalSessionId)}`:"/agent-terminal")}function vibe64AgentTerminalControlTextPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return`${vibe64AgentTerminalPath(sessionsApiPath,sessionId,terminalSessionId)}/control/text`}function vibe64GlobalCodexTerminalPath(vibe64ApiPath="",terminalSessionId=""){return terminalSessionId?`${vibe64ApiPath}/codex-terminal/${encodePathSegment(terminalSessionId)}`:`${vibe64ApiPath}/codex-terminal`}function vibe64ConversationLogPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/conversation-log")}function vibe64SessionPromptHintsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/prompt-hints")}function vibe64SessionPromptHintsCancelPath(sessionsApiPath="",sessionId=""){return`${vibe64SessionPromptHintsPath(sessionsApiPath,sessionId)}/cancel`}function vibe64SessionPreviewStatePath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/preview-state")}function vibe64OutputsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/outputs")}function vibe64PreviewIdentityPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/preview-identity")}function vibe64OutputRunPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/output-runs/${encodePathSegment(terminalSessionId)}/terminal`:"/output-runs")}function vibe64OutputRunStopPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-runs/${encodePathSegment(terminalSessionId)}/stop`)}function vibe64OutputResultPath(sessionsApiPath="",sessionId="",resultId=""){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-results/${encodePathSegment(resultId)}`)}function vibe64SourceEditorTreePath(sessionsApiPath="",sessionId="",options={}){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/tree");const params=new URLSearchParams;const normalizedPath=String((options==null?void 0:options.path)||"").trim();if(normalizedPath){params.set("path",normalizedPath)}if(Number.isInteger(Number(options==null?void 0:options.offset))&&Number(options.offset)>0){params.set("offset",String(Number(options.offset)))}if(Number.isInteger(Number(options==null?void 0:options.limit))&&Number(options.limit)>0){params.set("limit",String(Number(options.limit)))}const query=params.toString();return query?`${basePath}?${query}`:basePath}function vibe64SourceEditorFilesPath(sessionsApiPath="",sessionId="",query=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/files");const normalizedQuery=String(query||"").trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorSearchPath(sessionsApiPath="",sessionId="",query=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/search");const normalizedQuery=String(query||"").trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorResolvePathPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/resolve-path")}function vibe64SourceEditorFilePath(sessionsApiPath="",sessionId="",sourcePath=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/file");const normalizedPath=String(sourcePath||"").trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorCreateFilePath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/file")}function vibe64SourceEditorStarsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/stars")}function vibe64SourceEditorDownloadPath(sessionsApiPath="",sessionId="",sourcePath=""){return`${vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/download")}?path=${encodeURIComponent(sourcePath)}`}function vibe64SourceEditorChangesStreamPath(sessionsApiPath="",sessionId="",sourcePath=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/changes/stream");const normalizedPath=String(sourcePath||"").trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorExplanationsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/explanations")}function vibe64SourceEditorExplanationsStreamPath(sessionsApiPath="",sessionId=""){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/stream`}function vibe64SourceEditorExplanationsCleanupPath(sessionsApiPath="",sessionId=""){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/cleanup`}function vibe64SourceEditorExplanationPath(sessionsApiPath="",sessionId="",explanationId=""){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/explanations/${encodePathSegment(explanationId)}`)}function vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath="",sessionId="",explanationId=""){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/followups`}function vibe64SourceEditorExplanationFollowupsStreamPath(sessionsApiPath="",sessionId="",explanationId=""){return`${vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath,sessionId,explanationId)}/stream`}function vibe64SourceEditorExplanationStopPath(sessionsApiPath="",sessionId="",explanationId=""){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/stop`}function vibe64ConversationLogQueryKey(surfaceId,ownershipFilter,sessionId="",projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"conversation-log",encodePathSegment(sessionId)]}function vibe64OutputsQueryKey(surfaceId,ownershipFilter,sessionId="",projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"outputs",encodePathSegment(sessionId)]}function agentSettingsInputFromContext(context={}){return(context==null?void 0:context.agentSettings)&&typeof context.agentSettings==="object"&&!Array.isArray(context.agentSettings)?{agentSettings:context.agentSettings}:{}}export{vibe64SessionPreviewStatePath as $,VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT as A,vibe64SourceEditorTreePath as B,vibe64SourceEditorFilePath as C,vibe64SourceEditorExplanationStopPath as D,vibe64SourceEditorExplanationFollowupsStreamPath as E,vibe64SourceEditorResolvePathPath as F,vibe64SourceEditorExplanationsStreamPath as G,vibe64SourceEditorCreateFilePath as H,vibe64SourceEditorExplanationPath as I,vibe64SourceEditorSearchPath as J,vibe64SourceEditorFilesPath as K,vibe64SourceEditorExplanationsCleanupPath as L,vibe64SourceEditorDownloadPath as M,VIBE64_ARCHIVED_SESSIONS_API_SUFFIX as N,vibe64SessionsQueryKey as O,vibe64ConversationLogQueryKey as P,vibe64ConversationLogPath as Q,vibe64RepositoryHistoryPath as R,vibe64RepositoryVersionDiffPath as S,vibe64RepositoryVersionFilesPath as T,vibe64SessionChangeDiffPath as U,VIBE64_SESSION_CHANGED_EVENT as V,vibe64SessionChangesPath as W,VIBE64_CURRENT_SESSION_API_SUFFIX as X,selectedSessionStorageKey as Y,vibe64OutputRunStopPath as Z,vibe64PreviewIdentityPath as _,VIBE64_ASSISTANTS_API_SUFFIX as a,vibe64OutputsPath as a0,vibe64OutputsQueryKey as a1,vibe64OutputResultPath as a2,vibe64AssistantCapabilitiesQueryKey as b,VIBE64_SESSIONS_API_SUFFIX as c,VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX as d,vibe64AssistantModelAccessPath as e,vibe64SourceEditorStarsPath as f,vibe64TemporaryConversationPath as g,vibe64AgentAttachmentFilePath as h,vibe64TemporaryConversationStopPath as i,vibe64TemporaryConversationsPath as j,vibe64TemporaryConversationTurnsPath as k,vibe64SessionPromptHintsCancelPath as l,vibe64SessionPromptHintsPath as m,vibe64SessionQueryKey as n,vibe64AgentTerminalPath as o,vibe64GlobalCodexTerminalPath as p,vibe64OutputRunPath as q,VIBE64_API_SUFFIX as r,vibe64AgentTerminalControlTextPath as s,agentSettingsInputFromContext as t,VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT as u,vibe64SessionPath as v,vibe64SessionCheckUpdatesPath as w,vibe64AgentAttachmentPath as x,vibe64SourceEditorChangesStreamPath as y,VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT as z};
|
|
1
|
+
import{dz as vibe64ProjectQueryScope,aJ as vibe64ProjectScopedStorageKey}from"./index-C4KnwA0g.js";const VIBE64_SESSIONS_API_SUFFIX="/vibe64/sessions";const VIBE64_ARCHIVED_SESSIONS_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/archived`;const VIBE64_ASSISTANTS_API_SUFFIX="/vibe64/assistants/capabilities";const VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX="/vibe64/assistants/model-access";const VIBE64_CURRENT_SESSION_API_SUFFIX=`${VIBE64_SESSIONS_API_SUFFIX}/current`;const VIBE64_API_SUFFIX="/vibe64";const VIBE64_SESSION_CHANGED_EVENT="vibe64.session.changed";const VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT="vibe64.source-editor.file.changed";const VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT="vibe64.source-editor.sync.error";const VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT="vibe64.source-editor.sync.ready";const SELECTED_SESSION_STORAGE_KEY="vibe64:selected-session-id";function selectedSessionStorageKey(projectSlug){return vibe64ProjectScopedStorageKey(SELECTED_SESSION_STORAGE_KEY,projectSlug)}function vibe64SessionsQueryKey(surfaceId,ownershipFilter,projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"sessions"]}function vibe64SessionQueryKey(surfaceId,ownershipFilter,projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"session"]}function vibe64AssistantCapabilitiesQueryKey(surfaceId,ownershipFilter,projectSlug,scope="overview"){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"assistant-capabilities",String(scope||"overview")]}function encodePathSegment(value=""){return encodeURIComponent(String(value||"").trim())}function vibe64SessionPath(sessionsApiPath="",sessionId="",suffix=""){return`${sessionsApiPath}/${encodePathSegment(sessionId)}${suffix}`}function vibe64AssistantModelAccessPath(capabilitiesApiPath=""){return String(capabilitiesApiPath||"").replace(/\/assistants\/capabilities(?=\?|#|$)/u,"/assistants/model-access")}function vibe64RepositoryApiPath(sessionsApiPath=""){const normalized=String(sessionsApiPath||"").replace(/\/+$/u,"");return normalized.endsWith(VIBE64_SESSIONS_API_SUFFIX)?`${normalized.slice(0,-VIBE64_SESSIONS_API_SUFFIX.length)}/vibe64/repository`:`${normalized}/repository`}function vibe64RepositoryHistoryPath(sessionsApiPath="",options={}){const params=new URLSearchParams;const sessionId=String((options==null?void 0:options.sessionId)||"").trim();const cursor=String((options==null?void 0:options.cursor)||"").trim();if(sessionId){params.set("sessionId",sessionId)}if(cursor){params.set("cursor",cursor)}const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionFilesPath(sessionsApiPath="",commit="",options={}){const params=new URLSearchParams;const sessionId=String((options==null?void 0:options.sessionId)||"").trim();const historySnapshotCommit=String((options==null?void 0:options.historySnapshotCommit)||"").trim();if(sessionId){params.set("sessionId",sessionId)}if(historySnapshotCommit){params.set("historySnapshotCommit",historySnapshotCommit)}if(Number.isInteger(Number(options==null?void 0:options.offset))&&Number(options.offset)>0){params.set("offset",String(Number(options.offset)))}if(Number.isInteger(Number(options==null?void 0:options.limit))&&Number(options.limit)>0){params.set("limit",String(Number(options.limit)))}const query=params.toString();const base=`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/files`;return query?`${base}?${query}`:base}function vibe64RepositoryVersionDiffPath(sessionsApiPath="",commit="",sourcePath="",options={}){const params=new URLSearchParams({path:String(sourcePath||"")});const sessionId=String((options==null?void 0:options.sessionId)||"").trim();const historySnapshotCommit=String((options==null?void 0:options.historySnapshotCommit)||"").trim();if(sessionId){params.set("sessionId",sessionId)}if(historySnapshotCommit){params.set("historySnapshotCommit",historySnapshotCommit)}return`${vibe64RepositoryApiPath(sessionsApiPath)}/history/${encodePathSegment(commit)}/diff?${params.toString()}`}function vibe64SessionChangesPath(sessionsApiPath="",sessionId="",options={}){const params=new URLSearchParams;if(Number.isInteger(Number(options==null?void 0:options.offset))&&Number(options.offset)>0){params.set("offset",String(Number(options.offset)))}if(Number.isInteger(Number(options==null?void 0:options.limit))&&Number(options.limit)>0){params.set("limit",String(Number(options.limit)))}const query=params.toString();const base=vibe64SessionPath(sessionsApiPath,sessionId,"/changes");return query?`${base}?${query}`:base}function vibe64SessionCheckUpdatesPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/updates/check")}function vibe64SessionChangeDiffPath(sessionsApiPath="",sessionId="",sourcePath=""){return`${vibe64SessionPath(sessionsApiPath,sessionId,"/changes/diff")}?path=${encodeURIComponent(String(sourcePath||""))}`}function vibe64AgentAttachmentPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/agent-attachments")}function vibe64AgentAttachmentFilePath(sessionsApiPath="",sessionId="",attachmentId=""){return`${vibe64AgentAttachmentPath(sessionsApiPath,sessionId)}/${encodePathSegment(attachmentId)}`}function vibe64TemporaryConversationsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/temporary-conversations")}function vibe64TemporaryConversationPath(sessionsApiPath="",sessionId="",conversationId=""){return`${vibe64TemporaryConversationsPath(sessionsApiPath,sessionId)}/${encodePathSegment(conversationId)}`}function vibe64TemporaryConversationTurnsPath(sessionsApiPath="",sessionId="",conversationId=""){return`${vibe64TemporaryConversationPath(sessionsApiPath,sessionId,conversationId)}/turns`}function vibe64TemporaryConversationStopPath(sessionsApiPath="",sessionId="",conversationId=""){return`${vibe64TemporaryConversationPath(sessionsApiPath,sessionId,conversationId)}/stop`}function vibe64AgentTerminalPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/agent-terminal/${encodePathSegment(terminalSessionId)}`:"/agent-terminal")}function vibe64AgentTerminalControlTextPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return`${vibe64AgentTerminalPath(sessionsApiPath,sessionId,terminalSessionId)}/control/text`}function vibe64GlobalCodexTerminalPath(vibe64ApiPath="",terminalSessionId=""){return terminalSessionId?`${vibe64ApiPath}/codex-terminal/${encodePathSegment(terminalSessionId)}`:`${vibe64ApiPath}/codex-terminal`}function vibe64ConversationLogPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/conversation-log")}function vibe64SessionPromptHintsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/prompt-hints")}function vibe64SessionPromptHintsCancelPath(sessionsApiPath="",sessionId=""){return`${vibe64SessionPromptHintsPath(sessionsApiPath,sessionId)}/cancel`}function vibe64SessionPreviewStatePath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/preview-state")}function vibe64OutputsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/outputs")}function vibe64PreviewIdentityPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/preview-identity")}function vibe64OutputRunPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,terminalSessionId?`/output-runs/${encodePathSegment(terminalSessionId)}/terminal`:"/output-runs")}function vibe64OutputRunStopPath(sessionsApiPath="",sessionId="",terminalSessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-runs/${encodePathSegment(terminalSessionId)}/stop`)}function vibe64OutputResultPath(sessionsApiPath="",sessionId="",resultId=""){return vibe64SessionPath(sessionsApiPath,sessionId,`/output-results/${encodePathSegment(resultId)}`)}function vibe64SourceEditorTreePath(sessionsApiPath="",sessionId="",options={}){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/tree");const params=new URLSearchParams;const normalizedPath=String((options==null?void 0:options.path)||"").trim();if(normalizedPath){params.set("path",normalizedPath)}if(Number.isInteger(Number(options==null?void 0:options.offset))&&Number(options.offset)>0){params.set("offset",String(Number(options.offset)))}if(Number.isInteger(Number(options==null?void 0:options.limit))&&Number(options.limit)>0){params.set("limit",String(Number(options.limit)))}const query=params.toString();return query?`${basePath}?${query}`:basePath}function vibe64SourceEditorFilesPath(sessionsApiPath="",sessionId="",query=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/files");const normalizedQuery=String(query||"").trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorSearchPath(sessionsApiPath="",sessionId="",query=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/search");const normalizedQuery=String(query||"").trim();return normalizedQuery?`${basePath}?q=${encodeURIComponent(normalizedQuery)}`:basePath}function vibe64SourceEditorResolvePathPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/resolve-path")}function vibe64SourceEditorFilePath(sessionsApiPath="",sessionId="",sourcePath=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/file");const normalizedPath=String(sourcePath||"").trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorCreateFilePath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/file")}function vibe64SourceEditorStarsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/stars")}function vibe64SourceEditorDownloadPath(sessionsApiPath="",sessionId="",sourcePath=""){return`${vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/download")}?path=${encodeURIComponent(sourcePath)}`}function vibe64SourceEditorChangesStreamPath(sessionsApiPath="",sessionId="",sourcePath=""){const basePath=vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/changes/stream");const normalizedPath=String(sourcePath||"").trim();return normalizedPath?`${basePath}?path=${encodeURIComponent(normalizedPath)}`:basePath}function vibe64SourceEditorExplanationsPath(sessionsApiPath="",sessionId=""){return vibe64SessionPath(sessionsApiPath,sessionId,"/source-editor/explanations")}function vibe64SourceEditorExplanationsStreamPath(sessionsApiPath="",sessionId=""){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/stream`}function vibe64SourceEditorExplanationsCleanupPath(sessionsApiPath="",sessionId=""){return`${vibe64SourceEditorExplanationsPath(sessionsApiPath,sessionId)}/cleanup`}function vibe64SourceEditorExplanationPath(sessionsApiPath="",sessionId="",explanationId=""){return vibe64SessionPath(sessionsApiPath,sessionId,`/source-editor/explanations/${encodePathSegment(explanationId)}`)}function vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath="",sessionId="",explanationId=""){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/followups`}function vibe64SourceEditorExplanationFollowupsStreamPath(sessionsApiPath="",sessionId="",explanationId=""){return`${vibe64SourceEditorExplanationFollowupsPath(sessionsApiPath,sessionId,explanationId)}/stream`}function vibe64SourceEditorExplanationStopPath(sessionsApiPath="",sessionId="",explanationId=""){return`${vibe64SourceEditorExplanationPath(sessionsApiPath,sessionId,explanationId)}/stop`}function vibe64ConversationLogQueryKey(surfaceId,ownershipFilter,sessionId="",projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"conversation-log",encodePathSegment(sessionId)]}function vibe64OutputsQueryKey(surfaceId,ownershipFilter,sessionId="",projectSlug){return["vibe64",...vibe64ProjectQueryScope(projectSlug),surfaceId,ownershipFilter,"outputs",encodePathSegment(sessionId)]}function agentSettingsInputFromContext(context={}){return(context==null?void 0:context.agentSettings)&&typeof context.agentSettings==="object"&&!Array.isArray(context.agentSettings)?{agentSettings:context.agentSettings}:{}}export{vibe64SessionPreviewStatePath as $,VIBE64_SOURCE_EDITOR_SYNC_ERROR_EVENT as A,vibe64SourceEditorTreePath as B,vibe64SourceEditorFilePath as C,vibe64SourceEditorExplanationStopPath as D,vibe64SourceEditorExplanationFollowupsStreamPath as E,vibe64SourceEditorResolvePathPath as F,vibe64SourceEditorExplanationsStreamPath as G,vibe64SourceEditorCreateFilePath as H,vibe64SourceEditorExplanationPath as I,vibe64SourceEditorSearchPath as J,vibe64SourceEditorFilesPath as K,vibe64SourceEditorExplanationsCleanupPath as L,vibe64SourceEditorDownloadPath as M,VIBE64_ARCHIVED_SESSIONS_API_SUFFIX as N,vibe64SessionsQueryKey as O,vibe64ConversationLogQueryKey as P,vibe64ConversationLogPath as Q,vibe64RepositoryHistoryPath as R,vibe64RepositoryVersionDiffPath as S,vibe64RepositoryVersionFilesPath as T,vibe64SessionChangeDiffPath as U,VIBE64_SESSION_CHANGED_EVENT as V,vibe64SessionChangesPath as W,VIBE64_CURRENT_SESSION_API_SUFFIX as X,selectedSessionStorageKey as Y,vibe64OutputRunStopPath as Z,vibe64PreviewIdentityPath as _,VIBE64_ASSISTANTS_API_SUFFIX as a,vibe64OutputsPath as a0,vibe64OutputsQueryKey as a1,vibe64OutputResultPath as a2,vibe64AssistantCapabilitiesQueryKey as b,VIBE64_SESSIONS_API_SUFFIX as c,VIBE64_ASSISTANT_MODEL_ACCESS_API_SUFFIX as d,vibe64AssistantModelAccessPath as e,vibe64SourceEditorStarsPath as f,vibe64TemporaryConversationPath as g,vibe64AgentAttachmentFilePath as h,vibe64TemporaryConversationStopPath as i,vibe64TemporaryConversationsPath as j,vibe64TemporaryConversationTurnsPath as k,vibe64SessionPromptHintsCancelPath as l,vibe64SessionPromptHintsPath as m,vibe64SessionQueryKey as n,vibe64AgentTerminalPath as o,vibe64GlobalCodexTerminalPath as p,vibe64OutputRunPath as q,VIBE64_API_SUFFIX as r,vibe64AgentTerminalControlTextPath as s,agentSettingsInputFromContext as t,VIBE64_SOURCE_EDITOR_FILE_CHANGED_EVENT as u,vibe64SessionPath as v,vibe64SessionCheckUpdatesPath as w,vibe64AgentAttachmentPath as x,vibe64SourceEditorChangesStreamPath as y,VIBE64_SOURCE_EDITOR_SYNC_READY_EVENT as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{eQ as deepFreeze,av as mdiInformationOutline,eR as mdiFileCompare,cI as mdiSourceRepository,cy as mdiFileCodeOutline,e0 as mdiDatabaseOutline,e1 as mdiGraphOutline,aB as mdiRobotOutline}from"./index-
|
|
1
|
+
import{eQ as deepFreeze,av as mdiInformationOutline,eR as mdiFileCompare,cI as mdiSourceRepository,cy as mdiFileCodeOutline,e0 as mdiDatabaseOutline,e1 as mdiGraphOutline,aB as mdiRobotOutline}from"./index-C4KnwA0g.js";const VIBE64_ACTIVE_SESSION_NAV_TARGET="page.active-session-nav";const VIBE64_ACTIVE_SESSION_NAV_OWNER="vibe64-session";const VIBE64_SESSION_TOOL_DEFINITIONS=deepFreeze([{icon:mdiInformationOutline,id:"info",label:"Session info",order:100,routeSegment:"session",title:"View paths and Git context for the active session"},{icon:mdiFileCompare,id:"changes",label:"Current changes",order:150,routeSegment:"changes",title:"Review files changed in this session"},{icon:mdiSourceRepository,id:"repository",label:"Repository",order:175,routeSegment:"repository",title:"Review saved versions and update this session"},{icon:mdiFileCodeOutline,id:"editor",label:"Files",order:200,routeSegment:"files",title:"Browse, edit, and explain session source files"},{icon:mdiDatabaseOutline,id:"database",label:"Database",order:225,routeSegment:"database",title:"Query, edit, and map the active session database"},{icon:mdiGraphOutline,id:"system",label:"Subsystems",order:250,routeSegment:"system",title:"Explore subsystem responsibilities, operations, data, and Cities"},{icon:mdiRobotOutline,id:"ai-terminal",label:"AI Terminal",order:700,routeSegment:"ai-terminal",title:"Open the active session AI terminal"}]);function normalizeSessionToolRouteSegment(value=""){return String(value||"").trim().replace(/^\/+|\/+$/gu,"")}function vibe64SessionToolDefinition(toolId=""){const normalizedId=String(toolId||"").trim();return VIBE64_SESSION_TOOL_DEFINITIONS.find(tool=>tool.id===normalizedId)||null}function vibe64SessionToolRouteSegment(toolId=""){const tool=vibe64SessionToolDefinition(toolId);return normalizeSessionToolRouteSegment((tool==null?void 0:tool.routeSegment)||(tool==null?void 0:tool.id)||"")}function vibe64SessionToolIdFromRouteSegment(routeSegment=""){var _a;const normalizedSegment=normalizeSessionToolRouteSegment(routeSegment);return((_a=VIBE64_SESSION_TOOL_DEFINITIONS.find(tool=>normalizeSessionToolRouteSegment(tool.routeSegment||tool.id)===normalizedSegment))==null?void 0:_a.id)||""}function vibe64SessionToolDashboardSuffix(toolId=""){const routeSegment=vibe64SessionToolRouteSegment(toolId);return routeSegment?`/dashboard/${routeSegment}`:""}export{VIBE64_SESSION_TOOL_DEFINITIONS as V,vibe64SessionToolIdFromRouteSegment as a,VIBE64_ACTIVE_SESSION_NAV_OWNER as b,VIBE64_ACTIVE_SESSION_NAV_TARGET as c,vibe64SessionToolDashboardSuffix as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as unref}from"./index-
|
|
1
|
+
import{i as unref}from"./index-C4KnwA0g.js";function readRefOrGetterValue(value){return unref(typeof value==="function"?value():value)}export{readRefOrGetterValue as r};
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/assets/favicon-B93tlu1U.svg" />
|
|
7
7
|
<title>Studio</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-C4KnwA0g.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-B0R44Dvo.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|