claude-code-session-manager 0.74.0 → 0.75.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/dist/assets/AgentLibrary-CGplUKxY.js +3 -0
- package/dist/assets/DataModel-DQ15KxVb.js +1 -0
- package/dist/assets/{History-ShwkUTny.js → History-v2TSC_6A.js} +2 -2
- package/dist/assets/{Hooks-Dc5y1rZH.js → Hooks-Co7s6BNB.js} +2 -2
- package/dist/assets/HostBilko-DJj8FWPK.js +1 -0
- package/dist/assets/{Library-BOL6GqFX.js → Library-DQaC9VQ1.js} +1 -1
- package/dist/assets/ListDetail-BwFRfAZm.js +1 -0
- package/dist/assets/MarkdownEditor-C155gNpc.js +1 -0
- package/dist/assets/{McpServers-DuOTxmc4.js → McpServers-BmLgE_gS.js} +2 -2
- package/dist/assets/{Memory-BYJHDz7W.js → Memory-ISwNcS5j.js} +4 -4
- package/dist/assets/Panel-1adjEpj-.js +1 -0
- package/dist/assets/{Permissions-DhYERDVR.js → Permissions-FrCz5cGa.js} +3 -3
- package/dist/assets/Plugins-zUssKp_b.js +2 -0
- package/dist/assets/ProvenanceBadge-CAXqA_HX.js +1 -0
- package/dist/assets/SaveBar-D9cqms3Y.js +1 -0
- package/dist/assets/{Scheduler-Bu6kSkl3.js → Scheduler-dNNc9S11.js} +6 -6
- package/dist/assets/ScopeSwitcher-1wBTne7S.js +1 -0
- package/dist/assets/Settings-BT_expIg.js +3 -0
- package/dist/assets/{SkillReferenceGraph-rKaTHmOg.js → SkillReferenceGraph-CVccq4Cu.js} +1 -1
- package/dist/assets/{Skills-BHlH2uG5.js → Skills-xFpRY0ld.js} +2 -2
- package/dist/assets/SystemPrompt-CEk_71th.js +1 -0
- package/dist/assets/TagLibrary-C2zhihQG.js +1 -0
- package/dist/assets/{TiptapBody-XoQHiqfF.js → TiptapBody-CQKcHKaD.js} +1 -1
- package/dist/assets/Toggle-CQ-IBb8m.js +1 -0
- package/dist/assets/{index-Cs_Lq9-w.js → index-BgbV3sKX.js} +659 -655
- package/dist/assets/{index-D9C8N3pn.css → index-Dbo9R4e0.css} +1 -1
- package/dist/assets/{settingsSchema-BTDJcu2x.js → settingsSchema-D6ccSKqm.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +3 -1
- package/scripts/scheduler-mcp-server.cjs +471 -0
- package/src/main/__tests__/scheduler-autofix-outcome.test.cjs +116 -0
- package/src/main/__tests__/scheduler-autofix-select.test.cjs +113 -7
- package/src/main/__tests__/scheduler-fix-plan-path.test.cjs +119 -0
- package/src/main/__tests__/seedAgentPersonas.test.cjs +105 -0
- package/src/main/__tests__/seedSchedulerMcp.test.cjs +145 -0
- package/src/main/__tests__/seedStatus.test.cjs +100 -0
- package/src/main/agentLibrary.cjs +43 -0
- package/src/main/index.cjs +42 -1
- package/src/main/ipcSchemas.cjs +25 -0
- package/src/main/lib/__tests__/delegationReadiness.test.cjs +185 -0
- package/src/main/lib/__tests__/epicDelegationStats.test.cjs +137 -0
- package/src/main/lib/delegationReadiness.cjs +141 -0
- package/src/main/lib/epicDelegationStats.cjs +124 -0
- package/src/main/lib/promptSessionSchema.cjs +1 -1
- package/src/main/scheduler.cjs +136 -27
- package/src/main/seedAgentPersonas.cjs +92 -0
- package/src/main/seedDevPlugin.cjs +14 -2
- package/src/main/seedSchedulerMcp.cjs +148 -0
- package/src/main/seedStatus.cjs +59 -0
- package/src/preload/api.d.ts +40 -1
- package/src/preload/index.cjs +7 -0
- package/src/seed/agents/architect.md +64 -0
- package/src/seed/agents/dev-lead.md +42 -0
- package/src/seed/prompts/code-review/ac-coverage-check.md +8 -0
- package/src/seed/prompts/code-review/correctness-only.md +8 -0
- package/src/seed/prompts/code-review/full-spectrum-high.md +8 -0
- package/src/seed/prompts/code-review/hallucination-check.md +8 -0
- package/src/seed/prompts/code-review/public-api-compat.md +8 -0
- package/src/seed/prompts/code-review/readability-naming.md +8 -0
- package/src/seed/prompts/debugging/bug-as-failing-test.md +8 -0
- package/src/seed/prompts/debugging/git-bisect-regression.md +8 -0
- package/src/seed/prompts/debugging/instrument-intermittent-bug.md +8 -0
- package/src/seed/prompts/debugging/localize-pipeline-failure.md +8 -0
- package/src/seed/prompts/debugging/reproduce-then-diagnose.md +8 -0
- package/src/seed/prompts/documentation/adr-from-change.md +8 -0
- package/src/seed/prompts/documentation/module-readme.md +8 -0
- package/src/seed/prompts/documentation/onboarding-plan.md +8 -0
- package/src/seed/prompts/documentation/refresh-claude-md.md +8 -0
- package/src/seed/prompts/documentation/tsdoc-public-exports.md +8 -0
- package/src/seed/prompts/git-pr/conventional-commit.md +8 -0
- package/src/seed/prompts/git-pr/draft-pr-title-body.md +8 -0
- package/src/seed/prompts/git-pr/pre-commit-safety-sweep.md +8 -0
- package/src/seed/prompts/git-pr/release-notes-block.md +8 -0
- package/src/seed/prompts/git-pr/split-large-pr.md +8 -0
- package/src/seed/prompts/performance/bundle-startup-audit.md +8 -0
- package/src/seed/prompts/performance/complexity-audit.md +8 -0
- package/src/seed/prompts/performance/cpu-profile-hot-path.md +8 -0
- package/src/seed/prompts/performance/db-query-plan-review.md +8 -0
- package/src/seed/prompts/performance/memory-leak-hunt.md +8 -0
- package/src/seed/prompts/qa/api-contract-tests.md +8 -0
- package/src/seed/prompts/qa/e2e-critical-path.md +8 -0
- package/src/seed/prompts/qa/failing-test-for-bug.md +8 -0
- package/src/seed/prompts/qa/find-missing-test-coverage.md +8 -0
- package/src/seed/prompts/qa/stabilize-flaky-test.md +8 -0
- package/src/seed/prompts/qa/tdd-red-first.md +8 -0
- package/src/seed/prompts/qa/visual-regression-review.md +8 -0
- package/src/seed/prompts/qa/wcag-axe-scan.md +8 -0
- package/src/seed/prompts/refactoring/dead-code-sweep.md +8 -0
- package/src/seed/prompts/refactoring/extract-duplicated-pattern.md +8 -0
- package/src/seed/prompts/refactoring/modernize-legacy-file.md +8 -0
- package/src/seed/prompts/refactoring/reduce-cyclomatic-complexity.md +8 -0
- package/src/seed/prompts/refactoring/tighten-module-boundaries.md +8 -0
- package/src/seed/prompts/security/authz-audit.md +8 -0
- package/src/seed/prompts/security/crypto-correctness.md +8 -0
- package/src/seed/prompts/security/cwe-top-25-hunt.md +8 -0
- package/src/seed/prompts/security/dependency-audit.md +8 -0
- package/src/seed/prompts/security/ipc-boundary-hardening.md +8 -0
- package/src/seed/prompts/security/owasp-top-10-staged-diff.md +8 -0
- package/src/seed/prompts/security/secret-credential-scan.md +8 -0
- package/dist/assets/AgentLibrary-CSnWV6uv.js +0 -3
- package/dist/assets/HostBilko-evd1hD8q.js +0 -1
- package/dist/assets/ListDetail-BPJb2et3.js +0 -1
- package/dist/assets/MarkdownEditor-CACsHVuf.js +0 -1
- package/dist/assets/Panel-n-p8OQLc.js +0 -1
- package/dist/assets/Plugins-D1ckVgo3.js +0 -2
- package/dist/assets/ProvenanceBadge-ByTjDwAX.js +0 -1
- package/dist/assets/SaveBar-_ORUCmZw.js +0 -1
- package/dist/assets/ScopeSwitcher-Css6Sg7Y.js +0 -1
- package/dist/assets/Settings-DlyJjexf.js +0 -3
- package/dist/assets/SystemPrompt-DsgF8xsl.js +0 -1
- package/dist/assets/TagLibrary-Q5QsKMes.js +0 -1
- package/dist/assets/Toggle-BJHhHQOq.js +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: performance/bundle-startup-audit
|
|
3
|
+
title: Bundle size / startup time audit
|
|
4
|
+
category: Performance
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Lists top 20 modules by size, duplicated deps, dev-only leaks, and synchronous imports over 50KB.
|
|
7
|
+
---
|
|
8
|
+
Analyze the production bundle. Report: total gzipped size, top 20 modules by size with their import paths, any duplicated dependency versions, any dev-only dependency leaking into the prod bundle, and any synchronously-imported module over 50 KB that could be lazy-loaded. Suggest concrete `import()` boundaries and tree-shaking opportunities. Cite the entry file:line that pulls each heavy module.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: performance/complexity-audit
|
|
3
|
+
title: Complexity audit on hot data structures
|
|
4
|
+
category: Performance
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Flags every loop over user-scaled data with big-O analysis; proposes O(n) rewrites or justifies n.
|
|
7
|
+
---
|
|
8
|
+
Identify every loop in this module that iterates over user-scaled data (collections whose size grows with user count, request count, or document size). For each, state the time and space complexity in big-O, flag any nested loop over user-scaled data as a complexity hazard, and propose either an O(n) rewrite, an index/Map lookup, or a justification that n is provably bounded. Do not touch loops over constant-sized data (e.g., HTTP methods, weekdays).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: performance/cpu-profile-hot-path
|
|
3
|
+
title: Find the real hot path with a CPU profile
|
|
4
|
+
category: Performance
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Runs a sampling profiler, builds a flame graph, lists top 5 self-time + top 5 inclusive-time functions.
|
|
7
|
+
---
|
|
8
|
+
Hand off to the `perf-profiler` subagent. Run the app under a sampling CPU profiler (`node --cpu-prof`, `0x`, or `clinic flame` depending on stack) while reproducing the slow scenario I describe: [scenario]. Produce a flame graph and report the top 5 functions by self-time and the top 5 by inclusive time. For each, cite file:line, explain why it is hot (algorithmic, I/O, serialization, etc.), and propose a fix. Do not optimize anything that is not in the top 10 — that is premature.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: performance/db-query-plan-review
|
|
3
|
+
title: Database query plan review
|
|
4
|
+
category: Performance
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Runs EXPLAIN ANALYZE on hot-path queries; flags missing indexes, N+1, and over-fetching.
|
|
7
|
+
---
|
|
8
|
+
Find every SQL query or ORM call on the hot path I describe: [path]. For each, run `EXPLAIN ANALYZE` (or the ORM equivalent) and report: rows scanned vs rows returned, missing indexes (sequential scans on large tables), N+1 patterns where one query in a loop should be a single join or batched lookup, and queries returning more columns than the caller uses. Output as a table sorted by estimated cost.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: performance/memory-leak-hunt
|
|
3
|
+
title: Memory leak hunt
|
|
4
|
+
category: Performance
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Snapshot-diffs after 100 iterations to find retained-size growers; pins fix with a regression test.
|
|
7
|
+
---
|
|
8
|
+
Run the app, take a heap snapshot, exercise the suspected leak path 100 times, take a second snapshot, diff them. Report retained-size growers: type, count delta, top retainers in the dominator tree. For each candidate leak cite the file:line that allocates and the file:line that fails to release (missing `removeListener`, unbounded cache, closure capturing a large object, timer not cleared, etc.). Propose a fix and a regression test that snapshot-diffs over N iterations and asserts bounded growth.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/api-contract-tests
|
|
3
|
+
title: API contract test suite
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Exercises happy path, 4xx, auth boundaries, rate limits, idempotency, and pagination for each endpoint.
|
|
7
|
+
---
|
|
8
|
+
Engage the `playwright-api-testing` skill. For each public endpoint, write a request-context test that exercises: 200 happy path with schema validation, 4xx invalid input, 401/403 auth boundaries, 429 rate limit (if applicable), idempotency key replay returns identical body, and pagination correctness. Mock no internals — hit the real test server. Validate response bodies against the OpenAPI schema if one exists; otherwise pin the shape with a snapshot.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/e2e-critical-path
|
|
3
|
+
title: E2E test for the critical user path
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Writes a Playwright test using role/label locators with web-first assertions and no manual sleeps.
|
|
7
|
+
---
|
|
8
|
+
Use the `playwright-e2e` skill to write a Playwright test for this user flow: [describe path]. Use role/label locators (`getByRole`, `getByLabel`, `getByTestId`) — no XPath, no long CSS chains. Rely on Playwright's auto-wait; do not insert `waitForTimeout` or manual sleeps. Use web-first assertions (`expect(locator).toBeVisible()`, etc.) so retries happen automatically. Each test must own its data setup and teardown — no shared state across tests.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/failing-test-for-bug
|
|
3
|
+
title: Generate a failing test that reproduces this bug
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Pins the exact wrong behavior in a test before any fix, using the project's existing test runner.
|
|
7
|
+
---
|
|
8
|
+
I have a bug: [describe symptom + steps to reproduce]. Before any fix, write a failing test that pins the exact wrong behavior. The test must fail today on `main` and pass once the bug is fixed. Use the project's existing test runner and the same file/folder convention as the nearest sibling tests. Run the test and paste the failure output so I can verify it reproduces.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/find-missing-test-coverage
|
|
3
|
+
title: Find missing test coverage on the diff
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Lists untested error paths, branches, and public APIs in the staged diff, ranked by risk.
|
|
7
|
+
---
|
|
8
|
+
Look at the staged diff. For every new or changed function, branch, and error path, check whether at least one test exercises it. List untested behaviors as a checklist with `file:line — behavior — suggested test name`. Prioritize: untested error paths and untested public API > untested branches > untested happy paths. Do not propose tests for trivial getters or for code that is purely delegating.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/stabilize-flaky-test
|
|
3
|
+
title: Convert a Playwright test failure into a stable fix
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Diagnoses a flaky test as real-bug / locator-timing / test-data-leak, then patches and re-runs 10x.
|
|
7
|
+
---
|
|
8
|
+
This Playwright test is flaky / failing: [paste test name or path]. Use the `playwright-debug` skill — pull the trace, identify whether the failure is (a) a real bug, (b) a timing/locator issue, or (c) a test-data leak from another test. For (a) write a smaller reproducer and patch the app; for (b) replace the locator with a role/label/testid locator and rely on auto-wait; for (c) isolate the test's setup/teardown. Re-run 10 times in headed mode to confirm stability.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/tdd-red-first
|
|
3
|
+
title: TDD this feature, RED first
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Forces the RED-GREEN-REFACTOR loop; stops after a confirmed failing test before any implementation.
|
|
7
|
+
---
|
|
8
|
+
Engage the `test-driven-development` skill. We are adding the following feature: [describe behavior here]. Start in RED: write the smallest failing test that captures one observable behavior, run it, confirm it fails for the right reason (assertion failure, not setup error), and stop. Do not write implementation. Once I confirm RED, you will write the minimum implementation to reach GREEN, then refactor with the test still green. Never skip RED.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/visual-regression-review
|
|
3
|
+
title: Visual regression baseline + diff review
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Refreshes screenshot baselines, classifies diffs as intentional / flake / real regression.
|
|
7
|
+
---
|
|
8
|
+
Use the `playwright-visual-testing` skill. Capture or refresh `toHaveScreenshot()` baselines for the primary routes, then run the suite. For any diff, classify as: (1) intentional UI change — update baseline, (2) flake — mask the dynamic region or wait for stable font load, (3) real regression — leave failing and open an issue. Disable animations and wait for `networkidle` before capture. Do not blindly update all baselines on a diff.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: qa/wcag-axe-scan
|
|
3
|
+
title: WCAG 2.2 accessibility scan with axe-core
|
|
4
|
+
category: QA
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Runs axe-core against every route, reports violations by WCAG criterion at A/AA levels.
|
|
7
|
+
---
|
|
8
|
+
Invoke the `playwright-accessibility` skill. Run an axe-core scan against every route in the app, configured for WCAG 2.0/2.1/2.2 levels A and AA. Report findings as a table: severity, WCAG criterion (e.g., 1.4.3 Contrast, 2.4.7 Focus Visible, 2.5.8 Target Size which is new in 2.2), selector, fix. For "incomplete" items where axe could not be certain, list them separately and propose a manual check. Skip AAA unless the project explicitly targets it.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: refactoring/dead-code-sweep
|
|
3
|
+
title: Dead code sweep
|
|
4
|
+
category: Refactoring
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Audits for unused exports/files/deps; verifies absence of dynamic references before proposing deletes.
|
|
7
|
+
---
|
|
8
|
+
Audit the repo for unused exports, unused functions, unused files, unused dependencies, and unreachable branches. Use static analysis (`ts-prune`, `knip`, `depcheck`, or grep + import-graph). For each finding cite file:line and confirm it is genuinely unused by checking for: dynamic imports, string-based references, framework-magic auto-discovery, and re-exports through barrel files. Output a delete-list, then on my go-ahead remove them in a single commit titled `chore: remove dead code`.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: refactoring/extract-duplicated-pattern
|
|
3
|
+
title: Extract a duplicated pattern into one place
|
|
4
|
+
category: Refactoring
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Consolidates 3+ implementations of the same idea; no speculative generality beyond current callers.
|
|
7
|
+
---
|
|
8
|
+
Three or more sites in this repo implement [pattern, e.g., "is path inside $HOME", "atomic file write", "exponential backoff retry"]. Find every implementation with grep, compare them, identify the union of behaviors needed, and consolidate to one canonical implementation in a sensible location. Migrate all callers. Keep test coverage equivalent or better. Do not introduce a generic abstraction beyond what the existing call sites need — concrete duplication is fine; speculative generality is not.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: refactoring/modernize-legacy-file
|
|
3
|
+
title: Modernize a legacy file without changing behavior
|
|
4
|
+
category: Refactoring
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: callbacks→async/await, var→const, magic numbers, narrowed types — observable behavior unchanged.
|
|
7
|
+
---
|
|
8
|
+
Refactor this file to current project conventions: [file path]. Constraints: do NOT change observable behavior, do NOT change the public API, do NOT change the test assertions. You MAY: replace callbacks with async/await, replace `var` with `const`/`let`, replace string concatenation with template literals, extract magic numbers, narrow types, replace try/catch with explicit error returns where the project does that elsewhere. After each commit, run the full test suite and confirm green before continuing.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: refactoring/reduce-cyclomatic-complexity
|
|
3
|
+
title: Reduce cyclomatic complexity on a hot function
|
|
4
|
+
category: Refactoring
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Early returns, guard clauses, small extractions — no new abstractions; preserves signature + tests.
|
|
7
|
+
---
|
|
8
|
+
Hand off to the `refactorer` subagent. This function has too many nested conditionals: [name file:function]. Reduce cyclomatic complexity using early returns, guard clauses, lookup tables, and small extracted helpers — no new abstractions, no design patterns unless the situation actually calls for one. Keep the public signature identical and keep the existing test assertions passing unchanged. Report before/after complexity and line count.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: refactoring/tighten-module-boundaries
|
|
3
|
+
title: Tighten module boundaries
|
|
4
|
+
category: Refactoring
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Demotes single-use exports to module-private; moves test-only helpers to __test__.
|
|
7
|
+
---
|
|
8
|
+
This module's public surface has grown organically: [name the module]. List every exported symbol. For each, classify: (a) used by 3+ external callers — keep public, (b) used by 1-2 external callers — consider inlining at the call site, (c) only used inside this module — make it module-private, (d) only used in tests — move to a `__test__` helper. Apply the demotions. Re-run typecheck and tests after each commit.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security/authz-audit
|
|
3
|
+
title: Auth + authorization audit
|
|
4
|
+
category: Security
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Audits every authenticated route/middleware/IPC handler for broken access control (OWASP A01) and IDOR.
|
|
7
|
+
---
|
|
8
|
+
Audit every authenticated route, middleware, and IPC handler in this repo for broken access control (OWASP A01) and identification/authentication failures (OWASP A07). For each endpoint or handler, state: who can call it, what authz check protects it, whether that check happens before any side effect, and whether the user-supplied identifier is ever trusted without rebinding to the session subject. Flag any TOCTOU windows, missing authorization on object IDs (IDOR), or auth checks that happen after a database write.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security/crypto-correctness
|
|
3
|
+
title: Crypto + secret-handling correctness pass
|
|
4
|
+
category: Security
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Reviews crypto primitives, password hashing, JWT signing, and TLS config against OWASP A02.
|
|
7
|
+
---
|
|
8
|
+
Find every use of crypto primitives, password hashing, JWT signing/verification, and TLS configuration in this repo. Check against OWASP A02 Cryptographic Failures: no MD5/SHA-1 for security, no ECB mode, no PBKDF2 with iteration counts under 600k, bcrypt cost factor ≥ 12, argon2id preferred over bcrypt for new code, JWTs verified with the algorithm pinned (no `alg: none` accepted), nonces never reused with AES-GCM, randomness from `crypto.randomBytes` not `Math.random`. Report file:line + category + suggested fix.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security/cwe-top-25-hunt
|
|
3
|
+
title: Hunt for the CWE Top 25 in this directory
|
|
4
|
+
category: Security
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Sweeps the open directory against the 2024 CWE Top 25; adversarial self-verification before reporting.
|
|
7
|
+
---
|
|
8
|
+
Hand this off to the `security-auditor` subagent. Sweep the directory I have open against the 2024 CWE Top 25 — prioritize CWE-79 (XSS), CWE-787 (out-of-bounds write), CWE-89 (SQL injection), CWE-352 (CSRF), CWE-22 (path traversal), CWE-78 (OS command injection), CWE-94 (code injection), CWE-918 (SSRF), and CWE-77 (command injection). For each hit, cite file:line, name the CWE, show a minimal reproducer or the exact attack input, and propose a patch. Do an adversarial verification pass on your own findings before reporting — drop any you cannot defend.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security/dependency-audit
|
|
3
|
+
title: Dependency audit with exploitability triage
|
|
4
|
+
category: Security
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Runs npm audit and triages each advisory by whether the vulnerable path is actually reachable here.
|
|
7
|
+
---
|
|
8
|
+
Run the `dependency-auditor` subagent. Execute `npm audit --json` (or the equivalent for this stack), then for every high/critical advisory determine whether the vulnerable code path is actually reachable from this application's entrypoints — most transitive advisories are not exploitable here. Group output as: (1) exploitable + needs immediate patch, (2) exploitable but mitigated by configuration, (3) not reachable, low priority, (4) needs human investigation. Cite the advisory ID, the dependent path (`npm ls`), and the proposed remediation (upgrade, override, or replace).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security/ipc-boundary-hardening
|
|
3
|
+
title: IPC / cross-process boundary hardening
|
|
4
|
+
category: Security
|
|
5
|
+
sendMode: paste
|
|
6
|
+
description: Audits every IPC handler for schema validation, path allowlists, URL scheme checks, and shell-safe argv.
|
|
7
|
+
---
|
|
8
|
+
Audit every IPC handler, message-port listener, and main-to-renderer boundary in this repo. For each handler, verify: payload is validated by a schema before use; file paths are validated against an allowlist of roots (no `..` escapes, no symlink follows into denied dirs); URLs are scheme-checked before fetch; shell commands never pass user input through `shell: true`. Output a checklist per handler with PASS/FAIL/UNCLEAR and a one-line patch suggestion for each FAIL.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security/owasp-top-10-staged-diff
|
|
3
|
+
title: Review staged diff for OWASP Top 10 issues
|
|
4
|
+
category: Security
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Sweeps the staged diff against OWASP Top 10:2021 categories and reports findings as a severity table.
|
|
7
|
+
---
|
|
8
|
+
Invoke the `security-review` skill on the currently staged diff. Walk OWASP Top 10:2021 in order (A01 Broken Access Control, A02 Cryptographic Failures, A03 Injection, A04 Insecure Design, A05 Security Misconfiguration, A06 Vulnerable Components, A07 Auth Failures, A08 Software & Data Integrity, A09 Logging Failures, A10 SSRF) and report findings as a markdown table with columns: severity (critical/high/medium/low), OWASP category, file:line, one-sentence description, suggested fix. Skip categories with no findings rather than padding. Do not include style or naming nits — security only.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: security/secret-credential-scan
|
|
3
|
+
title: Secret + credential scan with remediation plan
|
|
4
|
+
category: Security
|
|
5
|
+
sendMode: auto-fire
|
|
6
|
+
description: Greps the tree for hardcoded secrets, checks git history, and orders rotate → redact → gitignore.
|
|
7
|
+
---
|
|
8
|
+
Grep the working tree for hardcoded secrets — API keys, OAuth tokens, JWTs, private keys, database URLs with embedded passwords, and webhook signing secrets. Use both pattern matching (e.g., `sk-`, `xoxb-`, `AKIA`, `-----BEGIN`, `Bearer `) and entropy heuristics on string literals over 20 chars. For each finding report file:line, the secret type, whether it is in tracked git history (`git log -S`), and a remediation order: rotate first, then redact, then add to `.gitignore`/secret manager. Do not print the secret value in clear — show a masked prefix only.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{_ as e,t as V,a5 as m,g as _,b as D,ae as b,ab as X,T as G,ad as Z,al as ee,A as T}from"./index-Cs_Lq9-w.js";import{P as te}from"./Panel-n-p8OQLc.js";import{L as ne}from"./ListDetail-BPJb2et3.js";import"./monaco-editor-BW5C4Iv1.js";function y({children:t,onClick:r,disabled:x,variant:g="default",tooltip:i,type:f="button",className:u}){const v=`px-2 py-0.5 text-xs rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${g==="primary"?"text-accent border-accent/50 hover:bg-bg-hi":g==="danger"?"text-red-400 hover:text-red-300 border-line hover:border-red-400/50":"text-fg-dim border-line hover:text-fg hover:bg-bg-hi"} ${u??""}`,a=e.jsx("button",{type:f,title:i,onClick:r,disabled:x,className:v,children:t});return i?e.jsx(V,{content:i,align:"bottom-center",children:a}):a}const ae=["inherit","haiku","sonnet","opus"],B=["Read","Grep","Glob","Bash","Write","Edit","WebFetch","WebSearch","Task"],se=["","red","orange","yellow","green","cyan","blue","purple","pink"],K={red:"#c0392b",orange:"#b85c34",yellow:"#c9a227",green:"#6f7d52",cyan:"#3f8f8a",blue:"#4a6fa5",purple:"#7a6a8a",pink:"#b45a80"};function R(t){return{name:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:t.tags,projects:t.projects??[],action:t.action??"",actionLabel:t.actionLabel??"",body:t.body}}const I={name:"new-agent",description:"",tools:["Read","Grep"],model:"inherit",color:"",tags:[],projects:[],action:"",actionLabel:"",body:""},re=new Set(G.map(t=>t.tag));function oe(t){return t.filter(r=>re.has(r))}function ie(){const[t,r]=m.useState(null),[x,g]=m.useState(null),[i,f]=m.useState(""),[u,c]=m.useState(null),[v,a]=m.useState(!1),[j,N]=m.useState(!1),[O,C]=m.useState(null),[k,s]=m.useState(!1),w=m.useRef(!0);m.useEffect(()=>()=>{w.current=!1},[]);const h=async n=>{try{const d=await window.api.agents.listPersonas();if(!w.current)return;r(d),g(L=>{var P;return n??L??((P=d[0])==null?void 0:P.name)??null})}catch(d){if(!w.current)return;r([]),b.error(d.message||"failed to load agent personas")}};if(m.useEffect(()=>{h()},[]),m.useEffect(()=>window.api.agents.onChanged(()=>h()),[]),m.useEffect(()=>{const n=X();n&&g(n);const d=L=>g(L.detail);return window.addEventListener("sm:select-persona",d),()=>window.removeEventListener("sm:select-persona",d)},[]),t===null)return e.jsx(_,{title:"loading…"});const $=i.toLowerCase(),E=t.filter(n=>!$||n.name.toLowerCase().includes($)||(n.description??"").toLowerCase().includes($)),l=t.find(n=>n.name===x)??t[0]??null,o=u??(l?R(l):null),F=!!u&&!!l&&JSON.stringify(u)!==JSON.stringify(R(l)),S=v,W=n=>{c(null),a(!1),N(!1),C(null),g(n)},z=n=>c(d=>({...d??(l?R(l):I),...n})),M=()=>{c({...I}),a(!0),N(!1)},J=()=>{o&&(c({...o,name:o.name+"-copy"}),a(!0))},H=()=>{c(null),a(!1)},Y=async()=>{if(o){if(!/^[a-z][a-z0-9-]*$/.test(o.name)){b.error('agent name must be lowercase, hyphenated (e.g. "my-agent")');return}s(!0);try{const n={name:o.name,originalName:S||l==null?void 0:l.name,description:o.description,tools:o.tools,model:o.model,color:o.color,tags:oe(o.tags),projects:o.projects,action:o.action,actionLabel:o.actionLabel,body:o.body};await window.api.agents.savePersona(n),b.info(S?`created ${o.name}`:`saved ${o.name}`),c(null),a(!1),await h(o.name)}catch(n){b.error(n.message||"failed to save agent persona")}finally{s(!1)}}},q=async()=>{if(l){s(!0);try{await window.api.agents.deletePersona({name:l.name}),b.info(`deleted ${l.name}`),N(!1),c(null),a(!1),await h()}catch(n){b.error(n.message||"failed to delete agent persona")}finally{s(!1)}}},Q=async n=>{s(!0);try{await window.api.agents.deletePersona({name:n}),b.info(`deleted ${n}`),C(null),x===n&&(c(null),a(!1)),await h()}catch(d){b.error(d.message||"failed to delete agent persona")}finally{s(!1)}},U=async n=>{if(l)try{await window.api.agents.removeOverride({name:l.name,projectName:n}),b.info(`removed ${n}'s override of ${l.name}`),await h(l.name)}catch(d){b.error(d.message||"failed to remove override")}};return e.jsx(te,{toolbar:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-faint",children:[t.length," persona",t.length===1?"":"s"]}),e.jsx("input",{value:i,onChange:n=>f(n.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-40"}),e.jsx("div",{className:"flex-1"}),e.jsx(y,{variant:"primary",onClick:M,children:"+ New agent"})]}),children:e.jsx(ne,{sidebar:e.jsxs("div",{className:"py-1",children:[S&&e.jsx("div",{className:"w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 bg-bg-hi text-fg border-l-2 border-accent",children:e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsx("span",{className:"truncate font-mono",children:o==null?void 0:o.name}),e.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-accent",children:"new"})]})}),E.length===0&&!S?e.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agent personas found"}):E.map(n=>{const d=!S&&n.name===x,L=d&&F,P=O===n.name;return e.jsxs("div",{"data-agent-row":n.name,className:`group w-full text-left px-3 py-1 text-xs flex flex-col gap-0.5 border-l-2 cursor-pointer ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,onClick:()=>W(n.name),children:[e.jsxs("span",{className:"flex items-center gap-2 justify-between w-full",children:[e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"w-2 h-2 rounded-sm shrink-0",style:{background:n.color?K[n.color]??n.color:"var(--fg-faint, #999)",opacity:n.color?1:.35}}),e.jsx("span",{className:"truncate font-mono",children:n.name})]}),e.jsxs("span",{className:"shrink-0 flex items-center gap-1.5",children:[L&&e.jsx("span",{className:"text-[10px] font-semibold text-accent",children:"unsaved"}),!L&&n.overridingProjects.length>0&&e.jsxs(D,{tone:"dim",children:[n.overridingProjects.length," override",n.overridingProjects.length>1?"s":""]}),P?e.jsxs("span",{className:"flex items-center gap-1",onClick:A=>A.stopPropagation(),children:[e.jsx("button",{onClick:()=>Q(n.name),disabled:k,title:`Delete ${n.name}`,className:"text-[10px] font-semibold text-red-400 hover:text-red-300",children:"confirm"}),e.jsx("button",{onClick:()=>C(null),title:"Cancel",className:"text-[10px] text-fg-faint hover:text-fg",children:"cancel"})]}):e.jsx("button",{onClick:A=>{A.stopPropagation(),C(n.name)},title:`Delete ${n.name}`,className:"opacity-0 group-hover:opacity-100 text-fg-faint hover:text-red-400 transition-opacity",children:"×"})]})]}),n.description&&e.jsx("span",{className:"truncate text-fg-faint",children:n.description})]},n.name)})]}),detail:o?e.jsx(le,{obj:o,set:z,saved:l,dirty:F,isNew:S,busy:k,confirmDelete:j,setConfirmDelete:N,onDuplicate:J,onRevert:H,onSave:Y,onDelete:q,onDropOverride:U}):e.jsx(_,{title:"select an agent"})})})}const he=m.memo(ie);function le({obj:t,set:r,saved:x,dirty:g,isNew:i,busy:f,confirmDelete:u,setConfirmDelete:c,onDuplicate:v,onRevert:a,onSave:j,onDelete:N,onDropOverride:O}){const C=`~/.claude/agents/${t.name}.md`,k=g||i;return e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-line flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-sm font-semibold text-fg font-mono",children:t.name}),i?e.jsx(D,{tone:"accent",children:"unsaved draft"}):g?e.jsx(D,{tone:"warn",children:"edited"}):e.jsx(D,{tone:"good",children:"saved"}),e.jsx("span",{className:"ml-auto text-[11px] text-fg-faint font-mono",children:C})]}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsx(p,{label:"name",hint:"Filename on disk — lowercase, hyphenated.",children:e.jsx("input",{value:t.name,onChange:s=>r({name:s.target.value.toLowerCase()}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg font-mono"})}),e.jsx(p,{label:"description",hint:"Shown in the list and in agent pickers.",children:e.jsx("input",{value:t.description,onChange:s=>r({description:s.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(p,{label:"default model",hint:"This persona's default model for its Epics — sets the --model an Epic launches with (Terminal + Chat both honor it). 'inherit' falls back to each view's own default, not this Settings page. Cheap models for read-only personas; opus for judgement calls.",children:e.jsx(de,{options:ae,value:t.model,onChange:s=>r({model:s}),mono:!0})}),e.jsx(p,{label:"tools",hint:`${t.tools.length} of ${B.length} granted. Anything not ticked is refused at call time.`,children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:B.map(s=>{const w=t.tools.includes(s);return e.jsx("button",{onClick:()=>r({tools:w?t.tools.filter(h=>h!==s):[...t.tools,s]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${w?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"}`,children:s},s)})})}),e.jsx(p,{label:"color",children:e.jsx("div",{className:"flex gap-1.5",children:se.map(s=>e.jsx("button",{title:s||"none",onClick:()=>r({color:s}),className:"w-5 h-5 rounded",style:{background:s?K[s]:"transparent",border:t.color===s?"2px solid var(--accent, #b85c34)":"1px solid var(--line, #555)"}},s||"none"))})}),e.jsx(p,{label:"tags",hint:"Session mission tags this persona is associated with — shown as the default agent on that tag's own page. The first one (in Tag Library order) is the MISSION an Action button's session opens with.",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:G.map(s=>{const w=t.tags.includes(s.tag),h=Z(s.tag);return e.jsxs("button",{onClick:()=>r({tags:w?t.tags.filter($=>$!==s.tag):[...t.tags,s.tag]}),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${w?`${h.bg} ${h.text} ${h.border?"border-current/30":"border-transparent"}`:"bg-bg-hi text-fg-faint border-line"}`,children:["#",s.tag]},s.tag)})})}),e.jsx(ce,{obj:t,set:r}),e.jsx(p,{label:"definition",hint:"The system prompt this persona runs under.",children:e.jsx("textarea",{rows:9,value:t.body,onChange:s=>r({body:s.target.value}),className:"w-full bg-bg border border-line rounded px-2 py-1.5 text-xs text-fg font-mono leading-relaxed resize-y"})}),e.jsx(p,{label:"project overrides",hint:"Open projects that shadow this definition with a local copy.",children:x&&x.overridingProjects.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:x.overridingProjects.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[s,e.jsx("button",{onClick:()=>O(s),title:"Drop the local copy",className:"text-fg-faint hover:text-fg",children:"×"})]},s))}):e.jsx("div",{className:"text-xs text-fg-faint italic",children:i?"save first to see project overrides.":"no open project overlays this agent — the global definition applies everywhere."})})]}),e.jsx("div",{className:"px-4 py-2.5 border-t border-line flex items-center gap-2 flex-wrap",children:u?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-xs text-fg-dim",children:["Delete ",e.jsx("strong",{className:"font-mono",children:t.name})," and its file?"]}),e.jsx(y,{variant:"danger",onClick:N,disabled:f,children:"Delete"}),e.jsx(y,{onClick:()=>c(!1),children:"Keep"})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{onClick:v,disabled:f,children:"Duplicate"}),!i&&e.jsx(y,{variant:"danger",onClick:()=>c(!0),disabled:f,children:"Delete"}),e.jsx("div",{className:"flex-1"}),k&&e.jsx("span",{className:"text-[11px] text-fg-faint",children:"unsaved changes"}),e.jsx(y,{onClick:a,disabled:!k||f,children:"Revert"}),e.jsx(y,{variant:"primary",onClick:j,disabled:!k||f,children:f?"Saving…":i?"Create":"Save"})]})})]})}function ce({obj:t,set:r}){const{projects:x}=ee(),g=x.map(a=>({cwd:a.cwd,name:a.name})),i=new Set(g.map(a=>a.cwd)),f=t.projects.filter(a=>a!==T&&!i.has(a)),u=t.projects.includes(T),c=a=>r({projects:t.projects.includes(a)?t.projects.filter(j=>j!==a):[...t.projects,a]}),v=t.projects.length>0;return e.jsxs(e.Fragment,{children:[e.jsx(p,{label:"action — appears in",hint:"Projects whose Sessions toolbar gets a one-click button for this agent. Pressing it starts a normal session: this persona is the ACTOR, its first tag is the MISSION, and the action text below is the opening goal. Leave empty for an agent that is only picked by hand in the New Session card.",children:e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx("button",{onClick:()=>c(T),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${u?"bg-accent/15 text-accent border-accent/40 font-semibold":"bg-bg-hi text-fg-faint border-line"}`,children:"every project"}),g.map(a=>{const j=t.projects.includes(a.cwd);return e.jsx("button",{title:a.cwd,onClick:()=>c(a.cwd),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border ${j?"bg-sage/15 text-sage-dark border-sage/30":"bg-bg-hi text-fg-faint border-line"} ${u&&!j?"opacity-40":""}`,children:a.name},a.cwd)}),f.map(a=>e.jsxs("button",{title:`${a} — not a known project on this machine`,onClick:()=>c(a),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border bg-bg-hi text-fg-faint border-dashed border-line",children:[a," ×"]},a))]})}),v&&e.jsxs(e.Fragment,{children:[e.jsx(p,{label:"action — button label",hint:"Caption on the Sessions toolbar button. Defaults to the agent name.",children:e.jsx("input",{value:t.actionLabel,onChange:a=>r({actionLabel:a.target.value}),placeholder:t.name,className:"w-full bg-bg border border-line rounded px-2 py-1 text-xs text-fg"})}),e.jsx(p,{label:"action — opening instruction",hint:"Sent as the session's first message, under the AIM framing. Falls back to this persona's description when empty; with neither, no button is shown.",children:e.jsx("textarea",{rows:3,value:t.action,onChange:a=>r({action:a.target.value}),placeholder:t.description||`e.g. /builder
|
|
2
|
-
|
|
3
|
-
Check git vs the published package and publish anything new.`,className:"w-full bg-bg border border-line rounded px-2 py-1.5 text-xs text-fg font-mono leading-relaxed resize-y"})})]})]})}function p({label:t,hint:r,children:x}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] font-semibold uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:t}),x,r&&e.jsx("div",{className:"text-[11px] text-fg-faint mt-1 leading-snug",children:r})]})}function de({options:t,value:r,onChange:x,mono:g}){return e.jsx("div",{className:"flex flex-wrap gap-1",children:t.map(i=>{const f=i===r;return e.jsx("button",{onClick:()=>x(i),className:`px-2.5 py-1 rounded text-xs border ${g?"font-mono":""} ${f?"bg-accent/15 text-accent border-accent/40 font-semibold":"bg-bg-hi text-fg-dim border-line"}`,children:i},i)})})}export{he as AgentLibrary};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as i,af as V,ao as P,ae as m,w as Y,ag as Q,_ as t,g as I,a9 as W}from"./index-Cs_Lq9-w.js";import"./monaco-editor-BW5C4Iv1.js";function X(r){return r.hasMarketingPage?r.packagePrivate&&!r.packageHomepage?{kind:"private-needs-confirm"}:{kind:"ready"}:{kind:"no-marketing-page"}}const Z=["home","marketing","feature","architecture"],ee={home:"Home page",marketing:"Marketing page",feature:"Feature page",architecture:"Architecture page"};function $(r){return ee[r]}function D(r){const n=r.find(l=>l.subpath==="");return Z.map(l=>{const p=r.find(h=>h.source.kind==="project-page-lens"&&h.source.lens===l);return p?{lens:l,status:p.subpath===""?"root":"hosted",subpath:p.subpath,documentId:p.id}:!n&&l==="marketing"?{lens:l,status:"root",subpath:"",documentId:null}:{lens:l,status:"available",subpath:l,documentId:null}})}function te(r){return r.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||"project"}const j="bilko-host-publisher",se="bilko-host-publisher",ne=[{value:"home",label:"Home lens"},{value:"marketing",label:"Marketing lens"},{value:"feature",label:"Feature lens"},{value:"architecture",label:"Architecture lens"}];function ae(r,n){for(const l of Object.values(r))if(l.cwd===n&&l.tag===j&&l.status==="active")return l;return null}function _(r){W(r),window.dispatchEvent(new CustomEvent("sm:navigate",{detail:"terminal"}))}function oe(){const r=V(),n=(r==null?void 0:r.cwd)??null,l=P(e=>e.sessions),p=P(e=>e.createPromptSession),h=P(e=>e.approveProposed),[o,C]=i.useState(null),[R,v]=i.useState(!1),[b,k]=i.useState(""),[E,H]=i.useState(!1),[B,M]=i.useState(!1),[u,A]=i.useState(null),[N,L]=i.useState(""),[f,T]=i.useState(""),[w,O]=i.useState("feature");i.useEffect(()=>{let e=!1;return window.api.agents.listPersonas().then(a=>{if(e)return;const s=a.find(g=>g.name===se);A(s?{name:s.name,description:s.description}:null)}).catch(()=>{e||A(null)}),()=>{e=!0}},[]);const c=i.useCallback(()=>{n&&(v(!1),window.api.bilkoHost.get(n).then(e=>{C(e),k(a=>{var s;return a||((s=e.bundleManifest)==null?void 0:s.slug)||e.defaultSlug}),v(!0)}).catch(e=>{v(!0),m.error(`Could not load bilko-host status: ${e instanceof Error?e.message:String(e)}`)}))},[n]);i.useEffect(()=>{C(null),k(""),H(!1),c()},[c]);const x=n?ae(l,n):null,z=i.useCallback(()=>{!n||!b||(M(!0),window.api.bilkoHost.prepareBundle(n,b).then(()=>c()).catch(e=>m.error(`Could not prepare bundle: ${e instanceof Error?e.message:String(e)}`)).finally(()=>M(!1)))},[n,b,c]),F=i.useCallback(()=>{if(!n)return;const e=te(N).replace(/^-+|-+$/g,"");if(!e||!f.trim()){m.error("A sub-path and a title are required.");return}const a={kind:"project-page-lens",lens:w};window.api.bilkoHost.addDocument(n,e,f.trim(),a).then(()=>{L(""),T(""),c()}).catch(s=>m.error(`Could not add document: ${s instanceof Error?s.message:String(s)}`))},[n,N,f,w,c]),G=i.useCallback((e,a)=>{n&&window.api.bilkoHost.addDocument(n,a,$(e),{kind:"project-page-lens",lens:e}).then(()=>c()).catch(s=>m.error(`Could not add ${e} page: ${s instanceof Error?s.message:String(s)}`))},[n,c]),U=i.useCallback(async()=>{if(!n||!o)return;const e=D(o.documents).filter(a=>a.status==="available");for(const a of e)try{await window.api.bilkoHost.addDocument(n,a.subpath,$(a.lens),{kind:"project-page-lens",lens:a.lens})}catch(s){m.error(`Could not add ${a.lens} page: ${s instanceof Error?s.message:String(s)}`)}c()},[n,o,c]),q=i.useCallback(e=>{n&&window.api.bilkoHost.removeDocument(n,e).then(()=>c()).catch(a=>m.error(`Could not remove document: ${a instanceof Error?a.message:String(a)}`))},[n,c]),J=i.useCallback(async()=>{if(!n||!b)return;if(x){_(x.id);return}const e=`Publish this project to bilko.run as a static-path listing, slug "${b}". Bundle is at session-manager-operations/bilko-host/dist/ (prepare it first via Prepare Bundle if it's missing or stale) — it may contain multiple documents (a root page plus sub-paths); publish the whole dist/ tree as one static-path app.`,{goalText:a,openingPrompt:s}=Y({title:"",goal:e,tag:j,agentName:u==null?void 0:u.name,agentDescription:(u==null?void 0:u.description)??void 0}),g=u?await p(n,a,j,"HostBilko",u.name):await p(n,a,j,"HostBilko");h(g.id,"HostBilko"),Q.getState().send({tabId:g.id,sessionId:g.claudeSessionId,cwd:n,prompt:s}),_(g.id)},[n,b,x,p,h,u]);if(!n)return t.jsx(I,{title:"Open a project to host it on Bilko.run"});if(!R||!o)return null;const y=X(o);if(y.kind==="no-marketing-page")return t.jsx(I,{title:"No Marketing page yet",hint:"Generate this project's Project Pages from Project Home first — the root document publishes the Marketing lens."});const d=o.publishState,K=(d==null?void 0:d.status)??(o.bundleManifest?"bundle-ready":"not-published"),S=y.kind==="ready"||E;return t.jsxs("div",{className:"max-w-2xl space-y-4",children:[t.jsxs("div",{className:"rounded-card border border-line bg-bg-hi p-5 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("div",{className:"font-serif text-lg text-fg",children:o.projectName}),t.jsxs("div",{className:"text-xs text-fg-faint mt-0.5",children:["Status: ",t.jsx("span",{className:"font-mono",children:K}),o.bundleStale&&o.bundleManifest&&t.jsx("span",{className:"ml-2 text-accent",children:"bundle out of date — Prepare Bundle again"})]})]}),(d==null?void 0:d.status)==="published"&&d.url&&t.jsx("a",{href:d.url,target:"_blank",rel:"noreferrer",className:"text-xs text-accent hover:underline",children:d.url})]}),y.kind==="private-needs-confirm"&&!E&&t.jsxs("div",{className:"rounded-md border border-line bg-bg p-3 text-xs text-fg-dim",children:["This project's package.json is marked private with no public homepage. Confirm you want to publish it to bilko.run anyway.",t.jsx("button",{type:"button",onClick:()=>H(!0),className:"mt-2 block rounded-md bg-accent px-3 py-1.5 text-xs font-semibold text-bg-hi hover:bg-accent-dark",children:"Yes, this can be public"})]}),S&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"block text-xs text-fg-faint",children:["Slug (bilko.run/projects/<slug>/)",t.jsx("input",{value:b,onChange:e=>k(e.target.value.toLowerCase()),className:"mt-1 block w-full rounded-md border border-line bg-bg px-2.5 py-1.5 text-sm font-mono text-fg"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{type:"button",onClick:z,disabled:B,className:"rounded-md border border-line bg-bg px-3.5 py-1.5 text-xs font-semibold text-fg hover:bg-bg-hi disabled:opacity-50",children:B?"Preparing…":"Prepare Bundle"}),t.jsx("button",{type:"button",onClick:()=>{J().catch(e=>{m.error(e instanceof Error?e.message:String(e))})},disabled:!o.bundleManifest,title:o.bundleManifest?void 0:"Prepare a bundle first",className:"rounded-md bg-accent px-3.5 py-1.5 text-xs font-semibold text-bg-hi hover:bg-accent-dark disabled:opacity-50",children:x?"View publish in progress":"Publish"})]}),o.bundleManifest&&t.jsxs("div",{className:"text-[11px] text-fg-faint font-mono",children:["bundle: ",(o.bundleManifest.bundle.sizeBytesGz/1024).toFixed(1)," KB gz ·"," ",o.bundleManifest.bundle.fileCount," document",o.bundleManifest.bundle.fileCount===1?"":"s"," · built"," ",new Date(o.bundleManifest.builtAt).toLocaleString()," · ",o.bundleManifest.gitSha]}),(d==null?void 0:d.status)==="publish-failed"&&d.lastError&&t.jsxs("div",{className:"text-xs text-accent",children:["Last publish failed: ",d.lastError]})]})]}),S&&(()=>{const e=D(o.documents),a=e.filter(s=>s.status==="available").length;return t.jsxs("div",{className:"rounded-card border border-line bg-bg-hi p-5 space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"font-serif text-base text-fg",children:"Project Pages"}),a>1&&t.jsxs("button",{type:"button",onClick:U,className:"text-xs text-accent hover:underline",children:["Host all ",a," remaining"]})]}),t.jsxs("p",{className:"text-xs text-fg-faint",children:["This project generates 4 pages (Home / Marketing / Feature / Architecture). Marketing is the project's root (bilko.run/projects/",b||"<slug>","/); host any of the others as their own sub-page if you want them public too."]}),t.jsx("ul",{className:"space-y-1.5",children:e.map(s=>t.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border border-line bg-bg px-3 py-2 text-xs",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-fg capitalize",children:s.lens}),t.jsx("div",{className:"text-fg-faint font-mono truncate",children:s.status==="root"?"(project root)":`/${s.subpath}/`})]}),s.status==="available"?t.jsxs("button",{type:"button",onClick:()=>G(s.lens,s.subpath),className:"shrink-0 rounded-md border border-line px-2 py-1 text-fg hover:bg-bg-hi",children:["+ Host as /",s.subpath,"/"]}):t.jsx("span",{className:"shrink-0 text-fg-faint",children:s.status==="root"?"root":"hosted"})]},s.lens))})]})})(),S&&t.jsxs("div",{className:"rounded-card border border-line bg-bg-hi p-5 space-y-3",children:[t.jsx("div",{className:"font-serif text-base text-fg",children:"Hosted documents"}),t.jsx("p",{className:"text-xs text-fg-faint",children:"One project, one Bilko listing — add as many explanatory pages as you want under it, each at its own sub-path. Removing one here takes it down on the next Publish."}),t.jsx("ul",{className:"space-y-1.5",children:o.documents.map(e=>t.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border border-line bg-bg px-3 py-2 text-xs",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"text-fg truncate",children:e.title}),t.jsxs("div",{className:"text-fg-faint font-mono truncate",children:[e.subpath===""?"(root)":`/${e.subpath}/`," · ",e.url]})]}),e.subpath!==""&&t.jsx("button",{type:"button",onClick:()=>q(e.id),title:"Remove — takes effect on the next Publish",className:"shrink-0 rounded-md border border-line px-2 py-1 text-fg-faint hover:text-accent hover:border-accent/40",children:"Remove"})]},e.id))}),t.jsxs("div",{className:"rounded-md border border-line bg-bg p-3 space-y-2",children:[t.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-fg-faint",children:"Add a document"}),t.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[t.jsx("input",{value:N,onChange:e=>L(e.target.value),placeholder:"sub-path, e.g. special-doc/01",className:"rounded-md border border-line bg-bg-hi px-2.5 py-1.5 text-xs font-mono text-fg"}),t.jsx("input",{value:f,onChange:e=>T(e.target.value),placeholder:"Title",className:"rounded-md border border-line bg-bg-hi px-2.5 py-1.5 text-xs text-fg"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("select",{value:w,onChange:e=>O(e.target.value),className:"rounded-md border border-line bg-bg-hi px-2.5 py-1.5 text-xs text-fg",children:ne.map(e=>t.jsx("option",{value:e.value,children:e.label},e.value))}),t.jsx("button",{type:"button",onClick:F,className:"rounded-md border border-line bg-bg-hi px-3.5 py-1.5 text-xs font-semibold text-fg hover:bg-bg",children:"Add document"})]})]})]})]})}const le=i.memo(oe);export{le as HostBilko};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./index-Cs_Lq9-w.js";function o({sidebar:r,detail:s,sidebarWidth:i="18rem"}){return e.jsxs("div",{className:"h-full flex",children:[e.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:i},children:r}),e.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:s})]})}export{o as L};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as i,F as r}from"./index-Cs_Lq9-w.js";function l({value:e,onChange:n,path:o,readOnly:a}){return i.jsx(r,{path:`file://${o}`,defaultLanguage:"markdown",value:e,onChange:t=>n(t??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,wordWrap:"on",readOnly:a,automaticLayout:!0}})}export{l as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./index-Cs_Lq9-w.js";function n({toolbar:s,footer:l,children:r}){return e.jsxs("div",{className:"h-full flex flex-col",children:[s&&e.jsx("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:s}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:r}),l&&e.jsx("div",{className:"shrink-0 border-t border-line bg-bg-elev",children:l})]})}export{n as P};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkillReferenceGraph-rKaTHmOg.js","./index-Cs_Lq9-w.js","./monaco-editor-BW5C4Iv1.js","./monaco-editor-BTnBOi8r.css","./index-D9C8N3pn.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as e,a5 as h,g as j,ak as U,ae as T,b as X}from"./index-Cs_Lq9-w.js";import{P as R}from"./Panel-n-p8OQLc.js";import{P as K}from"./ProvenanceBadge-ByTjDwAX.js";import{e as Y}from"./Library-BOL6GqFX.js";import{p as W}from"./skillFrontmatter-Dif5JIg7.js";import{_ as Z}from"./monaco-editor-BW5C4Iv1.js";import{L as ee}from"./ListDetail-BPJb2et3.js";import{M as te}from"./MarkdownEditor-CACsHVuf.js";function ne({columns:t,rows:s,getKey:r,onRowClick:a,activeKey:o,empty:d}){return s.length===0?e.jsx("div",{className:"p-6 text-fg-faint text-xs text-center",children:d??"no entries"}):e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{className:"sticky top-0 bg-bg-elev text-fg-faint uppercase tracking-wider",children:e.jsx("tr",{className:"border-b border-line",children:t.map(i=>e.jsx("th",{className:`text-left font-normal px-3 py-1.5 ${i.className??""}`,style:i.width?{width:i.width}:void 0,children:i.header},i.key))})}),e.jsx("tbody",{children:s.map(i=>{const l=r(i),c=o===l;return e.jsx("tr",{"data-row-key":l,onClick:()=>a==null?void 0:a(i),className:`border-b border-line/50 transition-colors ${a?"cursor-pointer":""} ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg-hi/50"}`,children:t.map(m=>e.jsx("td",{className:`px-3 py-1 ${m.className??""}`,children:m.render(i)},m.key))},l)})})]})}async function se(t,s,r){var m,x;const a=`${s}/skills`;try{const n=await window.api.config.listDir(a,{dirsOnly:!0});if(n.ok&&n.entries.length>0)return a}catch{}let o=null;try{const n=await window.api.config.readJson(`${r}/.claude/plugins/installed_plugins.json`);n.exists&&!n.parseError&&n.data&&typeof n.data=="object"&&(o=n.data)}catch{return null}if(!(o!=null&&o.plugins))return null;const d=Object.keys(o.plugins).find(n=>n===t||n.startsWith(`${t}@`));if(!d)return null;const i=(x=(m=o.plugins[d])==null?void 0:m[0])==null?void 0:x.installPath;if(!i)return null;const l=`${i}/skills`;return await window.api.config.exists(l)?l:null}async function ie(t){const s=await window.api.config.listDir(t,{dirsOnly:!0}),r=[];for(const a of s.entries){const o=`${a.path}/SKILL.md`,d=await window.api.config.readText(o);if(!d.exists)continue;const i=W(d.text);r.push({id:a.name,name:i.name,description:i.description,dir:a.path,path:o,body:i.body})}return r}function ae(t){const s=[],r=new Set;for(const a of t)for(const o of t){if(a.id===o.id)continue;const d=o.id.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=[`/${d}\\b`,`\`${d}\``];if(o.id.length>=4&&i.push(`\\b${d}\\b`),!i.some(m=>new RegExp(m,"i").test(a.body)))continue;const c=`${a.id}->${o.id}`;r.has(c)||(r.add(c),s.push({from:a.id,to:o.id}))}return s}const le=h.lazy(()=>Z(()=>import("./SkillReferenceGraph-rKaTHmOg.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(t=>({default:t.SkillReferenceGraph})));function oe({pluginName:t,skills:s,onBack:r,initialSelectedId:a}){var x;const[o,d]=h.useState(a??((x=s[0])==null?void 0:x.id)??null),i=o?s.find(n=>n.id===o)??null:null,l=h.useMemo(()=>ae(s),[s]),[c,m]=h.useState("list");return e.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 h-11 flex items-baseline gap-3.5 px-3 border-b border-line bg-bg",children:[e.jsxs("button",{type:"button",onClick:r,className:"font-mono text-accent hover:underline shrink-0 text-xs",children:["← ",t]}),e.jsx("span",{className:"font-serif text-[22px] text-fg shrink-0 truncate max-w-[16rem]",children:(i==null?void 0:i.name)??(i==null?void 0:i.id)??"skill"}),e.jsx("span",{className:"flex-1"}),e.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:e.jsxs("div",{className:"flex rounded border border-line overflow-hidden",children:[e.jsx("button",{onClick:()=>m("list"),className:`px-2 py-0.5 text-xs ${c==="list"?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:"list"}),e.jsx("button",{onClick:()=>m("graph"),className:`px-2 py-0.5 text-xs ${c==="graph"?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:"graph"})]})})]}),e.jsxs("div",{className:"shrink-0 h-[26px] flex items-center gap-[18px] px-3 bg-bg-elev border-b border-line text-[9px] font-mono uppercase tracking-wide overflow-hidden",children:[i!=null&&i.description?e.jsx("span",{className:"text-fg-dim truncate normal-case",children:i.description}):null,e.jsxs("span",{className:"ml-auto text-fg-faint truncate normal-case",children:[s.length," ",s.length===1?"skill":"skills"," · ",l.length," ",l.length===1?"reference":"references"]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:s.length===0?e.jsx(j,{title:"no skills in this plugin"}):c==="graph"?e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"p-6 text-xs text-fg-faint",children:"Loading graph…"}),children:e.jsx(le,{skills:s,edges:l,selectedId:o,onSelect:d})}):e.jsx(ee,{sidebar:e.jsx("div",{className:"py-1",children:s.map(n=>e.jsxs("button",{onClick:()=>d(n.id),className:`w-full px-3 py-1 text-xs text-left ${o===n.id?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsx("div",{className:"truncate",children:n.name??n.id}),n.description?e.jsx("div",{className:"truncate text-fg-faint",children:n.description}):null]},n.id))}),detail:i?e.jsx("div",{className:"h-full min-h-0",children:e.jsx(te,{path:i.path,value:i.body,onChange:()=>{},readOnly:!0})}):e.jsx(j,{title:"select a skill"})})})]})}const z=t=>{var s,r;return{type:"plugin",name:t.name,repository:(s=t.manifest)==null?void 0:s.repository,homepage:(r=t.manifest)==null?void 0:r.homepage}};function re(){const t=U(),[s,r]=h.useState([]),[a,o]=h.useState(!0),[d,i]=h.useState(null),[l,c]=h.useState("installed");h.useEffect(()=>{if(!t)return;let n=!1;return(async()=>{var y;o(!0);const u=[];try{const g=await window.api.config.readJson(`${t}/.claude/plugins/installed_plugins.json`);if(g.exists&&!g.parseError&&g.data&&typeof g.data=="object"){const w=g.data;for(const[f,L]of Object.entries(w.plugins??{})){if(!Array.isArray(L))continue;const $=f.split("@")[0],E=f.split("@")[1];for(const b of L){if(!(b!=null&&b.installPath))continue;const S={name:$,path:b.installPath,isDirectory:!0,isFile:!1,mtimeMs:0,size:0},N=await fe(S);(y=N.manifest)!=null&&y.version||(N.manifest={...N.manifest??{},version:b.version}),N.marketplace=E,u.push(N)}}}}catch{}n||(u.sort((g,w)=>g.name.localeCompare(w.name)),n||(r(u),o(!1)))})(),()=>{n=!0}},[t]);const m=[{key:"name",header:"name",render:n=>{var u;return e.jsxs("div",{style:{maxWidth:"16rem"},children:[e.jsx("div",{className:"truncate",children:n.name}),(u=n.manifest)!=null&&u.description?e.jsx("div",{className:"truncate text-fg-faint",title:n.manifest.description,children:n.manifest.description}):null]})},width:"16rem"},{key:"origin",header:"origin",render:n=>e.jsx(K,{interactive:!1,input:z(n)}),width:"7rem"},{key:"version",header:"version",render:n=>{var u;return((u=n.manifest)==null?void 0:u.version)??e.jsx("span",{className:"text-fg-faint",children:"—"})},width:"6rem"},{key:"manifest",header:"manifest",render:n=>n.hasManifest?"plugin.json":e.jsx("span",{className:"text-fg-faint",children:"—"}),width:"8rem"},{key:"contents",header:"contents",render:n=>e.jsx("span",{className:"font-mono text-fg-faint text-xs",children:[n.agents>0?`${n.agents} agents`:null,n.skills>0?`${n.skills} skills`:null,n.hooks>0?`${n.hooks} hooks`:null,n.monitors>0?`${n.monitors} monitors`:null,n.binCount>0?`${n.binCount} bin`:null,n.hasLsp?"lsp":null,n.hasMcp?"mcp":null].filter(Boolean).join(" · ")||"—"})},{key:"path",header:"path",render:n=>e.jsx("span",{className:"font-mono text-fg-faint truncate",children:n.path})}];if(l==="library")return e.jsx(R,{toolbar:e.jsx(V,{active:l,onChange:c}),children:e.jsx(Y,{})});const x=d?s.find(n=>n.path===d)??null:null;return e.jsx(R,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(V,{active:l,onChange:c}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsxs("span",{className:"text-fg-faint",children:[s.length," plugins"]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/plugins/installed_plugins.json"})]}),children:a?e.jsx(j,{title:"scanning plugins…"}):x?e.jsx(ce,{row:x,home:t,onBack:()=>i(null)},x.path):e.jsx("div",{className:"flex flex-col h-full",children:e.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:e.jsx(ne,{columns:m,rows:s,getKey:n=>n.path,activeKey:d,onRowClick:n=>i(n.path),empty:e.jsxs(e.Fragment,{children:["no plugins installed",e.jsxs("div",{className:"mt-2 text-fg-faint",children:["drop a plugin into ",e.jsx("code",{children:"~/.claude/plugins/"})]})]})})})})})}const ke=h.memo(re);function V({active:t,onChange:s}){const r=[["installed","Installed"],["library","Library"]];return e.jsx("div",{className:"flex rounded border border-line overflow-hidden",role:"tablist","aria-label":"Plugins view",children:r.map(([a,o])=>e.jsx("button",{onClick:()=>s(a),role:"tab","aria-selected":t===a,className:`px-2 py-0.5 text-xs ${t===a?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:o},a))})}function ce({row:t,home:s,onBack:r}){var b,S,N,I,B;const[a,o]=h.useState([]),[d,i]=h.useState([]),[l,c]=h.useState([]),[m,x]=h.useState([]),[n,u]=h.useState("skills"),[y,g]=h.useState(null),[w,f]=h.useState(!0);h.useEffect(()=>{if(!s)return;let p=!1;return(async()=>{f(!0);try{const[v,G,M,q]=await Promise.all([se(t.name,t.path,s),O(`${t.path}/agents`,{filesOnly:!0}),t.hasMcp?window.api.config.readJson(`${t.path}/.mcp.json`):Promise.resolve(null),O(`${t.path}/bin`,{filesOnly:!0})]),H=v?await ie(v):[],J=G.filter(k=>k.endsWith(".md")),Q=await Promise.all(J.map(k=>window.api.config.readText(`${t.path}/agents/${k}`))),_=[];J.forEach((k,D)=>{const C=Q[D];if(!C.exists)return;const A=W(C.text);_.push({id:k,name:A.name??k.replace(/\.md$/,""),description:A.description})});const F=[];if(M&&M.exists&&!M.parseError&&M.data&&typeof M.data=="object"){const k=M.data.mcpServers;if(k&&typeof k=="object")for(const[D,C]of Object.entries(k)){const A=C&&typeof C=="object"?C.command:void 0;F.push({id:D,name:D,description:typeof A=="string"?A:null})}}if(p)return;o(H),i(_),c(F),x(q),u(H.length>0?"skills":_.length>0?"agents":F.length>0?"mcp":t.hooks>0?"hooks":t.monitors>0?"monitors":t.hasLsp?"lsp":"files")}catch(v){if(p)return;T.error(`Failed to load plugin contents: ${v instanceof Error?v.message:String(v)}`),o([]),i([]),c([]),x([])}finally{p||f(!1)}})(),()=>{p=!0}},[t.path,t.name,t.hasMcp,t.hooks,t.monitors,t.hasLsp,s]);const L=[{key:"skills",label:"Skills",count:a.length},{key:"agents",label:"Agents",count:d.length},{key:"mcp",label:"MCP server",count:l.length},{key:"hooks",label:"Hooks",count:t.hooks},{key:"monitors",label:"Monitors",count:t.monitors},{key:"lsp",label:"LSP",count:t.hasLsp?1:0},{key:"files",label:"Bin",count:m.length}],$=(b=t.manifest)!=null&&b.author?typeof t.manifest.author=="string"?t.manifest.author:t.manifest.author.name??null:null,E=async p=>{const v=await window.api.shell.open({as:"external",url:p});v.ok||T.error(v.error??`Failed to open ${p}`)};return y?e.jsx(oe,{pluginName:((S=t.manifest)==null?void 0:S.name)??t.name,skills:a,initialSelectedId:y.id,onBack:()=>g(null)},y.id):e.jsxs("div",{className:"flex flex-col h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 h-11 flex items-baseline gap-3.5 px-3 border-b border-line bg-bg",children:[e.jsx("button",{type:"button",onClick:r,className:"font-mono text-accent hover:underline shrink-0 text-xs",children:"← Plugins"}),e.jsx("span",{className:"font-serif text-[22px] text-fg shrink-0 truncate max-w-[16rem]",children:((N=t.manifest)==null?void 0:N.name)??t.name}),(I=t.manifest)!=null&&I.version?e.jsxs("span",{className:"font-mono text-fg-faint text-xs shrink-0",children:["v",t.manifest.version]}):null,(B=t.manifest)!=null&&B.description?e.jsx("span",{className:"text-fg-dim text-xs min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:t.manifest.description}):e.jsx("span",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(K,{input:z(t)}),t.hasMcp?e.jsx(X,{tone:"accent",children:"MCP"}):null]})]}),t.manifest?e.jsxs("div",{className:"shrink-0 h-[26px] flex items-center gap-[18px] px-3 bg-bg-elev border-b border-line text-[9px] font-mono uppercase tracking-wide overflow-hidden",children:[$?e.jsxs("span",{className:"text-fg-dim truncate",children:[e.jsx("span",{className:"text-fg-faint",children:"Author "}),$]}):null,t.manifest.license?e.jsxs("span",{className:"text-fg-dim truncate",children:[e.jsx("span",{className:"text-fg-faint",children:"License "}),t.manifest.license]}):null,t.manifest.homepage?e.jsxs("button",{onClick:()=>E(t.manifest.homepage),className:"text-accent hover:underline truncate normal-case",title:t.manifest.homepage,children:[e.jsx("span",{className:"text-fg-faint uppercase",children:"Homepage "}),t.manifest.homepage]}):null,e.jsx("span",{className:"ml-auto text-fg-faint truncate normal-case",children:t.path})]}):e.jsx("div",{className:"shrink-0 h-[26px] flex items-center px-3 bg-bg-elev border-b border-line text-[9px] font-mono uppercase tracking-wide overflow-hidden",children:e.jsx("span",{className:"ml-auto text-fg-faint truncate normal-case",children:t.path})}),e.jsxs("div",{className:"flex-1 min-h-0 grid overflow-hidden",style:{gridTemplateColumns:"170px 1fr"},children:[e.jsx("div",{className:"min-h-0 overflow-auto bg-bg-elev border-r border-line py-1",children:L.map(p=>e.jsxs("button",{type:"button",disabled:p.count===0,onClick:()=>u(p.key),className:`w-full text-left px-3 py-1.5 text-xs flex items-center justify-between ${p.count===0?"text-fg-faint opacity-50 cursor-default":n===p.key?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[e.jsx("span",{children:p.label}),p.count>0?e.jsx("span",{className:"font-mono text-fg-faint",children:p.count}):null]},p.key))}),e.jsx("div",{className:"min-h-0 overflow-auto",children:w?e.jsx(j,{title:"scanning…"}):e.jsx(de,{active:n,row:t,skills:a,agents:d,mcpServers:l,files:m,onOpenSkill:g})})]})]})}function de({active:t,row:s,skills:r,agents:a,mcpServers:o,files:d,onOpenSkill:i}){return t==="skills"?r.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:r.map((l,c)=>e.jsx(P,{n:c+1,name:l.name??l.id,description:l.description,onClick:()=>i(l)},l.id))}):t==="agents"?a.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:a.map((l,c)=>e.jsx(P,{n:c+1,name:l.name??l.id,description:l.description},l.id))}):t==="mcp"?o.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:o.map((l,c)=>e.jsx(P,{n:c+1,name:l.name,description:l.description},l.id))}):t==="hooks"?s.hooks===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:e.jsx(P,{n:1,name:`${s.hooks} ${s.hooks===1?"hook":"hooks"} configured`,description:`${s.path}/hooks/hooks.json`})}):t==="monitors"?s.monitors===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:e.jsx(P,{n:1,name:`${s.monitors} ${s.monitors===1?"monitor":"monitors"} configured`,description:`${s.path}/monitors/monitors.json`})}):t==="lsp"?s.hasLsp?e.jsx("div",{children:e.jsx(P,{n:1,name:"LSP server enabled",description:`${s.path}/.lsp.json`})}):e.jsx(j,{title:"no components"}):d.length===0?e.jsx(j,{title:"no components"}):e.jsx("div",{children:d.map((l,c)=>e.jsx(P,{n:c+1,name:l,description:null},l))})}function P({n:t,name:s,description:r,onClick:a}){const o=a?"button":"div";return e.jsxs(o,{onClick:a,className:`w-full flex items-baseline gap-2.5 py-[9px] px-3 border-b border-line text-left min-w-0 ${a?"hover:bg-bg-hi cursor-pointer":""}`,children:[e.jsx("span",{className:"font-serif text-fg-faint text-xs shrink-0 w-6 text-right",children:String(t).padStart(2,"0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-mono font-semibold text-accent truncate",children:s}),r?e.jsx("div",{className:"text-fg-dim text-xs truncate",children:r}):null]})]})}async function fe(t){let s=`${t.path}/.claude-plugin/plugin.json`,r=await window.api.config.exists(s);r||(s=`${t.path}/plugin.json`,r=await window.api.config.exists(s));let a=null;if(r){const f=await window.api.config.readJson(s);f.exists&&!f.parseError&&f.data&&typeof f.data=="object"&&(a=f.data)}const[o,d,i,l]=await Promise.all([window.api.config.exists(`${t.path}/.lsp.json`),window.api.config.exists(`${t.path}/.mcp.json`),window.api.config.exists(`${t.path}/monitors/monitors.json`),window.api.config.exists(`${t.path}/hooks/hooks.json`)]);let c=0;if(i){const f=await window.api.config.readJson(`${t.path}/monitors/monitors.json`);Array.isArray(f.data)?c=f.data.length:f.data&&typeof f.data=="object"&&Array.isArray(f.data.monitors)&&(c=f.data.monitors.length)}let m=0;if(l){const f=await window.api.config.readJson(`${t.path}/hooks/hooks.json`);if(f.data&&typeof f.data=="object"){const L=f.data;m=Object.values(L).reduce(($,E)=>Array.isArray(E)?$+E.reduce((b,S)=>b+(Array.isArray(S.hooks)?S.hooks.length:0),0):$,0)}}const[x,n,u]=await Promise.all([O(`${t.path}/agents`,{filesOnly:!0}),O(`${t.path}/bin`,{filesOnly:!0}),O(`${t.path}/skills`,{dirsOnly:!0})]),y=x.filter(f=>f.endsWith(".md")).length,g=n.length,w=u.length;return{name:t.name,path:t.path,mtimeMs:t.mtimeMs,hasManifest:r,manifest:a,hasLsp:o,monitors:c,hooks:m,agents:y,skills:w,binCount:g,hasMcp:d}}async function O(t,s){try{return(await window.api.config.listDir(t,s)).entries.map(a=>a.name)}catch{return[]}}export{ke as Plugins};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{x as P,ak as G,a5 as x,_ as i,Z as _,B as R,b as T}from"./index-Cs_Lq9-w.js";import{a as E,C as B,c as L,d as S,b as I}from"./Library-BOL6GqFX.js";const O=e=>`${e}/.claude/session-manager/provenance.json`;function D(e){if(!e||typeof e!="object")return{};const t={};for(const[n,o]of Object.entries(e))(o==="anthropic"||o==="community"||o==="local")&&(t[n]=o);return t}const K=P((e,t)=>({overrides:{},loaded:!1,loading:!1,home:null,load:async n=>{const o=t();if(!(o.home===n&&(o.loaded||o.loading))){e({home:n,loading:!0});try{const r=await window.api.config.readJson(O(n)),d=r.exists?D(r.data):{};e(h=>({overrides:{...d,...h.overrides},loaded:!0,loading:!1}))}catch{e({loaded:!0,loading:!1})}}},setOverride:async(n,o)=>{const r={...t().overrides};o===null?delete r[n]:r[n]=o,e({overrides:r});const d=t().home;if(d)try{await window.api.config.writeJson(O(d),r)}catch{}}})),a=e=>(e??"").toLowerCase().trim(),j=new Set,$=new Set;for(const e of I){const t=e.official?j:$;t.add(a(e.id)),t.add(a(e.name))}const H=new Set(S.filter(e=>e.official).flatMap(e=>[a(e.id),a(e.name)])),J=new Set(S.filter(e=>!e.official).flatMap(e=>[a(e.id),a(e.name)])),U=new Set(L.filter(e=>e.official).flatMap(e=>[a(e.id),a(e.name)])),V=new Set(L.filter(e=>!e.official).flatMap(e=>[a(e.id),a(e.name)])),z=new Set(B.flatMap(e=>[a(e.id),a(e.name)])),Z=new Set(E.flatMap(e=>[a(e.id),a(e.name)])),q=new Set(E.map(e=>e.command.trim())),F=new Set(["security-review","pr-comments","release-notes","add-dir","code-review","simplify"]),Q=/(@anthropic-ai\/|anthropic\.com|github\.com\/anthropics)/i,W=/(^|\s)(npx|uvx|pipx|bunx|mcp-remote|deno\s+run|docker\s+run)(\s|$)/i;function X(e){return[e.command,...e.args??[],e.url,e.repository,e.homepage].filter(Boolean).join(" ").toLowerCase()}const l=e=>({provenance:"anthropic",reason:e}),y=e=>({provenance:"community",reason:e});function Y(e,t,n){switch(e){case"mcp":return j.has(t)?l("official MCP server (catalog)"):$.has(t)?y("third-party server (catalog)"):null;case"skill":case"command":return H.has(t)?l("official Anthropic skill (catalog)"):J.has(t)?y("third-party skill (catalog)"):null;case"plugin":return U.has(t)?l("official Anthropic plugin (catalog)"):V.has(t)?y("third-party plugin (catalog)"):null;case"subagent":return z.has(t)?l("bundled Anthropic subagent (catalog)"):null;case"hook":return Z.has(t)||n&&q.has(n.trim())?l("bundled hook (catalog)"):null}}function ee(e,t){return e.repository?"has a source repository":e.homepage?"has a homepage":e.url?"remote endpoint":W.test(t)?"installed from a package registry":null}function te(e){const t=a(e.name),n=X(e),o=Y(e.type,t,e.command);if(o)return o;if((e.type==="command"||e.type==="skill")&&F.has(t))return l("built-in Claude Code command");if(Q.test(n))return l("Anthropic package or repo");const r=ee(e,n);return r?y(r):{provenance:"local",reason:"no external source — assumed self-created"}}function ne(e,t,n){return`${e}:${t??"-"}:${n}`}const c={anthropic:"Anthropic",community:"Community",local:"Local"},N={anthropic:"accent",community:"warn",local:"dim"},oe=["anthropic","community","local"];function se({input:e,scope:t,interactive:n=!0,className:o=""}){const r=G(),{overrides:d,load:h,setOverride:k}=K(),[b,m]=x.useState(!1),v=x.useRef(null);x.useEffect(()=>{r&&h(r)},[r,h]),x.useEffect(()=>{if(!b)return;const s=C=>{v.current&&!v.current.contains(C.target)&&m(!1)},g=C=>{C.key==="Escape"&&m(!1)};return window.addEventListener("mousedown",s),window.addEventListener("keydown",g),()=>{window.removeEventListener("mousedown",s),window.removeEventListener("keydown",g)}},[b]);const w=ne(e.type,t??null,e.name),f=te(e),p=d[w],u=p??f.provenance,M=p?`Origin manually set to ${c[u]} — auto-detected ${c[f.provenance]} (${f.reason})`:`Auto-detected ${c[u]}: ${f.reason}`,A=i.jsxs(T,{tone:N[u],title:M,className:`${n?"cursor-pointer hover:brightness-125":""} ${o}`,children:[c[u],p&&i.jsx("span",{className:"w-1 h-1 rounded-full bg-current opacity-70","aria-hidden":!0})]});return n?i.jsxs("span",{ref:v,className:"relative inline-flex",children:[i.jsx("button",{type:"button",onClick:s=>{s.stopPropagation(),m(g=>!g)},className:"inline-flex","aria-label":`Origin: ${c[u]}. Click to change.`,children:A}),b&&i.jsxs("span",{className:`absolute ${_.dialog} top-full right-0 mt-1 min-w-[7.5rem] rounded-md border border-line bg-bg-elev shadow-lg py-1 text-left`,onClick:s=>s.stopPropagation(),children:[i.jsx("span",{className:"block px-2 pb-1 text-[10px] uppercase tracking-wide text-fg-faint",children:"Mark origin as"}),oe.map(s=>i.jsxs("button",{type:"button",onClick:()=>{k(w,s),m(!1)},className:`flex w-full items-center gap-2 px-2 py-1 text-[12px] hover:bg-bg-hi/60 ${u===s?"text-fg":"text-fg-dim"}`,children:[i.jsx("span",{className:`w-2 h-2 rounded-full border ${R[N[s]]}`,"aria-hidden":!0}),c[s],p===s&&i.jsx("span",{className:"ml-auto text-[10px] text-fg-faint",children:"set"})]},s)),i.jsx("div",{className:"my-1 border-t border-line"}),i.jsxs("button",{type:"button",onClick:()=>{k(w,null),m(!1)},disabled:!p,className:"flex w-full items-center gap-2 px-2 py-1 text-[12px] text-fg-dim hover:bg-bg-hi/60 disabled:opacity-40 disabled:hover:bg-transparent",title:`Revert to auto-detection (${c[f.provenance]})`,children:["Auto-detect",i.jsx("span",{className:"ml-auto text-[10px] text-fg-faint",children:c[f.provenance]})]})]})]}):A}export{se as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,Q as x}from"./index-Cs_Lq9-w.js";function m({dirty:a,busy:n,parseError:t,lastSavedAt:c,onSave:i,onRevert:l,leading:d}){const s=a&&!n&&!t;return e.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2 text-xs",children:[e.jsx("div",{className:"flex-1 min-w-0 truncate text-fg-faint",children:d}),t&&e.jsx("span",{className:"text-red-400 truncate max-w-xs",title:t,children:t}),!a&&!t&&c&&e.jsx("span",{className:"text-fg-faint",children:x(c)}),a&&!t&&e.jsx("span",{className:"text-accent",children:"unsaved"}),e.jsx("button",{onClick:l,disabled:!a||n,className:"px-2 py-0.5 border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40 disabled:cursor-not-allowed",children:"Revert"}),e.jsx("button",{onClick:i,disabled:!s,className:`px-2.5 py-0.5 rounded border ${s?"border-accent bg-accent/15 text-accent hover:bg-accent/25":"border-line text-fg-faint opacity-50 cursor-not-allowed"}`,children:n?"Saving…":"Save"})]})}export{m as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as i,S as d}from"./index-Cs_Lq9-w.js";function a({scopes:l,active:n,onChange:o,annotate:s}){return i.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:l.map(t=>{const r=d[t],e=s==null?void 0:s(t),c=t===n;return i.jsxs("button",{title:r.hint,onClick:()=>o(t),className:`px-2.5 py-1 text-xs flex items-center gap-1.5 transition-colors ${c?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[i.jsx("span",{children:r.label}),(e==null?void 0:e.dirty)&&i.jsx("span",{className:"w-1 h-1 rounded-full bg-accent",title:"unsaved edits"}),e&&e.exists===!1&&!e.dirty&&i.jsx("span",{className:"w-1 h-1 rounded-full bg-fg-faint",title:"not yet created"})]},t)})})}export{a as S};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a5 as d,_ as e,S,a as Z,g as M,ap as Y,R as Q,ae as X,ak as ee,as as $,am as te,ah as R,J as se,V as ae,r as F}from"./index-Cs_Lq9-w.js";import{P as ne}from"./Panel-n-p8OQLc.js";import{S as re}from"./ScopeSwitcher-Css6Sg7Y.js";import{S as J}from"./SaveBar-_ORUCmZw.js";import{u as le,m as ie,p as oe,a as G,E as ce,s as de}from"./settingsSchema-BTDJcu2x.js";import{T as U}from"./Toggle-BJHhHQOq.js";import"./monaco-editor-BW5C4Iv1.js";const ue=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Model allow/override lists, reasoning depth, and fast-mode toggles — machine-wide, with no per-Epic override yet. An Epic's Agent persona model (Agent Library) still wins over Essentials' plain model default.",advanced:!0,keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],pe={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function B(a){return a.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((l,n)=>{const r=pe[l];return r||(n===0?l.charAt(0).toUpperCase()+l.slice(1):l)}).join(" ")}function K(a){const s=new Set,t=[];for(const n of ue){const r=n.keys.filter(i=>a.has(i));r.forEach(i=>s.add(i)),r.length!==0&&t.push({id:n.id,title:n.title,summary:n.summary,advanced:!!n.advanced,keys:r})}const l=Array.from(a).filter(n=>!s.has(n)&&n!=="$schema").sort();return l.length>0&&t.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:l}),t}function xe(a,s){return K(a).map(t=>({id:t.id,title:t.title,advanced:t.advanced,total:t.keys.length,setCount:t.keys.filter(l=>s.has(l)).length}))}const me={};function V(a,s){if(s)return{text:s,authored:!1};const t=me[a];return t?{text:t,authored:!0}:null}const fe={essentials:"star",git:"link",memory:"memory",model:"sparkle",interface:"eye",updates:"reload",env:"keys",hooks:"hooks",mcp:"mcp",plugins:"plugins",filesystem:"folder",login:"lock",feedback:"send",advanced:"shield",other:"dot"},ge=["user","project","local","default"],he={user:"user",project:"project",local:"local",default:"default"};function be({node:a,targetScope:s,onOverride:t,schema:l}){const[n,r]=d.useState(""),[i,p]=d.useState(!1),[x,v]=d.useState(!0),u=a.kind==="object"?a:null,N=u?Object.keys(u.children):[],g=l.rootKeys(),b=new Set([...N,...g]),c=d.useMemo(()=>K(b),[Array.from(b).sort().join(",")]),h=d.useMemo(()=>xe(b,new Set(N)),[Array.from(b).sort().join(","),N.join(",")]),[C,E]=d.useState(null),m=d.useRef(null),k=o=>{const y=c.find(j=>j.id===o);y!=null&&y.advanced&&!i&&p(!0),E(o)};d.useEffect(()=>{if(!C)return;E(null);const o=m.current,y=document.getElementById(`settings-group-${C}`);if(!o||!y)return;const j=y.getBoundingClientRect().top-o.getBoundingClientRect().top;o.scrollBy({top:j,behavior:"smooth"})},[C]);const w=d.useMemo(()=>c.filter(o=>i||!o.advanced).map(o=>({...o,keys:o.keys.filter(y=>{const j=(u==null?void 0:u.children[y])!==void 0;if(!x&&!j)return!1;if(!n.trim())return!0;const T=l.at([y]);return[y,B(y),(T==null?void 0:T.description)??""].join(" ").toLowerCase().includes(n.toLowerCase())})})).filter(o=>o.keys.length>0),[c,n,i,x,u,l]);return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[e.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",e.jsx("span",{className:"text-fg-dim font-medium",children:S[s].label})]}),e.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:x,onChange:o=>v(o.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),e.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:i,onChange:o=>p(o.target.checked),className:"accent-accent"}),"show advanced"]}),e.jsx("div",{className:"flex-1"}),e.jsx("input",{value:n,onChange:o=>r(o.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[e.jsx(ye,{groups:h,onJump:k}),e.jsxs("div",{ref:m,className:"flex-1 overflow-auto py-3",children:[w.map(o=>e.jsx(ve,{id:o.id,title:o.title,summary:o.summary,advanced:o.advanced,children:o.keys.map(y=>{const j=u==null?void 0:u.children[y],T=l.at([y]);return e.jsx(je,{keyName:y,node:j,info:T,targetScope:s,onOverride:(f,P)=>t([y],f,P)},y)})},o.id)),w.length===0&&e.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',n,'"']})]})]})]})}function ye({groups:a,onJump:s}){return e.jsx("nav",{className:"shrink-0 w-48 border-r border-line bg-bg-elev/30 overflow-y-auto py-3",children:a.map(t=>e.jsxs("button",{onClick:()=>s(t.id),className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-bg-hi transition-colors",title:`jump to ${t.title}`,children:[e.jsx(Z,{name:fe[t.id]??"dot",size:15,className:"text-fg-faint shrink-0"}),e.jsx("span",{className:"flex-1 min-w-0 truncate text-xs text-fg-dim",children:t.title}),e.jsxs("span",{className:"text-[10px] text-fg-faint font-mono shrink-0",children:[t.setCount,"/",t.total]})]},t.id))})}function ve({id:a,title:s,summary:t,advanced:l,children:n}){const[r,i]=d.useState(!0);return e.jsxs("section",{id:`settings-group-${a}`,className:"mx-4 mb-4 rounded-lg border border-line shadow-sm bg-bg-elev/50 overflow-hidden",children:[e.jsxs("header",{className:"px-4 py-3 bg-bg-elev cursor-pointer hover:bg-bg-hi flex items-center gap-3 border-b border-line",onClick:()=>i(!r),children:[e.jsx("span",{className:"text-fg-faint w-3",children:r?"▾":"▸"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-fg text-base font-semibold",children:s}),l&&e.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),e.jsx("p",{className:"text-fg-dim text-sm mt-0.5",children:t})]})]}),r&&e.jsx("div",{className:"divide-y divide-line/60",children:n})]})}function je({keyName:a,node:s,info:t,targetScope:l,onOverride:n}){const[r,i]=d.useState(!1),[p,x]=d.useState(!1),v=B(a),u=s!==void 0,g=(s==null?void 0:s.kind)==="leaf"?s:null,b=(s==null?void 0:s.kind)==="object"||(s==null?void 0:s.kind)==="array",c=t==null?void 0:t.default,h=g&&c!==void 0&&z(g.value,c),C=Oe({isSet:u,leafNode:g,defaultVal:c,isDefault:!!h,node:s}),E=Ne(g,c),m=E.length>=2,k=!!g&&!h,w=V(a,t==null?void 0:t.description);return e.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("button",{onClick:()=>i(!r),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:r?"collapse":"expand",children:r?"▾":"▸"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-fg text-sm",children:v}),e.jsx(Pe,{kind:C.kind,label:C.label}),m&&e.jsxs("button",{onClick:o=>{o.stopPropagation(),r||i(!0),x(y=>!y)},className:"text-[9px] px-1.5 py-0 rounded border border-blue-900/40 bg-blue-950/30 text-blue-300/90 uppercase tracking-wide hover:bg-blue-900/40",title:"this key is defined in multiple scopes — click to expand",children:["drift · ",E.map(o=>he[o]).join(" · ")]}),k&&g&&e.jsx("button",{onClick:o=>{o.stopPropagation(),n(void 0,g.winner)},className:"text-[9px] px-1.5 py-0 rounded border border-line bg-bg-elev text-fg-faint uppercase tracking-wide hover:text-fg hover:bg-bg-hi",title:`reset · delete from ${S[g.winner].label}`,children:"↺ reset"}),(t==null?void 0:t.deprecated)&&e.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(t==null?void 0:t.required)&&!u&&e.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),w&&e.jsx("p",{className:`text-fg-dim text-xs mt-0.5 leading-relaxed ${w.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:w.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:Ae(w.text)}),r&&p&&g&&e.jsx(we,{leaf:g,defaultVal:c,onReset:o=>n(void 0,o)}),r&&e.jsx(ke,{keyName:a,node:s,info:t,targetScope:l,onOverride:o=>n(o)})]}),e.jsx("div",{className:"shrink-0",children:!r&&e.jsx(Te,{node:s,info:t,onSet:o=>{n(o)},disabled:b&&u})})]})})}function Ne(a,s){if(!a)return[];const t=new Set;t.add(a.winner);for(const l of a.shadowed)t.add(l.scope);return s!==void 0&&t.add("default"),ge.filter(l=>t.has(l))}function we({leaf:a,defaultVal:s,onReset:t}){const l={};l[a.winner]={value:a.value,winner:!0};for(const n of a.shadowed)l[n.scope]={value:n.value,winner:!1};return e.jsxs("div",{className:"mt-2 border border-line rounded bg-bg-elev/40 text-xs",children:[e.jsx("div",{className:"px-2 py-1 text-fg-faint border-b border-line/60",children:"Values across all scopes (winner highlighted · reset removes that scope's value):"}),e.jsxs("div",{className:"divide-y divide-line/60",children:[["user","project","local"].map(n=>{const r=l[n],i=r!==void 0;return e.jsxs("div",{className:"grid grid-cols-[5rem_1fr_auto] gap-2 px-2 py-1 items-center",children:[e.jsx("span",{className:"text-fg-faint",children:S[n].label}),e.jsx("span",{className:`font-mono truncate ${r!=null&&r.winner?"text-accent":"text-fg-dim"}`,children:i?A(r.value):e.jsx("span",{className:"text-fg-faint",children:"—"})}),i?e.jsx("button",{onClick:()=>t(n),className:"text-[9px] px-1.5 py-0 rounded border border-line text-fg-faint uppercase tracking-wide hover:text-fg hover:bg-bg-hi",title:`delete this key from ${S[n].label}`,children:"↺"}):e.jsx("span",{})]},n)}),e.jsxs("div",{className:"grid grid-cols-[5rem_1fr_auto] gap-2 px-2 py-1 items-center",children:[e.jsx("span",{className:"text-fg-faint",children:"Default"}),e.jsx("span",{className:"font-mono text-fg-dim truncate",children:s!==void 0?A(s):e.jsx("span",{className:"text-fg-faint",children:"—"})}),e.jsx("span",{})]})]})]})}function ke({keyName:a,node:s,info:t,targetScope:l,onOverride:n}){const i=(s==null?void 0:s.kind)==="leaf"?s:null,p=V(a,t==null?void 0:t.description);return e.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[p&&e.jsx("p",{className:`text-fg-dim leading-relaxed whitespace-pre-wrap ${p.authored?"inline-block border-b border-dotted border-fg-faint/70 cursor-help":""}`,title:p.authored?"In-app-authored description — not from the official Claude Code schema":void 0,children:p.text}),e.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(t==null?void 0:t.type)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Type"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(t.type)?t.type.join(" | "):t.type})]}),(t==null?void 0:t.default)!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Default"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:A(t.default)})]}),(t==null?void 0:t.enum)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Options"}),e.jsx("dd",{className:"text-fg-dim font-mono",children:t.enum.map(x=>String(x)).join(" | ")})]}),i&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Current"}),e.jsxs("dd",{className:"font-mono",children:[e.jsx("span",{className:"text-fg-dim",children:A(i.value)}),e.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",S[i.winner].label]})]})]}),i&&i.shadowed.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Shadowed"}),e.jsx("dd",{className:"space-y-0.5",children:i.shadowed.map((x,v)=>e.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[A(x.value)," —"," ",e.jsx("span",{className:"no-underline",children:S[x.scope].label})]},v))})]}),(s==null?void 0:s.kind)==="array"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:"Accumulated"}),e.jsxs("dd",{className:"text-fg-dim",children:[s.items.length," items across all scopes"]})]})]}),e.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:e.jsx(Se,{keyName:a,node:s,info:t,onChange:n,targetScope:l})})]})}function Se({node:a,info:s,onChange:t,targetScope:l}){const r=(a==null?void 0:a.kind)==="leaf"?a.value:s==null?void 0:s.default,i=W(s==null?void 0:s.type);if(i==="boolean"){const p=r===!0;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-fg-faint",children:"Set to:"}),e.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:x,label:v})=>e.jsx("button",{onClick:()=>t(x),className:`px-3 py-0.5 text-xs transition-colors ${p===x?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:v},v))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",S[l].label]})]})}return s!=null&&s.enum?e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-fg-faint",children:"Choose:"}),s.enum.map(p=>{const x=z(r,p);return e.jsx("button",{onClick:()=>t(p),className:`px-2 py-0.5 text-xs rounded border ${x?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(p)},String(p))}),e.jsxs("span",{className:"text-fg-faint",children:["→ ",S[l].label]})]}):i==="integer"||i==="number"?e.jsx(Ce,{value:typeof r=="number"?r:void 0,integer:i==="integer",onCommit:t,target:S[l].label}):i==="string"?e.jsx(Ee,{value:typeof r=="string"?r:"",onCommit:t,target:S[l].label}):e.jsxs("div",{className:"text-fg-faint",children:["Complex value (",i??"object/array",") — use the"," ",e.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function Ce({value:a,integer:s,onCommit:t,target:l}){const[n,r]=d.useState(a!==void 0?String(a):""),i=()=>{const p=s?parseInt(n,10):parseFloat(n);Number.isNaN(p)||t(p)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-fg-faint",children:"Set to:"}),e.jsx("input",{type:"number",value:n,onChange:p=>r(p.target.value),onBlur:i,onKeyDown:p=>{p.key==="Enter"&&p.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),e.jsxs("button",{onClick:i,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",l]})]})}function Ee({value:a,onCommit:s,target:t}){const[l,n]=d.useState(a);return e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),e.jsx("input",{type:"text",value:l,onChange:r=>n(r.target.value),onKeyDown:r=>{r.key==="Enter"&&s(l)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),e.jsxs("button",{onClick:()=>s(l),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",t]})]})}function Te({node:a,info:s,onSet:t,disabled:l}){const n=(a==null?void 0:a.kind)==="leaf",r=W(s==null?void 0:s.type);if(l)return null;if(r==="boolean"){const i=n&&a.value===!0;return e.jsx("button",{onClick:()=>t(!i),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${i?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:i?"on":"off"})}return null}function Oe({isSet:a,leafNode:s,defaultVal:t,isDefault:l,node:n}){return a?(n==null?void 0:n.kind)==="array"?{kind:"accumulated",label:`${n.items.length} items`}:(n==null?void 0:n.kind)==="object"?{kind:"set",label:"configured"}:s?l?{kind:"default",label:`= default · ${S[s.winner].label}`}:s.shadowed.length>0?{kind:"override",label:`overriding ${s.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${S[s.winner].label}`}:{kind:"set",label:"configured"}:t!==void 0?{kind:"default",label:`using default: ${A(t)}`}:{kind:"unset",label:"not configured"}}function Pe({kind:a,label:s}){const t={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[a];return e.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${t}`,children:s})}function W(a){if(a)return Array.isArray(a)?a.find(t=>t!=="null")??a[0]:a}function z(a,s){return a===s?!0:typeof a!=typeof s?!1:a&&s&&typeof a=="object"?JSON.stringify(a)===JSON.stringify(s):!1}function Ae(a){const s=a.trim().split(`
|
|
2
|
-
`)[0],t=s.match(/^([^.!?]+[.!?])/);return t?t[1]:s.length>120?s.slice(0,120)+"…":s}function A(a){if(typeof a=="string")return a===""?'""':JSON.stringify(a);if(a===null)return"null";if(a===void 0)return"—";if(typeof a=="object"){const s=JSON.stringify(a);return s.length>60?s.slice(0,60)+"…":s}return String(a)}function Re(){const[a,s]=d.useState(null),[t,l]=d.useState(null),[n,r]=d.useState(null),[i,p]=d.useState(null),[x,v]=d.useState(!1),[u,N]=d.useState(null),[g,b]=d.useState(null);if(d.useEffect(()=>{let m=!1;return Promise.all([window.api.otel.getConfig(),window.api.otel.status(),window.api.otel.configPath()]).then(([k,w,o])=>{m||(s(k),r(k),l(w),p(o))}).catch(k=>{console.warn("[telemetry] load failed:",k==null?void 0:k.message)}),()=>{m=!0}},[]),!n||!a)return e.jsx(M,{title:"loading…"});const c=JSON.stringify(n)!==JSON.stringify(a),h=(m,k)=>{N(null),r({...n,[m]:k})},C=async()=>{v(!0),N(null);try{const m=await window.api.otel.setConfig(n);!m.ok&&m.error&&N(m.error),s(m.config),r(m.config),l(m.status),b(Date.now())}catch(m){N(m instanceof Error?m.message:String(m))}finally{v(!1)}},E=()=>{N(null),r(a)};return e.jsxs("div",{className:"p-4 max-w-3xl space-y-5 text-sm",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-fg text-base font-medium",children:"Telemetry — OpenTelemetry export"}),e.jsx("p",{className:"text-fg-dim text-xs leading-relaxed",children:"When enabled, every classified transcript event (tool_use, todo_write, plan, usage, agent_spawn) is mirrored as a 0-duration OTLP/HTTP span. Point this at a local collector (Jaeger, Grafana Tempo, SigNoz, Honeycomb) for cross-session analysis."}),i&&e.jsxs("p",{className:"text-fg-faint text-[11px]",children:["stored at ",e.jsx("span",{className:"font-mono",children:i})]})]}),e.jsxs("section",{className:"border border-line rounded p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-fg",children:"Export transcripts to OTEL"}),e.jsx("div",{className:"text-fg-faint text-xs",children:"Toggle off to disable all span emission immediately."})]}),e.jsx(U,{checked:n.enabled,onChange:m=>h("enabled",m),label:n.enabled?"on":"off"})]}),e.jsxs("label",{className:"block space-y-1",children:[e.jsx("span",{className:"text-fg-dim text-xs",children:"OTLP/HTTP traces endpoint"}),e.jsx("input",{type:"text",value:n.endpoint,onChange:m=>h("endpoint",m.target.value),placeholder:"http://localhost:4318/v1/traces",className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs"})]}),e.jsxs("label",{className:"block space-y-1",children:[e.jsxs("span",{className:"text-fg-dim text-xs",children:["Headers (newline-separated ",e.jsx("span",{className:"font-mono",children:"Key: Value"}),")"]}),e.jsx("textarea",{value:n.headers,onChange:m=>h("headers",m.target.value),placeholder:"x-honeycomb-team: YOUR_API_KEY",rows:3,className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs"})]}),e.jsxs("label",{className:"block space-y-1",children:[e.jsx("span",{className:"text-fg-dim text-xs",children:"Service name"}),e.jsx("input",{type:"text",value:n.serviceName,onChange:m=>h("serviceName",m.target.value),placeholder:"session-manager",className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs"})]}),e.jsxs("div",{className:"flex items-start justify-between gap-3 pt-1",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-fg",children:"Include content (PII)"}),e.jsxs("div",{className:"text-fg-faint text-xs leading-relaxed",children:["Adds tool inputs, plan text, and agent prompts to span attributes. Off by default — matches upstream Claude Code's ",e.jsx("span",{className:"font-mono",children:"OTEL_LOG_USER_PROMPTS"})," opt-in."]})]}),e.jsx(U,{checked:n.includeContent,onChange:m=>h("includeContent",m),label:n.includeContent?"on":"off"})]})]}),t&&e.jsxs("section",{className:"border border-line rounded p-3 text-xs space-y-1",children:[e.jsx("div",{className:"text-fg-dim",children:"Runtime status"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-fg-faint",children:"enabled:"})," ",e.jsx("span",{className:t.enabled?"text-accent":"text-fg-dim",children:String(t.enabled)})]}),t.error&&e.jsxs("div",{className:"text-red-400 break-words",children:[e.jsx("span",{className:"text-fg-faint",children:"error:"})," ",t.error]}),!t.error&&t.enabled&&e.jsx("div",{className:"text-fg-faint",children:"spans batched and exported in the background. Verify by enabling and pointing at a local Jaeger."})]}),e.jsxs("footer",{className:"flex items-center gap-3 pt-2 border-t border-line",children:[e.jsx("button",{onClick:C,disabled:!c||x,className:"px-3 py-1 text-xs rounded bg-accent text-bg disabled:opacity-50 disabled:cursor-not-allowed",children:x?"saving…":"Save"}),e.jsx("button",{onClick:E,disabled:!c||x,className:"px-3 py-1 text-xs rounded border border-line text-fg-dim hover:text-fg disabled:opacity-50 disabled:cursor-not-allowed",children:"Revert"}),u&&e.jsx("span",{className:"text-red-400 text-xs",children:u}),!u&&g&&!c&&e.jsx("span",{className:"text-fg-faint text-xs",children:"saved"})]})]})}function Me(){const{model:a,setModel:s}=Y();return e.jsxs("div",{className:"p-4 max-w-3xl space-y-5 text-sm",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-fg text-base font-medium",children:"Session Manager preferences"}),e.jsx("p",{className:"text-fg-dim text-xs leading-relaxed",children:"Native app preferences, stored locally — not part of Claude Code's own settings."})]}),e.jsx("section",{className:"border border-line rounded p-3 space-y-3",children:e.jsxs("label",{className:"block space-y-1",children:[e.jsx("span",{className:"text-fg-dim text-xs",children:"Default model for raw sessions"}),e.jsx("select",{value:a,onChange:t=>s(t.target.value),className:"w-full bg-bg border border-line rounded px-2 py-1 text-fg font-mono text-xs",children:Q.map(t=>e.jsx("option",{value:t,children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),e.jsx("span",{className:"text-fg-faint text-[11px]",children:"Used when opening a raw interactive session without an explicit per-launch override."})]})})]})}function Ie({cwd:a}){const[s,t]=d.useState(!1),[l,n]=d.useState(!1),[r,i]=d.useState(!1),[p,x]=d.useState(!1);d.useEffect(()=>{var b,c;let g=!1;return t(!1),Promise.resolve((c=(b=window.api.promptSessions)==null?void 0:b.getWorktreeDisabled)==null?void 0:c.call(b,{cwd:a})).then(h=>{g||(n((h==null?void 0:h.disabled)??!1),i((h==null?void 0:h.disabled)??!1),t(!0))},()=>{g||t(!0)}),()=>{g=!0}},[a]);const v=s&&r!==l,u=()=>{var g,b;x(!0),Promise.resolve((b=(g=window.api.promptSessions)==null?void 0:g.setWorktreeDisabled)==null?void 0:b.call(g,{cwd:a,disabled:r})).then(c=>{n((c==null?void 0:c.disabled)??r),i((c==null?void 0:c.disabled)??r)}).catch(c=>X.error(c instanceof Error?c.message:String(c))).finally(()=>x(!1))},N=()=>i(l);return e.jsxs("div",{"data-testid":"settings-epic-isolation",className:"border-b border-line bg-bg-elev px-3 py-2.5 text-[11.5px] leading-snug",children:[e.jsxs("label",{className:"flex items-start gap-2",children:[e.jsx("input",{type:"checkbox",checked:r,disabled:!s||p,onChange:g=>i(g.target.checked),"data-testid":"settings-epic-isolation-checkbox",className:"mt-0.5"}),e.jsxs("span",{children:[e.jsx("span",{className:"font-semibold text-fg",children:"Disable Epic worktree isolation for this project"}),e.jsxs("span",{className:"block text-fg-dim",children:["Off by default — each active Epic runs in its own isolated ",e.jsx("code",{children:"git worktree"})," (branch"," ",e.jsx("code",{children:"sm-epic/<id>"}),"), merged back to main at an explicit checkpoint. Turning this on makes every new Epic in this project run directly in the shared working tree instead, same as before this feature existed."]})]})]}),v&&e.jsx(J,{dirty:v,busy:p,onSave:u,onRevert:N})]})}const H={user:{title:"Global settings",body:"This is the real ~/.claude/settings.json on disk — the same file the claude CLI reads on every session it starts. Edits apply machine-wide, to every project and every session."},project:{title:"Project settings",body:"This is the real <project>/.claude/settings.json on disk, checked into git. Edits apply to every current and future session in this project, for anyone who clones it."},local:{title:"Local settings",body:"This is the real <project>/.claude/settings.local.json on disk, gitignored. Edits apply to every current and future session in this project, on this machine only."}};function Le(){const a=ee(),s=$(f=>f.tabs),t=$(f=>f.activeTabId),l=s.find(f=>f.id===t)??null,n=(l==null?void 0:l.cwd)??null,r=te(f=>f.navFace),i=d.useRef(!1),p=d.useRef(r),[x,v]=d.useState(()=>r==="project"&&n?"project":"user"),[u,N]=d.useState("effective");d.useEffect(()=>{if(p.current!==r){if(p.current=r,i.current){i.current=!1;return}v(r==="project"&&n?"project":"user")}},[r,n]),d.useEffect(()=>{r==="project"&&(u==="telemetry"||u==="app")&&N("effective")},[r,u]);const g=f=>{i.current=!0,v(f)},b=le(F,a,n),c=b[x]??null,h=R(f=>f.files),C=R(f=>f.setDraft),E=R(f=>f.saveJson),m=R(f=>f.revert),[k,w]=d.useState(null),o=d.useMemo(()=>ie(oe(h,b)),[h,b]),y=(f,P,O)=>{var _;const I=b[O??x];if(!I)return;w(null);const D=((_=h[I])==null?void 0:_.draftRaw)??"";let L={};if(D.trim())try{L=JSON.parse(D)}catch{L={}}const q=de(L,f,P);C(I,JSON.stringify(q,null,2)+`
|
|
3
|
-
`)};if(!a)return e.jsx(M,{title:"loading…"});const j=c?h[c]:null,T=f=>f!=="user"&&!n;return e.jsx(ne,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(ae,{options:[{key:"effective",label:"Guided"},{key:"tree",label:"Tree"},{key:"raw",label:"Raw"},...r==="home"?[{key:"telemetry",label:"Telemetry"},{key:"app",label:"Session Manager"}]:[]],active:u,onChange:N}),u!=="telemetry"&&u!=="app"&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx(re,{scopes:F.scopes,active:x,onChange:g,annotate:f=>{if(T(f))return{exists:!1};const P=b[f];if(!P)return null;const O=h[P];return{exists:(O==null?void 0:O.exists)??!1,dirty:(O==null?void 0:O.dirty)??!1}}}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:u==="effective"?`overrides → ${c??"—"}`:c??"—"})]}),e.jsx("div",{className:"flex-1"}),e.jsx("a",{href:"https://code.claude.com/docs/en/settings",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"schema reference ↗"})]}),footer:u!=="telemetry"&&u!=="app"&&c&&j?e.jsx(J,{dirty:j.dirty,busy:j.busy,parseError:k||j.parseError,lastSavedAt:j.lastSavedAt,leading:j.exists?null:e.jsx("span",{children:"file will be created on save"}),onSave:async()=>{w(null);const f=await E(c);f.ok||w(f.error??"save failed")},onRevert:()=>{w(null),m(c)}}):null,children:u==="telemetry"?e.jsx(Re,{}):u==="app"?e.jsx(Me,{}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{"data-testid":"settings-scope-note",className:"sticky top-0 z-10 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:H[x].title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:H[x].body}),c&&e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:c})]}),x==="project"&&n&&e.jsx(Ie,{cwd:n}),T(x)?e.jsx(M,{title:"no active project",hint:"open a tab in a project directory to edit project or local settings"}):u==="effective"?e.jsx(be,{node:o,targetScope:x,onOverride:y,schema:G()}):u==="tree"?e.jsx(ce,{node:o,targetScope:x,onOverride:y,schema:G()}):c&&j?e.jsx(se,{path:c,value:j.draftRaw,onChange:f=>{w(null),C(c,f)}}):e.jsx(M,{title:"resolving…"})]})})}const Be=d.memo(Le);export{H as SETTINGS_SCOPE_NOTES,Be as Settings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as l,ae as _,_ as e,aj as $,X as B,Y as I,aa as V,y as z,c as H,e as L,j as M,M as D,E as X,z as Y,ak as q,C as G,ah as h,g as P}from"./index-Cs_Lq9-w.js";import{P as T}from"./Panel-n-p8OQLc.js";import{S as J}from"./SaveBar-_ORUCmZw.js";import{f as K,V as A}from"./Library-BOL6GqFX.js";import"./monaco-editor-BW5C4Iv1.js";function F(t){return t.split("/").pop()||t}function Q({activePath:t,selectedPath:o,onSelect:f}){const[n,i]=l.useState([]),m=l.useRef(0),r=l.useRef(f);if(r.current=f,l.useEffect(()=>{if(m.current+=1,r.current(null),!t){i([]);return}const a=m.current;let x=!1;return window.api.config.parseImports(t).then(c=>{x||m.current!==a||(c.ok?i(c.imports):(i([]),_.error(c.error||"failed to parse @-imports")))}),()=>{x=!0}},[t]),n.length===0||!t)return null;const b=o===t||o===null;return e.jsxs("div",{className:"w-64 shrink-0 border-r border-line bg-bg-elev overflow-auto","data-testid":"referenced-files-rail",children:[e.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-fg-faint border-b border-line",children:["Documents · ",n.length+1]}),e.jsxs("button",{type:"button",onClick:()=>f(null),"aria-current":b,"data-testid":"referenced-file-root",className:`w-full text-left px-3 py-2 border-b border-line ${b?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsx("div",{className:"text-[11.5px] font-medium truncate",children:F(t)}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:t,children:"this system prompt"})]}),n.map(a=>{const x=!a.ok||!a.exists,c=o===a.path;return e.jsxs("button",{type:"button",onClick:()=>f(a),"aria-current":c,"data-testid":"referenced-file-row",className:`w-full text-left px-3 py-2 border-b border-line last:border-b-0 ${c?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11.5px] font-medium truncate flex-1",children:F(a.path)}),x&&e.jsx("span",{className:"shrink-0 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-amber-400/90 border border-amber-400/30","data-testid":"referenced-file-missing",children:"missing"})]}),e.jsx("div",{className:"text-[10px] text-fg-faint truncate",title:a.path,children:a.path}),e.jsxs("div",{className:"text-[10px] text-fg-faint",children:[a.sizeBytes.toLocaleString()," bytes · ~",a.tokenEstimate.toLocaleString()," tokens"]})]},a.path)})]})}function U(t){return t.split("/").filter(Boolean).pop()||t}function W({path:t,value:o,onChange:f,onSave:n,readOnly:i,defaultMode:m,headerRight:r,hideStatusBar:b}){const a=$(),x=B(t),c=I(t),S=V(t),[E,w]=l.useState(()=>i&&c?"preview":m??z(t)),[g,C]=l.useState(!0),[p,R]=l.useState(null),N=l.useRef(null),d=l.useRef(null),v=l.useCallback(s=>{N.current=s},[]),y=l.useCallback(()=>N.current,[]),k=i?c?["preview","edit"]:[]:S?["edit","preview","split"]:c?["edit","preview"]:[],u=c?E:"edit",j=e.jsx(H,{path:t,name:U(t),value:o,onChange:f,onSave:()=>n==null?void 0:n(),onReady:v,onCursor:R,readOnly:i});return e.jsxs("div",{className:"flex flex-col h-full min-h-0","data-testid":"document-editor-pane",children:[e.jsxs("div",{className:"flex items-center gap-1 px-2 h-7 shrink-0 border-b border-line bg-bg-elev",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg truncate",children:U(t)}),i&&e.jsx("span",{className:"ml-1 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide text-fg-faint border border-line",children:"read-only"}),e.jsx("div",{className:"flex-1"}),r,x&&(u==="preview"||u==="split")&&e.jsx("button",{onClick:()=>C(s=>!s),"data-testid":"document-outline-toggle",className:`px-2 py-0.5 text-[10px] border border-line rounded ${g?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,title:"Toggle document outline",children:"Outline"}),k.length>0&&e.jsx("div",{className:"flex items-center ml-1 rounded border border-line overflow-hidden","data-testid":"document-mode-toggle",children:k.map(s=>e.jsx("button",{onClick:()=>w(s),className:`px-2 py-0.5 text-[10px] capitalize transition-colors ${u===s?"bg-bg-hi text-fg":"text-fg-faint hover:text-fg"}`,children:s},s))})]}),e.jsx("div",{className:"flex-1 min-h-0",children:u==="split"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(L,{text:o,scrollRef:d}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col border-r border-line",children:[!i&&e.jsx(M,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,flush:!0,wideMeasure:a.wideMeasure})})]}):u==="preview"&&x?e.jsxs("div",{className:"flex h-full",children:[g&&e.jsx(L,{text:o,scrollRef:d}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(D,{ref:d,text:o,wideMeasure:a.wideMeasure})})]}):x?e.jsxs("div",{className:"flex flex-col h-full",children:[!i&&e.jsx(M,{getEditor:y}),e.jsx("div",{className:"flex-1 min-h-0",children:j})]}):j}),!b&&e.jsx(X,{text:o,cursor:p,language:Y(t)||void 0})]})}const O={title:"User system prompt",body:"This is the real ~/.claude/CLAUDE.md on disk — the instructions the claude CLI loads into every session it starts on this machine, in every project. A project's own CLAUDE.md / CLAUDE.local.md are read from that project's directory when a session launches there; they are not edited here."};function Z(t){return Math.round(t.length/4)}function ee(){const t=q(),[o,f]=l.useState("installed"),n=l.useMemo(()=>t?G.resolve("user",t,null):null,[t]),[i,m]=l.useState(null),r=(i==null?void 0:i.path)??n,b=!!i&&(!i.ok||!i.exists),a=h(s=>s.files),x=h(s=>s.loadText),c=h(s=>s.setDraft),S=h(s=>s.saveText),E=h(s=>s.revert),w=h(s=>s.watchFile),g=h(s=>s.unwatchFile);l.useEffect(()=>{if(n)return x(n,!0),w(n),()=>{g(n)}},[n]),l.useEffect(()=>{if(!(!r||r===n))return x(r,!0),w(r),()=>{g(r)}},[r,n]);const[C,p]=l.useState(null),R=l.useCallback(s=>{p(null),m(s)},[]);if(!t)return e.jsx(P,{title:"loading…"});if(o==="library")return e.jsx(T,{toolbar:e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),children:e.jsx(K,{})});const N=n?a[n]:null,d=r?a[r]:null,v=(d==null?void 0:d.draftRaw)??"",y=Z(v),k=v.length,u=b,j=async()=>{if(!r)return;p(null);const s=await S(r);s.ok||p(s.error??"save failed")};return e.jsx(T,{toolbar:e.jsxs(e.Fragment,{children:[e.jsx(A,{active:o,onChange:f,installedLabel:"Editor",libraryLabel:"Presets"}),e.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:"User scope"}),e.jsx("span",{className:"ml-3 text-fg-faint truncate",children:r??"—"}),e.jsx("div",{className:"flex-1"}),e.jsxs("span",{className:"text-fg-faint",children:[k.toLocaleString()," chars · ~",y.toLocaleString()," tokens"]})]}),footer:r&&d&&!u?e.jsx(J,{dirty:d.dirty,busy:d.busy,parseError:C,lastSavedAt:d.lastSavedAt,leading:d.exists?i?e.jsx("span",{children:"editing an imported file"}):null:e.jsx("span",{children:"file will be created on save"}),onSave:j,onRevert:()=>{p(null),E(r)}}):null,children:n&&N?e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{"data-testid":"system-prompt-scope-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-2 text-[11.5px] leading-snug",children:[e.jsx("span",{className:"font-semibold text-fg",children:O.title}),e.jsx("span",{className:"mx-1.5 text-fg-faint",children:"·"}),e.jsx("span",{className:"text-fg-dim",children:O.body}),e.jsx("span",{className:"ml-1.5 font-mono text-fg-faint",children:n})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex",children:[e.jsx(Q,{activePath:n,selectedPath:r,onSelect:R}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[u&&e.jsx("div",{"data-testid":"system-prompt-missing-note",className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 text-[11px] text-amber-400/90",children:"This import does not resolve to a readable file — the CLI will skip it."}),r&&e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(W,{path:r,value:v,readOnly:u,defaultMode:"split",onChange:s=>{p(null),c(r,s)},onSave:()=>{j()}},r)})]})]})]}):e.jsx(P,{title:"resolving…"})})}const ie=l.memo(ee);export{ie as SystemPrompt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as o,T as g,_ as e,g as w,ad as v,ae as u,v as y}from"./index-Cs_Lq9-w.js";import{P as T}from"./Panel-n-p8OQLc.js";import{L as k}from"./ListDetail-BPJb2et3.js";import"./monaco-editor-BW5C4Iv1.js";const E=new Set(g.map(a=>a.tag));function j(a){return a.filter(n=>E.has(n))}function P(){const[a,n]=o.useState(g[0].tag),[l,x]=o.useState(null),[h,m]=o.useState(!1),r=o.useRef(!0);o.useEffect(()=>()=>{r.current=!1},[]);const c=async()=>{try{const t=await window.api.agents.listPersonas();r.current&&x(t)}catch(t){if(!r.current)return;x([]),u.error(t.message||"failed to load agent personas")}};o.useEffect(()=>{c()},[]),o.useEffect(()=>window.api.agents.onChanged(()=>c()),[]);const f=g.find(t=>t.tag===a)??null,p=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j([...t.tags,i]),body:t.body}),m(!1),await c()}catch(d){u.error(d.message||"failed to assign tag")}},s=async(t,i)=>{try{await window.api.agents.savePersona({name:t.name,originalName:t.name,description:t.description??"",tools:t.tools,model:t.model??"inherit",color:t.color??"",tags:j(t.tags.filter(d=>d!==i)),body:t.body}),await c()}catch(d){u.error(d.message||"failed to remove tag")}};return e.jsx(T,{toolbar:e.jsxs("span",{className:"text-fg-faint",children:[g.length," tag",g.length===1?"":"s"]}),children:e.jsx(k,{sidebar:e.jsx("div",{className:"py-1",children:g.map(t=>{const i=v(t.tag),d=a===t.tag,b=(l==null?void 0:l.filter(N=>N.tags.includes(t.tag)).length)??0;return e.jsxs("button",{onClick:()=>{n(t.tag),m(!1)},className:`w-full text-left px-3 py-1.5 text-xs flex items-center gap-2 border-l-2 ${d?"bg-bg-hi text-fg border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-transparent"}`,children:[e.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-mono font-semibold ${i.bg} ${i.text} ${i.border?"border border-current/30":""}`,children:["#",t.tag]}),e.jsx("span",{className:"truncate",children:t.label}),b>0&&e.jsx("span",{className:"ml-auto text-[10.5px] text-fg-faint font-mono shrink-0",children:b})]},t.tag)})}),detail:f?e.jsx(S,{entry:f,personas:l,adding:h,setAdding:m,onAssign:p,onUnassign:s}):e.jsx(w,{title:"select a tag"})})})}const A=o.memo(P);function S({entry:a,personas:n,adding:l,setAdding:x,onAssign:h,onUnassign:m}){const r=v(a.tag),c=y(a.tag),f=(n==null?void 0:n.filter(s=>s.tags.includes(a.tag)))??[],p=(n==null?void 0:n.filter(s=>!s.tags.includes(a.tag)))??[];return e.jsxs("div",{className:"p-4 space-y-4 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:`px-2 py-1 rounded text-xs font-mono font-semibold ${r.bg} ${r.text} ${r.border?"border border-current/30":""}`,children:["#",a.tag]}),e.jsx("span",{className:"text-sm font-semibold text-fg",children:a.label})]}),e.jsx("div",{className:"text-xs text-fg-dim leading-relaxed",children:a.description}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"/develop eagerness"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developEagerness})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"develops via"}),e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded border border-line text-fg-dim font-mono",children:a.developsVia})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"agents carrying this tag"}),n===null?e.jsx("div",{className:"text-xs text-fg-faint italic",children:"loading…"}):e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[f.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1.5 bg-bg-elev border border-line rounded px-2 py-0.5 text-[11px] font-mono text-fg-dim",children:[s.name,e.jsx("button",{onClick:()=>m(s,a.tag),title:"Remove this tag from the agent",className:"text-fg-faint hover:text-fg",children:"×"})]},s.name)),f.length===0&&!l&&e.jsx("span",{className:"text-xs text-fg-faint italic mr-1",children:"no agent carries this tag yet."}),l?p.length>0?e.jsxs("select",{autoFocus:!0,defaultValue:"",onChange:s=>{const t=n.find(i=>i.name===s.target.value);t&&h(t,a.tag)},onBlur:()=>x(!1),className:"bg-bg border border-line rounded px-2 py-0.5 text-[11px] text-fg font-mono",children:[e.jsx("option",{value:"",disabled:!0,children:"pick an agent…"}),p.map(s=>e.jsx("option",{value:s.name,children:s.name},s.name))]}):e.jsx("span",{className:"text-xs text-fg-faint italic",children:"every agent already carries this tag."}):e.jsx("button",{onClick:()=>x(!0),className:"px-2 py-0.5 rounded-full text-[11px] font-mono border border-line text-fg-faint hover:text-fg hover:bg-bg-hi",children:"+ assign agent"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10.5px] uppercase tracking-wide text-fg-faint mb-1.5 font-mono",children:"opening framing — sent before the human's goal"}),e.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap bg-bg-elev border border-line rounded p-3 leading-relaxed font-sans",children:c.initialPromptTemplate})]})]})}export{A as TagLibrary};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as r}from"./index-Cs_Lq9-w.js";function a({checked:t,onChange:e,label:n,disabled:s}){return r.jsxs("label",{className:`inline-flex items-center gap-2 text-xs ${s?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,children:[r.jsx("button",{type:"button",role:"switch","aria-checked":t,disabled:s,onClick:()=>!s&&e(!t),className:`relative w-7 h-4 rounded-full transition-colors ${t?"bg-accent":"bg-bg-hi border border-line"}`,children:r.jsx("span",{className:`absolute top-0.5 w-3 h-3 rounded-full bg-fg transition-transform ${t?"translate-x-3.5":"translate-x-0.5"}`})}),n&&r.jsx("span",{className:"text-fg-dim",children:n})]})}export{a as T};
|