lean-agents 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +407 -0
- package/LICENSE +21 -0
- package/README.es.md +560 -0
- package/README.md +559 -2
- package/core/AGENTS.es.md +60 -0
- package/core/AGENTS.md +60 -0
- package/core/README.md +8 -0
- package/core/agents/debug.md +14 -0
- package/core/agents/explore.md +13 -0
- package/core/agents/planner.md +14 -0
- package/core/agents/research.md +13 -0
- package/core/agents/review.md +13 -0
- package/core/copilot-usage-tui.js +189 -0
- package/core/mcp.json +38 -0
- package/core/pins.json +39 -0
- package/core/tiers.json +4 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.d.mts +503 -0
- package/node_modules/@clack/core/dist/index.mjs +1003 -0
- package/node_modules/@clack/core/package.json +63 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +396 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +949 -0
- package/node_modules/@clack/prompts/dist/index.mjs +1423 -0
- package/node_modules/@clack/prompts/package.json +67 -0
- package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/fast-string-width/license +21 -0
- package/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/fast-string-width/readme.md +42 -0
- package/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
- package/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/node_modules/jsonc-parser/README.md +364 -0
- package/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/node_modules/jsonc-parser/package.json +37 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/package.json +30 -4
- package/profiles/README.md +10 -0
- package/profiles/anthropic-api/gsd-defaults.json +26 -0
- package/profiles/anthropic-api.json +18 -0
- package/profiles/antigravity.json +12 -0
- package/profiles/claude-subscription/gsd-defaults.json +26 -0
- package/profiles/claude-subscription.json +17 -0
- package/profiles/github-copilot/gsd-defaults.json +26 -0
- package/profiles/github-copilot.json +17 -0
- package/profiles/openai-api/gsd-defaults.json +26 -0
- package/profiles/openai-api.json +17 -0
- package/profiles/opencode-go/gsd-defaults.json +26 -0
- package/profiles/opencode-go.json +17 -0
- package/profiles/vertex-gemini/gsd-defaults.json +26 -0
- package/profiles/vertex-gemini.json +18 -0
- package/scripts/adhd-skill.mjs +12 -0
- package/scripts/behavior-diff.sh +47 -0
- package/scripts/bump-pins.mjs +115 -0
- package/scripts/check-private.sh +52 -0
- package/scripts/check-readme.mjs +131 -0
- package/scripts/ci-download.sh +20 -0
- package/scripts/ci-install-opencode-v2.sh +6 -0
- package/scripts/ci-latest-report.mjs +38 -0
- package/scripts/ci-timing.mjs +61 -0
- package/scripts/copilot-context-mode.mjs +33 -0
- package/scripts/labels.sh +56 -0
- package/scripts/lean.mjs +1319 -0
- package/scripts/lib/adapters/antigravity.mjs +83 -0
- package/scripts/lib/adapters/claude.mjs +127 -0
- package/scripts/lib/adapters/copilot-cli.mjs +82 -0
- package/scripts/lib/adapters/cursor.mjs +60 -0
- package/scripts/lib/adapters/opencode-v1.mjs +79 -0
- package/scripts/lib/adapters/opencode-v2.mjs +216 -0
- package/scripts/lib/adapters/vscode-copilot.mjs +56 -0
- package/scripts/lib/adhd.mjs +28 -0
- package/scripts/lib/adopt.mjs +619 -0
- package/scripts/lib/agent-lifecycle.mjs +280 -0
- package/scripts/lib/backup-stamp.mjs +25 -0
- package/scripts/lib/copilot-usage.mjs +49 -0
- package/scripts/lib/doctor.mjs +279 -0
- package/scripts/lib/feedback.mjs +48 -0
- package/scripts/lib/fsops.mjs +319 -0
- package/scripts/lib/gsd.mjs +42 -0
- package/scripts/lib/inventory.mjs +196 -0
- package/scripts/lib/lean-update.mjs +30 -0
- package/scripts/lib/logins.mjs +28 -0
- package/scripts/lib/migrate.mjs +407 -0
- package/scripts/lib/network.mjs +119 -0
- package/scripts/lib/node-runtime.mjs +85 -0
- package/scripts/lib/opencode-backup.mjs +204 -0
- package/scripts/lib/opencode-upgrade.mjs +441 -0
- package/scripts/lib/opencode1.mjs +203 -0
- package/scripts/lib/parallel.mjs +270 -0
- package/scripts/lib/pins-diff.mjs +33 -0
- package/scripts/lib/pins.mjs +52 -0
- package/scripts/lib/plugin-health.mjs +191 -0
- package/scripts/lib/prereqs.mjs +203 -0
- package/scripts/lib/project.mjs +38 -0
- package/scripts/lib/redact.mjs +30 -0
- package/scripts/lib/render.mjs +101 -0
- package/scripts/lib/shell-path.mjs +22 -0
- package/scripts/lib/summary-data.mjs +30 -0
- package/scripts/lib/summary-html.mjs +159 -0
- package/scripts/lib/system.mjs +269 -0
- package/scripts/lib/terminals.mjs +316 -0
- package/scripts/lib/ui.mjs +34 -0
- package/scripts/lib/unverified.mjs +49 -0
- package/scripts/lib/update-plan.mjs +60 -0
- package/scripts/lib/upgrade.mjs +231 -0
- package/scripts/lib/verify-commit.mjs +16 -0
- package/scripts/lib/verify-prompt.mjs +46 -0
- package/scripts/lib/verify-sha256.mjs +20 -0
- package/scripts/lint-workflows.mjs +25 -0
- package/scripts/models-refresh.mjs +58 -0
- package/scripts/parallel.mjs +59 -0
- package/scripts/pins-latest.mjs +66 -0
- package/scripts/release.mjs +71 -0
- package/scripts/verify-pins.mjs +36 -0
- package/scripts/version-watch.mjs +124 -0
package/core/AGENTS.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Global rules
|
|
2
|
+
|
|
3
|
+
{{LANG_RULE}} These rules apply to every project; project rules win when they conflict.
|
|
4
|
+
|
|
5
|
+
## 1. Explain well
|
|
6
|
+
|
|
7
|
+
- Lead with the answer or the decision. Add only the context that is needed.
|
|
8
|
+
- Use skimmable structure: short headings, lists, numbered steps, one idea per point.
|
|
9
|
+
- Write complete, concrete sentences. No filler, apologies or restating the question.
|
|
10
|
+
- Explain the why of every non-obvious decision in one line.
|
|
11
|
+
- If something is uncertain, say so and say how you would verify it. Never invent APIs, flags or versions.
|
|
12
|
+
- When you show a change, say what changed, where (`file:line`) and how to verify it.
|
|
13
|
+
- Use compressed style (Caveman) only when asked or when the answer is trivial. Never for debugging, security or complex explanations.
|
|
14
|
+
|
|
15
|
+
## 2. Think before coding
|
|
16
|
+
|
|
17
|
+
- Do not assume silently. Write down your assumptions.
|
|
18
|
+
- If the request can be read several ways, list them and pick the most likely, or ask when a wrong guess is costly.
|
|
19
|
+
- If a simpler path than the one requested exists, say so before doing it.
|
|
20
|
+
- Name anything that is unclear.
|
|
21
|
+
|
|
22
|
+
## 3. Simplicity first
|
|
23
|
+
|
|
24
|
+
- Write the minimum code that solves the problem. No unrequested features, single-use abstractions or speculative configuration.
|
|
25
|
+
- Do not handle impossible cases.
|
|
26
|
+
- Test: would a senior engineer call this overcomplicated? Then simplify.
|
|
27
|
+
|
|
28
|
+
## 4. Surgical changes
|
|
29
|
+
|
|
30
|
+
- Touch only what the task needs. Do not reformat, "improve" neighboring code or refactor what works.
|
|
31
|
+
- Follow the existing style of the file.
|
|
32
|
+
- Mention unrelated dead code; do not delete it.
|
|
33
|
+
- Remove only what your own change left orphaned.
|
|
34
|
+
- Every changed line must trace back to the request.
|
|
35
|
+
|
|
36
|
+
## 5. Goal-driven execution
|
|
37
|
+
|
|
38
|
+
- Turn vague tasks into verifiable criteria (for example, a test that reproduces the bug and then passes).
|
|
39
|
+
- For multi-step work, write a short plan with one check per step.
|
|
40
|
+
- Never claim done without verifying. If you could not verify, say so.
|
|
41
|
+
|
|
42
|
+
## 6. Token efficiency
|
|
43
|
+
|
|
44
|
+
- Read the minimum: search first (grep{{SERENA_HINT}}) and open only the relevant parts.
|
|
45
|
+
{{TOOL_RULES}}- Do not repeat in your answer content that is already in files or in the conversation.
|
|
46
|
+
- Delegate exploration and bounded tasks to cheap subagents (`explore`, `research`, `review`). Use the strong tier only for planning, architecture or hard bugs, and only when asked or justified.
|
|
47
|
+
- Run subagents in parallel only when they do not touch the same files; otherwise run them in sequence.
|
|
48
|
+
- Give every subagent a goal, limits, allowed files and an output format. Finish with a `review` pass.
|
|
49
|
+
|
|
50
|
+
## 7. Safety
|
|
51
|
+
|
|
52
|
+
- Never read, print, copy or log secrets (API keys, tokens, passwords, auth files).
|
|
53
|
+
- Ask for confirmation before anything irreversible: push, deploy, migrations, mass deletes, overwrites.
|
|
54
|
+
- Back up before editing system or user configuration.
|
|
55
|
+
- Do not install new plugins, hooks or MCP servers without an explicit security review.
|
|
56
|
+
|
|
57
|
+
## 8. Final report
|
|
58
|
+
|
|
59
|
+
- What I did, what I verified (command or result), what is pending.
|
|
60
|
+
- At most one suggested next step.
|
package/core/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# core
|
|
2
|
+
|
|
3
|
+
The single source of truth. Adapters in `agents/` render these files into each agent's format.
|
|
4
|
+
|
|
5
|
+
- `AGENTS.md` / `AGENTS.es.md`: global rules. Placeholders (`{{LANG_RULE}}`, `{{SERENA_HINT}}`, `{{TOOL_RULES}}`) are filled at install time so the rules only mention tools you installed.
|
|
6
|
+
- `agents/`: neutral subagent definitions with a `tier` instead of a model ID.
|
|
7
|
+
- `mcp.json`: MCP servers rendered per agent.
|
|
8
|
+
- `tiers.json`: example tier mapping; real mappings live in `profiles/`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug
|
|
3
|
+
description: Reproduces, isolates and fixes hard bugs. Use when a failure is not obvious after a first look.
|
|
4
|
+
tier: strong
|
|
5
|
+
reasoning: high
|
|
6
|
+
access: read-write
|
|
7
|
+
---
|
|
8
|
+
You fix bugs with evidence.
|
|
9
|
+
|
|
10
|
+
1. Reproduce the failure with the smallest command or test. Show the output.
|
|
11
|
+
2. Form one hypothesis at a time and test it. Record what you ruled out.
|
|
12
|
+
3. Fix the root cause with the smallest change. Do not refactor around it.
|
|
13
|
+
4. Show the same check failing before and passing after.
|
|
14
|
+
5. Report the cause in one sentence, the fix as `path:line`, and the verification.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explore
|
|
3
|
+
description: Fast read-only codebase search. Use to find files, symbols and call sites before reading code.
|
|
4
|
+
tier: fast
|
|
5
|
+
reasoning: low
|
|
6
|
+
access: read-only
|
|
7
|
+
---
|
|
8
|
+
You locate code. You never edit files.
|
|
9
|
+
|
|
10
|
+
- Search before reading: grep, glob and symbol tools first. Open only the lines you need.
|
|
11
|
+
- Return a list of `path:line` entries, each with a one-line summary of why it matters.
|
|
12
|
+
- Never paste whole files. Quote at most 10 lines when a snippet is essential.
|
|
13
|
+
- If the answer is not found, say what you searched and where it most likely lives.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: planner
|
|
3
|
+
description: Plans features and architecture. Use only for multi-step or design-heavy work, or when the user asks for a plan.
|
|
4
|
+
tier: strong
|
|
5
|
+
reasoning: high
|
|
6
|
+
access: read-only
|
|
7
|
+
---
|
|
8
|
+
You plan. You never edit files.
|
|
9
|
+
|
|
10
|
+
- Restate the goal as verifiable success criteria.
|
|
11
|
+
- List assumptions and open questions first; propose the most likely answer for each.
|
|
12
|
+
- Give a short ordered plan. Each step names the files it touches, a check that proves it worked, and which subagent tier should do it.
|
|
13
|
+
- Point out a simpler alternative if one exists.
|
|
14
|
+
- Mark steps that can run in parallel (they must not touch the same files).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: research
|
|
3
|
+
description: Documentation and web research. Use for library APIs, changelogs, versions and current install steps.
|
|
4
|
+
tier: balanced
|
|
5
|
+
reasoning: low
|
|
6
|
+
access: read-only
|
|
7
|
+
---
|
|
8
|
+
You research facts from primary sources. You never edit files.
|
|
9
|
+
|
|
10
|
+
- Prefer official docs, release notes and source repositories over blogs.
|
|
11
|
+
- Return each finding with its source link and the date it was published or checked.
|
|
12
|
+
- Flag anything that differs between versions, and say which version the user is on if known.
|
|
13
|
+
- Say clearly when you could not confirm something. Never fill gaps from memory.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: Reviews a diff for bugs, risky changes and drift from the request. Use after implementation, before reporting done.
|
|
4
|
+
tier: balanced
|
|
5
|
+
reasoning: medium
|
|
6
|
+
access: git-read
|
|
7
|
+
---
|
|
8
|
+
You review changes. You never edit files.
|
|
9
|
+
|
|
10
|
+
- Read the diff (`git diff`, `git show`) and only the surrounding code needed to judge it.
|
|
11
|
+
- Report findings ranked by severity: bug, risk, drift from the request, cleanup.
|
|
12
|
+
- Each finding: `path:line`, what is wrong, a concrete failing scenario, and the smallest fix.
|
|
13
|
+
- If nothing is wrong, say so in one line. Do not invent findings.
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// GitHub Copilot AI-credit allowance in the OpenCode TUI sidebar (lean-agents#123).
|
|
2
|
+
// Local only: `gh api` calls, never a model request. Dollar figure is an estimate (1 credit = $0.01).
|
|
3
|
+
// Rendering follows the sidebar slot pattern (createElement/setProp/insert from the host's @opentui/solid).
|
|
4
|
+
import { execFile } from "node:child_process";
|
|
5
|
+
|
|
6
|
+
const MIN_REFRESH_MS = 5 * 60 * 1000;
|
|
7
|
+
const BAR_WIDTH = 16;
|
|
8
|
+
const ROWS = 4;
|
|
9
|
+
const SEGMENTS = 3;
|
|
10
|
+
|
|
11
|
+
function readQuota() {
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
// shell on Windows: gh may be a .cmd shim there; the arguments are fixed.
|
|
14
|
+
execFile("gh", ["api", "copilot_internal/user"], { timeout: 15000, windowsHide: true, shell: process.platform === "win32" }, (err, stdout) => {
|
|
15
|
+
if (err) return resolve(null);
|
|
16
|
+
try {
|
|
17
|
+
resolve(JSON.parse(stdout));
|
|
18
|
+
} catch {
|
|
19
|
+
resolve(null);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const credits = (n) => Math.round(n).toLocaleString("en-US");
|
|
26
|
+
const dollars = (n) => `$${(n / 100).toFixed(2)}`;
|
|
27
|
+
|
|
28
|
+
function summarize(user) {
|
|
29
|
+
const p = user?.quota_snapshots?.premium_interactions;
|
|
30
|
+
if (!p) return null;
|
|
31
|
+
if (p.unlimited) return { unlimited: true, level: "success" };
|
|
32
|
+
if (![p.entitlement, p.remaining, p.percent_remaining].every(Number.isFinite)) return null;
|
|
33
|
+
const spent = p.entitlement - p.remaining;
|
|
34
|
+
const pct = Math.min(100, Math.max(0, Math.floor(p.percent_remaining)));
|
|
35
|
+
const reset = new Date(`${user.quota_reset_date}T00:00:00Z`);
|
|
36
|
+
const days = Math.max(0, Math.ceil((reset.getTime() - Date.now()) / 86400000));
|
|
37
|
+
return {
|
|
38
|
+
level: pct < 10 ? "error" : pct < 25 ? "warning" : "success",
|
|
39
|
+
pct,
|
|
40
|
+
spent,
|
|
41
|
+
left: p.remaining,
|
|
42
|
+
resetLabel: reset.toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: "UTC" }),
|
|
43
|
+
days,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function toastMessage(s) {
|
|
48
|
+
if (s.unlimited) return "Unlimited premium requests";
|
|
49
|
+
return `Spent ${credits(s.spent)} (${dollars(s.spent)}) · Left ${credits(s.left)} (${dollars(s.left)}) · ${s.pct}% left · resets ${s.resetLabel} (in ${s.days} days)`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Rows of [color, text] segments for the sidebar box.
|
|
53
|
+
function rowsFor(state, theme) {
|
|
54
|
+
const s = state.summary;
|
|
55
|
+
const muted = theme.textMuted;
|
|
56
|
+
if (!s) return [[[muted, state.loaded ? "unavailable (gh api failed)" : "loading..."]]];
|
|
57
|
+
if (s.unlimited) return [[[theme.success ?? theme.text, "Unlimited premium requests"]]];
|
|
58
|
+
const color = theme[s.level] ?? theme.text;
|
|
59
|
+
const filled = Math.round((s.pct / 100) * BAR_WIDTH);
|
|
60
|
+
return [
|
|
61
|
+
[[color, "█".repeat(filled)], [theme.borderSubtle ?? muted, "░".repeat(BAR_WIDTH - filled)], [color, ` ${s.pct}% left`]],
|
|
62
|
+
[[muted, "Spent".padEnd(8)], [theme.text, credits(s.spent).padEnd(8)], [muted, dollars(s.spent)]],
|
|
63
|
+
[[muted, "Left".padEnd(8)], [theme.text, credits(s.left).padEnd(8)], [muted, dollars(s.left)]],
|
|
64
|
+
[[muted, "Resets".padEnd(8)], [theme.text, s.resetLabel], [muted, ` · in ${s.days} days`]],
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// The slot renders once per mount, so later data is painted into the mounted text nodes directly.
|
|
69
|
+
function paint(state, mounted) {
|
|
70
|
+
if (!mounted.rows) return;
|
|
71
|
+
const { solid, theme } = mounted;
|
|
72
|
+
const rows = rowsFor(state, theme);
|
|
73
|
+
mounted.rows.forEach((row, r) => {
|
|
74
|
+
const segments = rows[r] ?? [];
|
|
75
|
+
solid.setProp(row.box, "visible", segments.length > 0);
|
|
76
|
+
row.texts.forEach((t, i) => {
|
|
77
|
+
const [fg, value] = segments[i] ?? [theme.textMuted, ""];
|
|
78
|
+
solid.setProp(t, "fg", fg);
|
|
79
|
+
solid.setProp(t, "content", value);
|
|
80
|
+
solid.setProp(t, "visible", value !== "");
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function render(solid, theme, state, mounted) {
|
|
86
|
+
const box = solid.createElement("box");
|
|
87
|
+
const props = { borderStyle: "rounded", borderColor: theme.borderSubtle, title: " Copilot credits ", flexDirection: "column", paddingLeft: 1, paddingRight: 1 };
|
|
88
|
+
for (const [k, v] of Object.entries(props)) solid.setProp(box, k, v);
|
|
89
|
+
const rows = Array.from({ length: ROWS }, () => {
|
|
90
|
+
const row = solid.createElement("box");
|
|
91
|
+
solid.setProp(row, "flexDirection", "row");
|
|
92
|
+
const texts = Array.from({ length: SEGMENTS }, () => {
|
|
93
|
+
const t = solid.createElement("text");
|
|
94
|
+
solid.insert(row, t);
|
|
95
|
+
return t;
|
|
96
|
+
});
|
|
97
|
+
solid.insert(box, row);
|
|
98
|
+
return { box: row, texts };
|
|
99
|
+
});
|
|
100
|
+
Object.assign(mounted, { solid, theme, rows });
|
|
101
|
+
paint(state, mounted);
|
|
102
|
+
return box;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Host adapters: 1.x passes api (slots.register, api.command), 2.x passes context (ui.slot, keymap.layer).
|
|
106
|
+
// Both feed the same state, rendering and refresh logic; `theme` is normalised to the 1.x token names.
|
|
107
|
+
function start(host) {
|
|
108
|
+
const state = { summary: null, loaded: false, fetchedAt: 0 };
|
|
109
|
+
const mounted = {};
|
|
110
|
+
let inFlight = false;
|
|
111
|
+
|
|
112
|
+
const refresh = async () => {
|
|
113
|
+
if (inFlight) return state.summary;
|
|
114
|
+
inFlight = true;
|
|
115
|
+
try {
|
|
116
|
+
state.summary = summarize(await readQuota());
|
|
117
|
+
state.loaded = true;
|
|
118
|
+
state.fetchedAt = Date.now();
|
|
119
|
+
paint(state, mounted);
|
|
120
|
+
host.requestRender();
|
|
121
|
+
} catch {
|
|
122
|
+
state.summary = null;
|
|
123
|
+
state.loaded = true;
|
|
124
|
+
paint(state, mounted);
|
|
125
|
+
} finally {
|
|
126
|
+
inFlight = false;
|
|
127
|
+
}
|
|
128
|
+
return state.summary;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const toast = (s) =>
|
|
132
|
+
host.toast(
|
|
133
|
+
s
|
|
134
|
+
? { title: "Copilot credits", variant: s.level === "success" ? "info" : s.level, duration: 8000, message: toastMessage(s) }
|
|
135
|
+
: { title: "Copilot credits", variant: "warning", message: "Unavailable: `gh api copilot_internal/user` failed" },
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
return host.solid().then((solid) => {
|
|
139
|
+
if (solid) host.slot(() => render(solid, host.theme(), state, mounted));
|
|
140
|
+
host.command(async () => toast(await refresh()));
|
|
141
|
+
host.onIdle(() => {
|
|
142
|
+
if (Date.now() - state.fetchedAt >= MIN_REFRESH_MS) refresh().catch(() => {});
|
|
143
|
+
});
|
|
144
|
+
refresh().then((first) => {
|
|
145
|
+
if (!solid || (first && first.level !== "success")) toast(first);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const COMMAND = { title: "Copilot usage", value: "copilot-usage.show", description: "credits left", category: "Usage", slash: { name: "copilot-usage" } };
|
|
151
|
+
const solidModule = () => import("@opentui/solid").catch(() => null);
|
|
152
|
+
|
|
153
|
+
const plugin = {
|
|
154
|
+
id: "lean-copilot-usage",
|
|
155
|
+
// OpenCode 1.x TUI plugin (verified on 1.19.0).
|
|
156
|
+
tui: async (api) => {
|
|
157
|
+
const offs = [];
|
|
158
|
+
await start({
|
|
159
|
+
solid: solidModule,
|
|
160
|
+
theme: () => api.theme.current,
|
|
161
|
+
requestRender: () => api.renderer.requestRender(),
|
|
162
|
+
toast: (t) => api.ui.toast(t),
|
|
163
|
+
slot: (fn) => api.slots.register({ order: 950, slots: { sidebar_content: fn } }),
|
|
164
|
+
command: (run) => offs.push(api.command?.register(() => [{ ...COMMAND, onSelect: async (dialog) => { dialog?.clear?.(); await run(); } }])),
|
|
165
|
+
onIdle: (fn) => offs.push(api.event?.on?.("session.idle", fn)),
|
|
166
|
+
});
|
|
167
|
+
api.lifecycle?.onDispose?.(() => offs.forEach((off) => off?.()));
|
|
168
|
+
},
|
|
169
|
+
// OpenCode 2.x TUI plugin (docs: https://opencode.ai/docs/build/plugins/cli): context.ui.slot, context.keymap.layer, context.ui.toast.show.
|
|
170
|
+
setup: async (context) => {
|
|
171
|
+
const t = context.theme;
|
|
172
|
+
const offs = [];
|
|
173
|
+
await start({
|
|
174
|
+
solid: solidModule,
|
|
175
|
+
theme: () => ({ text: t.text.base, textMuted: t.text.muted, borderSubtle: t.border.base, success: "#98c379", warning: "#e5c07b", error: "#e06c75" }),
|
|
176
|
+
requestRender: () => {},
|
|
177
|
+
toast: (m) => context.ui.toast.show(m),
|
|
178
|
+
slot: (fn) => context.ui.slot({ append: "sidebar.content", render: fn }),
|
|
179
|
+
command: (run) => context.keymap.layer(() => ({ mode: "global", commands: [{ id: COMMAND.value, title: COMMAND.title, group: COMMAND.category, palette: true, slash: COMMAND.slash, run }] })),
|
|
180
|
+
// A finished turn is the 2.x idle signal (the 2.1.4 binary also names `session.idle`; not verified to fire); data.on returns an unsubscribe.
|
|
181
|
+
onIdle: (fn) => offs.push(context.data?.on?.("session.execution.succeeded", fn)),
|
|
182
|
+
});
|
|
183
|
+
return () => offs.forEach((off) => off?.());
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// 2.x wants Plugin.define from the host; on 1.x the import fails and the plain object is used.
|
|
188
|
+
const host2 = await import("@opencode/plugin/tui").catch(() => null);
|
|
189
|
+
export default host2?.Plugin ? host2.Plugin.define(plugin) : plugin;
|
package/core/mcp.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"servers": {
|
|
3
|
+
"serena": {
|
|
4
|
+
"description": "Symbol-level code navigation so agents read less code.",
|
|
5
|
+
"upstream": "https://github.com/oraios/serena",
|
|
6
|
+
"command": ["uvx", "-p", "3.13", "--from", "{pin:serena}", "serena", "start-mcp-server", "--project-from-cwd"],
|
|
7
|
+
"context": { "claude-code": "claude-code", "default": "ide" },
|
|
8
|
+
"optional": true
|
|
9
|
+
},
|
|
10
|
+
"playwright": {
|
|
11
|
+
"description": "Browser automation for checking web UIs.",
|
|
12
|
+
"upstream": "https://github.com/microsoft/playwright-mcp",
|
|
13
|
+
"command": ["npx", "-y", "{pin:playwright-mcp}"],
|
|
14
|
+
"optional": true
|
|
15
|
+
},
|
|
16
|
+
"playwright-extension": {
|
|
17
|
+
"description": "Playwright MCP attached to the user's own signed-in Chrome or Edge through the Playwright Extension.",
|
|
18
|
+
"upstream": "https://github.com/microsoft/playwright-mcp",
|
|
19
|
+
"command": ["npx", "-y", "{pin:playwright-mcp}", "--extension"],
|
|
20
|
+
"optional": true
|
|
21
|
+
},
|
|
22
|
+
"context-mode": {
|
|
23
|
+
"description": "Keeps large tool outputs out of the context window. Used as MCP only where its plugin is unavailable.",
|
|
24
|
+
"upstream": "https://github.com/mksglu/context-mode",
|
|
25
|
+
"command": ["npx", "-y", "{pin:context-mode}", "server"],
|
|
26
|
+
"node_command": ["{node}", "{modules}/context-mode/cli.mjs", "server"],
|
|
27
|
+
"legacy": [
|
|
28
|
+
["npx", "-y", "context-mode"],
|
|
29
|
+
["npx", "-y", "context-mode@{semver}"],
|
|
30
|
+
["npx", "-y", "context-mode@{semver}", "server"],
|
|
31
|
+
["*npx", "-y", "context-mode@{semver}", "server"],
|
|
32
|
+
["*npx.cmd", "-y", "context-mode@{semver}", "server"]
|
|
33
|
+
],
|
|
34
|
+
"optional": false,
|
|
35
|
+
"mcp_only_for": ["opencode-v2", "copilot-cli", "antigravity"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
package/core/pins.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"note": "Known-good versions fetched at run time. Bump only after the real-* job in 'ci' passes with the new version; 'verified' is the day the version was checked against npm or the git tag. Never use a version published in the last 14 days. Entries with ciOnly are harness CLIs that only CI installs: users never get them from lean-agents, so they stay out of state.json and --doctor.",
|
|
3
|
+
"pins": {
|
|
4
|
+
"skills-cli": { "kind": "npm", "source": "skills", "version": "1.7.4", "verified": "2026-11-06", "node": ">=22.20.0", "ci": "real-skills-undo", "integrity": "sha512-lHZJksE8UImNAr+LL6unqq7jERjdFw5EJasm17srycwL7rXHGdCmgu1L1ttLxUO9i3rdH+QQig+px0icHqLmRw==" },
|
|
5
|
+
"playwright-mcp": { "kind": "npm", "source": "@playwright/mcp", "version": "0.0.83", "verified": "2026-11-05", "node": ">=18", "ci": "real-tools", "integrity": "sha512-oNcl+Ae2/IAjhfPeP46BfIkSakfmprY+aOtkv5MjrQ4lPav4/yNtPhL0iq8SlIM90oApWgBDUxaNKvktazUKOg==" },
|
|
6
|
+
"context-mode": { "kind": "npm", "source": "context-mode", "version": "2.1.4", "verified": "2026-11-05", "node": ">=24.15.0", "ci": "real-claude", "integrity": "sha512-KZ/EH2gm6Pfyv+O8AZlv/FFEbKQqZI0irYRntsOXDUgoIVaeSejxskvlwlQBX1/fHWIWJIVMQ7n5RT/RsfLY0g==" },
|
|
7
|
+
"codeburn": { "kind": "npm", "source": "codeburn", "version": "0.9.27", "verified": "2026-11-05", "node": ">=22.13.0", "ci": "real-tools", "integrity": "sha512-dNCy09sYCdvrijcoOun+ZVyTbp/GYGmdBbBTe8uTSLRO8rSWqS4IEOzQdRoPRhbt7twCuSqVBjTNNl+CdTNrKQ==" },
|
|
8
|
+
"autoskills": { "kind": "npm", "source": "autoskills", "version": "0.4.1", "verified": "2026-11-05", "node": ">=22.6.0", "ci": "real-tools", "integrity": "sha512-cAFYRWMlzHbdRUUxQRcTDfhtOWnaItHH9l8Lpky+y1mFzqWMHLh/ke6JVd2Dm3Q/U43Fs3N6AvFF05wbA7r1JQ==" },
|
|
9
|
+
"gsd-core": { "kind": "npm", "source": "@opengsd/gsd-core", "version": "1.19.0", "verified": "2026-11-11", "node": ">=24.0.0", "ci": "real-tools", "integrity": "sha512-3j2ejyDoS4xo0nv9nUwlL8NhgQAEVy4HXsAGdylnEsp2toHTE5AZsDEzZTHv6mpHMtfOyr/vf9ZbdiREyFzvkQ==" },
|
|
10
|
+
"opencode-dcp": { "kind": "npm", "source": "@tarquinen/opencode-dcp", "version": "3.2.0", "verified": "2026-11-05", "ci": "real-opencode-v1", "integrity": "sha512-6tUjeYlbHgMx+0xfB2DiHkknC9G3U5Rk+F4FBsPqAI3vzjaMXGkgsBUNzjL0e5StsEGDmyDTbxtozg6p9mnhng==" },
|
|
11
|
+
"caveman": { "kind": "skill", "source": "JuliusBrussee/caveman", "version": "v4.0.1", "verified": "2026-11-05", "ci": "real-claude", "sha": "d262ab3882952a59312ff3537cd86d894523c5ab" },
|
|
12
|
+
"i-have-adhd": { "kind": "skill", "source": "ayghri/i-have-adhd", "version": "v0.4.1", "verified": "2026-11-05", "ci": "real-tools", "sha": "1ecea1993b7fce257ffbd686c070948b5e07eda6" },
|
|
13
|
+
"lean-update": { "kind": "skill", "source": "estebanmr99/lean-agents", "version": "v0.7.0", "verified": "2026-11-06", "ci": "real-update", "note": "The skill ships in this repo, so a real install needs the pinned tag to exist; real-update checks it." },
|
|
14
|
+
"orca-cli": { "kind": "skill", "source": "stablyai/orca", "version": "v1.4.99", "verified": "2026-11-05", "ci": "real-terminals", "sha": "c36fa1895fb93c0b8989e579a1007ff233d52d6f" },
|
|
15
|
+
"claude-code": { "kind": "npm", "source": "@anthropic-ai/claude-code", "version": "2.1.316", "verified": "2026-11-14", "node": ">=22.0.0", "ci": "real-claude", "ciOnly": true, "integrity": "sha512-i3BpzyDkcCPnsa0CSkWgxGPs7WMsyqDkxkqT0SDxyEC5XMIxEmcUmluWRHG9VSeBY8Vyv+l9X34JvJ/Bj54nBQ==" },
|
|
16
|
+
"opencode-v1": { "kind": "npm", "source": "opencode-ai", "version": "1.19.0", "verified": "2026-11-05", "ci": "real-opencode-v1", "ciOnly": true, "integrity": "sha512-lddJhFwZI3GLlw8VyOo4yNwBVGeVN/mxH6ORh60h69zAXL7QhjSWY9orj10rwO2kxVnxH9dh45uDCWNuiqPb8A==", "hold": "work PC runs 1.19.0; owner decision 2026-11-10", "note": "OpenCode 1.x only; OpenCode 2 is the opencode-v2 pin." },
|
|
17
|
+
"opencode-v2": { "kind": "npm", "source": "@opencode/cli", "version": "2.2.5", "verified": "2026-11-10", "ci": "real-opencode", "ciOnly": true, "integrity": "sha512-sJAwrwuVa5b+pA3O1UOiSDcC9DgdPVmtkWv6aF6q3+rOiOTCqrE41tkz1kyyE2O8BYPs4eOvBuzkQ6oEm8w5Mw==", "note": "CI installs it with its installer script (checked by SHA256 in tests/ci-downloads.json) and --version. Users install OpenCode 2 themselves." },
|
|
18
|
+
"copilot-cli": { "kind": "npm", "source": "@github/copilot", "version": "1.0.105", "verified": "2026-11-11", "ci": "real-copilot", "ciOnly": true, "integrity": "sha512-k5JPVZrc0Ms4YdAmYS80OGxDvwjDZNVqDS3dxphIFUVSTFJRwcHkbHh3yUKk7MEyBjKqQYKLKNAKSF+dVmjl7A==" },
|
|
19
|
+
"serena": { "kind": "git", "source": "oraios/serena", "version": "v2.1.0", "verified": "2026-11-06", "ci": "real-tools", "sha": "5e4f5cd173c7ff3eed37ee3f1de6c266b937c5dc" },
|
|
20
|
+
"ponytail": { "kind": "npm", "source": "@dietrichgebert/ponytail", "version": "5.3.3", "verified": "2026-11-13", "ci": "real-tools", "integrity": "sha512-Gq0ESMi1ZkcY+dvH1dyhOzR3+pYQ/LGW39E4dExcCzhaLe1AMPE43sPrW/JbEiaC986dUWeSzs97WfTABLkdDg==" },
|
|
21
|
+
"ponytail-plugin": { "kind": "marketplace", "source": "DietrichGebert/ponytail", "version": "v5.3.3", "verified": "2026-11-13", "ci": "real-claude", "sha": "7801d061243d7b753bad0e0b3c057cd250b11755" },
|
|
22
|
+
"context-mode-plugin": { "kind": "marketplace", "source": "mksglu/context-mode", "version": "v2.1.4", "verified": "2026-11-06", "ci": "real-claude", "sha": "10a2e677f7605ef8f16dedb37648ead8889addee" },
|
|
23
|
+
"warp-opencode": { "kind": "npm", "source": "@warp-dot-dev/opencode-warp", "version": "0.2.0", "verified": "2026-11-14", "ci": "real-terminals", "integrity": "sha512-/0+sNjo45VMJwtIR9rrHWI1Utoyg2CVFfW8pdkr4n5xGu7oavqcIwo6iepOO1knwz384WVGn2vMcyGmcwGp84Q==" },
|
|
24
|
+
"orca-app": { "kind": "download", "source": "stablyai/orca", "version": "1.4.264", "verified": "2026-11-19", "ci": "real-terminals", "sha256": { "windows-x64": "676c32d9eb955a314356a220ffd8afbefc214f0f348a324620628353ad4535f3", "darwin-x64": "c9752fcd27a5367607117c66d3a791b1f2afac311289936229160ce58748aaf8", "darwin-arm64": "1a1eb8039628094377f4194f866e918229d97c11c1918722a30ab5975d679546" }, "url": { "windows-x64": "https://github.com/stablyai/orca/releases/download/v1.4.264/orca-windows-setup.exe", "darwin-x64": "https://github.com/stablyai/orca/releases/download/v1.4.264/orca-macos-x64.dmg", "darwin-arm64": "https://github.com/stablyai/orca/releases/download/v1.4.264/orca-macos-arm64.dmg" } },
|
|
25
|
+
"warp-app": { "kind": "download", "source": "warp.dev", "version": "0.2026.11.04.08.17.stable_01", "verified": "2026-11-19", "ci": "real-windows", "sha256": { "windows-x64": "a50d6082208a195da9e7f2357da4866e7133b937a28ff1962772e7e232986531" }, "url": { "windows-x64": "https://app.warp.dev/download/windows?version=v0.2026.11.04.08.17.stable_01&arch=x86_64" } },
|
|
26
|
+
"bun": { "kind": "download", "source": "oven-sh/bun", "tagPrefix": "bun-", "version": "1.4.4", "verified": "2026-11-10", "ci": "real-bun", "sha256": { "linux-x64": "bf8ccbfb2b0b80159e0f9a6d15c55317add8077534dbc6130a3edb52fccb395c", "linux-aarch64": "baa6bb36f51d6e58561e02bbea825038a9df454f673d6d776e8bbf86f8c7850e", "windows-x64": "cd2c0fccc78f3ede1f50ca827a15f063eda13d4d150a3d0674f4f6e323d864a5", "windows-aarch64": "2d57a0eec0cb44d95c918c3f9734f60455a1306ae5085d76fc68f44e3ee30d09" }, "note": "Release zip checked against the release SHASUMS256.txt before it is extracted (Linux, Windows). macOS uses Homebrew. Bump by hand: copy the new SHASUMS256.txt values. The daily version-watch reports newer releases." },
|
|
27
|
+
"rtk": { "kind": "tool", "source": "rtk-ai/rtk", "via": "brew", "version": "v1.2.0", "min": "v1.2.0", "verified": "2026-11-18", "ci": "real-tools", "sha256": { "linux-x64": "70fee7b4a548c43dde94c77e2335550981b0bc2fb013691d8c8109b5bd0eda37", "linux-aarch64": "f91a06e94e5fad7dfa87946c811a4bcbc500e6da119fd47033f2a8940bf64f93" }, "note": "Installed by Homebrew or winget, which cannot pin a version: the update plan reports installed vs this version and asks for at least `min`; lean-agents never forces one. On Linux without Homebrew the pinned release tarball is downloaded and checked against these hashes. VERIFY: min is the verified release, not a tested floor." },
|
|
28
|
+
"uv": { "kind": "tool", "source": "astral-sh/uv", "via": "brew", "version": "0.13.7", "min": "0.13.7", "verified": "2026-11-18", "ci": "real-tools", "note": "Same as rtk: Homebrew/winget install, reported with a minimum, not forced. Provides uvx for Serena." },
|
|
29
|
+
"jq": { "kind": "tool", "source": "jqlang/jq", "tagPrefix": "jq-", "via": "brew", "version": "1.8.2", "min": "1.8.2", "verified": "2026-11-20", "ci": "real-tools", "note": "Same as rtk: Homebrew/winget install, reported with a minimum, not forced. Required by the Warp plugin for Claude Code. VERIFY: no CI job installs jq yet; formula `jq` and winget id `jqlang.jq` are from upstream (jqlang.org/download, winget-pkgs)." },
|
|
30
|
+
"gh": { "kind": "tool", "source": "cli/cli", "via": "brew", "version": "v2.103.3", "min": "v2.103.3", "verified": "2026-11-18", "ci": "real-tools", "note": "Same as rtk: Homebrew/winget install, reported with a minimum, not forced." },
|
|
31
|
+
"antigravity-cask": { "kind": "cask", "source": "antigravity-cli", "via": "brew-cask", "version": "1.5.11", "verified": "2026-11-18", "ci": "real-antigravity", "note": "Homebrew cask `antigravity-cli` on macOS (#147). Brew cannot install an older cask version or verify a hash from us, so this is the version checked on the date above, reported by the update plan and the daily watch; lean-agents never moves it. Linux uses the antigravity-installer pin." },
|
|
32
|
+
"claude-installer": { "kind": "download", "source": "claude.ai", "url": "https://claude.ai/install.sh", "version": "script", "verified": "2026-11-19", "ci": "real-claude", "sha256": "2c5506d110560bf618bbe88f678f2c2a0047c86a9c6585fc84976120b1de0b44", "note": "Installer for --install-agent claude; it gets the claude-code pin as its version argument." },
|
|
33
|
+
"claude-installer-win": { "kind": "download", "source": "claude.ai", "url": "https://downloads.claude.ai/claude-code-releases/bootstrap.ps1", "version": "script", "verified": "2026-11-19", "ci": "real-windows", "sha256": "cd17c6b555f761d60373659824bf805e1510538226e4c7028e19d7494937a333", "note": "Installer for --install-agent claude on Windows; it downloads and runs claude.exe install <version>." },
|
|
34
|
+
"homebrew-installer": { "kind": "download", "source": "Homebrew/install", "url": "https://raw.githubusercontent.com/Homebrew/install/e5b3c5834e3932c8aaa42deef4794076c9b0cbf0/install.sh", "version": "script", "verified": "2026-11-18", "ci": "release-build", "sha256": "5f333bbe53bc490e51e7ccb1df8779b3dd6ee73a1a7379efda216edb08ccb148", "note": "Official Homebrew installer for install.sh on a Mac without Homebrew, pinned by commit. Read once: needs sudo, clones brew from GitHub, installs the Xcode Command Line Tools via softwareupdate if missing, prints the PATH lines and edits no shell profile. VERIFY: unattended behavior" },
|
|
35
|
+
"opencode-installer": { "kind": "download", "source": "opencode.ai", "url": "https://raw.githubusercontent.com/anomalyco/opencode/1a5b7239bebd9a282ac7df9a693ffe41b8650342/install", "version": "script", "verified": "2026-11-20", "ci": "real-opencode", "sha256": "bbc4584fd6a888bcd14623b8a63afa0f1b4075a2e84a2c3518cd509b446b3135", "note": "Installer for OpenCode 2 (--install-agent opencode-v2 and the CI install); it gets the opencode-v2 pin as --version. Pinned by upstream commit: opencode.ai/v2/install serves the latest `install` from anomalyco/opencode, whose hash moves with every change (2026-11-20). Same file as opencode.ai/v2/install served on 2026-11-10." },
|
|
36
|
+
"antigravity-installer": { "kind": "download", "source": "antigravity.google", "url": "https://antigravity.google/cli/install.sh", "version": "script", "verified": "2026-11-10", "ci": "real-antigravity", "sha256": "62966c07365423bd4dc209355060744058fb30d60f5323e2d360e39de64e5042", "note": "Installer for the Antigravity CLI on Linux." },
|
|
37
|
+
"cursor-installer": { "kind": "download", "source": "cursor.com", "url": "https://cursor.com/install", "version": "script", "verified": "2026-11-18", "ci": "real-cursor", "sha256": "8ccf20942228a442f840b280acda363b6791798fe692992ac875635b03a8f065", "note": "Installer for the Cursor CLI; the script fixes the CLI version itself." }
|
|
38
|
+
}
|
|
39
|
+
}
|
package/core/tiers.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
MIT License Copyright (c) 2025-Present [Bombshell contributors](https://bomb.sh/team)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# `@clack/core`
|
|
2
|
+
|
|
3
|
+
Clack contains low-level primitives for implementing your own command-line applications.
|
|
4
|
+
|
|
5
|
+
Currently, `TextPrompt`, `SelectPrompt`, and `ConfirmPrompt` are exposed as well as the base `Prompt` class.
|
|
6
|
+
|
|
7
|
+
Each `Prompt` accepts a `render` function.
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import { TextPrompt, isCancel } from '@clack/core';
|
|
11
|
+
|
|
12
|
+
const p = new TextPrompt({
|
|
13
|
+
render() {
|
|
14
|
+
return `What's your name?\n${this.userInputWithCursor}`;
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const name = await p.prompt();
|
|
19
|
+
if (isCancel(name)) {
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
```
|