@codyswann/lisa 8.10.6 → 8.10.7
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/dist/core/nightly-e2e-guard-behavior-certificate.js +2 -2
- package/dist/core/upstream-evidence-manifest.json +19 -5
- package/package.json +4 -4
- 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-secrets-access/scripts/task-action.mjs +10 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-manager-session.mjs +177 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/task-unbound.mjs +2 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/launch.mjs +5 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/workers.mjs +5 -1
- package/plugins/lisa/skills/lisa-secrets-access/scripts/task-action.mjs +10 -0
- package/plugins/lisa/skills/lisa-secrets-access/scripts/task-manager-session.mjs +177 -0
- package/plugins/lisa/skills/lisa-secrets-access/scripts/task-unbound.mjs +2 -2
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +5 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/launch.mjs +5 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/workers.mjs +5 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-action.mjs +10 -0
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-manager-session.mjs +177 -0
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/task-unbound.mjs +2 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +5 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/launch.mjs +5 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/workers.mjs +5 -1
- 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-secrets-access/scripts/task-action.mjs +10 -0
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-manager-session.mjs +177 -0
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/task-unbound.mjs +2 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +5 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/launch.mjs +5 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/workers.mjs +5 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-action.mjs +10 -0
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-manager-session.mjs +177 -0
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/task-unbound.mjs +2 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +5 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/launch.mjs +5 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/workers.mjs +5 -1
- 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-secrets-access/scripts/task-action.mjs +10 -0
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-manager-session.mjs +177 -0
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/task-unbound.mjs +2 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +5 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/launch.mjs +5 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/workers.mjs +5 -1
- 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-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-secrets-access/scripts/task-action.mjs +10 -0
- package/plugins/src/base/skills/lisa-secrets-access/scripts/task-manager-session.mjs +177 -0
- package/plugins/src/base/skills/lisa-secrets-access/scripts/task-unbound.mjs +2 -2
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +5 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/launch.mjs +5 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/workers.mjs +5 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session manager in a Lisa-managed project (CodySwannGT/lisa#5211).
|
|
3
|
+
*
|
|
4
|
+
* The readiness gate refuses project work from a session with no ticket
|
|
5
|
+
* bound. The session manager binds no ticket by design: it hands tickets to
|
|
6
|
+
* workers, and each worker binds its own. Its work is operational: reading
|
|
7
|
+
* the queue, spawning workers, writing its ledger. So two things are
|
|
8
|
+
* admitted here with no ticket bound.
|
|
9
|
+
*
|
|
10
|
+
* - The manager's own session. `start` marks it at launch with
|
|
11
|
+
* `LISA_SESSION_MANAGER=<name>`. Hooks inherit the Claude process's
|
|
12
|
+
* environment, which a Bash `export` inside the session cannot change, and
|
|
13
|
+
* workers are spawned without the mark. The mark must equal the project's
|
|
14
|
+
* configured `sessionManager.name`. The session may do anything except edit
|
|
15
|
+
* project files: a file-edit tool aimed inside the repository is admitted
|
|
16
|
+
* only under `.lisa/`, where the manager keeps its state.
|
|
17
|
+
* - The operator's exact `start`, `stop`, `status` and `validate` commands,
|
|
18
|
+
* from any session, so an operator can run and check on the manager.
|
|
19
|
+
*
|
|
20
|
+
* Nothing here imports the session-manager skill, which is not shipped to
|
|
21
|
+
* every agent: a missing import would fail the whole gate closed.
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
24
|
+
import { dirname, join, resolve, sep } from "node:path";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
|
+
import {
|
|
27
|
+
outsideEveryRepository,
|
|
28
|
+
realLocation,
|
|
29
|
+
writeTargets,
|
|
30
|
+
} from "./task-unbound.mjs";
|
|
31
|
+
|
|
32
|
+
/** This install's session-manager CLI, beside this skill. */
|
|
33
|
+
export const MANAGER_CLI = join(
|
|
34
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
35
|
+
"..",
|
|
36
|
+
"..",
|
|
37
|
+
"lisa-session-manager",
|
|
38
|
+
"scripts",
|
|
39
|
+
"session-manager.mjs"
|
|
40
|
+
);
|
|
41
|
+
const OPERATOR = ["start", "stop", "status", "validate"];
|
|
42
|
+
const EDIT_TOOLS = new Set([
|
|
43
|
+
"Write",
|
|
44
|
+
"Edit",
|
|
45
|
+
"MultiEdit",
|
|
46
|
+
"NotebookEdit",
|
|
47
|
+
"apply_patch",
|
|
48
|
+
"write",
|
|
49
|
+
"edit",
|
|
50
|
+
]);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* One parsed config file, or undefined when absent or unreadable.
|
|
54
|
+
* @param {string} path File path.
|
|
55
|
+
* @returns {Record<string, any>|undefined} Parsed object.
|
|
56
|
+
*/
|
|
57
|
+
function readJson(path) {
|
|
58
|
+
try {
|
|
59
|
+
const value = JSON.parse(readFileSync(path, "utf8"));
|
|
60
|
+
return value && typeof value === "object" ? value : undefined;
|
|
61
|
+
} catch {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The project's configured manager name, local config over committed.
|
|
68
|
+
* @param {string} root Project root.
|
|
69
|
+
* @returns {string|null} The name, or null when none is configured.
|
|
70
|
+
*/
|
|
71
|
+
export function managerName(root) {
|
|
72
|
+
const name = [".lisa.config.local.json", ".lisa.config.json"]
|
|
73
|
+
.map(file => readJson(join(root, file))?.sessionManager?.name)
|
|
74
|
+
.find(value => value !== undefined);
|
|
75
|
+
return typeof name === "string" && name !== "" ? name : null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Whether a resolved path is inside the project's `.lisa/` folder.
|
|
80
|
+
* @param {string} target Absolute path the tool names.
|
|
81
|
+
* @param {string} root Project root.
|
|
82
|
+
* @returns {boolean} True for a path under `.lisa/`.
|
|
83
|
+
*/
|
|
84
|
+
function underLisaFolder(target, root) {
|
|
85
|
+
const location = realLocation(resolve(target));
|
|
86
|
+
let lisa;
|
|
87
|
+
try {
|
|
88
|
+
lisa = join(realpathSync(root), ".lisa");
|
|
89
|
+
} catch {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return Boolean(location?.startsWith(lisa + sep));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Whether this event comes from the project's marked manager session, and
|
|
97
|
+
* is not an edit to a project file.
|
|
98
|
+
* @param {Record<string, any>} input Hook event.
|
|
99
|
+
* @param {{projectRoot: string}} cfg Task configuration.
|
|
100
|
+
* @param {Record<string, string|undefined>} [env] Session environment.
|
|
101
|
+
* @returns {boolean} True to admit it.
|
|
102
|
+
*/
|
|
103
|
+
export function managerSession(input, cfg, env = process.env) {
|
|
104
|
+
const mark = env.LISA_SESSION_MANAGER;
|
|
105
|
+
if (!mark || mark !== managerName(cfg.projectRoot)) return false;
|
|
106
|
+
if (!EDIT_TOOLS.has(input?.tool_name)) return true;
|
|
107
|
+
const targets = writeTargets(input);
|
|
108
|
+
return (
|
|
109
|
+
targets !== null &&
|
|
110
|
+
targets.every(
|
|
111
|
+
target =>
|
|
112
|
+
outsideEveryRepository(target, cfg.projectRoot) ||
|
|
113
|
+
underLisaFolder(target, cfg.projectRoot)
|
|
114
|
+
)
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A path as the one shell word that names it.
|
|
120
|
+
* @param {string} path Absolute path.
|
|
121
|
+
* @returns {string[]} The plain form when the shell reads it as one word,
|
|
122
|
+
* and always the single-quoted form.
|
|
123
|
+
*/
|
|
124
|
+
function words(path) {
|
|
125
|
+
const quoted = `'${path.replaceAll("'", "'\\''")}'`;
|
|
126
|
+
return /^[\w./@+-]+$/u.test(path) ? [path, quoted] : [quoted];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The exact operator commands for this project, as the agent should type them.
|
|
131
|
+
* @param {string} root Project root.
|
|
132
|
+
* @returns {string[]} Admitted command texts; empty when the CLI is absent.
|
|
133
|
+
*/
|
|
134
|
+
export function operatorCommands(root) {
|
|
135
|
+
if (!existsSync(MANAGER_CLI)) return [];
|
|
136
|
+
let real;
|
|
137
|
+
try {
|
|
138
|
+
real = realpathSync(root);
|
|
139
|
+
} catch {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
return words(MANAGER_CLI).flatMap(cli =>
|
|
143
|
+
OPERATOR.flatMap(verb =>
|
|
144
|
+
words(real).map(dir => `node ${cli} ${verb} --project-root ${dir}`)
|
|
145
|
+
)
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Whether a shell command is exactly one of the operator commands.
|
|
151
|
+
* @param {Record<string, any>} input Hook event.
|
|
152
|
+
* @param {{projectRoot: string}} cfg Task configuration.
|
|
153
|
+
* @returns {boolean} True to admit it.
|
|
154
|
+
*/
|
|
155
|
+
export function operatorCommand(input, cfg) {
|
|
156
|
+
if (input?.tool_name !== "Bash") return false;
|
|
157
|
+
const command = input.tool_input?.command;
|
|
158
|
+
return (
|
|
159
|
+
typeof command === "string" &&
|
|
160
|
+
operatorCommands(cfg.projectRoot).includes(command)
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The sentence an unbound refusal adds, naming the operator commands.
|
|
166
|
+
* @param {{projectRoot: string}} cfg Task configuration.
|
|
167
|
+
* @returns {string} The sentence, or "" when the CLI is absent.
|
|
168
|
+
*/
|
|
169
|
+
export function operatorHint(cfg) {
|
|
170
|
+
const [first] = operatorCommands(cfg.projectRoot);
|
|
171
|
+
if (!first) return "";
|
|
172
|
+
const shape = first.replace(
|
|
173
|
+
" start --project-root ",
|
|
174
|
+
" <start|stop|status|validate> --project-root "
|
|
175
|
+
);
|
|
176
|
+
return `To start, stop or check on the session manager, which needs no ticket, run exactly: ${shape}.`;
|
|
177
|
+
}
|
|
@@ -30,7 +30,7 @@ const PATCH_TARGET =
|
|
|
30
30
|
* @param {string} target Absolute path.
|
|
31
31
|
* @returns {string|null} Resolved location, or null when unresolvable.
|
|
32
32
|
*/
|
|
33
|
-
function realLocation(target) {
|
|
33
|
+
export function realLocation(target) {
|
|
34
34
|
let existing = target;
|
|
35
35
|
while (!existsSync(existing)) {
|
|
36
36
|
// A link whose target is missing exists as an entry: writing through it
|
|
@@ -115,7 +115,7 @@ export function outsideEveryRepository(target, projectRoot) {
|
|
|
115
115
|
* @param {Record<string, any>} input Hook event.
|
|
116
116
|
* @returns {string[]|null} Target paths.
|
|
117
117
|
*/
|
|
118
|
-
function writeTargets(input) {
|
|
118
|
+
export function writeTargets(input) {
|
|
119
119
|
const args = input?.tool_input;
|
|
120
120
|
if (!args || typeof args !== "object") return null;
|
|
121
121
|
if (FILE_TOOLS.has(input.tool_name)) {
|
|
@@ -58,6 +58,11 @@ the manager.
|
|
|
58
58
|
- **Project root.** `$ROOT` is the absolute directory the manager was started in, the one whose
|
|
59
59
|
`.lisa.config.json` holds `sessionManager`. Pass `--project-root "$ROOT"` on **every** CLI call, so
|
|
60
60
|
a stray `cd` can never send a ledger write into a child repo.
|
|
61
|
+
- **No ticket.** The manager binds no ticket; workers do. The readiness gate admits this session
|
|
62
|
+
because `start` launched it with `LISA_SESSION_MANAGER` set to its name, which workers never
|
|
63
|
+
inherit. It still may not edit project files outside `.lisa/`. From a session with no ticket
|
|
64
|
+
bound, an operator runs `start`, `stop`, `status` and `validate` by the exact absolute command
|
|
65
|
+
the gate's `work-item-unbound` refusal names (CodySwannGT/lisa#5211).
|
|
61
66
|
- **Lifecycle roles.** Never hard-code a state or label name. Resolve each role you touch (`ready`,
|
|
62
67
|
`claimed`, `blocked`) from config:
|
|
63
68
|
`node "$SM/../../../scripts/resolve-lifecycle-role.mjs" --role <role> --vendor <tracker> --intent <read|write>`.
|
|
@@ -164,6 +164,11 @@ export function buildManagerLaunch({
|
|
|
164
164
|
...(telegram ? ["-e", `TELEGRAM_STATE_DIR=${stateDir}`] : []),
|
|
165
165
|
"-e",
|
|
166
166
|
`SM_SCRIPTS_DIR=${scriptsDir}`,
|
|
167
|
+
// Marks this session as the manager, which binds no ticket: the readiness
|
|
168
|
+
// gate lets it do operational work (#5211). A Bash export cannot set it,
|
|
169
|
+
// and scrubWorkerEnv keeps it from every worker.
|
|
170
|
+
"-e",
|
|
171
|
+
`LISA_SESSION_MANAGER=${name}`,
|
|
167
172
|
"claude",
|
|
168
173
|
"-n",
|
|
169
174
|
name,
|
|
@@ -268,7 +268,11 @@ export function findLiveWorker(agents, ref) {
|
|
|
268
268
|
*/
|
|
269
269
|
export function scrubWorkerEnv(env) {
|
|
270
270
|
return Object.fromEntries(
|
|
271
|
-
Object.entries(env).filter(
|
|
271
|
+
Object.entries(env).filter(
|
|
272
|
+
// The manager mark (#5211) admits operational work with no ticket bound;
|
|
273
|
+
// a worker binds its own ticket and must stay gated.
|
|
274
|
+
([key]) => !key.startsWith("TELEGRAM_") && key !== "LISA_SESSION_MANAGER"
|
|
275
|
+
)
|
|
272
276
|
);
|
|
273
277
|
}
|
|
274
278
|
|