Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc525cda50 | ||
|
|
d995d1004b | ||
|
|
0dedf82dea | ||
|
|
6f34ad3e87 | ||
|
|
62cf461759 | ||
|
|
23c18fda7a | ||
|
|
c0bb237345 |
No files matched your search
@@ -57,11 +57,11 @@ describe("ElectronProtocol", () => {
|
||||
assert.equal(yield* Effect.promise(() => response.text()), "ok");
|
||||
assert.include(
|
||||
response.headers.get("content-security-policy") ?? "",
|
||||
"script-src 'self' 'unsafe-inline' 'wasm-unsafe-eval' https://clerk.t3.codes https://challenges.cloudflare.com",
|
||||
"script-src 'self' 'unsafe-inline' https://clerk.t3.codes https://challenges.cloudflare.com",
|
||||
);
|
||||
assert.include(
|
||||
response.headers.get("content-security-policy") ?? "",
|
||||
"connect-src 'self' data: http: https: ws: wss:",
|
||||
"connect-src 'self' http: https: ws: wss:",
|
||||
);
|
||||
assert.include(
|
||||
response.headers.get("content-security-policy") ?? "",
|
||||
@@ -212,18 +212,10 @@ describe("ElectronProtocol", () => {
|
||||
assert.deepEqual(directives["script-src"], [
|
||||
"'self'",
|
||||
"'unsafe-inline'",
|
||||
"'wasm-unsafe-eval'",
|
||||
"https://clerk.t3.codes",
|
||||
"https://challenges.cloudflare.com",
|
||||
]);
|
||||
assert.deepEqual(directives["connect-src"], [
|
||||
"'self'",
|
||||
"data:",
|
||||
"http:",
|
||||
"https:",
|
||||
"ws:",
|
||||
"wss:",
|
||||
]);
|
||||
assert.deepEqual(directives["connect-src"], ["'self'", "http:", "https:", "ws:", "wss:"]);
|
||||
assert.deepEqual(directives["img-src"], [
|
||||
"'self'",
|
||||
"t3code:",
|
||||
|
||||
@@ -71,8 +71,6 @@ export function makeDesktopContentSecurityPolicy(input: DesktopProtocolRegistrat
|
||||
const scriptSources = [
|
||||
"'self'",
|
||||
"'unsafe-inline'",
|
||||
// Required to compile the ghostty-web terminal's WebAssembly module.
|
||||
"'wasm-unsafe-eval'",
|
||||
...(clerkOrigin ? [clerkOrigin] : []),
|
||||
"https://challenges.cloudflare.com",
|
||||
];
|
||||
@@ -81,8 +79,7 @@ export function makeDesktopContentSecurityPolicy(input: DesktopProtocolRegistrat
|
||||
// the build-configured Clerk, relay, and OTLP endpoints. Those environment
|
||||
// origins are not known when this response policy is created, so restrict
|
||||
// connections by the network schemes the client supports instead of by host.
|
||||
// data: allows ghostty-web to fetch its embedded WebAssembly payload.
|
||||
const connectSources = ["'self'", "data:", "http:", "https:", "ws:", "wss:"];
|
||||
const connectSources = ["'self'", "http:", "https:", "ws:", "wss:"];
|
||||
|
||||
return [
|
||||
"default-src 'self'",
|
||||
|
||||
@@ -28,6 +28,50 @@ Start Metro for the dev client:
|
||||
vp run dev:client
|
||||
```
|
||||
|
||||
### Android
|
||||
|
||||
Local Android builds require Android Studio, JDK 17, and an Android SDK. On an Apple Silicon Mac,
|
||||
the following setup installs the API 36.1 emulator used to exercise promoted ongoing notifications
|
||||
(Android Live Updates):
|
||||
|
||||
```bash
|
||||
brew install --cask android-studio android-commandlinetools
|
||||
brew install openjdk@17
|
||||
|
||||
export JAVA_HOME="/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home"
|
||||
export ANDROID_HOME="$HOME/Library/Android/sdk"
|
||||
export ANDROID_SDK_ROOT="$ANDROID_HOME"
|
||||
export PATH="$JAVA_HOME/bin:$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$PATH"
|
||||
|
||||
yes | sdkmanager --sdk_root="$ANDROID_HOME" --licenses
|
||||
sdkmanager --sdk_root="$ANDROID_HOME" \
|
||||
"platform-tools" \
|
||||
"emulator" \
|
||||
"platforms;android-36" \
|
||||
"build-tools;36.0.0" \
|
||||
"system-images;android-36.1;google_apis;arm64-v8a"
|
||||
|
||||
echo no | avdmanager create avd \
|
||||
--name T3Code_API_36_1 \
|
||||
--package "system-images;android-36.1;google_apis;arm64-v8a" \
|
||||
--device pixel_9
|
||||
```
|
||||
|
||||
Add the four exports to your shell profile, start `T3Code_API_36_1` from Android Studio's Device
|
||||
Manager, then build and run the development client:
|
||||
|
||||
```bash
|
||||
vp run android:dev
|
||||
```
|
||||
|
||||
The first native build may need roughly 20 GB of free space for SDK, NDK, Gradle, and emulator
|
||||
caches. In a development build on Android, Settings includes an **Android Live Update · Mock**
|
||||
section for exercising the active-agents and needs-attention states without the relay.
|
||||
|
||||
The mock preview is entirely local. It does not require T3 Connect, a hosted relay, Clerk
|
||||
configuration, Firebase/FCM credentials, or a connected T3 Code server. Remote delivery and
|
||||
background reconciliation require the separate T3 Connect infrastructure.
|
||||
|
||||
Build and run the local iOS dev client:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -315,6 +315,7 @@ const config: ExpoConfig = {
|
||||
"./plugins/withIosSceneLifecycle.cjs",
|
||||
"./plugins/withAndroidCleartextTraffic.cjs",
|
||||
"./plugins/withAndroidGradleHeap.cjs",
|
||||
"./plugins/withAndroidUnifiedNdk.cjs",
|
||||
"./plugins/withAndroidModernPopupMenu.cjs",
|
||||
"./plugins/withAndroidModernAlertDialog.cjs",
|
||||
"./plugins/withAndroidPredictiveBackCompat.cjs",
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
|
||||
group = 'com.t3tools.agentliveupdate'
|
||||
version = '0.0.0'
|
||||
|
||||
android {
|
||||
namespace 'expo.modules.t3agentliveupdate'
|
||||
compileSdk rootProject.ext.compileSdkVersion
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':expo-modules-core')
|
||||
implementation 'androidx.core:core:1.17.0'
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.POST_PROMOTED_NOTIFICATIONS" />
|
||||
|
||||
<application>
|
||||
<receiver
|
||||
android:name="expo.modules.t3agentliveupdate.AgentLiveUpdateDismissReceiver"
|
||||
android:exported="false" />
|
||||
</application>
|
||||
</manifest>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package expo.modules.t3agentliveupdate
|
||||
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
|
||||
internal class AgentLiveUpdateDismissReceiver : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent?) {
|
||||
AgentLiveUpdateManager(context.applicationContext).cancel()
|
||||
}
|
||||
}
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
package expo.modules.t3agentliveupdate
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Notification
|
||||
import android.app.NotificationChannel
|
||||
import android.app.NotificationManager
|
||||
import android.app.PendingIntent
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Build
|
||||
import android.provider.Settings
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
|
||||
internal class AgentLiveUpdateManager(private val context: Context) {
|
||||
private val notificationManager = context.getSystemService(NotificationManager::class.java)
|
||||
private val notificationManagerCompat = NotificationManagerCompat.from(context)
|
||||
|
||||
fun ensureChannel() {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) return
|
||||
|
||||
val channel = NotificationChannel(
|
||||
CHANNEL_ID,
|
||||
"Agent live updates",
|
||||
NotificationManager.IMPORTANCE_LOW,
|
||||
).apply {
|
||||
description = "Ongoing status for active T3 Code agents"
|
||||
enableVibration(false)
|
||||
lockscreenVisibility = Notification.VISIBILITY_PRIVATE
|
||||
setShowBadge(false)
|
||||
setSound(null, null)
|
||||
}
|
||||
notificationManager.createNotificationChannel(channel)
|
||||
}
|
||||
|
||||
fun show(snapshot: LiveUpdateSnapshot): Map<String, Any> {
|
||||
ensureChannel()
|
||||
checkNotificationPermission()
|
||||
|
||||
val title = snapshot.title.trim().ifEmpty { "T3 Code agents" }.take(MAX_TITLE_LENGTH)
|
||||
val summary = snapshot.summary.trim().ifEmpty { "Agent activity is in progress" }
|
||||
val expandedText = snapshot.lines
|
||||
.asSequence()
|
||||
.map(String::trim)
|
||||
.filter(String::isNotEmpty)
|
||||
.take(MAX_VISIBLE_LINES)
|
||||
.joinToString("\n")
|
||||
.ifEmpty { summary }
|
||||
|
||||
val builder = NotificationCompat.Builder(context, CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.t3_agent_live_update)
|
||||
.setContentTitle(title)
|
||||
.setContentText(summary)
|
||||
.setStyle(NotificationCompat.BigTextStyle().bigText(expandedText))
|
||||
.setCategory(NotificationCompat.CATEGORY_PROGRESS)
|
||||
.setVisibility(NotificationCompat.VISIBILITY_PRIVATE)
|
||||
.setPriority(NotificationCompat.PRIORITY_LOW)
|
||||
.setOngoing(true)
|
||||
.setAutoCancel(false)
|
||||
.setOnlyAlertOnce(true)
|
||||
.setColorized(false)
|
||||
.setRequestPromotedOngoing(true)
|
||||
.setWhen(System.currentTimeMillis())
|
||||
.setShowWhen(true)
|
||||
.setDeleteIntent(dismissPendingIntent())
|
||||
.addAction(
|
||||
NotificationCompat.Action.Builder(
|
||||
0,
|
||||
"Stop",
|
||||
dismissPendingIntent(),
|
||||
).build(),
|
||||
)
|
||||
|
||||
contentPendingIntent()?.let(builder::setContentIntent)
|
||||
snapshot.shortCriticalText
|
||||
.trim()
|
||||
.take(MAX_SHORT_CRITICAL_TEXT_LENGTH)
|
||||
.takeIf(String::isNotEmpty)
|
||||
?.let(builder::setShortCriticalText)
|
||||
|
||||
val notification = builder.build()
|
||||
notificationManagerCompat.notify(NOTIFICATION_TAG, NOTIFICATION_ID, notification)
|
||||
return status()
|
||||
}
|
||||
|
||||
fun cancel(): Map<String, Any> {
|
||||
notificationManagerCompat.cancel(NOTIFICATION_TAG, NOTIFICATION_ID)
|
||||
return status(null)
|
||||
}
|
||||
|
||||
fun status(): Map<String, Any> = status(activeNotification())
|
||||
|
||||
fun openPromotionSettings(): Map<String, Any> {
|
||||
val promotionIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
|
||||
Intent(Settings.ACTION_APP_NOTIFICATION_PROMOTION_SETTINGS)
|
||||
} else {
|
||||
appNotificationSettingsIntent()
|
||||
}
|
||||
promotionIntent
|
||||
.putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
|
||||
try {
|
||||
context.startActivity(promotionIntent)
|
||||
} catch (_: ActivityNotFoundException) {
|
||||
context.startActivity(appNotificationSettingsIntent())
|
||||
}
|
||||
return status()
|
||||
}
|
||||
|
||||
private fun status(notification: Notification?): Map<String, Any> {
|
||||
val supportsPromotion = Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA
|
||||
val promotable = supportsPromotion && notification?.hasPromotableCharacteristics() == true
|
||||
val promoted = supportsPromotion &&
|
||||
notification != null &&
|
||||
notification.flags.and(Notification.FLAG_PROMOTED_ONGOING) != 0
|
||||
val channelImportance = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
notificationManager.getNotificationChannel(CHANNEL_ID)?.importance
|
||||
?: NotificationManager.IMPORTANCE_UNSPECIFIED
|
||||
} else {
|
||||
NotificationManager.IMPORTANCE_UNSPECIFIED
|
||||
}
|
||||
|
||||
return mapOf(
|
||||
"apiLevel" to Build.VERSION.SDK_INT,
|
||||
"supportsPromotion" to supportsPromotion,
|
||||
"notificationsEnabled" to notificationManagerCompat.areNotificationsEnabled(),
|
||||
"canPostPromotedNotifications" to (
|
||||
supportsPromotion && notificationManagerCompat.canPostPromotedNotifications()
|
||||
),
|
||||
"channelImportance" to channelImportance,
|
||||
"active" to (notification != null),
|
||||
"promotable" to promotable,
|
||||
"promoted" to promoted,
|
||||
)
|
||||
}
|
||||
|
||||
private fun activeNotification(): Notification? = notificationManagerCompat.activeNotifications
|
||||
.firstOrNull { it.tag == NOTIFICATION_TAG && it.id == NOTIFICATION_ID }
|
||||
?.notification
|
||||
|
||||
private fun checkNotificationPermission() {
|
||||
if (
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU &&
|
||||
context.checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) !=
|
||||
PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
throw SecurityException("Notification permission is required to show an agent Live Update.")
|
||||
}
|
||||
}
|
||||
|
||||
private fun dismissPendingIntent(): PendingIntent {
|
||||
val intent = Intent(context, AgentLiveUpdateDismissReceiver::class.java).apply {
|
||||
action = ACTION_DISMISS
|
||||
}
|
||||
return PendingIntent.getBroadcast(
|
||||
context,
|
||||
DISMISS_REQUEST_CODE,
|
||||
intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
||||
)
|
||||
}
|
||||
|
||||
private fun contentPendingIntent(): PendingIntent? {
|
||||
val intent =
|
||||
context.packageManager.getLaunchIntentForPackage(context.packageName) ?: return null
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
|
||||
return PendingIntent.getActivity(
|
||||
context,
|
||||
CONTENT_REQUEST_CODE,
|
||||
intent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
||||
)
|
||||
}
|
||||
|
||||
private fun appNotificationSettingsIntent(): Intent =
|
||||
Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
|
||||
.putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
|
||||
private companion object {
|
||||
const val CHANNEL_ID = "t3_agent_live_updates"
|
||||
const val NOTIFICATION_TAG = "t3-agent-live-update"
|
||||
const val NOTIFICATION_ID = 44_001
|
||||
const val ACTION_DISMISS = "com.t3tools.agentliveupdate.action.DISMISS"
|
||||
const val DISMISS_REQUEST_CODE = 44_002
|
||||
const val CONTENT_REQUEST_CODE = 44_003
|
||||
const val MAX_VISIBLE_LINES = 3
|
||||
const val MAX_TITLE_LENGTH = 80
|
||||
const val MAX_SHORT_CRITICAL_TEXT_LENGTH = 7
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package expo.modules.t3agentliveupdate
|
||||
|
||||
import expo.modules.kotlin.records.Field
|
||||
import expo.modules.kotlin.records.Record
|
||||
|
||||
internal class LiveUpdateSnapshot : Record {
|
||||
@Field
|
||||
val title: String = ""
|
||||
|
||||
@Field
|
||||
val summary: String = ""
|
||||
|
||||
@Field
|
||||
val lines: List<String> = emptyList()
|
||||
|
||||
@Field
|
||||
val shortCriticalText: String = ""
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
package expo.modules.t3agentliveupdate
|
||||
|
||||
import android.content.Context
|
||||
import expo.modules.kotlin.modules.Module
|
||||
import expo.modules.kotlin.modules.ModuleDefinition
|
||||
|
||||
class T3AgentLiveUpdateModule : Module() {
|
||||
private val context: Context
|
||||
get() = requireNotNull(appContext.reactContext) {
|
||||
"T3AgentLiveUpdate requires an active React context."
|
||||
}
|
||||
|
||||
override fun definition() = ModuleDefinition {
|
||||
Name("T3AgentLiveUpdate")
|
||||
|
||||
AsyncFunction("ensureChannel") {
|
||||
manager().apply { ensureChannel() }.status()
|
||||
}
|
||||
|
||||
AsyncFunction("getStatus") {
|
||||
manager().status()
|
||||
}
|
||||
|
||||
AsyncFunction("show") { snapshot: LiveUpdateSnapshot ->
|
||||
manager().show(snapshot)
|
||||
}
|
||||
|
||||
AsyncFunction("cancel") {
|
||||
manager().cancel()
|
||||
}
|
||||
|
||||
AsyncFunction("openPromotionSettings") {
|
||||
manager().openPromotionSettings()
|
||||
}
|
||||
}
|
||||
|
||||
private fun manager() = AgentLiveUpdateManager(context.applicationContext)
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M8,5.5L1.5,12 8,18.5 9.4,17.1 4.3,12 9.4,6.9zM16,5.5L14.6,6.9 19.7,12 14.6,17.1 16,18.5 22.5,12z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"platforms": ["android"],
|
||||
"android": {
|
||||
"modules": ["expo.modules.t3agentliveupdate.T3AgentLiveUpdateModule"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "@t3tools/mobile-agent-live-update-native",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"expo-module": {
|
||||
"android": {
|
||||
"modules": [
|
||||
"expo.modules.t3agentliveupdate.T3AgentLiveUpdateModule"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
const { withProjectBuildGradle } = require("expo/config-plugins");
|
||||
|
||||
const BLOCK_START = "// @generated by withAndroidUnifiedNdk";
|
||||
const BLOCK_END = "// @end withAndroidUnifiedNdk";
|
||||
const BLOCK = `${BLOCK_START}
|
||||
// Expo libraries that do not declare an NDK version otherwise fall back to
|
||||
// Android Gradle Plugin's default. React Native declares a newer revision,
|
||||
// which makes clean local builds download and retain both multi-gigabyte NDKs.
|
||||
subprojects { subproject ->
|
||||
subproject.plugins.withId("com.android.application") {
|
||||
subproject.android.ndkVersion = rootProject.ext.ndkVersion
|
||||
}
|
||||
subproject.plugins.withId("com.android.library") {
|
||||
subproject.android.ndkVersion = rootProject.ext.ndkVersion
|
||||
}
|
||||
}
|
||||
${BLOCK_END}`;
|
||||
|
||||
module.exports = function withAndroidUnifiedNdk(config) {
|
||||
return withProjectBuildGradle(config, (nextConfig) => {
|
||||
if (nextConfig.modResults.language !== "groovy") {
|
||||
throw new Error("withAndroidUnifiedNdk requires a Groovy Android project build file.");
|
||||
}
|
||||
|
||||
const generatedBlock = new RegExp(
|
||||
`${BLOCK_START.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}[\\s\\S]*?${BLOCK_END.replace(
|
||||
/[.*+?^${}()|[\]\\]/g,
|
||||
"\\$&",
|
||||
)}\\n?`,
|
||||
"g",
|
||||
);
|
||||
const contents = nextConfig.modResults.contents.replace(generatedBlock, "").trimEnd();
|
||||
nextConfig.modResults.contents = `${contents}\n\n${BLOCK}\n`;
|
||||
return nextConfig;
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,96 @@
|
||||
import { requireOptionalNativeModule } from "expo";
|
||||
import { Platform } from "react-native";
|
||||
|
||||
const MODULE_NAME = "T3AgentLiveUpdate";
|
||||
|
||||
export interface AndroidLiveUpdateStatus {
|
||||
readonly apiLevel: number;
|
||||
readonly supportsPromotion: boolean;
|
||||
readonly notificationsEnabled: boolean;
|
||||
readonly canPostPromotedNotifications: boolean;
|
||||
readonly channelImportance: number;
|
||||
readonly active: boolean;
|
||||
readonly promotable: boolean;
|
||||
readonly promoted: boolean;
|
||||
}
|
||||
|
||||
interface AndroidLiveUpdateSnapshot {
|
||||
readonly title: string;
|
||||
readonly summary: string;
|
||||
readonly lines: ReadonlyArray<string>;
|
||||
readonly shortCriticalText: string;
|
||||
}
|
||||
|
||||
interface AndroidLiveUpdateNativeModule {
|
||||
readonly ensureChannel: () => Promise<AndroidLiveUpdateStatus>;
|
||||
readonly getStatus: () => Promise<AndroidLiveUpdateStatus>;
|
||||
readonly show: (snapshot: AndroidLiveUpdateSnapshot) => Promise<AndroidLiveUpdateStatus>;
|
||||
readonly cancel: () => Promise<AndroidLiveUpdateStatus>;
|
||||
readonly openPromotionSettings: () => Promise<AndroidLiveUpdateStatus>;
|
||||
}
|
||||
|
||||
export type AndroidLiveUpdateMockKind = "working" | "attention";
|
||||
|
||||
const MOCK_SNAPSHOTS: Record<AndroidLiveUpdateMockKind, AndroidLiveUpdateSnapshot> = {
|
||||
working: {
|
||||
title: "3 agents working",
|
||||
summary: "T3 Code is making progress",
|
||||
lines: [
|
||||
"● Implementing Android Live Updates",
|
||||
"● Running the mobile typecheck",
|
||||
"◌ Reviewing recent agent changes",
|
||||
],
|
||||
shortCriticalText: "3",
|
||||
},
|
||||
attention: {
|
||||
title: "1 agent needs attention",
|
||||
summary: "Approval is required to continue",
|
||||
lines: [
|
||||
"! Waiting for your approval",
|
||||
"● Android validation is still running",
|
||||
"● Two agents continue in the background",
|
||||
],
|
||||
shortCriticalText: "Action",
|
||||
},
|
||||
};
|
||||
|
||||
function resolveNativeModule(): AndroidLiveUpdateNativeModule | null {
|
||||
if (Platform.OS !== "android") return null;
|
||||
try {
|
||||
return requireOptionalNativeModule<AndroidLiveUpdateNativeModule>(MODULE_NAME);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function requireNativeLiveUpdateModule(): AndroidLiveUpdateNativeModule {
|
||||
const module = resolveNativeModule();
|
||||
if (module) return module;
|
||||
throw new Error("Rebuild the Android development client to install the Live Update module.");
|
||||
}
|
||||
|
||||
export function hasAndroidLiveUpdateModule(): boolean {
|
||||
return resolveNativeModule() !== null;
|
||||
}
|
||||
|
||||
export async function ensureAndroidLiveUpdateChannel(): Promise<AndroidLiveUpdateStatus> {
|
||||
return requireNativeLiveUpdateModule().ensureChannel();
|
||||
}
|
||||
|
||||
export async function getAndroidLiveUpdateStatus(): Promise<AndroidLiveUpdateStatus | null> {
|
||||
return resolveNativeModule()?.getStatus() ?? null;
|
||||
}
|
||||
|
||||
export async function showAndroidLiveUpdateMock(
|
||||
kind: AndroidLiveUpdateMockKind,
|
||||
): Promise<AndroidLiveUpdateStatus> {
|
||||
return requireNativeLiveUpdateModule().show(MOCK_SNAPSHOTS[kind]);
|
||||
}
|
||||
|
||||
export async function cancelAndroidLiveUpdateMock(): Promise<AndroidLiveUpdateStatus> {
|
||||
return requireNativeLiveUpdateModule().cancel();
|
||||
}
|
||||
|
||||
export async function openAndroidLiveUpdatePromotionSettings(): Promise<AndroidLiveUpdateStatus> {
|
||||
return requireNativeLiveUpdateModule().openPromotionSettings();
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
import * as Notifications from "expo-notifications";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Alert, AppState, View } from "react-native";
|
||||
|
||||
import { AppText as Text } from "../../components/AppText";
|
||||
import {
|
||||
cancelAndroidLiveUpdateMock,
|
||||
ensureAndroidLiveUpdateChannel,
|
||||
getAndroidLiveUpdateStatus,
|
||||
hasAndroidLiveUpdateModule,
|
||||
openAndroidLiveUpdatePromotionSettings,
|
||||
showAndroidLiveUpdateMock,
|
||||
type AndroidLiveUpdateMockKind,
|
||||
type AndroidLiveUpdateStatus,
|
||||
} from "../agent-awareness/androidLiveUpdate";
|
||||
import { SettingsRow } from "./components/SettingsRow";
|
||||
import { SettingsSection } from "./components/SettingsSection";
|
||||
|
||||
export function AndroidLiveUpdatePreviewSection() {
|
||||
const [status, setStatus] = useState<AndroidLiveUpdateStatus | null>(null);
|
||||
const [busy, setBusy] = useState(false);
|
||||
const busyRef = useRef(false);
|
||||
const moduleAvailable = hasAndroidLiveUpdateModule();
|
||||
|
||||
const refreshStatus = useCallback(async () => {
|
||||
const nextStatus = await getAndroidLiveUpdateStatus();
|
||||
setStatus(nextStatus);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
void refreshStatus();
|
||||
const subscription = AppState.addEventListener("change", (state) => {
|
||||
if (state === "active") void refreshStatus();
|
||||
});
|
||||
return () => subscription.remove();
|
||||
}, [refreshStatus]);
|
||||
|
||||
const run = useCallback(async (operation: () => Promise<AndroidLiveUpdateStatus>) => {
|
||||
if (busyRef.current) return;
|
||||
busyRef.current = true;
|
||||
setBusy(true);
|
||||
try {
|
||||
setStatus(await operation());
|
||||
} catch (cause) {
|
||||
Alert.alert(
|
||||
"Live Update preview unavailable",
|
||||
cause instanceof Error ? cause.message : "Could not update the mock notification.",
|
||||
);
|
||||
} finally {
|
||||
busyRef.current = false;
|
||||
setBusy(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const showMock = useCallback(
|
||||
(kind: AndroidLiveUpdateMockKind) => {
|
||||
void run(async () => {
|
||||
await ensureAndroidLiveUpdateChannel();
|
||||
const currentPermission = await Notifications.getPermissionsAsync();
|
||||
const permission = currentPermission.granted
|
||||
? currentPermission
|
||||
: await Notifications.requestPermissionsAsync();
|
||||
if (!permission.granted) {
|
||||
throw new Error("Allow notifications to display the Android Live Update preview.");
|
||||
}
|
||||
return showAndroidLiveUpdateMock(kind);
|
||||
});
|
||||
},
|
||||
[run],
|
||||
);
|
||||
|
||||
const statusLabel = useMemo(
|
||||
() => formatStatus(status, moduleAvailable),
|
||||
[moduleAvailable, status],
|
||||
);
|
||||
const settingsValue = status?.canPostPromotedNotifications ? "Allowed" : "Review";
|
||||
|
||||
return (
|
||||
<View className="gap-3">
|
||||
<SettingsSection title="Android Live Update · Mock">
|
||||
<SettingsRow
|
||||
disabled={busy || !moduleAvailable}
|
||||
icon="bolt.circle"
|
||||
label="Show Active Agents"
|
||||
onPress={() => showMock("working")}
|
||||
/>
|
||||
<SettingsRow
|
||||
disabled={busy || !moduleAvailable}
|
||||
icon="exclamationmark.triangle"
|
||||
label="Show Needs Attention"
|
||||
onPress={() => showMock("attention")}
|
||||
/>
|
||||
<SettingsRow
|
||||
disabled={busy || !moduleAvailable || !status?.active}
|
||||
icon="stop.fill"
|
||||
label="End Mock Update"
|
||||
onPress={() => void run(cancelAndroidLiveUpdateMock)}
|
||||
/>
|
||||
<SettingsRow
|
||||
disabled={busy || !moduleAvailable}
|
||||
icon="gearshape"
|
||||
label="Promotion Settings"
|
||||
value={settingsValue}
|
||||
onPress={() => void run(openAndroidLiveUpdatePromotionSettings)}
|
||||
/>
|
||||
</SettingsSection>
|
||||
<Text className="px-2 text-sm text-foreground-muted">
|
||||
{statusLabel} Mock data only; relay and FCM delivery are intentionally deferred.
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function formatStatus(status: AndroidLiveUpdateStatus | null, moduleAvailable: boolean): string {
|
||||
if (!moduleAvailable) return "Rebuild the Android development client to enable this preview.";
|
||||
if (!status) return "Checking Android notification capabilities.";
|
||||
if (!status.notificationsEnabled) return "Notification access is currently disabled.";
|
||||
if (status.active && status.promoted) return "A promoted Live Update is active.";
|
||||
if (status.active && status.promotable) {
|
||||
return status.canPostPromotedNotifications
|
||||
? "A promotable ongoing notification is active."
|
||||
: "The ongoing notification is active, but promotion access is disabled.";
|
||||
}
|
||||
if (!status.supportsPromotion) {
|
||||
return "This device will use the standard ongoing-notification fallback.";
|
||||
}
|
||||
return status.canPostPromotedNotifications
|
||||
? "This device allows promoted Live Updates."
|
||||
: "Open Promotion Settings to allow promoted Live Updates.";
|
||||
}
|
||||
@@ -38,6 +38,7 @@ import { runtime } from "../../lib/runtime";
|
||||
import { useThemeColor } from "../../lib/useThemeColor";
|
||||
import { mobilePreferencesAtom, updateMobilePreferencesAtom } from "../../state/preferences";
|
||||
import { useSavedRemoteConnections } from "../../state/use-remote-environment-registry";
|
||||
import { AndroidLiveUpdatePreviewSection } from "./AndroidLiveUpdatePreviewSection";
|
||||
import { SettingsRow } from "./components/SettingsRow";
|
||||
import { SettingsSection } from "./components/SettingsSection";
|
||||
import { SettingsSwitchRow } from "./components/SettingsSwitchRow";
|
||||
@@ -125,6 +126,8 @@ function LocalSettingsRouteScreen() {
|
||||
|
||||
<ArchivedThreadsSettingsSection />
|
||||
|
||||
{Platform.OS === "android" && __DEV__ ? <AndroidLiveUpdatePreviewSection /> : null}
|
||||
|
||||
<AppSettingsSection />
|
||||
</ScrollView>
|
||||
</View>
|
||||
@@ -508,6 +511,8 @@ function ConfiguredSettingsRouteScreen() {
|
||||
|
||||
<ArchivedThreadsSettingsSection />
|
||||
|
||||
{Platform.OS === "android" && __DEV__ ? <AndroidLiveUpdatePreviewSection /> : null}
|
||||
|
||||
<AppSettingsSection />
|
||||
</ScrollView>
|
||||
</View>
|
||||
|
||||
@@ -58,6 +58,8 @@ import { type VcsRef } from "@t3tools/client-runtime/state/vcs";
|
||||
|
||||
type WorkspaceMode = "local" | "worktree";
|
||||
|
||||
const EMPTY_BRANCH_REFS: ReadonlyArray<VcsRef> = [];
|
||||
|
||||
function pendingTaskDraftKey(messageId: string): string {
|
||||
return `pending-task:${messageId}`;
|
||||
}
|
||||
@@ -348,7 +350,14 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
const workspaceMode = selectedProjectDraft.workspaceSelection?.mode ?? "local";
|
||||
const selectedBranchName = selectedProjectDraft.workspaceSelection?.branch ?? null;
|
||||
const selectedWorktreePath = selectedProjectDraft.workspaceSelection?.worktreePath ?? null;
|
||||
const startFromOrigin = selectedProjectDraft.workspaceSelection?.startFromOrigin ?? false;
|
||||
// Keep the user's explicit choice separate from the resolved display value:
|
||||
// only the explicit flag is ever written back to the draft, so the resolved
|
||||
// value keeps tracking the server setting when the config loads late.
|
||||
const draftStartFromOrigin = selectedProjectDraft.workspaceSelection?.startFromOrigin;
|
||||
const startFromOrigin =
|
||||
draftStartFromOrigin ??
|
||||
selectedEnvironmentServerConfig?.settings.newWorktreesStartFromOrigin ??
|
||||
true;
|
||||
const runtimeMode = selectedProjectDraft.runtimeMode ?? DEFAULT_RUNTIME_MODE;
|
||||
const interactionMode = selectedProjectDraft.interactionMode ?? DEFAULT_PROVIDER_INTERACTION_MODE;
|
||||
|
||||
@@ -368,6 +377,7 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
const selectedModel =
|
||||
selectedProjectDraft.modelSelection ??
|
||||
selectedProject?.defaultModelSelection ??
|
||||
modelOptions.find((option) => option.isDefault)?.selection ??
|
||||
modelOptions[0]?.selection ??
|
||||
null;
|
||||
const selectedModelKey = selectedModel
|
||||
@@ -475,13 +485,14 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
);
|
||||
const branchState = useBranches(branchTarget);
|
||||
const branchesLoading = branchState.isPending;
|
||||
const allBranchRefs = branchState.data?.refs ?? EMPTY_BRANCH_REFS;
|
||||
const availableBranches = useMemo(
|
||||
() =>
|
||||
pipe(
|
||||
branchState.data?.refs ?? [],
|
||||
allBranchRefs,
|
||||
Arr.filter((branch) => !branch.isRemote),
|
||||
),
|
||||
[branchState.data?.refs],
|
||||
[allBranchRefs],
|
||||
);
|
||||
|
||||
const filteredBranches = useMemo(() => {
|
||||
@@ -543,11 +554,11 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
mode,
|
||||
branch: selectedBranchName,
|
||||
worktreePath: selectedWorktreePath,
|
||||
startFromOrigin,
|
||||
...(draftStartFromOrigin !== undefined ? { startFromOrigin: draftStartFromOrigin } : {}),
|
||||
},
|
||||
});
|
||||
},
|
||||
[selectedBranchName, selectedProjectDraftKey, selectedWorktreePath, startFromOrigin],
|
||||
[draftStartFromOrigin, selectedBranchName, selectedProjectDraftKey, selectedWorktreePath],
|
||||
);
|
||||
|
||||
const selectBranch = useCallback(
|
||||
@@ -560,11 +571,11 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
mode: workspaceMode,
|
||||
branch: branch.name,
|
||||
worktreePath: normalizeSelectedWorktreePath(selectedProject, branch),
|
||||
startFromOrigin,
|
||||
...(draftStartFromOrigin !== undefined ? { startFromOrigin: draftStartFromOrigin } : {}),
|
||||
},
|
||||
});
|
||||
},
|
||||
[selectedProject, selectedProjectDraftKey, startFromOrigin, workspaceMode],
|
||||
[draftStartFromOrigin, selectedProject, selectedProjectDraftKey, workspaceMode],
|
||||
);
|
||||
|
||||
const setStartFromOrigin = useCallback(
|
||||
@@ -597,14 +608,16 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
if (workspaceMode !== "worktree" || selectedBranchName !== null) {
|
||||
return;
|
||||
}
|
||||
// The default may only exist as origin/<default> (isRemote), which
|
||||
// availableBranches filters out — search the unfiltered refs for it.
|
||||
const preferredBranch =
|
||||
allBranchRefs.find((branch) => branch.isDefault) ??
|
||||
availableBranches.find((branch) => branch.current) ??
|
||||
availableBranches.find((branch) => branch.isDefault) ??
|
||||
null;
|
||||
if (preferredBranch) {
|
||||
selectBranch(preferredBranch);
|
||||
}
|
||||
}, [availableBranches, selectBranch, selectedBranchName, workspaceMode]);
|
||||
}, [allBranchRefs, availableBranches, selectBranch, selectedBranchName, workspaceMode]);
|
||||
|
||||
const setRuntimeMode = useCallback(
|
||||
(value: RuntimeMode) => {
|
||||
@@ -696,7 +709,12 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
workspaceMode: mode,
|
||||
branch: workspaceSelection?.branch ?? null,
|
||||
worktreePath: mode === "worktree" ? null : (workspaceSelection?.worktreePath ?? null),
|
||||
...(workspaceSelection?.startFromOrigin ? { startFromOrigin: true } : {}),
|
||||
// The draft only carries the flag when the user touched it; fall
|
||||
// back to the resolved default (server settings) so queued tasks
|
||||
// drain with the same origin mode the composer displayed.
|
||||
...((workspaceSelection?.startFromOrigin ?? startFromOrigin)
|
||||
? { startFromOrigin: true }
|
||||
: {}),
|
||||
},
|
||||
createdAt: metadata.createdAt,
|
||||
};
|
||||
@@ -707,6 +725,7 @@ export function NewTaskFlowProvider(props: React.PropsWithChildren) {
|
||||
selectedModel,
|
||||
selectedProject,
|
||||
selectedProjectDraftKey,
|
||||
startFromOrigin,
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ export type ModelOption = {
|
||||
readonly providerKey: string;
|
||||
readonly providerLabel: string;
|
||||
readonly providerDriver: string;
|
||||
readonly isDefault: boolean;
|
||||
readonly capabilities: ModelCapabilities | null;
|
||||
readonly selection: ModelSelection;
|
||||
};
|
||||
@@ -78,6 +79,7 @@ export function buildModelOptions(
|
||||
providerKey: provider.instanceId,
|
||||
providerLabel,
|
||||
providerDriver: provider.driver,
|
||||
isDefault: model.isDefault === true,
|
||||
capabilities: model.capabilities,
|
||||
selection: normalizeSelectionOptions(
|
||||
{
|
||||
@@ -107,6 +109,7 @@ export function buildModelOptions(
|
||||
providerKey: fallbackModelSelection.instanceId,
|
||||
providerLabel,
|
||||
providerDriver: fallbackModelSelection.instanceId,
|
||||
isDefault: false,
|
||||
capabilities: null,
|
||||
selection: fallbackModelSelection,
|
||||
});
|
||||
|
||||
@@ -1711,6 +1711,133 @@ describe("ClaudeAdapterLive", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.effect("consumes undeclared and UX-internal system subtypes without warning rows", () => {
|
||||
const harness = makeHarness();
|
||||
return Effect.gen(function* () {
|
||||
const adapter = yield* ClaudeAdapter;
|
||||
const runtimeEvents: Array<ProviderRuntimeEvent> = [];
|
||||
const runtimeEventsFiber = yield* Stream.runForEach(adapter.streamEvents, (event) =>
|
||||
Effect.sync(() => runtimeEvents.push(event)),
|
||||
).pipe(Effect.forkChild);
|
||||
|
||||
yield* adapter.startSession({
|
||||
threadId: THREAD_ID,
|
||||
provider: ProviderDriverKind.make("claudeAgent"),
|
||||
runtimeMode: "full-access",
|
||||
});
|
||||
|
||||
// Undeclared wire-only roster snapshot + every typed UX-internal
|
||||
// subtype and top-level type consumed silently: none may surface as
|
||||
// unknown-subtype warnings.
|
||||
for (const message of [
|
||||
{
|
||||
type: "system",
|
||||
subtype: "background_tasks_changed",
|
||||
tasks: [{ task_id: "t1", task_type: "local_agent", description: "Say hi" }],
|
||||
session_id: "session",
|
||||
uuid: "roster",
|
||||
},
|
||||
{
|
||||
type: "system",
|
||||
subtype: "task_updated",
|
||||
task_id: "t1",
|
||||
patch: { status: "running" },
|
||||
session_id: "session",
|
||||
uuid: "tu",
|
||||
},
|
||||
{ type: "system", subtype: "commands_changed", session_id: "session", uuid: "cc" },
|
||||
{ type: "system", subtype: "model_refusal_fallback", session_id: "session", uuid: "mrf" },
|
||||
{ type: "system", subtype: "local_command_output", session_id: "session", uuid: "lco" },
|
||||
{ type: "system", subtype: "plugin_install", session_id: "session", uuid: "pi" },
|
||||
{ type: "system", subtype: "memory_recall", session_id: "session", uuid: "mr" },
|
||||
{ type: "system", subtype: "elicitation_complete", session_id: "session", uuid: "ec" },
|
||||
{ type: "prompt_suggestion", suggestion: "try this", session_id: "session", uuid: "ps" },
|
||||
{
|
||||
type: "system",
|
||||
subtype: "notification",
|
||||
key: "context",
|
||||
text: "low priority note",
|
||||
priority: "low",
|
||||
session_id: "session",
|
||||
uuid: "notif",
|
||||
},
|
||||
]) {
|
||||
harness.query.emit(message as unknown as SDKMessage);
|
||||
}
|
||||
// High-priority notifications DO surface as a warning row.
|
||||
harness.query.emit({
|
||||
type: "system",
|
||||
subtype: "notification",
|
||||
key: "limit",
|
||||
text: "context window nearly full",
|
||||
priority: "high",
|
||||
session_id: "session",
|
||||
uuid: "notif-high",
|
||||
} as unknown as SDKMessage);
|
||||
// session_state_changed maps to the matching session states.
|
||||
for (const [state, uuid] of [
|
||||
["running", "ssc-run"],
|
||||
["requires_action", "ssc-req"],
|
||||
["idle", "ssc-idle"],
|
||||
]) {
|
||||
harness.query.emit({
|
||||
type: "system",
|
||||
subtype: "session_state_changed",
|
||||
state,
|
||||
session_id: "session",
|
||||
uuid,
|
||||
} as unknown as SDKMessage);
|
||||
}
|
||||
// api_retry maps to a session heartbeat, not a warning row.
|
||||
harness.query.emit({
|
||||
type: "system",
|
||||
subtype: "api_retry",
|
||||
attempt: 3,
|
||||
max_retries: 10,
|
||||
retry_delay_ms: 1000,
|
||||
error_status: 502,
|
||||
error: { type: "api_error" },
|
||||
session_id: "session",
|
||||
uuid: "retry",
|
||||
} as unknown as SDKMessage);
|
||||
yield* Effect.yieldNow;
|
||||
yield* Effect.yieldNow;
|
||||
|
||||
const warnings = runtimeEvents.filter((event) => event.type === "runtime.warning");
|
||||
// Exactly one warning: the high-priority notification. Nothing else.
|
||||
assert.deepEqual(
|
||||
warnings.map((event) => event.payload.message),
|
||||
["context window nearly full"],
|
||||
);
|
||||
const sessionStates = runtimeEvents
|
||||
.filter((event) => event.type === "session.state.changed")
|
||||
.map((event) =>
|
||||
event.type === "session.state.changed"
|
||||
? `${event.payload.state}:${event.payload.reason ?? ""}`
|
||||
: "",
|
||||
)
|
||||
.filter(
|
||||
(entry) => entry.startsWith("running:session_state") || entry.includes("session_state"),
|
||||
);
|
||||
assert.deepEqual(sessionStates, [
|
||||
"running:session_state:running",
|
||||
"waiting:session_state:requires_action",
|
||||
"ready:session_state:idle",
|
||||
]);
|
||||
const heartbeat = runtimeEvents.find(
|
||||
(event) =>
|
||||
event.type === "session.state.changed" &&
|
||||
typeof event.payload.reason === "string" &&
|
||||
event.payload.reason.startsWith("api_retry:"),
|
||||
);
|
||||
assert.equal(heartbeat?.type, "session.state.changed");
|
||||
runtimeEventsFiber.interruptUnsafe();
|
||||
}).pipe(
|
||||
Effect.provideService(Random.Random, makeDeterministicRandomService()),
|
||||
Effect.provide(harness.layer),
|
||||
);
|
||||
});
|
||||
|
||||
it.effect("emits thread token usage updates from Claude task progress", () => {
|
||||
const harness = makeHarness();
|
||||
return Effect.gen(function* () {
|
||||
@@ -3045,7 +3172,7 @@ describe("ClaudeAdapterLive", () => {
|
||||
attachments: [],
|
||||
});
|
||||
|
||||
assert.deepEqual(harness.query.setModelCalls, ["claude-opus-4-6"]);
|
||||
assert.deepEqual(harness.query.setModelCalls, ["claude-opus-4-6[1m]"]);
|
||||
}).pipe(
|
||||
Effect.provideService(Random.Random, makeDeterministicRandomService()),
|
||||
Effect.provide(harness.layer),
|
||||
@@ -3143,10 +3270,11 @@ describe("ClaudeAdapterLive", () => {
|
||||
yield* adapter.sendTurn({
|
||||
threadId: session.threadId,
|
||||
input: "hello again",
|
||||
modelSelection: {
|
||||
instanceId: ProviderInstanceId.make("claudeAgent"),
|
||||
model: "claude-opus-4-6",
|
||||
},
|
||||
modelSelection: createModelSelection(
|
||||
ProviderInstanceId.make("claudeAgent"),
|
||||
"claude-opus-4-6",
|
||||
[{ id: "contextWindow", value: "200k" }],
|
||||
),
|
||||
attachments: [],
|
||||
});
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ import {
|
||||
isClaudeUltracodeEffort,
|
||||
normalizeClaudeCliEffort,
|
||||
resolveClaudeApiModelId,
|
||||
resolveClaudeContextWindow,
|
||||
resolveClaudeEffort,
|
||||
} from "./ClaudeProvider.ts";
|
||||
import {
|
||||
@@ -341,24 +342,18 @@ function selectedClaudeContextWindow(
|
||||
switch (modelSelection?.model) {
|
||||
case "claude-opus-4-8":
|
||||
case "claude-opus-4-7":
|
||||
// Always 1M at the API; these models expose no contextWindow option.
|
||||
return 1_000_000;
|
||||
}
|
||||
|
||||
const optionValue = getModelSelectionStringOptionValue(modelSelection, "contextWindow");
|
||||
if (optionValue === "1m") {
|
||||
return 1_000_000;
|
||||
switch (resolveClaudeContextWindow(modelSelection)) {
|
||||
case "1m":
|
||||
return 1_000_000;
|
||||
case "200k":
|
||||
return 200_000;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
if (optionValue === "200k") {
|
||||
return 200_000;
|
||||
}
|
||||
const caps = getClaudeModelCapabilities(modelSelection?.model);
|
||||
const hasContextWindowOption = getProviderOptionDescriptors({ caps }).some(
|
||||
(descriptor) => descriptor.type === "select" && descriptor.id === "contextWindow",
|
||||
);
|
||||
if (hasContextWindowOption) {
|
||||
return 200_000;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function finiteNonNegativeInteger(value: unknown): number | undefined {
|
||||
@@ -2590,6 +2585,17 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
|
||||
},
|
||||
};
|
||||
|
||||
// Undeclared-but-real subtypes (absent from the SDK's union, so they can't
|
||||
// be switch cases): consumed intentionally without emitting, otherwise
|
||||
// they fall through to the unknown-subtype warning and surface as spurious
|
||||
// error rows in client work logs. `background_tasks_changed` is a roster
|
||||
// snapshot ({tasks: [...]}) — the task_* lifecycle events carry the
|
||||
// authoritative per-agent data and the typed background_tasks control
|
||||
// request is the reconciliation source.
|
||||
if ((message.subtype as string) === "background_tasks_changed") {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (message.subtype) {
|
||||
case "init":
|
||||
yield* offerRuntimeEvent({
|
||||
@@ -2702,6 +2708,11 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
|
||||
},
|
||||
});
|
||||
return;
|
||||
// Task state patch (status/backgrounded/end_time). No runtime mapping
|
||||
// yet — the terminal task_notification reports the outcome — but it
|
||||
// must not surface as an unknown-subtype warning row.
|
||||
case "task_updated":
|
||||
return;
|
||||
case "task_notification":
|
||||
yield* emitThreadTokenUsage(
|
||||
context,
|
||||
@@ -2746,6 +2757,52 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
|
||||
return;
|
||||
case "thinking_tokens":
|
||||
return;
|
||||
case "api_retry":
|
||||
// Transport-level retry heartbeat. Surfacing each attempt as a
|
||||
// warning row spammed the work log (10 rows during a 502 storm);
|
||||
// the terminal result/error path reports the actual failure. Keep
|
||||
// the session visibly alive instead.
|
||||
yield* offerRuntimeEvent({
|
||||
...base,
|
||||
type: "session.state.changed",
|
||||
payload: {
|
||||
state: "running",
|
||||
reason: `api_retry:${message.attempt}/${message.max_retries}`,
|
||||
},
|
||||
});
|
||||
return;
|
||||
case "session_state_changed":
|
||||
// Authoritative turn-over signal from the CLI.
|
||||
yield* offerRuntimeEvent({
|
||||
...base,
|
||||
type: "session.state.changed",
|
||||
payload: {
|
||||
state:
|
||||
message.state === "running"
|
||||
? "running"
|
||||
: message.state === "requires_action"
|
||||
? "waiting"
|
||||
: "ready",
|
||||
reason: `session_state:${message.state}`,
|
||||
},
|
||||
});
|
||||
return;
|
||||
case "notification":
|
||||
// User-facing CLI notification (e.g. context-limit warnings). Only
|
||||
// high-priority ones warrant a work-log row.
|
||||
if (message.priority === "high" || message.priority === "immediate") {
|
||||
yield* emitRuntimeWarning(context, message.text, message);
|
||||
}
|
||||
return;
|
||||
// Inner protocol/UX details with no T3 surface today — consumed
|
||||
// deliberately so they don't masquerade as unknown-subtype warnings.
|
||||
case "model_refusal_fallback":
|
||||
case "local_command_output":
|
||||
case "plugin_install":
|
||||
case "commands_changed":
|
||||
case "memory_recall":
|
||||
case "elicitation_complete":
|
||||
return;
|
||||
case "permission_denied":
|
||||
yield* offerRuntimeEvent({
|
||||
...base,
|
||||
@@ -2765,13 +2822,21 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
|
||||
message,
|
||||
);
|
||||
return;
|
||||
default:
|
||||
default: {
|
||||
// Exhaustiveness guard: every subtype in the SDK's typed union is
|
||||
// handled above, so `message` narrows to never here — a new SDK
|
||||
// release adding a subtype fails this typecheck instead of silently
|
||||
// warning at runtime. The runtime fallback still catches undeclared
|
||||
// wire-only subtypes (like background_tasks_changed used to be).
|
||||
message satisfies never;
|
||||
const unknownMessage = message as never as { subtype: string };
|
||||
yield* emitRuntimeWarning(
|
||||
context,
|
||||
describeUnknownSdkMessage(`Claude system message '${message.subtype}'`, message),
|
||||
describeUnknownSdkMessage(`Claude system message '${unknownMessage.subtype}'`, message),
|
||||
message,
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2879,13 +2944,21 @@ export const makeClaudeAdapter = Effect.fn("makeClaudeAdapter")(function* (
|
||||
case "rate_limit_event":
|
||||
yield* handleSdkTelemetryMessage(context, message);
|
||||
return;
|
||||
default:
|
||||
// Composer prompt suggestions have no T3 surface; consumed deliberately.
|
||||
case "prompt_suggestion":
|
||||
return;
|
||||
default: {
|
||||
// Exhaustiveness guard (see handleSystemMessage): new SDK top-level
|
||||
// message types fail typecheck here instead of warning at runtime.
|
||||
message satisfies never;
|
||||
const unknownMessage = message as never as { type: string };
|
||||
yield* emitRuntimeWarning(
|
||||
context,
|
||||
describeUnknownSdkMessage(`Claude SDK message '${message.type}'`, message),
|
||||
describeUnknownSdkMessage(`Claude SDK message '${unknownMessage.type}'`, message),
|
||||
message,
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
|
||||
id: "contextWindow",
|
||||
label: "Context Window",
|
||||
options: [
|
||||
{ value: "200k", label: "200k", isDefault: true },
|
||||
{ value: "1m", label: "1M" },
|
||||
{ value: "200k", label: "200k" },
|
||||
{ value: "1m", label: "1M", isDefault: true },
|
||||
],
|
||||
}),
|
||||
],
|
||||
@@ -162,8 +162,8 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
|
||||
id: "contextWindow",
|
||||
label: "Context Window",
|
||||
options: [
|
||||
{ value: "200k", label: "200k", isDefault: true },
|
||||
{ value: "1m", label: "1M" },
|
||||
{ value: "200k", label: "200k" },
|
||||
{ value: "1m", label: "1M", isDefault: true },
|
||||
],
|
||||
}),
|
||||
],
|
||||
@@ -214,6 +214,7 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
|
||||
buildSelectOptionDescriptor({
|
||||
id: "contextWindow",
|
||||
label: "Context Window",
|
||||
// Sonnet is 200k-default in Claude Code (1M is opt-in there too).
|
||||
options: [
|
||||
{ value: "200k", label: "200k", isDefault: true },
|
||||
{ value: "1m", label: "1M" },
|
||||
@@ -243,6 +244,7 @@ const BUILT_IN_MODELS: ReadonlyArray<ServerProviderModel> = [
|
||||
buildSelectOptionDescriptor({
|
||||
id: "contextWindow",
|
||||
label: "Context Window",
|
||||
// Sonnet is 200k-default in Claude Code (1M is opt-in there too).
|
||||
options: [
|
||||
{ value: "200k", label: "200k", isDefault: true },
|
||||
{ value: "1m", label: "1M" },
|
||||
@@ -369,8 +371,22 @@ export function isClaudeUltracodeEffort(effort: string | null | undefined): bool
|
||||
return effort === "ultracode";
|
||||
}
|
||||
|
||||
export function resolveClaudeContextWindow(
|
||||
modelSelection: ModelSelection | undefined,
|
||||
): string | undefined {
|
||||
const caps = getClaudeModelCapabilities(modelSelection?.model);
|
||||
const raw = getModelSelectionStringOptionValue(modelSelection, "contextWindow");
|
||||
const descriptors = getProviderOptionDescriptors({
|
||||
caps,
|
||||
...(raw ? { selections: [{ id: "contextWindow", value: raw }] } : {}),
|
||||
});
|
||||
const descriptor = descriptors.find((candidate) => candidate.id === "contextWindow");
|
||||
const value = getProviderOptionCurrentValue(descriptor);
|
||||
return typeof value === "string" ? value : undefined;
|
||||
}
|
||||
|
||||
export function resolveClaudeApiModelId(modelSelection: ModelSelection): string {
|
||||
switch (getModelSelectionStringOptionValue(modelSelection, "contextWindow")) {
|
||||
switch (resolveClaudeContextWindow(modelSelection)) {
|
||||
case "1m":
|
||||
return `${modelSelection.model}[1m]`;
|
||||
default:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assert, it } from "@effect/vitest";
|
||||
|
||||
import { mapCodexModelCapabilities } from "./CodexProvider.ts";
|
||||
import { applyPreferredCodexDefaultModel, mapCodexModelCapabilities } from "./CodexProvider.ts";
|
||||
|
||||
it("maps current Codex model capability fields", () => {
|
||||
const capabilities = mapCodexModelCapabilities({
|
||||
@@ -102,3 +102,45 @@ it("uses standard routing when the catalog has no default service tier", () => {
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("marks the most preferred available model as default", () => {
|
||||
const models = applyPreferredCodexDefaultModel([
|
||||
{ slug: "gpt-5.6-terra", name: "GPT-5.6-Terra", isCustom: false, capabilities: null },
|
||||
{ slug: "gpt-5.4", name: "GPT-5.4", isCustom: false, isDefault: true, capabilities: null },
|
||||
]);
|
||||
|
||||
assert.deepStrictEqual(
|
||||
models.map((model) => ({ slug: model.slug, isDefault: model.isDefault })),
|
||||
[
|
||||
{ slug: "gpt-5.6-terra", isDefault: true },
|
||||
{ slug: "gpt-5.4", isDefault: undefined },
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
it("prefers sol over terra when both are available", () => {
|
||||
const models = applyPreferredCodexDefaultModel([
|
||||
{ slug: "gpt-5.6-terra", name: "GPT-5.6-Terra", isCustom: false, capabilities: null },
|
||||
{ slug: "gpt-5.6-sol", name: "GPT-5.6-Sol", isCustom: false, capabilities: null },
|
||||
]);
|
||||
|
||||
assert.deepStrictEqual(models.find((model) => model.isDefault)?.slug, "gpt-5.6-sol");
|
||||
});
|
||||
|
||||
it("keeps Codex's own default when no preferred model is available", () => {
|
||||
const models = applyPreferredCodexDefaultModel([
|
||||
{ slug: "gpt-5.5", name: "GPT-5.5", isCustom: false, capabilities: null },
|
||||
{ slug: "gpt-5.4", name: "GPT-5.4", isCustom: false, isDefault: true, capabilities: null },
|
||||
]);
|
||||
|
||||
assert.deepStrictEqual(models.find((model) => model.isDefault)?.slug, "gpt-5.4");
|
||||
});
|
||||
|
||||
it("ignores custom models that shadow a preferred slug", () => {
|
||||
const models = applyPreferredCodexDefaultModel([
|
||||
{ slug: "gpt-5.6-sol", name: "gpt-5.6-sol", isCustom: true, capabilities: null },
|
||||
{ slug: "gpt-5.4", name: "GPT-5.4", isCustom: false, isDefault: true, capabilities: null },
|
||||
]);
|
||||
|
||||
assert.deepStrictEqual(models.find((model) => model.isDefault)?.slug, "gpt-5.4");
|
||||
});
|
||||
@@ -22,7 +22,7 @@ import type {
|
||||
ServerProviderModel,
|
||||
ServerProviderSkill,
|
||||
} from "@t3tools/contracts";
|
||||
import { ServerSettingsError } from "@t3tools/contracts";
|
||||
import { PREFERRED_DEFAULT_CODEX_MODELS, ServerSettingsError } from "@t3tools/contracts";
|
||||
|
||||
import { createModelCapabilities } from "@t3tools/shared/model";
|
||||
import { resolveSpawnCommand } from "@t3tools/shared/shell";
|
||||
@@ -189,10 +189,36 @@ function parseCodexModelListResponse(
|
||||
slug: model.model,
|
||||
name: toDisplayName(model),
|
||||
isCustom: false,
|
||||
...(model.isDefault ? { isDefault: true } : {}),
|
||||
capabilities: mapCodexModelCapabilities(model),
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefer our own default-model ranking when one of the preferred slugs is in
|
||||
* the live catalog; otherwise keep whatever Codex itself flagged as default.
|
||||
*/
|
||||
export function applyPreferredCodexDefaultModel(
|
||||
models: ReadonlyArray<ServerProviderModel>,
|
||||
): ReadonlyArray<ServerProviderModel> {
|
||||
const preferredSlug = PREFERRED_DEFAULT_CODEX_MODELS.find((slug) =>
|
||||
models.some((model) => model.slug === slug && !model.isCustom),
|
||||
);
|
||||
if (!preferredSlug) {
|
||||
return models;
|
||||
}
|
||||
return models.map((model) => {
|
||||
if (model.slug === preferredSlug) {
|
||||
return model.isDefault ? model : { ...model, isDefault: true };
|
||||
}
|
||||
if (!model.isDefault) {
|
||||
return model;
|
||||
}
|
||||
const { isDefault: _isDefault, ...rest } = model;
|
||||
return rest;
|
||||
});
|
||||
}
|
||||
|
||||
function appendCustomCodexModels(
|
||||
models: ReadonlyArray<ServerProviderModel>,
|
||||
customModels: ReadonlyArray<string>,
|
||||
@@ -376,7 +402,9 @@ const probeCodexAppServerProvider = Effect.fn("probeCodexAppServerProvider")(fun
|
||||
return {
|
||||
account: accountResponse,
|
||||
version,
|
||||
models: appendCustomCodexModels(models, input.customModels ?? []),
|
||||
models: applyPreferredCodexDefaultModel(
|
||||
appendCustomCodexModels(models, input.customModels ?? []),
|
||||
),
|
||||
skills: parseCodexSkillsListResponse(skillsResponse, input.cwd),
|
||||
} satisfies CodexAppServerProviderSnapshot;
|
||||
});
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
import { describe, expect, it } from "vite-plus/test";
|
||||
|
||||
import {
|
||||
ghosttyThemeSearchPaths,
|
||||
parseGhosttyConfig,
|
||||
splitThemeSelection,
|
||||
} from "./ghosttyStyle.ts";
|
||||
|
||||
const posixPath = {
|
||||
isAbsolute: (value: string) => value.startsWith("/"),
|
||||
join: (...segments: ReadonlyArray<string>) =>
|
||||
segments
|
||||
.map((segment, index) =>
|
||||
index === 0 ? segment.replace(/\/$/, "") : segment.replace(/^\//, ""),
|
||||
)
|
||||
.join("/"),
|
||||
};
|
||||
|
||||
const windowsPath = {
|
||||
isAbsolute: (value: string) => /^[A-Za-z]:[\\/]/.test(value),
|
||||
join: (...segments: ReadonlyArray<string>) => segments.join("\\"),
|
||||
};
|
||||
|
||||
describe("parseGhosttyConfig", () => {
|
||||
it("omits empty scalar color assignments", () => {
|
||||
const config = parseGhosttyConfig(`
|
||||
background =
|
||||
foreground = ""
|
||||
cursor-color = #c0ffee
|
||||
`);
|
||||
|
||||
expect(config.colors.background).toBeUndefined();
|
||||
expect(config.colors.foreground).toBeUndefined();
|
||||
expect(config.colors.cursor).toBe("#c0ffee");
|
||||
});
|
||||
});
|
||||
|
||||
describe("splitThemeSelection", () => {
|
||||
it("keeps a Windows absolute theme path as a bare selection", () => {
|
||||
expect(splitThemeSelection("C:/Users/Alex/Ghostty Themes/t3code")).toEqual({
|
||||
light: "C:/Users/Alex/Ghostty Themes/t3code",
|
||||
dark: "C:/Users/Alex/Ghostty Themes/t3code",
|
||||
});
|
||||
});
|
||||
|
||||
it("still parses explicit light and dark theme selections", () => {
|
||||
expect(splitThemeSelection("light:Day,dark:Night")).toEqual({
|
||||
light: "Day",
|
||||
dark: "Night",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("ghosttyThemeSearchPaths", () => {
|
||||
it("searches beside the macOS Application Support config", () => {
|
||||
const candidates = ghosttyThemeSearchPaths(posixPath, {
|
||||
home: "/Users/alex",
|
||||
xdgConfigHome: "/Users/alex/.config",
|
||||
themeName: "t3code",
|
||||
});
|
||||
|
||||
expect(candidates).toContain(
|
||||
"/Users/alex/Library/Application Support/com.mitchellh.ghostty/themes/t3code",
|
||||
);
|
||||
});
|
||||
|
||||
it("tries an absolute theme file before named-theme directories", () => {
|
||||
const candidates = ghosttyThemeSearchPaths(windowsPath, {
|
||||
home: "C:\\Users\\alex",
|
||||
xdgConfigHome: "C:\\Users\\alex\\.config",
|
||||
themeName: "D:\\themes\\t3code",
|
||||
});
|
||||
|
||||
expect(candidates[0]).toBe("D:\\themes\\t3code");
|
||||
});
|
||||
});
|
||||
@@ -1,289 +0,0 @@
|
||||
import * as NodeOS from "node:os";
|
||||
|
||||
import type { ServerTerminalStyle, ServerTerminalThemeColors } from "@t3tools/contracts";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as FileSystem from "effect/FileSystem";
|
||||
import * as Path from "effect/Path";
|
||||
|
||||
const PALETTE_SIZE = 16;
|
||||
|
||||
interface GhosttyConfigValues {
|
||||
readonly fontFamily: ReadonlyArray<string>;
|
||||
readonly fontSize: number | undefined;
|
||||
readonly theme: string | undefined;
|
||||
readonly colors: MutableThemeColors;
|
||||
}
|
||||
|
||||
interface MutableThemeColors {
|
||||
background?: string | undefined;
|
||||
foreground?: string | undefined;
|
||||
cursor?: string | undefined;
|
||||
selectionBackground?: string | undefined;
|
||||
selectionForeground?: string | undefined;
|
||||
palette: Array<string>;
|
||||
}
|
||||
|
||||
function emptyColors(): MutableThemeColors {
|
||||
return { palette: Array.from({ length: PALETTE_SIZE }, () => "") };
|
||||
}
|
||||
|
||||
function stripQuotes(value: string): string {
|
||||
if (value.length >= 2 && value.startsWith('"') && value.endsWith('"')) {
|
||||
return value.slice(1, -1);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function applyColorEntry(colors: MutableThemeColors, key: string, value: string): void {
|
||||
// Empty assignments are resets, not colors. Keeping an empty scalar here
|
||||
// would later violate ServerConfig's TrimmedNonEmptyString schema and make
|
||||
// the whole server.getConfig response fail to encode.
|
||||
if (value.length === 0) return;
|
||||
switch (key) {
|
||||
case "background":
|
||||
colors.background = value;
|
||||
return;
|
||||
case "foreground":
|
||||
colors.foreground = value;
|
||||
return;
|
||||
case "cursor-color":
|
||||
colors.cursor = value;
|
||||
return;
|
||||
case "selection-background":
|
||||
colors.selectionBackground = value;
|
||||
return;
|
||||
case "selection-foreground":
|
||||
colors.selectionForeground = value;
|
||||
return;
|
||||
case "palette": {
|
||||
const match = value.match(/^(\d+)\s*=\s*(\S+)$/);
|
||||
if (!match) return;
|
||||
const index = Number(match[1]);
|
||||
if (!Number.isInteger(index) || index < 0 || index >= PALETTE_SIZE) return;
|
||||
colors.palette[index] = match[2] ?? "";
|
||||
return;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/** Parse Ghostty's `key = value` config format, keeping only what the web terminal uses. */
|
||||
export function parseGhosttyConfig(source: string): GhosttyConfigValues {
|
||||
const fontFamily: Array<string> = [];
|
||||
let fontSize: number | undefined;
|
||||
let theme: string | undefined;
|
||||
const colors = emptyColors();
|
||||
|
||||
for (const rawLine of source.split("\n")) {
|
||||
const line = rawLine.trim();
|
||||
if (line.length === 0 || line.startsWith("#")) continue;
|
||||
const separatorIndex = line.indexOf("=");
|
||||
if (separatorIndex <= 0) continue;
|
||||
const key = line.slice(0, separatorIndex).trim();
|
||||
const value = stripQuotes(line.slice(separatorIndex + 1).trim());
|
||||
|
||||
switch (key) {
|
||||
case "font-family":
|
||||
// Repeated entries build a fallback chain; an empty value resets it.
|
||||
if (value.length === 0) {
|
||||
fontFamily.length = 0;
|
||||
} else {
|
||||
fontFamily.push(value);
|
||||
}
|
||||
break;
|
||||
case "font-size": {
|
||||
const parsed = Number(value);
|
||||
if (Number.isFinite(parsed) && parsed > 0) {
|
||||
fontSize = parsed;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "theme":
|
||||
theme = value.length > 0 ? value : undefined;
|
||||
break;
|
||||
default:
|
||||
applyColorEntry(colors, key, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return { fontFamily, fontSize, theme, colors };
|
||||
}
|
||||
|
||||
/** Split `theme = light:A,dark:B` into per-mode names; a bare name applies to both. */
|
||||
export function splitThemeSelection(theme: string): { light?: string; dark?: string } {
|
||||
const result: { light?: string; dark?: string } = {};
|
||||
let hasModeSelection = false;
|
||||
for (const part of theme.split(",")) {
|
||||
const match = /^\s*(light|dark):(.*)$/.exec(part);
|
||||
if (!match) continue;
|
||||
const mode = match[1];
|
||||
const name = (match[2] ?? "").trim();
|
||||
if (name.length === 0) continue;
|
||||
hasModeSelection = true;
|
||||
if (mode === "light") result.light = name;
|
||||
if (mode === "dark") result.dark = name;
|
||||
}
|
||||
// A colon is also part of a Windows drive path (C:/theme), and may be part
|
||||
// of another valid bare theme identifier. Only enter per-mode parsing when
|
||||
// an explicit light: or dark: selection was recognized.
|
||||
return hasModeSelection ? result : { light: theme, dark: theme };
|
||||
}
|
||||
|
||||
function hasAnyColor(colors: MutableThemeColors): boolean {
|
||||
return (
|
||||
colors.background !== undefined ||
|
||||
colors.foreground !== undefined ||
|
||||
colors.cursor !== undefined ||
|
||||
colors.selectionBackground !== undefined ||
|
||||
colors.selectionForeground !== undefined ||
|
||||
colors.palette.some((entry) => entry.length > 0)
|
||||
);
|
||||
}
|
||||
|
||||
function mergeColors(base: MutableThemeColors, override: MutableThemeColors): MutableThemeColors {
|
||||
return {
|
||||
background: override.background ?? base.background,
|
||||
foreground: override.foreground ?? base.foreground,
|
||||
cursor: override.cursor ?? base.cursor,
|
||||
selectionBackground: override.selectionBackground ?? base.selectionBackground,
|
||||
selectionForeground: override.selectionForeground ?? base.selectionForeground,
|
||||
palette: base.palette.map((entry, index) => {
|
||||
const overrideEntry = override.palette[index] ?? "";
|
||||
return overrideEntry.length > 0 ? overrideEntry : entry;
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
function toThemeColors(colors: MutableThemeColors): ServerTerminalThemeColors | undefined {
|
||||
if (!hasAnyColor(colors)) return undefined;
|
||||
return {
|
||||
...(colors.background !== undefined ? { background: colors.background } : {}),
|
||||
...(colors.foreground !== undefined ? { foreground: colors.foreground } : {}),
|
||||
...(colors.cursor !== undefined ? { cursor: colors.cursor } : {}),
|
||||
...(colors.selectionBackground !== undefined
|
||||
? { selectionBackground: colors.selectionBackground }
|
||||
: {}),
|
||||
...(colors.selectionForeground !== undefined
|
||||
? { selectionForeground: colors.selectionForeground }
|
||||
: {}),
|
||||
palette: colors.palette,
|
||||
};
|
||||
}
|
||||
|
||||
// Bundled theme locations by platform: the macOS app bundle and the
|
||||
// Linux system resource dirs documented by Ghostty.
|
||||
const GHOSTTY_SYSTEM_THEME_DIRS = [
|
||||
"/Applications/Ghostty.app/Contents/Resources/ghostty/themes",
|
||||
"/usr/share/ghostty/themes",
|
||||
"/usr/local/share/ghostty/themes",
|
||||
];
|
||||
|
||||
export function ghosttyThemeSearchPaths(
|
||||
path: Pick<Path.Path, "isAbsolute" | "join">,
|
||||
input: { readonly home: string; readonly xdgConfigHome: string; readonly themeName: string },
|
||||
): ReadonlyArray<string> {
|
||||
return [
|
||||
...(path.isAbsolute(input.themeName) ? [input.themeName] : []),
|
||||
path.join(input.xdgConfigHome, "ghostty", "themes", input.themeName),
|
||||
path.join(
|
||||
input.home,
|
||||
"Library",
|
||||
"Application Support",
|
||||
"com.mitchellh.ghostty",
|
||||
"themes",
|
||||
input.themeName,
|
||||
),
|
||||
...GHOSTTY_SYSTEM_THEME_DIRS.map((dir) => path.join(dir, input.themeName)),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load terminal font and theme colors from the user's local Ghostty config.
|
||||
* Best effort by design: any missing file or parse problem yields `undefined`
|
||||
* so the client falls back to its built-in terminal appearance.
|
||||
*/
|
||||
export const loadGhosttyTerminalStyle: Effect.Effect<
|
||||
ServerTerminalStyle | undefined,
|
||||
never,
|
||||
FileSystem.FileSystem | Path.Path
|
||||
> = Effect.gen(function* () {
|
||||
const fs = yield* FileSystem.FileSystem;
|
||||
const path = yield* Path.Path;
|
||||
const home = NodeOS.homedir();
|
||||
// Per the XDG spec an empty XDG_CONFIG_HOME must be treated as unset.
|
||||
const xdgConfigHomeEnv = process.env["XDG_CONFIG_HOME"];
|
||||
const xdgConfigHome =
|
||||
xdgConfigHomeEnv !== undefined && xdgConfigHomeEnv.length > 0
|
||||
? xdgConfigHomeEnv
|
||||
: path.join(home, ".config");
|
||||
|
||||
const readFirstExisting = (candidates: ReadonlyArray<string>) =>
|
||||
Effect.gen(function* () {
|
||||
for (const candidate of candidates) {
|
||||
const exists = yield* fs.exists(candidate).pipe(Effect.orElseSucceed(() => false));
|
||||
if (!exists) continue;
|
||||
const content = yield* fs
|
||||
.readFileString(candidate)
|
||||
.pipe(Effect.orElseSucceed(() => undefined));
|
||||
if (content !== undefined) return content;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
|
||||
// Ghostty reads the XDG config first and the macOS Application Support
|
||||
// config after it, so later files override earlier values. It also accepts
|
||||
// config.ghostty as the file name. Merge every location that exists instead
|
||||
// of stopping at the first match.
|
||||
const configDirs = [
|
||||
path.join(xdgConfigHome, "ghostty"),
|
||||
path.join(home, "Library", "Application Support", "com.mitchellh.ghostty"),
|
||||
];
|
||||
const configSources: Array<string> = [];
|
||||
for (const dir of configDirs) {
|
||||
// Read both file names when they coexist so neither shadows the other;
|
||||
// Ghostty loads config.ghostty before config, so config wins conflicts.
|
||||
for (const candidate of [path.join(dir, "config.ghostty"), path.join(dir, "config")]) {
|
||||
const source = yield* readFirstExisting([candidate]);
|
||||
if (source !== undefined) configSources.push(source);
|
||||
}
|
||||
}
|
||||
if (configSources.length === 0) return undefined;
|
||||
|
||||
const config = parseGhosttyConfig(configSources.join("\n"));
|
||||
|
||||
const loadThemeColors = (themeName: string) =>
|
||||
Effect.gen(function* () {
|
||||
const themeSource = yield* readFirstExisting(
|
||||
ghosttyThemeSearchPaths(path, { home, xdgConfigHome, themeName }),
|
||||
);
|
||||
if (themeSource === undefined) return emptyColors();
|
||||
return parseGhosttyConfig(themeSource).colors;
|
||||
});
|
||||
|
||||
const themeSelection = config.theme ? splitThemeSelection(config.theme) : {};
|
||||
const resolveModeColors = (themeName: string | undefined) =>
|
||||
Effect.gen(function* () {
|
||||
const themeColors = themeName ? yield* loadThemeColors(themeName) : emptyColors();
|
||||
// Explicit colors in the user config override the selected theme.
|
||||
return toThemeColors(mergeColors(themeColors, config.colors));
|
||||
});
|
||||
|
||||
const light = yield* resolveModeColors(themeSelection.light);
|
||||
const dark = yield* resolveModeColors(themeSelection.dark);
|
||||
|
||||
const style: ServerTerminalStyle = {
|
||||
...(config.fontFamily.length > 0 ? { fontFamily: config.fontFamily } : {}),
|
||||
...(config.fontSize !== undefined ? { fontSize: config.fontSize } : {}),
|
||||
...(light !== undefined ? { light } : {}),
|
||||
...(dark !== undefined ? { dark } : {}),
|
||||
};
|
||||
|
||||
const hasAnyValue =
|
||||
style.fontFamily !== undefined ||
|
||||
style.fontSize !== undefined ||
|
||||
style.light !== undefined ||
|
||||
style.dark !== undefined;
|
||||
return hasAnyValue ? style : undefined;
|
||||
}).pipe(Effect.orElseSucceed(() => undefined));
|
||||
@@ -596,6 +596,26 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("marks the origin default ref as default when no local copy exists", () =>
|
||||
Effect.gen(function* () {
|
||||
const cwd = yield* makeTmpDir();
|
||||
const remote = yield* makeTmpDir("git-vcs-driver-remote-");
|
||||
const { initialBranch } = yield* initRepoWithCommit(cwd);
|
||||
yield* git(remote, ["init", "--bare"]);
|
||||
yield* git(cwd, ["remote", "add", "origin", remote]);
|
||||
yield* git(cwd, ["push", "-u", "origin", initialBranch]);
|
||||
yield* git(cwd, ["remote", "set-head", "origin", initialBranch]);
|
||||
yield* git(cwd, ["checkout", "-b", "feature/only-local"]);
|
||||
yield* git(cwd, ["branch", "-D", initialBranch]);
|
||||
const driver = yield* GitVcsDriver.GitVcsDriver;
|
||||
|
||||
const refs = yield* driver.listRefs({ cwd });
|
||||
const remoteDefault = refs.refs.find((ref) => ref.name === `origin/${initialBranch}`);
|
||||
assert.equal(remoteDefault?.isRemote, true);
|
||||
assert.equal(remoteDefault?.isDefault, true);
|
||||
}),
|
||||
);
|
||||
|
||||
it.effect("creates, checks out, renames, and lists refs", () =>
|
||||
Effect.gen(function* () {
|
||||
const cwd = yield* makeTmpDir();
|
||||
|
||||
@@ -2217,7 +2217,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
|
||||
name: refName.name,
|
||||
current: false,
|
||||
isRemote: true,
|
||||
isDefault: false,
|
||||
// origin/HEAD's target is the repo default even when no local
|
||||
// copy of the default branch exists.
|
||||
isDefault:
|
||||
defaultBranch !== null &&
|
||||
parsedRemoteRef?.remoteName === "origin" &&
|
||||
parsedRemoteRef.branchName === defaultBranch,
|
||||
worktreePath: null,
|
||||
};
|
||||
if (parsedRemoteRef) {
|
||||
@@ -2232,9 +2237,16 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
|
||||
})
|
||||
: [];
|
||||
|
||||
const allBranches = input.includeMatchingRemoteRefs
|
||||
const combinedBranches = input.includeMatchingRemoteRefs
|
||||
? [...localBranches, ...remoteBranches]
|
||||
: dedupeRemoteBranchesWithLocalMatches([...localBranches, ...remoteBranches]);
|
||||
// Keep current/default refs on the first page even when the default
|
||||
// only exists as origin/<default> (remote refs sort after all locals).
|
||||
const allBranches = combinedBranches.toSorted((a, b) => {
|
||||
const aPriority = a.current ? 0 : a.isDefault ? 1 : 2;
|
||||
const bPriority = b.current ? 0 : b.isDefault ? 1 : 2;
|
||||
return aPriority - bPriority;
|
||||
});
|
||||
const branchesForKind =
|
||||
input.refKind === "local"
|
||||
? allBranches.filter((ref) => !ref.isRemote)
|
||||
|
||||
@@ -81,7 +81,6 @@ import * as ProviderMaintenanceRunner from "./provider/providerMaintenanceRunner
|
||||
import * as ServerLifecycleEvents from "./serverLifecycleEvents.ts";
|
||||
import * as ServerRuntimeStartup from "./serverRuntimeStartup.ts";
|
||||
import * as ServerSettings from "./serverSettings.ts";
|
||||
import { loadGhosttyTerminalStyle } from "./terminal/ghosttyStyle.ts";
|
||||
import * as TerminalManager from "./terminal/Manager.ts";
|
||||
import * as PreviewAutomationBroker from "./mcp/PreviewAutomationBroker.ts";
|
||||
import * as PreviewManager from "./preview/Manager.ts";
|
||||
@@ -1066,7 +1065,6 @@ const makeWsRpcLayer = (
|
||||
|
||||
const loadServerConfig = Effect.gen(function* () {
|
||||
const keybindingsConfig = yield* keybindings.loadConfigState;
|
||||
const terminalStyle = yield* loadGhosttyTerminalStyle;
|
||||
const providers = yield* providerRegistry.getProviders;
|
||||
const settings = ServerSettings.redactServerSettingsForClient(
|
||||
yield* serverSettings.getSettings,
|
||||
@@ -1083,7 +1081,6 @@ const makeWsRpcLayer = (
|
||||
issues: keybindingsConfig.issues,
|
||||
providers,
|
||||
availableEditors: yield* externalLauncher.resolveAvailableEditors(),
|
||||
...(terminalStyle !== undefined ? { terminalStyle } : {}),
|
||||
observability: {
|
||||
logsDirectoryPath: config.logsDir,
|
||||
localTracingEnabled: true,
|
||||
|
||||
@@ -31,9 +31,10 @@
|
||||
"@t3tools/shared": "workspace:*",
|
||||
"@tanstack/react-pacer": "^0.19.4",
|
||||
"@tanstack/react-router": "^1.160.2",
|
||||
"@xterm/addon-fit": "^0.11.0",
|
||||
"@xterm/xterm": "^6.0.0",
|
||||
"class-variance-authority": "^0.7.1",
|
||||
"effect": "catalog:",
|
||||
"ghostty-web": "0.4.0",
|
||||
"jose": "catalog:",
|
||||
"lexical": "^0.41.0",
|
||||
"lucide-react": "^0.564.0",
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
resolveBranchToolbarValue,
|
||||
resolveLockedWorkspaceLabel,
|
||||
shouldIncludeBranchPickerItem,
|
||||
shouldShowEnvironmentIndicator,
|
||||
} from "./BranchToolbar.logic";
|
||||
|
||||
const localEnvironmentId = EnvironmentId.make("environment-local");
|
||||
@@ -119,6 +120,44 @@ describe("resolveEnvironmentOptionLabel", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldShowEnvironmentIndicator", () => {
|
||||
it("shows the indicator whenever multiple environments are pickable", () => {
|
||||
expect(
|
||||
shouldShowEnvironmentIndicator({
|
||||
activeEnvironment: { isPrimary: true },
|
||||
canPickEnvironment: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("shows a sole remote environment so the user knows where the project runs", () => {
|
||||
expect(
|
||||
shouldShowEnvironmentIndicator({
|
||||
activeEnvironment: { isPrimary: false },
|
||||
canPickEnvironment: false,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("hides a sole primary (this-device) environment", () => {
|
||||
expect(
|
||||
shouldShowEnvironmentIndicator({
|
||||
activeEnvironment: { isPrimary: true },
|
||||
canPickEnvironment: false,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("hides the indicator when the active environment is unknown", () => {
|
||||
expect(
|
||||
shouldShowEnvironmentIndicator({
|
||||
activeEnvironment: null,
|
||||
canPickEnvironment: false,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveEffectiveEnvMode", () => {
|
||||
it("treats draft threads already attached to a worktree as current-checkout mode", () => {
|
||||
expect(
|
||||
|
||||
@@ -42,6 +42,17 @@ export function resolveEnvironmentOptionLabel(input: {
|
||||
return runtimeLabel ?? savedLabel ?? input.environmentId;
|
||||
}
|
||||
|
||||
// A remote (non-primary) environment is always surfaced, even when it is the
|
||||
// only environment available: with a single connected machine there is nothing
|
||||
// to pick, but the user still needs to see where the project runs.
|
||||
export function shouldShowEnvironmentIndicator(input: {
|
||||
activeEnvironment: Pick<EnvironmentOption, "isPrimary"> | null;
|
||||
canPickEnvironment: boolean;
|
||||
}): boolean {
|
||||
if (input.canPickEnvironment) return true;
|
||||
return input.activeEnvironment !== null && !input.activeEnvironment.isPrimary;
|
||||
}
|
||||
|
||||
export function resolveEnvModeLabel(mode: EnvMode): string {
|
||||
return mode === "worktree" ? "New worktree" : "Current checkout";
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
resolveEnvModeLabel,
|
||||
resolveEffectiveEnvMode,
|
||||
resolveLockedWorkspaceLabel,
|
||||
shouldShowEnvironmentIndicator,
|
||||
} from "./BranchToolbar.logic";
|
||||
import { BranchToolbarBranchSelector } from "./BranchToolbarBranchSelector";
|
||||
import { BranchToolbarEnvironmentSelector } from "./BranchToolbarEnvironmentSelector";
|
||||
@@ -60,6 +61,7 @@ interface MobileRunContextSelectorProps {
|
||||
environmentId: EnvironmentId;
|
||||
availableEnvironments: readonly EnvironmentOption[] | undefined;
|
||||
showEnvironmentPicker: boolean;
|
||||
showEnvironmentIndicator: boolean;
|
||||
onEnvironmentChange: ((environmentId: EnvironmentId) => void) | undefined;
|
||||
effectiveEnvMode: EnvMode;
|
||||
activeWorktreePath: string | null;
|
||||
@@ -72,6 +74,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({
|
||||
environmentId,
|
||||
availableEnvironments,
|
||||
showEnvironmentPicker,
|
||||
showEnvironmentIndicator,
|
||||
onEnvironmentChange,
|
||||
effectiveEnvMode,
|
||||
activeWorktreePath,
|
||||
@@ -94,7 +97,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({
|
||||
: resolveCurrentWorkspaceLabel(activeWorktreePath);
|
||||
const isLocked = envLocked || envModeLocked;
|
||||
const EnvironmentIcon = activeEnvironment?.isPrimary ? MonitorIcon : CloudIcon;
|
||||
const icon = showEnvironmentPicker ? (
|
||||
const icon = showEnvironmentIndicator ? (
|
||||
// Button's base styles apply `-mx-0.5` to descendant SVGs, which eats 4px
|
||||
// out of whatever gap we set. mx-0! cancels that so gap-0.5 reads as 2px.
|
||||
<span className="inline-flex shrink-0 items-center gap-0.5">
|
||||
@@ -108,7 +111,7 @@ const MobileRunContextSelector = memo(function MobileRunContextSelector({
|
||||
<>
|
||||
{icon}
|
||||
<span className="min-w-0 truncate">
|
||||
{showEnvironmentPicker ? (activeEnvironment?.label ?? "Run on") : workspaceLabel}
|
||||
{showEnvironmentIndicator ? (activeEnvironment?.label ?? "Run on") : workspaceLabel}
|
||||
</span>
|
||||
</>
|
||||
);
|
||||
@@ -234,6 +237,12 @@ export const BranchToolbar = memo(function BranchToolbar({
|
||||
const showEnvironmentPicker = Boolean(
|
||||
availableEnvironments && availableEnvironments.length > 1 && onEnvironmentChange,
|
||||
);
|
||||
const activeEnvironmentOption =
|
||||
availableEnvironments?.find((env) => env.environmentId === environmentId) ?? null;
|
||||
const showEnvironmentIndicator = shouldShowEnvironmentIndicator({
|
||||
activeEnvironment: activeEnvironmentOption,
|
||||
canPickEnvironment: showEnvironmentPicker,
|
||||
});
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
if (!hasActiveThread || !activeProject) return null;
|
||||
@@ -247,6 +256,7 @@ export const BranchToolbar = memo(function BranchToolbar({
|
||||
environmentId={environmentId}
|
||||
availableEnvironments={availableEnvironments}
|
||||
showEnvironmentPicker={showEnvironmentPicker}
|
||||
showEnvironmentIndicator={showEnvironmentIndicator}
|
||||
onEnvironmentChange={onEnvironmentChange}
|
||||
effectiveEnvMode={effectiveEnvMode}
|
||||
activeWorktreePath={activeWorktreePath}
|
||||
@@ -254,13 +264,13 @@ export const BranchToolbar = memo(function BranchToolbar({
|
||||
/>
|
||||
) : (
|
||||
<div className="flex min-w-0 shrink-0 items-center gap-1">
|
||||
{showEnvironmentPicker && availableEnvironments && onEnvironmentChange && (
|
||||
{showEnvironmentIndicator && availableEnvironments && (
|
||||
<>
|
||||
<BranchToolbarEnvironmentSelector
|
||||
envLocked={envLocked}
|
||||
environmentId={environmentId}
|
||||
availableEnvironments={availableEnvironments}
|
||||
onEnvironmentChange={onEnvironmentChange}
|
||||
{...(showEnvironmentPicker && onEnvironmentChange ? { onEnvironmentChange } : {})}
|
||||
/>
|
||||
<Separator orientation="vertical" className="mx-0.5 h-3.5!" />
|
||||
</>
|
||||
|
||||
@@ -422,17 +422,32 @@ export function BranchToolbarBranchSelector({
|
||||
});
|
||||
};
|
||||
|
||||
// Default the worktree base to the repo default branch (origin/HEAD), only
|
||||
// falling back to the checked-out branch when no default is known.
|
||||
const defaultBranchName = useMemo(
|
||||
() => refs.find((refName) => refName.isDefault)?.name ?? null,
|
||||
[refs],
|
||||
);
|
||||
const worktreeBaseBranchCandidate = isInitialBranchesLoadPending
|
||||
? null
|
||||
: (defaultBranchName ?? currentGitBranch);
|
||||
useEffect(() => {
|
||||
if (
|
||||
effectiveEnvMode !== "worktree" ||
|
||||
activeWorktreePath ||
|
||||
activeThreadBranch ||
|
||||
!currentGitBranch
|
||||
!worktreeBaseBranchCandidate
|
||||
) {
|
||||
return;
|
||||
}
|
||||
setThreadBranch(currentGitBranch, null);
|
||||
}, [activeThreadBranch, activeWorktreePath, currentGitBranch, effectiveEnvMode, setThreadBranch]);
|
||||
setThreadBranch(worktreeBaseBranchCandidate, null);
|
||||
}, [
|
||||
activeThreadBranch,
|
||||
activeWorktreePath,
|
||||
effectiveEnvMode,
|
||||
setThreadBranch,
|
||||
worktreeBaseBranchCandidate,
|
||||
]);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Combobox / list plumbing
|
||||
|
||||
@@ -17,7 +17,9 @@ interface BranchToolbarEnvironmentSelectorProps {
|
||||
envLocked: boolean;
|
||||
environmentId: EnvironmentId;
|
||||
availableEnvironments: readonly EnvironmentOption[];
|
||||
onEnvironmentChange: (environmentId: EnvironmentId) => void;
|
||||
// Absent when there is only one environment to show: the indicator still
|
||||
// renders (as a static label) so remote projects are always identifiable.
|
||||
onEnvironmentChange?: (environmentId: EnvironmentId) => void;
|
||||
}
|
||||
|
||||
export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvironmentSelector({
|
||||
@@ -39,7 +41,7 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
|
||||
[availableEnvironments],
|
||||
);
|
||||
|
||||
if (envLocked) {
|
||||
if (envLocked || onEnvironmentChange === undefined) {
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1 border border-transparent px-[calc(--spacing(3)-1px)] text-sm font-medium text-muted-foreground/70 sm:text-xs">
|
||||
{activeEnvironment?.isPrimary ? (
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1159,6 +1159,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
isSendBusy ||
|
||||
isConnecting ||
|
||||
projectSelectionRequired ||
|
||||
environmentUnavailable !== null ||
|
||||
!composerSendState.hasSendableContent;
|
||||
const collapsedComposerPrimaryActionLabel = "Send message";
|
||||
const showMobilePendingAnswerActions =
|
||||
@@ -1697,7 +1698,9 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
|
||||
const shouldBlurMobileComposerOnSubmit = useCallback(() => {
|
||||
if (!isMobileViewport) return false;
|
||||
if (isSendBusy || isConnecting || phase === "running") return false;
|
||||
if (isSendBusy || isConnecting || environmentUnavailable !== null || phase === "running") {
|
||||
return false;
|
||||
}
|
||||
if (activePendingProgress) {
|
||||
return activePendingProgress.isLastQuestion && Boolean(activePendingResolvedAnswers);
|
||||
}
|
||||
@@ -1706,6 +1709,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
activePendingProgress,
|
||||
activePendingResolvedAnswers,
|
||||
composerSendState.hasSendableContent,
|
||||
environmentUnavailable,
|
||||
isConnecting,
|
||||
isMobileViewport,
|
||||
isSendBusy,
|
||||
@@ -1892,8 +1896,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
isConnecting ||
|
||||
isComposerApprovalState ||
|
||||
pendingUserInputs.length > 0 ||
|
||||
projectSelectionRequired ||
|
||||
(environmentUnavailable !== null && activePendingProgress === null)
|
||||
projectSelectionRequired
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -2101,8 +2104,6 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
isComposerApprovalState,
|
||||
pendingUserInputs.length,
|
||||
projectSelectionRequired,
|
||||
environmentUnavailable,
|
||||
activePendingProgress,
|
||||
applyPromptReplacement,
|
||||
isComposerModelPickerOpen,
|
||||
readComposerSnapshot,
|
||||
@@ -2144,7 +2145,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
className={cn(
|
||||
"chat-composer-glass rounded-[20px] border transition-[background-color] duration-200 has-focus-visible:border-ring/45",
|
||||
isDragOverComposer ? "border-primary/70 bg-accent/45" : "border-border",
|
||||
environmentUnavailable || projectSelectionRequired ? "opacity-75" : null,
|
||||
projectSelectionRequired ? "opacity-75" : null,
|
||||
composerProviderState.composerSurfaceClassName,
|
||||
)}
|
||||
onFocusCapture={(event) => {
|
||||
@@ -2502,12 +2503,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
? "Ask for follow-up changes or attach images"
|
||||
: "Ask anything, @tag files/folders, $use skills, or / for commands"
|
||||
}
|
||||
disabled={
|
||||
isConnecting ||
|
||||
isComposerApprovalState ||
|
||||
projectSelectionRequired ||
|
||||
(environmentUnavailable !== null && activePendingProgress === null)
|
||||
}
|
||||
disabled={isConnecting || isComposerApprovalState || projectSelectionRequired}
|
||||
/>
|
||||
{showMobilePendingAnswerActions ? (
|
||||
<div
|
||||
|
||||
@@ -8,6 +8,7 @@ import { createHashHistory, createBrowserHistory } from "@tanstack/react-router"
|
||||
import "@fontsource-variable/dm-sans/index.css";
|
||||
import "@fontsource/jetbrains-mono/400.css";
|
||||
import "@fontsource/jetbrains-mono/500.css";
|
||||
import "@xterm/xterm/css/xterm.css";
|
||||
import "./index.css";
|
||||
|
||||
import { isElectron } from "./env";
|
||||
|
||||
@@ -75,6 +75,7 @@ export interface AppModelOption {
|
||||
shortName?: string;
|
||||
subProvider?: string;
|
||||
isCustom: boolean;
|
||||
isDefault?: boolean;
|
||||
}
|
||||
|
||||
function toAppModelOption(model: ServerProvider["models"][number]): AppModelOption {
|
||||
@@ -85,6 +86,7 @@ function toAppModelOption(model: ServerProvider["models"][number]): AppModelOpti
|
||||
};
|
||||
if (model.shortName) option.shortName = model.shortName;
|
||||
if (model.subProvider) option.subProvider = model.subProvider;
|
||||
if (model.isDefault) option.isDefault = true;
|
||||
return option;
|
||||
}
|
||||
|
||||
@@ -247,7 +249,9 @@ export function resolveAppModelSelectionForInstance(
|
||||
const options = getAppModelOptionsForInstance(settings, entry);
|
||||
return (
|
||||
resolveSelectableModel(entry.driverKind, selectedModel, options) ??
|
||||
options.find((option) => option.isDefault)?.slug ??
|
||||
options[0]?.slug ??
|
||||
entry.models.find((model) => model.isDefault)?.slug ??
|
||||
entry.models[0]?.slug ??
|
||||
null
|
||||
);
|
||||
|
||||
@@ -92,6 +92,7 @@ export function getDefaultServerModel(
|
||||
): string {
|
||||
const models = getProviderModels(providers, provider);
|
||||
return (
|
||||
models.find((model) => model.isDefault && !model.isCustom)?.slug ??
|
||||
models.find((model) => !model.isCustom)?.slug ??
|
||||
models[0]?.slug ??
|
||||
DEFAULT_MODEL_BY_PROVIDER[provider] ??
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
import { describe, expect, it } from "vite-plus/test";
|
||||
|
||||
import { shouldFocusTerminalAfterSetup } from "./terminal-focus";
|
||||
|
||||
describe("shouldFocusTerminalAfterSetup", () => {
|
||||
it("focuses the active terminal on its first setup", () => {
|
||||
expect(
|
||||
shouldFocusTerminalAfterSetup({
|
||||
autoFocus: true,
|
||||
hasMounted: false,
|
||||
restorePreviousTerminalFocus: false,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("does not steal focus when terminal style causes a remount", () => {
|
||||
expect(
|
||||
shouldFocusTerminalAfterSetup({
|
||||
autoFocus: true,
|
||||
hasMounted: true,
|
||||
restorePreviousTerminalFocus: false,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("restores focus when the terminal itself was focused before remount", () => {
|
||||
expect(
|
||||
shouldFocusTerminalAfterSetup({
|
||||
autoFocus: false,
|
||||
hasMounted: true,
|
||||
restorePreviousTerminalFocus: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
export function shouldFocusTerminalAfterSetup(input: {
|
||||
readonly autoFocus: boolean;
|
||||
readonly hasMounted: boolean;
|
||||
readonly restorePreviousTerminalFocus: boolean;
|
||||
}): boolean {
|
||||
return input.restorePreviousTerminalFocus || (!input.hasMounted && input.autoFocus);
|
||||
}
|
||||
@@ -37,24 +37,6 @@ describe("extractTerminalLinks", () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it("finds non-http scheme urls", () => {
|
||||
const line = "email mailto:[email protected] or clone ssh://[email protected]/t3/t3code.git now";
|
||||
expect(extractTerminalLinks(line)).toEqual([
|
||||
{
|
||||
kind: "url",
|
||||
text: "mailto:[email protected]",
|
||||
start: 6,
|
||||
end: 28,
|
||||
},
|
||||
{
|
||||
kind: "url",
|
||||
text: "ssh://[email protected]/t3/t3code.git",
|
||||
start: 38,
|
||||
end: 72,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it("trims trailing punctuation from links", () => {
|
||||
const line = "(https://example.com/docs), ./src/main.ts:12.";
|
||||
expect(extractTerminalLinks(line)).toEqual([
|
||||
|
||||
@@ -36,10 +36,7 @@ export interface WrappedTerminalLinkLine {
|
||||
segments: ReadonlyArray<WrappedTerminalLinkLineSegment>;
|
||||
}
|
||||
|
||||
// Also matches the non-http schemes ghostty and other terminals linkify;
|
||||
// authority-style schemes require // while opaque ones take a bare payload.
|
||||
const URL_PATTERN =
|
||||
/(?:https?|ftp|ssh|git|gemini|gopher):\/\/[^\s"'`<>]+|(?:mailto|tel|news|magnet):[^\s"'`<>:][^\s"'`<>]*/g;
|
||||
const URL_PATTERN = /https?:\/\/[^\s"'`<>]+/g;
|
||||
const FILE_PATH_PATTERN =
|
||||
/(?:~\/|\.{1,2}\/|\/|[A-Za-z]:[\\/]|\\\\)[^\s"'`<>]+|[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)+(?::\d+){0,2}/g;
|
||||
const TRAILING_PUNCTUATION_PATTERN = /[.,;!?]+$/;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { describe, expect, it } from "vite-plus/test";
|
||||
import {
|
||||
DEFAULT_MODEL,
|
||||
EnvironmentId,
|
||||
ProjectId,
|
||||
CommandId,
|
||||
@@ -139,7 +140,7 @@ describe("add project shared logic", () => {
|
||||
createWorkspaceRootIfMissing: true,
|
||||
defaultModelSelection: {
|
||||
instanceId: "codex",
|
||||
model: "gpt-5.4",
|
||||
model: DEFAULT_MODEL,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -133,8 +133,18 @@ const CURSOR_DRIVER_KIND = ProviderDriverKind.make("cursor");
|
||||
const GROK_DRIVER_KIND = ProviderDriverKind.make("grok");
|
||||
const OPENCODE_DRIVER_KIND = ProviderDriverKind.make("opencode");
|
||||
|
||||
export const DEFAULT_MODEL = "gpt-5.4";
|
||||
export const DEFAULT_GIT_TEXT_GENERATION_MODEL = "gpt-5.4-mini";
|
||||
export const DEFAULT_MODEL = "gpt-5.6-sol";
|
||||
|
||||
/**
|
||||
* Codex default-model preference, most preferred first. The provider snapshot
|
||||
* marks the first of these present in the live `model/list` response as
|
||||
* default; when none are available, Codex's own `isDefault` flag wins.
|
||||
*/
|
||||
export const PREFERRED_DEFAULT_CODEX_MODELS: ReadonlyArray<string> = [
|
||||
"gpt-5.6-sol",
|
||||
"gpt-5.6-terra",
|
||||
];
|
||||
export const DEFAULT_GIT_TEXT_GENERATION_MODEL = "gpt-5.6-luna";
|
||||
|
||||
export const DEFAULT_MODEL_BY_PROVIDER: Partial<Record<ProviderDriverKind, string>> = {
|
||||
[CODEX_DRIVER_KIND]: DEFAULT_MODEL,
|
||||
|
||||
@@ -64,6 +64,7 @@ export const ServerProviderModel = Schema.Struct({
|
||||
shortName: Schema.optional(TrimmedNonEmptyString),
|
||||
subProvider: Schema.optional(TrimmedNonEmptyString),
|
||||
isCustom: Schema.Boolean,
|
||||
isDefault: Schema.optional(Schema.Boolean),
|
||||
capabilities: Schema.NullOr(ModelCapabilities),
|
||||
});
|
||||
export type ServerProviderModel = typeof ServerProviderModel.Type;
|
||||
@@ -406,28 +407,6 @@ export const ServerSignalProcessResult = Schema.Struct({
|
||||
});
|
||||
export type ServerSignalProcessResult = typeof ServerSignalProcessResult.Type;
|
||||
|
||||
/** Terminal colors parsed from the user's Ghostty theme (hex strings like "#1e1e2e"). */
|
||||
export const ServerTerminalThemeColors = Schema.Struct({
|
||||
background: Schema.optional(TrimmedNonEmptyString),
|
||||
foreground: Schema.optional(TrimmedNonEmptyString),
|
||||
cursor: Schema.optional(TrimmedNonEmptyString),
|
||||
selectionBackground: Schema.optional(TrimmedNonEmptyString),
|
||||
selectionForeground: Schema.optional(TrimmedNonEmptyString),
|
||||
/** ANSI palette slots 0-15; empty string for slots the theme does not define. */
|
||||
palette: Schema.optional(Schema.Array(Schema.String)),
|
||||
});
|
||||
export type ServerTerminalThemeColors = typeof ServerTerminalThemeColors.Type;
|
||||
|
||||
/** Terminal appearance derived from the user's local Ghostty config, when present. */
|
||||
export const ServerTerminalStyle = Schema.Struct({
|
||||
/** font-family fallback chain in config order. */
|
||||
fontFamily: Schema.optional(Schema.Array(TrimmedNonEmptyString)),
|
||||
fontSize: Schema.optional(Schema.Number),
|
||||
light: Schema.optional(ServerTerminalThemeColors),
|
||||
dark: Schema.optional(ServerTerminalThemeColors),
|
||||
});
|
||||
export type ServerTerminalStyle = typeof ServerTerminalStyle.Type;
|
||||
|
||||
export const ServerConfig = Schema.Struct({
|
||||
environment: ExecutionEnvironmentDescriptor,
|
||||
auth: ServerAuthDescriptor,
|
||||
@@ -443,8 +422,6 @@ export const ServerConfig = Schema.Struct({
|
||||
shellResumeCompletionMarker: Schema.optionalKey(Schema.Boolean),
|
||||
/** Whether thread subscriptions can emit an opt-in catch-up completion marker. */
|
||||
threadResumeCompletionMarker: Schema.optionalKey(Schema.Boolean),
|
||||
/** Absent when no Ghostty config exists or it cannot be read. */
|
||||
terminalStyle: Schema.optional(ServerTerminalStyle),
|
||||
});
|
||||
export type ServerConfig = typeof ServerConfig.Type;
|
||||
|
||||
|
||||
@@ -88,14 +88,14 @@ describe("ServerSettings.providerInstances (slice-2 invariant)", () => {
|
||||
});
|
||||
|
||||
describe("ServerSettings worktree defaults", () => {
|
||||
it("defaults start-from-origin off for legacy configs", () => {
|
||||
expect(decodeServerSettings({}).newWorktreesStartFromOrigin).toBe(false);
|
||||
it("defaults start-from-origin on for legacy configs", () => {
|
||||
expect(decodeServerSettings({}).newWorktreesStartFromOrigin).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts start-from-origin updates", () => {
|
||||
expect(
|
||||
decodeServerSettingsPatch({ newWorktreesStartFromOrigin: true }).newWorktreesStartFromOrigin,
|
||||
).toBe(true);
|
||||
decodeServerSettingsPatch({ newWorktreesStartFromOrigin: false }).newWorktreesStartFromOrigin,
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -382,7 +382,7 @@ export const ServerSettings = Schema.Struct({
|
||||
Schema.withDecodingDefault(Effect.succeed("local" as const satisfies ThreadEnvMode)),
|
||||
),
|
||||
newWorktreesStartFromOrigin: Schema.Boolean.pipe(
|
||||
Schema.withDecodingDefault(Effect.succeed(false)),
|
||||
Schema.withDecodingDefault(Effect.succeed(true)),
|
||||
),
|
||||
addProjectBaseDirectory: TrimmedString.pipe(Schema.withDecodingDefault(Effect.succeed(""))),
|
||||
textGenerationModelSelection: ModelSelection.pipe(
|
||||
|
||||
Generated
+74
-8
@@ -6,12 +6,30 @@ settings:
|
||||
|
||||
catalogs:
|
||||
default:
|
||||
'@effect/openapi-generator':
|
||||
specifier: 4.0.0-beta.78
|
||||
version: 4.0.0-beta.78
|
||||
'@effect/tsgo':
|
||||
specifier: 0.13.2
|
||||
version: 0.13.2
|
||||
'@noble/curves':
|
||||
specifier: 1.9.1
|
||||
version: 1.9.1
|
||||
'@noble/hashes':
|
||||
specifier: 1.8.0
|
||||
version: 1.8.0
|
||||
'@pierre/diffs':
|
||||
specifier: 1.3.0-beta.5
|
||||
version: 1.3.0-beta.5
|
||||
'@typescript/native-preview':
|
||||
specifier: 7.0.0-dev.20260604.1
|
||||
version: 7.0.0-dev.20260604.1
|
||||
jose:
|
||||
specifier: 6.2.2
|
||||
version: 6.2.2
|
||||
typescript:
|
||||
specifier: ~6.0.3
|
||||
version: 6.0.3
|
||||
vite-plus:
|
||||
specifier: 0.2.2
|
||||
version: 0.2.2
|
||||
@@ -544,15 +562,18 @@ importers:
|
||||
'@tanstack/react-router':
|
||||
specifier: ^1.160.2
|
||||
version: 1.170.10([email protected]([email protected]))([email protected])
|
||||
'@xterm/addon-fit':
|
||||
specifier: ^0.11.0
|
||||
version: 0.11.0
|
||||
'@xterm/xterm':
|
||||
specifier: ^6.0.0
|
||||
version: 6.0.0
|
||||
class-variance-authority:
|
||||
specifier: ^0.7.1
|
||||
version: 0.7.1
|
||||
effect:
|
||||
specifier: 4.0.0-beta.78
|
||||
version: 4.0.0-beta.78(patch_hash=c502bc684210b707dfceb87d8fe6ad6843395af6e19cfc02cd65854898bde2c5)
|
||||
ghostty-web:
|
||||
specifier: 0.4.0
|
||||
version: 0.4.0
|
||||
jose:
|
||||
specifier: 'catalog:'
|
||||
version: 6.2.2
|
||||
@@ -3279,48 +3300,56 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-p4Y/+RYk9Bk5WO+zHSUXAClRmZ2fbJCejMuCAsU2HhyME4jqf6Ftt/mJYEwIah1wGCBDYOB7wEGV1x5bCEZ6hA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-By6tRALAZsno0F4zedmtG+wdMvJiJmJoXM4d3+A9zHE4HRXLqXITwRH8mgrlcXc5yJM2g2W3riRPwTYdgemZLQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-skYeG+RgvyzspqVEBsEprL90OYYZfoVNqB3HcCNR6QDJyXKOzfDRT3zncnHmUaFluIlBHuY23mU1b5WGgR98hA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-FFgACrZOXAXUh5KQh2mt1CDOVOZmn+QzHP71wM9QobNwyQvoFfyAeefVUltW83g3sm7LTiH3yfFqLLVUpA5ZFQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-Nm/BAOfQeFiiKd502mZn/GAVKJwtd0RdCg17G3Wz/WSOIQmDi3+7/SZH4BHn1Ye5KvTVH3ua8WvfwLLycNIuvA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-BiSy5Ku3mQqyxS6YIqAJgd403wEUWvI7kerfzPxc2l/txZVmZM0pSj7oDM+4bGBExowxOi7o73jEam1W0EDTZg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-BCRkJiotz5s9afLYD2LuMvzAoDYx9H17E/YbDyu4xK7l4zHDPeny9ErSXL//i/nJyaOwRk08x4b8cgJC00+JDg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxfmt/[email protected]':
|
||||
resolution: {integrity: sha512-4Oaxe1qrGgXfpCJ1C/ERJ2iCtV2rN1R79ga9fsfyVHfSQRu/hVW780u2KDqZWFZ/iGTHODJji0JemxqFZ63eIQ==}
|
||||
@@ -3423,48 +3452,56 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-JGHS9Mnr7iWyyLDxgCv1MhzVpAckgptg00F2gnxt/GD7lQ2SW1BRcxHqhSTaSdDpjWRrBkBxMMh4+Hn3aVtExg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-AOYgBZqxNshrg83P9v0RYv+m8s10Cqkj4/PxXFDhcS3k7FqsIG5+CxErshZCIN7G8iy4Y+VGfAsuEdar8AcbBg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-QMybPS5ij3/vrKG67mqzHwW++91sYxK/PPUVi6SBtNCEzW4niS52fVBdXbQ6nou0wWbUPEpx8Sl/ZjtgE3clXA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-gOc3W7JV0PXRpIL7stUlLe3Wa9Gp0Kdlup87IT3gHDvPKck2xNgMIl/Gs2lldYY2lyXZDC4rWi3hmoLUobkgbQ==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-rpGxph+FjjHcYI5q6uxB3Az+tnfmEnDbSA8+PK9ZE/VzyUAkvBOMeuY7ZQMhu5mpZH7YQDsTdW6Cx4kV/msc6w==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-WND+uhf/Ko13SLqQMWQUgsZuLvYYEvL0ZKgg0tgGYfLqxG7l8Ju123fHDMJyYSDl5E3bUbpFUuii/OvMreFQzw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-SrpbrUL70nG9vh6zP4/oKHWgLuHquwsr7MW9XOn0olBVgh10Uqr8qscKhQoBGEn6olK/IUpn5GSKcdQ5AjUhGA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@oxlint/[email protected]':
|
||||
resolution: {integrity: sha512-qkrsEn6NmgFKr7U/QnezQMb+q/vzAy0Dd9Y95gQGQTyjzDLN+HRZMuM5u70iyH4nBLCfKBzhjMsYCehKay2jyg==}
|
||||
@@ -4000,6 +4037,7 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-QoSx2EkyrrdZ6kcyE8stqZ62t0Yra8Fs5ia9lOxJrh6TMQJK7gQKmscdTHf7pOXKREKrVwOtJcQG3qVSfc866A==}
|
||||
@@ -4013,12 +4051,14 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-uwNwFpwKeNiZawfAWBgg0VIztPTV3ihhh1vV334h9ivnNLorxnQMU6Fz8wG1Zb4Qh9LC1/MkcyT3YlDXG3Rsgg==}
|
||||
@@ -4032,12 +4072,14 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-zY1bul7OWr7DFBiJ++wofXvnr8B45ce3QsQUhKrIhXsygAh7bTkwyeM1bi1a2g5C/yC/N8TZyGDEoMfm/l9mpg==}
|
||||
@@ -4051,12 +4093,14 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-0frlsT/f4Ft6I7SMESTKnF3cZsdicQn1dCMkF/jT9wDLE+gGoiQfv1nmT9e+s7s/fekvvy6tZM2jHvI2tkbJDQ==}
|
||||
@@ -4070,12 +4114,14 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-XABVmGp9Tg0WspTVvwduTc4fpqy6JnAUrSQe6OuyqD/03nI7r0O9OWUkMIwFrjKAIqolvqoA4ZrJppgwE0Gxmw==}
|
||||
@@ -4089,12 +4135,14 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw==}
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-bV4fzswuzVcKD90o/VM6QqKxnxlDq0g2BISDLNVmxrnhpv1DDbyPhCIjYfvzYLV+MvkKKnQt2Q6AO86SEBULUQ==}
|
||||
@@ -4108,6 +4156,7 @@ packages:
|
||||
engines: {node: ^20.19.0 || >=22.12.0}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@rolldown/[email protected]':
|
||||
resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==}
|
||||
@@ -4567,6 +4616,7 @@ packages:
|
||||
engines: {node: '>= 20'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@tailwindcss/[email protected]':
|
||||
resolution: {integrity: sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ==}
|
||||
@@ -4580,6 +4630,7 @@ packages:
|
||||
engines: {node: '>= 20'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@tailwindcss/[email protected]':
|
||||
resolution: {integrity: sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g==}
|
||||
@@ -4593,6 +4644,7 @@ packages:
|
||||
engines: {node: '>= 20'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@tailwindcss/[email protected]':
|
||||
resolution: {integrity: sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g==}
|
||||
@@ -4606,6 +4658,7 @@ packages:
|
||||
engines: {node: '>= 20'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@tailwindcss/[email protected]':
|
||||
resolution: {integrity: sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q==}
|
||||
@@ -5072,24 +5125,28 @@ packages:
|
||||
engines: {node: '>=20.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@voidzero-dev/[email protected]':
|
||||
resolution: {integrity: sha512-YGtvTHT7qP4c5pZmM4kLL78/d8hj2NS150R92cR2SVOW/l9Ilq5R5WrEiMA4k5Ea3B++IJWZT5MRFI0tW9qlcg==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@voidzero-dev/[email protected]':
|
||||
resolution: {integrity: sha512-FvaMI/vsy4PVM+Qd73K+KM8blfCAfaoZaGaGWNrrlMryhyPThXPnHoB1AQcrKbEAWb+z2fc4zLS4sH+8uI65fw==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
'@voidzero-dev/[email protected]':
|
||||
resolution: {integrity: sha512-ZsMochHqXqxj2sGTJNJzz3vabppbe4BFgZAjJfsnVzkwR7jv6c5p1BM71LFWxP4qd5LL0TJT7lbeRhALlI44RQ==}
|
||||
engines: {node: '>=20.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
'@voidzero-dev/[email protected]':
|
||||
resolution: {integrity: sha512-noBNyJufux0cf18eDpQLOQUZ1Kybfx9zlr+yQ6gAnxMEsQXSvYqZgWymfRDesBE3G/0XB5bg+AUtWijp3TwVcw==}
|
||||
@@ -5137,6 +5194,12 @@ packages:
|
||||
resolution: {integrity: sha512-A9gOqLdi6cV4ibazAjcQufGj0B1y/vDqYrcuP6d/6x8P27gRS8643Dj9o1dEKtB6O7fwxb2FgBmJS2mX7gpvdw==}
|
||||
engines: {node: '>=14.6'}
|
||||
|
||||
'@xterm/[email protected]':
|
||||
resolution: {integrity: sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==}
|
||||
|
||||
'@xterm/[email protected]':
|
||||
resolution: {integrity: sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==}
|
||||
|
||||
'@yuuang/[email protected]':
|
||||
resolution: {integrity: sha512-eDYLT0kVBkp7e2BwdRDmt6N1rkeDPUHDefk3ZX0/nok+GLsqfy1WBoSL3Yg7HVXN1EyW8OBVc2uK8Zq8HbmaSA==}
|
||||
engines: {node: '>= 12'}
|
||||
@@ -6983,9 +7046,6 @@ packages:
|
||||
resolution: {integrity: sha512-VilgtJj/ALgGY77fiLam5iD336eSWi96Q15JSAG1zi8NRBysm3LXKdGnHb4m5cuyxvOLQQKWpBZAT6ni4FI2iQ==}
|
||||
engines: {node: '>=6'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-0puDBik2qapbD/QQBW9o5ZHfXnZBqZWx/ctBiVtKZ6ZLds4NYb+wZuw1cRLXZk9zYovIQ908z3rvFhexAvc5Hg==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==}
|
||||
|
||||
@@ -7612,6 +7672,7 @@ packages:
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==}
|
||||
@@ -7632,6 +7693,7 @@ packages:
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==}
|
||||
@@ -7652,6 +7714,7 @@ packages:
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [glibc]
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==}
|
||||
@@ -7672,6 +7735,7 @@ packages:
|
||||
engines: {node: '>= 12.0.0'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==}
|
||||
@@ -15134,6 +15198,10 @@ snapshots:
|
||||
|
||||
'@xmldom/[email protected]': {}
|
||||
|
||||
'@xterm/[email protected]': {}
|
||||
|
||||
'@xterm/[email protected]': {}
|
||||
|
||||
'@yuuang/[email protected]':
|
||||
optional: true
|
||||
|
||||
@@ -17455,8 +17523,6 @@ snapshots:
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
|
||||
Reference in new issue
Block a user