kaizen-agent 1.81.0 → 1.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/task-service.ts +16 -2
- package/cli/tasks.ts +2 -1
- package/cli/web.ts +2 -1
- package/package.json +1 -1
- package/skills/media/kaizen-video/SKILL.md +2 -0
- package/skills/optional/lemo-opuscar/LICENSE +21 -0
- package/skills/optional/lemo-opuscar/SKILL.md +24 -0
- package/skills/optional/lemo-opuscar/scripts/setup.sh +145 -0
- package/skills/optional/lemo-opuscar/skill.json +1 -0
- package/web/board/settings-skills.ts +6 -1
- package/web/board/task-page.ts +12 -1
- package/web/board/update.ts +4 -2
- package/web/board/workspace.ts +26 -17
- package/web/board.html +2 -2
- package/web/board.js +129 -127
- package/web/notebook.js +119 -117
- package/web/notes.html +2 -2
- package/web/term.js +1 -1
- package/web/video.html +2 -2
- package/web/video.js +162 -160
package/cli/task-service.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { join, dirname } from 'node:path';
|
|
|
6
6
|
import * as T from './tasks.ts';
|
|
7
7
|
import * as R from './task-results.ts';
|
|
8
8
|
import { read as scalar } from './config-values.ts';
|
|
9
|
-
import { detectDefaultAgent, home, readInbox, readRuns, readText, saveAttachment, acceptance, gateOf } from './state.ts';
|
|
9
|
+
import { detectDefaultAgent, home, readInbox, writeInbox, replaceTask, abandonRun, setArchived, readRuns, readText, saveAttachment, acceptance, gateOf } from './state.ts';
|
|
10
10
|
|
|
11
11
|
type Hooks = { launch: (state:string, run:string, text:string, task:T.Task, pick?:any) => {ok:boolean; pty?:string; why?:string}; alive:(pty:string)=>boolean; stop:(pty:string)=>boolean };
|
|
12
12
|
const runtimeLaunches = new Set<string>();
|
|
@@ -24,7 +24,7 @@ export function taskView(state:string,task:T.Task) {
|
|
|
24
24
|
return {...task,activeRun:finished&&['ready','accepted'].includes(task.status)?null:task.activeRun,projectName:task.project?.split(/[\\/]/).pop()??'Choose a project',dir:state,updatedAt:task.updated,attention:{category:p.filter,reason:p.reason,action:p.action},statusLabel:p.label,decision:!task.project?{id:'project',kind:'project',text:'Choose a named project for your saved goal.'}:task.pendingDecision,messages:task.events,runs:task.runIds,currentResultId:task.currentResult,acceptedResultId:task.acceptedResult};
|
|
25
25
|
}
|
|
26
26
|
export function taskList(states:string[],hooks?:Hooks) {
|
|
27
|
-
const tasks=states.flatMap(state=>T.listTasks(state).map(t=>taskView(state,reconcile(state,t,hooks))));
|
|
27
|
+
const tasks=states.flatMap(state=>T.listTasks(state).filter(t=>!t.archived).map(t=>taskView(state,reconcile(state,t,hooks))));
|
|
28
28
|
// Legacy rows become durable only when opened. Stable keys include stamps/index,
|
|
29
29
|
// never a title-based merge; existing inbox and run files are left intact.
|
|
30
30
|
for(const state of states) {
|
|
@@ -118,6 +118,20 @@ export function taskAction(state:string,body:any,hooks:Hooks):{state:string;task
|
|
|
118
118
|
const mutation={revision:Number(body.revision),opId:operationId};
|
|
119
119
|
if(task.operations.includes(operationId))return {state,task};
|
|
120
120
|
if(op==='start'){task=T.mutateTask(state,task.id,mutation,t=>{if(t.status!=='draft')throw new T.TaskError('Task already started');});return {state,task:dispatchReady(state,task.id,hooks,true,body.pick&&typeof body.pick==='object'?body.pick:undefined)};}
|
|
121
|
+
if(op==='delete'||op==='archive'||op==='abandon'){
|
|
122
|
+
// Closing a task: Delete only before any run exists; Archive hides it; Abandon ends its run.
|
|
123
|
+
if(op==='delete'){
|
|
124
|
+
if(task.runIds.length||task.activeRun)throw new T.TaskError('A run already started. Archive or abandon it instead.');
|
|
125
|
+
replaceTask(state,task.goal,null);T.deleteTask(state,task.id);return {state,task};
|
|
126
|
+
}
|
|
127
|
+
if(op==='abandon'){
|
|
128
|
+
if(!task.activeRun)throw new T.TaskError('No run to abandon');
|
|
129
|
+
const key=task.launch?.pty;if(key&&hooks.alive(key))hooks.stop(key);
|
|
130
|
+
const bad=abandonRun(state,task.activeRun,String(body.why??'').trim()||'abandoned from the task page');if(bad)throw new T.TaskError(bad);
|
|
131
|
+
}else if(task.activeRun)setArchived(state,task.activeRun,true);
|
|
132
|
+
else{const lines=readInbox(state),at=lines.findIndex(l=>l.status==='open'&&l.text===task.goal);if(at>=0){lines[at]={...lines[at]!,status:'archived'};writeInbox(state,lines);}}
|
|
133
|
+
return {state,task:T.mutateTask(state,task.id,mutation,t=>{t.archived=true;})};
|
|
134
|
+
}
|
|
121
135
|
task=T.mutateTask(state,task.id,mutation,t=>{
|
|
122
136
|
if(op==='message'){
|
|
123
137
|
const text=String(body.text??'').trim();const status=body.intent==='question'||/^\s*(status\??|what(?:'s| is) (?:the )?(?:status|progress)\??|how (?:is|are) (?:it|things|the task) (?:going|doing)\??)\s*$/i.test(text);
|
package/cli/tasks.ts
CHANGED
|
@@ -15,7 +15,7 @@ export type Task = {
|
|
|
15
15
|
runIds: string[]; activeRun: string | null; currentResult: string | null; acceptedResult: string | null;
|
|
16
16
|
pendingDecision: TaskDecision | null; inputs: TaskInput[]; events: TaskEvent[]; operations: string[];
|
|
17
17
|
files: { name: string; path: string }[]; launch: TaskLaunch | null; safe: boolean; queuePaused: boolean;
|
|
18
|
-
initialConfirmed: boolean; writePhase: boolean; error?: string; legacyKey?: string; alias?: { state: string; id: string };
|
|
18
|
+
initialConfirmed: boolean; writePhase: boolean; error?: string; legacyKey?: string; archived?: boolean; alias?: { state: string; id: string };
|
|
19
19
|
};
|
|
20
20
|
export type Mutation = { revision: number; opId: string };
|
|
21
21
|
export class TaskError extends Error { constructor(message: string, public status = 409) { super(message); } }
|
|
@@ -77,6 +77,7 @@ export function resolveTask(state: string, id: string): { state: string; task: T
|
|
|
77
77
|
export function listTasks(state: string): Task[] {
|
|
78
78
|
try { return readdirSync(join(state, "tasks")).filter(taskId).map((id) => readTask(state, id)).filter((t): t is Task => !!t && !t.alias).sort((a, b) => taskProjection(a).rank - taskProjection(b).rank || b.updated - a.updated); } catch { return []; }
|
|
79
79
|
}
|
|
80
|
+
export function deleteTask(state: string, id: string) { rmSync(taskDir(state, id), { recursive: true, force: true }); }
|
|
80
81
|
export type NewTask = { goal: string; title?: string; project?: string | null; files?: Task["files"] };
|
|
81
82
|
export function createTask(state: string, input: NewTask, opId?: string): Task {
|
|
82
83
|
if (!input.goal?.trim()) throw new TaskError("Describe what you want to make", 400);
|
package/cli/web.ts
CHANGED
|
@@ -1865,7 +1865,8 @@ export async function web(repoDir: string, opts: Opts = {}) {
|
|
|
1865
1865
|
// Update button there (DESKTOP_BUNDLED, above).
|
|
1866
1866
|
const update = !!v && newer(v, VERSION) && !DESKTOP_BUNDLED;
|
|
1867
1867
|
const notes = update ? await releaseNotes(VERSION, url.searchParams.has("fresh")) : [];
|
|
1868
|
-
|
|
1868
|
+
// behind: npm has a newer one but this board cannot update itself (the desktop app's copy), so a phone or browser can say so instead of "up to date".
|
|
1869
|
+
return json({ version: VERSION, latest: v, update, behind: DESKTOP_BUNDLED && !!v && newer(v, VERSION), notes, failed: upgradeFailed });
|
|
1869
1870
|
}
|
|
1870
1871
|
|
|
1871
1872
|
// `kaizen upgrade`, run here with no window, then a new board on this port: it
|
package/package.json
CHANGED
|
@@ -84,6 +84,8 @@ the whole video and spot-checking the cut edges.
|
|
|
84
84
|
|
|
85
85
|
# From scratch
|
|
86
86
|
|
|
87
|
+
**A named art style** (oil painting, watercolor, ukiyo-e, satellite briefing, exploded teardown and the rest of the Lemo-Opuscar library)? That is the optional `lemo-opuscar` skill, off until the user turns it on in Settings → Skills: when it is on, use it for that film (it downloads its own style library from GitHub on first use). When it is off, say so in one line and offer the film presets below.
|
|
88
|
+
|
|
87
89
|
A film is data in `videos/<name>/`: `film.json` (storyboard, brand, `format` `"9x16"`, `"16x9"` or `"4x5"` (Instagram feed), `preset` (a film preset, or any footage preset such as `tiktok-explainer`: see *Crossing over* in `references/presets.md`), `style` (overrides of the preset's style.json), `hook` (for a footage preset), and `platforms`, which the Video page in `kaizen web` keeps), `lines.json` (narration with emotion tags), `words.json` (word timings, generated), `inputs/` (the user's material), voice files `vNN.mp3`. `S=<this skill>/scripts`, run from the project folder. Worked example: [`examples/sample-film/`](examples/sample-film/). Run `$S/check.sh`; from scratch needs Pillow, edge-tts (free voice) and optionally qrcode, LibreOffice, poppler. No WhisperX.
|
|
88
90
|
|
|
89
91
|
**Camera moves (`film-explainer-canvas`):** for an explainer that pans, zooms and follows things across one canvas,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LemoLab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lemo-opuscar
|
|
3
|
+
description: Direct and produce a short film made entirely in code, in one of the styles of the Lemo-Opuscar library (e.g. Impasto Oil Painting 油画厚涂, Watercolor Brush 水彩笔刷, Ukiyo-e 浮世绘, Satellite Briefing 卫星简报, Exploded Teardown 产品拆解). Use when the user asks for a video, film, short, promo, explainer or animation (视频、短片、动画、宣传片) in a named style, including explainers built from real material such as satellite imagery, laser scans, CAD files or archive scans (数据解说、科普、产品拆解), and new films cut from real archive footage and documents (剪辑与纪实, e.g. 用档案影像剪一支新闻片); when they want a film about their own topic and haven't chosen a style (help them choose); when they want to change a style into their own, make their own style from a blank page, or use a style they saved (改风格、从空白开始、我的风格); when they start the skill without saying what they want; or when they ask which film styles there are. Not for plain editing, trimming or converting the user's existing video files.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Lemo-Opuscar
|
|
7
|
+
|
|
8
|
+
The styles, guides and tools live in the Lemo-Opuscar library (github.com/lemomo-ai/lemo-opuscar). This skill fetches it and hands you over to it.
|
|
9
|
+
|
|
10
|
+
1. **Get the library.** Run `sh "<skill base directory>/scripts/setup.sh"`. It clones or updates the library (default `~/lemo-opuscar`; a clone the user is standing in is used as it is) and prints `LIB=<path>` on its last line.
|
|
11
|
+
2. **Install the core tools early.** Start `sh "<skill base directory>/scripts/setup.sh" deps` right away, in the background if you can: it takes a few minutes the first time. Add `deps voice` or `deps music` later, only if the film needs them (`$LIB/TECHNIQUE.md` §1). Report missing system tools (Node, ffmpeg, Python) in your one round of questions; don't install system software yourself. Packages a style needs (its `STYLE.md` lists them) you install yourself, into the project folder.
|
|
12
|
+
3. **Follow the library.** Read `$LIB/AGENTS.md` and do what it says, starting with **Start** (the user's own styles in `~/lemo-my-styles/`; when they started the skill without writing anything, the language question first, then the ways in): finding the style or making their own, the one round of questions, the treatment, production and delivery.
|
|
13
|
+
|
|
14
|
+
What changes in skill mode:
|
|
15
|
+
|
|
16
|
+
| | |
|
|
17
|
+
|---|---|
|
|
18
|
+
| Project folder | `<name>/` in the folder the user started from (lowercase letters, digits, hyphens; avoid `#` and `?` in the path). Wherever the guides say `films/<name>/`, read this folder |
|
|
19
|
+
| Running tools | from `$LIB`, with the project's absolute path: `cd "$LIB" && node core/render/still.mjs "<project>" 1.5 3` |
|
|
20
|
+
| Library files in pages | absolute URLs: `/core/lib.js`, `/node_modules/three/…` (the project is served at `/@film/`) |
|
|
21
|
+
| Library files in scripts and `build.sh` | `$LIB/…`, with `LIB=<path>` at the top of `build.sh`; never `../..` |
|
|
22
|
+
| Demo source | not downloaded. `sh "<skill base directory>/scripts/setup.sh" demo <slug>`, only after your `TREATMENT.md` is written, to read its techniques; it is not meant to be rendered. An Edit & Documentary style is the exception: fetch it before the treatment to use the material tools its `STYLE.md` names in `demo/tools/` (`$LIB/AGENTS.md`, "Treatment first") |
|
|
23
|
+
|
|
24
|
+
Deliver what `$LIB/DIRECTOR.md` §11 lists, in the project folder, and tell the user where it is.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Lemo-Opuscar skill: find or install the style library, then print its path.
|
|
3
|
+
# sh setup.sh library ready? (clone on first run, update later) → which package tiers are installed, LIB=<path>
|
|
4
|
+
# sh setup.sh deps [voice] [music]
|
|
5
|
+
# install packages: core = Node packages, headless browser, Python core tier;
|
|
6
|
+
# voice = TTS and speech check (+ the English voice model); music = pluck.py (numba)
|
|
7
|
+
# sh setup.sh demo <slug> add one style's demo source and poster to the library (reference only)
|
|
8
|
+
# The library is a sparse clone of the main branch: guides, core/ tools and every STYLE.md. Big assets: tools/fetch.sh.
|
|
9
|
+
# LEMO_OPUSCAR_HOME = where the library lives (default: the clone you stand in, else ~/lemo-opuscar).
|
|
10
|
+
set -e
|
|
11
|
+
REPO=${LEMO_OPUSCAR_REPO:-https://github.com/lemomo-ai/lemo-opuscar.git}
|
|
12
|
+
|
|
13
|
+
# 1. Which library: $LEMO_OPUSCAR_HOME, else the clone we are standing in, else ~/lemo-opuscar
|
|
14
|
+
is_lib() { [ -f "$1/AGENTS.md" ] && [ -d "$1/core/render" ]; }
|
|
15
|
+
if [ -n "$LEMO_OPUSCAR_HOME" ]; then LIB=$LEMO_OPUSCAR_HOME
|
|
16
|
+
elif top=$(git rev-parse --show-toplevel 2>/dev/null) && is_lib "$top"; then LIB=$top
|
|
17
|
+
else LIB=$HOME/lemo-opuscar
|
|
18
|
+
fi
|
|
19
|
+
case "$LIB" in /*|[A-Za-z]:[/\\]*) ;; *) LIB=$(pwd)/$LIB ;; esac # C:/… is absolute too (Windows git prints paths that way)
|
|
20
|
+
|
|
21
|
+
# Our clone skips demo sources, the gallery and big images; what `setup.sh demo` added stays.
|
|
22
|
+
# git < 2.35 has no --no-cone: then the whole library is checked out.
|
|
23
|
+
# The patterns reach git as written: Git Bash on Windows would turn '/styleboard/' into 'C:/Program Files/Git/styleboard/'.
|
|
24
|
+
# It runs from inside $LIB, because a -C /c/… path needs that rewriting.
|
|
25
|
+
sparse() { (cd "$LIB" && MSYS_NO_PATHCONV=1 git sparse-checkout "$@"); }
|
|
26
|
+
apply_sparse() {
|
|
27
|
+
set -- '/*' '!/styles/*/demo/' '!/styleboard/' '!/docs/frames/' '!/docs/cover.jpg' '!/docs/opuscar98.jpg' '!/styles/*/poster.jpg' \
|
|
28
|
+
$(git -C "$LIB" sparse-checkout list 2>/dev/null | grep -E '^/styles/[^/*]+/(demo/|poster\.jpg)$' || true)
|
|
29
|
+
sparse set --no-cone "$@" 2>/dev/null || git -C "$LIB" sparse-checkout disable || true
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if [ "$(git -C "$LIB" config --get lemo.managed 2>/dev/null)" = true ]; then
|
|
33
|
+
# our own clone (nothing of the user's lives in it): match main, whatever happened upstream
|
|
34
|
+
[ "$(git -C "$LIB" remote get-url origin 2>/dev/null)" = "$REPO" ] || git -C "$LIB" remote set-url origin "$REPO"
|
|
35
|
+
if err=$(git -C "$LIB" fetch --quiet --depth 1 origin main 2>&1 && git -C "$LIB" reset --quiet --hard FETCH_HEAD 2>&1); then apply_sparse
|
|
36
|
+
else echo "! could not update $LIB (offline?); using the local copy. git: $err" | head -3; fi
|
|
37
|
+
elif ! is_lib "$LIB"; then
|
|
38
|
+
[ -e "$LIB" ] && [ -n "$(ls -A "$LIB" 2>/dev/null)" ] && { echo "✗ $LIB exists but is not the Lemo-Opuscar library. Set LEMO_OPUSCAR_HOME to another folder."; exit 1; }
|
|
39
|
+
command -v git >/dev/null || { echo "✗ git is needed to download the library"; exit 1; }
|
|
40
|
+
echo "↓ downloading the style library into $LIB"
|
|
41
|
+
git clone --quiet --depth 1 --filter=blob:none --sparse --branch main "$REPO" "$LIB" || { rm -rf "$LIB"; echo "✗ download failed (offline?)"; exit 1; }
|
|
42
|
+
apply_sparse
|
|
43
|
+
git -C "$LIB" config lemo.managed true
|
|
44
|
+
fi
|
|
45
|
+
LIB=$(cd "$LIB" && pwd -P)
|
|
46
|
+
|
|
47
|
+
# Installed packages are tracked by content: a marker holds a checksum of the files they came from (and the Python
|
|
48
|
+
# version), so a changed package.json or requirements file triggers a reinstall.
|
|
49
|
+
sig() { cat "$@" 2>/dev/null | cksum | cut -d' ' -f1; }
|
|
50
|
+
pysig() { echo "$(sig "$1")-$("$LIB/.venv/bin/python" -V 2>&1 | cut -d. -f1,2)"; }
|
|
51
|
+
req() { [ "$1" = core ] && echo "$LIB/requirements.txt" || echo "$LIB/requirements-$1.txt"; }
|
|
52
|
+
node_ok() { [ "$(cat "$LIB/node_modules/.lemo-ok" 2>/dev/null)" = "$(sig "$LIB/package.json" "$LIB/package-lock.json")" ]; }
|
|
53
|
+
py_ok() { [ "$(cat "$LIB/.venv/.lemo-$1" 2>/dev/null)" = "$(pysig "$(req "$1")")" ]; }
|
|
54
|
+
# a Python 3.11+ for the venv when uv is absent; kokoro-onnx (voice tier) needs < 3.14, so those come first
|
|
55
|
+
find_py() {
|
|
56
|
+
for c in python3.12 python3.13 python3.11 python3 python; do
|
|
57
|
+
"$c" -c 'import sys; sys.exit(sys.version_info < (3, 11))' 2>/dev/null && { echo "$c"; return 0; }
|
|
58
|
+
done
|
|
59
|
+
return 1
|
|
60
|
+
}
|
|
61
|
+
# Windows (Git Bash): a venv keeps its Python in Scripts/python.exe. Give it the .venv/bin/python every tool calls,
|
|
62
|
+
# a shim that also forces UTF-8 (a Chinese Windows defaults to GBK, which can't print ✓ or read our UTF-8 files).
|
|
63
|
+
win_shim() {
|
|
64
|
+
[ -f .venv/Scripts/python.exe ] && [ ! -e .venv/bin/python ] || return 0
|
|
65
|
+
mkdir -p .venv/bin
|
|
66
|
+
printf '#!/bin/sh\nPYTHONUTF8=1 PYTHONIOENCODING=utf-8 exec "$(dirname "$0")/../Scripts/python.exe" "$@"\n' > .venv/bin/python
|
|
67
|
+
chmod +x .venv/bin/python
|
|
68
|
+
}
|
|
69
|
+
# One deps run per library at a time (#23): two sessions sharing a library would otherwise half-install, or remove,
|
|
70
|
+
# each other's packages. A lock folder holds the run's pid; a lock whose run is gone is taken over.
|
|
71
|
+
lock_deps() {
|
|
72
|
+
lock=$LIB/.lemo-deps.lock; n=0
|
|
73
|
+
until mkdir "$lock" 2>/dev/null; do
|
|
74
|
+
p=$(cat "$lock/pid" 2>/dev/null || true)
|
|
75
|
+
if [ -n "$p" ] && ! kill -0 "$p" 2>/dev/null; then rm -rf "$lock"; continue; fi
|
|
76
|
+
[ $n -gt 0 ] || echo "… another '$1 deps' is installing into $LIB; waiting for it to finish"
|
|
77
|
+
n=$((n + 1)); [ $n -lt 1800 ] || { echo "✗ $lock is still there after 30 minutes: remove it if no install is running"; exit 1; }
|
|
78
|
+
sleep 1
|
|
79
|
+
done
|
|
80
|
+
echo $$ > "$lock/pid"
|
|
81
|
+
trap 'rm -rf "$lock"' EXIT; trap 'exit 1' INT TERM HUP
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
case "$1" in
|
|
85
|
+
deps)
|
|
86
|
+
shift; tiers=core
|
|
87
|
+
for t in "$@"; do case $t in voice|music) tiers="$tiers $t" ;; *) echo "usage: sh setup.sh deps [voice] [music]"; exit 1 ;; esac; done
|
|
88
|
+
cd "$LIB"; lock_deps "sh setup.sh"
|
|
89
|
+
command -v npm >/dev/null || { echo "✗ npm not found: install Node 20+ first"; exit 1; }
|
|
90
|
+
if ! node_ok; then
|
|
91
|
+
npm install --no-audit --no-fund --loglevel=error
|
|
92
|
+
# npm may rewrite package-lock.json; in our own clone put it back, so the checksum stays the same
|
|
93
|
+
[ "$(git config --get lemo.managed 2>/dev/null)" = true ] && git checkout -q -- package.json package-lock.json 2>/dev/null || true
|
|
94
|
+
sig package.json package-lock.json > node_modules/.lemo-ok
|
|
95
|
+
fi
|
|
96
|
+
node node_modules/playwright-core/cli.js install chromium-headless-shell # the renderer's browser (a no-op when present)
|
|
97
|
+
# a venv whose Python is gone (after a Python upgrade) can't be repaired in place: make it again
|
|
98
|
+
win_shim
|
|
99
|
+
[ ! -e .venv ] || .venv/bin/python -c pass 2>/dev/null || { echo "! $LIB/.venv is broken; making it again"; rm -rf .venv; }
|
|
100
|
+
if [ ! -x .venv/bin/python ]; then
|
|
101
|
+
if command -v uv >/dev/null; then uv venv --quiet --python 3.12 .venv
|
|
102
|
+
else py=$(find_py) || { echo "✗ Python 3.11+ is needed (or install uv, which fetches it)"; exit 1; }; "$py" -m venv .venv; fi
|
|
103
|
+
win_shim
|
|
104
|
+
fi
|
|
105
|
+
# uv is a native program: on Windows it needs the venv's Scripts/python.exe, not a bin/python meant for sh
|
|
106
|
+
upy=.venv/bin/python; [ ! -f .venv/Scripts/python.exe ] || upy=.venv/Scripts/python.exe
|
|
107
|
+
for t in $tiers; do
|
|
108
|
+
py_ok "$t" && continue
|
|
109
|
+
if command -v uv >/dev/null; then uv pip install --quiet --python "$upy" -r "$(req "$t")"
|
|
110
|
+
else .venv/bin/python -m pip install --quiet --disable-pip-version-check -r "$(req "$t")"; fi
|
|
111
|
+
pysig "$(req "$t")" > ".venv/.lemo-$t"
|
|
112
|
+
done
|
|
113
|
+
case " $tiers " in *" voice "*) [ -f core/tts/kokoro-v1.0.onnx ] && [ -f core/tts/voices-v1.0.bin ] || sh tools/fetch.sh voice ;; esac
|
|
114
|
+
;;
|
|
115
|
+
demo)
|
|
116
|
+
[ -n "$2" ] && [ -f "$LIB/styles/$2/STYLE.md" ] || { echo "usage: sh setup.sh demo <slug> (slugs: $LIB/styles/README.md)"; exit 1; }
|
|
117
|
+
if git -C "$LIB" sparse-checkout list >/dev/null 2>&1 && ! git -C "$LIB" sparse-checkout list | grep -qx "/styles/$2/demo/"; then
|
|
118
|
+
sparse add "/styles/$2/demo/" "/styles/$2/poster.jpg"
|
|
119
|
+
fi
|
|
120
|
+
echo "demo source: $LIB/styles/$2/demo"
|
|
121
|
+
echo "demo poster: $LIB/styles/$2/poster.jpg"
|
|
122
|
+
;;
|
|
123
|
+
esac
|
|
124
|
+
|
|
125
|
+
# 2. Tools the pipeline needs (report only; installing them is up to the user)
|
|
126
|
+
miss=""
|
|
127
|
+
if command -v node >/dev/null; then
|
|
128
|
+
[ "$(node -p 'process.versions.node.split(".")[0]')" -ge 20 ] || miss="$miss node20+(found $(node -v))"
|
|
129
|
+
else miss="$miss node20+"; fi
|
|
130
|
+
if command -v ffmpeg >/dev/null; then
|
|
131
|
+
ffv=$(ffmpeg -version 2>/dev/null | sed -n '1s/^ffmpeg version n\{0,1\}\([0-9][0-9]*\)\..*/\1/p')
|
|
132
|
+
[ -z "$ffv" ] || [ "$ffv" -ge 7 ] || miss="$miss ffmpeg7+(found $ffv.x)"
|
|
133
|
+
else miss="$miss ffmpeg"; fi
|
|
134
|
+
command -v uv >/dev/null || find_py >/dev/null || miss="$miss python3.11+(or uv)"
|
|
135
|
+
[ -n "$miss" ] && echo "! missing:$miss"
|
|
136
|
+
node_ok && py_ok core || echo "! packages not installed yet: run 'sh setup.sh deps' (a few minutes) before the first render"
|
|
137
|
+
# Package tiers: core renders; voice (TTS + speech check) and music (pluck.py) are added when a film needs them
|
|
138
|
+
mark() { if "$@"; then printf '✓'; else printf '✗'; fi; }
|
|
139
|
+
core_ok() { node_ok && py_ok core; }
|
|
140
|
+
voice_ok() { py_ok voice && [ -f "$LIB/core/tts/kokoro-v1.0.onnx" ] && [ -f "$LIB/core/tts/voices-v1.0.bin" ]; }
|
|
141
|
+
add=""; voice_ok || add="$add voice"; py_ok music || add="$add music"
|
|
142
|
+
tline="packages: core $(mark core_ok) · voice $(mark voice_ok) · music $(mark py_ok music)"
|
|
143
|
+
core_ok && [ -n "$add" ] && tline="$tline (when a film needs them: sh setup.sh deps$add)"
|
|
144
|
+
echo "$tline"
|
|
145
|
+
echo "LIB=$LIB"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"title": "Film styles (Lemo-Opuscar)", "group": "optional", "off_by_default": true, "status": "beta", "needs": ["git", "node", "python3", "ffmpeg"]}
|
|
@@ -24,6 +24,11 @@ const SKILL_ICONS: Record<string, string> = {
|
|
|
24
24
|
const PUZZLE = '<path d="M10 4a2 2 0 1 1 4 0v2h5v5h-2a2 2 0 1 0 0 4h2v5H5v-5h2a2 2 0 1 0 0-4H5V6h5Z"/>';
|
|
25
25
|
const skillIcon = (id: string) => raw(`<svg class="sk-i" viewBox="0 0 24 24" aria-hidden="true">${SKILL_ICONS[id] ?? PUZZLE}</svg>`);
|
|
26
26
|
|
|
27
|
+
// What each off-by-default skill asks before it turns on.
|
|
28
|
+
const WARN: Record<string, string> = {
|
|
29
|
+
"kaizen-computer": "Let agents read and operate the apps on your desktop?\n\nThey see the window text of the apps they open and can click, set values and type in them, as you. A password manager is blocked by its name only, so one inside a browser or under another name is not. Any other open app is in reach. Turn on?",
|
|
30
|
+
"lemo-opuscar": "Add film styles from Lemo-Opuscar?\n\nThe first time an agent uses it, it downloads the Lemo-Opuscar style library from github.com/lemomo-ai/lemo-opuscar (MIT) into ~/lemo-opuscar and installs its Node and Python packages there. It needs git, Node, Python and ffmpeg, and it runs that project's code on your computer. Turn on?",
|
|
31
|
+
};
|
|
27
32
|
const row = (s: Row) =>
|
|
28
33
|
html`<div class="sk" data-q="${[s.title, s.id, s.description, s.group, "skill"].join(" ").toLowerCase()}">
|
|
29
34
|
<div class="sk-h">${skillIcon(s.id)}<span class="sk-n"><b>${s.title}${s.status && s.status !== "stable" ? html` <em class="sk-st">${s.status === "beta" ? "Beta" : "Experimental"}</em>` : ""}</b><span>${s.description}</span></span>
|
|
@@ -73,7 +78,7 @@ export function wireSkills(redraw: () => Promise<unknown>, token = "") {
|
|
|
73
78
|
if (b.dataset.skill === "rea") return reaSwitch(on, false, redraw);
|
|
74
79
|
// An off-by-default skill gives agents a power the user never had to grant: say so, then ask.
|
|
75
80
|
const warn = on && b.dataset.warn === "true";
|
|
76
|
-
if (warn && !confirm(
|
|
81
|
+
if (warn && !confirm(WARN[b.dataset.skill!] ?? "Turn this skill on?")) return;
|
|
77
82
|
const j = await post("/skills", { id: b.dataset.skill, on, ...(warn ? { confirm: true, token } : {}) });
|
|
78
83
|
toast(j.error ? j.error : "Saved. Applies to new sessions");
|
|
79
84
|
await redraw();
|
package/web/board/task-page.ts
CHANGED
|
@@ -245,7 +245,7 @@ function technicalView(t: TaskView, current?: TaskResult): Safe {
|
|
|
245
245
|
Permission prompts may require the supported terminal controls in the workspace. Stop requests cancellation; it
|
|
246
246
|
does not undo files.
|
|
247
247
|
</p>
|
|
248
|
-
${runs.length ? html`<nav aria-label="Linked runs">${runs.map((id) => html`<a class="btn" href="?view=run&id=${id}&dir=${encodeURIComponent(t.dir)}">Open workspace · ${id}</a>`)}</nav>` : html`<p>No run has started yet.</p>`}<small
|
|
248
|
+
${runs.length ? html`<nav aria-label="Linked runs">${runs.map((id) => html`<a class="btn" href="?view=run&id=${id}&dir=${encodeURIComponent(t.dir)}">Open workspace · ${id}</a>`)}</nav>` : html`<p>No run has started yet.</p>`}<div class="tp-close" role="group" aria-label="Close this task"><button type="button" class="btn ghost" data-close="archive">Archive</button>${t.activeRun ? html`<button type="button" class="btn danger" data-close="abandon">Abandon</button>` : html`<button type="button" class="btn danger" data-close="delete">Delete</button>`}</div><small
|
|
249
249
|
>Task ${t.id} · revision ${t.revision}</small
|
|
250
250
|
>
|
|
251
251
|
</div>`;
|
|
@@ -361,6 +361,17 @@ function draw() {
|
|
|
361
361
|
drawer = false;
|
|
362
362
|
applyDrawer();
|
|
363
363
|
};
|
|
364
|
+
$("tp-info").addEventListener("click", async (e) => {
|
|
365
|
+
const op = (e.target as HTMLElement).closest<HTMLElement>("[data-close]")?.dataset.close;
|
|
366
|
+
if (!op) return;
|
|
367
|
+
const ask = { delete: "Delete this task? It is not recorded anywhere.", abandon: "Abandon this run? Saved files are not rolled back." }[op];
|
|
368
|
+
if (ask && !confirm(ask)) return;
|
|
369
|
+
const r = await action(op, op === "abandon" ? { why: "abandoned from the task page" } : {});
|
|
370
|
+
if (r?.ok && op !== "abandon") {
|
|
371
|
+
history.pushState(null, "", "?view=tasks");
|
|
372
|
+
go("tasks");
|
|
373
|
+
}
|
|
374
|
+
});
|
|
364
375
|
$("tp-stop").onclick = () => void action("stop");
|
|
365
376
|
$("tp-resume").onclick = () => void action("resume");
|
|
366
377
|
$("tp-start").onclick = () => runPopup({ _k: "task:" + t.id, kind: "task", state: t.dir, text: t.title }, (pick) => void action("start", { pick }));
|
package/web/board/update.ts
CHANGED
|
@@ -14,6 +14,8 @@ let upd = null,
|
|
|
14
14
|
const desk = globalThis.kaizenDesktop;
|
|
15
15
|
const name = desk ? "Kaizen" : "kaizen";
|
|
16
16
|
const getVer = (fresh) => (desk ? desk.check() : fetch(fresh ? "/version?fresh=1" : "/version").then((r) => r.json()));
|
|
17
|
+
// A board that is the desktop app's own copy cannot update itself; say where to update it.
|
|
18
|
+
const behindMsg = (v) => `${name} ${v.latest} is available. You are running ${v.version}. Update it from the desktop app on your computer.`;
|
|
17
19
|
export function gotVer(v) {
|
|
18
20
|
ver = v;
|
|
19
21
|
upd = v.update ? v : null;
|
|
@@ -26,7 +28,7 @@ export function updBar() {
|
|
|
26
28
|
const d = document.createElement("div");
|
|
27
29
|
d.className = `updbar${upd ? "" : " quiet"}`;
|
|
28
30
|
if (!upd) {
|
|
29
|
-
d.innerHTML = html`<span id="upd-msg" aria-live="polite">${ver ? `${name} ${ver.version}` : name}</span
|
|
31
|
+
d.innerHTML = html`<span id="upd-msg" aria-live="polite">${ver ? (ver.behind ? behindMsg(ver) : `${name} ${ver.version}`) : name}</span
|
|
30
32
|
><button class="btn" id="upd-chk">Check for updates</button>`;
|
|
31
33
|
} else {
|
|
32
34
|
// What's new: each newer release's one-line title, shown on hover, focus or click.
|
|
@@ -77,7 +79,7 @@ export function updBar() {
|
|
|
77
79
|
updBar();
|
|
78
80
|
if (upd) $("upd-go").focus();
|
|
79
81
|
else {
|
|
80
|
-
$("upd-msg").textContent = `${name} ${v.version} is up to date.`;
|
|
82
|
+
$("upd-msg").textContent = v.behind ? behindMsg(v) : `${name} ${v.version} is up to date.`;
|
|
81
83
|
$("upd-chk").focus();
|
|
82
84
|
}
|
|
83
85
|
};
|
package/web/board/workspace.ts
CHANGED
|
@@ -17,7 +17,9 @@ const STAGE = ["idea", "planning", "building", "reviewing", "done"];
|
|
|
17
17
|
export function stateOf(c) {
|
|
18
18
|
const task = taskForCard(c);
|
|
19
19
|
// Only a task that is really working spins; a saved goal is idle, a finished run keeps its own state.
|
|
20
|
-
|
|
20
|
+
// An abandoned run waits on nobody, and a done one only on its own approval or commit (below), so
|
|
21
|
+
// a linked task's "needs you" never paints a finished run orange.
|
|
22
|
+
if (task && !(c.kind === "run" && (c.status === "done" || c.status === "abandoned"))) return task.attention.category === "needs-you" ? "wait" : task.attention.category === "completed" ? "done" : ["interrupted", "failed"].includes(task.status ?? "") ? "stalled" : task.status === "draft" ? "idle" : "build";
|
|
21
23
|
// A task whose agent is working is a run being born: show it as planning.
|
|
22
24
|
if (c.kind === "idea") return !c.pty?.alive ? "idle" : c.pty.asking ? "wait" : c.pty.busy ? "plan" : "idle";
|
|
23
25
|
if (c.status === "waiting" || (c.pty?.alive && c.pty.asking)) return "wait";
|
|
@@ -61,24 +63,21 @@ export const cardHref = (c) =>
|
|
|
61
63
|
`/?view=run&dir=${encodeURIComponent(c.state)}&` + (c.kind === "run" ? "id=" + encodeURIComponent(c.id) : "idea=" + encodeURIComponent(c.text));
|
|
62
64
|
|
|
63
65
|
// The Projects filter: projects ticked (none = all) and which kinds of card show. Kept per browser.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
// Running: tasks and agents that started and are not done. Done: the finished ones. Saved tasks that never started show in neither.
|
|
67
|
+
type Filt = { dirs: string[]; running: boolean; done: boolean };
|
|
68
|
+
const ALLF: Filt = { dirs: [], running: true, done: false };
|
|
66
69
|
let filt: Filt = (() => {
|
|
67
70
|
try {
|
|
68
|
-
return { ...ALLF, ...JSON.parse(localStorage.getItem("kz-rail-
|
|
71
|
+
return { ...ALLF, ...JSON.parse(localStorage.getItem("kz-rail-filter2") || "{}") };
|
|
69
72
|
} catch {
|
|
70
73
|
return { ...ALLF };
|
|
71
74
|
}
|
|
72
75
|
})();
|
|
73
76
|
const keepFilt = () => {
|
|
74
77
|
try {
|
|
75
|
-
localStorage.setItem("kz-rail-
|
|
78
|
+
localStorage.setItem("kz-rail-filter2", JSON.stringify(filt));
|
|
76
79
|
} catch {}
|
|
77
80
|
};
|
|
78
|
-
const kindOf = (c) => {
|
|
79
|
-
const st = stateOf(c);
|
|
80
|
-
return st === "done" || st === "aband" ? "done" : "active";
|
|
81
|
-
};
|
|
82
81
|
let last: { cards: any[]; projects?: any[]; agents?: Agent[] } = { cards: [] };
|
|
83
82
|
// Projects that are git repositories (the main checkout has a branch): where a workspace can be made.
|
|
84
83
|
export const gitProjects = () =>
|
|
@@ -211,7 +210,7 @@ async function readTaskAttention() {
|
|
|
211
210
|
try { const r = await fetch("/tasks?all=1"); if (r.ok) { const body = await r.json(); setTaskAttention(body.tasks ?? []); } } catch { /* retain the latest persisted projection */ }
|
|
212
211
|
finally { tasksReading = false; }
|
|
213
212
|
}
|
|
214
|
-
const taskLinks = (dir: string, w: any, cards: any[]) => (attentionTasks ?? []).filter((t) => t.dir === dir && !t.legacy && t.attention.category !== "completed" && (cards.some((c) => taskForCard(c)?.id === t.id) || (w.main && !(t.runs ?? t.runIds ?? []).length))).sort((a: any, b: any) => (a.created ?? 0) - (b.created ?? 0)).map((t) => html`<a class="rtask" href="/?view=task&task=${encodeURIComponent(t.id)}&dir=${encodeURIComponent(t.dir)}" data-task-id="${t.id}" data-task-dir="${t.dir}" title="${t.attention.reason} · ${t.attention.action}"><span class="si ${t.attention.category === "needs-you" ? "wait" : t.attention.category === "completed" ? "done" : ["interrupted", "failed"].includes(t.status ?? "") ? "stalled" : t.status === "draft" ? "idle" : "build"}"></span><span><b>${t.title}</b><small>${t.attention.reason}</small></span></a>`);
|
|
213
|
+
const taskLinks = (dir: string, w: any, cards: any[]) => (attentionTasks ?? []).filter((t) => t.dir === dir && !t.legacy && t.attention.category !== "completed" && filt.running && t.status !== "draft" && (cards.some((c) => taskForCard(c)?.id === t.id) || (w.main && !(t.runs ?? t.runIds ?? []).length))).sort((a: any, b: any) => (a.created ?? 0) - (b.created ?? 0)).map((t) => html`<a class="rtask" href="/?view=task&task=${encodeURIComponent(t.id)}&dir=${encodeURIComponent(t.dir)}" data-task-id="${t.id}" data-task-dir="${t.dir}" title="${t.attention.reason} · ${t.attention.action}"><span class="si ${t.attention.category === "needs-you" ? "wait" : t.attention.category === "completed" ? "done" : ["interrupted", "failed"].includes(t.status ?? "") ? "stalled" : t.status === "draft" ? "idle" : "build"}"></span><span><b>${t.title}</b><small>${t.attention.reason}</small></span></a>`);
|
|
215
214
|
|
|
216
215
|
export const wsLabel = (w) => w.branch || (w.main ? "workspace" : w.path.split(/[\\/]/).pop());
|
|
217
216
|
function drawList() {
|
|
@@ -222,7 +221,12 @@ function drawList() {
|
|
|
222
221
|
const all = new Set(projects.map((p) => p.dir));
|
|
223
222
|
// Cards by project and workspace: each lands on a row, the main checkout when its own is not listed.
|
|
224
223
|
const by = new Map<string, any[]>();
|
|
225
|
-
|
|
224
|
+
const shownAgents = (rs) => rs.filter((r) => (r.st === "done" ? filt.done : filt.running));
|
|
225
|
+
const shown = (c) => {
|
|
226
|
+
const st = stateOf(c);
|
|
227
|
+
return (filt.running && ["wait", "plan", "build", "review", "stalled"].includes(st)) || (filt.done && (st === "done" || st === "aband"));
|
|
228
|
+
};
|
|
229
|
+
for (const c of last.cards.filter((c) => listed(c, now) && shown(c))) {
|
|
226
230
|
const k = c.state + "\0" + wsOfCard(c);
|
|
227
231
|
if (!by.has(k)) by.set(k, []);
|
|
228
232
|
by.get(k)!.push(c);
|
|
@@ -234,17 +238,18 @@ function drawList() {
|
|
|
234
238
|
const rows = p.workspaces
|
|
235
239
|
.map((w) => ({ w, cs: by.get(p.dir + "\0" + w.path) ?? [] }))
|
|
236
240
|
// An empty workspace or one with a run going is active; one holding only finished runs is done.
|
|
237
|
-
.filter(({ cs }) =>
|
|
241
|
+
.filter(({ w, cs }) => cs.length || shownAgents(wsAgents(last.agents ?? [], p.dir, w.path, wsOfCard, now)).length)
|
|
238
242
|
// Pinned worktrees first (a stable sort keeps the rest in git's order).
|
|
239
243
|
.sort((a, b) => +pins.has(p.dir + "\0" + b.w.path) - +pins.has(p.dir + "\0" + a.w.path));
|
|
240
244
|
return { p, rows, top: Math.min(9, ...rows.map((r) => top(r.cs))) };
|
|
241
245
|
})
|
|
242
|
-
|
|
246
|
+
// Running only keeps every project listed, so an idle one reads "Nothing running" rather than vanishing.
|
|
247
|
+
.filter((g) => g.rows.length || filt.running)
|
|
243
248
|
// Projects by their most urgent card; the picker's order otherwise.
|
|
244
249
|
.sort((a, b) => a.top - b.top);
|
|
245
250
|
|
|
246
251
|
const f = $("pfilter");
|
|
247
|
-
const on = filt.dirs.some((d) => all.has(d)) || !filt.
|
|
252
|
+
const on = filt.dirs.some((d) => all.has(d)) || !filt.running || filt.done;
|
|
248
253
|
f.setAttribute("aria-pressed", String(on));
|
|
249
254
|
f.title = on ? "Filter on: choose projects and kinds" : "Filter projects and kinds";
|
|
250
255
|
if ($("pfpop")) drawPop(all);
|
|
@@ -258,12 +263,13 @@ function drawList() {
|
|
|
258
263
|
.map(({ p, rows }) => {
|
|
259
264
|
const dir = p.dir,
|
|
260
265
|
name = projName(dir, last.projects),
|
|
261
|
-
|
|
266
|
+
// A project with nothing to list stays as a collapsed header.
|
|
267
|
+
shut = folded.has(dir) || !rows.length;
|
|
262
268
|
// A + for a new worktree on git projects (the main checkout has a branch).
|
|
263
269
|
const git = p.workspaces.some((w) => w.branch);
|
|
264
270
|
return html`<div class="pgrp"><button type="button" class="proj${shut ? " shut" : ""}" data-fold="${dir}" title="${dir}" aria-expanded="${String(!shut)}">${logo(dir, name, last.projects)}<span class="pname">${name}</span><svg class="fchev" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>${git ? html`<button type="button" class="wadd" data-wadd="${dir}" title="New workspace in ${name}" aria-label="New workspace in ${name}"><svg aria-hidden="true"><use href="#i-plus"/></svg></button>` : ""}</div>${shut ? "" : raw('<div class="pws">')}${shut ? "" : rows.map(({ w, cs }) => {
|
|
265
271
|
// The dot: the most urgent run there, or an agent asking (amber) or working (spinner).
|
|
266
|
-
const rows = wsAgents(last.agents ?? [], dir, w.path, wsOfCard, now);
|
|
272
|
+
const rows = shownAgents(wsAgents(last.agents ?? [], dir, w.path, wsOfCard, now));
|
|
267
273
|
const st0 = cs.length ? stateOf([...cs].sort((a, b) => RANK[stateOf(a)] - RANK[stateOf(b)])[0]) : "";
|
|
268
274
|
const st = st0 === "wait" || rows[0]?.st === "asking" ? "wait" : rows.some((r) => r.st === "working") ? "build" : st0 || (rows.length ? "done" : "");
|
|
269
275
|
// The agent buttons are siblings of the link (a button inside a link is invalid).
|
|
@@ -360,9 +366,12 @@ function drawPop(all: Set<string>) {
|
|
|
360
366
|
const box = (on: boolean, attrs: string, label) => html`<label class="pfrow"><input type="checkbox" ${raw(attrs)}${on ? raw(" checked") : ""}>${label}</label>`;
|
|
361
367
|
const allShut = dirs.length > 0 && dirs.every((d) => folded.has(d));
|
|
362
368
|
const had = document.activeElement?.id;
|
|
369
|
+
const top = p.querySelector(".pfl")?.scrollTop ?? 0;
|
|
363
370
|
p.innerHTML = String(
|
|
364
|
-
html
|
|
371
|
+
html`<input class="sel" id="pfq" placeholder="Search projects…" aria-label="Search projects" value="${pq}" autocomplete="off" spellcheck="false"><div class="pfall">${box(!filt.dirs.length, 'data-all="1"', "All projects")}<button type="button" class="pfb" data-fa="${allShut ? "0" : "1"}" title="${allShut ? "Expand all" : "Collapse all"}" aria-label="${allShut ? "Expand all projects" : "Collapse all projects"}">${raw(allShut ? FA_OPEN : FA_SHUT)}</button></div><div class="pfl">${shown.map((d) => box(filt.dirs.includes(d), `data-dir="${encodeURIComponent(d)}"`, html`${logo(d, projName(d, last.projects), last.projects)}<span>${projName(d, last.projects)}</span>`))}</div><div class="pff"><div class="pfh">Show</div>${(["running", "done"] as const).map((k) => box(filt[k], `data-k="${k}"`, { running: "Running", done: "Done" }[k]))}</div>`,
|
|
365
372
|
);
|
|
373
|
+
const pl = p.querySelector(".pfl");
|
|
374
|
+
if (pl) pl.scrollTop = top;
|
|
366
375
|
if (had === "pfq") {
|
|
367
376
|
const q = $("pfq") as HTMLInputElement;
|
|
368
377
|
q.focus();
|
package/web/board.html
CHANGED
|
@@ -103,10 +103,10 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
|
|
|
103
103
|
.rail .psec button{width:var(--btn-xs);height:var(--btn-xs);display:grid;place-items:center;flex:none;border-radius:var(--r-s);color:var(--dim)}.rail .psec button:hover{background:var(--hover);color:var(--ink)}.rail .psec button svg{width:var(--ico);height:var(--ico)}
|
|
104
104
|
.rail .psec button[aria-pressed=true]{color:var(--accent)}.rail .psec button{position:relative}.rail .psec button[aria-pressed=true]::after{content:"";position:absolute;right:3px;top:3px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
|
|
105
105
|
.rail .psec a.pbd{width:var(--btn-xs);height:var(--btn-xs);display:grid;place-items:center;flex:none;border-radius:var(--r-s);color:var(--dim)}.rail .psec a.pbd:hover{background:var(--hover);color:var(--ink)}.rail .psec a.pbd[aria-current=page]{color:var(--accent)}
|
|
106
|
-
.pfpop{position:fixed;z-index:40;min-width:220px;max-width:280px;max-height:60vh;overflow:
|
|
106
|
+
.pfpop{position:fixed;z-index:40;min-width:220px;max-width:280px;max-height:60vh;overflow:hidden;padding:6px;display:flex;flex-direction:column;gap:1px;background:var(--bg-2);color:var(--ink);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow-2);font-size:12.5px}
|
|
107
107
|
.pfpop .sel{margin:2px 2px 6px;padding:5px 8px;border-radius:var(--r)}.pfrow{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:var(--r-s);cursor:pointer;white-space:nowrap}.pfrow:hover{background:var(--hover)}.pfrow input{accent-color:var(--accent);margin:0}.pfrow .plogo{width:16px;height:16px;font-size:9px;border-radius:var(--r-xs);display:inline-grid;place-items:center;flex:none;font-weight:600;color:var(--dim);background:var(--hover)}.pfrow img.plogo{background:none}
|
|
108
108
|
.pfall{display:flex;align-items:center;gap:2px}.pfall .pfrow{flex:1;min-width:0}.pfb{all:unset;display:grid;place-items:center;width:24px;height:24px;flex:none;border-radius:var(--r-s);cursor:pointer;color:var(--dim)}.pfb:hover{background:var(--hover);color:var(--ink)}.pfb:focus-visible{outline:2px solid var(--accent)}
|
|
109
|
-
.pfpop .pfh{margin:8px 8px 2px;font-size:11px;font-weight:600;color:var(--dim)}
|
|
109
|
+
.pfpop .pfh{margin:8px 8px 2px;font-size:11px;font-weight:600;color:var(--dim)}.pfpop .pfl{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:1px}.pfpop .pff{flex:none;margin-top:4px;padding-top:2px;border-top:1px solid var(--line)}
|
|
110
110
|
.rail .plist{flex:1;min-height:40px;overflow:hidden auto;margin:0 -4px;padding:0 4px}
|
|
111
111
|
#kbd{display:none!important}.plist .proj{all:unset;box-sizing:border-box;display:flex;gap:8px;align-items:center;height:var(--row-h);margin:2px 0 0;padding:0 var(--padx);font-size:var(--fs-s);font-weight:500;color:var(--ink);white-space:nowrap;cursor:pointer;width:100%;border-radius:var(--r-s)}.proj:focus-visible{outline:2px solid var(--accent)}.proj .pname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.proj .fchev{width:12px;height:12px;flex:none;color:var(--dim);transition:transform .15s,opacity .15s;transform:rotate(90deg);opacity:0}.proj:hover .fchev,.proj:focus-visible .fchev{opacity:1}.proj.shut .fchev{transform:none}@media(hover:none){.proj .fchev{opacity:1}}.plist .proj .c{color:var(--dim);font-size:11px;font-weight:400}.plist .proj .plogo{width:16px;height:16px;font-size:9px;border-radius:var(--r-xs);display:inline-grid;place-items:center;flex:none;font-weight:600;color:var(--dim);background:var(--hover);object-fit:contain}.plist .proj img.plogo{background:none}
|
|
112
112
|
.plist .row{display:grid;grid-template-columns:14px minmax(0,1fr);gap:var(--gap);align-items:center;height:var(--row);padding:0 var(--padx);border-radius:var(--r-s);color:var(--ink);text-decoration:none}.plist .row:hover,.plist .row[aria-current]{background:var(--hover)}.plist .row .si{margin-top:0}
|