Skip to content
Open
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
3 changes: 3 additions & 0 deletions apps/presentation/calli-workbench/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
*.tsbuildinfo
4 changes: 4 additions & 0 deletions apps/presentation/calli-workbench/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Calli Workbench
Portions derived from Calli (https://github.com/maxliux5/calli).
Copyright Calli contributors. Relicensed under the Apache License, Version 2.0
with contributor consent.
86 changes: 86 additions & 0 deletions apps/presentation/calli-workbench/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Calli Workbench

The Calli web UI (React 18 / Vite 5), ported from the Calli repository
(`packages/web`) into LoopX as a separate presentation
surface, then stripped to the part M1 needs: the thread sidebar, the thread view,
the launch bar and the desk. It is milestone M1 of the Calli workbench and
session fabric RFC. No change to `loopx/`.

## Data layer

`App.tsx` builds a `LoopxApi` (`src/loopx/LoopxApi.ts`), a read-only subclass of
`Api`. Reads come from the LoopX adapter (`src/loopx/`): zod contracts for
`/status.json` and `/api/chat`, mappers to the app's own types, a schema-version
gate, and an SSE-to-polling stream. `Api.send()` is closed, so every write
rejects with `ReadOnlyError`; `Api.readOnly` is what the UI reads to disable
composing and write buttons. The base `Api` has no transport of its own, and
`fetch` appears only under `src/loopx/`.

`vite.config.ts` has no `server.proxy` or `preview.proxy`. All forwarding to the
local LoopX services (status 8766, chat 8767) happens in `readonly-forward.ts`,
one middleware used by both `vite` (5174) and `vite preview` (4174). It
enumerates the routes the workbench reads, all GET/HEAD: `/status.json`,
`/ssh-hosts`, `/api/chat/capabilities`, `/api/chat/endpoints`,
`/api/chat/goals/contexts`, `/api/chat/sessions` and `/api/chat/sessions/<id>`
(one plain segment). A request that matches no route is answered locally with
404 and never leaves the page server; an enumerated route with another method
gets 405. Targets can be overridden with `LOOPX_STATUS_BASE` / `LOOPX_CHAT_BASE`.
`test/readonly-forward.test.ts` runs it against loopback fake upstreams and
asserts they receive zero requests for every refused one.

`?fixture=1` answers from `src/loopx/fixtures/status.demo.json` (a public-safe
copy of the status example plus synthetic sessions) and makes no network
request. An unsupported or malformed contract shows "update the local LoopX
service" with a retry button instead of a blank page.

`src/demo/` (`DemoApi`) is no longer used by the app; only `test/demo.test.ts`
reaches it.

## Checks

```sh
npm run smoke:projection # fixture (zero fetch) and, if 8766 is up, live counts
npm run check:no-second-state # src/ keeps only display-preference storage, no fetch outside src/loopx/
```

## Layout

- `src/`, `public/`, `test/`: Calli web, with the removals listed below.
- `src/daemon-shared/`: `icons.ts` and `todo-priority.ts`, copied from the Calli
daemon (the web app imported them across packages).
- `src/attention.ts`: the `Attention` and `ProgressReport` types that the web app
took from Calli's extension API package.
- `src/thread-feed.ts`: the thread list feed, moved out of Calli's extensions.

## Build

```sh
npm install
npm run build # tsc --noEmit && vite build -> dist/
npm test # unit tests (tsx --test)
npm run dev # 127.0.0.1:5174
```

## Removed from upstream

Voice, writing mode, the pet, quota and cost boards, skills and MCP pages,
agent management and login, daemon settings, Calli's own todos/schedules/teams,
handover and the merged handover history, terminal/desktop/files/preview panels,
observability and activity pages, the extension system and its packages,
import/archive panels, side chat, selection notes, and the local caches and
persisted drafts. Their tests went with them. `styles.css` is untouched, so it
still carries the rules for those features.

## Other deviations from upstream

- Dev port 5174 / preview 4174 (upstream 5173), and the read-only LoopX
forwarder above instead of the Calli daemon proxy.
- `App.tsx` and `main.tsx` no longer take a token or connect dialog; the
workspace is `LoopxApi`.
- The Composer accepts pictures only; mentions, videos and files, notes and
takeover are gone.
- The merged handover history is replaced by a plain `ThreadView`.

## Provenance & license

Derived from Calli (`packages/web`) and relicensed under Apache-2.0 with the consent of its contributors; see `NOTICE`.
33 changes: 33 additions & 0 deletions apps/presentation/calli-workbench/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<!-- No interactive-widget=resizes-content: on iOS 26 Safari the layout viewport then resizes
for the keyboard while visualViewport.height subtracts the keyboard again, so the app sized
to --vvh shrinks twice and the page background shows below the composer. -->
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
<meta name="color-scheme" content="light dark" />
<meta name="theme-color" content="#ffffff" />
<title>Calli</title>
<link rel="manifest" href="/manifest.webmanifest" />
<meta name="application-name" content="Calli" />
<meta name="apple-mobile-web-app-title" content="Calli" />
<link rel="icon" href="/favicon-32.png?v=crab-1" type="image/png" sizes="32x32" />
<link rel="icon" href="/favicon.svg?v=crab-1" type="image/svg+xml" sizes="any" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png?v=crab-1" />
<!-- The look chosen on this device, put on the page before the first paint so it never opens
in the wrong colours. src/hooks.ts (useAppearance) takes over from here and checks the values. -->
<script>
try {
var saved = JSON.parse(localStorage.getItem('calli.appearance') || '{}');
var dark = saved.mode === 'dark' || (saved.mode !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches);
document.documentElement.setAttribute('data-theme', dark ? 'dark' : 'light');
if (typeof saved.palette === 'string') document.documentElement.setAttribute('data-palette', saved.palette);
} catch (e) {}
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading