What: - 三份 manifest 的 name 由 jsc-template 改成 jsc-assist,version 設為 0.0.1,description 改寫成助理的定位,並加上 jsc.requires 宣告對 jsc-cli、jsc-gitea、jsc-hooks、jsc-log 的最低版本。 - README.md 與 AGENTS.md 依 meta domain 的格式重寫,AGENTS.md 多一節「助理的界線」。 - 刪掉樣板的 hello 技能,新增 status 技能與 references/behaviors.md 行為清單。 Why: - 這個存取庫原本整份是 template 的樣板,四份 manifest 都還叫 jsc-template。名字沒改,marketplace 認不出它是獨立的 domain,各 CLI 也裝不上。 - 助理的閘門、心跳與巡檢要有落點,前提是存取庫先認得出自己。 - 樣板的 hello 技能只是安裝驗證用,留著會讓助理的技能清單從第一天就帶著一支沒有用途的技能。換成唯讀的 status,行為檢查與 frontmatter 檢查也才有掃描對象。 How: - status 全程唯讀:讀心跳檔判斷助理在不在跑,判準只看時間戳距現在是否不到 300 秒,不看 pid 存活——五支 CLI 與容器裡的行程互相看不到彼此的 pid。 - 心跳檔不存在時印「助理未運行」,這是正常結果,不以非 0 結束。 - 這支不新增 tools/ 腳本。讀兩個路徑印一張表還不到抽腳本的門檻,助理主體落地時再一併評估。 - 三份 manifest 的 version 由 sync-skill-manifest.sh 同步,README 的技能目錄區塊一起更新。 Who: 助理 domain 落地的第一步,後續的閘門、心跳與排程都接在這個基礎上。
5.6 KiB
name, description
| name | description |
|---|---|
| status | Report the background assistant's current state read-only, from the heartbeat file and the task book under $JSC_HOME/assistant/. Heartbeat counts as fresh only when the file exists and its ts is less than 300 seconds old, and pid liveness is never checked. Print one table covering heartbeat freshness, last heartbeat time, cli, session, task count, and every task's state, title, next_run and fail_count, flagging each task whose fail_count is above zero. A missing heartbeat file prints 助理未運行 and still counts as a normal result rather than an error. Use when someone asks whether the assistant is running or what is queued; not for starting or stopping it, not for environment health checks (jsc-cli:doctor), and not for skill usage counts (jsc-log:stats). |
status — assistant heartbeat and task book snapshot
Read-only snapshot of the background assistant. This skill reads two paths and prints one table. It writes no file, writes no wiki page, calls no gate, and never starts or stops the assistant.
No tools/ script backs this skill. Two paths and one table stay below the extraction bar; re-evaluate when the assistant body itself lands.
Data sources
| Path | Format | Keys |
|---|---|---|
$JSC_HOME/assistant/heartbeat |
plain text, one key=value per line |
ts (epoch seconds), pid, cli, session |
$JSC_HOME/assistant/tasks/{id} |
plain text, one key=value per line, one entry per file |
id, kind (check or todo), title, action, trigger, recur, repo, due, state (pending / done / paused), last_run, next_run, fail_count, origin (user or assistant) |
$JSC_HOME defaults to ~/.jsc.
Freshness is time-based only. The heartbeat is fresh when the file exists and ts is less than 300 seconds behind the current time. An older ts means the assistant is not running. Never test whether pid is alive: the five CLIs and the processes inside containers cannot see each other's pids, so a live-looking pid proves nothing and a missing one proves nothing either. Report pid as a hint for whoever has to find a blocking process, and give it no weight in the verdict.
Steps
-
Resolve the assistant directory. Take
$JSC_HOMEfrom the environment; when it is unset or empty, use~/.jsc. Appendassistant/to get the directory this skill reads. When that directory is absent or cannot be listed, print助理未運行, name the resolved path and the reason (the variable was unset and the default path does not exist, or the listing was denied), skip steps 2 to 6, and finish per step 7. Done when one absolute assistant directory path is recorded, or the not-running report naming that path is printed. -
Read the heartbeat. Read
{assistant}/heartbeatand split each line on its first=. Branch on the outcome.Outcome Do File absent Set heartbeat state to 不存在, print助理未運行, continue at step 4 — the task book is still worth printingFile unreadable (permission denied, I/O error) Set heartbeat state to 不存在, print助理未運行, name the error text as the reason, continue at step 4File present, tsabsent or not an integerSet heartbeat state to 過期, name the malformed value, continue at step 4File present with an integer tsContinue at step 3 Done when the heartbeat state holds one of
不存在,過期, or a pending verdict handed to step 3, and the values ofpid,cliandsessionare recorded as read or as absent. -
Judge freshness. Subtract
tsfrom the current epoch seconds. A difference below 300 sets the state to新鮮; 300 or above sets it to過期. Done when the state is新鮮or過期and the age in seconds is recorded. -
Read the task book. List the regular files directly under
{assistant}/tasks/and parse each one askey=valuelines. Branch on the outcome.Outcome Do Directory absent Report zero entries. This is a normal result, not an error Directory present, no files Report zero entries A file cannot be read or holds no recognisable key Keep it as one row, put the file name in the title column, name the read or parse error in that row, and carry on with the remaining files A key is missing from a readable file Print -in that columnDone when every file under
tasks/has produced exactly one row, or zero entries has been reported. -
Print the status table. Lead with the heartbeat block — state (
新鮮/過期/不存在), last heartbeat time rendered fromtsin local time,cli,session, and the task count. Follow it with one row per task carryingstate,title,next_runandfail_count, in the order the files were listed. Done when the heartbeat block holds all five values and the row count equals the task count reported in step 4. -
Flag the repeatedly failing tasks. Append
已連續失敗 N 次to every row whosefail_countis above 0, withNtaken verbatim from the file. A broken entry that retries every round with nobody noticing is the reason this field exists, so let no such row leave the table unmarked. Done when every row withfail_countabove 0 carries the marker and its number matches the file. -
Finish successfully.
助理未運行, an absent tasks directory and an empty tasks directory are normal results — never exit non-zero for any of them. Reserve a failure report for a condition none of the tables above covers, and state which path and which error produced it. Done when the report is printed and nothing under$JSC_HOMEhas been created, modified or deleted.