diff --git a/README.md b/README.md index 691759f807c4..69a0acfda1cb 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ This is a fork of T3 Code that integrates a few additional features, including: - **FYI messages between agents:** an agent can send another thread an FYI, a note of at most 16,000 characters that needs no action and starts no turn. The receiving agent gets it with its next turn; a running Claude Code thread gets it at its next tool call. An FYI counts as delivered only when the turn that carries it finishes: a turn that fails, is stopped, restarts or is reverted gives it back, so the agent may see it twice. When a thread has an FYI waiting and has been idle for 6 hours, T3 Code wakes it to deliver its FYIs, unless the thread is settled, archived, waiting for your answer or holds queued messages; a snoozed thread waits until its snooze ends. The 6 hours count from the thread's last turn, or from the reset of a usage limit that stopped it on the provider it still uses (or from the end of a snooze that ends after that reset), so an FYI to a thread that has been idle longer wakes it within minutes. A thread whose usage limit has no known reset time, or whose provider fails every turn, gets a failed wake every 6 hours while an FYI waits. A wake carries up to 16,000 characters of FYIs. The rest, and any that a wake gives back because it failed or you stopped it, get another wake after 6 more idle hours. A wake is a new turn, so **Resume** no longer continues a turn that ended before it. Settle or archive a thread to stop its wakes. The timeline marks these messages "FYI · waiting", "FYI · sent" while the turn that carries them runs, and "FYI" once it finished. - **Open server files by their path:** in a browser signed in to T3 Code at its own address, open `/` (such as `https://t3.example.com/home/ana/work/report.html`) to see that file read-only, for files under the server user's home folder and temp folder. A session needs the `filesystem:read` permission, and a signed-out browser gets a sign-in page. Text and code of any type show as plain text, and images, PDFs, audio and video show as themselves. A folder shows its `index.html`, or else a list of its files. Links ending in `:line` or `:line:col` open the file. Names that start with `.`, and T3 Code's own data folder, are not served. An HTML page runs in a sandboxed frame at the same address: its scripts run but cannot act as you in T3, and it loads files from its own folder and below for an hour, though its scripts cannot fetch them. A page directly in the home or temp folder loads no other files. An HTML page linked from another site, or any HTML page over plain HTTP, first shows an Open link. - **HTML pages from disk block their own network calls:** an HTML file that the file viewer, "Open in browser" or a server file path shows from disk runs its own scripts and loads scripts, styles, fonts and images over HTTPS. It cannot use fetch, XHR, WebSocket, EventSource, beacons or form posts, its frames cannot load other addresses, and audio and video play only from its own files or inline data. A page that fetches its data while it runs needs that data inline. An allowed load can still carry data in its URL, so these limits do not make an untrusted page safe. +- **Folders on file links:** Settings → Appearance → File link folders shows up to four folders before the file name on file links in messages and Markdown previews, such as `review-pipeline/glossary.md`, so you need not hover a link to see where the file is. Each browser, and the desktop app, keeps its own choice. A file name that repeats in one message keeps its folder hint after the name. - Enabling math rendering by default. - Other small fixes. diff --git a/apps/web/src/components/ChatMarkdown.tsx b/apps/web/src/components/ChatMarkdown.tsx index 39dbc684d25d..c4074b1ac357 100644 --- a/apps/web/src/components/ChatMarkdown.tsx +++ b/apps/web/src/components/ChatMarkdown.tsx @@ -241,6 +241,7 @@ import { } from "./chat/ChatMarkdownMedia"; import { MarkdownExternalLinkContent } from "./chat/MarkdownExternalLink"; import { MarkdownFileLink } from "./chat/MarkdownFileLink"; +import { useFileLinkPrefix } from "../fork/FileLinkPathPrefix"; import { canUseMarkdownFileShellActions } from "./chat/MarkdownFileLink.logic"; import { rehypeChipPunctuation } from "./chat/markdownChipPunctuation"; import { handleMarkdownFragmentClick, rehypeHeadingIds } from "./chat/markdownFragments"; @@ -769,6 +770,7 @@ function useChatMarkdownState({ const fileLinksKey = `${fileLinkSourcesKey(text, cwd, imageBaseDir, fileLinkPeerPaths, hostFileOrigins)}`; const { markdownFileLinkMetaByHref, inlineCodeFileLinkMetaByText, fileLinkParentSuffixByPath } = resolveFileLinkSources(fileLinksKey, cwd, imageBaseDir); + const fileLinkPrefix = useFileLinkPrefix(fileLinkParentSuffixByPath); const resolveThreadPullRequest = ( href: string, ): (ThreadPullRequestKey & { readonly url: string }) | null => { @@ -993,6 +995,7 @@ function useChatMarkdownState({ }, fileLinkParentSuffixByPath, )} + labelPrefix={fileLinkPrefix(fileLinkMeta)} copyMarkdown={copyMarkdown} theme={resolvedTheme} threadRef={threadRef} diff --git a/apps/web/src/components/chat/FileTagChip.tsx b/apps/web/src/components/chat/FileTagChip.tsx index ddb30cf7bcf7..e1c1e5cfb26e 100644 --- a/apps/web/src/components/chat/FileTagChip.tsx +++ b/apps/web/src/components/chat/FileTagChip.tsx @@ -1,12 +1,14 @@ import type { ReactNode } from "react"; import type { EnvironmentId } from "@t3tools/contracts"; import { ContextChipLabel } from "../ContextChip"; +import { FileLinkPathLabel } from "../../fork/FileLinkPathPrefix"; import { WorkspaceEntryIcon } from "./WorkspaceEntryIcon"; export function FileTagChipContent(props: { icon?: ReactNode; path: string; label: string; + labelPrefix?: string | undefined; theme: "light" | "dark"; environmentId?: EnvironmentId | null | undefined; cwd?: string | undefined; @@ -21,7 +23,9 @@ export function FileTagChipContent(props: { theme={props.theme} /> )} - {props.label} + + + ); } diff --git a/apps/web/src/components/chat/MarkdownFileLink.tsx b/apps/web/src/components/chat/MarkdownFileLink.tsx index 5b1e1e500704..a70c75265e39 100644 --- a/apps/web/src/components/chat/MarkdownFileLink.tsx +++ b/apps/web/src/components/chat/MarkdownFileLink.tsx @@ -44,6 +44,7 @@ interface MarkdownFileLinkProps { panelPath: string | null; line?: number | undefined; label: string; + labelPrefix?: string | undefined; copyMarkdown: string; theme: "light" | "dark"; threadRef?: ScopedThreadRef | undefined; @@ -70,6 +71,7 @@ export const MarkdownFileLink = memo(function MarkdownFileLink({ panelPath, line, label, + labelPrefix, copyMarkdown, theme, threadRef, @@ -349,6 +351,7 @@ export const MarkdownFileLink = memo(function MarkdownFileLink({ kind={chipKind} dir="ltr" render={} + aria-label={labelPrefix === undefined ? undefined : `${labelPrefix}${label}`} className={MARKDOWN_FILE_LINK_CLASS_NAME} data-markdown-copy={copyMarkdown} onClick={(event) => { @@ -376,6 +379,7 @@ export const MarkdownFileLink = memo(function MarkdownFileLink({ path={iconPath} environmentId={environmentId} label={label} + labelPrefix={labelPrefix} theme={theme} /> @@ -385,7 +389,7 @@ export const MarkdownFileLink = memo(function MarkdownFileLink({ kind={chipKind} dir="ltr" render={