Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,6 +42,7 @@ const clientSettings: ClientSettings = {
legacySidebarEnabled: false,
timestampFormat: "24-hour",
wordWrap: true,
petEnabled: false,
};

const decodeClientSettingsJson = Schema.decodeEffect(Schema.fromJsonString(ClientSettingsSchema));
Expand Down
182 changes: 173 additions & 9 deletions apps/mobile/src/components/ProviderIcon.tsx
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
import { useColorScheme } from "react-native";
import { Path, Svg } from "react-native-svg";
import { Circle, Path, Svg } from "react-native-svg";
import {
resolveJcodeInnerProviderIconKind,
type JcodeInnerProviderIconKind,
} from "@t3tools/shared/jcodeInnerProvider";
import { View } from "react-native";

type ProviderIconProps = {
readonly provider: string | null | undefined;
readonly size?: number;
/** Selected model slug — used to pick a nested LLM brand when provider is jcode. */
readonly model?: string | null | undefined;
/** jcode `-p` setting when known. */
readonly jcodeProvider?: string | null | undefined;
};

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
function BrandGlyph(props: {
readonly kind: string;
readonly size: number;
readonly mono: string;
readonly isDarkMode: boolean;
}) {
const { kind, size, mono, isDarkMode } = props;

if (props.provider === "claudeAgent") {
if (kind === "claudeAgent") {
return (
<Svg width={size} height={size} viewBox="0 0 256 257" fill="none">
<Path
Expand All@@ -22,7 +34,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "grok") {
if (kind === "grok") {
const fill = isDarkMode ? "#F5F5F5" : "#0F0F0F";
return (
<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
Expand All@@ -38,7 +50,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "cursor") {
if (kind === "cursor") {
return (
<Svg width={size} height={size} viewBox="0 0 466.73 532.09" fill="none">
<Path
Expand All@@ -49,7 +61,7 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (props.provider === "opencode") {
if (kind === "opencode") {
return (
<Svg width={size} height={size} viewBox="0 0 32 40" fill="none">
<Path d="M24 32H8V16H24V32Z" fill={isDarkMode ? "#4B4646" : "#CFCECD"} />
Expand All@@ -58,6 +70,122 @@ export function ProviderIcon(props: ProviderIconProps) {
);
}

if (kind === "jcode") {
return (
<Svg width={size} height={size} viewBox="0 0 100 100" fill="none">
<Circle cx="73.57" cy="14.64" r="3.95" fill={mono} />
<Circle cx="79.46" cy="20.54" r="3.94" fill={mono} />
<Circle cx="85.36" cy="26.43" r="1.57" fill={mono} />
<Circle cx="50.00" cy="2.86" r="3.94" fill={mono} />
<Circle cx="55.89" cy="8.75" r="4.85" fill={mono} />
<Circle cx="61.79" cy="14.64" r="4.51" fill={mono} />
<Circle cx="67.68" cy="20.54" r="4.34" fill={mono} />
<Circle cx="73.57" cy="26.43" r="4.41" fill={mono} />
<Circle cx="79.46" cy="32.32" r="4.58" fill={mono} />
<Circle cx="85.36" cy="38.21" r="4.63" fill={mono} />
<Circle cx="91.25" cy="44.11" r="3.90" fill={mono} />
<Circle cx="38.21" cy="2.86" r="5.15" fill={mono} />
<Circle cx="44.11" cy="8.75" r="4.75" fill={mono} />
<Circle cx="50.00" cy="14.64" r="4.10" fill={mono} />
<Circle cx="55.89" cy="20.54" r="3.45" fill={mono} />
<Circle cx="61.79" cy="26.43" r="3.15" fill={mono} />
<Circle cx="67.68" cy="32.32" r="3.51" fill={mono} />
<Circle cx="73.57" cy="38.21" r="4.17" fill={mono} />
<Circle cx="79.46" cy="44.11" r="4.66" fill={mono} />
<Circle cx="85.36" cy="50.00" r="4.75" fill={mono} />
<Circle cx="91.25" cy="55.89" r="4.19" fill={mono} />
<Circle cx="26.43" cy="2.86" r="2.57" fill={mono} />
<Circle cx="32.32" cy="8.75" r="4.93" fill={mono} />
<Circle cx="38.21" cy="14.64" r="4.26" fill={mono} />
<Circle cx="44.11" cy="20.54" r="3.20" fill={mono} />
<Circle cx="67.68" cy="44.11" r="3.45" fill={mono} />
<Circle cx="73.57" cy="50.00" r="4.56" fill={mono} />
<Circle cx="79.46" cy="55.89" r="4.94" fill={mono} />
<Circle cx="85.36" cy="61.79" r="4.76" fill={mono} />
<Circle cx="91.25" cy="67.68" r="3.54" fill={mono} />
<Circle cx="20.54" cy="8.75" r="5.12" fill={mono} />
<Circle cx="26.43" cy="14.64" r="4.74" fill={mono} />
<Circle cx="32.32" cy="20.54" r="3.98" fill={mono} />
<Circle cx="38.21" cy="26.43" r="2.49" fill={mono} />
<Circle cx="67.68" cy="55.89" r="4.46" fill={mono} />
<Circle cx="73.57" cy="61.79" r="5.06" fill={mono} />
<Circle cx="79.46" cy="67.68" r="4.97" fill={mono} />
<Circle cx="85.36" cy="73.57" r="4.31" fill={mono} />
<Circle cx="14.64" cy="14.64" r="5.05" fill={mono} />
<Circle cx="20.54" cy="20.54" r="4.70" fill={mono} />
<Circle cx="26.43" cy="26.43" r="4.04" fill={mono} />
<Circle cx="32.32" cy="32.32" r="2.73" fill={mono} />
<Circle cx="61.79" cy="61.79" r="4.40" fill={mono} />
<Circle cx="67.68" cy="67.68" r="5.15" fill={mono} />
<Circle cx="73.57" cy="73.57" r="5.04" fill={mono} />
<Circle cx="79.46" cy="79.46" r="4.48" fill={mono} />
<Circle cx="8.75" cy="20.54" r="4.99" fill={mono} />
<Circle cx="14.64" cy="26.43" r="4.76" fill={mono} />
<Circle cx="20.54" cy="32.32" r="4.33" fill={mono} />
<Circle cx="26.43" cy="38.21" r="3.63" fill={mono} />
<Circle cx="32.32" cy="44.11" r="1.72" fill={mono} />
<Circle cx="55.89" cy="67.68" r="4.81" fill={mono} />
<Circle cx="61.79" cy="73.57" r="5.13" fill={mono} />
<Circle cx="67.68" cy="79.46" r="4.97" fill={mono} />
<Circle cx="73.57" cy="85.36" r="4.41" fill={mono} />
<Circle cx="79.46" cy="91.25" r="2.13" fill={mono} />
<Circle cx="2.86" cy="26.43" r="4.89" fill={mono} />
<Circle cx="8.75" cy="32.32" r="4.82" fill={mono} />
<Circle cx="14.64" cy="38.21" r="4.59" fill={mono} />
<Circle cx="20.54" cy="44.11" r="4.29" fill={mono} />
<Circle cx="26.43" cy="50.00" r="3.97" fill={mono} />
<Circle cx="32.32" cy="55.89" r="3.70" fill={mono} />
<Circle cx="38.21" cy="61.79" r="3.81" fill={mono} />
<Circle cx="44.11" cy="67.68" r="4.54" fill={mono} />
<Circle cx="50.00" cy="73.57" r="4.94" fill={mono} />
<Circle cx="55.89" cy="79.46" r="5.00" fill={mono} />
<Circle cx="61.79" cy="85.36" r="4.77" fill={mono} />
<Circle cx="67.68" cy="91.25" r="4.15" fill={mono} />
<Circle cx="-3.03" cy="32.32" r="4.64" fill={mono} />
<Circle cx="2.86" cy="38.21" r="4.79" fill={mono} />
<Circle cx="8.75" cy="44.11" r="4.72" fill={mono} />
<Circle cx="14.64" cy="50.00" r="4.61" fill={mono} />
<Circle cx="20.54" cy="55.89" r="4.52" fill={mono} />
<Circle cx="26.43" cy="61.79" r="4.51" fill={mono} />
<Circle cx="32.32" cy="67.68" r="4.62" fill={mono} />
<Circle cx="38.21" cy="73.57" r="4.77" fill={mono} />
<Circle cx="44.11" cy="79.46" r="4.85" fill={mono} />
<Circle cx="50.00" cy="85.36" r="4.76" fill={mono} />
<Circle cx="55.89" cy="91.25" r="4.44" fill={mono} />
<Circle cx="61.79" cy="97.14" r="3.66" fill={mono} />
<Circle cx="-3.03" cy="44.11" r="4.60" fill={mono} />
<Circle cx="2.86" cy="50.00" r="4.68" fill={mono} />
<Circle cx="8.75" cy="55.89" r="4.66" fill={mono} />
<Circle cx="14.64" cy="61.79" r="4.64" fill={mono} />
<Circle cx="20.54" cy="67.68" r="4.64" fill={mono} />
<Circle cx="26.43" cy="73.57" r="4.67" fill={mono} />
<Circle cx="32.32" cy="79.46" r="4.68" fill={mono} />
<Circle cx="38.21" cy="85.36" r="4.61" fill={mono} />
<Circle cx="44.11" cy="91.25" r="4.41" fill={mono} />
<Circle cx="50.00" cy="97.14" r="3.93" fill={mono} />
<Circle cx="55.89" cy="103.03" r="2.57" fill={mono} />
<Circle cx="-3.03" cy="55.89" r="4.39" fill={mono} />
<Circle cx="2.86" cy="61.79" r="4.49" fill={mono} />
<Circle cx="8.75" cy="67.68" r="4.51" fill={mono} />
<Circle cx="14.64" cy="73.57" r="4.50" fill={mono} />
<Circle cx="20.54" cy="79.46" r="4.47" fill={mono} />
<Circle cx="26.43" cy="85.36" r="4.39" fill={mono} />
<Circle cx="32.32" cy="91.25" r="4.21" fill={mono} />
<Circle cx="38.21" cy="97.14" r="3.83" fill={mono} />
<Circle cx="44.11" cy="103.03" r="2.92" fill={mono} />
<Circle cx="-3.03" cy="67.68" r="3.92" fill={mono} />
<Circle cx="2.86" cy="73.57" r="4.07" fill={mono} />
<Circle cx="8.75" cy="79.46" r="4.07" fill={mono} />
<Circle cx="14.64" cy="85.36" r="4.00" fill={mono} />
<Circle cx="20.54" cy="91.25" r="3.81" fill={mono} />
<Circle cx="26.43" cy="97.14" r="3.42" fill={mono} />
<Circle cx="32.32" cy="103.03" r="2.43" fill={mono} />
<Circle cx="2.86" cy="85.36" r="2.53" fill={mono} />
<Circle cx="8.75" cy="91.25" r="2.48" fill={mono} />
</Svg>
);
}

// codex (and unknown drivers)
return (
<Svg width={size} height={size} viewBox="0 0 256 260" fill="none">
Expand All@@ -68,3 +196,39 @@ export function ProviderIcon(props: ProviderIconProps) {
</Svg>
);
}

function innerKindToProvider(kind: JcodeInnerProviderIconKind): string {
return kind;
}

export function ProviderIcon(props: ProviderIconProps) {
const isDarkMode = useColorScheme() === "dark";
const size = props.size ?? 16;
const mono = isDarkMode ? "#e5e5e5" : "#171717";
const provider = props.provider ?? "codex";

const innerKind =
provider === "jcode"
? resolveJcodeInnerProviderIconKind({
jcodeProvider: props.jcodeProvider,
model: props.model,
})
: null;

if (!innerKind) {
return <BrandGlyph kind={provider} size={size} mono={mono} isDarkMode={isDarkMode} />;
}

const nestedSize = Math.max(10, Math.round(size * 0.85));
return (
<View style={{ flexDirection: "row", alignItems: "center", gap: 2 }}>
<BrandGlyph kind="jcode" size={size} mono={mono} isDarkMode={isDarkMode} />
<BrandGlyph
kind={innerKindToProvider(innerKind)}
size={nestedSize}
mono={mono}
isDarkMode={isDarkMode}
/>
</View>
);
}
1 change: 1 addition & 0 deletions apps/mobile/src/features/home/HomeScreen.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -796,6 +796,7 @@ export function HomeScreen(props: HomeScreenProps) {
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(props.savedConnectionsById).length > 1
? (props.savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -930,6 +930,7 @@ function ThreadNavigationSidebarPane(
(thread.session?.providerInstanceId ?? thread.modelSelection.instanceId),
)?.driver ?? null
}
providerModel={thread.modelSelection.model}
environmentLabel={
Object.keys(savedConnectionsById).length > 1
? (savedConnectionsById[thread.environmentId]?.environmentLabel ?? null)
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -321,6 +321,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
readonly project: EnvironmentProject | null;
readonly projectTitle?: string;
readonly providerDriver: string | null;
readonly providerModel?: string | null;
readonly jcodeProvider?: string | null;
/** Which machine hosts the thread. Null when only one environment is
connected — repeating the same label on every row is noise. Mirrors
the web sidebar's remote-environment cloud icon, but as text since
Expand DownExpand Up@@ -737,7 +739,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : null}
{props.providerDriver ? (
<View className="opacity-60">
<ProviderIcon provider={props.providerDriver} size={14} />
<ProviderIcon
provider={props.providerDriver}
model={props.providerModel}
jcodeProvider={props.jcodeProvider}
size={14}
/>
</View>
) : null}
</View>
Expand Down
14 changes: 13 additions & 1 deletion apps/server/src/attachmentStore.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,9 +8,14 @@ import {
normalizeAttachmentRelativePath,
resolveAttachmentRelativePath,
} from "./attachmentPaths.ts";
import { inferChatFileExtension, SAFE_CHAT_FILE_EXTENSIONS } from "@t3tools/shared/chatAttachments";
import { inferImageExtension, SAFE_IMAGE_FILE_EXTENSIONS } from "./imageMime.ts";

const ATTACHMENT_FILENAME_EXTENSIONS = [...SAFE_IMAGE_FILE_EXTENSIONS, ".bin"];
const ATTACHMENT_FILENAME_EXTENSIONS = [
...SAFE_IMAGE_FILE_EXTENSIONS,
...SAFE_CHAT_FILE_EXTENSIONS,
".bin",
];
const ATTACHMENT_ID_THREAD_SEGMENT_MAX_CHARS = 80;
const ATTACHMENT_ID_THREAD_SEGMENT_PATTERN = "[a-z0-9_]+(?:-[a-z0-9_]+)*";
const ATTACHMENT_ID_UUID_PATTERN = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
Expand DownExpand Up@@ -63,6 +68,13 @@ export function attachmentRelativePath(attachment: ChatAttachment): string {
});
return `${attachment.id}${extension}`;
}
case "file": {
const extension = inferChatFileExtension({
mimeType: attachment.mimeType,
fileName: attachment.name,
});
return `${attachment.id}${extension}`;
}
}
}

Expand Down
23 changes: 18 additions & 5 deletions apps/server/src/bin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,22 @@ export const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) =>
export const cli = makeCli();

if (import.meta.main) {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
// Hidden stdio MCP entry for jcode (see provider/jcodeMcpConfig.ts). Must run
// before Effect CLI so stdin stays available for NDJSON framing.
if (process.argv[2] === "__jcode-mcp-stdio") {
const { runJcodeMcpStdioBridge } = await import("./mcp/jcodeMcpStdioBridge.ts");
try {
await runJcodeMcpStdioBridge();
} catch (error) {
const detail = error instanceof Error ? error.message : String(error);
process.stderr.write(`t3 jcode MCP bridge failed: ${detail}\n`);
process.exit(1);
}
} else {
Command.run(cli, { version: packageJson.version }).pipe(
Effect.scoped,
Effect.provide(CliRuntimeLayer),
NodeRuntime.runMain,
);
}
}
2 changes: 2 additions & 0 deletions apps/server/src/keybindings.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -203,6 +203,8 @@ it.layer(NodeServices.layer)("keybindings", (it) => {
assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
assert.equal(defaultsByCommand.get("board.toggle"), "mod+shift+b");
assert.equal(defaultsByCommand.get("composer.attachImages"), "mod+shift+a");
assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
Expand Down
7 changes: 7 additions & 0 deletions apps/server/src/mcp/McpHttpServer.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,6 +13,8 @@ import packageJson from "../../package.json" with { type: "json" };
import * as McpInvocationContext from "./McpInvocationContext.ts";
import * as McpSessionRegistry from "./McpSessionRegistry.ts";
import * as PreviewAutomationBroker from "./PreviewAutomationBroker.ts";
import { BoardToolkitHandlersLive } from "./toolkits/board/handlers.ts";
import { BoardToolkit } from "./toolkits/board/tools.ts";
import {
PreviewSnapshotToolkitHandlersLive,
PreviewStandardToolkitHandlersLive,
Expand DownExpand Up@@ -211,9 +213,14 @@ const PreviewSnapshotRegistrationLive = Layer.effectDiscard(registerPreviewSnaps
Layer.provide(PreviewSnapshotToolkitHandlersLive),
);

const BoardToolkitRegistrationLive = McpServer.toolkit(BoardToolkit).pipe(
Layer.provide(BoardToolkitHandlersLive),
);

export const PreviewToolkitRegistrationLive = Layer.mergeAll(
PreviewStandardToolkitRegistrationLive,
PreviewSnapshotRegistrationLive,
BoardToolkitRegistrationLive,
);

const McpTransportLive = McpServer.layerHttp({
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpInvocationContext.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,7 +7,7 @@ import {
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";

export type McpCapability = "preview";
export type McpCapability = "preview" | "board";

export interface McpInvocationScope {
readonly environmentId: EnvironmentId;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/mcp/McpSessionRegistry.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,7 +128,7 @@ const makeWithOptions = Effect.fn("McpSessionRegistry.make")(function* (
threadId: ThreadId.make(request.threadId),
providerSessionId,
providerInstanceId: ProviderInstanceId.make(request.providerInstanceId),
capabilities: new Set(["preview"]),
capabilities: new Set(["preview", "board"]),
issuedAt,
};
yield* SynchronizedRef.update(state, ({ records }) => {
Expand Down
Loading