Commit graph

2009 commits

Author SHA1 Message Date
Ramnique Singh
a3d2ddf34c docs(x): design docs and prompt catalogs follow the runtime/ move
Path pass over turn-runtime-design.md, session-design.md,
VIDEO_MODE.md, and LIVE_NOTE.md: every source pointer updated to the
runtime/ layout, the turn doc's suggested-module-layout section (§28)
refreshed to the real tree (it predated the event hub, bridges, and
composer), and the session doc's §14 layout fixed including its old
§11/§14 contradiction about where the headless runner lives.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:30:26 +05:30
Ramnique Singh
5f4788cf56 refactor(x): dissolve the tools support grab-bag into its owners
domains/support.ts bundled five unrelated concerns. Each moves to its
owner: the catalog schema → tools/types.ts (every domain's typing);
lenient ~-expansion → tools/paths.ts (documented as distinct from
filesystem's throwing variant); the bg-task input schemas and
resolveCodeProject → domains/background-tasks.ts; the code-run
coalescer → domains/code.ts (catalog re-export retargeted); parser
plumbing → domains/parsing.ts, now module-private.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:30:26 +05:30
Ramnique Singh
e808d6d4f0 refactor(x): the runtime moves under one roof — core/src/runtime/
Everything "model runtime" now lives under core/src/runtime/, whose
five children are the architecture: turns/ (the engine + bridges),
sessions/, assembly/ (what an agent is: registry, composer, workspace
context, message encoding, permission metadata, headless runners,
spawn-agent, copilot/ definition, capabilities/, skills/ — no longer
buried at application/assistant), tools/ (catalog + domains + exec
plumbing + descriptors, which leave turns/bridges and fix the upward
lib→bridges edge), and legacy/ (the quarantined runs engine, with
agents/runtime.ts finally honestly named engine.ts).

Pure moves via git mv (history follows) with mechanical import
rewrites; no durable schema, wire format, or behavior changes — the
golden prompt snapshots and the catalog key-order pin pass unchanged.
di/ stays top-level (whole-app composition root); application/ shrinks
to browser-control/browser-skills/notification and true cross-cutting
lib utils.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 16:30:26 +05:30
gagan
25a465880d
Merge pull request #723 from rowboatlabs/feature/apps-copilot-bridge
Apps: generic copilot bridge — answer from app data, surface the app
2026-07-10 15:39:47 +05:30
gagan
5ffe6c26a2
Merge pull request #725 from rowboatlabs/feat/chat-history-polish
Chat history redesign, session-store search fix, chat header cleanup
2026-07-10 15:32:09 +05:30
Gagan
269734a3d5 feat(x): chat history redesign, session-store search, header cleanup
- Chat history: shared tab design (heading, bg, centered column, card
  table), hover kebab + context menu with rename/delete/open-in-new-tab
- Search: chat search now targets the session store (titles from the
  sessions index, content grepped from turn logs) — results open again
  and new chats are searchable; segmented scope control, scope-aware
  placeholder and empty states, Tab flips scope, keyboard-hint footer
- Sidebar pins: stale ids of deleted chats no longer eat pin slots
- Chat header: session token-usage as a ghost bar-chart button with
  tooltip that opens stats directly; options menu (download log) moved
  into the shared ChatHeader so full-screen chats get it too; caffeinate
  indicator renders nothing while off (was a 32px hole)
- Turn usage dots: borderless, aligned with message text edge
- Workspace: breadcrumb baseline alignment
2026-07-10 15:16:28 +05:30
Gagan
5df26e6fca feat(apps): run an app's own agents when its data/config.json changes
Apps store user settings in data/config.json (e.g. pr-dashboard's
tracked repo) and rely on their bundled agents to turn config into
data. Without this, changing a setting meant staring at an empty app
until the next cron tick. The apps-server watcher now debounces
config.json writes and fires a one-shot manual run of the app's owned
tasks (app--<slug>--*). Generic for any app; dynamic import keeps the
server decoupled from the bg-task runner at load time.
2026-07-10 15:15:24 +05:30
Gagan
7d38dc84a2 feat(apps): copilot answers from installed apps and surfaces them
Generic app-copilot bridge (no app-specific wiring anywhere):

- app-read-data builtin: read (or list) an installed app's data/ files —
  the agent-maintained JSON the app renders. Same path confinement as
  app-set-data; 50k char cap with truncation flag; parsed JSON returned
  when possible. Attached via the app-navigation skill.
- read-view view=apps: installed apps with name/description/dataFiles/
  agentSlugs, navigating the user's screen to the Apps view (same
  show-while-telling contract as email/bg-tasks). Renderer routes the
  new view value.
- copilot instructions embed the installed-apps list (name +
  description per app) with routing guidance: prefer an app's fresh
  data over external calls, answer from it, open-app to surface it.
  The apps:list handler fingerprints the app set and invalidates the
  instructions cache when it changes (installs, deletes, copilot-
  created folders all flow through that poll).
- app-navigation skill: apps section + a worked example framing the
  pattern generically (match apps by their own descriptions, never a
  hardcoded topic map).

Verified against real data: app-read-data returns pr-dashboard's live
10-PR data.json, escape paths rejected, key-order golden test updated
and passing.
2026-07-10 14:23:03 +05:30
Ramnique Singh
214cae7190
Merge pull request #721 from rowboatlabs/subagent-effort
Add reasoning effort for spawned agents
2026-07-10 12:01:54 +05:30
Ramnique Singh
36ce35a058 Add reasoning effort for spawned agents 2026-07-10 11:59:11 +05:30
Ramnique Singh
7765bec96e
Merge pull request #719 from rowboatlabs/runtime-refactor
refactor(x): decouple the new runtime from the legacy engine (reorg phase A)
2026-07-10 11:43:35 +05:30
Ramnique Singh
fdce639839 refactor(x): decouple the new runtime from the legacy engine file
Findings from a fresh post-refactor review. The turn-runtime bridges
imported convertFromMessages and getToolPermissionMetadata from
agents/runtime.ts — the legacy engine file — making it undeletable;
both move to neutral modules (agents/message-encoding.ts,
agents/permission-metadata.ts) that both engines now share. The
abort registry, used by the live tool registry, moves out of the
legacy runs/ cluster into turns/. Dead surface goes: the zero-consumer
CopilotInstructions, skillCatalog, RunLogger, and MappedToolCall
exports are deleted, mapAgentTool/StreamStepMessageBuilder become
module-private, and the mid-file import scar from the composer
extraction is hoisted.

Three review fixes ride along: ITurnEventBus gains
subscribe/subscribeAll so consumers stop resolving the concrete hub;
skill carry-forward becomes its own registry trait instead of
overloading workspaceContext; and connection checks (slack/composio/
code-mode/google) collapse into one shared connections.ts consumed by
both skill availability and the copilot prompt blocks — plus stale
doc pointers (VIDEO_MODE.md to moved prompt text, CLAUDE.md's dangling
AGENTS.md reference).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 11:39:39 +05:30
Ramnique Singh
6375704d66
Merge pull request #717 from rowboatlabs/reasoning-effort
Per-turn reasoning effort control
2026-07-10 11:38:25 +05:30
Ramnique Singh
7ab7143372 fix(x): round-trip signed reasoning via message-level providerOptions
Thorough-effort Anthropic runs through the gateway failed on the tool
loop: Bedrock rejected the echoed thinking block ("Invalid `signature`
in `thinking` block"). OpenRouter streams reasoning_details as
per-delta FRAGMENTS on reasoning events — the part-level capture kept
only the last fragment (unsigned) — while the fully accumulated,
signed array rides the finish event's providerMetadata, and OpenRouter
gives message-level reasoning_details precedence on read-back.

The bridge now attaches finish-step providerMetadata to the assistant
message as message-level providerOptions (restoring parity with the
legacy StreamStepMessageBuilder, which always did this);
convertFromMessages already echoes it. The authoritative signed array
wins over the per-part fragments, which providers then ignore.

Also persist provider failure detail on turn_failed: errorMessage()
appends the API error's status code and responseBody (bounded to 2KB)
— "Failed after 3 attempts" alone was undebuggable from the turn log.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 11:34:16 +05:30
Ramnique Singh
3b447d07b9 refactor(x): models.dev — single startup writer, cache-only consumers
Previously catalog readers (listOnboardingModels, getChatModelIds)
fetched models.dev inline on a 24h TTL, while the reasoning-capability
paths read the cache only — so a signed-in install could run forever
with no cache and the effort chip never appeared, and catalog calls
could stall on a slow third-party fetch.

Now main calls startModelsDevRefresh() once at boot: refresh if the
cache is missing or older than 24h, then every 24h while running, with
a 10s fetch timeout, errors logged and swallowed (existing cache stays
in use). Every consumer reads the on-disk cache only. Catalog-shaped
readers (models:list, gateway annotation) await the warm-up's first
attempt so a fresh install's first list sees the fetched data; the
turn-start capability gate never waits. A missing cache is an empty
catalog, not an error — chat is unaffected either way.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 10:38:33 +05:30
Ramnique Singh
bea16c6513
Merge pull request #718 from rowboatlabs/readme2
Update readme
2026-07-10 10:36:15 +05:30
Ramnique Singh
885d4bc5cf fix(x): join gateway model ids to models.dev across id dialects
The reasoning-capability join failed for most gateway models, hiding
the effort chip for everything except the Gemini default. Two id
dialects broke it: OpenRouter-style ids spell versions with dots
("anthropic/claude-opus-4.8") where models.dev uses dashes
("claude-opus-4-8"), and the rowboat gateway serves OpenAI models with
no vendor prefix at all ("gpt-5.4").

The lookup is now a pure index (buildReasoningIndex/lookupReasoningFlag,
unit-tested) that normalizes ids case-insensitively with dots folded to
dashes, keyed both vendor-qualified and bare; bare ids that clash across
vendors with different flags are dropped rather than guessed. Verified
against the live gateway list: all 11 models now resolve.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 10:20:56 +05:30
Arjun
ffb1a84870 fix brain image 2026-07-10 10:16:50 +05:30
Ramnique Singh
15d4a497f0 feat(x): reasoning-effort control in the chat composer
Adds a Brain chip next to the model picker (Auto / Fast / Balanced /
Thorough) in both the full-screen and side-pane composer. Selection is
per-tab, next-turn intent like the model picker (same ref pattern), but
unlike model it is never frozen on a run — it applies turn by turn,
riding sendConfig.reasoningEffort into turn_created.config.

The chip renders only when the effective model (run-frozen, picked, or
app default) is known-reasoning per the models:list capability flag,
and a stale selection resets when switching to a non-reasoning model.

Turns that ran at a non-auto effort show the level beside the existing
token-usage affordance, read retroactively from the persisted turn
config; reasoning tokens were already displayed there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 10:11:25 +05:30
Ramnique Singh
1ffe29db9d feat(x): thread the models.dev reasoning flag to the renderer
Widens the models.dev schema to keep the per-model `reasoning` boolean
and carries it through normalizeModels → ProviderSummary → models:list,
so the composer can gate the reasoning-effort control on actual model
capability. Gateway model lists (bare "vendor/model" ids from the
server) are annotated from the models.dev cache in one batched,
cache-only read; unknown models keep the flag absent, which the UI
treats as "hide the control".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 10:11:25 +05:30
Ramnique Singh
125d39ee0b feat(x): per-turn reasoning effort — core plumbing
Adds a canonical reasoning-effort ladder (low|medium|high, absent =
auto/provider default) that travels: send config → turn_created.config →
every model call's persisted parameters (§8.3) → provider-specific
options at invoke time. Behavior-neutral: nothing sends an effort yet,
and auto produces byte-identical requests to today.

- shared: ReasoningEffort enum (single source, reused by models.json
  provider config), TurnCreated.config.reasoningEffort (additive
  optional on a non-strict object — old builds strip it, no
  schemaVersion bump), sessions:sendMessage IPC schema.
- turns: CreateTurnInput/SendMessageConfig/HeadlessAgentOptions carry
  the value; runModelStep stamps it on each call's parameters so every
  step durably records what it ran with.
- bridge: maps canonical effort to provider options, transport-only
  like prompt caching — OpenAI reasoningEffort, Anthropic thinking
  budgets (raising maxOutputTokens to the budget floor, never lowering
  an explicit value), Gemini thinkingLevel/thinkingBudget by
  generation, OpenRouter/rowboat reasoning.effort. Capability-gated
  via a cache-only models.dev lookup (never blocks a turn on the
  network); unknown support fails closed on strict flavors, while
  OpenRouter-shaped flavors map permissively since OpenRouter drops
  the field for non-reasoning models. Explicit persisted
  providerOptions win over the mapping. Ollama keeps its existing
  provider-level think rewrite; openai-compatible endpoints get
  nothing (no safe universal parameter).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 10:11:25 +05:30
Ramnique Singh
091f3e3acd fix(x): preserve block-level provider metadata in the turns bridge
The bridge dropped providerMetadata from content-block stream events,
so reasoning parts persisted as bare {type, text}. Anthropic thinking
signatures (which arrive on a reasoning-delta with an empty text delta),
Gemini thoughtSignatures (on text-end / reasoning-end / tool-call), and
OpenAI encrypted reasoning were all lost — breaking multi-step tool
turns whenever extended thinking is enabled, since providers require
signed blocks to be echoed back verbatim within the tool loop.

Now every -start event opens a new part (distinct blocks keep distinct
signatures) and metadata from each event of a block is merged opaquely
onto that part's providerOptions, which convertFromMessages already
echoes verbatim. The bridge never interprets the contents; each
provider reads back only its own keys. Empty blocks with no metadata
are dropped, matching the previous lazy-creation behavior. finish-step
metadata stays top-level as before.

Schemas already allowed providerOptions on all part types, so persisted
files remain readable in both directions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 10:11:25 +05:30
Arjun
380449565e fix brain image 2026-07-10 10:09:47 +05:30
Arjun
9b0b2f8888 add gif 2026-07-10 10:04:37 +05:30
Ramnique Singh
7a0e729703
Merge pull request #716 from rowboatlabs/runtime-refactor
refactor(x): split the builtin-tool monolith into domain modules
2026-07-10 10:01:58 +05:30
Arjun
bbd12b9937 fix readme 2026-07-10 10:00:10 +05:30
Ramnique Singh
38e63b9609 refactor(x): split the builtin-tool monolith into domain modules
The 2,091-line BuiltinTools object literal becomes 15 domain modules
(files, parsing, mcp, shell, code, browser, app, web, memory, composio,
models, live-note, background-tasks, notifications, agent-analysis)
plus a shared support module; the root builtin-tools.ts keeps the same
public path and exports and shrinks to loadSkill + spawn-agent (catalog
infrastructure) and the ordered merge.

Catalog key order is provider-payload bytes (tool declarations sit in
the cached prompt prefix), and the historical order interleaves domains
— so the spread order preserves it verbatim, with code/app/web each
contributing two fragments at their original positions. Entries were
moved by script, not retyped. Two proofs pin the order: a
HISTORICAL_KEY_ORDER test on the merged catalog, and a pre/post runtime
key dump compared during the split (byte-identical). Adding a tool now
means editing its domain module; adding a domain means one fragment in
the ordered merge list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 09:47:53 +05:30
Ramnique Singh
78c1309b6f
Merge pull request #715 from rowboatlabs/runtime-refactor
refactor(x): capability rules move from convention to compiler
2026-07-10 08:55:28 +05:30
Ramnique Singh
ca077faa95 refactor(x): shared lazyResolve for the no-static-DI-edge pattern
Four modules hand-rolled the same lazy container-import-and-resolve
dance (agent registry, spawn-agent, background-task runner, notifier),
each restating the rationale. di/lazy-resolve.ts holds the pattern and
the reasoning once; all four sites migrate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 08:50:39 +05:30
Ramnique Singh
8dd5a2b49f refactor(x): skills declare their own availability; excludeIds dies
Catalog membership for connection-gated skills (composio-integration,
code-with-agents, slack) was decided by hand-rolled excludeIds forks
inside buildCopilotInstructions — a third place that had to know which
skill depends on which connection. Now each entry declares an
availability() check (repos resolved via the new lazyResolve helper, so
the skills module keeps no static DI edge; failures read as
unavailable, the historical default), buildAvailableSkillCatalog
evaluates them concurrently for the system prompt, and the excludeIds
mechanism is deleted. Availability gates catalog VISIBILITY only —
loadSkill still resolves explicitly-requested ids, exactly matching the
old behavior. Tests cover the pure filter and pin that gated ids remain
resolvable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 08:48:24 +05:30
Ramnique Singh
efeaae1e19 refactor(x): workspace-context loading gets one trait-gated chokepoint
The workspaceContext trait was consulted separately at every assembly
site before loading agent notes / work dir — a convention each caller
had to re-remember, where a forgotten check either leaks the user's
agent-memory into non-copilot prompts or silently omits it for the
copilot, and neither fails loudly. The loaders move out of the legacy
runtime file into agents/workspace-context.ts, and
loadWorkspaceContext() applies the trait gate INSIDE: both engines now
call it (the resolver keeps its loader test-seams by injecting them
through), so a future assembly site structurally cannot skip the gate.
Tests pin the gate: non-workspace agents get nulls even when the
loaders would yield values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 08:45:58 +05:30
Ramnique Singh
d0018daad3 refactor(x): one ModeFlags schema behind all three composition shapes
The app-toggled mode flags were hand-mirrored in three places (the
resolver's CompositionOverrides zod schema, CapabilityContext, and
ComposeSystemInstructionsInput) and copied field-by-field with '?? false'
defaults — so a mode missed at one site compiled clean and silently
never composed. Now capabilities/types.ts declares one zod ModeFlags
schema with defaults: the wire shape (all-optional, what turn files
carry), the resolver's concrete parse output, and the composition
context all derive from it; CompositionOverrides just extends it with
the resolver-only keys, the composer takes {instructions, notes,
workDir} & ModeFlags with a rest-spread (no copy list), and the legacy
call site passes explicit false for the modes it never composes.
Adding a mode = one schema key + one record; anything less is a
compile/parse error. New resolver test pins historical-composition
compatibility (sparse, null-heavy, unknown-key, and garbage
compositions all compose exactly as before). Golden snapshots
unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 08:43:24 +05:30
Ramnique Singh
8cf1335577 refactor(x): make capability activation a discriminated union; fence the loadSkill path
The design rule "app/always capabilities are never model-loadable" was
held only by two arrays happening to be separate. Now it is structural:
CapabilityDefinition is a union — ModelCapability (requires catalog
title/summary and lazy content, cannot carry a fragment) vs
EagerCapability (requires promptFragment, never enters the catalog) —
and DiskSkill is typed as ModelCapability, making the disk trust
boundary a compile-time fact instead of a comment. The kitchen is
fenced along with the menu: catalog building and skill-tool attachment
go through pure, fenced helpers (buildCatalogFromEntries /
toolNamesFromEntries), and the boundary test now feeds a real eager
capability through a mixed list and asserts both the catalog hides it
and the tool path refuses its tools. Golden snapshots unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 08:38:51 +05:30
gagan
b9fea2b037
Merge pull request #712 from rowboatlabs/fix/side-pane-copy-button
Fix: copy button missing on side-pane chat messages
2026-07-10 01:24:31 +05:30
Gagan
a090385f34 fix(x): show message copy button in side-pane chat
The side-pane copilot renders messages through its own markup in
chat-sidebar.tsx, which never got the hover copy button added to the
full-screen chat renderer. Maximizing the pane stays on the same code
path, so it was missing there too.
2026-07-10 01:21:44 +05:30
gagan
45d9002a3a
Merge pull request #711 from rowboatlabs/fix/heading-ui-cleanup
UI polish: unified headers, settings redesign, chat management
2026-07-10 01:13:56 +05:30
Gagan
bf24fb85bb feat(x): rename, pin, and delete chats from the sidebar
- Hover kebab menu on sidebar chat rows with Pin / Rename / Delete
- Rename: inline edit persisted via the existing sessions:setTitle;
  custom titles survive since auto-titling only fills empty titles
- Pin: up to 3 chats float to the top of the list (localStorage)
- Delete: confirm dialog, sessions:delete, closes any open tab
2026-07-10 01:10:22 +05:30
Gagan
890a7864f4 style(x): settings redesign — grouped nav, brand logos, blurred overlay
- Dialog shell: sectioned sidebar nav (Configure / App), larger header
  without divider, more padding
- Connections & Mobile: real brand logos (Google, Fireflies, Slack,
  WhatsApp, Telegram), no icon tiles, no separator lines
- Models: provider logos on the your-own-providers cards
- Code Mode: Anthropic/OpenAI marks for Claude Code and Codex
- Help: GitHub and Discord logos, tile-free rows
- Dialog overlay: frosted backdrop blur
2026-07-10 00:38:30 +05:30
Gagan
565a5032ec style(x): side-pane chat sizing, bg-tasks stop chip, Brain contrast
- Chat empty state: smaller type scale in the side-pane copilot,
  compact prop on connections card
- Background tasks: stop button sized to match the Updating pill,
  wraps under it in narrow panes, aligned with the state toggle
- Sidebar: Code above Meetings
- Brain: page + graph background matches other tabs, darker light-mode
  borders for Base rows and Files containers, bolder section labels
2026-07-10 00:11:40 +05:30
Gagan
834b8b0390 style(x): sidebar alignment and quick-action hierarchy
- Top-align icons with titles on two-line nav rows; consistent ink
  color for Apps/Background agents/Workspaces (sublabels stay muted)
- Quick actions: labeled New chat button, secondary actions as
  compact ghost icons
2026-07-09 23:52:38 +05:30
Ramnique Singh
d2263759ef
Merge pull request #709 from rowboatlabs/runtime-refactor
Some checks failed
rowboat / apps/x Vitest suites (push) Has been cancelled
rowboat / apps/x Electron package smoke test (push) Has been cancelled
refactor(x): agent assembly — registry, extracted composer, capability records
2026-07-09 23:18:05 +05:30
Ramnique Singh
a9a342653f fix(x): review fixes — prototype-safe registry lookup, shared parsing, slimmer records
Findings from an independent review of the branch:

- loadAgent's plain-object lookup traversed Object.prototype, so a
  user-defined agent named "constructor"/"toString" threw a TypeError
  instead of falling through to the agents repo as it did before the
  registry (Object.hasOwn now guards both lookups; regression test
  pins the fallthrough without depending on the environment).
- agentFromRaw now uses the same parseFrontmatter helper FSAgentsRepo
  uses, so builtin and user agents can never drift on one file format.
- The fused workspace-context capability splits into agent-notes and
  work-directory records — the composer's own separator joining makes
  the output byte-identical, so the fusion bought nothing.
- Mode records drop their write-only title/summary (optional on the
  base record, still required on skills where the catalog renders
  them), the composer body is reindented and iterates a hoisted
  PROMPT_CAPABILITIES list, and the two single-consumer re-export
  shims in the legacy runtime file are deleted (consumers retargeted).

Golden snapshots unchanged throughout: composed prompts remain
byte-identical. Deferred to the follow-up PR with availability wiring:
discriminated-union typing on activation + fencing resolveSkill, and
unifying the three mirrored composition shapes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 23:10:58 +05:30
Ramnique Singh
506eaa97a2
Merge pull request #710 from rowboatlabs/show-usage
Show token usage in chats
2026-07-09 22:56:27 +05:30
Ramnique Singh
9df3630423 Show token usage in chats 2026-07-09 22:47:25 +05:30
Ramnique Singh
f2a874a214 refactor(x): workspace context becomes an always-activated capability
The agent-notes and work-directory prompt blocks move out of the
composer into WORKSPACE_CONTEXT_CAPABILITY (activation: 'always'),
whose fragment is pure over the resolved inputs — the resolver still
loads notes/work-dir only for agents with the workspaceContext trait
and passes null otherwise, so trait gating is unchanged. The composer
now iterates one capability list (workspace + modes) in fixed order;
golden snapshots pass unchanged, byte-identical output. The composer's
own body is down to: base instructions + hidden-user-context + the
capability loop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:40:27 +05:30
Ramnique Singh
e194e32a23 refactor(x): modes become app-activated capabilities
The six mode blocks (voice input, video, coach, voice output
summary/full, search, code mode) move out of the composer's if-chain
into capability records (capabilities/modes.ts), each owning its
fragment text as a pure function of the composition context — the
code-mode fragment keeps its chip/cwd parameterization. The composer
now iterates MODE_CAPABILITIES in declared order, which is the fixed
total order that keeps composed prompts byte-stable; the 13 golden
snapshot tests pass unchanged, proving byte-identical output. Fragment
text was extracted from the if-chain programmatically (not retyped) so
the bytes could not drift. Adding a mode is now one record in one
file instead of a flag threaded through the resolver plus a concat
site in the composer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:38:06 +05:30
Ramnique Singh
484a9f0495 refactor(x): capability record — skills become the model-activated subset
capabilities/types.ts introduces the assembly unit: id/title/summary +
lazy guidance + owned tools (what skills already were), plus an
activation axis ('model' | 'app' | 'always') and an eager
promptFragment(ctx) for app/always entries — pure over a persisted
composition context so composed prompts stay byte-identical.
SkillDefinition is now CapabilityDefinition & {content}: bundled skills
are unchanged model-activated entries, the loadSkill catalog filters to
that subset, and disk skills remain structurally limited to it (eager
fragments and app activation are bundled-only powers — a disk file must
never gain a standing system-prompt injection channel).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:35:41 +05:30
Ramnique Singh
bd34531305 refactor(x): extract the system-prompt composer from the legacy runtime file
composeSystemInstructions (+ the hidden-user-context block) moves
verbatim to agents/compose-instructions.ts, owned by the assembly
layer; the legacy engine and old import paths keep working via
re-export. New golden-bytes snapshot tests pin the composed output for
a 12-case composition matrix plus the block ordering — the safety net
for folding the mode blocks into capability records: prefix caching
and snapshot inheritance require byte-identical prompts, so any
restructuring must keep these snapshots green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:32:47 +05:30
Ramnique Singh
b3330c09c4 refactor(x): agent registry — one table instead of the loadAgent ladder
Built-in agent identity moves to agents/registry.ts: a table of
definitions with builders, an alias (rowboatx → copilot) expressed as
shared entries, and declared traits. One prompt-file loader replaces
the five copy-pasted frontmatter-parsing blocks, and the stringly
"copilot" || "rowboatx" comparisons in the resolver and the legacy
runtime become hasWorkspaceContext(agentId) trait lookups. loadAgent
keeps its signature and its legacy import path via re-export; the
user-agents repo fallback resolves the container lazily so the
registry adds no static edge into the DI graph.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 22:31:02 +05:30
Gagan
5dd8c85ce4 style(x): chat empty state, message bubbles, sidebar hover gap
- Chat empty state: icon-free heading, single suggestion list with
  leading icons and hover arrows, aligned to the composer column
- User message bubbles: rounded-2xl with flattened top-right corner,
  hover-only copy button under the bubble's bottom-right
- Sidebar: hairline gap between menu items so adjacent active/hover
  highlights don't merge
2026-07-09 18:42:47 +05:30