@codyswann/lisa 4.106.3 → 4.107.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/cdk/package-lisa/package.lisa.json +2 -2
- package/dist/configs/eslint/base.d.ts +2 -0
- package/dist/configs/eslint/base.d.ts.map +1 -1
- package/dist/configs/eslint/base.js +8 -0
- package/dist/configs/eslint/base.js.map +1 -1
- package/dist/configs/eslint/expo.d.ts +6 -0
- package/dist/configs/eslint/expo.d.ts.map +1 -1
- package/dist/configs/eslint/expo.js +23 -0
- package/dist/configs/eslint/expo.js.map +1 -1
- package/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +34 -11
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/expo/package-lisa/package.lisa.json +2 -2
- package/harper-fabric/package-lisa/package.lisa.json +2 -2
- package/nestjs/package-lisa/package.lisa.json +2 -2
- package/package.json +6 -6
- package/phaser/package-lisa/package.lisa.json +2 -2
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +21 -12
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-status.mjs +10 -9
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +21 -10
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cyclers.mjs +127 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/ledger.mjs +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +2 -0
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +21 -12
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-status.mjs +10 -9
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +21 -10
- package/plugins/lisa/skills/lisa-session-manager/scripts/cyclers.mjs +127 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/ledger.mjs +5 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +2 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +21 -12
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-status.mjs +10 -9
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +21 -10
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cyclers.mjs +127 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/ledger.mjs +5 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +2 -0
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +21 -12
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-status.mjs +10 -9
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +21 -10
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cyclers.mjs +127 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/ledger.mjs +5 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +2 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +21 -12
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-status.mjs +10 -9
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +21 -10
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cyclers.mjs +127 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/ledger.mjs +5 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +2 -0
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +21 -12
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-status.mjs +10 -9
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +21 -10
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cyclers.mjs +127 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/ledger.mjs +5 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +2 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +21 -12
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-status.mjs +10 -9
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +21 -10
- package/plugins/src/base/skills/lisa-session-manager/scripts/cyclers.mjs +127 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/ledger.mjs +5 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +2 -0
- package/typescript/package-lisa/package.lisa.json +2 -2
|
@@ -10,7 +10,8 @@ import path from "node:path";
|
|
|
10
10
|
|
|
11
11
|
import { listAgents, requireConfig, run } from "./cli-runtime.mjs";
|
|
12
12
|
import { notifyProvider } from "./config.mjs";
|
|
13
|
-
import {
|
|
13
|
+
import { callerSessionName, otherCyclers } from "./cyclers.mjs";
|
|
14
|
+
import { buildHasSession } from "./launch.mjs";
|
|
14
15
|
import { listPendingQuestions } from "./ledger-questions.mjs";
|
|
15
16
|
import { readLedger } from "./ledger.mjs";
|
|
16
17
|
import { shellQuote } from "./token.mjs";
|
|
@@ -50,13 +51,9 @@ function answerCommandFor(ctx, ref) {
|
|
|
50
51
|
* another session or none, null when tmux cannot say which it is
|
|
51
52
|
*/
|
|
52
53
|
function isManagerSelf(ctx, name) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const probe = run("tmux", argv, { env: ctx.env });
|
|
57
|
-
const current = probe.status === 0 ? probe.stdout.trim() : "";
|
|
58
|
-
if (current === "") return null;
|
|
59
|
-
return current === name;
|
|
54
|
+
const current = callerSessionName(ctx);
|
|
55
|
+
if (current === undefined) return false;
|
|
56
|
+
return current === null ? null : current === name;
|
|
60
57
|
}
|
|
61
58
|
|
|
62
59
|
/**
|
|
@@ -66,7 +63,10 @@ function isManagerSelf(ctx, name) {
|
|
|
66
63
|
* `notify` is the configured notification provider (`telegram` or `none`),
|
|
67
64
|
* so the manager knows each cycle whether a channel exists. `manager.self`
|
|
68
65
|
* (`true|false|null`) says whether the caller runs inside that tmux session
|
|
69
|
-
* (see {@link isManagerSelf}).
|
|
66
|
+
* (see {@link isManagerSelf}). `manager.otherCyclers` lists every session
|
|
67
|
+
* other than the manager's tmux session that ran `cycle` within twice the
|
|
68
|
+
* interval, newest first, so the manager can warn about a second loop it
|
|
69
|
+
* cannot otherwise see (#4809; see cyclers.mjs).
|
|
70
70
|
* @returns {Promise<{ json: object }>}
|
|
71
71
|
* `{manager,notify,control,workers,untracked,pendingQuestions}`
|
|
72
72
|
*/
|
|
@@ -85,6 +85,7 @@ export async function status(ctx) {
|
|
|
85
85
|
name: config.name,
|
|
86
86
|
running: tmux.status === 0,
|
|
87
87
|
self: isManagerSelf(ctx, config.name),
|
|
88
|
+
otherCyclers: otherCyclers(ledger, config, ctx.now()),
|
|
88
89
|
},
|
|
89
90
|
notify: notifyProvider(config),
|
|
90
91
|
control: ledger.control,
|
|
@@ -56,17 +56,28 @@ Workers and capacity
|
|
|
56
56
|
requestion|setup-gap|working|stalled|dead|exhausted. setup-gap: the
|
|
57
57
|
worker's first prompt never ran; setupGap is {kind:"unknown-command"|
|
|
58
58
|
"prompt-blocked",detail}, else null.
|
|
59
|
+
cycle
|
|
60
|
+
Records that this session ran a cycle now: cyclers[<by>] = <at> in
|
|
61
|
+
the ledger, by tmux:<session> when tmux names the caller's session,
|
|
62
|
+
pid:<parent pid> outside tmux, tmux-unknown:pid:<parent pid> when tmux
|
|
63
|
+
cannot name it. Prunes entries older than twice the interval.
|
|
64
|
+
Run at the start of every cycle. stdout {by,at}.
|
|
59
65
|
status
|
|
60
|
-
stdout {manager:{name,running,self
|
|
61
|
-
worker,sessionId,repo,status,attempts,
|
|
62
|
-
[wk-names],pendingQuestions:[{ref,
|
|
63
|
-
answerQueued,answerCommand}]}. manager.self
|
|
64
|
-
runs inside the manager's tmux session (any
|
|
65
|
-
outside tmux or in another session, null when
|
|
66
|
-
session the caller is in or $TMUX_PANE is not
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
stdout {manager:{name,running,self,otherCyclers:[{by,at}]},notify,
|
|
67
|
+
control,workers:[{ref,worker,sessionId,repo,status,attempts,
|
|
68
|
+
pendingQuestion,live}],untracked:[wk-names],pendingQuestions:[{ref,
|
|
69
|
+
kind,text,askedAt,marked,answerQueued,answerCommand}]}. manager.self
|
|
70
|
+
is true when the caller runs inside the manager's tmux session (any
|
|
71
|
+
window of it), false outside tmux or in another session, null when
|
|
72
|
+
tmux cannot say which session the caller is in or $TMUX_PANE is not
|
|
73
|
+
a pane id.
|
|
74
|
+
manager.otherCyclers lists, newest first, every cycle recorded within
|
|
75
|
+
twice the interval by a session other than tmux:<manager name>,
|
|
76
|
+
leaving out tmux-unknown entries; empty when only the manager
|
|
77
|
+
cycles. notify is the configured
|
|
78
|
+
channel: "telegram" or "none". pendingQuestions lists every item
|
|
79
|
+
waiting on a human, oldest first; answerCommand is the answer line to
|
|
80
|
+
run at this machine.
|
|
70
81
|
|
|
71
82
|
Manager
|
|
72
83
|
start [--settle-ms <n>]
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who ran a cycle, so the tmux manager can hear about a second session
|
|
3
|
+
* cycling in its project (CodySwannGT/lisa#4809).
|
|
4
|
+
*
|
|
5
|
+
* Only one session-manager loop should hand out work per project. #4496 left
|
|
6
|
+
* the duplicate warning to the second session's own cycle, because the tmux
|
|
7
|
+
* manager cannot see another session's `/loop`. An operator watching only the
|
|
8
|
+
* manager's channel never heard about it. Now every `cycle` records
|
|
9
|
+
* `cyclers[<identity>] = <ISO time>` in the ledger, and `status` reports as
|
|
10
|
+
* `manager.otherCyclers` every recent cycler that is not the manager's own
|
|
11
|
+
* tmux session, so the manager's cycle can warn too.
|
|
12
|
+
*
|
|
13
|
+
* Identity is `tmux:<session name>` when tmux names the caller's session
|
|
14
|
+
* (the same probe `manager.self` uses), `pid:<parent pid>` outside tmux, and
|
|
15
|
+
* `tmux-unknown:pid:<parent pid>` when that probe fails inside tmux. Nothing from
|
|
16
|
+
* the environment and no credential is ever recorded. "Recent" is within
|
|
17
|
+
* twice `sessionManager.interval`; older entries are pruned on every write so
|
|
18
|
+
* the map stays small.
|
|
19
|
+
* @module session-manager/cyclers
|
|
20
|
+
*/
|
|
21
|
+
import { requireConfig, run } from "./cli-runtime.mjs";
|
|
22
|
+
import { parseLoopInterval } from "./config.mjs";
|
|
23
|
+
import { buildCurrentSessionName } from "./launch.mjs";
|
|
24
|
+
import { updateLedger } from "./ledger.mjs";
|
|
25
|
+
|
|
26
|
+
/** Fallback when the interval does not parse: the config default, 5m. */
|
|
27
|
+
const DEFAULT_INTERVAL_SECONDS = 300;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The tmux session the caller runs in, by asking tmux for the caller's own
|
|
31
|
+
* `$TMUX_PANE` (#4496; see `buildCurrentSessionName` for why the pane is
|
|
32
|
+
* always targeted). Nothing here throws.
|
|
33
|
+
* @param {{ env: Record<string, string | undefined> }} ctx - CLI context
|
|
34
|
+
* @returns {string | null | undefined} The session name; undefined outside
|
|
35
|
+
* tmux; null inside tmux when tmux cannot say which session it is
|
|
36
|
+
*/
|
|
37
|
+
export function callerSessionName(ctx) {
|
|
38
|
+
if (!ctx.env.TMUX) return undefined;
|
|
39
|
+
const argv = buildCurrentSessionName(ctx.env.TMUX_PANE);
|
|
40
|
+
if (argv === null) return null;
|
|
41
|
+
const probe = run("tmux", argv, { env: ctx.env });
|
|
42
|
+
const current = probe.status === 0 ? probe.stdout.trim() : "";
|
|
43
|
+
return current === "" ? null : current;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Prefix for an in-tmux cycle whose session tmux could not name. */
|
|
47
|
+
const UNRESOLVED_PREFIX = "tmux-unknown:";
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The identity a cycle records: `tmux:<session>` when tmux names the
|
|
51
|
+
* caller's session, `pid:<parent pid>` outside tmux, and
|
|
52
|
+
* `tmux-unknown:pid:<parent pid>` inside tmux when the probe fails. The last
|
|
53
|
+
* may be the manager itself on a transient probe failure, so `otherCyclers`
|
|
54
|
+
* never counts it as another session.
|
|
55
|
+
* @param {{ env: Record<string, string | undefined> }} ctx - CLI context
|
|
56
|
+
* @returns {string} Identity
|
|
57
|
+
*/
|
|
58
|
+
function cyclerIdentity(ctx) {
|
|
59
|
+
const session = callerSessionName(ctx);
|
|
60
|
+
if (typeof session === "string") return `tmux:${session}`;
|
|
61
|
+
const pid = `pid:${process.ppid}`;
|
|
62
|
+
return session === null ? `${UNRESOLVED_PREFIX}${pid}` : pid;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* How far back a cycle still counts as recent: twice the loop interval.
|
|
67
|
+
* @param {{ interval?: string }} config - sessionManager block
|
|
68
|
+
* @returns {number} Window in milliseconds
|
|
69
|
+
*/
|
|
70
|
+
function windowMs(config) {
|
|
71
|
+
const seconds =
|
|
72
|
+
parseLoopInterval(config.interval) ?? DEFAULT_INTERVAL_SECONDS;
|
|
73
|
+
return 2 * seconds * 1000;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The entries of a cyclers map recorded within the window before `now`.
|
|
78
|
+
* An entry whose time does not parse is dropped.
|
|
79
|
+
* @param {Record<string, string> | undefined} cyclers - Identity to ISO time
|
|
80
|
+
* @param {number} nowMs - Now, in epoch milliseconds
|
|
81
|
+
* @param {number} window - Window in milliseconds
|
|
82
|
+
* @returns {[string, string][]} Recent `[identity, at]` pairs
|
|
83
|
+
*/
|
|
84
|
+
function recentEntries(cyclers, nowMs, window) {
|
|
85
|
+
return Object.entries(cyclers ?? {}).filter(([, at]) => {
|
|
86
|
+
const atMs = Date.parse(at);
|
|
87
|
+
return Number.isFinite(atMs) && nowMs - atMs <= window;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Every recent cycler that is not the manager's own tmux session, newest
|
|
93
|
+
* first, for `status` `manager.otherCyclers`. An unresolved in-tmux cycle is
|
|
94
|
+
* left out: it may be the manager's own cycle on a failed probe.
|
|
95
|
+
* @param {{ cyclers?: Record<string, string> }} ledger - Ledger
|
|
96
|
+
* @param {{ name: string, interval?: string }} config - sessionManager block
|
|
97
|
+
* @param {Date} now - Current time
|
|
98
|
+
* @returns {{by: string, at: string}[]} Other recent cyclers
|
|
99
|
+
*/
|
|
100
|
+
export function otherCyclers(ledger, config, now) {
|
|
101
|
+
const self = `tmux:${config.name}`;
|
|
102
|
+
return recentEntries(ledger.cyclers, now.getTime(), windowMs(config))
|
|
103
|
+
.filter(([by]) => by !== self && !by.startsWith(UNRESOLVED_PREFIX))
|
|
104
|
+
.map(([by, at]) => ({ by, at }))
|
|
105
|
+
.sort((a, b) => Date.parse(b.at) - Date.parse(a.at));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* `cycle`: record that this session ran a cycle now, pruning entries older
|
|
110
|
+
* than twice the interval. The skill runs it at the start of every cycle.
|
|
111
|
+
* @param {object} ctx - CLI context
|
|
112
|
+
* @returns {Promise<{ json: {by: string, at: string} }>} What was recorded
|
|
113
|
+
*/
|
|
114
|
+
export async function cycle(ctx) {
|
|
115
|
+
const config = requireConfig(ctx);
|
|
116
|
+
const by = cyclerIdentity(ctx);
|
|
117
|
+
const json = await updateLedger(ctx.root, { now: ctx.now }, (ledger, at) => {
|
|
118
|
+
const kept = recentEntries(
|
|
119
|
+
ledger.cyclers,
|
|
120
|
+
Date.parse(at),
|
|
121
|
+
windowMs(config)
|
|
122
|
+
);
|
|
123
|
+
const cyclers = { ...Object.fromEntries(kept), [by]: at };
|
|
124
|
+
return { ledger: { ...ledger, cyclers }, result: { by, at } };
|
|
125
|
+
});
|
|
126
|
+
return { json };
|
|
127
|
+
}
|
|
@@ -102,6 +102,9 @@ const FINISH_STATUSES = new Set(["DONE", "FAILED"]);
|
|
|
102
102
|
* @property {Record<string, ValidationFailure>} validationFailures - Backlog
|
|
103
103
|
* items that failed validation, keyed by ref, so an unchanged item is not
|
|
104
104
|
* re-validated every cycle
|
|
105
|
+
* @property {Record<string, string>} cyclers - Who ran a cycle and when
|
|
106
|
+
* (identity to ISO time), pruned to twice the interval (#4809; see
|
|
107
|
+
* cyclers.mjs)
|
|
105
108
|
*/
|
|
106
109
|
|
|
107
110
|
/**
|
|
@@ -149,6 +152,7 @@ function emptyLedger() {
|
|
|
149
152
|
items: {},
|
|
150
153
|
control: { paused: false, maxWorkers: null, me: null },
|
|
151
154
|
validationFailures: {},
|
|
155
|
+
cyclers: {},
|
|
152
156
|
};
|
|
153
157
|
}
|
|
154
158
|
|
|
@@ -190,6 +194,7 @@ export async function readLedger(projectRoot, seams) {
|
|
|
190
194
|
items: parsed.items ?? {},
|
|
191
195
|
control: { ...empty.control, ...parsed.control },
|
|
192
196
|
validationFailures: parsed.validationFailures ?? {},
|
|
197
|
+
cyclers: parsed.cyclers ?? {},
|
|
193
198
|
};
|
|
194
199
|
}
|
|
195
200
|
|
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
route,
|
|
48
48
|
} from "./cli-cycle.mjs";
|
|
49
49
|
import { answer, itemAnswer, markPlan } from "./cli-human.mjs";
|
|
50
|
+
import { cycle } from "./cyclers.mjs";
|
|
50
51
|
import { overruledPlan } from "./cli-overruled.mjs";
|
|
51
52
|
import { repoDir, start, status, stop, validate } from "./cli-manager.mjs";
|
|
52
53
|
import { queue } from "./cli-queue.mjs";
|
|
@@ -71,6 +72,7 @@ const COMMANDS = {
|
|
|
71
72
|
resume: { run: resume, options: {}, positionals: 1 },
|
|
72
73
|
classify: { run: classify, options: {}, positionals: 1 },
|
|
73
74
|
status: { run: status, options: {}, positionals: 0 },
|
|
75
|
+
cycle: { run: cycle, options: {}, positionals: 0 },
|
|
74
76
|
start: { run: start, options: { "settle-ms": text }, positionals: 0 },
|
|
75
77
|
stop: { run: stop, options: {}, positionals: 0 },
|
|
76
78
|
"store-token": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.107.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.107.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.107.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.107.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.107.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.107.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.107.0",
|
|
4
4
|
"description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cody Swann"
|