@codyswann/lisa 2.322.1 → 2.322.3
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/upstream-evidence-manifest.d.ts.map +1 -1
- package/dist/core/upstream-evidence-manifest.js +4 -3
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/package.json +1 -1
- 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-setup-automations/scripts/generate-workflow.mjs +50 -4
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +20 -9
- package/plugins/lisa/skills/lisa-setup-automations/scripts/generate-workflow.mjs +50 -4
- package/plugins/lisa/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +20 -9
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-setup-automations/scripts/generate-workflow.mjs +50 -4
- package/plugins/lisa-agy/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +20 -9
- 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-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/skills/lisa-setup-automations/scripts/generate-workflow.mjs +50 -4
- package/plugins/lisa-copilot/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +20 -9
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-setup-automations/scripts/generate-workflow.mjs +50 -4
- package/plugins/lisa-cursor/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +20 -9
- 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-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-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-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-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-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-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-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/src/base/skills/lisa-setup-automations/scripts/generate-workflow.mjs +50 -4
- package/plugins/src/base/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs +20 -9
- package/scripts/lisa-remote-env/setup.sh +74 -5
package/package.json
CHANGED
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"brace-expansion": ">=5.0.9"
|
|
116
116
|
},
|
|
117
117
|
"name": "@codyswann/lisa",
|
|
118
|
-
"version": "2.322.
|
|
118
|
+
"version": "2.322.3",
|
|
119
119
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
120
120
|
"main": "dist/index.js",
|
|
121
121
|
"exports": {
|
package/plugins/lisa/.codex-plugin/skills/lisa-setup-automations/scripts/generate-workflow.mjs
CHANGED
|
@@ -62,6 +62,51 @@ export function readAutomation(name, cwd = process.cwd()) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Emit shell that locates a Lisa skill script before running it.
|
|
67
|
+
*
|
|
68
|
+
* A hardcoded `.claude/skills/...` path is wrong in exactly the place this
|
|
69
|
+
* workflow runs. Claude and Codex receive Lisa skills as an installed plugin
|
|
70
|
+
* living in the user's home directory, which is emphatically not part of a
|
|
71
|
+
* clone — and a scheduled run is always a fresh clone with no plugin install.
|
|
72
|
+
* So the one path that reliably exists on a runner is the npm package, at the
|
|
73
|
+
* version the project pins, which is the version its automation should run.
|
|
74
|
+
*
|
|
75
|
+
* The same candidate list the remote-env entrypoint uses, for the same reason:
|
|
76
|
+
* the in-checkout copies are cheapest and need nothing installed, and
|
|
77
|
+
* `node_modules` is the fallback that makes the plugin-delivered harnesses work
|
|
78
|
+
* at all.
|
|
79
|
+
* @param {string} skill Skill slug that owns the script.
|
|
80
|
+
* @param {string} script Script filename.
|
|
81
|
+
* @param {string[]} args Arguments appended to the invocation, one per line.
|
|
82
|
+
* @returns {string} Shell, indented for a workflow `run:` block.
|
|
83
|
+
*/
|
|
84
|
+
function runSkillScript(skill, script, args) {
|
|
85
|
+
const candidates = [
|
|
86
|
+
`.claude/skills/${skill}/scripts/${script}`,
|
|
87
|
+
`.agents/skills/${skill}/scripts/${script}`,
|
|
88
|
+
`.codex/skills/${skill}/scripts/${script}`,
|
|
89
|
+
`node_modules/@codyswann/lisa/plugins/lisa/skills/${skill}/scripts/${script}`,
|
|
90
|
+
]
|
|
91
|
+
.map(candidate => ` "${candidate}"`)
|
|
92
|
+
.join(" \\\n");
|
|
93
|
+
const tail = args.map(arg => ` ${arg}`).join(" \\\n");
|
|
94
|
+
return ` runner=""
|
|
95
|
+
for candidate in \\
|
|
96
|
+
${candidates}; do
|
|
97
|
+
if [ -f "$candidate" ]; then runner="$candidate"; break; fi
|
|
98
|
+
done
|
|
99
|
+
if [ -z "$runner" ]; then
|
|
100
|
+
echo "cannot find ${skill}/scripts/${script}" >&2
|
|
101
|
+
echo "Checked the agent skill directories and node_modules." >&2
|
|
102
|
+
echo "Lisa skills reach Claude and Codex as an installed plugin," >&2
|
|
103
|
+
echo "so node_modules is the only copy a runner ever has." >&2
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
node "$runner" \\
|
|
107
|
+
${tail}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
65
110
|
/**
|
|
66
111
|
* Render the workflow YAML for one loop.
|
|
67
112
|
*
|
|
@@ -112,7 +157,7 @@ export function renderWorkflow(name, loop) {
|
|
|
112
157
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
113
158
|
run: |
|
|
114
159
|
set -euo pipefail
|
|
115
|
-
|
|
160
|
+
${runSkillScript("lisa-secrets-access", "rotate-secret.mjs", ["leases"])}`;
|
|
116
161
|
|
|
117
162
|
const trigger = loop.enabled
|
|
118
163
|
? ` schedule:\n - cron: '${loop.schedule}'\n workflow_dispatch:`
|
|
@@ -172,9 +217,10 @@ jobs:
|
|
|
172
217
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
173
218
|
run: |
|
|
174
219
|
set -euo pipefail
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
220
|
+
${runSkillScript("lisa-remote-dispatch", "dispatch.mjs", [
|
|
221
|
+
`'executionEnv=${loop.executionEnv} ${loop.payload ?? ""}'`,
|
|
222
|
+
`--skill ${loop.skill ?? `lisa-${name}`}`,
|
|
223
|
+
])}
|
|
178
224
|
|
|
179
225
|
${rotation}
|
|
180
226
|
`;
|
package/plugins/lisa/.codex-plugin/skills/lisa-setup-remote-env/scripts/setup-remote-env.mjs
CHANGED
|
@@ -299,18 +299,29 @@ export function installAssets(cwd = process.cwd()) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
|
-
* The setup field, identical for every project.
|
|
302
|
+
* The setup field, identical for every project and every surface.
|
|
303
303
|
*
|
|
304
|
-
* Names neither the repository nor its package manager
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
304
|
+
* Names neither the repository nor its package manager, and deliberately not
|
|
305
|
+
* `$HOME` either: the surfaces disagree about where the field runs. Codex Cloud
|
|
306
|
+
* runs it inside the checkout, Claude Code web runs it from `$HOME` with the
|
|
307
|
+
* checkout one level down, and on Codex Cloud the checkout is not under `$HOME`
|
|
308
|
+
* at all — so a `$HOME` glob matched nothing there and bash was handed a path
|
|
309
|
+
* still containing a literal asterisk.
|
|
308
310
|
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
311
|
+
* Both candidates are therefore tried relative to cwd. `exec` on the first hit
|
|
312
|
+
* avoids a subshell and avoids parsing `ls`; the explicit `exit 1` means a
|
|
313
|
+
* missing entrypoint says so rather than the field quietly succeeding. The
|
|
314
|
+
* script then anchors itself on the repository root and installs dependencies
|
|
315
|
+
* from whichever lockfile the project commits.
|
|
316
|
+
*
|
|
317
|
+
* A field that named the repository and package manager was a string a human
|
|
318
|
+
* had to get right, in a settings box with no review, no version history and no
|
|
319
|
+
* test — and the logic it encoded belongs in a file that has all three.
|
|
312
320
|
*/
|
|
313
|
-
const SETUP_FIELD =
|
|
321
|
+
export const SETUP_FIELD =
|
|
322
|
+
"for f in scripts/lisa-remote-env/setup.sh */scripts/lisa-remote-env/setup.sh; " +
|
|
323
|
+
'do [ -f "$f" ] && exec bash "$f"; done; ' +
|
|
324
|
+
'echo "lisa-remote-env entrypoint not found under $PWD" >&2; exit 1';
|
|
314
325
|
|
|
315
326
|
/**
|
|
316
327
|
* The settings block that wires the session-start hook into a repository.
|
|
@@ -62,6 +62,51 @@ export function readAutomation(name, cwd = process.cwd()) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Emit shell that locates a Lisa skill script before running it.
|
|
67
|
+
*
|
|
68
|
+
* A hardcoded `.claude/skills/...` path is wrong in exactly the place this
|
|
69
|
+
* workflow runs. Claude and Codex receive Lisa skills as an installed plugin
|
|
70
|
+
* living in the user's home directory, which is emphatically not part of a
|
|
71
|
+
* clone — and a scheduled run is always a fresh clone with no plugin install.
|
|
72
|
+
* So the one path that reliably exists on a runner is the npm package, at the
|
|
73
|
+
* version the project pins, which is the version its automation should run.
|
|
74
|
+
*
|
|
75
|
+
* The same candidate list the remote-env entrypoint uses, for the same reason:
|
|
76
|
+
* the in-checkout copies are cheapest and need nothing installed, and
|
|
77
|
+
* `node_modules` is the fallback that makes the plugin-delivered harnesses work
|
|
78
|
+
* at all.
|
|
79
|
+
* @param {string} skill Skill slug that owns the script.
|
|
80
|
+
* @param {string} script Script filename.
|
|
81
|
+
* @param {string[]} args Arguments appended to the invocation, one per line.
|
|
82
|
+
* @returns {string} Shell, indented for a workflow `run:` block.
|
|
83
|
+
*/
|
|
84
|
+
function runSkillScript(skill, script, args) {
|
|
85
|
+
const candidates = [
|
|
86
|
+
`.claude/skills/${skill}/scripts/${script}`,
|
|
87
|
+
`.agents/skills/${skill}/scripts/${script}`,
|
|
88
|
+
`.codex/skills/${skill}/scripts/${script}`,
|
|
89
|
+
`node_modules/@codyswann/lisa/plugins/lisa/skills/${skill}/scripts/${script}`,
|
|
90
|
+
]
|
|
91
|
+
.map(candidate => ` "${candidate}"`)
|
|
92
|
+
.join(" \\\n");
|
|
93
|
+
const tail = args.map(arg => ` ${arg}`).join(" \\\n");
|
|
94
|
+
return ` runner=""
|
|
95
|
+
for candidate in \\
|
|
96
|
+
${candidates}; do
|
|
97
|
+
if [ -f "$candidate" ]; then runner="$candidate"; break; fi
|
|
98
|
+
done
|
|
99
|
+
if [ -z "$runner" ]; then
|
|
100
|
+
echo "cannot find ${skill}/scripts/${script}" >&2
|
|
101
|
+
echo "Checked the agent skill directories and node_modules." >&2
|
|
102
|
+
echo "Lisa skills reach Claude and Codex as an installed plugin," >&2
|
|
103
|
+
echo "so node_modules is the only copy a runner ever has." >&2
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
node "$runner" \\
|
|
107
|
+
${tail}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
65
110
|
/**
|
|
66
111
|
* Render the workflow YAML for one loop.
|
|
67
112
|
*
|
|
@@ -112,7 +157,7 @@ export function renderWorkflow(name, loop) {
|
|
|
112
157
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
113
158
|
run: |
|
|
114
159
|
set -euo pipefail
|
|
115
|
-
|
|
160
|
+
${runSkillScript("lisa-secrets-access", "rotate-secret.mjs", ["leases"])}`;
|
|
116
161
|
|
|
117
162
|
const trigger = loop.enabled
|
|
118
163
|
? ` schedule:\n - cron: '${loop.schedule}'\n workflow_dispatch:`
|
|
@@ -172,9 +217,10 @@ jobs:
|
|
|
172
217
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
173
218
|
run: |
|
|
174
219
|
set -euo pipefail
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
220
|
+
${runSkillScript("lisa-remote-dispatch", "dispatch.mjs", [
|
|
221
|
+
`'executionEnv=${loop.executionEnv} ${loop.payload ?? ""}'`,
|
|
222
|
+
`--skill ${loop.skill ?? `lisa-${name}`}`,
|
|
223
|
+
])}
|
|
178
224
|
|
|
179
225
|
${rotation}
|
|
180
226
|
`;
|
|
@@ -299,18 +299,29 @@ export function installAssets(cwd = process.cwd()) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
|
-
* The setup field, identical for every project.
|
|
302
|
+
* The setup field, identical for every project and every surface.
|
|
303
303
|
*
|
|
304
|
-
* Names neither the repository nor its package manager
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
304
|
+
* Names neither the repository nor its package manager, and deliberately not
|
|
305
|
+
* `$HOME` either: the surfaces disagree about where the field runs. Codex Cloud
|
|
306
|
+
* runs it inside the checkout, Claude Code web runs it from `$HOME` with the
|
|
307
|
+
* checkout one level down, and on Codex Cloud the checkout is not under `$HOME`
|
|
308
|
+
* at all — so a `$HOME` glob matched nothing there and bash was handed a path
|
|
309
|
+
* still containing a literal asterisk.
|
|
308
310
|
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
311
|
+
* Both candidates are therefore tried relative to cwd. `exec` on the first hit
|
|
312
|
+
* avoids a subshell and avoids parsing `ls`; the explicit `exit 1` means a
|
|
313
|
+
* missing entrypoint says so rather than the field quietly succeeding. The
|
|
314
|
+
* script then anchors itself on the repository root and installs dependencies
|
|
315
|
+
* from whichever lockfile the project commits.
|
|
316
|
+
*
|
|
317
|
+
* A field that named the repository and package manager was a string a human
|
|
318
|
+
* had to get right, in a settings box with no review, no version history and no
|
|
319
|
+
* test — and the logic it encoded belongs in a file that has all three.
|
|
312
320
|
*/
|
|
313
|
-
const SETUP_FIELD =
|
|
321
|
+
export const SETUP_FIELD =
|
|
322
|
+
"for f in scripts/lisa-remote-env/setup.sh */scripts/lisa-remote-env/setup.sh; " +
|
|
323
|
+
'do [ -f "$f" ] && exec bash "$f"; done; ' +
|
|
324
|
+
'echo "lisa-remote-env entrypoint not found under $PWD" >&2; exit 1';
|
|
314
325
|
|
|
315
326
|
/**
|
|
316
327
|
* The settings block that wires the session-start hook into a repository.
|
|
@@ -62,6 +62,51 @@ export function readAutomation(name, cwd = process.cwd()) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Emit shell that locates a Lisa skill script before running it.
|
|
67
|
+
*
|
|
68
|
+
* A hardcoded `.claude/skills/...` path is wrong in exactly the place this
|
|
69
|
+
* workflow runs. Claude and Codex receive Lisa skills as an installed plugin
|
|
70
|
+
* living in the user's home directory, which is emphatically not part of a
|
|
71
|
+
* clone — and a scheduled run is always a fresh clone with no plugin install.
|
|
72
|
+
* So the one path that reliably exists on a runner is the npm package, at the
|
|
73
|
+
* version the project pins, which is the version its automation should run.
|
|
74
|
+
*
|
|
75
|
+
* The same candidate list the remote-env entrypoint uses, for the same reason:
|
|
76
|
+
* the in-checkout copies are cheapest and need nothing installed, and
|
|
77
|
+
* `node_modules` is the fallback that makes the plugin-delivered harnesses work
|
|
78
|
+
* at all.
|
|
79
|
+
* @param {string} skill Skill slug that owns the script.
|
|
80
|
+
* @param {string} script Script filename.
|
|
81
|
+
* @param {string[]} args Arguments appended to the invocation, one per line.
|
|
82
|
+
* @returns {string} Shell, indented for a workflow `run:` block.
|
|
83
|
+
*/
|
|
84
|
+
function runSkillScript(skill, script, args) {
|
|
85
|
+
const candidates = [
|
|
86
|
+
`.claude/skills/${skill}/scripts/${script}`,
|
|
87
|
+
`.agents/skills/${skill}/scripts/${script}`,
|
|
88
|
+
`.codex/skills/${skill}/scripts/${script}`,
|
|
89
|
+
`node_modules/@codyswann/lisa/plugins/lisa/skills/${skill}/scripts/${script}`,
|
|
90
|
+
]
|
|
91
|
+
.map(candidate => ` "${candidate}"`)
|
|
92
|
+
.join(" \\\n");
|
|
93
|
+
const tail = args.map(arg => ` ${arg}`).join(" \\\n");
|
|
94
|
+
return ` runner=""
|
|
95
|
+
for candidate in \\
|
|
96
|
+
${candidates}; do
|
|
97
|
+
if [ -f "$candidate" ]; then runner="$candidate"; break; fi
|
|
98
|
+
done
|
|
99
|
+
if [ -z "$runner" ]; then
|
|
100
|
+
echo "cannot find ${skill}/scripts/${script}" >&2
|
|
101
|
+
echo "Checked the agent skill directories and node_modules." >&2
|
|
102
|
+
echo "Lisa skills reach Claude and Codex as an installed plugin," >&2
|
|
103
|
+
echo "so node_modules is the only copy a runner ever has." >&2
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
node "$runner" \\
|
|
107
|
+
${tail}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
65
110
|
/**
|
|
66
111
|
* Render the workflow YAML for one loop.
|
|
67
112
|
*
|
|
@@ -112,7 +157,7 @@ export function renderWorkflow(name, loop) {
|
|
|
112
157
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
113
158
|
run: |
|
|
114
159
|
set -euo pipefail
|
|
115
|
-
|
|
160
|
+
${runSkillScript("lisa-secrets-access", "rotate-secret.mjs", ["leases"])}`;
|
|
116
161
|
|
|
117
162
|
const trigger = loop.enabled
|
|
118
163
|
? ` schedule:\n - cron: '${loop.schedule}'\n workflow_dispatch:`
|
|
@@ -172,9 +217,10 @@ jobs:
|
|
|
172
217
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
173
218
|
run: |
|
|
174
219
|
set -euo pipefail
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
220
|
+
${runSkillScript("lisa-remote-dispatch", "dispatch.mjs", [
|
|
221
|
+
`'executionEnv=${loop.executionEnv} ${loop.payload ?? ""}'`,
|
|
222
|
+
`--skill ${loop.skill ?? `lisa-${name}`}`,
|
|
223
|
+
])}
|
|
178
224
|
|
|
179
225
|
${rotation}
|
|
180
226
|
`;
|
|
@@ -299,18 +299,29 @@ export function installAssets(cwd = process.cwd()) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
|
-
* The setup field, identical for every project.
|
|
302
|
+
* The setup field, identical for every project and every surface.
|
|
303
303
|
*
|
|
304
|
-
* Names neither the repository nor its package manager
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
304
|
+
* Names neither the repository nor its package manager, and deliberately not
|
|
305
|
+
* `$HOME` either: the surfaces disagree about where the field runs. Codex Cloud
|
|
306
|
+
* runs it inside the checkout, Claude Code web runs it from `$HOME` with the
|
|
307
|
+
* checkout one level down, and on Codex Cloud the checkout is not under `$HOME`
|
|
308
|
+
* at all — so a `$HOME` glob matched nothing there and bash was handed a path
|
|
309
|
+
* still containing a literal asterisk.
|
|
308
310
|
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
311
|
+
* Both candidates are therefore tried relative to cwd. `exec` on the first hit
|
|
312
|
+
* avoids a subshell and avoids parsing `ls`; the explicit `exit 1` means a
|
|
313
|
+
* missing entrypoint says so rather than the field quietly succeeding. The
|
|
314
|
+
* script then anchors itself on the repository root and installs dependencies
|
|
315
|
+
* from whichever lockfile the project commits.
|
|
316
|
+
*
|
|
317
|
+
* A field that named the repository and package manager was a string a human
|
|
318
|
+
* had to get right, in a settings box with no review, no version history and no
|
|
319
|
+
* test — and the logic it encoded belongs in a file that has all three.
|
|
312
320
|
*/
|
|
313
|
-
const SETUP_FIELD =
|
|
321
|
+
export const SETUP_FIELD =
|
|
322
|
+
"for f in scripts/lisa-remote-env/setup.sh */scripts/lisa-remote-env/setup.sh; " +
|
|
323
|
+
'do [ -f "$f" ] && exec bash "$f"; done; ' +
|
|
324
|
+
'echo "lisa-remote-env entrypoint not found under $PWD" >&2; exit 1';
|
|
314
325
|
|
|
315
326
|
/**
|
|
316
327
|
* The settings block that wires the session-start hook into a repository.
|
|
@@ -62,6 +62,51 @@ export function readAutomation(name, cwd = process.cwd()) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Emit shell that locates a Lisa skill script before running it.
|
|
67
|
+
*
|
|
68
|
+
* A hardcoded `.claude/skills/...` path is wrong in exactly the place this
|
|
69
|
+
* workflow runs. Claude and Codex receive Lisa skills as an installed plugin
|
|
70
|
+
* living in the user's home directory, which is emphatically not part of a
|
|
71
|
+
* clone — and a scheduled run is always a fresh clone with no plugin install.
|
|
72
|
+
* So the one path that reliably exists on a runner is the npm package, at the
|
|
73
|
+
* version the project pins, which is the version its automation should run.
|
|
74
|
+
*
|
|
75
|
+
* The same candidate list the remote-env entrypoint uses, for the same reason:
|
|
76
|
+
* the in-checkout copies are cheapest and need nothing installed, and
|
|
77
|
+
* `node_modules` is the fallback that makes the plugin-delivered harnesses work
|
|
78
|
+
* at all.
|
|
79
|
+
* @param {string} skill Skill slug that owns the script.
|
|
80
|
+
* @param {string} script Script filename.
|
|
81
|
+
* @param {string[]} args Arguments appended to the invocation, one per line.
|
|
82
|
+
* @returns {string} Shell, indented for a workflow `run:` block.
|
|
83
|
+
*/
|
|
84
|
+
function runSkillScript(skill, script, args) {
|
|
85
|
+
const candidates = [
|
|
86
|
+
`.claude/skills/${skill}/scripts/${script}`,
|
|
87
|
+
`.agents/skills/${skill}/scripts/${script}`,
|
|
88
|
+
`.codex/skills/${skill}/scripts/${script}`,
|
|
89
|
+
`node_modules/@codyswann/lisa/plugins/lisa/skills/${skill}/scripts/${script}`,
|
|
90
|
+
]
|
|
91
|
+
.map(candidate => ` "${candidate}"`)
|
|
92
|
+
.join(" \\\n");
|
|
93
|
+
const tail = args.map(arg => ` ${arg}`).join(" \\\n");
|
|
94
|
+
return ` runner=""
|
|
95
|
+
for candidate in \\
|
|
96
|
+
${candidates}; do
|
|
97
|
+
if [ -f "$candidate" ]; then runner="$candidate"; break; fi
|
|
98
|
+
done
|
|
99
|
+
if [ -z "$runner" ]; then
|
|
100
|
+
echo "cannot find ${skill}/scripts/${script}" >&2
|
|
101
|
+
echo "Checked the agent skill directories and node_modules." >&2
|
|
102
|
+
echo "Lisa skills reach Claude and Codex as an installed plugin," >&2
|
|
103
|
+
echo "so node_modules is the only copy a runner ever has." >&2
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
node "$runner" \\
|
|
107
|
+
${tail}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
65
110
|
/**
|
|
66
111
|
* Render the workflow YAML for one loop.
|
|
67
112
|
*
|
|
@@ -112,7 +157,7 @@ export function renderWorkflow(name, loop) {
|
|
|
112
157
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
113
158
|
run: |
|
|
114
159
|
set -euo pipefail
|
|
115
|
-
|
|
160
|
+
${runSkillScript("lisa-secrets-access", "rotate-secret.mjs", ["leases"])}`;
|
|
116
161
|
|
|
117
162
|
const trigger = loop.enabled
|
|
118
163
|
? ` schedule:\n - cron: '${loop.schedule}'\n workflow_dispatch:`
|
|
@@ -172,9 +217,10 @@ jobs:
|
|
|
172
217
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
173
218
|
run: |
|
|
174
219
|
set -euo pipefail
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
220
|
+
${runSkillScript("lisa-remote-dispatch", "dispatch.mjs", [
|
|
221
|
+
`'executionEnv=${loop.executionEnv} ${loop.payload ?? ""}'`,
|
|
222
|
+
`--skill ${loop.skill ?? `lisa-${name}`}`,
|
|
223
|
+
])}
|
|
178
224
|
|
|
179
225
|
${rotation}
|
|
180
226
|
`;
|
|
@@ -299,18 +299,29 @@ export function installAssets(cwd = process.cwd()) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
|
-
* The setup field, identical for every project.
|
|
302
|
+
* The setup field, identical for every project and every surface.
|
|
303
303
|
*
|
|
304
|
-
* Names neither the repository nor its package manager
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
304
|
+
* Names neither the repository nor its package manager, and deliberately not
|
|
305
|
+
* `$HOME` either: the surfaces disagree about where the field runs. Codex Cloud
|
|
306
|
+
* runs it inside the checkout, Claude Code web runs it from `$HOME` with the
|
|
307
|
+
* checkout one level down, and on Codex Cloud the checkout is not under `$HOME`
|
|
308
|
+
* at all — so a `$HOME` glob matched nothing there and bash was handed a path
|
|
309
|
+
* still containing a literal asterisk.
|
|
308
310
|
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
311
|
+
* Both candidates are therefore tried relative to cwd. `exec` on the first hit
|
|
312
|
+
* avoids a subshell and avoids parsing `ls`; the explicit `exit 1` means a
|
|
313
|
+
* missing entrypoint says so rather than the field quietly succeeding. The
|
|
314
|
+
* script then anchors itself on the repository root and installs dependencies
|
|
315
|
+
* from whichever lockfile the project commits.
|
|
316
|
+
*
|
|
317
|
+
* A field that named the repository and package manager was a string a human
|
|
318
|
+
* had to get right, in a settings box with no review, no version history and no
|
|
319
|
+
* test — and the logic it encoded belongs in a file that has all three.
|
|
312
320
|
*/
|
|
313
|
-
const SETUP_FIELD =
|
|
321
|
+
export const SETUP_FIELD =
|
|
322
|
+
"for f in scripts/lisa-remote-env/setup.sh */scripts/lisa-remote-env/setup.sh; " +
|
|
323
|
+
'do [ -f "$f" ] && exec bash "$f"; done; ' +
|
|
324
|
+
'echo "lisa-remote-env entrypoint not found under $PWD" >&2; exit 1';
|
|
314
325
|
|
|
315
326
|
/**
|
|
316
327
|
* The settings block that wires the session-start hook into a repository.
|
|
@@ -62,6 +62,51 @@ export function readAutomation(name, cwd = process.cwd()) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Emit shell that locates a Lisa skill script before running it.
|
|
67
|
+
*
|
|
68
|
+
* A hardcoded `.claude/skills/...` path is wrong in exactly the place this
|
|
69
|
+
* workflow runs. Claude and Codex receive Lisa skills as an installed plugin
|
|
70
|
+
* living in the user's home directory, which is emphatically not part of a
|
|
71
|
+
* clone — and a scheduled run is always a fresh clone with no plugin install.
|
|
72
|
+
* So the one path that reliably exists on a runner is the npm package, at the
|
|
73
|
+
* version the project pins, which is the version its automation should run.
|
|
74
|
+
*
|
|
75
|
+
* The same candidate list the remote-env entrypoint uses, for the same reason:
|
|
76
|
+
* the in-checkout copies are cheapest and need nothing installed, and
|
|
77
|
+
* `node_modules` is the fallback that makes the plugin-delivered harnesses work
|
|
78
|
+
* at all.
|
|
79
|
+
* @param {string} skill Skill slug that owns the script.
|
|
80
|
+
* @param {string} script Script filename.
|
|
81
|
+
* @param {string[]} args Arguments appended to the invocation, one per line.
|
|
82
|
+
* @returns {string} Shell, indented for a workflow `run:` block.
|
|
83
|
+
*/
|
|
84
|
+
function runSkillScript(skill, script, args) {
|
|
85
|
+
const candidates = [
|
|
86
|
+
`.claude/skills/${skill}/scripts/${script}`,
|
|
87
|
+
`.agents/skills/${skill}/scripts/${script}`,
|
|
88
|
+
`.codex/skills/${skill}/scripts/${script}`,
|
|
89
|
+
`node_modules/@codyswann/lisa/plugins/lisa/skills/${skill}/scripts/${script}`,
|
|
90
|
+
]
|
|
91
|
+
.map(candidate => ` "${candidate}"`)
|
|
92
|
+
.join(" \\\n");
|
|
93
|
+
const tail = args.map(arg => ` ${arg}`).join(" \\\n");
|
|
94
|
+
return ` runner=""
|
|
95
|
+
for candidate in \\
|
|
96
|
+
${candidates}; do
|
|
97
|
+
if [ -f "$candidate" ]; then runner="$candidate"; break; fi
|
|
98
|
+
done
|
|
99
|
+
if [ -z "$runner" ]; then
|
|
100
|
+
echo "cannot find ${skill}/scripts/${script}" >&2
|
|
101
|
+
echo "Checked the agent skill directories and node_modules." >&2
|
|
102
|
+
echo "Lisa skills reach Claude and Codex as an installed plugin," >&2
|
|
103
|
+
echo "so node_modules is the only copy a runner ever has." >&2
|
|
104
|
+
exit 1
|
|
105
|
+
fi
|
|
106
|
+
node "$runner" \\
|
|
107
|
+
${tail}`;
|
|
108
|
+
}
|
|
109
|
+
|
|
65
110
|
/**
|
|
66
111
|
* Render the workflow YAML for one loop.
|
|
67
112
|
*
|
|
@@ -112,7 +157,7 @@ export function renderWorkflow(name, loop) {
|
|
|
112
157
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
113
158
|
run: |
|
|
114
159
|
set -euo pipefail
|
|
115
|
-
|
|
160
|
+
${runSkillScript("lisa-secrets-access", "rotate-secret.mjs", ["leases"])}`;
|
|
116
161
|
|
|
117
162
|
const trigger = loop.enabled
|
|
118
163
|
? ` schedule:\n - cron: '${loop.schedule}'\n workflow_dispatch:`
|
|
@@ -172,9 +217,10 @@ jobs:
|
|
|
172
217
|
${bootstrap}: \${{ secrets.${bootstrap} }}
|
|
173
218
|
run: |
|
|
174
219
|
set -euo pipefail
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
220
|
+
${runSkillScript("lisa-remote-dispatch", "dispatch.mjs", [
|
|
221
|
+
`'executionEnv=${loop.executionEnv} ${loop.payload ?? ""}'`,
|
|
222
|
+
`--skill ${loop.skill ?? `lisa-${name}`}`,
|
|
223
|
+
])}
|
|
178
224
|
|
|
179
225
|
${rotation}
|
|
180
226
|
`;
|