@codyswann/lisa 4.85.0 → 4.86.1
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/all/copy-overwrite/scripts/lib/completion-proof-content.mjs +63 -22
- package/all/copy-overwrite/scripts/lib/npm-update-hosted-hook.mjs +6 -1
- package/all/copy-overwrite/scripts/lisa-hooks/parity-safety-net.sh +19 -3
- package/all/copy-overwrite/scripts/npm-updater-helper-graph.json +2 -2
- package/dist/cli/doctor-session-manager-pending.d.ts +17 -0
- package/dist/cli/doctor-session-manager-pending.d.ts.map +1 -0
- package/dist/cli/doctor-session-manager-pending.js +130 -0
- package/dist/cli/doctor-session-manager-pending.js.map +1 -0
- package/dist/cli/doctor-session-manager-token.d.ts +69 -0
- package/dist/cli/doctor-session-manager-token.d.ts.map +1 -0
- package/dist/cli/doctor-session-manager-token.js +264 -0
- package/dist/cli/doctor-session-manager-token.js.map +1 -0
- package/dist/cli/doctor-session-manager.d.ts +3 -1
- package/dist/cli/doctor-session-manager.d.ts.map +1 -1
- package/dist/cli/doctor-session-manager.js +168 -146
- package/dist/cli/doctor-session-manager.js.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.d.ts.map +1 -1
- package/dist/core/lisa-owned-hash-ledger.js +16 -0
- package/dist/core/lisa-owned-hash-ledger.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 +168 -26
- package/dist/core/upstream-evidence-manifest.js.map +1 -1
- package/dist/opencode/plugin-templates/parity-safety-net.sh +19 -3
- 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-parity-sentry-sdk-setup/SKILL.md +24 -17
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/SKILL.md +5 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/SKILL.md +197 -54
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/references/runbook-template.md +23 -10
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/config.mjs +39 -11
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/launch.mjs +69 -60
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-session-manager/scripts/token.mjs +39 -120
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-session-manager/SKILL.md +82 -19
- package/plugins/lisa/commands/session-manager.md +1 -1
- package/plugins/lisa/commands/setup/session-manager.md +1 -1
- package/plugins/lisa/hooks/parity-safety-net.sh +19 -3
- package/plugins/lisa/rules/reference/config-resolution.md +39 -7
- package/plugins/lisa/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
- package/plugins/lisa/skills/lisa-secrets-access/SKILL.md +5 -3
- package/plugins/lisa/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
- package/plugins/lisa/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
- package/plugins/lisa/skills/lisa-session-manager/SKILL.md +197 -54
- package/plugins/lisa/skills/lisa-session-manager/references/runbook-template.md +23 -10
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
- package/plugins/lisa/skills/lisa-session-manager/scripts/config.mjs +39 -11
- package/plugins/lisa/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/launch.mjs +69 -60
- package/plugins/lisa/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
- package/plugins/lisa/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
- package/plugins/lisa/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
- package/plugins/lisa/skills/lisa-session-manager/scripts/token.mjs +39 -120
- package/plugins/lisa/skills/lisa-setup-session-manager/SKILL.md +82 -19
- package/plugins/lisa-agy/commands/lisa/session-manager.md +1 -1
- package/plugins/lisa-agy/commands/lisa/setup/session-manager.md +1 -1
- package/plugins/lisa-agy/hooks/parity-safety-net.sh +19 -3
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
- package/plugins/lisa-agy/skills/lisa-secrets-access/SKILL.md +5 -3
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
- package/plugins/lisa-agy/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
- package/plugins/lisa-agy/skills/lisa-session-manager/SKILL.md +197 -54
- package/plugins/lisa-agy/skills/lisa-session-manager/references/runbook-template.md +23 -10
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/config.mjs +39 -11
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/launch.mjs +69 -60
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
- package/plugins/lisa-agy/skills/lisa-session-manager/scripts/token.mjs +39 -120
- package/plugins/lisa-agy/skills/lisa-setup-session-manager/SKILL.md +82 -19
- 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/commands/lisa/session-manager.md +1 -1
- package/plugins/lisa-copilot/commands/lisa/setup/session-manager.md +1 -1
- package/plugins/lisa-copilot/hooks/parity-safety-net.sh +19 -3
- package/plugins/lisa-copilot/rules/reference/config-resolution.md +39 -7
- package/plugins/lisa-copilot/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
- package/plugins/lisa-copilot/skills/lisa-secrets-access/SKILL.md +5 -3
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
- package/plugins/lisa-copilot/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
- package/plugins/lisa-copilot/skills/lisa-session-manager/SKILL.md +197 -54
- package/plugins/lisa-copilot/skills/lisa-session-manager/references/runbook-template.md +23 -10
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/config.mjs +39 -11
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/launch.mjs +69 -60
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
- package/plugins/lisa-copilot/skills/lisa-session-manager/scripts/token.mjs +39 -120
- package/plugins/lisa-copilot/skills/lisa-setup-session-manager/SKILL.md +82 -19
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/commands/lisa/session-manager.md +1 -1
- package/plugins/lisa-cursor/commands/lisa/setup/session-manager.md +1 -1
- package/plugins/lisa-cursor/hooks/parity-safety-net.sh +19 -3
- package/plugins/lisa-cursor/rules/config-resolution-reference.mdc +39 -7
- package/plugins/lisa-cursor/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
- package/plugins/lisa-cursor/skills/lisa-secrets-access/SKILL.md +5 -3
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
- package/plugins/lisa-cursor/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
- package/plugins/lisa-cursor/skills/lisa-session-manager/SKILL.md +197 -54
- package/plugins/lisa-cursor/skills/lisa-session-manager/references/runbook-template.md +23 -10
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/config.mjs +39 -11
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/launch.mjs +69 -60
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
- package/plugins/lisa-cursor/skills/lisa-session-manager/scripts/token.mjs +39 -120
- package/plugins/lisa-cursor/skills/lisa-setup-session-manager/SKILL.md +82 -19
- package/plugins/lisa-devin/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/.devin-plugin/plugin.json +1 -1
- package/plugins/lisa-devin/hooks/parity-safety-net.sh +19 -3
- package/plugins/lisa-devin/rules/reference/config-resolution.md +39 -7
- package/plugins/lisa-devin/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
- package/plugins/lisa-devin/skills/lisa-secrets-access/SKILL.md +5 -3
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
- package/plugins/lisa-devin/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
- package/plugins/lisa-devin/skills/lisa-session-manager/SKILL.md +197 -54
- package/plugins/lisa-devin/skills/lisa-session-manager/references/runbook-template.md +23 -10
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/config.mjs +39 -11
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/launch.mjs +69 -60
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
- package/plugins/lisa-devin/skills/lisa-session-manager/scripts/token.mjs +39 -120
- package/plugins/lisa-devin/skills/lisa-setup-session-manager/SKILL.md +82 -19
- 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/commands/session-manager.md +1 -1
- package/plugins/src/base/commands/setup/session-manager.md +1 -1
- package/plugins/src/base/hooks/parity-safety-net.sh +19 -3
- package/plugins/src/base/rules/reference/config-resolution.md +39 -7
- package/plugins/src/base/skills/lisa-parity-sentry-sdk-setup/SKILL.md +24 -17
- package/plugins/src/base/skills/lisa-secrets-access/SKILL.md +5 -3
- package/plugins/src/base/skills/lisa-secrets-access/scripts/providers.mjs +121 -3
- package/plugins/src/base/skills/lisa-secrets-access/scripts/validate-config.mjs +86 -31
- package/plugins/src/base/skills/lisa-session-manager/SKILL.md +197 -54
- package/plugins/src/base/skills/lisa-session-manager/references/runbook-template.md +23 -10
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-cycle.mjs +21 -3
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-human.mjs +199 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-manager-token.mjs +99 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-manager.mjs +52 -52
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-queue.mjs +51 -139
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-runtime.mjs +5 -3
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-setup.mjs +94 -14
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-status.mjs +73 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/cli-usage.mjs +105 -15
- package/plugins/src/base/skills/lisa-session-manager/scripts/config.mjs +39 -11
- package/plugins/src/base/skills/lisa-session-manager/scripts/human-answer.mjs +162 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/human-needed.mjs +198 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/json-input.mjs +34 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/launch-shell.mjs +115 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/launch.mjs +69 -60
- package/plugins/src/base/skills/lisa-session-manager/scripts/ledger-questions.mjs +252 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/ledger.mjs +22 -56
- package/plugins/src/base/skills/lisa-session-manager/scripts/queue-github.mjs +117 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/session-manager.mjs +17 -5
- package/plugins/src/base/skills/lisa-session-manager/scripts/token-migrate.mjs +180 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/token-provider.mjs +150 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/token-read.mjs +166 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/token-store.mjs +248 -0
- package/plugins/src/base/skills/lisa-session-manager/scripts/token.mjs +39 -120
- package/plugins/src/base/skills/lisa-setup-session-manager/SKILL.md +82 -19
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-needed subcommands of the session-manager CLI (CodySwannGT/lisa#4555,
|
|
3
|
+
* part 3): `mark-plan`, `answer` and `item-answer`.
|
|
4
|
+
*
|
|
5
|
+
* `mark-plan` says how to mark an item that needs a human: the configured
|
|
6
|
+
* human-needed label (else the configured `blocked` role), a move to the
|
|
7
|
+
* `blocked` role for an `exhausted` item, and the comment to post. It writes
|
|
8
|
+
* nothing; the manager applies the plan through `lisa-tracker-write`, so the
|
|
9
|
+
* tracker write stays with the vendor writers. `answer` and `item-answer`
|
|
10
|
+
* queue a human's answer in the ledger for the next cycle to deliver.
|
|
11
|
+
*
|
|
12
|
+
* Question and answer text arrive on stdin, never in argv, and are refused
|
|
13
|
+
* (exit 2) when they look like they hold a credential.
|
|
14
|
+
* @module session-manager/cli-human
|
|
15
|
+
*/
|
|
16
|
+
import { resolveRole } from "../../../scripts/resolve-lifecycle-role.mjs";
|
|
17
|
+
import {
|
|
18
|
+
CliError,
|
|
19
|
+
EXIT,
|
|
20
|
+
asSetupError,
|
|
21
|
+
asSetupErrorAsync,
|
|
22
|
+
humanNeededLabel,
|
|
23
|
+
loadProject,
|
|
24
|
+
requirePositional,
|
|
25
|
+
stdinText,
|
|
26
|
+
validOrAbsent,
|
|
27
|
+
} from "./cli-runtime.mjs";
|
|
28
|
+
import { parseJson } from "./cli-queue.mjs";
|
|
29
|
+
import { notifyProvider } from "./config.mjs";
|
|
30
|
+
import { pickItemAnswer } from "./human-answer.mjs";
|
|
31
|
+
import { findCredentialShape, planMark } from "./human-needed.mjs";
|
|
32
|
+
import { readLedger } from "./ledger.mjs";
|
|
33
|
+
import { queueAnswer } from "./ledger-questions.mjs";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The project's configured tracker.
|
|
37
|
+
* @param {ReturnType<typeof loadProject>} project - Loaded project
|
|
38
|
+
* @returns {string | undefined} `github`, `jira` or `linear`
|
|
39
|
+
*/
|
|
40
|
+
function trackerOf(project) {
|
|
41
|
+
return project.local?.tracker ?? project.global?.tracker;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* `mark-plan <ref> --kind <kind>` (question or reason on stdin).
|
|
46
|
+
* @param {object} ctx - CLI context
|
|
47
|
+
* @returns {{ json: object }} `{ref,kind,marker,move?,comment,answerWith}`
|
|
48
|
+
*/
|
|
49
|
+
export function markPlan(ctx) {
|
|
50
|
+
const ref = requirePositional(ctx, "ref");
|
|
51
|
+
const text = stdinText(ctx, "question or reason");
|
|
52
|
+
const project = loadProject(ctx.root);
|
|
53
|
+
const config = validOrAbsent(project);
|
|
54
|
+
const tracker = trackerOf(project);
|
|
55
|
+
const blocked = resolveRole({
|
|
56
|
+
role: "blocked",
|
|
57
|
+
vendor: tracker,
|
|
58
|
+
intent: "write",
|
|
59
|
+
local: project.local,
|
|
60
|
+
global: project.global,
|
|
61
|
+
}).value;
|
|
62
|
+
return {
|
|
63
|
+
json: asSetupError(() =>
|
|
64
|
+
planMark({
|
|
65
|
+
ref,
|
|
66
|
+
kind: ctx.values.kind,
|
|
67
|
+
text,
|
|
68
|
+
label: humanNeededLabel(project, tracker),
|
|
69
|
+
blocked: blocked || undefined,
|
|
70
|
+
channel: config ? notifyProvider(config) === "telegram" : false,
|
|
71
|
+
answerers: allowedAnswerers(config).length > 0,
|
|
72
|
+
})
|
|
73
|
+
),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Refuse (exit 2) text that looks like it holds a credential.
|
|
79
|
+
* @param {string} text - Answer text
|
|
80
|
+
*/
|
|
81
|
+
function refuseCredential(text) {
|
|
82
|
+
const shape = findCredentialShape(text);
|
|
83
|
+
if (shape) {
|
|
84
|
+
throw new CliError(
|
|
85
|
+
`The answer looks like it holds a credential (${shape}); nothing was queued. Keep secrets in the secrets provider.`,
|
|
86
|
+
EXIT.SETUP
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* `answer <ref>` (answer on stdin): queue an operator's answer from the
|
|
93
|
+
* terminal. Exit 2 when the ref has no pending question.
|
|
94
|
+
* @param {object} ctx - CLI context
|
|
95
|
+
* @returns {Promise<{ json: object }>} `{queued:true,ref,source}`
|
|
96
|
+
*/
|
|
97
|
+
export async function answer(ctx) {
|
|
98
|
+
const ref = requirePositional(ctx, "ref");
|
|
99
|
+
const text = stdinText(ctx, "answer");
|
|
100
|
+
refuseCredential(text);
|
|
101
|
+
await asSetupErrorAsync(() =>
|
|
102
|
+
queueAnswer(ctx.root, { ref, source: "cli", text })
|
|
103
|
+
);
|
|
104
|
+
return { json: { queued: true, ref, source: "cli" } };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Who may answer on the item: operators and trusted authors only. There is
|
|
109
|
+
* no fallback to the tracker identity (`control.me`): workers and the
|
|
110
|
+
* manager post as that identity, so its comments cannot be told apart from
|
|
111
|
+
* an answer.
|
|
112
|
+
* @param {object | null} config - Resolved `sessionManager` block
|
|
113
|
+
* @returns {string[]} Allowed author ids (empty: nobody may answer there)
|
|
114
|
+
*/
|
|
115
|
+
function allowedAnswerers(config) {
|
|
116
|
+
return [
|
|
117
|
+
...(config?.operatorIds ?? []),
|
|
118
|
+
...(config?.trustedAuthorIds ?? []),
|
|
119
|
+
].map(String);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Why nothing is read off the item when nobody may answer there. */
|
|
123
|
+
/** Why no answer can be read, and the fix, when the question is not found. */
|
|
124
|
+
const NO_QUESTION =
|
|
125
|
+
"The question comment was not found on the item: its id is not recorded " +
|
|
126
|
+
"(or not among these comments), and no comment by an operator or trusted " +
|
|
127
|
+
"author starts with the question marker. Replies cannot be read until it " +
|
|
128
|
+
"is. Re-post the question comment from mark-plan, then record its id " +
|
|
129
|
+
"with ledger marked --comment-id <id>.";
|
|
130
|
+
|
|
131
|
+
const NO_ANSWERERS =
|
|
132
|
+
"No sessionManager.operatorIds or trustedAuthorIds are configured, so " +
|
|
133
|
+
"replies on the item are not read: the tracker identity is the one " +
|
|
134
|
+
"workers post as. Answer with the answerCommand that status lists, or " +
|
|
135
|
+
"set sessionManager.operatorIds.";
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* `item-answer <ref>` (stdin `{"comments":[...]}`): find the human's answer
|
|
139
|
+
* on the item and queue it. stdout `{queued:false,reason}` when there is none
|
|
140
|
+
* yet, or `reason: "no-answerers-configured"` (exit 0) when nobody may
|
|
141
|
+
* answer there. Exit 2 when the ref has no pending question.
|
|
142
|
+
* @param {object} ctx - CLI context
|
|
143
|
+
* @returns {Promise<{ json: object }>} What was queued, or why nothing was
|
|
144
|
+
*/
|
|
145
|
+
export async function itemAnswer(ctx) {
|
|
146
|
+
const ref = requirePositional(ctx, "ref");
|
|
147
|
+
const input = parseJson(stdinText(ctx, "item comments JSON"), "stdin");
|
|
148
|
+
const config = validOrAbsent(loadProject(ctx.root));
|
|
149
|
+
const ledger = await readLedger(ctx.root);
|
|
150
|
+
const pending = Object.hasOwn(ledger.items, ref)
|
|
151
|
+
? ledger.items[ref].pendingQuestion
|
|
152
|
+
: null;
|
|
153
|
+
if (!pending) {
|
|
154
|
+
throw new CliError(`${ref} has no pending question in the ledger.`, 2);
|
|
155
|
+
}
|
|
156
|
+
if (pending.answer) {
|
|
157
|
+
return { json: { queued: false, ref, reason: "already-queued" } };
|
|
158
|
+
}
|
|
159
|
+
const allowed = allowedAnswerers(config);
|
|
160
|
+
if (allowed.length === 0) {
|
|
161
|
+
return {
|
|
162
|
+
json: {
|
|
163
|
+
queued: false,
|
|
164
|
+
ref,
|
|
165
|
+
reason: "no-answerers-configured",
|
|
166
|
+
explanation: NO_ANSWERERS,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const picked = asSetupError(() =>
|
|
171
|
+
pickItemAnswer({
|
|
172
|
+
comments: input?.comments,
|
|
173
|
+
allowed,
|
|
174
|
+
managerCommentIds: pending.managerCommentIds ?? [],
|
|
175
|
+
})
|
|
176
|
+
);
|
|
177
|
+
if (!picked.answer) {
|
|
178
|
+
return {
|
|
179
|
+
json: {
|
|
180
|
+
queued: false,
|
|
181
|
+
ref,
|
|
182
|
+
reason: picked.reason,
|
|
183
|
+
...(picked.reason === "no-question-comment"
|
|
184
|
+
? { explanation: NO_QUESTION }
|
|
185
|
+
: {}),
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
refuseCredential(picked.answer.text);
|
|
190
|
+
await queueAnswer(ctx.root, {
|
|
191
|
+
ref,
|
|
192
|
+
source: "item",
|
|
193
|
+
text: picked.answer.text,
|
|
194
|
+
author: picked.answer.author,
|
|
195
|
+
});
|
|
196
|
+
return {
|
|
197
|
+
json: { queued: true, ref, source: "item", author: picked.answer.author },
|
|
198
|
+
};
|
|
199
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Telegram-token half of the session-manager `start` subcommand (#4555),
|
|
3
|
+
* split out of cli-manager.mjs to keep it under the line budget: where the
|
|
4
|
+
* bot token comes from ({@link telegramToken}), and the tmux launch that
|
|
5
|
+
* hands a provider-held token to the manager's session on stdin, never in
|
|
6
|
+
* argv ({@link launchWithToken}). The token value never reaches a return
|
|
7
|
+
* value that is printed, an error message or a log line.
|
|
8
|
+
* @module session-manager/cli-manager-token
|
|
9
|
+
*/
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
CliError,
|
|
14
|
+
EXIT,
|
|
15
|
+
asSetupError,
|
|
16
|
+
asSetupErrorAsync,
|
|
17
|
+
run,
|
|
18
|
+
} from "./cli-runtime.mjs";
|
|
19
|
+
import { buildSourcedLaunch, buildStoreTokenCommand } from "./launch.mjs";
|
|
20
|
+
import {
|
|
21
|
+
loadTokenSecrets,
|
|
22
|
+
resolveTelegramToken,
|
|
23
|
+
telegramSecretName,
|
|
24
|
+
} from "./token-store.mjs";
|
|
25
|
+
import { shellQuote } from "./token.mjs";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Where `start` gets the Telegram bot token (#4555). With a secrets provider
|
|
29
|
+
* it is resolved once from the provider (exit 2 for a leftover plaintext
|
|
30
|
+
* file, naming the `store-token` command that migrates it; exit 1 when the
|
|
31
|
+
* provider cannot answer). With none, the plugin reads `<stateDir>/.env`.
|
|
32
|
+
* The value is kept off the returned JSON; `shellVars` is the foreground
|
|
33
|
+
* line's way to resolve it in the operator's own shell instead.
|
|
34
|
+
* @param {object} ctx - CLI context
|
|
35
|
+
* @param {string} managerName - `sessionManager.name`
|
|
36
|
+
* @param {string} stateDir - Resolved state dir
|
|
37
|
+
* @returns {Promise<{ source: "file" } | { source: "provider",
|
|
38
|
+
* secret: string, value: string, shellVars: Record<string, string> }>}
|
|
39
|
+
* Token source
|
|
40
|
+
*/
|
|
41
|
+
export async function telegramToken(ctx, managerName, stateDir) {
|
|
42
|
+
const secrets = await asSetupErrorAsync(() =>
|
|
43
|
+
loadTokenSecrets(ctx.root, ctx.env)
|
|
44
|
+
);
|
|
45
|
+
if (secrets === null) return { source: "file" };
|
|
46
|
+
const secret = telegramSecretName(managerName);
|
|
47
|
+
const value = await asSetupErrorAsync(() =>
|
|
48
|
+
resolveTelegramToken({
|
|
49
|
+
...secrets,
|
|
50
|
+
name: secret,
|
|
51
|
+
stateDir,
|
|
52
|
+
fixCommand: buildStoreTokenCommand({
|
|
53
|
+
scriptsDir: ctx.scriptsDir,
|
|
54
|
+
projectRoot: ctx.root,
|
|
55
|
+
}),
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
const resolver = path.resolve(
|
|
59
|
+
ctx.scriptsDir,
|
|
60
|
+
"../../lisa-secrets-access/scripts/resolve-secret.mjs"
|
|
61
|
+
);
|
|
62
|
+
return {
|
|
63
|
+
source: "provider",
|
|
64
|
+
secret,
|
|
65
|
+
value,
|
|
66
|
+
shellVars: {
|
|
67
|
+
TELEGRAM_BOT_TOKEN: `$(node ${shellQuote(resolver)} get ${secret})`,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Start the manager's tmux session with the bot token on tmux's stdin
|
|
74
|
+
* (`start-server ; source-file -`), never in argv. tmux's own stderr is never
|
|
75
|
+
* passed through: a parse error can quote the line, which holds the token.
|
|
76
|
+
* @param {{ ctx: object, argv: string[], env: object,
|
|
77
|
+
* token: { value: string }, foreground: () => string }} input - Context,
|
|
78
|
+
* the launch argv, the scrubbed env, the token and the foreground line
|
|
79
|
+
*/
|
|
80
|
+
export function launchWithToken({ ctx, argv, env, token, foreground }) {
|
|
81
|
+
const sourced = asSetupError(() =>
|
|
82
|
+
buildSourcedLaunch(argv, { TELEGRAM_BOT_TOKEN: token.value })
|
|
83
|
+
);
|
|
84
|
+
const result = run("tmux", sourced.argv, {
|
|
85
|
+
env,
|
|
86
|
+
cwd: ctx.root,
|
|
87
|
+
input: sourced.input,
|
|
88
|
+
});
|
|
89
|
+
if (result.missing) throw new CliError("tmux is not on PATH.", EXIT.SETUP);
|
|
90
|
+
if (result.status !== 0) {
|
|
91
|
+
throw new CliError(
|
|
92
|
+
`tmux could not start the manager's session (exit ` +
|
|
93
|
+
`${String(result.status)}). tmux's own error is not shown, because ` +
|
|
94
|
+
`the command it read carries the bot token. Run the launch in the ` +
|
|
95
|
+
`foreground to see the error:\n ${foreground()}`,
|
|
96
|
+
EXIT.FAILURE
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -3,13 +3,22 @@
|
|
|
3
3
|
* repo-dir and validate. The setup ones (init-config, store-token,
|
|
4
4
|
* trust-status, coexistence) live in cli-setup.mjs.
|
|
5
5
|
*
|
|
6
|
-
* `start` hosts the manager in tmux.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* `start` hosts the manager in tmux. With Telegram as the notification
|
|
7
|
+
* channel and a secrets provider configured, it resolves the bot token once
|
|
8
|
+
* from the provider and hands it to tmux on stdin (#4555; see
|
|
9
|
+
* token-store.mjs). With Telegram and no provider it refuses (exit 2) unless
|
|
10
|
+
* the bot token file exists with owner-only permissions in the project's own
|
|
11
|
+
* state dir; with no channel
|
|
12
|
+
* (`notify.provider` `"none"`, or no `notify` block) it needs no token, state
|
|
13
|
+
* dir or plugin and launches without `--channels` (#4555). It treats an existing tmux session started in this root as
|
|
9
14
|
* "already running" rather than starting a second poller on the same bot. A
|
|
10
15
|
* session of that name started in another root is another project's manager,
|
|
11
16
|
* so both `start` and `stop` refuse it (exit 2). `stop` kills only the
|
|
12
17
|
* manager's tmux session: workers hold claimed work and keep running.
|
|
18
|
+
*
|
|
19
|
+
* The token lookup and stdin launch live in cli-manager-token.mjs and
|
|
20
|
+
* `status` in cli-status.mjs (re-exported here), to keep each module under
|
|
21
|
+
* the line budget.
|
|
13
22
|
* @module session-manager/cli-manager
|
|
14
23
|
*/
|
|
15
24
|
import {
|
|
@@ -18,25 +27,25 @@ import {
|
|
|
18
27
|
GLOBAL_CONFIG_FILE,
|
|
19
28
|
asSetupError,
|
|
20
29
|
intFlag,
|
|
21
|
-
listAgents,
|
|
22
30
|
loadProject,
|
|
23
31
|
mustRun,
|
|
24
32
|
requireConfig,
|
|
25
33
|
requireLisaRepo,
|
|
26
34
|
run,
|
|
27
35
|
} from "./cli-runtime.mjs";
|
|
28
|
-
import {
|
|
36
|
+
import { launchWithToken, telegramToken } from "./cli-manager-token.mjs";
|
|
37
|
+
import { notifyProvider, resolveRepoDir } from "./config.mjs";
|
|
29
38
|
import { probeOwnSession, sessionSurvives } from "./isolation.mjs";
|
|
30
39
|
import {
|
|
31
40
|
assertTokenPresent,
|
|
32
41
|
buildForegroundCommand,
|
|
33
|
-
buildHasSession,
|
|
34
42
|
buildManagerLaunch,
|
|
35
43
|
buildStopManager,
|
|
36
44
|
resolveStateDir,
|
|
37
45
|
} from "./launch.mjs";
|
|
38
|
-
import {
|
|
39
|
-
|
|
46
|
+
import { scrubWorkerEnv } from "./workers.mjs";
|
|
47
|
+
|
|
48
|
+
export { status } from "./cli-status.mjs";
|
|
40
49
|
|
|
41
50
|
/**
|
|
42
51
|
* The configured state dir, resolved (exit 2 for the shared default dir).
|
|
@@ -85,32 +94,49 @@ function settleMsOf(ctx) {
|
|
|
85
94
|
export async function start(ctx) {
|
|
86
95
|
const settleMs = settleMsOf(ctx);
|
|
87
96
|
const config = requireConfig(ctx);
|
|
88
|
-
const
|
|
97
|
+
const notify = notifyProvider(config);
|
|
98
|
+
const stateDir = notify === "telegram" ? stateDirOf(ctx, config) : undefined;
|
|
89
99
|
// tmux gets the scrubbed env: if this call starts the tmux server, its
|
|
90
100
|
// global environment must not carry a TELEGRAM_* value into other sessions.
|
|
91
101
|
const env = scrubWorkerEnv(ctx.env);
|
|
102
|
+
// A running manager already holds its token, so it is reported before the
|
|
103
|
+
// provider is asked for one: a rate-limited vault must not turn "already
|
|
104
|
+
// running" into a failure, or spend a vault call on nothing.
|
|
92
105
|
const session = probeOwnSession(ctx, config.name, env);
|
|
93
106
|
if (session.missing) throw new CliError("tmux is not on PATH.", EXIT.SETUP);
|
|
94
107
|
if (session.running) {
|
|
95
108
|
return { json: { status: "already-running", name: config.name } };
|
|
96
109
|
}
|
|
97
|
-
|
|
110
|
+
// Resolved before any session is created: a provider that cannot answer
|
|
111
|
+
// must leave nothing half-started.
|
|
112
|
+
const token =
|
|
113
|
+
stateDir === undefined
|
|
114
|
+
? null
|
|
115
|
+
: await telegramToken(ctx, config.name, stateDir);
|
|
116
|
+
if (token?.source === "file") {
|
|
117
|
+
asSetupError(() => assertTokenPresent(stateDir));
|
|
118
|
+
}
|
|
98
119
|
const argv = asSetupError(() =>
|
|
99
120
|
buildManagerLaunch({
|
|
100
121
|
name: config.name,
|
|
101
122
|
root: ctx.root,
|
|
102
|
-
stateDir,
|
|
123
|
+
...(stateDir === undefined ? {} : { stateDir }),
|
|
103
124
|
scriptsDir: ctx.scriptsDir,
|
|
104
125
|
interval: config.interval,
|
|
126
|
+
notify,
|
|
105
127
|
})
|
|
106
128
|
);
|
|
107
|
-
|
|
129
|
+
const foreground = () => buildForegroundCommand(argv, token?.shellVars ?? {});
|
|
130
|
+
if (token?.source === "provider") {
|
|
131
|
+
launchWithToken({ ctx, argv, env, token, foreground });
|
|
132
|
+
} else {
|
|
133
|
+
mustRun("tmux", argv, { env, cwd: ctx.root });
|
|
134
|
+
}
|
|
108
135
|
if (!(await sessionSurvives(config.name, env, settleMs))) {
|
|
109
|
-
const foreground = buildForegroundCommand(argv);
|
|
110
136
|
throw new CliError(
|
|
111
137
|
`The manager's tmux session "${config.name}" exited within ` +
|
|
112
138
|
`${settleMs} ms of starting, so the manager is not running. Run the ` +
|
|
113
|
-
`launch in the foreground to see claude's error:\n ${foreground}`,
|
|
139
|
+
`launch in the foreground to see claude's error:\n ${foreground()}`,
|
|
114
140
|
EXIT.SETUP
|
|
115
141
|
);
|
|
116
142
|
}
|
|
@@ -118,7 +144,14 @@ export async function start(ctx) {
|
|
|
118
144
|
json: {
|
|
119
145
|
status: "started",
|
|
120
146
|
name: config.name,
|
|
121
|
-
|
|
147
|
+
notify,
|
|
148
|
+
...(stateDir === undefined ? {} : { stateDir }),
|
|
149
|
+
...(token === null
|
|
150
|
+
? {}
|
|
151
|
+
: {
|
|
152
|
+
tokenSource: token.source,
|
|
153
|
+
...(token.secret ? { secret: token.secret } : {}),
|
|
154
|
+
}),
|
|
122
155
|
attach: `tmux attach -t ${config.name}`,
|
|
123
156
|
},
|
|
124
157
|
};
|
|
@@ -174,7 +207,10 @@ function environmentProblems(ctx, config) {
|
|
|
174
207
|
return [`sessionManager.repos.entries.${key}: ${error.message}`];
|
|
175
208
|
}
|
|
176
209
|
});
|
|
177
|
-
if (
|
|
210
|
+
if (
|
|
211
|
+
notifyProvider(config) === "telegram" &&
|
|
212
|
+
typeof config.notify?.stateDir === "string"
|
|
213
|
+
) {
|
|
178
214
|
try {
|
|
179
215
|
stateDirOf(ctx, config);
|
|
180
216
|
} catch (error) {
|
|
@@ -199,39 +235,3 @@ export function validate(ctx) {
|
|
|
199
235
|
exitCode: errors.length === 0 ? EXIT.OK : EXIT.SETUP,
|
|
200
236
|
};
|
|
201
237
|
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* `status`: is the manager's tmux session up, and what does the ledger say
|
|
205
|
-
* about each worker it dispatched.
|
|
206
|
-
* @param {object} ctx - CLI context
|
|
207
|
-
* @returns {Promise<{ json: object }>} `{manager,control,workers,untracked}`
|
|
208
|
-
*/
|
|
209
|
-
export async function status(ctx) {
|
|
210
|
-
const config = requireConfig(ctx);
|
|
211
|
-
const tmux = run("tmux", buildHasSession(config.name), { env: ctx.env });
|
|
212
|
-
const agents = listAgents(ctx, { all: true });
|
|
213
|
-
const ledger = await readLedger(ctx.root);
|
|
214
|
-
const liveNames = new Set(
|
|
215
|
-
agents.filter(agent => agent.active).map(agent => agent.name)
|
|
216
|
-
);
|
|
217
|
-
const tracked = new Set(Object.values(ledger.items).map(i => i.worker));
|
|
218
|
-
return {
|
|
219
|
-
json: {
|
|
220
|
-
manager: { name: config.name, running: tmux.status === 0 },
|
|
221
|
-
control: ledger.control,
|
|
222
|
-
workers: Object.entries(ledger.items).map(([ref, item]) => ({
|
|
223
|
-
ref,
|
|
224
|
-
worker: item.worker ?? null,
|
|
225
|
-
sessionId: item.sessionId ?? null,
|
|
226
|
-
repo: item.repo ?? null,
|
|
227
|
-
status: item.status ?? null,
|
|
228
|
-
attempts: item.attempts ?? 0,
|
|
229
|
-
pendingQuestion: Boolean(item.pendingQuestion),
|
|
230
|
-
live: liveNames.has(item.worker),
|
|
231
|
-
})),
|
|
232
|
-
untracked: [...liveNames]
|
|
233
|
-
.filter(name => parseWorkerName(name) !== null && !tracked.has(name))
|
|
234
|
-
.sort(),
|
|
235
|
-
},
|
|
236
|
-
};
|
|
237
|
-
}
|