@mrpatronz/nexusflow 2.10.2 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +151 -12
- package/dist/analyzers/detect-deps.js +1 -1
- package/dist/analyzers/detect-deps.js.map +1 -1
- package/dist/commands/commit.d.ts.map +1 -1
- package/dist/commands/commit.js +15 -0
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/create.d.ts +10 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +44 -23
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/finish.d.ts.map +1 -1
- package/dist/commands/finish.js +15 -0
- package/dist/commands/finish.js.map +1 -1
- package/dist/commands/flow.d.ts +13 -0
- package/dist/commands/flow.d.ts.map +1 -0
- package/dist/commands/flow.js +91 -0
- package/dist/commands/flow.js.map +1 -0
- package/dist/commands/handoff.d.ts.map +1 -1
- package/dist/commands/handoff.js +5 -14
- package/dist/commands/handoff.js.map +1 -1
- package/dist/commands/knowledge.d.ts.map +1 -1
- package/dist/commands/knowledge.js +3 -0
- package/dist/commands/knowledge.js.map +1 -1
- package/dist/commands/skill.d.ts +28 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +250 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +17 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/tag.d.ts +13 -0
- package/dist/commands/tag.d.ts.map +1 -0
- package/dist/commands/tag.js +179 -0
- package/dist/commands/tag.js.map +1 -0
- package/dist/commands/verify.d.ts +16 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +91 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/core/adapters/local-storage.d.ts.map +1 -1
- package/dist/core/adapters/local-storage.js +2 -2
- package/dist/core/adapters/local-storage.js.map +1 -1
- package/dist/core/commit.d.ts +2 -0
- package/dist/core/commit.d.ts.map +1 -1
- package/dist/core/commit.js +15 -0
- package/dist/core/commit.js.map +1 -1
- package/dist/core/doctor.d.ts.map +1 -1
- package/dist/core/doctor.js +14 -4
- package/dist/core/doctor.js.map +1 -1
- package/dist/core/domain-catalog.d.ts +9 -0
- package/dist/core/domain-catalog.d.ts.map +1 -0
- package/dist/core/domain-catalog.js +47 -0
- package/dist/core/domain-catalog.js.map +1 -0
- package/dist/core/domain-packs.d.ts +81 -0
- package/dist/core/domain-packs.d.ts.map +1 -0
- package/dist/core/domain-packs.js +443 -0
- package/dist/core/domain-packs.js.map +1 -0
- package/dist/core/generation-lock.d.ts.map +1 -1
- package/dist/core/generation-lock.js +1 -3
- package/dist/core/generation-lock.js.map +1 -1
- package/dist/core/lifecycle.d.ts +28 -0
- package/dist/core/lifecycle.d.ts.map +1 -0
- package/dist/core/lifecycle.js +411 -0
- package/dist/core/lifecycle.js.map +1 -0
- package/dist/core/status.d.ts +17 -0
- package/dist/core/status.d.ts.map +1 -1
- package/dist/core/status.js +80 -1
- package/dist/core/status.js.map +1 -1
- package/dist/core/verify.d.ts +39 -0
- package/dist/core/verify.d.ts.map +1 -0
- package/dist/core/verify.js +397 -0
- package/dist/core/verify.js.map +1 -0
- package/dist/core/work-guidance.d.ts +201 -0
- package/dist/core/work-guidance.d.ts.map +1 -0
- package/dist/core/work-guidance.js +225 -0
- package/dist/core/work-guidance.js.map +1 -0
- package/dist/core/workspace-state.d.ts +24 -3
- package/dist/core/workspace-state.d.ts.map +1 -1
- package/dist/core/workspace-state.js +93 -31
- package/dist/core/workspace-state.js.map +1 -1
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +7 -0
- package/dist/core/workspace.js.map +1 -1
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +45 -7
- package/dist/generators/base.js.map +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +11 -2
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/plan-generator.d.ts.map +1 -1
- package/dist/generators/plan-generator.js +9 -4
- package/dist/generators/plan-generator.js.map +1 -1
- package/dist/generators/skills-generator.d.ts.map +1 -1
- package/dist/generators/skills-generator.js +36 -3
- package/dist/generators/skills-generator.js.map +1 -1
- package/dist/gui/assets/AgentsPage-GCFiyNSm.js +3 -0
- package/dist/gui/assets/DashboardPage-51JHl4Hg.js +1 -0
- package/dist/gui/assets/{GettingStartedPage-1MOTng3B.js → GettingStartedPage-DH-zXYgU.js} +1 -1
- package/dist/gui/assets/ProjectsPage-DUv2fhI8.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-Asao9IqG.js +1 -0
- package/dist/gui/assets/SettingsPage--pnZKpmm.js +1 -0
- package/dist/gui/assets/SkillsPage-BPq8arO5.js +7 -0
- package/dist/gui/assets/StartWorkPage-CypGEQZ0.js +1 -0
- package/dist/gui/assets/{StrategiesPage-CdCbbIu-.js → StrategiesPage-BHAzXMnc.js} +2 -2
- package/dist/gui/assets/WorkroomsPage-BYC8c-rP.js +4 -0
- package/dist/gui/assets/WorkspacesPage-DRASo1aL.js +13 -0
- package/dist/gui/assets/{alert-dialog-u7qgb9Hq.js → alert-dialog-BD3wT0w3.js} +1 -1
- package/dist/gui/assets/badge-DTBzXOWn.js +1 -0
- package/dist/gui/assets/index-er-mkc2S.css +2 -0
- package/dist/gui/assets/index-jcGHcXQ1.js +57 -0
- package/dist/gui/assets/square-check-big-Bj8Rf_dH.js +1 -0
- package/dist/gui/assets/tabs-DfbdubLX.js +1 -0
- package/dist/gui/assets/{useAriaLabelledBy-C4zV-1Ra.js → useAriaLabelledBy-BmJErI5a.js} +1 -1
- package/dist/gui/assets/vsc-Dn-smJni.js +1 -0
- package/dist/gui/index.html +3 -5
- package/dist/http/work-guidance-routes.d.ts +4 -0
- package/dist/http/work-guidance-routes.d.ts.map +1 -0
- package/dist/http/work-guidance-routes.js +44 -0
- package/dist/http/work-guidance-routes.js.map +1 -0
- package/dist/index.js +169 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +184 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/resources/contracts.d.ts.map +1 -1
- package/dist/resources/contracts.js +2 -1
- package/dist/resources/contracts.js.map +1 -1
- package/dist/resources/fs-safety.d.ts.map +1 -1
- package/dist/resources/fs-safety.js +2 -1
- package/dist/resources/fs-safety.js.map +1 -1
- package/dist/resources/materializer.d.ts +3 -0
- package/dist/resources/materializer.d.ts.map +1 -1
- package/dist/resources/materializer.js +45 -19
- package/dist/resources/materializer.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +327 -4
- package/dist/server.js.map +1 -1
- package/dist/static-resources/skills/contextspace-verify-release/SKILL.md +51 -0
- package/dist/static-resources/skills/contextspace-verify-release/references/evidence.md +21 -0
- package/dist/static-resources/skills/nexusflow-dev/SKILL.md +49 -0
- package/dist/static-resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
- package/dist/static-resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
- package/dist/static-resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
- package/dist/static-resources/workflows/epic-multi-slice.md +21 -0
- package/dist/static-resources/workflows/plan-implement-review.md +17 -6
- package/dist/static-resources/workflows/research-verify.md +15 -4
- package/dist/static-resources/workflows/solo-developer.md +11 -2
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +8 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/types.d.ts +175 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/resolve-workspace.d.ts.map +1 -1
- package/dist/utils/resolve-workspace.js +15 -8
- package/dist/utils/resolve-workspace.js.map +1 -1
- package/dist/utils/skills-catalog.d.ts +13 -9
- package/dist/utils/skills-catalog.d.ts.map +1 -1
- package/dist/utils/skills-catalog.js +241 -341
- package/dist/utils/skills-catalog.js.map +1 -1
- package/dist/utils/test-command.d.ts +7 -1
- package/dist/utils/test-command.d.ts.map +1 -1
- package/dist/utils/test-command.js +35 -11
- package/dist/utils/test-command.js.map +1 -1
- package/dist/utils/workflow-advisor.d.ts +1 -1
- package/dist/utils/workflow-advisor.d.ts.map +1 -1
- package/dist/utils/workflow-advisor.js +16 -4
- package/dist/utils/workflow-advisor.js.map +1 -1
- package/dist/utils/workflows.d.ts.map +1 -1
- package/dist/utils/workflows.js +5 -2
- package/dist/utils/workflows.js.map +1 -1
- package/dist/workrooms/contracts.d.ts +3 -3
- package/dist/workrooms/local-resources.d.ts +4 -1
- package/dist/workrooms/local-resources.d.ts.map +1 -1
- package/dist/workrooms/manager.d.ts +5 -2
- package/dist/workrooms/manager.d.ts.map +1 -1
- package/dist/workrooms/store.d.ts +2 -2
- package/package.json +3 -2
- package/resources/skills/contextspace-verify-release/SKILL.md +51 -0
- package/resources/skills/contextspace-verify-release/references/evidence.md +21 -0
- package/resources/skills/nexusflow-dev/SKILL.md +49 -0
- package/resources/skills/nexusflow-dev/references/cli-conventions.md +15 -0
- package/resources/skills/nexusflow-dev/references/verification-checklist.md +28 -0
- package/resources/skills/nexusflow-lifecycle/SKILL.md +62 -0
- package/resources/skills/nexusflow-lifecycle/references/epic-deliverables.md +22 -0
- package/resources/skills/nexusflow-lifecycle/references/flow-selection-matrix.md +21 -0
- package/resources/skills/nexusflow-lifecycle/references/stage-outcomes.md +23 -0
- package/resources/workflows/epic-multi-slice.md +21 -0
- package/resources/workflows/plan-implement-review.md +17 -6
- package/resources/workflows/research-verify.md +15 -4
- package/resources/workflows/solo-developer.md +11 -2
- package/dist/gui/assets/AgentsPage-DbivhmK0.js +0 -3
- package/dist/gui/assets/DashboardPage-D50Qrm3e.js +0 -1
- package/dist/gui/assets/NullStore-tdPen1kp.js +0 -1
- package/dist/gui/assets/ProjectsPage-srKgf7VN.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-CP0yn5mw.js +0 -1
- package/dist/gui/assets/SettingsPage-DWmrLV8o.js +0 -1
- package/dist/gui/assets/SkillsPage-CKjTXdrd.js +0 -6
- package/dist/gui/assets/StartWorkPage-BCUnJ9k8.js +0 -1
- package/dist/gui/assets/WorkroomsPage-BcT-mGtT.js +0 -4
- package/dist/gui/assets/WorkspacesPage-CYFCm-7_.js +0 -2
- package/dist/gui/assets/badge-DwXvB44H.js +0 -1
- package/dist/gui/assets/chunk-BV7QT456-DfUBKG-z.js +0 -3
- package/dist/gui/assets/index-3tD_IeyQ.js +0 -55
- package/dist/gui/assets/index-CK5YRfPV.css +0 -2
- package/dist/gui/assets/square-check-big-BSIiYXPI.js +0 -1
- package/dist/gui/assets/tabs-BrHKp5bD.js +0 -1
- package/dist/gui/assets/vsc-D80c4gBT.js +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nexusflow-dev
|
|
3
|
+
description: Maintain ContextSpace/NexusFlow implementation, CLI, storage, generated resources, and tests. Use for changes to this codebase; projects merely using ContextSpace follow their own repository engineering standards.
|
|
4
|
+
metadata:
|
|
5
|
+
contextspace:
|
|
6
|
+
title: ContextSpace Maintainer
|
|
7
|
+
category: dev-standards
|
|
8
|
+
tags: [contextspace, nexusflow, architecture, testing]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Maintain ContextSpace
|
|
12
|
+
|
|
13
|
+
Read the current repository instructions and assignment before editing. Keep changes
|
|
14
|
+
in the supplied worktree. The CLI in `src/index.ts` wires thin handlers; workspace
|
|
15
|
+
behavior belongs in `src/core/`, document persistence uses `src/core/storage.ts`,
|
|
16
|
+
and generated assistant views belong in `src/generators/`.
|
|
17
|
+
|
|
18
|
+
## Preserve implementation contracts
|
|
19
|
+
|
|
20
|
+
- Resolve brand aliases and durable paths through `src/core/constants.ts` and the
|
|
21
|
+
brand configuration. Preserve primary/legacy fallback behavior.
|
|
22
|
+
- Use the storage port for adapter-owned documents. A local lock or cache does not
|
|
23
|
+
make filesystem writes an acceptable substitute for configured storage.
|
|
24
|
+
- Mutate shared state through the relevant catalog or workspace API. Keep locked
|
|
25
|
+
sections short; do slow verification outside them and revalidate the affected
|
|
26
|
+
revision before committing its result. Read fresh state under the lock.
|
|
27
|
+
- Use atomic persistence at the owning storage layer. For portable resource paths,
|
|
28
|
+
enforce containment and reject symlinks with the filesystem safety helpers.
|
|
29
|
+
- Change the source of generated views, then regenerate. Keep volatile progress
|
|
30
|
+
in live state, and invalidate verification evidence when the tested input changes.
|
|
31
|
+
- Knowledge entries retain the 300-character body limit; preserve adapter routing,
|
|
32
|
+
searchability, and recovery when Git persistence fails.
|
|
33
|
+
|
|
34
|
+
Read [CLI conventions](references/cli-conventions.md) for command changes and
|
|
35
|
+
[verification checks](references/verification-checklist.md) to select checks for
|
|
36
|
+
the affected subsystem. Follow repository-required gates before submission; use
|
|
37
|
+
targeted checks during iteration and repeat only when changes or failures justify it.
|
|
38
|
+
|
|
39
|
+
## Maintain the guidance too
|
|
40
|
+
|
|
41
|
+
Versioned skill sources live in `resources/skills/`; workflow templates live in
|
|
42
|
+
`resources/workflows/`. Installed catalog packages and generated workspace copies
|
|
43
|
+
are derived from those sources. See `docs/maintaining-skills.md` for validation,
|
|
44
|
+
scenario evaluation, installation, and regeneration. Do not hand-edit a generated
|
|
45
|
+
`SKILL.md` and expect refresh to preserve it.
|
|
46
|
+
|
|
47
|
+
After changing structures or resources, build the backend before running
|
|
48
|
+
`node dist/index.js refresh`. Distinguish successful generation from a later Git
|
|
49
|
+
staging failure. Report the actual state instead of claiming the entire refresh passed.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# CLI contracts
|
|
2
|
+
|
|
3
|
+
Declare positional arguments once: either in `.command('name <id>')` or with
|
|
4
|
+
`.command('name').argument('<id>')`. Wrap action handlers with `runAction(...)`.
|
|
5
|
+
|
|
6
|
+
Use the repository's workspace resolver appropriate to the operation: interactive
|
|
7
|
+
selection when requested, quiet resolution for headless/read-only commands. Do not
|
|
8
|
+
introduce a prompt when a supplied workspace or current context resolves the task.
|
|
9
|
+
|
|
10
|
+
`--json` must produce parseable JSON without banners or ANSI escapes. Errors should
|
|
11
|
+
have a meaningful nonzero exit status; test failure paths as well as successful output.
|
|
12
|
+
Exercise documented subcommands and options against the built CLI's `--help`.
|
|
13
|
+
|
|
14
|
+
Tests should check observable argument behavior, JSON parsing, missing/invalid inputs,
|
|
15
|
+
and exit status where relevant. Use disposable fixtures for mutating commands.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Repository verification
|
|
2
|
+
|
|
3
|
+
Follow the current `AGENTS.md` and package scripts. Before submitting code changes,
|
|
4
|
+
run `npm run build:backend` and `npm test`; GUI changes also require
|
|
5
|
+
`npm run build --prefix gui`. Do not embed expected test counts in this guide.
|
|
6
|
+
|
|
7
|
+
During implementation, select checks by affected behavior:
|
|
8
|
+
|
|
9
|
+
| Change | Useful evidence |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| CLI/API | Real command/request behavior, validation failures, clean JSON and exit status |
|
|
12
|
+
| Storage | Configured adapter exercised, original content retained, failed writes recoverable |
|
|
13
|
+
| Shared state | Concurrent edits do not lose unrelated data; stale revisions rejected |
|
|
14
|
+
| Generated resources | Regeneration from source, repeatability, provenance and source-file preservation |
|
|
15
|
+
| GUI | Actual user journey, loading/empty/error states, draft preservation, keyboard and label behavior |
|
|
16
|
+
| Verification engine | Gate uses the tested input, failed/stale/unreadable snapshots cannot permit progress |
|
|
17
|
+
| Compatibility/migration | Old and new persisted inputs, supported aliases, failure/recovery paths |
|
|
18
|
+
|
|
19
|
+
Run the relevant existing suites and add regressions for concrete failures. Do not
|
|
20
|
+
write tests that merely restate implementation or assert arbitrary prose. Browser
|
|
21
|
+
tests should wait for observable navigation/request completion, not fixed sleeps.
|
|
22
|
+
Passing mocked UI tests does not prove the backend integration; pair them with API
|
|
23
|
+
tests where the change crosses that boundary.
|
|
24
|
+
|
|
25
|
+
Use environment-specific workarounds only after establishing why they are needed.
|
|
26
|
+
For example, `npm test -- --configLoader native` can avoid Vite writing beside a
|
|
27
|
+
read-only configuration cache; it is not a universal substitute for repository scripts.
|
|
28
|
+
Missing permissions or dependencies are unavailable evidence, not a passing test.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nexusflow-lifecycle
|
|
3
|
+
description: Choose and carry out an appropriately sized development workflow in a ContextSpace workspace, using its current assignment, source documents, and milestones. Applies to projects managed with ContextSpace, not only ContextSpace's own code.
|
|
4
|
+
metadata:
|
|
5
|
+
contextspace:
|
|
6
|
+
title: ContextSpace Work Lifecycle
|
|
7
|
+
category: workflows
|
|
8
|
+
tags: [contextspace, workflow, development]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Work from the current assignment
|
|
12
|
+
|
|
13
|
+
Read the workspace instructions and live assignment with `ctxspace flow --assignment --json`
|
|
14
|
+
or MCP `get_work_context`. Check the selected milestone, stage, expected output, and
|
|
15
|
+
stopping point. If live tools are unavailable, read the authoritative
|
|
16
|
+
`contextspace-work.json` and relevant sources; identify anything you cannot verify.
|
|
17
|
+
The user's current instruction can revise a saved assignment. Make that change
|
|
18
|
+
explicit; do not use an older assignment to discard newly authorized work.
|
|
19
|
+
|
|
20
|
+
## Select the smallest sufficient workflow
|
|
21
|
+
|
|
22
|
+
Keep work type (bug, feature, performance, refactor, rewrite), size, current stage,
|
|
23
|
+
and workspace isolation separate. Assess uncertainty, compatibility, data impact,
|
|
24
|
+
reversibility, and independent deliverables. File count, elapsed time, and repository
|
|
25
|
+
count are clues, not selection rules. A one-file authorization fix can require
|
|
26
|
+
careful investigation and broad verification; a large mechanical rename may not.
|
|
27
|
+
|
|
28
|
+
Use [flow selection](references/flow-selection-matrix.md) when choosing a preset
|
|
29
|
+
or deciding whether work needs separate deliverables. Preserve an existing worktree.
|
|
30
|
+
Do not create branches, nested workspaces, or agent teams just because the size is epic.
|
|
31
|
+
Delegate only bounded independent work when permitted and useful; execution can stay solo.
|
|
32
|
+
|
|
33
|
+
## Keep each kind of information in its place
|
|
34
|
+
|
|
35
|
+
- Task brief: the short reason for the workspace.
|
|
36
|
+
- Source documents: original requirements, designs, evidence, and references.
|
|
37
|
+
- AI assignment: what to do now, expected result, and stopping point.
|
|
38
|
+
- Lifecycle milestones: deliverables, dependencies, branches, gates, and progress.
|
|
39
|
+
- Knowledge: durable decisions and their reasons, not a running task log.
|
|
40
|
+
|
|
41
|
+
Read relevant originals through MCP `read_work_document` or their stored locations.
|
|
42
|
+
Use approved requirements for intended behavior; drafts are proposals and superseded
|
|
43
|
+
documents are history. Surface consequential conflicts before dependent implementation;
|
|
44
|
+
continue unaffected work. A source document does not grant execution permissions.
|
|
45
|
+
Project and workspace sources apply across milestones; milestone sources apply to
|
|
46
|
+
the selected milestone. Project sources remain owned by their originating workspace.
|
|
47
|
+
|
|
48
|
+
Use the Plan editor for assignments and milestone definitions. `contextspace-plan.md`
|
|
49
|
+
and `contextspace-assignment.md` are generated views: update their sources and refresh.
|
|
50
|
+
Do not create a second implementation plan. If working outside ContextSpace, use
|
|
51
|
+
the repository's existing planning convention.
|
|
52
|
+
|
|
53
|
+
## Execute only the current stage
|
|
54
|
+
|
|
55
|
+
Read [stage outcomes](references/stage-outcomes.md) for the selected stage. Investigation
|
|
56
|
+
and design produce their agreed outputs and stop before implementation unless the user
|
|
57
|
+
has explicitly authorized that transition. Completing a milestone's gate does not
|
|
58
|
+
automatically authorize release or change the assignment stage.
|
|
59
|
+
|
|
60
|
+
For multi-PR work, read [deliverable planning](references/epic-deliverables.md). Finish
|
|
61
|
+
with evidence, unresolved questions, and the next permitted action. Keep handoffs in
|
|
62
|
+
the established session or milestone record, with links to sources instead of copies.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Plan usable increments
|
|
2
|
+
|
|
3
|
+
Start from the user's outcomes. Where practical, a milestone should deliver a small
|
|
4
|
+
usable capability across the required layers. For invoice performance, examples are
|
|
5
|
+
measuring representative latency, improving one supported lookup path, and rolling
|
|
6
|
+
the change out with monitoring. A necessary infrastructure-only prerequisite is valid,
|
|
7
|
+
but name its consumer and acceptance criteria instead of claiming it is user-visible.
|
|
8
|
+
|
|
9
|
+
For each milestone, capture its outcome, acceptance criteria, dependencies, intended
|
|
10
|
+
branch/PR, compatibility constraints, and verification evidence. Include rollout and
|
|
11
|
+
recovery details when the change affects persistent data or deployed consumers.
|
|
12
|
+
Branch labels in the plan are intentions; verify actual branches and PRs separately.
|
|
13
|
+
|
|
14
|
+
Sequence only actual dependencies. Independent deliverables can proceed concurrently
|
|
15
|
+
when isolation and ownership are clear. Each mergeable increment must build and pass
|
|
16
|
+
its applicable gates. For stacked PRs, record the base branch and merge order; recheck
|
|
17
|
+
dependent PRs after their base changes.
|
|
18
|
+
|
|
19
|
+
Preserve milestone IDs referenced by documents and assignments. The current editor
|
|
20
|
+
can add/edit milestones but does not delete existing ones. Record canceled outcomes
|
|
21
|
+
explicitly rather than marking unimplemented behavior as delivered; if restructuring
|
|
22
|
+
requires unsupported operations, explain the limitation and agree a supported plan.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Choose by uncertainty and impact
|
|
2
|
+
|
|
3
|
+
| Situation | Starting workflow | Evidence or planning needed |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| Understood, localized, reversible change | Small task | Reproduction or observable acceptance check; relevant regression gate |
|
|
6
|
+
| One cohesive capability with some unknowns | Standard change | Resolve important unknowns; define acceptance criteria and failure behavior |
|
|
7
|
+
| Multiple independently reviewable deliverables | Epic | Outcomes, dependency graph, compatibility boundaries, handoffs |
|
|
8
|
+
| Authentication, data migration, public contract, or hard-to-reverse change | Any size, deeper verification | Failure analysis, compatibility and recovery evidence appropriate to the impact |
|
|
9
|
+
| Performance investigation | Investigate stage, any size | Representative workload, baseline, measurement method; no speculative rewrite |
|
|
10
|
+
|
|
11
|
+
Choose isolation separately. `ctxspace quick` creates an in-place workspace;
|
|
12
|
+
`ctxspace create` creates a standard workspace and supports mode selection.
|
|
13
|
+
`ctxspace create --flow epic` selects an epic preset. Check the installed CLI's
|
|
14
|
+
`--help` for its available flags; presets do not create a stack of PRs automatically.
|
|
15
|
+
A small task may use a worktree for isolation. Existing workspaces can change their
|
|
16
|
+
assignment size and milestone definitions without resetting progress.
|
|
17
|
+
|
|
18
|
+
Increase workflow depth when investigation uncovers data loss risk, cross-service
|
|
19
|
+
compatibility constraints, or separately releasable outcomes. Explain the finding and
|
|
20
|
+
adapt the existing plan. Reduce unnecessary ceremony when evidence resolves uncertainty.
|
|
21
|
+
Do not require a research document, new test file, approval, or agent team for every tweak.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Expected results by stage
|
|
2
|
+
|
|
3
|
+
| Stage | Produce | Stop or transition |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| Investigate | Reproduction or measurements, evidence for likely causes, remaining unknowns | Return the agreed findings; implementation requires an authorized assignment |
|
|
6
|
+
| Design | Intended behavior, acceptance criteria, relevant alternatives and compatibility constraints | Return a reviewable proposal; do not silently start coding |
|
|
7
|
+
| Implement | Working behavior for the assigned milestone, with relevant tests and documentation | Verify within authorized scope; do not infer release permission |
|
|
8
|
+
| Verify | Results against acceptance criteria, commands, tested revision, failure and recovery evidence | Report pass, failure, or missing evidence; fix within existing authorization |
|
|
9
|
+
| Review | Prioritized findings with trigger, impact, location, and expected behavior; usability evidence where relevant | State unresolved blockers and assessment scope; review alone does not authorize edits |
|
|
10
|
+
| Release | Current commit checks, review status, compatibility and recovery details when needed | Perform only the requested external actions; verify their results |
|
|
11
|
+
|
|
12
|
+
For performance work, establish a repeatable baseline before optimizing and compare
|
|
13
|
+
the same workload afterward. Report environmental differences and noisy measurements.
|
|
14
|
+
For rewrites or migrations, define behavior to preserve and test coexistence or rollback
|
|
15
|
+
where applicable. Test a rollback procedure only in an appropriate test environment.
|
|
16
|
+
|
|
17
|
+
For GUI work, acceptance includes the user's path to the feature, understandable
|
|
18
|
+
labels, defaults, and loading, empty, error, and recovery behavior. Use browser evidence
|
|
19
|
+
for interaction or visual claims; a successful build proves neither usability nor accessibility.
|
|
20
|
+
|
|
21
|
+
A concise handoff contains the current stage/milestone, relevant source IDs, decisions,
|
|
22
|
+
tested revision and commands, unresolved issues, and the next permitted action. It should
|
|
23
|
+
not introduce another authoritative plan or copy entire source documents.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Team Strategy: Epic & Multi-PR Slices
|
|
2
|
+
|
|
3
|
+
Deliver large changes as independently reviewable outcomes with explicit dependencies.
|
|
4
|
+
|
|
5
|
+
1. Read the current assignment and approved project/workspace/milestone sources.
|
|
6
|
+
Name usable increments where practical, rather than automatically splitting
|
|
7
|
+
schema, API, and UI into separate PRs. For a required infrastructure prerequisite,
|
|
8
|
+
identify its consumer and acceptance criteria.
|
|
9
|
+
2. In the existing lifecycle plan, record each outcome, acceptance criteria,
|
|
10
|
+
dependencies, intended branch/PR, compatibility requirements, and verification.
|
|
11
|
+
Edit the source through the Plan editor; `contextspace-plan.md` is generated.
|
|
12
|
+
Branch labels do not create branches or PRs automatically.
|
|
13
|
+
3. Sequence actual dependencies. Independent increments may proceed concurrently
|
|
14
|
+
with clear ownership and isolation. Each mergeable increment must build and pass
|
|
15
|
+
applicable gates; recheck dependent PRs when their base changes.
|
|
16
|
+
4. Keep original contracts in source documents, durable decisions with reasons in
|
|
17
|
+
knowledge, and progress in milestones. Handoffs link those records and include
|
|
18
|
+
the tested revision, outstanding issues, and next permitted action.
|
|
19
|
+
5. Respect the current stage and stopping point. Add migration, rollout, and recovery
|
|
20
|
+
evidence when the change affects stored data or deployed consumers. Verify the
|
|
21
|
+
current PR head and checks before reporting readiness; release requires authorization.
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
# Team
|
|
1
|
+
# Team Strategy: Plan, Implement, Review
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Deliver one cohesive change through a bounded plan, implementation, and review.
|
|
4
4
|
|
|
5
|
-
1.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
1. Read the current assignment and relevant approved sources. Resolve important
|
|
6
|
+
unknowns and define observable acceptance criteria in the existing milestone
|
|
7
|
+
plan. In ContextSpace, edit the lifecycle source through the Plan editor;
|
|
8
|
+
`contextspace-plan.md` is its generated view. Do not create a second plan.
|
|
9
|
+
2. If the assignment is investigation or design, return that stage's output and
|
|
10
|
+
stop. Proceed to implementation only when the current user authorization covers it.
|
|
11
|
+
3. Implement the assigned outcome and test relevant behavior, including concrete
|
|
12
|
+
failure and recovery paths. Preserve compatibility with existing consumers.
|
|
13
|
+
4. Review correctness, scope, usability where relevant, and verification evidence.
|
|
14
|
+
Fix in-scope findings, rerun affected checks, and report remaining limitations.
|
|
15
|
+
|
|
16
|
+
One developer or agent can perform this loop. Use independent review or bounded
|
|
17
|
+
parallel work when available, authorized, and useful; a fixed agent topology is
|
|
18
|
+
not required. Reuse the same sources and milestone state across handoffs.
|
|
19
|
+
Read the current PR head and checks before declaring merge readiness.
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
# Team
|
|
1
|
+
# Team Strategy: Research & Verify
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Investigate uncertainty and produce evidence for the current assignment.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Read the live assignment, relevant original sources, and the code paths needed to
|
|
6
|
+
answer it. Use reproducible experiments, focused tests, or measurements to test
|
|
7
|
+
hypotheses. For performance work, establish a representative baseline before
|
|
8
|
+
proposing optimization. Distinguish observations from inference.
|
|
9
|
+
|
|
10
|
+
Return the agreed findings, evidence, remaining questions, and options for the next
|
|
11
|
+
stage. Investigation does not automatically authorize implementation. If the user
|
|
12
|
+
has authorized the next stage, update the current assignment and existing milestone
|
|
13
|
+
plan and proceed within that scope. Otherwise stop at the agreed output.
|
|
14
|
+
|
|
15
|
+
Work directly by default. An independent specialist can investigate a bounded
|
|
16
|
+
question when delegation is permitted and materially helps; a research agent team
|
|
17
|
+
and a long context report are not prerequisites.
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Team Strategy: Solo Developer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Complete a bounded assignment directly, with verification appropriate to its impact.
|
|
4
|
+
|
|
5
|
+
Read the live assignment with `ctxspace flow --assignment` or MCP `get_work_context`.
|
|
6
|
+
Preserve its stage and stopping point unless the user revises them. Use the existing
|
|
7
|
+
workspace and plan; do not create an additional planning document or agent team.
|
|
8
|
+
|
|
9
|
+
Investigate only the unknowns needed for the assignment. For a bug, reproduce the
|
|
10
|
+
failure; for a small reversible edit, use an observable acceptance check. Implement
|
|
11
|
+
when authorized, keep the change focused, and run relevant checks plus the
|
|
12
|
+
repository-required gates before submission. Return the result and evidence.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-CREn1mup.js";import{n as o,t as s}from"./badge-DwXvB44H.js";import{a as ee,c as te,i as ne,n as re,o as c,r as ie,s as ae,t as oe}from"./alert-dialog-u7qgb9Hq.js";import{t as se}from"./trash-2-CMdv3eD3.js";import{n as ce}from"./chunk-BV7QT456-DfUBKG-z.js";import{Dn as le,E as ue,L as de,N as l,O as fe,_ as u,a as d,d as pe,f,gn as p,h as m,i as me,it as he,kn as h,m as g,mn as ge,n as _,o as v,ot as _e,p as y,q as ve,r as b,t as x,v as S,xn as ye}from"./index-3tD_IeyQ.js";import{t as be}from"./card-yrg6ov8B.js";import{t as C}from"./label-DC730X8s.js";var xe=r(`file-up`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),w=t(e(),1),T=n(),E={id:``,name:``,category:`general`,description:``,developerInstructions:``};function D(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}function O({showToast:e}){let[t,n]=(0,w.useState)(`global`),[r,O]=(0,w.useState)(``),[Se,k]=(0,w.useState)(!1),[A,j]=(0,w.useState)(!1),[M,N]=(0,w.useState)(null),[P,F]=(0,w.useState)(E),[I,L]=(0,w.useState)(``),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(null),{data:H=[],isLoading:Ce,isError:we}=ue(),{data:U=[]}=_e(),W=he(t===`global`?``:t),G=ve(),K=de(),q=l(),J=fe(),Y=t!==`global`,Te=U.find(e=>e.id===t),X=!Y||Te?.assistants?.includes(`codex`),Z=Y&&X&&!W.isLoading&&!W.isError&&!!W.data;(0,w.useEffect)(()=>{if(!Y){z(null);return}W.data&&z([...W.data.enabledAgents??[]])},[Y,t,W.data]);let Q=(0,w.useMemo)(()=>{let e=r.trim().toLowerCase();return e?H.filter(t=>[t.name,t.description,t.category].some(t=>t.toLowerCase().includes(e))):H},[H,r]),Ee=new Set(R??W.data?.enabledAgents??[]);function $(){N(null),F(E),k(!0)}function De(e){N(e.id),F({id:e.id,name:e.name,category:e.category,description:e.description,developerInstructions:e.developerInstructions,model:e.model,modelReasoningEffort:e.modelReasoningEffort,sandboxMode:e.sandboxMode}),k(!0)}async function Oe(){try{let t=M??D(P.name);await G.mutateAsync({...P,id:t,name:t}),k(!1),e?.(`Codex agent saved`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent`,`error`)}}async function ke(){try{await K.mutateAsync({toml:I,category:`general`}),j(!1),L(``),e?.(`Codex agent imported`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to import agent`,`error`)}}async function Ae(){if(B)try{await q.mutateAsync(B.id),V(null),e?.(`Agent deleted from the personal catalog`,`info`)}catch(t){e?.(t instanceof Error?t.message:`Failed to delete agent`,`error`)}}function je(e){if(!Z||R===null)return;let t=new Set(R);t.has(e)?t.delete(e):t.add(e),z([...t])}async function Me(){if(!(!W.data||R===null))try{await J.mutateAsync({workspaceId:t,expectedRevision:W.data.revision??0,enabledSkills:W.data.enabledSkills,enabledAgents:R,enabledCategories:W.data.enabledCategories??[]}),e?.(`Agent selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save agent selection`,`error`)}}return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,T.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-4 border-b border-border px-6 py-5`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,T.jsx)(`div`,{className:`rounded-lg bg-primary/10 p-2 text-primary`,children:(0,T.jsx)(h,{className:`h-5 w-5`})}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Codex Agent Library`}),(0,T.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create and reuse project-scoped Codex custom agents.`})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,T.jsx)(a,{render:(0,T.jsx)(ce,{to:`/skills`}),variant:`outline`,size:`sm`,children:`Skills`}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-3 py-1.5`,children:[(0,T.jsx)(ye,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(C,{htmlFor:`agent-scope`,className:`text-xs text-muted-foreground`,children:`Scope`}),(0,T.jsxs)(`select`,{id:`agent-scope`,value:t,onChange:e=>n(e.target.value),className:`cursor-pointer bg-transparent text-xs font-semibold text-foreground focus:outline-none`,children:[(0,T.jsx)(`option`,{value:`global`,children:`Personal catalog`}),U.map(e=>(0,T.jsx)(`option`,{value:e.id,children:e.id},e.id))]})]}),Y?(0,T.jsx)(a,{size:`sm`,onClick:Me,disabled:!Z||J.isPending,children:J.isPending?`Saving…`:`Save selection`}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>j(!0),children:[(0,T.jsx)(xe,{className:`mr-1.5 h-4 w-4`}),`Import TOML`]}),(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(p,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]})]})]}),(0,T.jsx)(`div`,{className:`border-b border-border/60 bg-muted/20 px-6 py-3`,children:(0,T.jsxs)(`div`,{className:`relative max-w-md`,children:[(0,T.jsx)(ge,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground`}),(0,T.jsx)(o,{value:r,onChange:e=>O(e.target.value),placeholder:`Search agents…`,className:`pl-9`})]})}),(0,T.jsx)(`main`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:Ce||Y&&W.isLoading?(0,T.jsx)(`div`,{className:`flex justify-center p-12`,children:(0,T.jsx)(pe,{})}):we||Y&&W.isError?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(d,{children:`Resources could not be loaded`}),(0,T.jsx)(_,{children:`Assignment controls remain disabled to protect the saved selection.`})]})}):Y&&!X?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(d,{children:`Codex is not enabled for this workspace`}),(0,T.jsx)(_,{children:`Add Codex to the workspace before assigning Codex-native agents.`})]})}):Q.length===0?(0,T.jsxs)(x,{className:`border border-dashed py-12`,children:[(0,T.jsx)(me,{children:(0,T.jsx)(h,{className:`h-8 w-8 text-muted-foreground`})}),(0,T.jsxs)(b,{children:[(0,T.jsx)(d,{children:`No Codex agents found`}),(0,T.jsx)(_,{children:`Create an agent or import a native TOML definition.`})]}),!Y&&(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(p,{className:`mr-1.5 h-4 w-4`}),`New agent`]})]}):(0,T.jsx)(`div`,{className:`mx-auto grid max-w-6xl grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3`,children:Q.map(e=>{let t=Ee.has(e.id);return(0,T.jsxs)(be,{className:i(`flex flex-col gap-4 p-4`,Y&&!t&&`opacity-60`),children:[(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`h2`,{className:`font-semibold`,children:e.name}),(0,T.jsx)(s,{variant:`outline`,children:`Codex`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.description})]}),Y?(0,T.jsxs)(a,{variant:t?`default`:`outline`,size:`sm`,onClick:()=>je(e.id),disabled:!Z,children:[(0,T.jsx)(le,{className:i(`mr-1 h-3.5 w-3.5`,!t&&`opacity-0`)}),t?`Enabled`:`Disabled`]}):(0,T.jsxs)(`div`,{className:`flex gap-1`,children:[(0,T.jsx)(a,{variant:`ghost`,size:`icon`,"aria-label":`Edit ${e.name}`,onClick:()=>De(e),children:(0,T.jsx)(te,{className:`h-4 w-4`})}),(0,T.jsx)(a,{variant:`ghost`,size:`icon`,"aria-label":`Delete ${e.name}`,onClick:()=>V(e),children:(0,T.jsx)(se,{className:`h-4 w-4`})})]})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[e.sandboxMode&&(0,T.jsx)(s,{variant:`secondary`,children:e.sandboxMode}),e.modelReasoningEffort&&(0,T.jsx)(s,{variant:`secondary`,children:e.modelReasoningEffort}),e.model&&(0,T.jsx)(s,{variant:`secondary`,children:e.model})]})]},e.id)})})}),(0,T.jsx)(f,{open:Se,onOpenChange:k,children:(0,T.jsxs)(u,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(S,{children:M?`Edit Codex agent`:`Create Codex agent`}),(0,T.jsx)(y,{children:`Only the current stable native fields are managed. Omitted settings inherit from Codex.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(C,{htmlFor:`agent-name`,children:`Name`}),(0,T.jsx)(o,{id:`agent-name`,value:P.name,disabled:!!M,onChange:e=>F({...P,name:D(e.target.value)}),placeholder:`code-reviewer`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(C,{htmlFor:`agent-description`,children:`Description`}),(0,T.jsx)(o,{id:`agent-description`,value:P.description,onChange:e=>F({...P,description:e.target.value}),placeholder:`Use when reviewing a fixed diff for correctness and security.`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(C,{htmlFor:`agent-instructions`,children:`Developer instructions`}),(0,T.jsx)(v,{id:`agent-instructions`,value:P.developerInstructions,onChange:e=>F({...P,developerInstructions:e.target.value}),className:`min-h-48 font-mono`})]}),(0,T.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(C,{htmlFor:`agent-model`,children:`Model override`}),(0,T.jsx)(o,{id:`agent-model`,value:P.model??``,onChange:e=>F({...P,model:e.target.value||void 0}),placeholder:`Inherit`})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(C,{htmlFor:`agent-effort`,children:`Reasoning`}),(0,T.jsxs)(`select`,{id:`agent-effort`,value:P.modelReasoningEffort??``,onChange:e=>F({...P,modelReasoningEffort:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`low`,children:`Low`}),(0,T.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,T.jsx)(`option`,{value:`high`,children:`High`}),(0,T.jsx)(`option`,{value:`xhigh`,children:`XHigh`}),(0,T.jsx)(`option`,{value:`max`,children:`Max`}),(0,T.jsx)(`option`,{value:`ultra`,children:`Ultra`})]})]}),(0,T.jsxs)(`div`,{className:`grid gap-2`,children:[(0,T.jsx)(C,{htmlFor:`agent-sandbox`,children:`Sandbox`}),(0,T.jsxs)(`select`,{id:`agent-sandbox`,value:P.sandboxMode??``,onChange:e=>F({...P,sandboxMode:e.target.value||void 0}),className:`h-9 rounded-md border border-input bg-background px-3 text-sm`,children:[(0,T.jsx)(`option`,{value:``,children:`Inherit`}),(0,T.jsx)(`option`,{value:`read-only`,children:`Read only`}),(0,T.jsx)(`option`,{value:`workspace-write`,children:`Workspace write`})]})]})]})]}),(0,T.jsxs)(g,{children:[(0,T.jsx)(a,{variant:`outline`,onClick:()=>k(!1),children:`Cancel`}),(0,T.jsx)(a,{onClick:Oe,disabled:G.isPending||!P.name||!P.description||!P.developerInstructions,children:G.isPending?`Saving…`:`Save agent`})]})]})}),(0,T.jsx)(f,{open:A,onOpenChange:j,children:(0,T.jsxs)(u,{className:`max-w-2xl`,children:[(0,T.jsxs)(m,{children:[(0,T.jsx)(S,{children:`Import Codex agent TOML`}),(0,T.jsx)(y,{children:`The import accepts the required native fields and supported model, reasoning, and sandbox overrides.`})]}),(0,T.jsx)(v,{value:I,onChange:e=>L(e.target.value),className:`min-h-72 font-mono`,placeholder:`name = "reviewer"
|
|
2
|
-
description = "Use for code review."
|
|
3
|
-
developer_instructions = "Review the fixed diff."`}),(0,T.jsxs)(g,{children:[(0,T.jsx)(a,{variant:`outline`,onClick:()=>j(!1),children:`Cancel`}),(0,T.jsx)(a,{onClick:ke,disabled:K.isPending||!I.trim(),children:K.isPending?`Importing…`:`Import agent`})]})]})}),(0,T.jsx)(oe,{open:B!==null,onOpenChange:e=>!e&&V(null),children:(0,T.jsxs)(c,{children:[(0,T.jsxs)(ee,{children:[(0,T.jsxs)(ae,{children:[`Delete “`,B?.name,`”?`]}),(0,T.jsx)(ie,{children:`This removes the agent from the personal catalog. Existing workspace copies remain until the workspace is refreshed.`})]}),(0,T.jsxs)(ne,{children:[(0,T.jsx)(re,{render:(0,T.jsx)(a,{variant:`outline`,children:`Cancel`})}),(0,T.jsx)(a,{variant:`destructive`,onClick:Ae,disabled:q.isPending,children:q.isPending?`Deleting…`:`Delete agent`})]})]})})]})}export{O as AgentsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,t as r}from"./button-CREn1mup.js";import{t as i}from"./code-xml-DH-38Tt7.js";import{t as a}from"./git-branch-Ce0I2663.js";import{t as o}from"./layers-j_brOuoa.js";import{t as s}from"./brand-hHByyyzq.js";import{Cn as c,D as l,Jt as u,Mn as d,On as f,R as ee,Yt as p,Zt as m,a as h,c as g,ct as _,d as v,dn as y,gn as b,i as x,in as S,l as C,ln as w,mn as T,n as E,qt as D,r as O,t as k,tt as A,u as j,xn as M}from"./index-3tD_IeyQ.js";import{t as N}from"./card-yrg6ov8B.js";var P=t(e(),1),F=n(),I=[{id:`antigravity`,name:`Google Antigravity`,shortName:`Antigravity`,cliCommand:`agy`,icon:(0,F.jsx)(u,{className:`size-4`}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`antigravity-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`agy`,isAvailable:e.antigravity??!1,unavailableReason:`CLI "agy" not found on PATH`,icon:(0,F.jsx)(w,{size:12})},{id:`antigravity-ide`,label:`Antigravity IDE Workspace`,shortLabel:`IDE`,type:`editor`,targetId:`antigravity`,isAvailable:t.find(e=>e.id===`antigravity`)?.available??!1,unavailableReason:`Antigravity IDE not installed`,icon:(0,F.jsx)(i,{size:12})}]},{id:`claude`,name:`Claude Code`,shortName:`Claude`,cliCommand:`claude`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-[#D97757] text-white shadow-2xs`,children:(0,F.jsx)(p,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`claude-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`claude`,isAvailable:e.claude??!1,unavailableReason:`CLI "claude" not found on PATH`,icon:(0,F.jsx)(w,{size:12})},{id:`claude-desktop`,label:`Claude Desktop App`,shortLabel:`App`,type:`app`,targetId:`claude-desktop`,isAvailable:t.find(e=>e.id===`claude-desktop`)?.available??!1,unavailableReason:`Claude Desktop not detected`,icon:(0,F.jsx)(c,{size:12})}]},{id:`codex`,name:`OpenAI Codex`,shortName:`Codex`,cliCommand:`codex`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-foreground text-background shadow-2xs`,children:(0,F.jsx)(S,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`codex-cli`,label:`CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`codex`,isAvailable:e.codex??!1,unavailableReason:`CLI "codex" not found on PATH`,icon:(0,F.jsx)(w,{size:12})},{id:`codex-desktop`,label:`Codex Desktop App`,shortLabel:`App`,type:`app`,targetId:`codex-desktop`,isAvailable:t.find(e=>e.id===`codex-desktop`)?.available??!1,unavailableReason:`Codex Desktop not detected`,icon:(0,F.jsx)(c,{size:12})}]},{id:`copilot`,name:`GitHub Copilot`,shortName:`Copilot`,cliCommand:`copilot`,icon:(0,F.jsx)(`span`,{className:`grid size-5 place-items-center rounded bg-gradient-to-tr from-purple-600 via-indigo-500 to-blue-600 text-white shadow-2xs`,children:(0,F.jsx)(m,{className:`size-3`})}),getOptions:({aiDetected:e,launchTargets:t})=>[{id:`copilot-cli`,label:`Copilot CLI in Terminal`,shortLabel:`CLI`,type:`cli`,command:`copilot`,isAvailable:e.copilot??!1,icon:(0,F.jsx)(w,{size:12})},{id:`copilot-vscode`,label:`VS Code with Copilot`,shortLabel:`VS Code`,type:`editor`,targetId:`vscode`,isAvailable:t.find(e=>e.id===`vscode`)?.available??!1,unavailableReason:`VS Code not detected`,icon:(0,F.jsx)(i,{size:12})}]}];function L({workspaces:e,workspaceStatuses:t,workspacesLoading:n=!1,onOpenWorkspace:i,onNewWorkspace:c,showToast:u}){let p=l(),m=A(),S=ee(),[w,L]=(0,P.useState)(``),[R,z]=(0,P.useState)(!1),[B,V]=(0,P.useState)(``),H=e.find(e=>e.branchName===B)??e[0],U=e.filter(e=>`${e.branchName} ${e.description??``} ${e.repos.join(` `)}`.toLowerCase().includes(w.trim().toLowerCase())&&(!R||(t[e.branchName]?.changedFiles??0)>0)),[W,G]=(0,P.useState)(null),K=e.flatMap(e=>t[e.branchName]?[t[e.branchName]]:[]),q=K.reduce((e,t)=>e+(t.changedFiles||0),0),J=K.filter(e=>e.changedFiles>0).length,Y=e.filter(e=>(e.mode??`worktree`)===`worktree`).length,te=e.filter(e=>e.mode===`in-place`).length,X=(0,P.useMemo)(()=>{let t=new Map;return e.forEach(e=>{(e.repos||[]).forEach(e=>{let n=g(e),r=t.get(e);r?r.count+=1:t.set(e,{name:n,path:e,count:1})})}),Array.from(t.values())},[e]),Z=(0,P.useMemo)(()=>{let e={};return(p.data??[]).forEach(t=>{e[t.name]=t.detected}),e},[p.data]),Q=(0,P.useMemo)(()=>m.data??[],[m.data]),$=(0,P.useMemo)(()=>I.map(e=>{let t=e.getOptions({aiDetected:Z,launchTargets:Q}),n=t.filter(e=>e.isAvailable),r=n[0]||t[0],i=n.length>0,a=`Not found`,o=`neutral`;return n.length>1?(a=`${n.map(e=>e.shortLabel).join(` & `)} Ready`,o=`success`):n.length===1&&(a=`${n[0].shortLabel} Ready`,o=`success`),{harness:e,allOptions:t,availableOptions:n,primaryOption:r,isAnyAvailable:i,statusLabel:a,statusTone:o}}),[Z,Q]),ne=async(e,t)=>{if(W)return;let n=H;if(!n){u?.(`No active workspace available to launch harness in.`,`error`);return}let r=`${e.id}:${t.id}`;G(r);try{t.type===`cli`?(await S.mutateAsync({workspaceId:n.branchName,assistant:e.id,command:t.command}),u?.(`Launched ${e.name} (${t.label}) for ${n.branchName}`,`success`)):t.targetId&&(await _(`/api/workspace/${encodeURIComponent(n.branchName)}/launch`,{method:`POST`,body:JSON.stringify({targetId:t.targetId})}),u?.(`Opened ${n.branchName} in ${e.name} (${t.label})`,`success`))}catch(t){u?.(`Failed to launch ${e.name}: ${t instanceof Error?t.message:String(t)}`,`error`)}finally{G(null)}};return(0,F.jsxs)(`div`,{className:`context-home mx-auto max-w-7xl space-y-7 pb-10`,children:[(0,F.jsxs)(`header`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,F.jsx)(o,{size:15}),(0,F.jsx)(`span`,{children:s}),(0,F.jsx)(`span`,{className:`opacity-40`,children:`/`}),(0,F.jsx)(`span`,{className:`text-foreground`,children:`Overview`})]}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your next idea starts here.`})]}),(0,F.jsxs)(`section`,{className:`context-hero relative overflow-hidden rounded-2xl border border-border p-6 sm:p-9 lg:p-11`,children:[(0,F.jsxs)(`div`,{className:`relative z-10 max-w-2xl`,children:[(0,F.jsxs)(`div`,{className:`mb-5 flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[0.22em] text-primary`,children:[(0,F.jsx)(D,{size:23}),` A space for what’s next`]}),(0,F.jsxs)(`h1`,{className:`text-4xl font-semibold leading-[1.08] tracking-[-0.055em] sm:text-5xl lg:text-6xl`,children:[`Many repositories.`,(0,F.jsx)(`br`,{}),(0,F.jsx)(`span`,{className:`context-hero-accent`,children:`One clear direction.`})]}),(0,F.jsx)(`p`,{className:`mt-5 max-w-md text-sm leading-relaxed text-muted-foreground`,children:`Bring your code, context, and AI assistants together. Pick up a workspace, follow an idea, and make your next move.`}),(0,F.jsxs)(`div`,{className:`mt-7 flex flex-wrap gap-3`,children:[(0,F.jsxs)(r,{onClick:c,className:`h-10 rounded-lg px-5`,children:[(0,F.jsx)(b,{size:16}),` Start work `,(0,F.jsx)(d,{size:15})]}),H&&(0,F.jsxs)(r,{variant:`outline`,className:`h-10 max-w-full rounded-lg`,onClick:()=>i(H.branchName),children:[(0,F.jsxs)(`span`,{className:`truncate`,children:[`Open `,H.branchName]}),(0,F.jsx)(d,{size:14})]})]})]}),(0,F.jsx)(`div`,{className:`context-hero-signature pointer-events-none absolute right-10 top-1/2 hidden -translate-y-1/2 opacity-20 xl:block`,"aria-hidden":`true`,children:(0,F.jsx)(D,{size:220})}),(0,F.jsxs)(`div`,{className:`relative mt-9 flex flex-wrap gap-x-6 gap-y-2 border-t border-border pt-4 text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:`Isolated workspaces`}),(0,F.jsx)(`span`,{children:`Shared knowledge`}),(0,F.jsx)(`span`,{children:`Your choice of AI`})]})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[{label:`Workspaces`,value:n?`—`:e.length,detail:`${Y} worktrees · ${te} in-place`,icon:o},{label:`Connected repositories`,value:n?`—`:X.length,detail:`Across your workspaces`,icon:M},{label:`Changed files`,value:K.length?q:`—`,detail:`${J} workspaces with changes`,icon:a},{label:`Available assistants`,value:p.isLoading||m.isLoading?`—`:$.filter(e=>e.isAnyAvailable).length,detail:`Choose how you work`,icon:y}].map(({label:e,value:t,detail:n,icon:r})=>(0,F.jsxs)(N,{className:`context-metric gap-0 rounded-xl p-4 sm:p-5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:e}),(0,F.jsx)(r,{size:15,className:`text-primary`})]}),(0,F.jsx)(`div`,{className:`my-3 text-3xl font-semibold tracking-tight tabular-nums`,children:t}),(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:n})]},e))}),(0,F.jsxs)(`div`,{className:`grid items-start gap-7 xl:grid-cols-[minmax(0,1fr)_310px]`,children:[(0,F.jsxs)(`section`,{className:`min-w-0`,"aria-labelledby":`workspaces-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h2`,{id:`workspaces-heading`,className:`text-lg font-semibold tracking-tight`,children:`Your workspaces`}),(0,F.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`A little context. A lot of possibility.`})]}),(0,F.jsxs)(r,{variant:`ghost`,size:`sm`,onClick:c,children:[(0,F.jsx)(b,{size:14}),` New`]})]}),(0,F.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(`label`,{className:`flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-input bg-card px-3`,children:[(0,F.jsx)(T,{size:15,className:`shrink-0 text-muted-foreground`}),(0,F.jsx)(`input`,{"aria-label":`Search workspaces`,value:w,onChange:e=>L(e.target.value),placeholder:`Find a workspace or repository…`,className:`h-10 w-full min-w-0 bg-transparent text-xs outline-none`})]}),(0,F.jsxs)(r,{variant:R?`secondary`:`outline`,className:`h-10 rounded-lg`,"aria-pressed":R,onClick:()=>z(!R),children:[(0,F.jsx)(a,{size:14}),` With changes`]})]}),n?(0,F.jsx)(N,{className:`p-10`,children:(0,F.jsx)(v,{"aria-label":`Loading workspaces`,className:`mx-auto size-5`})}):e.length?U.length?(0,F.jsx)(`div`,{className:`space-y-3`,children:U.map(e=>{let n=t[e.branchName],r=e.mode===`in-place`||!n?null:C(n.syncStatus);return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>i(e.branchName),className:`context-workspace group w-full rounded-xl border border-border bg-card p-5 text-left transition duration-200 hover:border-primary/50 hover:bg-accent/30 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`,children:[(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,F.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-lg border border-border bg-primary/5 text-primary`,children:(0,F.jsx)(M,{size:19})}),(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:e.branchName}),(0,F.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.mode===`in-place`?`In-place workspace`:`Isolated worktree`})]})]}),(0,F.jsx)(d,{size:17,className:`mt-2 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-1 group-hover:text-primary`})]}),e.description&&(0,F.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-relaxed text-muted-foreground`,children:e.description}),(0,F.jsx)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:e.repos.map(e=>(0,F.jsx)(`span`,{className:`rounded-md bg-muted px-2 py-1 font-mono text-[10px] text-muted-foreground`,children:g(e)},e))}),(0,F.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-border/60 pt-3 text-[11px] text-muted-foreground`,children:[(0,F.jsx)(`span`,{className:n?.changedFiles?`text-warning-foreground`:``,children:n?n.changedFiles?`${n.changedFiles} changed files`:`Working tree clean`:`Status pending`}),r&&(0,F.jsx)(`span`,{children:r.label}),!!n?.runningServices&&(0,F.jsxs)(`span`,{className:`text-success-foreground`,children:[n.runningServices,` services running`]}),(0,F.jsx)(`span`,{className:`ml-auto`,children:`Open workspace`})]})]},e.id)})}):(0,F.jsxs)(N,{className:`rounded-xl p-8 text-center`,children:[(0,F.jsx)(`p`,{className:`text-sm`,children:`No workspaces match this view.`}),(0,F.jsx)(r,{variant:`ghost`,className:`mt-3`,onClick:()=>{L(``),z(!1)},children:`Clear filters`})]}):(0,F.jsx)(N,{className:`rounded-xl border-dashed`,children:(0,F.jsxs)(k,{children:[(0,F.jsxs)(O,{children:[(0,F.jsx)(x,{variant:`icon`,children:(0,F.jsx)(M,{})}),(0,F.jsx)(h,{children:`Make room for your next idea`}),(0,F.jsx)(E,{children:`Create a workspace to bring repositories and assistant context together.`})]}),(0,F.jsxs)(r,{onClick:c,children:[(0,F.jsx)(b,{size:15}),` Create your first workspace`]})]})})]}),(0,F.jsxs)(`aside`,{className:`rounded-xl border border-border bg-card p-5`,"aria-labelledby":`assistants-heading`,children:[(0,F.jsxs)(`div`,{className:`mb-5`,children:[(0,F.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-[10px] font-semibold uppercase tracking-[0.16em] text-primary`,children:[(0,F.jsx)(y,{size:14}),` Ready when you are`]}),(0,F.jsx)(`h2`,{id:`assistants-heading`,className:`text-lg font-semibold tracking-tight`,children:`Your AI, your way.`}),(0,F.jsx)(`p`,{className:`mt-2 text-xs leading-relaxed text-muted-foreground`,children:`Launch an assistant with the right workspace already in place.`})]}),(0,F.jsx)(`label`,{className:`block text-[11px] font-medium text-muted-foreground`,htmlFor:`launch-workspace`,children:`Launch into`}),(0,F.jsxs)(`select`,{id:`launch-workspace`,value:H?.branchName??``,onChange:e=>V(e.target.value),disabled:!e.length||!!W,className:`mt-2 mb-5 h-9 w-full min-w-0 rounded-md border border-input bg-background px-2 text-xs focus-visible:outline-ring`,children:[!e.length&&(0,F.jsx)(`option`,{value:``,children:`Create a workspace first`}),e.map(e=>(0,F.jsx)(`option`,{value:e.branchName,children:e.branchName},e.id))]}),(0,F.jsx)(`div`,{className:`divide-y divide-border`,children:$.map(({harness:e,availableOptions:t,isAnyAvailable:n,statusTone:i})=>(0,F.jsxs)(`div`,{className:`py-4 first:pt-0 last:pb-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[e.icon,(0,F.jsx)(`h3`,{className:`text-xs font-semibold`,children:e.shortName})]}),(0,F.jsx)(j,{tone:i,children:p.isLoading||m.isLoading?`Checking`:p.isError||m.isError?`Check failed`:n?`Available`:`Not detected`})]}),(0,F.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:t.map(t=>(0,F.jsxs)(r,{variant:`outline`,size:`xs`,disabled:!!W||!H,onClick:()=>void ne(e,t),title:`Open ${e.name} in ${H?.branchName??`a workspace`}`,children:[W===`${e.id}:${t.id}`?(0,F.jsx)(v,{className:`size-3`}):t.icon,t.shortLabel,(0,F.jsx)(d,{size:11})]},t.id))})]},e.id))})]})]}),X.length>0&&(0,F.jsxs)(`section`,{className:`border-t border-border pt-5`,children:[(0,F.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-medium text-muted-foreground`,children:[(0,F.jsx)(f,{size:14}),` Connected repositories`]}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:X.map(e=>(0,F.jsxs)(`button`,{onClick:()=>{L(e.path),z(!1),document.getElementById(`workspaces-heading`)?.scrollIntoView({block:`start`})},title:e.path,className:`flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs transition-colors hover:border-primary/50 focus-visible:outline-ring`,children:[(0,F.jsx)(M,{size:13,className:`text-primary`}),e.name,(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:e.count})]},e.path))})]})]})}export{L as DashboardPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,p as t}from"./button-CREn1mup.js";import{Gt as n,L as r,On as i,R as a,w as o}from"./badge-DwXvB44H.js";var s=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let r=this.attachedStore;if(r===null)return;let a;if(e){for(let t=this.attachedStores.length-1;t>=0&&!a;--t)a=this.attachedStores[t].context.triggerElements.getById(e);a??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!a&&this.throwOnMissingTrigger)throw Error(t(99,this.componentName,e,this.componentName));r.setOpen(!0,n(i,void 0,a))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,n(i))}};function c(){return new r({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new o,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function l(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:c(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:e,inactiveTriggerProps:e,popupProps:e}}function u(e,t,n=!1){return new r({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}var d=e=>e.triggerIdProp??e.activeTriggerId,f=e=>e.openProp??e.open,p=e=>(e.popupElement?.id??e.floatingId)||void 0;function m(e,t){return t!==void 0&&f(e)&&d(e)===t}function h(e,t){return m(e,t)?!0:t!==void 0&&f(e)&&d(e)==null&&e.triggerCount===1}var g={open:f,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:d,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:p,isTriggerActive:(e,t)=>t!==void 0&&d(e)===t,isOpenedByTrigger:(e,t)=>m(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&d(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>h(e,t)?p(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},_=class extends a{setState(e){}update(e){}set(e,t){}notifyAll(){}};export{s as a,g as i,l as n,u as r,_ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,t as r}from"./button-CREn1mup.js";import{n as i,t as a}from"./badge-DwXvB44H.js";import{n as o,t as s}from"./ScaffoldRepoInline-CP0yn5mw.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./alert-dialog-u7qgb9Hq.js";import{t as g}from"./trash-2-CMdv3eD3.js";import{c as _}from"./chunk-BV7QT456-DfUBKG-z.js";import{$ as v,A as y,G as b,P as x,V as S,_ as ee,_n as C,a as w,d as T,f as E,g as D,gn as O,h as k,i as A,m as j,n as M,ot as N,p as P,r as F,t as I,v as L,xn as te}from"./index-3tD_IeyQ.js";var R=t(e(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=_(),t=S(),n=b(),V=N(),H=y(),U=v(),W=x(),[G,K]=(0,R.useState)(null),[q,J]=(0,R.useState)(null),[Y,X]=(0,R.useState)(null),Z=(0,R.useMemo)(()=>{let e={};for(let t of V.data??[])t.projectId&&(e[t.projectId]=(e[t.projectId]??0)+1);return e},[V.data]),Q=()=>{J(null),K(B)},ne=e=>{J(null),K({editingId:e.id,name:e.name,description:e.description??``,repoPaths:e.repos.map(e=>e.path)})},re=e=>{K(t=>t&&{...t,repoPaths:t.repoPaths.includes(e.path)?t.repoPaths.filter(t=>t!==e.path):[...t.repoPaths,e.path]})},ie=async()=>{if(G){J(null);try{G.editingId?await U.mutateAsync({id:G.editingId,name:G.name,description:G.description||null,repos:G.repoPaths}):await H.mutateAsync({name:G.name,description:G.description||void 0,repos:G.repoPaths}),K(null)}catch(e){J(e instanceof Error?e.message:String(e))}}},ae=async()=>{if(Y)try{await W.mutateAsync(Y.id)}finally{X(null)}},oe=!!(G&&G.name.trim()&&G.repoPaths.length>0),$=H.isPending||U.isPending;return(0,z.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,z.jsxs)(`header`,{className:`mb-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-border/70 pb-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature workspace.`})]}),(0,z.jsxs)(r,{onClick:Q,className:`gap-1.5 shadow-sm`,children:[(0,z.jsx)(O,{size:15}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(T,{className:`size-6`})}):(t.data??[]).length===0?(0,z.jsxs)(I,{className:`border border-border border-dashed`,children:[(0,z.jsxs)(F,{children:[(0,z.jsx)(A,{variant:`icon`,children:(0,z.jsx)(te,{})}),(0,z.jsx)(w,{children:`No projects yet`}),(0,z.jsx)(M,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(O,{}),` New project`]})]}):(0,z.jsx)(`ul`,{className:`flex flex-col gap-3`,children:(t.data??[]).map(t=>(0,z.jsx)(`li`,{className:`rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-4 transition-all duration-200 hover:border-primary/40 hover:shadow-xs`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:t.name}),(Z[t.id]??0)>0&&(0,z.jsxs)(a,{variant:`secondary`,children:[Z[t.id],` workspace`,Z[t.id]===1?``:`s`]})]}),t.description&&(0,z.jsx)(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:t.description}),(0,z.jsx)(`ul`,{className:`mt-2 flex flex-col gap-0.5`,children:t.repos.map(e=>(0,z.jsxs)(`li`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[e.path,(0,z.jsxs)(`span`,{className:`ml-2 text-muted-foreground/60`,children:[`[`,e.defaultBranch,`]`]})]},e.path))})]}),(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,z.jsxs)(r,{size:`sm`,onClick:()=>e(`/new?project=${encodeURIComponent(t.id)}`),children:[(0,z.jsx)(C,{}),` Start work`]}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Edit ${t.name}`,onClick:()=>ne(t),children:(0,z.jsx)(l,{})}),(0,z.jsx)(r,{size:`icon-sm`,variant:`ghost`,"aria-label":`Remove ${t.name}`,onClick:()=>X(t),children:(0,z.jsx)(g,{})})]})]})},t.id))}),(0,z.jsx)(E,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(ee,{className:`max-w-lg`,children:[(0,z.jsxs)(k,{children:[(0,z.jsx)(L,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(P,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,z.jsxs)(D,{className:`space-y-4`,children:[(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Name`}),(0,z.jsx)(i,{value:G?.name??``,onChange:e=>K(t=>t&&{...t,name:e.target.value}),placeholder:`e.g. Hogia Billing`,autoFocus:!0})]}),(0,z.jsxs)(`label`,{className:`block`,children:[(0,z.jsxs)(`span`,{className:`mb-1 block text-sm font-medium`,children:[`Description `,(0,z.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`(optional)`})]}),(0,z.jsx)(i,{value:G?.description??``,onChange:e=>K(t=>t&&{...t,description:e.target.value}),placeholder:`What this group of repos is for`})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`span`,{className:`mb-1 block text-sm font-medium`,children:`Repositories`}),(0,z.jsx)(o,{repos:n.data??[],selectedPaths:G?.repoPaths??[],onToggle:re,loading:n.isLoading,emptyHint:`No repositories found in your dev directory.`}),(0,z.jsx)(s,{onCreated:e=>K(t=>t&&{...t,repoPaths:[...t.repoPaths,e.path]})})]}),q&&(0,z.jsx)(`p`,{className:`text-sm text-destructive-foreground`,children:q})]}),(0,z.jsxs)(j,{children:[(0,z.jsx)(r,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(r,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(T,{}):null,G?.editingId?`Save changes`:`Create project`]})]})]})}),(0,z.jsx)(h,{open:Y!==null,onOpenChange:e=>!e&&X(null),children:(0,z.jsxs)(f,{children:[(0,z.jsxs)(c,{children:[(0,z.jsxs)(m,{children:[`Remove “`,Y?.name,`”?`]}),(0,z.jsx)(p,{children:`This only removes the project from the registry — repositories and workspaces on disk are not touched.`})]}),(0,z.jsxs)(u,{children:[(0,z.jsx)(d,{render:(0,z.jsx)(r,{variant:`outline`,children:`Cancel`})}),(0,z.jsxs)(r,{variant:`destructive`,onClick:ae,disabled:W.isPending,children:[W.isPending?(0,z.jsx)(T,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,i as s,l as c,m as l,o as u,p as d,t as f}from"./button-CREn1mup.js";import{$t as p,Bt as m,Gt as h,Ht as g,Kt as _,Nn as ee,Qt as te,Sn as ne,Wn as v,_t as re,c as ie,gt as ae,i as oe,l as se,n as y,o as ce,pn as le,rn as ue,s as de}from"./badge-DwXvB44H.js";import{t as fe}from"./useAriaLabelledBy-C4zV-1Ra.js";import{d as b,j as x,jt as pe,mn as S,u as me}from"./index-3tD_IeyQ.js";var C=o(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),w=t(e(),1),T=w.createContext({disabled:!1});function he(){return w.useContext(T)}function ge(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}function E(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":``}:{"data-unchecked":``}},...se}}var D=w.createContext(void 0);function _e(){return w.useContext(D)}var O=w.createContext(void 0);function k(){let e=w.useContext(O);if(e===void 0)throw Error(d(14));return e}var A=a(),ve=`data-parent`,ye=w.forwardRef(function(e,t){let{checked:a,className:o,defaultChecked:l=!1,"aria-labelledby":d,disabled:f=!1,form:m,id:g,indeterminate:v=!1,inputRef:se,name:y,onCheckedChange:b,parent:x=!1,readOnly:S=!1,render:me,required:C=!1,uncheckedValue:T,value:D,nativeButton:k=!1,style:ye,...j}=e,{clearErrors:M}=de(),{disabled:N,name:be,setDirty:xe,setFilled:P,setFocused:Se,setTouched:Ce,state:we,validationMode:Te,validityData:Ee,validation:De}=ie(),Oe=he(),{labelId:ke,controlId:Ae,registerControlId:F,getDescriptionProps:je}=ce(),I=_e(),L=I?.allValues===void 0?void 0:I.parent,R=L!==void 0,z=N||Oe.disabled||I?.disabled||f,B=be??y,V=D??B,Me=_(),Ne=_(),H=g||Ae;R&&(x?H=Ne:V===void 0?H||=Ne:H=`${L.id}-${V}`);let U={};R&&(x?U=L.getParentProps():V!==void 0&&(U=L.getChildProps(V)));let{checked:Pe=a,indeterminate:Fe=v,onCheckedChange:Ie,...Le}=U,W=I?.value,G=w.useRef(null),K=i(()=>Symbol()),q=w.useRef(!1),{getButtonProps:Re,buttonRef:ze}=te({disabled:z,native:k}),J=I?.validation??De,[Y,Be]=ne({controlled:V!==void 0&&W!==void 0&&!x?W.includes(V):Pe,default:l,name:`Checkbox`,state:`checked`}),X=R?!!Pe:Y,Z=R&&Fe||v;ue(()=>{F!==c&&(q.current=!0,F(K.current,H))},[H,F,K]),w.useEffect(()=>{let e=K.current;return()=>{!q.current||F===c||(q.current=!1,F(e,void 0))}},[F,K]),oe(G,Me,Y,void 0,!I&&!z,y);let Q=w.useRef(null),Ve=J.registerInput,He=I?V:void 0,Ue=w.useCallback(e=>Ve(e,{controlRef:G,value:He}),[Ve,He]),We=r(se,Q,x?void 0:Ue),Ge=fe(d,ke,Q,!k,H??void 0);ue(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&P(!0))},[Y,Z,P]),pe(Y,()=>{I||(M(B),P(Y),xe(Y!==Ee.initialValue),J.change(Y))});let Ke=u({checked:Y,disabled:z,form:m,name:x?void 0:B,id:k?void 0:H??void 0,required:C,ref:We,style:B?re:ae,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(S){e.preventDefault();return}let t=e.currentTarget.checked,n=h(ee,e.nativeEvent);if(b?.(t,n),!n.isCanceled&&(Ie?.(t,n),!n.isCanceled&&(Be(t),V!==void 0&&I!==void 0&&!x&&!R))){let e=t?[...I.value,V]:I.value.filter(e=>e!==V);I.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){G.current?.focus()}},D===void 0?n:{value:(I?Y&&D:D)||``},je,e=>J.getValidationProps(z,e));w.useEffect(()=>{if(!L||V===void 0)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=w.useMemo(()=>({...we,checked:X,disabled:z,readOnly:S,required:C,indeterminate:Z}),[we,X,z,S,C,Z]),qe=E($),Je=s(`span`,e,{state:$,ref:[ze,G,t],props:[{id:k?H??void 0:Me,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":S||void 0,"aria-required":C||void 0,"aria-labelledby":Ge,[ve]:x?``:void 0,onFocus(){z||Se(!0)},onBlur(){let e=Q.current;e&&(Ce(!0),Se(!1),Te===`onBlur`&&J.commit(I?W:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=Q.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),le(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||ge(t)?.click()})},onClick(e){if(S||z)return;e.preventDefault();let t=Q.current;t&&p(t,e)}},j,Le,Re,je,e=>J.getValidationProps(z,e)],stateAttributesMapping:qe});return(0,A.jsxs)(O.Provider,{value:$,children:[Je,!Y&&!I&&B&&!x&&T!==void 0&&(0,A.jsx)(`input`,{type:`hidden`,form:m,name:B,value:T,disabled:z}),(0,A.jsx)(`input`,{...Ke,suppressHydrationWarning:!0})]})}),j=w.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,c=k(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:f}=g(l),p=w.useRef(null),h={...c,transitionStatus:d};m({open:l,ref:p,onComplete(){l||f(!1)}});let _={...E(c),...v},ee=a||u,te=s(`span`,e,{ref:[t,p],state:h,stateAttributesMapping:_,props:o});return ee?te:null});function M({className:e,...t}){return(0,A.jsx)(ye,{className:l(`relative inline-flex size-4.5 shrink-0 items-center justify-center rounded-[.25rem] border border-input bg-background not-dark:bg-clip-padding shadow-xs/5 outline-none ring-ring transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[3px] not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-invalid:border-destructive/36 focus-visible:aria-invalid:border-destructive/64 focus-visible:aria-invalid:ring-destructive/48 data-disabled:opacity-64 sm:size-4 dark:not-data-checked:bg-input/32 dark:aria-invalid:ring-destructive/24 dark:not-data-disabled:not-data-checked:not-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)] [[data-disabled],[data-checked],[aria-invalid]]:shadow-none`,e),"data-slot":`checkbox`,...t,children:(0,A.jsx)(j,{className:`-inset-px absolute flex items-center justify-center rounded-[.25rem] text-primary-foreground data-unchecked:hidden data-checked:bg-primary data-indeterminate:text-foreground`,"data-slot":`checkbox-indicator`,render:(e,t)=>(0,A.jsx)(`span`,{...e,children:t.indeterminate?(0,A.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,A.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,A.jsx)(`svg`,{className:`size-3.5 sm:size-3`,fill:`none`,height:`24`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`3`,viewBox:`0 0 24 24`,width:`24`,xmlns:`http://www.w3.org/2000/svg`,children:(0,A.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})})})}function N({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a,freshnessMap:o}){let[s,c]=(0,w.useState)(``),u=(0,w.useMemo)(()=>{let t=s.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,s]);return(0,A.jsxs)(`div`,{className:l(`flex flex-col gap-2`,a),children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(S,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(y,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter repositories…`,className:`pl-8`,"aria-label":`Filter repositories`})]}),(0,A.jsx)(`div`,{className:`max-h-56 overflow-y-auto rounded-lg border border-border`,children:r?(0,A.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`Scanning for repositories…`}):u.length===0?(0,A.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:i??`No repositories found.`}):(0,A.jsx)(`ul`,{className:`divide-y divide-border`,children:u.map(e=>{let r=t.includes(e.path),i=o?.[e.path];return(0,A.jsx)(`li`,{children:(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-3 py-2 hover:bg-accent`,children:[(0,A.jsx)(M,{checked:r,onCheckedChange:()=>n(e),"aria-label":e.name}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,A.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.path})]}),(0,A.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&(0,A.jsx)(me,{tone:i.status===`up-to-date`?`success`:i.status===`behind`?`warning`:i.status===`diverged`?`danger`:i.status===`ahead`?`info`:`neutral`,title:i.message,children:i.status===`behind`?`↓ ${i.behind} behind`:i.status===`up-to-date`?`Up to date`:i.status===`diverged`?`Diverged`:i.status===`ahead`?`↑ ${i.ahead} ahead`:`Local`}),(0,A.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})]})},e.path)})})})]})}function be({onCreated:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(``),[a,o]=(0,w.useState)(null),s=x(),c=async()=>{o(null);try{let{repo:t}=await s.mutateAsync(r.trim());i(``),n(!1),e(t)}catch(e){o(e instanceof Error?e.message:String(e))}};return t?(0,A.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(y,{value:r,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&c(),placeholder:`new-repo-name`,className:`h-7 font-mono text-xs`,"aria-label":`New repository name`,autoFocus:!0}),(0,A.jsxs)(f,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,A.jsx)(b,{}):null,`Create`]}),(0,A.jsx)(f,{size:`xs`,variant:`ghost`,onClick:()=>{n(!1),o(null)},children:`Cancel`})]}),a&&(0,A.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:a})]}):(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(!0),className:`mt-1.5 inline-flex cursor-pointer items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground`,children:[(0,A.jsx)(C,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{N as n,M as r,be as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,c as n,d as r,g as i,i as a,m as o,p as s,t as c}from"./button-CREn1mup.js";import{$t as l,Gt as u,Kt as d,Nn as f,Qt as p,Sn as m,_t as ee,a as h,c as te,gt as g,i as ne,l as _,n as v,o as re,rn as ie,s as y,t as b}from"./badge-DwXvB44H.js";import{t as ae}from"./useAriaLabelledBy-C4zV-1Ra.js";import{C as x,Dn as S,Et as C,S as w,b as T,cn as E,d as D,hn as O,jt as oe,w as k,x as A}from"./index-3tD_IeyQ.js";import{t as j}from"./card-yrg6ov8B.js";import{t as M}from"./label-DC730X8s.js";import{t as N}from"./alert-QnMXzwpU.js";var P=i();function F({className:e,orientation:t=`horizontal`,...n}){return(0,P.jsx)(C,{className:o(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:not-[[class^='h-']]:not-[[class*='_h-']]:self-stretch`,e),"data-slot":`separator`,orientation:t,...n})}var I=t(e(),1),L=I.createContext(void 0);function R(){let e=I.useContext(L);if(e===void 0)throw Error(s(63));return e}var z={..._,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},B=I.forwardRef(function(e,t){let{checked:i,className:o,defaultChecked:s,"aria-labelledby":c,form:_,id:v,inputRef:b,name:x,nativeButton:S=!1,onCheckedChange:C,readOnly:w=!1,required:T=!1,disabled:E=!1,render:D,uncheckedValue:O,value:k,style:A,...j}=e,{clearErrors:M}=y(),{state:N,setTouched:F,setDirty:R,validityData:B,setFilled:V,setFocused:H,validationMode:U,disabled:se,name:ce,validation:W}=te(),{labelId:le}=re(),G=se||E,K=ce??x,q=I.useRef(null),ue=r(q,b,W.inputRef),J=I.useRef(null),Y=d(),X=h({id:v,implicit:!1,controlRef:J}),Z=S?void 0:X,[Q,de]=m({controlled:i,default:!!s,name:`Switch`,state:`checked`});ne(J,Y,Q,void 0,!G,x),ie(()=>{q.current&&V(q.current.checked)},[V]),oe(Q,()=>{M(K),R(Q!==B.initialValue),V(Q),W.change(Q)});let{getButtonProps:fe,buttonRef:pe}=p({disabled:G,native:S}),me=ae(c,le,q,!S,Z),he={id:S?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":w||void 0,"aria-required":T||void 0,"aria-labelledby":me,onFocus(){G||H(!0)},onBlur(){let e=q.current;!e||G||(F(!0),H(!1),U===`onBlur`&&W.commit(e.checked))},onClick(e){if(w||G)return;e.preventDefault();let t=q.current;t&&l(t,e)}},ge={...W.getValidationProps(G),checked:Q,disabled:G,form:_,id:Z,name:K,required:T,style:K?ee:g,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ue,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(w){e.preventDefault();return}let t=e.currentTarget.checked,n=u(f,e.nativeEvent);C?.(t,n),!n.isCanceled&&de(t)},onClick(e){e.stopPropagation()},onFocus(){J.current?.focus()},...k===void 0?n:{value:k}},$=I.useMemo(()=>({...N,checked:Q,disabled:G,readOnly:w,required:T}),[N,Q,G,w,T]),_e=a(`span`,e,{state:$,ref:[t,J,pe],props:[he,j,fe,e=>W.getValidationProps(G,e)],stateAttributesMapping:z});return(0,P.jsxs)(L.Provider,{value:$,children:[_e,!Q&&K&&O!==void 0&&(0,P.jsx)(`input`,{type:`hidden`,form:_,name:K,value:O,disabled:G}),(0,P.jsx)(`input`,{...ge,suppressHydrationWarning:!0})]})}),V=I.forwardRef(function(e,t){let{render:n,className:r,style:i,...o}=e,s=R();return a(`span`,e,{state:s,ref:t,stateAttributesMapping:z,props:o})});function H({className:e,...t}){return(0,P.jsx)(B,{className:o(`inline-flex h-[calc(var(--thumb-size)+2px)] w-[calc(var(--thumb-size)*2-2px)] shrink-0 cursor-pointer items-center rounded-full p-px outline-none transition-[background-color,box-shadow] duration-200 [--thumb-size:--spacing(5)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-64 sm:[--thumb-size:--spacing(4)]`,e),"data-slot":`switch`,...t,children:(0,P.jsx)(V,{className:o(`pointer-events-none block aspect-square h-full origin-left in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:not-data-disabled:scale-x-110 in-[[role=switch]:active,[data-slot=label]:active,[data-slot=field-label]:active]:rounded-[var(--thumb-size)/calc(var(--thumb-size)*1.1)] rounded-(--thumb-size) bg-background shadow-sm/5 will-change-transform [transition:translate_.15s,border-radius_.15s,scale_.1s_.1s,transform-origin_.15s] data-checked:origin-[var(--thumb-size)_50%] data-checked:translate-x-[calc(var(--thumb-size)-4px)]`),"data-slot":`switch-thumb`})})}function U({config:e,setConfig:t,saveStatus:n,editors:r,adapters:i,saveAppConfig:a,isSettingsFormValid:o,toolsStatus:s,toolsLoading:l,updatingToolId:u,fetchToolsStatus:d,handleUpdateTool:f}){if(!e)return null;let p=r.find(t=>t.command===e.defaultEditor),m=i.find(t=>t.name===(e.storageProvider||`local`));return(0,P.jsxs)(`div`,{className:`mx-auto max-w-4xl animate-fade-in`,children:[(0,P.jsxs)(`header`,{className:`mb-6 border-b border-border/70 pb-4`,children:[(0,P.jsx)(`h1`,{className:`text-xl font-bold tracking-tight text-foreground`,children:`Global Settings`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Configure your local development directories, AI search parameters, storage adapters, and editor defaults.`})]}),n===`success`&&(0,P.jsxs)(N,{variant:`success`,className:`mb-6`,children:[(0,P.jsx)(S,{size:18}),` Settings successfully saved and updated!`]}),n===`error`&&(0,P.jsxs)(N,{variant:`error`,className:`mb-6`,children:[(0,P.jsx)(E,{size:18}),` Error: Could not save configuration details to disk.`]}),(0,P.jsx)(j,{className:`mb-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:(0,P.jsxs)(`div`,{className:`grid grid-cols-1 gap-6 md:grid-cols-2`,children:[(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-devDir`,className:`text-sm`,children:`Development Directory`}),(0,P.jsx)(v,{type:`text`,id:`settings-devDir`,value:e.devDir,onChange:n=>t({...e,devDir:n.target.value})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where your git projects are scanned.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-workspacesDir`,className:`text-sm`,children:`Workspaces Directory`}),(0,P.jsx)(v,{type:`text`,id:`settings-workspacesDir`,value:e.workspacesDir,onChange:n=>t({...e,workspacesDir:n.target.value})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Directory where unified worktree environments are spun up.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`settings-scanDepth`,className:`text-sm`,children:`Repo Search Depth`}),(0,P.jsx)(v,{type:`number`,min:1,max:5,id:`settings-scanDepth`,value:e.scanDepth,onChange:n=>t({...e,scanDepth:parseInt(n.target.value,10)})}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Max directory levels deep the system will traverse for git repos.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:`Default Assistant`}),(0,P.jsxs)(T,{value:e.defaultAssistant||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultAssistant:n||null}),children:[(0,P.jsx)(x,{"aria-label":`Default Assistant`,children:(0,P.jsx)(k,{children:e.defaultAssistant===`claude`?`Claude Code`:e.defaultAssistant===`antigravity`?`Antigravity`:e.defaultAssistant===`codex`?`Codex`:e.defaultAssistant===`copilot`?`GitHub Copilot`:e.defaultAssistant===`cursor`?`Cursor`:`None (Prompt me)`})}),(0,P.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,P.jsx)(A,{value:``,children:`None (Prompt me)`}),(0,P.jsx)(A,{value:`claude`,children:`Claude Code`}),(0,P.jsx)(A,{value:`antigravity`,children:`Antigravity`}),(0,P.jsx)(A,{value:`codex`,children:`Codex`}),(0,P.jsx)(A,{value:`copilot`,children:`GitHub Copilot`}),(0,P.jsx)(A,{value:`cursor`,children:`Cursor`})]})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your preferred workspace context manager.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:`Preferred Editor`}),(0,P.jsxs)(T,{value:e.defaultEditor||``,onValueChange:n=>typeof n==`string`&&t({...e,defaultEditor:n||null}),children:[(0,P.jsx)(x,{"aria-label":`Preferred Editor`,children:(0,P.jsx)(k,{children:p?`${p.name} ${p.detected?`(Detected)`:`(Not found)`}`:`No preference`})}),(0,P.jsxs)(w,{alignItemWithTrigger:!1,children:[(0,P.jsx)(A,{value:``,children:`No preference`}),r.map(e=>(0,P.jsxs)(A,{value:e.command,children:[e.name,` `,e.detected?`(Detected)`:`(Not found)`]},e.command))]})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Shown first in the “Open with…” workspace chooser.`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 md:col-span-2`,children:[(0,P.jsx)(F,{className:`mt-1`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Workspace Storage Settings`}),(0,P.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Choose where maps, plans, and knowledge files are stored.`})]}),(0,P.jsxs)(`div`,{className:`flex max-w-md flex-col gap-1.5`,children:[(0,P.jsx)(M,{htmlFor:`storageProvider`,className:`text-sm`,children:`Storage Provider`}),(0,P.jsxs)(T,{value:e.storageProvider||`local`,onValueChange:n=>{if(typeof n!=`string`)return;let r=n,a={...e,storageProvider:r},o=i.find(e=>e.name===r);o?.configFields?.length&&(a.adapterConfig||={},a.adapterConfig[r]||(a.adapterConfig[r]={}),o.configFields.forEach(e=>{a.adapterConfig[r][e.key]===void 0&&e.default!==void 0&&(a.adapterConfig[r][e.key]=e.default)})),t(a)},children:[(0,P.jsx)(x,{id:`storageProvider`,"aria-label":`Storage Provider`,children:(0,P.jsx)(k,{children:m?.displayName??`Local Workspace (Folders)`})}),(0,P.jsx)(w,{alignItemWithTrigger:!1,children:i.length>0?i.map(e=>(0,P.jsx)(A,{value:e.name,children:e.displayName},e.name)):(0,P.jsx)(A,{value:`local`,children:`Local Workspace (Folders)`})})]}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m?.description||`Choose where to store maps, plans, and knowledge files. Centralized vault keeps repositories 100% clean and allows Obsidian integration.`})]}),(()=>{let n=e.storageProvider||`local`,r=i.find(e=>e.name===n);return r?.configFields?.length?(0,P.jsxs)(`div`,{className:`flex max-w-md flex-col gap-4 rounded-xl border border-border bg-muted/40 p-4`,children:[(0,P.jsxs)(`h4`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[r.displayName,` Settings`]}),r.configFields.map(r=>{let i=e.adapterConfig?.[n]?.[r.key]??r.default??``,a=i=>{let a={...e.adapterConfig||{},[n]:{...e.adapterConfig?.[n]||{},[r.key]:i}};t({...e,adapterConfig:a})};return r.type===`boolean`?(0,P.jsxs)(M,{className:`flex cursor-pointer items-start gap-3 text-sm`,children:[(0,P.jsx)(H,{checked:!!i,onCheckedChange:e=>a(e)}),(0,P.jsxs)(`span`,{className:`flex flex-col`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:r.label}),r.description&&(0,P.jsx)(`span`,{className:`mt-0.5 text-xs leading-normal text-muted-foreground`,children:r.description})]})]},r.key):(0,P.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,P.jsx)(M,{className:`text-sm`,children:r.label}),(0,P.jsx)(v,{type:r.type===`number`?`number`:`text`,value:i,onChange:e=>{let t=r.type===`number`?Number(e.target.value):e.target.value;a(t)}}),r.description&&(0,P.jsx)(`span`,{className:`text-xs leading-normal text-muted-foreground`,children:r.description})]},r.key)})]}):null})()]})]})}),(0,P.jsxs)(j,{className:`mt-6 rounded-xl border border-border/80 bg-card/70 backdrop-blur-md p-6 shadow-xs`,children:[(0,P.jsxs)(`div`,{className:`mb-6 flex items-start justify-between gap-4`,children:[(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h3`,{className:`text-lg font-semibold text-foreground`,children:`AI Toolchain Updates`}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Monitor and update the CLI packages and assistants in your workflow.`})]}),(0,P.jsxs)(c,{variant:`outline`,size:`sm`,onClick:()=>d(!0),disabled:l,children:[l?(0,P.jsx)(D,{className:`size-3`}):(0,P.jsx)(O,{size:13}),l?`Checking...`:`Check Now`]})]}),l&&s.length===0?(0,P.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground`,children:[(0,P.jsx)(D,{className:`size-6`}),(0,P.jsx)(`span`,{className:`text-xs`,children:`Fetching registry version details...`})]}):s.length===0?(0,P.jsx)(`p`,{className:`py-4 text-xs text-muted-foreground`,children:`No toolchain information available.`}):(0,P.jsx)(`div`,{className:`space-y-4`,children:s.map(e=>(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-xl border border-border bg-muted/30 p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`h4`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[e.name,(0,P.jsx)(b,{variant:e.installed?`success`:`secondary`,size:`sm`,children:e.installed?`Installed`:`Not Installed`})]}),(0,P.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,P.jsxs)(`span`,{children:[`Installed version: `,(0,P.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.currentVersion})]}),e.installed&&(0,P.jsxs)(`span`,{children:[`Latest: `,(0,P.jsx)(`code`,{className:`font-mono text-[10px] text-foreground`,children:e.latestVersion})]})]}),(0,P.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:e.updateCmd})]}),(0,P.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:e.updateAvailable?(0,P.jsx)(c,{size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(D,{className:`size-3`}),` Updating...`]}):`Update Tool`}):e.installed?(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsxs)(b,{variant:`success`,className:`gap-1.5`,children:[(0,P.jsx)(S,{size:12}),` Up to Date`]}),(0,P.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(D,{className:`size-3`}),` Reinstalling...`]}):`Reinstall`})]}):(0,P.jsx)(c,{variant:`outline`,size:`sm`,onClick:()=>f(e.id),disabled:u!==null,children:u===e.id?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(D,{className:`size-3`}),` Installing...`]}):`Install CLI`})})]},e.id))})]}),(0,P.jsx)(`div`,{className:`mb-10 flex justify-end pt-4`,children:(0,P.jsxs)(c,{onClick:()=>a(e),disabled:!o,children:[(0,P.jsx)(S,{size:16}),` Save Configuration`]})})]})}export{U as SettingsPage};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-CREn1mup.js";import{n as o,t as s}from"./badge-DwXvB44H.js";import{t as ee}from"./chevron-down-B_Mwbim8.js";import{n as c,r as te,t as l}from"./shield-check-Dd1Yv3l2.js";import{t as ne}from"./code-xml-DH-38Tt7.js";import{a as re,i as ie,n as u,r as d,t as ae}from"./square-check-big-BSIiYXPI.js";import{t as f}from"./layers-j_brOuoa.js";import{t as p}from"./trash-2-CMdv3eD3.js";import{d as oe,n as se}from"./chunk-BV7QT456-DfUBKG-z.js";import{Dn as m,F as ce,I as le,J as ue,O as de,On as h,Q as fe,Y as pe,Z as me,_ as g,a as he,d as ge,dn as _e,f as _,gn as ve,h as v,i as ye,it as be,ln as xe,m as y,mn as Se,n as Ce,o as we,on as b,ot as Te,p as x,r as Ee,t as S,un as De,ut as Oe,v as C,wn as w,xn as ke}from"./index-3tD_IeyQ.js";import{t as Ae}from"./card-yrg6ov8B.js";import{t as T}from"./label-DC730X8s.js";var je=r(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),Me=r(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Ne=r(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Pe=r(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Fe=r(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),E=t(e(),1),D=n(),O={"git-pull-request":d,"flask-conical":ie,package:u,database:re,"shield-check":l,terminal:xe,zap:b,cpu:w,layers:f,boxes:h,code:ne},Ie=[{label:`Blue`,value:`#3b82f6`},{label:`Green`,value:`#10b981`},{label:`Purple`,value:`#8b5cf6`},{label:`Amber`,value:`#f59e0b`},{label:`Red`,value:`#ef4444`},{label:`Cyan`,value:`#06b6d4`},{label:`Pink`,value:`#ec4899`},{label:`Emerald`,value:`#059669`}];function k({showToast:e}){let[t,n]=(0,E.useState)(`global`),[r,l]=(0,E.useState)(``),[ne,re]=(0,E.useState)({}),[ie,u]=(0,E.useState)(!1),[d,f]=(0,E.useState)(null),[xe,b]=(0,E.useState)(!1),[w,k]=(0,E.useState)(null),[Le,A]=(0,E.useState)(!1),[j,M]=(0,E.useState)(`edit`),[Re,N]=(0,E.useState)(!1),[P,F]=(0,E.useState)(null),[ze,I]=(0,E.useState)(!1),[L,R]=(0,E.useState)(null),[Be,Ve]=(0,E.useState)(null),[z,B]=(0,E.useState)(null),{data:V=[],isLoading:He}=me(),{data:H=[],isLoading:Ue}=fe(t===`global`?void 0:t),{data:We=[]}=Te(),{data:U,isLoading:Ge,isError:Ke}=be(t===`global`?``:t),[W,G]=(0,E.useState)(null),qe=pe(),Je=le(),K=ue(),Ye=ce(),q=de(),J=t!==`global`,Y=new Set(W??U?.enabledSkills??[]),X=!J||!Ge&&!Ke&&!!U;(0,E.useEffect)(()=>{if(!J){G(null);return}U&&G([...U.enabledSkills])},[J,t,U]);let Xe=e=>{re(t=>({...t,[e]:!t[e]}))},Z=H.filter(e=>{if(!r.trim())return!0;let t=r.toLowerCase();return e.title?.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.tags?.some(e=>e.toLowerCase().includes(t))}),Ze=V.reduce((e,t)=>(e[t.id]=Z.filter(e=>e.category===t.id),e),{}),Q=Z.filter(e=>!e.category||!V.some(t=>t.id===e.category)),Qe=e=>{f(e||{name:``,description:``,icon:`boxes`,color:`#3b82f6`,custom:!0}),u(!0)},$e=async()=>{if(!(!d||!d.name?.trim()))try{await qe.mutateAsync({id:d.id,name:d.name.trim(),description:d.description,icon:d.icon,color:d.color}),e?.(`Category saved successfully`,`success`),u(!1),f(null)}catch(t){e?.(`Failed to save category`,`error`),console.error(t)}},et=(e,t)=>{t.stopPropagation(),R({type:`category`,id:e.id,title:e.name}),I(!0)},$=(e,t)=>{k(e||{name:``,title:``,category:t||(V[0]?.id??`pull-requests`),description:``,tags:[],allowedTools:[],content:`# Skill Title
|
|
2
|
-
|
|
3
|
-
Instructions and playbook for the AI assistant.
|
|
4
|
-
`,custom:!0}),A(!!e),M(`edit`),b(!0)},tt=e=>{if(!w)return;let t={...w,title:e};!Le&&!w.id&&(t.name=e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)),k(t)},nt=async()=>{if(!w||!w.name?.trim()||!w.description?.trim()||!w.content?.trim()){e?.(`Skill name, trigger description, and content are required`,`error`);return}try{await K.mutateAsync({id:w.id,name:w.name.trim(),title:w.title||w.name,category:w.category||`general`,description:w.description||``,tags:w.tags||[],allowedTools:w.allowedTools||[],content:w.content}),e?.(`Skill package saved successfully`,`success`),b(!1),k(null)}catch(t){e?.(`Failed to save skill`,`error`),console.error(t)}},rt=(e,t)=>{t.stopPropagation(),R({type:`skill`,id:e.id,title:e.title||e.name}),I(!0)},it=async()=>{if(L)try{L.type===`category`?(await Je.mutateAsync(L.id),e?.(`Category deleted`,`info`)):(await Ye.mutateAsync(L.id),e?.(`Skill package deleted`,`info`)),I(!1),R(null)}catch(t){e?.(`Failed to delete item`,`error`),console.error(t)}},at=e=>{if(!J||!X||W===null)return;let t=new Set(W);t.has(e)?t.delete(e):t.add(e),G(Array.from(t))},ot=()=>{if(!w||w.custom!==!1)return;let e=`${w.name}-copy`;k({...w,id:void 0,name:e,title:`${w.title||w.name} Copy`,allowedTools:[],custom:!0,sourcePath:void 0,references:void 0,scripts:void 0}),A(!0)},st=(e,t)=>{if(!J||!X||W===null)return;let n=Ze[e]||[],r=new Set(W);for(let e of n)t?r.add(e.id):r.delete(e.id);G(Array.from(r))},ct=async()=>{if(!(!U||W===null||!J))try{await q.mutateAsync({workspaceId:t,expectedRevision:U.revision??0,enabledSkills:W,enabledAgents:U.enabledAgents??[],enabledCategories:V.map(e=>e.id)}),e?.(`Skill selection saved. Refresh the workspace to apply it.`,`success`)}catch(t){e?.(t instanceof Error?t.message:`Failed to save skill selection`,`error`)}},lt=(e,t)=>{e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`,Ve(t)},ut=(e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`,z!==t&&B(t)},dt=()=>{B(null)},ft=async(t,n)=>{t.preventDefault(),B(null);let r=t.dataTransfer.getData(`text/plain`)||Be;if(Ve(null),!r)return;let i=H.find(e=>e.id===r);!i||!i.custom||J||i.category===n||(await K.mutateAsync({id:i.id,name:i.name,title:i.title,description:i.description,tags:i.tags,allowedTools:i.allowedTools,content:i.content,category:n}),e?.(`Skill re-categorized`,`success`))},pt=(e,t)=>{t.stopPropagation(),F(e),N(!0)},mt=async t=>{if(!P||P.category===t){N(!1),F(null);return}await K.mutateAsync({id:P.id,name:P.name,title:P.title,description:P.description,tags:P.tags,allowedTools:P.allowedTools,content:P.content,category:t}),e?.(`Skill moved to category`,`success`),N(!1),F(null)};return(0,D.jsxs)(`div`,{className:`flex-1 flex flex-col h-full overflow-hidden bg-background text-foreground`,children:[(0,D.jsxs)(`div`,{className:`p-6 border-b border-border flex flex-col sm:flex-row sm:items-center justify-between gap-4 bg-card/40 backdrop-blur-sm`,children:[(0,D.jsx)(`div`,{children:(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`p-2 rounded-xl bg-primary/10 text-primary`,children:(0,D.jsx)(h,{className:`h-6 w-6`})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-xl font-bold tracking-tight`,children:`Skill Library`}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Create, organize, and assign reusable Agent Skill packages.`})]})]})}),(0,D.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,D.jsx)(a,{render:(0,D.jsx)(se,{to:`/agents`}),variant:`outline`,size:`sm`,children:`Codex Agents`}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 bg-muted/50 rounded-lg px-3 py-1.5 border border-border`,children:[(0,D.jsx)(ke,{className:`h-4 w-4 text-muted-foreground`}),(0,D.jsx)(T,{htmlFor:`skill-scope`,className:`text-xs font-medium text-muted-foreground`,children:`Scope:`}),(0,D.jsxs)(`select`,{id:`skill-scope`,value:t,onChange:e=>n(e.target.value),className:`bg-transparent text-xs font-semibold focus:outline-none cursor-pointer text-foreground`,children:[(0,D.jsx)(`option`,{value:`global`,className:`bg-popover text-popover-foreground`,children:`🌐 Global Skills Catalog`}),We.map(e=>(0,D.jsxs)(`option`,{value:e.id,className:`bg-popover text-popover-foreground`,children:[`📁 `,e.id,` (`,e.branchName,`)`]},e.id))]})]}),J&&(0,D.jsx)(a,{size:`sm`,onClick:ct,disabled:!X||q.isPending||W===null,children:q.isPending?`Saving…`:`Save selection`}),!J&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(a,{variant:`outline`,size:`sm`,onClick:()=>Qe(),className:`flex items-center gap-1.5`,children:[(0,D.jsx)(ve,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`New Category`})]}),(0,D.jsxs)(a,{variant:`default`,size:`sm`,onClick:()=>$(),className:`flex items-center gap-1.5`,children:[(0,D.jsx)(_e,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`New Skill`})]})]})]})]}),(0,D.jsxs)(`div`,{className:`px-6 py-3 border-b border-border/60 bg-muted/20 flex items-center justify-between gap-4`,children:[(0,D.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,D.jsx)(Se,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,D.jsx)(o,{value:r,onChange:e=>l(e.target.value),placeholder:`Search skills by keyword, tag, or tool...`,className:`pl-9 pr-8 h-9 text-xs`}),r&&(0,D.jsx)(`button`,{onClick:()=>l(``),className:`absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,children:(0,D.jsx)(oe,{className:`h-3.5 w-3.5`})})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,D.jsxs)(`span`,{children:[`Showing `,(0,D.jsx)(`strong`,{className:`text-foreground`,children:Z.length}),` of`,` `,(0,D.jsx)(`strong`,{className:`text-foreground`,children:H.length}),` skills`]}),J&&(0,D.jsxs)(s,{variant:`secondary`,className:`text-[10px] uppercase font-mono`,children:[`Workspace Mode (`,Y.size,` active)`]})]})]}),(0,D.jsx)(Oe,{className:`flex-1 p-6`,children:He||Ue||J&&Ge?(0,D.jsxs)(`div`,{className:`flex items-center justify-center p-12 gap-3 text-muted-foreground`,children:[(0,D.jsx)(ge,{}),(0,D.jsx)(`span`,{className:`text-sm`,children:`Loading skills catalog...`})]}):J&&Ke?(0,D.jsx)(S,{className:`py-12 border border-dashed rounded-xl`,children:(0,D.jsxs)(Ee,{children:[(0,D.jsx)(he,{children:`Workspace resources could not be loaded`}),(0,D.jsx)(Ce,{children:`Assignment controls are disabled so an existing selection cannot be overwritten.`})]})}):Z.length===0&&r?(0,D.jsxs)(S,{className:`py-12 border border-dashed rounded-xl`,children:[(0,D.jsx)(ye,{children:(0,D.jsx)(Se,{className:`h-8 w-8 text-muted-foreground/60`})}),(0,D.jsxs)(Ee,{children:[(0,D.jsx)(he,{children:`No matching skills found`}),(0,D.jsxs)(Ce,{children:[`No skills matched your search query "`,r,`".`]})]}),(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>l(``),children:`Clear Search`})]}):(0,D.jsxs)(`div`,{className:`space-y-6 max-w-7xl mx-auto pb-12`,children:[V.map(e=>{let t=O[e.icon||`boxes`]||h,n=Ze[e.id]||[],r=!!ne[e.id],o=z===e.id,c=n.length>0&&n.every(e=>Y.has(e.id));return(0,D.jsxs)(`div`,{onDragOver:t=>ut(t,e.id),onDragLeave:dt,onDrop:t=>ft(t,e.id),className:i(`border rounded-xl transition-all duration-150 overflow-hidden bg-card/60`,o?`border-primary ring-2 ring-primary/20 bg-primary/5`:`border-border`),children:[(0,D.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":!r,onClick:()=>Xe(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),Xe(e.id))},className:`p-4 flex items-center justify-between cursor-pointer hover:bg-muted/40 transition-colors border-b border-border/40 select-none`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`p-2 rounded-lg text-white shadow-sm flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,D.jsx)(t,{className:`h-4 w-4`})}),(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(`h2`,{className:`font-semibold text-sm tracking-tight`,children:e.name}),(0,D.jsxs)(s,{variant:`outline`,className:`text-[10px] px-1.5 py-0`,children:[n.length,` `,n.length===1?`skill`:`skills`]}),e.isTemplate&&!e.custom&&(0,D.jsx)(s,{variant:`secondary`,className:`text-[9px] px-1 py-0 uppercase`,children:`Template`})]}),e.description&&(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description})]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[J&&n.length>0&&(0,D.jsxs)(a,{variant:`ghost`,size:`xs`,onClick:()=>st(e.id,!c),className:`h-7 text-xs mr-2 text-muted-foreground hover:text-foreground`,title:c?`Deselect all in category`:`Select all in category`,children:[c?(0,D.jsx)(ae,{className:`h-3.5 w-3.5 mr-1 text-primary`}):(0,D.jsx)(De,{className:`h-3.5 w-3.5 mr-1`}),(0,D.jsx)(`span`,{children:c?`Deselect All`:`Select All`})]}),!J&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:()=>$(void 0,e.id),title:`Add skill to this category`,children:(0,D.jsx)(ve,{className:`h-3.5 w-3.5`})}),!J&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:()=>Qe(e),title:`Edit category`,children:(0,D.jsx)(Pe,{className:`h-3 w-3`})}),!J&&e.custom&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>et(e,t),title:`Delete category`,className:`text-destructive hover:text-destructive`,children:(0,D.jsx)(p,{className:`h-3 w-3`})}),(0,D.jsx)(`div`,{className:`p-1 text-muted-foreground`,children:r?(0,D.jsx)(te,{className:`h-4 w-4`}):(0,D.jsx)(ee,{className:`h-4 w-4`})})]})]}),!r&&(0,D.jsx)(`div`,{className:`p-4 bg-background/50`,children:n.length===0?(0,D.jsxs)(`div`,{className:`border border-dashed border-border/80 rounded-lg p-6 text-center text-xs text-muted-foreground`,children:[`No skills in this category.`,!J&&(0,D.jsxs)(D.Fragment,{children:[` `,`Drag a custom skill here, or click`,` `,(0,D.jsx)(`button`,{onClick:()=>$(void 0,e.id),className:`text-primary underline font-medium`,children:`+ Add Skill`})]})]}):(0,D.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3.5`,children:n.map(e=>{let t=Y.has(e.id);return(0,D.jsxs)(Ae,{draggable:!J&&!!e.custom,onDragStart:t=>{!J&&e.custom&<(t,e.id)},onClick:()=>$(e),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),$(e))},className:i(`group relative cursor-pointer hover:border-primary/60 transition-all p-3.5 flex flex-col justify-between select-none shadow-sm`,J&&!t&&`opacity-60 bg-muted/20`,Be===e.id&&`opacity-40 border-dashed`),children:[(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-2`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground group-hover:text-foreground cursor-grab active:cursor-grabbing`,title:`Drag to reorder or re-categorize`,"aria-label":`Drag handle`,children:[(0,D.jsx)(Ne,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{className:`font-mono text-xs font-bold text-foreground`,children:e.title||e.name})]}),J?(0,D.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),at(e.id)},disabled:!X||q.isPending,className:i(`h-5 px-2 rounded-md flex items-center gap-1 text-[10px] font-semibold transition-colors`,t?`bg-primary text-primary-foreground`:`bg-muted text-muted-foreground hover:bg-muted/80`),children:[(0,D.jsx)(m,{className:i(`h-3 w-3`,!t&&`opacity-0`)}),(0,D.jsx)(`span`,{children:t?`Enabled`:`Disabled`})]}):(0,D.jsx)(s,{variant:`outline`,className:`text-[10px] font-mono`,children:e.custom?`Custom`:`Template`})]}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2 mb-3 leading-relaxed`,children:e.description||`No description provided.`})]}),(0,D.jsxs)(`div`,{className:`pt-2 border-t border-border/40 flex items-center justify-between gap-2`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap overflow-hidden`,children:[e.tags?.slice(0,2).map(e=>(0,D.jsxs)(`span`,{className:`text-[10px] font-mono bg-muted px-1.5 py-0.5 rounded text-muted-foreground`,children:[`#`,e]},e)),e.allowedTools&&e.allowedTools.length>0&&(0,D.jsxs)(`span`,{className:`text-[10px] text-muted-foreground flex items-center gap-0.5 font-mono`,children:[(0,D.jsx)(Fe,{className:`h-2.5 w-2.5`}),e.allowedTools.length]})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1`,onClick:e=>e.stopPropagation(),children:[!J&&e.custom&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>pt(e,t),title:`Move to another category`,className:`h-6 w-6 text-muted-foreground hover:text-foreground`,children:(0,D.jsx)(je,{className:`h-3 w-3`})}),!J&&e.custom&&(0,D.jsx)(a,{variant:`ghost`,size:`icon-xs`,onClick:t=>rt(e,t),title:`Delete skill`,className:`h-6 w-6 text-destructive hover:text-destructive`,children:(0,D.jsx)(p,{className:`h-3 w-3`})})]})]})]},e.id)})})})]},e.id)}),Q.length>0&&(0,D.jsxs)(`div`,{className:`border border-border/80 rounded-xl overflow-hidden bg-card/60`,children:[(0,D.jsx)(`div`,{className:`p-4 bg-muted/30 border-b border-border/40 flex items-center justify-between`,children:(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(h,{className:`h-4 w-4 text-muted-foreground`}),(0,D.jsx)(`h2`,{className:`font-semibold text-sm`,children:`Uncategorized Skills`}),(0,D.jsx)(s,{variant:`outline`,className:`text-[10px]`,children:Q.length})]})}),(0,D.jsx)(`div`,{className:`p-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3.5`,children:Q.map(e=>(0,D.jsxs)(Ae,{onClick:()=>$(e),role:`button`,tabIndex:0,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),$(e))},className:`p-3.5 cursor-pointer hover:border-primary/60`,children:[(0,D.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,D.jsx)(`div`,{className:`font-mono text-xs font-bold`,children:e.title||e.name}),J&&(0,D.jsx)(a,{size:`xs`,variant:Y.has(e.id)?`default`:`outline`,disabled:!X||q.isPending,onClick:t=>{t.stopPropagation(),at(e.id)},children:Y.has(e.id)?`Enabled`:`Disabled`})]}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2`,children:e.description})]},e.id))})]})]})}),(0,D.jsx)(_,{open:ie,onOpenChange:u,children:(0,D.jsxs)(g,{className:`sm:max-w-lg`,children:[(0,D.jsxs)(v,{children:[(0,D.jsx)(C,{children:d?.id?`Edit Skill Category`:`Create Skill Category`}),(0,D.jsx)(x,{children:`Categories group related procedural skills and agent tools into clean visual boxes.`})]}),(0,D.jsxs)(`div`,{className:`space-y-4 py-2`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`cat-name`,className:`text-xs font-medium`,children:`Category Name`}),(0,D.jsx)(o,{id:`cat-name`,value:d?.name||``,onChange:e=>f(t=>t?{...t,name:e.target.value}:null),placeholder:`e.g. Pull Requests & Review`,className:`mt-1 text-xs`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`cat-desc`,className:`text-xs font-medium`,children:`Description`}),(0,D.jsx)(o,{id:`cat-desc`,value:d?.description||``,onChange:e=>f(t=>t?{...t,description:e.target.value}:null),placeholder:`Brief summary of what skills belong in this box...`,className:`mt-1 text-xs`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{className:`text-xs font-medium`,children:`Icon`}),(0,D.jsx)(`div`,{className:`grid grid-cols-6 gap-2 mt-1.5`,children:Object.keys(O).map(e=>{let t=O[e],n=(d?.icon||`boxes`)===e;return(0,D.jsx)(`button`,{type:`button`,onClick:()=>f(t=>t?{...t,icon:e}:null),className:i(`p-2.5 rounded-lg border flex items-center justify-center transition-colors`,n?`border-primary bg-primary/10 text-primary`:`border-border hover:bg-muted text-muted-foreground`),children:(0,D.jsx)(t,{className:`h-4 w-4`})},e)})})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{className:`text-xs font-medium`,children:`Color Accent`}),(0,D.jsx)(`div`,{className:`flex items-center gap-2 mt-1.5 flex-wrap`,children:Ie.map(e=>{let t=d?.color===e.value;return(0,D.jsx)(`button`,{type:`button`,"aria-label":`Select color ${e.label}`,onClick:()=>f(t=>t?{...t,color:e.value}:null),className:i(`w-7 h-7 rounded-full transition-transform flex items-center justify-center shadow-sm`,t?`scale-110 ring-2 ring-primary ring-offset-2`:`hover:scale-105`),style:{backgroundColor:e.value},children:t&&(0,D.jsx)(m,{className:`h-3.5 w-3.5 text-white`})},e.value)})})]})]}),(0,D.jsxs)(y,{children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>u(!1),children:`Cancel`}),(0,D.jsx)(a,{variant:`default`,size:`sm`,onClick:$e,disabled:!d?.name?.trim(),children:`Save Category`})]})]})}),(0,D.jsx)(_,{open:xe,onOpenChange:b,children:(0,D.jsxs)(g,{className:`sm:max-w-3xl max-h-[90vh] flex flex-col`,children:[(0,D.jsx)(v,{children:(0,D.jsxs)(`div`,{className:`flex items-center justify-between pr-6`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(C,{children:w?.id?`Edit Skill Package`:`Create New Skill`}),(0,D.jsx)(x,{children:`Configure SKILL.md metadata triggers and markdown playbook instructions.`})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1 bg-muted/60 p-1 rounded-lg border border-border text-xs`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>M(`edit`),className:i(`px-2.5 py-1 rounded-md flex items-center gap-1 font-medium transition-colors`,j===`edit`?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[(0,D.jsx)(c,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`Edit`})]}),(0,D.jsxs)(`button`,{type:`button`,onClick:()=>M(`preview`),className:i(`px-2.5 py-1 rounded-md flex items-center gap-1 font-medium transition-colors`,j===`preview`?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[(0,D.jsx)(Me,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:`Preview`})]})]})]})}),(0,D.jsx)(Oe,{className:`flex-1 pr-4 py-2`,children:j===`edit`?(0,D.jsxs)(`div`,{className:`space-y-4`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-title`,className:`text-xs font-medium`,children:`Display Title`}),(0,D.jsx)(o,{id:`skill-title`,value:w?.title||``,onChange:e=>tt(e.target.value),placeholder:`e.g. Pull Request Reviewer`,className:`mt-1 text-xs`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-name`,className:`text-xs font-medium`,children:`Identifier (Slug)`}),(0,D.jsx)(o,{id:`skill-name`,value:w?.name||``,disabled:!!w?.id,onChange:e=>{A(!0),k(t=>t?{...t,name:e.target.value}:null)},placeholder:`e.g. pr-review-toolkit`,className:`mt-1 text-xs font-mono`})]})]}),(0,D.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-cat`,className:`text-xs font-medium`,children:`Category Box`}),(0,D.jsx)(`select`,{id:`skill-cat`,value:w?.category||``,onChange:e=>k(t=>t?{...t,category:e.target.value}:null),className:`mt-1 w-full bg-background border border-border rounded-md px-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-primary`,children:V.map(e=>(0,D.jsx)(`option`,{value:e.id,children:e.name},e.id))})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-tags`,className:`text-xs font-medium`,children:`Tags (comma separated)`}),(0,D.jsx)(o,{id:`skill-tags`,value:w?.tags?.join(`, `)||``,onChange:e=>k(t=>t?{...t,tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}:null),placeholder:`e.g. git, pr, quality`,className:`mt-1 text-xs font-mono`})]})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-desc`,className:`text-xs font-medium`,children:`Trigger Description (for AI Autonomous Discovery)`}),(0,D.jsx)(o,{id:`skill-desc`,value:w?.description||``,onChange:e=>k(t=>t?{...t,description:e.target.value}:null),placeholder:`e.g. Use when reviewing PR diffs or when user asks for a PR audit...`,className:`mt-1 text-xs`})]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(T,{htmlFor:`skill-content`,className:`text-xs font-medium`,children:`Playbook Instructions (Markdown)`}),(0,D.jsx)(we,{id:`skill-content`,value:w?.content||``,onChange:e=>k(t=>t?{...t,content:e.target.value}:null),rows:12,placeholder:`# Playbook Title
|
|
5
|
-
|
|
6
|
-
Detailed instructions for the AI assistant...`,className:`mt-1 font-mono text-xs leading-relaxed`})]})]}):(0,D.jsxs)(`div`,{className:`p-4 border rounded-xl bg-card/40 prose prose-sm dark:prose-invert max-w-none`,children:[(0,D.jsxs)(`div`,{className:`mb-4 pb-3 border-b`,children:[(0,D.jsx)(`h2`,{className:`text-lg font-bold m-0`,children:w?.title||w?.name}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground m-0 mt-1`,children:w?.description})]}),(0,D.jsx)(`pre`,{className:`text-xs whitespace-pre-wrap font-sans bg-transparent p-0 border-0`,children:w?.content||`*(No playbook markdown provided)*`})]})}),(0,D.jsxs)(y,{className:`mt-4 pt-3 border-t`,children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>b(!1),children:`Cancel`}),(0,D.jsx)(a,{variant:`default`,size:`sm`,onClick:w?.custom===!1?ot:nt,disabled:!w?.name?.trim()||!w?.description?.trim()||!w?.content?.trim(),children:w?.custom===!1?`Create editable copy`:`Save Skill`})]})]})}),(0,D.jsx)(_,{open:Re,onOpenChange:N,children:(0,D.jsxs)(g,{className:`sm:max-w-md`,children:[(0,D.jsxs)(v,{children:[(0,D.jsx)(C,{children:`Move Skill to Category`}),(0,D.jsxs)(x,{children:[`Select the destination category box for "`,P?.title||P?.name,`".`]})]}),(0,D.jsx)(`div`,{className:`space-y-2 py-2`,children:V.map(e=>{let t=O[e.icon||`boxes`]||h,n=P?.category===e.id;return(0,D.jsxs)(`button`,{type:`button`,onClick:()=>mt(e.id),className:i(`w-full p-3 rounded-lg border text-left flex items-center justify-between transition-colors`,n?`border-primary bg-primary/10`:`border-border hover:bg-muted/50 text-foreground`),children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`p-1.5 rounded text-white flex items-center justify-center`,style:{backgroundColor:e.color||`#3b82f6`},children:(0,D.jsx)(t,{className:`h-4 w-4`})}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`font-semibold text-xs`,children:e.name}),e.description&&(0,D.jsx)(`div`,{className:`text-[11px] text-muted-foreground line-clamp-1`,children:e.description})]})]}),n&&(0,D.jsx)(s,{variant:`secondary`,className:`text-[10px]`,children:`Current`})]},e.id)})}),(0,D.jsx)(y,{children:(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>N(!1),children:`Cancel`})})]})}),(0,D.jsx)(_,{open:ze,onOpenChange:I,children:(0,D.jsxs)(g,{className:`sm:max-w-md`,children:[(0,D.jsxs)(v,{children:[(0,D.jsxs)(C,{className:`text-destructive`,children:[`Delete `,L?.type===`category`?`Category`:`Skill`]}),(0,D.jsxs)(x,{children:[`Are you sure you want to delete "`,L?.title,`"? This action cannot be undone.`]})]}),(0,D.jsxs)(y,{className:`mt-4`,children:[(0,D.jsx)(a,{variant:`outline`,size:`sm`,onClick:()=>I(!1),children:`Cancel`}),(0,D.jsx)(a,{variant:`destructive`,size:`sm`,onClick:it,children:`Delete Permanently`})]})]})})]})}export{k as SkillsPage};
|