Rename to t3tui
The command, package, env vars (T3TUI_*), config folder, tmux session and the session label it issues itself. An existing ~/.config/tui3 moves to ~/.config/t3tui on the first run.
This commit is contained in:
1 parent
673d314e46
commit
1cccff8031
30 files changed
+147
-138
No files matched your search
+1
-1
@@ -25,7 +25,7 @@ const LOCAL_ENVIRONMENT = "local" as EnvironmentId;
|
||||
* The web's ThreadNotificationCoordinator over the shell snapshot: attention (approval,
|
||||
* question, guest request, failure, usage limit) alerts once per run and status;
|
||||
* completion alerts after the Working shelf's grace, unless the run was stopped. Nothing
|
||||
* alerts for state that was already there when tui3 connected.
|
||||
* alerts for state that was already there when t3tui connected.
|
||||
*/
|
||||
export function createAlerts(onAlert: (alert: Alert) => void) {
|
||||
let previous = new Map<ThreadId, Observed>();
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface ComposerItem {
|
||||
const THREAD_LIMIT = 5;
|
||||
export const PATH_SEARCH_LIMIT = 80;
|
||||
|
||||
/** The trigger the cursor sits in, or null. `/model` is a command here, as tui3 has no model-name search. */
|
||||
/** The trigger the cursor sits in, or null. `/model` is a command here, as t3tui has no model-name search. */
|
||||
export function composerTrigger(text: string, cursor: number): ComposerTrigger | null {
|
||||
const trigger = detectComposerTrigger(text, cursor);
|
||||
if (trigger?.kind === "slash-model") return { ...trigger, kind: "slash-command", query: "model" };
|
||||
|
||||
@@ -13,7 +13,7 @@ import { formatWorkingDurationLabel } from "@t3tools/client-runtime/state/models
|
||||
import { homedir } from "node:os";
|
||||
|
||||
import type { VcsState } from "../client/session.ts";
|
||||
import { formatClock, type Tui3Config } from "../config.ts";
|
||||
import { formatClock, type T3tuiConfig } from "../config.ts";
|
||||
import { buildMenuItems, resolveQuickAction } from "../../vendor/t3code/apps/web/src/components/GitActionsControl.logic.ts";
|
||||
import type { StatusTone } from "./threads.ts";
|
||||
|
||||
@@ -93,7 +93,7 @@ export interface DetailsInput {
|
||||
readonly automations?: readonly ScheduledTask[];
|
||||
readonly now?: number;
|
||||
/** How automation times read; the system's locale by default. */
|
||||
readonly timestampFormat?: Tui3Config["timestampFormat"];
|
||||
readonly timestampFormat?: T3tuiConfig["timestampFormat"];
|
||||
}
|
||||
|
||||
export interface PullRequestLine {
|
||||
@@ -223,7 +223,7 @@ function gitActions(status: VcsStatusResult): NonNullable<ThreadDetails["git"]>
|
||||
return { quick, hint: quick ? null : quickAction.hint ?? quickAction.label, menu };
|
||||
}
|
||||
|
||||
function automationLine(task: ScheduledTask, now: number, timestampFormat: Tui3Config["timestampFormat"]): AutomationLine {
|
||||
function automationLine(task: ScheduledTask, now: number, timestampFormat: T3tuiConfig["timestampFormat"]): AutomationLine {
|
||||
const schedule =
|
||||
task.schedule.type === "interval"
|
||||
? `every ${formatWorkingDurationLabel(task.schedule.everyMs)}`
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import type { ServerConfig } from "@t3tools/contracts";
|
||||
|
||||
import { CONFIG_CHOICES, type Tui3Config } from "../config.ts";
|
||||
import { CONFIG_CHOICES, type T3tuiConfig } from "../config.ts";
|
||||
import { RUNTIME_MODE_LABELS } from "./details.ts";
|
||||
|
||||
export interface SettingRow {
|
||||
readonly key: keyof Tui3Config;
|
||||
readonly key: keyof T3tuiConfig;
|
||||
readonly label: string;
|
||||
readonly value: string;
|
||||
readonly help: string;
|
||||
}
|
||||
|
||||
const LABELS: { readonly [K in keyof Tui3Config]: { readonly label: string; readonly help: string; readonly values?: Partial<Record<string, string>> } } = {
|
||||
const LABELS: { readonly [K in keyof T3tuiConfig]: { readonly label: string; readonly help: string; readonly values?: Partial<Record<string, string>> } } = {
|
||||
followUpBehavior: { label: "While the agent runs, enter", help: "alt+enter does the other", values: { steer: "steers", queue: "queues" } },
|
||||
sendShortcut: { label: "Send with", help: "ctrl+enter needs kitty keyboard support; alt+enter also sends", values: { enter: "enter", "ctrl-enter": "ctrl+enter (enter adds a line)" } },
|
||||
timestampFormat: { label: "Times", help: "automation schedules", values: { locale: "system locale", "12-hour": "12-hour", "24-hour": "24-hour" } },
|
||||
@@ -24,9 +24,9 @@ const LABELS: { readonly [K in keyof Tui3Config]: { readonly label: string; read
|
||||
theme: { label: "Colours", help: "from the next start", values: { auto: "match the terminal", dark: "dark", light: "light" } },
|
||||
};
|
||||
|
||||
/** tui3's own settings, in display order, each cycled with enter. */
|
||||
export function settingRows(config: Tui3Config): SettingRow[] {
|
||||
return (Object.keys(CONFIG_CHOICES) as (keyof Tui3Config)[]).map((key) => {
|
||||
/** t3tui's own settings, in display order, each cycled with enter. */
|
||||
export function settingRows(config: T3tuiConfig): SettingRow[] {
|
||||
return (Object.keys(CONFIG_CHOICES) as (keyof T3tuiConfig)[]).map((key) => {
|
||||
const meta = LABELS[key];
|
||||
const raw = String(config[key]);
|
||||
return { key, label: meta.label, value: meta.values?.[raw] ?? raw, help: meta.help };
|
||||
|
||||
@@ -3,7 +3,7 @@ import { presentThreadShell, threadRuntimeCanArchive } from "@t3tools/client-run
|
||||
import { canSnooze, effectiveSnoozed, pickSnoozePreset, resolveSnoozePresets, type SnoozePreset } from "@t3tools/client-runtime/state/thread-settled";
|
||||
import { pinOrderKeyBetween } from "@t3tools/client-runtime/state/thread-sort";
|
||||
|
||||
import type { Tui3Config } from "../config.ts";
|
||||
import type { T3tuiConfig } from "../config.ts";
|
||||
import { buildThreadActionMenuItems, type ThreadActionMenuId } from "../../vendor/t3code/apps/web/src/components/threadActionMenu.logic.ts";
|
||||
|
||||
export type { ThreadActionMenuId };
|
||||
@@ -18,8 +18,8 @@ export interface ThreadMenu {
|
||||
readonly snoozePresets: readonly SnoozePreset[];
|
||||
}
|
||||
|
||||
/** The web sidebar's thread menu (right-click), from the same builder, less what tui3 can't do. */
|
||||
export function threadMenu(input: { readonly thread: OrchestrationV2ThreadShell; readonly config: ServerConfig | null; readonly timestampFormat: Tui3Config["timestampFormat"]; readonly now?: Date }): ThreadMenu {
|
||||
/** The web sidebar's thread menu (right-click), from the same builder, less what t3tui can't do. */
|
||||
export function threadMenu(input: { readonly thread: OrchestrationV2ThreadShell; readonly config: ServerConfig | null; readonly timestampFormat: T3tuiConfig["timestampFormat"]; readonly now?: Date }): ThreadMenu {
|
||||
const { config } = input;
|
||||
// The presented shell carries what the menu reads: pending requests, the runtime.
|
||||
const thread = presentThreadShell(config?.environment.environmentId ?? LOCAL, input.thread);
|
||||
@@ -44,18 +44,18 @@ export function threadMenu(input: { readonly thread: OrchestrationV2ThreadShell;
|
||||
return { items: items.filter((item) => !UNSUPPORTED.has(item.id)), snoozePresets };
|
||||
}
|
||||
|
||||
function snoozeMenu(config: ServerConfig | null, timestampFormat: Tui3Config["timestampFormat"], now: Date): readonly SnoozePreset[] {
|
||||
function snoozeMenu(config: ServerConfig | null, timestampFormat: T3tuiConfig["timestampFormat"], now: Date): readonly SnoozePreset[] {
|
||||
const presets = config?.settings.snoozePresets;
|
||||
return resolveSnoozePresets(now, { ...(presets ? { presets } : {}), formatTime: (date) => formatTime(date, timestampFormat) });
|
||||
}
|
||||
|
||||
/** A shown snooze choice, re-resolved now as the web does; undefined once its time has passed. */
|
||||
export function pickSnooze(shown: readonly SnoozePreset[], id: string, config: ServerConfig | null, timestampFormat: Tui3Config["timestampFormat"]): SnoozePreset | undefined {
|
||||
export function pickSnooze(shown: readonly SnoozePreset[], id: string, config: ServerConfig | null, timestampFormat: T3tuiConfig["timestampFormat"]): SnoozePreset | undefined {
|
||||
const presets = config?.settings.snoozePresets;
|
||||
return pickSnoozePreset({ shown, id, now: new Date(), ...(presets ? { presets } : {}), formatTime: (date) => formatTime(date, timestampFormat) });
|
||||
}
|
||||
|
||||
function formatTime(date: Date, format: Tui3Config["timestampFormat"]): string {
|
||||
function formatTime(date: Date, format: T3tuiConfig["timestampFormat"]): string {
|
||||
return date.toLocaleTimeString(undefined, { hour: "numeric", minute: "2-digit", ...(format === "locale" ? {} : { hour12: format === "12-hour" }) });
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { derivePendingThreadRequests, type PendingThreadRequests } from "@t3tools/client-runtime/state/thread-requests";
|
||||
import { deriveThreadCheckpointSummaries } from "@t3tools/client-runtime/state/thread-checkpoints";
|
||||
|
||||
// The web app's own timeline derivation: tui3 shows the same rows, folds and labels.
|
||||
// The web app's own timeline derivation: t3tui shows the same rows, folds and labels.
|
||||
import {
|
||||
computeStableMessagesTimelineRows,
|
||||
deriveMessagesTimelineRowsWithState,
|
||||
|
||||
Reference in new issue
Block a user