@codyswann/lisa 4.81.2 → 4.81.4
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/lisa.d.ts.map +1 -1
- package/dist/core/lisa.js +3 -0
- package/dist/core/lisa.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 +47 -8
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/strategies/copy-contents.d.ts.map +1 -1
- package/dist/strategies/copy-contents.js +3 -1
- package/dist/strategies/copy-contents.js.map +1 -1
- package/dist/strategies/copy-overwrite.d.ts.map +1 -1
- package/dist/strategies/copy-overwrite.js +3 -0
- package/dist/strategies/copy-overwrite.js.map +1 -1
- package/dist/strategies/create-only.d.ts.map +1 -1
- package/dist/strategies/create-only.js +8 -0
- package/dist/strategies/create-only.js.map +1 -1
- package/dist/strategies/merge.d.ts.map +1 -1
- package/dist/strategies/merge.js +2 -0
- package/dist/strategies/merge.js.map +1 -1
- package/dist/strategies/package-lisa.d.ts.map +1 -1
- package/dist/strategies/package-lisa.js +2 -0
- package/dist/strategies/package-lisa.js.map +1 -1
- package/dist/strategies/strategy.interface.d.ts +12 -1
- package/dist/strategies/strategy.interface.d.ts.map +1 -1
- package/dist/strategies/tagged-merge.d.ts.map +1 -1
- package/dist/strategies/tagged-merge.js +2 -0
- package/dist/strategies/tagged-merge.js.map +1 -1
- package/dist/transaction/backup.d.ts +27 -1
- package/dist/transaction/backup.d.ts.map +1 -1
- package/dist/transaction/backup.js +65 -3
- package/dist/transaction/backup.js.map +1 -1
- package/dist/transaction/created-paths.d.ts +72 -0
- package/dist/transaction/created-paths.d.ts.map +1 -0
- package/dist/transaction/created-paths.js +176 -0
- package/dist/transaction/created-paths.js.map +1 -0
- 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-session-manager/SKILL.md +2 -2
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-manager.mjs +5 -76
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-setup.mjs +165 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +32 -8
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/clipboard.mjs +119 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +18 -36
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/launch.mjs +1 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/repo-detect.mjs +205 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +16 -13
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/setup-checks.mjs +168 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token.mjs +98 -28
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-session-manager/SKILL.md +44 -21
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +2 -2
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-manager.mjs +5 -76
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-setup.mjs +165 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +32 -8
- package/plugins/lisa/skills/lisa-session-manager/scripts/clipboard.mjs +119 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +18 -36
- package/plugins/lisa/skills/lisa-session-manager/scripts/launch.mjs +1 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/repo-detect.mjs +205 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +16 -13
- package/plugins/lisa/skills/lisa-session-manager/scripts/setup-checks.mjs +168 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/token.mjs +98 -28
- package/plugins/lisa/skills/lisa-setup-session-manager/SKILL.md +44 -21
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +2 -2
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-manager.mjs +5 -76
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-setup.mjs +165 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +32 -8
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/clipboard.mjs +119 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +18 -36
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/launch.mjs +1 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/repo-detect.mjs +205 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +16 -13
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/setup-checks.mjs +168 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token.mjs +98 -28
- package/plugins/lisa-agy/skills/lisa-setup-session-manager/SKILL.md +44 -21
- 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 +2 -2
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-manager.mjs +5 -76
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-setup.mjs +165 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +32 -8
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/clipboard.mjs +119 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +18 -36
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/launch.mjs +1 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/repo-detect.mjs +205 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +16 -13
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/setup-checks.mjs +168 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token.mjs +98 -28
- package/plugins/lisa-copilot/skills/lisa-setup-session-manager/SKILL.md +44 -21
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +2 -2
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-manager.mjs +5 -76
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-setup.mjs +165 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +32 -8
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/clipboard.mjs +119 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +18 -36
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/launch.mjs +1 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/repo-detect.mjs +205 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +16 -13
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/setup-checks.mjs +168 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token.mjs +98 -28
- package/plugins/lisa-cursor/skills/lisa-setup-session-manager/SKILL.md +44 -21
- 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 +2 -2
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-manager.mjs +5 -76
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-setup.mjs +165 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +32 -8
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/clipboard.mjs +119 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +18 -36
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/launch.mjs +1 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/repo-detect.mjs +205 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +16 -13
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/setup-checks.mjs +168 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token.mjs +98 -28
- package/plugins/lisa-devin/skills/lisa-setup-session-manager/SKILL.md +44 -21
- 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 +2 -2
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-manager.mjs +5 -76
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-setup.mjs +165 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +32 -8
- package/plugins/src/base/skills/lisa-session-manager/scripts/clipboard.mjs +119 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +18 -36
- package/plugins/src/base/skills/lisa-session-manager/scripts/launch.mjs +1 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/repo-detect.mjs +205 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +16 -13
- package/plugins/src/base/skills/lisa-session-manager/scripts/setup-checks.mjs +168 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/token.mjs +98 -28
- package/plugins/src/base/skills/lisa-setup-session-manager/SKILL.md +44 -21
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The Telegram bot token the manager needs: validated, stored in
|
|
3
3
|
* `<stateDir>/.env` (dir 0700, file 0600), read from the operator's terminal
|
|
4
|
-
* with echo off
|
|
4
|
+
* with echo off or from the clipboard (`--from-clipboard`, for when no TTY is
|
|
5
|
+
* reachable), and never put in argv, a return value, an error message or a
|
|
5
6
|
* log line. An existing token is replaced only on request. Split out of
|
|
6
7
|
* launch.mjs, which re-exports everything here.
|
|
7
8
|
* @module token
|
|
@@ -10,6 +11,7 @@ import { randomUUID } from "node:crypto";
|
|
|
10
11
|
import * as nodeFs from "node:fs";
|
|
11
12
|
import path from "node:path";
|
|
12
13
|
|
|
14
|
+
import { readClipboard } from "./clipboard.mjs";
|
|
13
15
|
import { LaunchError, resolveStateDir } from "./state-dir.mjs";
|
|
14
16
|
|
|
15
17
|
/** The shape of a BotFather token: `<bot id>:<secret>`. */
|
|
@@ -94,41 +96,110 @@ function shellQuote(word) {
|
|
|
94
96
|
* input - Script and project locations, and whether to carry `--replace`
|
|
95
97
|
* @returns {string} One shell line
|
|
96
98
|
*/
|
|
97
|
-
export function buildStoreTokenCommand({
|
|
99
|
+
export function buildStoreTokenCommand({
|
|
100
|
+
scriptsDir,
|
|
101
|
+
projectRoot,
|
|
102
|
+
replace,
|
|
103
|
+
fromClipboard = false,
|
|
104
|
+
}) {
|
|
98
105
|
const script = shellQuote(path.join(scriptsDir, "session-manager.mjs"));
|
|
99
|
-
const
|
|
100
|
-
|
|
106
|
+
const flags =
|
|
107
|
+
(replace ? " --replace" : "") + (fromClipboard ? " --from-clipboard" : "");
|
|
108
|
+
return `node ${script} store-token${flags} --project-root ${shellQuote(projectRoot)}`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Why `store-token` cannot prompt here, and the two ways forward. */
|
|
112
|
+
const NO_TTY_HINT =
|
|
113
|
+
"No terminal to prompt on, and Claude Code's ! prefix has no TTY either. " +
|
|
114
|
+
"Run `command` in a separate terminal app, or copy the token from " +
|
|
115
|
+
"BotFather and run `clipboardCommand`.";
|
|
116
|
+
|
|
117
|
+
/** The `invalid` outcome; names the expected shape, never the input. */
|
|
118
|
+
const INVALID = Object.freeze({
|
|
119
|
+
stored: false,
|
|
120
|
+
reason: "invalid",
|
|
121
|
+
message:
|
|
122
|
+
"That does not look like a Telegram bot token " +
|
|
123
|
+
"(expected <digits>:<30 or more letters, digits, _ or ->).",
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Refuse to overwrite an existing token unless `replace` was asked for: a
|
|
128
|
+
* second project that shares this state dir by mistake would otherwise
|
|
129
|
+
* silently take over the first project's bot.
|
|
130
|
+
* @param {string} stateDir - Resolved state dir
|
|
131
|
+
* @param {boolean} replace - `--replace`
|
|
132
|
+
* @param {{ fs?: { existsSync?: (p: string) => boolean } }} io - Seams
|
|
133
|
+
*/
|
|
134
|
+
function assertReplaceable(stateDir, replace, io) {
|
|
135
|
+
const existing = path.join(stateDir, TOKEN_FILE_NAME);
|
|
136
|
+
const exists = io.fs?.existsSync ?? nodeFs.existsSync;
|
|
137
|
+
if (!replace && exists(existing)) {
|
|
138
|
+
throw new LaunchError(
|
|
139
|
+
`A bot token already exists at ${existing}. Nothing was changed. ` +
|
|
140
|
+
`Re-run store-token with --replace to overwrite it.`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Store the bot token from the system clipboard, with no TTY needed.
|
|
147
|
+
*
|
|
148
|
+
* Same validation and the same existing-token rule as the prompt. The
|
|
149
|
+
* clipboard is cleared only after a successful store, so a failed attempt
|
|
150
|
+
* leaves the operator's copy in place to retry with. The token is never
|
|
151
|
+
* returned, and an invalid value is reported by shape, never echoed.
|
|
152
|
+
* @param {{ stateDir: string, replace?: boolean,
|
|
153
|
+
* env?: Record<string, string | undefined>, homedir?: string,
|
|
154
|
+
* io?: { readClipboard?: typeof readClipboard, fs?: object } }} input -
|
|
155
|
+
* Configured state dir, the `--replace` flag and seams
|
|
156
|
+
* @returns {{ stored: true, path: string, clipboardCleared: boolean } |
|
|
157
|
+
* { stored: false, reason: "empty" | "invalid" | "unsupported" |
|
|
158
|
+
* "unavailable" | "failed", message: string }} Outcome
|
|
159
|
+
*/
|
|
160
|
+
export function storeTokenFromClipboard(input) {
|
|
161
|
+
const { replace = false, io = {} } = input;
|
|
162
|
+
const stateDir = resolveStateDir(input.stateDir, input);
|
|
163
|
+
assertReplaceable(stateDir, replace, io);
|
|
164
|
+
const clip = (io.readClipboard ?? readClipboard)();
|
|
165
|
+
if (!clip.ok) {
|
|
166
|
+
return { stored: false, reason: clip.reason, message: clip.message };
|
|
167
|
+
}
|
|
168
|
+
const token = clip.text.trim();
|
|
169
|
+
if (!token) {
|
|
170
|
+
return {
|
|
171
|
+
stored: false,
|
|
172
|
+
reason: "empty",
|
|
173
|
+
message: "The clipboard is empty.",
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (!validateBotToken(token)) return { ...INVALID };
|
|
177
|
+
const written = writeTokenFile(stateDir, token, io);
|
|
178
|
+
return { stored: true, ...written, clipboardCleared: clip.clear() };
|
|
101
179
|
}
|
|
102
180
|
|
|
103
181
|
/**
|
|
104
182
|
* Prompt for the bot token on the operator's terminal and store it.
|
|
105
183
|
*
|
|
106
|
-
* An existing token is never overwritten without `replace
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* one.
|
|
184
|
+
* An existing token is never overwritten without `replace`. With no TTY this
|
|
185
|
+
* does not prompt and does not fail: it returns the exact command for the
|
|
186
|
+
* operator to run in a separate terminal app, and the `--from-clipboard` form
|
|
187
|
+
* of it, because an agent's Bash (and Claude Code's `!` prefix) can never
|
|
188
|
+
* answer a prompt and a hung setup looks like a slow one.
|
|
112
189
|
* @param {{ stateDir: string, scriptsDir: string, projectRoot: string,
|
|
113
190
|
* replace?: boolean, env?: Record<string, string | undefined>,
|
|
114
191
|
* homedir?: string, io?: { canPrompt?: () => boolean,
|
|
115
192
|
* promptSecret?: (message: string) => string, fs?: object } }} input -
|
|
116
193
|
* Configured state dir, locations, the `--replace` flag and seams
|
|
117
194
|
* @returns {Promise<{ stored: true, path: string } |
|
|
118
|
-
* { stored: false, reason: "no-tty",
|
|
195
|
+
* { stored: false, reason: "no-tty", message: string, command: string,
|
|
196
|
+
* clipboardCommand: string } |
|
|
119
197
|
* { stored: false, reason: "empty" | "invalid", message: string }>} Outcome
|
|
120
198
|
*/
|
|
121
199
|
export async function storeToken(input) {
|
|
122
200
|
const { scriptsDir, projectRoot, replace = false, io = {} } = input;
|
|
123
201
|
const stateDir = resolveStateDir(input.stateDir, input);
|
|
124
|
-
|
|
125
|
-
const exists = io.fs?.existsSync ?? nodeFs.existsSync;
|
|
126
|
-
if (!replace && exists(existing)) {
|
|
127
|
-
throw new LaunchError(
|
|
128
|
-
`A bot token already exists at ${existing}. Nothing was changed. ` +
|
|
129
|
-
`Re-run store-token with --replace to overwrite it.`
|
|
130
|
-
);
|
|
131
|
-
}
|
|
202
|
+
assertReplaceable(stateDir, replace, io);
|
|
132
203
|
const loaded =
|
|
133
204
|
io.canPrompt && io.promptSecret ? null : await loadPromptSecret();
|
|
134
205
|
const canPrompt = io.canPrompt ?? (() => loaded.canPrompt());
|
|
@@ -138,7 +209,14 @@ export async function storeToken(input) {
|
|
|
138
209
|
return {
|
|
139
210
|
stored: false,
|
|
140
211
|
reason: "no-tty",
|
|
212
|
+
message: NO_TTY_HINT,
|
|
141
213
|
command: buildStoreTokenCommand({ scriptsDir, projectRoot, replace }),
|
|
214
|
+
clipboardCommand: buildStoreTokenCommand({
|
|
215
|
+
scriptsDir,
|
|
216
|
+
projectRoot,
|
|
217
|
+
replace,
|
|
218
|
+
fromClipboard: true,
|
|
219
|
+
}),
|
|
142
220
|
};
|
|
143
221
|
}
|
|
144
222
|
const typed = promptSecret(
|
|
@@ -147,15 +225,7 @@ export async function storeToken(input) {
|
|
|
147
225
|
if (!typed) {
|
|
148
226
|
return { stored: false, reason: "empty", message: "Nothing entered." };
|
|
149
227
|
}
|
|
150
|
-
if (!validateBotToken(typed)) {
|
|
151
|
-
return {
|
|
152
|
-
stored: false,
|
|
153
|
-
reason: "invalid",
|
|
154
|
-
message:
|
|
155
|
-
"That does not look like a Telegram bot token " +
|
|
156
|
-
"(expected <digits>:<30 or more letters, digits, _ or ->).",
|
|
157
|
-
};
|
|
158
|
-
}
|
|
228
|
+
if (!validateBotToken(typed)) return { ...INVALID };
|
|
159
229
|
return { stored: true, ...writeTokenFile(stateDir, typed, io) };
|
|
160
230
|
}
|
|
161
231
|
|
|
@@ -42,11 +42,14 @@ writes `$SM`, and pass `--project-root "$ROOT"` (the absolute project root) on e
|
|
|
42
42
|
|
|
43
43
|
1. Preview: `node "$SM/session-manager.mjs" init-config --project-root "$ROOT"`. It detects
|
|
44
44
|
`projects/*/.lisa.config.json` and proposes `name`, `interval`, `repos`, `capacity`, `stall` and a
|
|
45
|
-
per-project `notify.stateDir`.
|
|
45
|
+
per-project `notify.stateDir`. Repo detection leaves out linked worktrees and keeps one checkout
|
|
46
|
+
per remote, so ticket worktrees and second clones under `projects/` are not proposed. Show the
|
|
47
|
+
block to the operator and ask whether any repo is missing or should not be routed.
|
|
46
48
|
2. Write it: the same command with `--write`. It adds only non-secret fields and never overwrites an
|
|
47
49
|
existing block (`reason: "exists"` means keep it).
|
|
48
|
-
3.
|
|
49
|
-
|
|
50
|
+
3. Each repo's `hints` are a draft: its name plus one per well-known dependency (`NestJS`, `Expo`,
|
|
51
|
+
`AWS CDK`, ...). Ask the operator to correct them and add the areas that identify the repo
|
|
52
|
+
(e.g. `api`: `["NestJS","migrations"]`, `web`: `["Expo","screens"]`), and whether to
|
|
50
53
|
set `sessionManager.trustedAuthorIds`. Without it, any author's Ready item reaches a
|
|
51
54
|
bypass-permissions worker; say so plainly. The list holds stable tracker user ids as strings,
|
|
52
55
|
never logins: the GitHub numeric user id (`gh api users/<login> --jq .id`), the Jira
|
|
@@ -61,8 +64,14 @@ The operator creates a bot with @BotFather, one per project. Then run
|
|
|
61
64
|
- `stored: true`: done.
|
|
62
65
|
- Exit 2 because a token already exists: keep it (re-running setup is safe). Only when the operator
|
|
63
66
|
says the stored token is wrong or belongs to another project, re-run with `store-token --replace`.
|
|
64
|
-
- `reason: "no-tty"` (an agent's Bash has no terminal):
|
|
65
|
-
|
|
67
|
+
- `reason: "no-tty"` (an agent's Bash has no terminal): offer the operator both routes, and say
|
|
68
|
+
plainly that Claude Code's `!` prefix has no terminal either, so it fails the same way:
|
|
69
|
+
- **Clipboard (simplest):** they copy the token from the BotFather chat and tell you; then run
|
|
70
|
+
`clipboardCommand` from the output (`store-token --from-clipboard`). It validates the token,
|
|
71
|
+
stores it, never prints it, and clears the clipboard. On `stored: false`, say what `message`
|
|
72
|
+
reports and ask them to copy it again.
|
|
73
|
+
- **Separate terminal app:** print `command` and ask them to run it in Terminal, iTerm or similar,
|
|
74
|
+
outside the agent, where it prompts with echo off. Wait for them to confirm.
|
|
66
75
|
- `empty` / `invalid`: say what was wrong and ask again.
|
|
67
76
|
|
|
68
77
|
Never ask for the token in chat, never echo, log or commit it, and never put it in
|
|
@@ -97,14 +106,24 @@ If `.lisa/automations/session-manager.runbook.md` does not exist, copy
|
|
|
97
106
|
`$SM/../references/runbook-template.md` there. Never overwrite an existing runbook: it is the
|
|
98
107
|
project's. It is checked in, like every automation runbook (`automation-runbook-contract`).
|
|
99
108
|
|
|
100
|
-
## Step 7:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
## Step 7: Check for competing intake loops
|
|
110
|
+
|
|
111
|
+
The scheduled `intake-repair` loop can re-dispatch an item a local worker is still building (it treats
|
|
112
|
+
a claimed item with no tracker activity for `intake.repair.staleAfterHours` as stalled), and
|
|
113
|
+
`intake-tickets` competes for the same Ready items. Find out whether either is running before you
|
|
114
|
+
start the manager; do not leave the operator to check.
|
|
115
|
+
|
|
116
|
+
1. Run `node "$SM/session-manager.mjs" coexistence --project-root "$ROOT"`. For each loop it reports
|
|
117
|
+
the last run recorded in this project's run log and whether that is `recent`. `live` lists the
|
|
118
|
+
loops that ran recently.
|
|
119
|
+
2. A run log is evidence, not proof: also list your runtime's scheduler for those loop names (Claude
|
|
120
|
+
Code: the `/schedule` listing of claude.ai routines; Codex: automations; a `lisa-<loop>.yml`
|
|
121
|
+
workflow with a `schedule:` trigger on GitHub Actions).
|
|
122
|
+
3. Report what you found, per loop, in one line each. Only for a loop that is live (a recent run, or a
|
|
123
|
+
scheduler entry): recommend tearing down `intake-tickets` (`/lisa:tear-down-automations
|
|
124
|
+
intake-tickets`) and either raising `intake.repair.staleAfterHours` above
|
|
125
|
+
`stall.noOutputMinutes × stall.maxAttempts` or tearing down `intake-repair`. When neither is live,
|
|
126
|
+
say so and move on.
|
|
108
127
|
|
|
109
128
|
## Step 8: Accept workspace trust in each worker repo
|
|
110
129
|
|
|
@@ -113,12 +132,15 @@ folder?" prompt: until someone has accepted it in a directory, `claude --bg` ref
|
|
|
113
132
|
and `spawn` exits 2 saying so. Do this once per routed repo (or once for the root on a single-repo
|
|
114
133
|
project), on every machine that runs the manager:
|
|
115
134
|
|
|
116
|
-
1.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
accept
|
|
135
|
+
1. Run `node "$SM/session-manager.mjs" trust-status --project-root "$ROOT"`. It lists every
|
|
136
|
+
directory workers start in (each routed repo, or the root on a single-repo project) with whether
|
|
137
|
+
Claude Code has already recorded trust for it. `needsTrust` lists the ones that are not
|
|
138
|
+
`trusted: true`. When it is empty, this step is done: say so.
|
|
139
|
+
2. For each directory in `needsTrust`, ask the operator, in a separate terminal app (not the agent's
|
|
140
|
+
Bash or Claude Code's `!` prefix), to run `claude` once in that directory, accept the trust prompt,
|
|
141
|
+
then exit. An agent's Bash cannot answer that prompt, so never try to accept it for them. Then
|
|
142
|
+
re-run `trust-status` to confirm. (`trusted: "unknown"` means Claude Code's state file could not be
|
|
143
|
+
read; treat it as needing trust.)
|
|
122
144
|
3. Re-run this step whenever a repo is added to `sessionManager.repos`.
|
|
123
145
|
|
|
124
146
|
## Step 9: Start and pair
|
|
@@ -152,5 +174,6 @@ confirm the "Session manager Telegram isolation?" check is green. Fix every warn
|
|
|
152
174
|
`node "$SM/session-manager.mjs" status --project-root "$ROOT"` should show the manager running.
|
|
153
175
|
|
|
154
176
|
Report: the config block written (or kept), where the token lives (the path, never the value), the
|
|
155
|
-
plugin scope result, the runbook path, which repo dirs
|
|
156
|
-
tmux session name, and the
|
|
177
|
+
plugin scope result, the runbook path, which repo dirs were already trusted and which the operator
|
|
178
|
+
accepted trust in, what the competing-loop check found, the manager's tmux session name, and the
|
|
179
|
+
doctor result.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "4.81.
|
|
3
|
+
"version": "4.81.4",
|
|
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.81.
|
|
3
|
+
"version": "4.81.4",
|
|
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.81.
|
|
3
|
+
"version": "4.81.4",
|
|
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.81.
|
|
3
|
+
"version": "4.81.4",
|
|
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.81.
|
|
3
|
+
"version": "4.81.4",
|
|
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.81.
|
|
3
|
+
"version": "4.81.4",
|
|
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.81.
|
|
3
|
+
"version": "4.81.4",
|
|
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"
|