@mrpatronz/nexusflow 2.2.0 → 2.3.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/README.md +80 -17
- package/dist/commands/ui.d.ts +1 -0
- package/dist/commands/ui.d.ts.map +1 -1
- package/dist/commands/ui.js +24 -13
- package/dist/commands/ui.js.map +1 -1
- package/dist/commands/ui.test.d.ts +2 -0
- package/dist/commands/ui.test.d.ts.map +1 -0
- package/dist/commands/ui.test.js +58 -0
- package/dist/commands/ui.test.js.map +1 -0
- package/dist/core/workspace-skills-workflow.integration.test.d.ts +2 -0
- package/dist/core/workspace-skills-workflow.integration.test.d.ts.map +1 -0
- package/dist/core/workspace-skills-workflow.integration.test.js +162 -0
- package/dist/core/workspace-skills-workflow.integration.test.js.map +1 -0
- package/dist/core/worktree.test.js +1 -1
- package/dist/core/worktree.test.js.map +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +4 -8
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/skills-generator.d.ts +2 -2
- package/dist/generators/skills-generator.d.ts.map +1 -1
- package/dist/generators/skills-generator.js +84 -89
- package/dist/generators/skills-generator.js.map +1 -1
- package/dist/generators/skills-generator.test.d.ts +2 -0
- package/dist/generators/skills-generator.test.d.ts.map +1 -0
- package/dist/generators/skills-generator.test.js +79 -0
- package/dist/generators/skills-generator.test.js.map +1 -0
- package/dist/gui/assets/AgentsPage-BtrTgIyU.js +3 -0
- package/dist/gui/assets/{DashboardPage-CUspfCap.js → DashboardPage-CeUkMdxc.js} +1 -1
- package/dist/gui/assets/{GettingStartedPage-BqtgARZW.js → GettingStartedPage-YwJXpsc6.js} +1 -1
- package/dist/gui/assets/ProjectsPage-D8kEHb-m.js +1 -0
- package/dist/gui/assets/ScaffoldRepoInline-ij7JLzmx.js +1 -0
- package/dist/gui/assets/SettingsPage-BQhAP4go.js +1 -0
- package/dist/gui/assets/SkillsPage-DJ-dXfcC.js +6 -0
- package/dist/gui/assets/StartWorkPage-DGWZzF4H.js +1 -0
- package/dist/gui/assets/{StrategiesPage-D0Y6A4Tw.js → StrategiesPage-CLOjDRbX.js} +2 -2
- package/dist/gui/assets/WorkspaceLauncher-CjNI4vqn.js +1 -0
- package/dist/gui/assets/WorkspacesPage-MDzm2JUh.js +6 -0
- package/dist/gui/assets/alert-dialog-DjwFcE6b.js +1 -0
- package/dist/gui/assets/bot-wH0FKlic.js +1 -0
- package/dist/gui/assets/chevron-down-DDmhvRLr.js +1 -0
- package/dist/gui/assets/code-xml-Chu1p81J.js +1 -0
- package/dist/gui/assets/index-CfQEnn52.js +52 -0
- package/dist/gui/assets/index-k7inKaui.css +2 -0
- package/dist/gui/assets/{spinner-DXt6mnJk.js → spinner-BCEaGbib.js} +1 -1
- package/dist/gui/assets/terminal-gK6BMl3E.js +1 -0
- package/dist/gui/assets/{textarea-BLU5HXmZ.js → textarea-D3-elOAa.js} +1 -1
- package/dist/gui/assets/{useAriaLabelledBy-CjNlctb9.js → useAriaLabelledBy-DmwmZIqb.js} +1 -1
- package/dist/gui/assets/useCompositeListItem-CZnlZ-eF.js +1 -0
- package/dist/gui/assets/useValueChanged-BfI2s7NX.js +1 -0
- package/dist/gui/assets/zap-FQrDnrgb.js +1 -0
- package/dist/gui/index.html +6 -4
- package/dist/resources/agents-catalog.d.ts +7 -0
- package/dist/resources/agents-catalog.d.ts.map +1 -0
- package/dist/resources/agents-catalog.js +141 -0
- package/dist/resources/agents-catalog.js.map +1 -0
- package/dist/resources/agents-catalog.test.d.ts +2 -0
- package/dist/resources/agents-catalog.test.d.ts.map +1 -0
- package/dist/resources/agents-catalog.test.js +50 -0
- package/dist/resources/agents-catalog.test.js.map +1 -0
- package/dist/resources/codex-agent.d.ts +6 -0
- package/dist/resources/codex-agent.d.ts.map +1 -0
- package/dist/resources/codex-agent.js +55 -0
- package/dist/resources/codex-agent.js.map +1 -0
- package/dist/resources/codex-agent.test.d.ts +2 -0
- package/dist/resources/codex-agent.test.d.ts.map +1 -0
- package/dist/resources/codex-agent.test.js +27 -0
- package/dist/resources/codex-agent.test.js.map +1 -0
- package/dist/resources/contracts.d.ts +116 -0
- package/dist/resources/contracts.d.ts.map +1 -0
- package/dist/resources/contracts.js +103 -0
- package/dist/resources/contracts.js.map +1 -0
- package/dist/resources/fs-safety.d.ts +11 -0
- package/dist/resources/fs-safety.d.ts.map +1 -0
- package/dist/resources/fs-safety.js +77 -0
- package/dist/resources/fs-safety.js.map +1 -0
- package/dist/resources/materializer.d.ts +17 -0
- package/dist/resources/materializer.d.ts.map +1 -0
- package/dist/resources/materializer.js +439 -0
- package/dist/resources/materializer.js.map +1 -0
- package/dist/resources/materializer.test.d.ts +2 -0
- package/dist/resources/materializer.test.d.ts.map +1 -0
- package/dist/resources/materializer.test.js +149 -0
- package/dist/resources/materializer.test.js.map +1 -0
- package/dist/resources/service.d.ts +8 -0
- package/dist/resources/service.d.ts.map +1 -0
- package/dist/resources/service.js +45 -0
- package/dist/resources/service.js.map +1 -0
- package/dist/resources/service.test.d.ts +2 -0
- package/dist/resources/service.test.d.ts.map +1 -0
- package/dist/resources/service.test.js +58 -0
- package/dist/resources/service.test.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +310 -4
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +365 -5
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +107 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/resources.d.ts +2 -1
- package/dist/utils/resources.d.ts.map +1 -1
- package/dist/utils/resources.js +4 -3
- package/dist/utils/resources.js.map +1 -1
- package/dist/utils/session-finder.d.ts +6 -0
- package/dist/utils/session-finder.d.ts.map +1 -1
- package/dist/utils/session-finder.js +56 -0
- package/dist/utils/session-finder.js.map +1 -1
- package/dist/utils/session-finder.test.js +34 -1
- package/dist/utils/session-finder.test.js.map +1 -1
- package/dist/utils/skills-catalog.d.ts +77 -0
- package/dist/utils/skills-catalog.d.ts.map +1 -0
- package/dist/utils/skills-catalog.js +871 -0
- package/dist/utils/skills-catalog.js.map +1 -0
- package/dist/utils/skills-catalog.test.d.ts +2 -0
- package/dist/utils/skills-catalog.test.d.ts.map +1 -0
- package/dist/utils/skills-catalog.test.js +281 -0
- package/dist/utils/skills-catalog.test.js.map +1 -0
- package/dist/utils/workspace-launch.d.ts.map +1 -1
- package/dist/utils/workspace-launch.js +22 -1
- package/dist/utils/workspace-launch.js.map +1 -1
- package/dist/utils/workspace-launch.test.js +36 -2
- package/dist/utils/workspace-launch.test.js.map +1 -1
- package/package.json +4 -1
- package/dist/gui/assets/ProjectsPage-UBoQxI2G.js +0 -1
- package/dist/gui/assets/ScaffoldRepoInline-DqoourJe.js +0 -1
- package/dist/gui/assets/SettingsPage-BZl24tqD.js +0 -1
- package/dist/gui/assets/StartWorkPage-BGNFdBfj.js +0 -1
- package/dist/gui/assets/WorkspaceLauncher-Cxv0O_wt.js +0 -1
- package/dist/gui/assets/WorkspacesPage-Cvb1rOeh.js +0 -6
- package/dist/gui/assets/index-CllPiiFL.js +0 -52
- package/dist/gui/assets/index-DGCBhMAn.css +0 -2
- package/dist/gui/assets/useCompositeListItem-DWGFLKqA.js +0 -1
- /package/dist/{resources → static-resources}/workflows/plan-implement-review.md +0 -0
- /package/dist/{resources → static-resources}/workflows/research-verify.md +0 -0
- /package/dist/{resources → static-resources}/workflows/solo-developer.md +0 -0
package/dist/generators/index.js
CHANGED
|
@@ -244,14 +244,10 @@ export async function generateContextFiles(ctx, assistants, workspacePath) {
|
|
|
244
244
|
const message = error instanceof Error ? error.message : String(error);
|
|
245
245
|
console.error(chalk.red(' ✖'), `Failed to generate implementation plan: ${message}`);
|
|
246
246
|
}
|
|
247
|
-
//
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
catch (error) {
|
|
252
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
253
|
-
console.error(chalk.red(' ✖'), `Failed to generate skills: ${message}`);
|
|
254
|
-
}
|
|
247
|
+
// Resource materialization is transactional and owns assistant-discovered
|
|
248
|
+
// files. Propagate failures so callers never report a partially applied
|
|
249
|
+
// workspace as successful.
|
|
250
|
+
await generateSkills(ctx, assistants, workspacePath);
|
|
255
251
|
}
|
|
256
252
|
// Re-export individual generators for direct use
|
|
257
253
|
export { generateClaudeConfig } from './claude.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAkB,MAAM,oBAAoB,CAAC;AAE7F,8EAA8E;AAC9E,MAAM,UAAU,GAMZ;IACF,MAAM,EAAE,EAAE,QAAQ,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE;IACnE,WAAW,EAAE,EAAE,QAAQ,EAAE,yBAAyB,EAAE,UAAU,EAAE,WAAW,EAAE;IAC7E,KAAK,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,UAAU,EAAE,WAAW,EAAE;IACjE,OAAO,EAAE,EAAE,QAAQ,EAAE,qBAAqB,EAAE,UAAU,EAAE,iCAAiC,EAAE;IAC3F,MAAM,EAAE,EAAE,QAAQ,EAAE,oBAAoB,E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C,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAChB,0CAA0C,OAAO,EAAE,CACpD,CAAC;QACJ,CAAC;IACH,CAAC;IAGD,qFAAqF;IACrF,IAAI,CAAC;QACH,MAAM,0BAA0B,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAChB,2CAA2C,OAAO,EAAE,CACrD,CAAC;IACJ,CAAC;IAED,0EAA0E;IAC1E,wEAAwE;IACxE,2BAA2B;IAC3B,MAAM,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;AACvD,CAAC;AAED,iDAAiD;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generators/skills-generator
|
|
3
|
-
* Generates harness-specific agent skills/rules (e.g. for Claude, Cursor, Copilot, Codex)
|
|
4
|
-
* dynamically based on workspace analysis.
|
|
3
|
+
* Generates harness-specific agent skills/rules (e.g. for Claude, Antigravity, Cursor, Copilot, Codex)
|
|
4
|
+
* dynamically based on workspace analysis and workspace skills configuration.
|
|
5
5
|
*/
|
|
6
6
|
import type { AIAssistant, WorkspaceContext } from '../types.js';
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills-generator.d.ts","sourceRoot":"","sources":["../../src/generators/skills-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"skills-generator.d.ts","sourceRoot":"","sources":["../../src/generators/skills-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAA8B,MAAM,aAAa,CAAC;AAqL7F;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,gBAAgB,EACrB,UAAU,EAAE,WAAW,EAAE,EACzB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CA0Ef"}
|
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generators/skills-generator
|
|
3
|
-
* Generates harness-specific agent skills/rules (e.g. for Claude, Cursor, Copilot, Codex)
|
|
4
|
-
* dynamically based on workspace analysis.
|
|
3
|
+
* Generates harness-specific agent skills/rules (e.g. for Claude, Antigravity, Cursor, Copilot, Codex)
|
|
4
|
+
* dynamically based on workspace analysis and workspace skills configuration.
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import { getAllSkills, getWorkspaceSkillsConfig, } from '../utils/skills-catalog.js';
|
|
7
|
+
import { getAllAgents } from '../resources/agents-catalog.js';
|
|
8
|
+
import { reconcileWorkspaceResources } from '../resources/materializer.js';
|
|
8
9
|
/**
|
|
9
10
|
* Checks if the workspace has cross-repo package dependencies.
|
|
10
11
|
*/
|
|
11
12
|
function hasCrossRepoDependencies(analysis) {
|
|
12
13
|
const produced = new Set();
|
|
13
14
|
for (const [, a] of analysis) {
|
|
14
|
-
if (a.produces) {
|
|
15
|
+
if (a.produces && Array.isArray(a.produces)) {
|
|
15
16
|
for (const p of a.produces) {
|
|
16
|
-
|
|
17
|
+
if (p && p.name) {
|
|
18
|
+
produced.add(p.name.toLowerCase());
|
|
19
|
+
}
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
for (const [, a] of analysis) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
if (Array.isArray(a.dependencies)) {
|
|
25
|
+
for (const dep of a.dependencies) {
|
|
26
|
+
if (dep && dep.name && produced.has(dep.name.toLowerCase())) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else if (a.dependencies && typeof a.dependencies === 'object') {
|
|
32
|
+
for (const depName of Object.keys(a.dependencies)) {
|
|
33
|
+
if (produced.has(depName.toLowerCase())) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
24
36
|
}
|
|
25
37
|
}
|
|
26
38
|
}
|
|
@@ -30,15 +42,15 @@ function hasCrossRepoDependencies(analysis) {
|
|
|
30
42
|
* Checks if any workspace project produces packages that have consumer repos.
|
|
31
43
|
*/
|
|
32
44
|
function hasProducedPackagesWithConsumers(analysis) {
|
|
33
|
-
return hasCrossRepoDependencies(analysis);
|
|
45
|
+
return hasCrossRepoDependencies(analysis);
|
|
34
46
|
}
|
|
35
47
|
/**
|
|
36
48
|
* Generates local package loop skill instructions.
|
|
37
49
|
*/
|
|
38
50
|
function getLocalPackageLoopSkill(analysis) {
|
|
39
51
|
let pkgManagerInfo = '';
|
|
40
|
-
const hasNuget = Array.from(analysis.values()).some(a => a.techStack
|
|
41
|
-
const hasNpm = Array.from(analysis.values()).some(a => a.techStack
|
|
52
|
+
const hasNuget = Array.from(analysis.values()).some((a) => a.techStack?.languages?.includes('csharp'));
|
|
53
|
+
const hasNpm = Array.from(analysis.values()).some((a) => a.techStack?.languages?.includes('typescript') || a.techStack?.languages?.includes('javascript'));
|
|
42
54
|
if (hasNuget) {
|
|
43
55
|
pkgManagerInfo += `### NuGet / C# local loop:
|
|
44
56
|
1. **Pack locally**: Run \`dotnet pack -c Release -o ./local-packages\` inside the producing project folder.
|
|
@@ -64,7 +76,6 @@ This skill guides the AI assistant through local package testing across reposito
|
|
|
64
76
|
When modifying a shared package in one repository, you must test its effect on downstream consumer repositories before pushing.
|
|
65
77
|
|
|
66
78
|
${pkgManagerInfo}
|
|
67
|
-
|
|
68
79
|
## Guidelines
|
|
69
80
|
- **Leave a TODO comment**: Always write a \`// TODO: Revert local package loop reference\` comment in the consumer code so you don't commit temporary local reference modifications.
|
|
70
81
|
- **Do not commit local-packages**: The \`local-packages/\` folder is workspace-local and must not be committed to Git.
|
|
@@ -82,12 +93,12 @@ function getReleaseOrderingSkill(ctx) {
|
|
|
82
93
|
lines.push('');
|
|
83
94
|
lines.push('## Dependency Chains');
|
|
84
95
|
if (analysis) {
|
|
85
|
-
for (const [
|
|
96
|
+
for (const [pathKey, a] of analysis) {
|
|
86
97
|
if (a.produces && a.produces.length > 0) {
|
|
87
98
|
for (const p of a.produces) {
|
|
88
99
|
const consumers = [];
|
|
89
100
|
for (const [otherPath, otherA] of analysis) {
|
|
90
|
-
if (otherPath ===
|
|
101
|
+
if (otherPath === pathKey)
|
|
91
102
|
continue;
|
|
92
103
|
for (const dep of otherA.dependencies) {
|
|
93
104
|
if (dep.name.toLowerCase() === p.name.toLowerCase()) {
|
|
@@ -98,7 +109,7 @@ function getReleaseOrderingSkill(ctx) {
|
|
|
98
109
|
if (consumers.length > 0) {
|
|
99
110
|
lines.push(`- **Product**: \`${p.name}\``);
|
|
100
111
|
lines.push(` - **Producer**: \`${a.name}\` (Must build and release first)`);
|
|
101
|
-
lines.push(` - **Consumers**: ${consumers.map(c => `\`${c}\``).join(', ')} (Must be bumped and released after the producer)`);
|
|
112
|
+
lines.push(` - **Consumers**: ${consumers.map((c) => `\`${c}\``).join(', ')} (Must be bumped and released after the producer)`);
|
|
102
113
|
}
|
|
103
114
|
}
|
|
104
115
|
}
|
|
@@ -140,48 +151,6 @@ function getVerifierSkill(ctx) {
|
|
|
140
151
|
lines.push('3. **Watch out for shared staging environment**: Never publish messages or write data to staging infrastructure while testing locally unless explicitly requested.');
|
|
141
152
|
return lines.join('\n');
|
|
142
153
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Deploys skills files to the specified harness's directory structure.
|
|
145
|
-
*/
|
|
146
|
-
async function deploySkill(workspacePath, assistant, skillName, content) {
|
|
147
|
-
const titleMap = {
|
|
148
|
-
'nexusflow-local-package-loop': 'Local Package Development Loop',
|
|
149
|
-
'nexusflow-release-ordering': 'Release and Merge Ordering',
|
|
150
|
-
'verifier-workspace': 'Local Runtime Verifier',
|
|
151
|
-
};
|
|
152
|
-
const title = titleMap[skillName] || skillName;
|
|
153
|
-
if (assistant === 'claude') {
|
|
154
|
-
const skillDir = path.join(workspacePath, '.claude', 'skills', skillName);
|
|
155
|
-
await fse.ensureDir(skillDir);
|
|
156
|
-
await fse.writeFile(path.join(skillDir, 'SKILL.md'), content, 'utf-8');
|
|
157
|
-
}
|
|
158
|
-
else if (assistant === 'antigravity') {
|
|
159
|
-
const skillDir = path.join(workspacePath, '.agents', 'skills', skillName);
|
|
160
|
-
await fse.ensureDir(skillDir);
|
|
161
|
-
await fse.writeFile(path.join(skillDir, 'SKILL.md'), content, 'utf-8');
|
|
162
|
-
}
|
|
163
|
-
else if (assistant === 'cursor') {
|
|
164
|
-
const ruleDir = path.join(workspacePath, '.cursor', 'rules');
|
|
165
|
-
await fse.ensureDir(ruleDir);
|
|
166
|
-
const mdcContent = `---
|
|
167
|
-
description: "Guidelines and instructions for ${title}"
|
|
168
|
-
alwaysApply: false
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
${content}`;
|
|
172
|
-
await fse.writeFile(path.join(ruleDir, `${skillName}.mdc`), mdcContent, 'utf-8');
|
|
173
|
-
}
|
|
174
|
-
else if (assistant === 'copilot') {
|
|
175
|
-
const copilotDir = path.join(workspacePath, '.github', 'instructions');
|
|
176
|
-
await fse.ensureDir(copilotDir);
|
|
177
|
-
await fse.writeFile(path.join(copilotDir, `${skillName}.instructions.md`), content, 'utf-8');
|
|
178
|
-
}
|
|
179
|
-
else if (assistant === 'codex') {
|
|
180
|
-
const codexDir = path.join(workspacePath, '.codex', 'skills', skillName);
|
|
181
|
-
await fse.ensureDir(codexDir);
|
|
182
|
-
await fse.writeFile(path.join(codexDir, 'SKILL.md'), content, 'utf-8');
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
154
|
/**
|
|
186
155
|
* Generates custom skills/rules for each selected AI assistant.
|
|
187
156
|
*
|
|
@@ -191,40 +160,66 @@ ${content}`;
|
|
|
191
160
|
*/
|
|
192
161
|
export async function generateSkills(ctx, assistants, workspacePath) {
|
|
193
162
|
const { analysis } = ctx;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
if (hasDeps) {
|
|
201
|
-
skillsToDeploy.push({
|
|
202
|
-
name: 'nexusflow-local-package-loop',
|
|
203
|
-
content: getLocalPackageLoopSkill(analysis),
|
|
204
|
-
});
|
|
163
|
+
// 1. Get enabled skills config and catalog
|
|
164
|
+
const wsConfig = await getWorkspaceSkillsConfig(workspacePath);
|
|
165
|
+
const [catalogSkills, catalogAgents] = await Promise.all([getAllSkills(), getAllAgents()]);
|
|
166
|
+
const skillMap = new Map();
|
|
167
|
+
for (const s of catalogSkills) {
|
|
168
|
+
skillMap.set(s.id, s);
|
|
205
169
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
170
|
+
// 2. Add or update dynamic skills based on codebase analysis
|
|
171
|
+
if (analysis) {
|
|
172
|
+
const hasDeps = hasCrossRepoDependencies(analysis);
|
|
173
|
+
const hasProds = hasProducedPackagesWithConsumers(analysis);
|
|
174
|
+
const hasRunConfig = Array.from(analysis.values()).some((a) => a.runConfig && a.runConfig.entryPoints.length > 0);
|
|
175
|
+
if (hasDeps) {
|
|
176
|
+
skillMap.set('nexusflow-local-package-loop', {
|
|
177
|
+
id: 'nexusflow-local-package-loop',
|
|
178
|
+
name: 'nexusflow-local-package-loop',
|
|
179
|
+
title: 'Local Package Development Loop',
|
|
180
|
+
category: 'cross-repo-release',
|
|
181
|
+
description: 'Guides testing cross-repo package dependencies locally without publishing.',
|
|
182
|
+
content: getLocalPackageLoopSkill(analysis),
|
|
183
|
+
custom: false,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (hasProds) {
|
|
187
|
+
skillMap.set('nexusflow-release-ordering', {
|
|
188
|
+
id: 'nexusflow-release-ordering',
|
|
189
|
+
name: 'nexusflow-release-ordering',
|
|
190
|
+
title: 'Release and Merge Ordering Guidelines',
|
|
191
|
+
category: 'cross-repo-release',
|
|
192
|
+
description: 'Answers what repositories must be merged and released in what order.',
|
|
193
|
+
content: getReleaseOrderingSkill(ctx),
|
|
194
|
+
custom: false,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
if (hasRunConfig) {
|
|
198
|
+
skillMap.set('verifier-workspace', {
|
|
199
|
+
id: 'verifier-workspace',
|
|
200
|
+
name: 'verifier-workspace',
|
|
201
|
+
title: 'Local Runtime Verifier',
|
|
202
|
+
category: 'testing-qa',
|
|
203
|
+
description: 'Guidelines to safely launch, mock, and verify services locally.',
|
|
204
|
+
content: getVerifierSkill(ctx),
|
|
205
|
+
custom: false,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
211
208
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
});
|
|
209
|
+
// 3. Determine which skills to deploy
|
|
210
|
+
const enabledSet = new Set(wsConfig.enabledSkills);
|
|
211
|
+
const missingSkills = [...enabledSet].filter((id) => !skillMap.has(id));
|
|
212
|
+
if (missingSkills.length) {
|
|
213
|
+
throw new Error(`Selected skills are no longer available: ${missingSkills.join(', ')}`);
|
|
217
214
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
225
|
-
console.error(` ✖ Failed to deploy skill ${skill.name} for ${assistant}: ${msg}`);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
215
|
+
const skillsToDeploy = [...enabledSet].map((id) => skillMap.get(id));
|
|
216
|
+
const agentMap = new Map(catalogAgents.map((agent) => [agent.id, agent]));
|
|
217
|
+
const enabledAgentIds = new Set(wsConfig.enabledAgents ?? []);
|
|
218
|
+
const missingAgents = [...enabledAgentIds].filter((id) => !agentMap.has(id));
|
|
219
|
+
if (missingAgents.length) {
|
|
220
|
+
throw new Error(`Selected agents are no longer available: ${missingAgents.join(', ')}`);
|
|
228
221
|
}
|
|
222
|
+
const agentsToDeploy = [...enabledAgentIds].map((id) => agentMap.get(id));
|
|
223
|
+
await reconcileWorkspaceResources(workspacePath, assistants, skillsToDeploy, agentsToDeploy);
|
|
229
224
|
}
|
|
230
225
|
//# sourceMappingURL=skills-generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills-generator.js","sourceRoot":"","sources":["../../src/generators/skills-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"skills-generator.js","sourceRoot":"","sources":["../../src/generators/skills-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E;;GAEG;AACH,SAAS,wBAAwB,CAAC,QAAsC;IACtE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IACnC,KAAK,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,QAAQ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AAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1E,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,CAAC,GAAG,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7E,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,4CAA4C,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,cAAc,GAAG,CAAC,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAC;IAE3E,MAAM,2BAA2B,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAC/F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-generator.test.d.ts","sourceRoot":"","sources":["../../src/generators/skills-generator.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import * as fs from 'node:fs/promises';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import * as os from 'node:os';
|
|
5
|
+
import fse from 'fs-extra';
|
|
6
|
+
import { generateSkills } from './skills-generator.js';
|
|
7
|
+
import { saveWorkspaceSkillsConfig } from '../utils/skills-catalog.js';
|
|
8
|
+
describe('skills-generator', () => {
|
|
9
|
+
let tempWorkspace;
|
|
10
|
+
let tempHome;
|
|
11
|
+
const originalEnv = process.env.NEXUSFLOW_HOME;
|
|
12
|
+
beforeEach(async () => {
|
|
13
|
+
tempWorkspace = await fs.mkdtemp(path.join(os.tmpdir(), 'nexusflow-gen-skills-ws-'));
|
|
14
|
+
tempHome = await fs.mkdtemp(path.join(os.tmpdir(), 'nexusflow-gen-skills-home-'));
|
|
15
|
+
process.env.NEXUSFLOW_HOME = tempHome;
|
|
16
|
+
});
|
|
17
|
+
afterEach(async () => {
|
|
18
|
+
if (originalEnv !== undefined) {
|
|
19
|
+
process.env.NEXUSFLOW_HOME = originalEnv;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
delete process.env.NEXUSFLOW_HOME;
|
|
23
|
+
}
|
|
24
|
+
await fse.remove(tempWorkspace);
|
|
25
|
+
await fse.remove(tempHome);
|
|
26
|
+
});
|
|
27
|
+
it('deploys enabled skills across claude, antigravity, cursor, copilot, and codex', async () => {
|
|
28
|
+
// Enable 2 specific skills
|
|
29
|
+
await saveWorkspaceSkillsConfig(tempWorkspace, {
|
|
30
|
+
enabledSkills: ['pr-review-toolkit', 'verifier-workspace'],
|
|
31
|
+
});
|
|
32
|
+
const ctx = {
|
|
33
|
+
feature: {
|
|
34
|
+
id: 'test-feature',
|
|
35
|
+
branchName: 'feature-test',
|
|
36
|
+
description: 'Testing skills generation',
|
|
37
|
+
repos: [],
|
|
38
|
+
assistants: ['claude', 'antigravity', 'cursor', 'copilot', 'codex'],
|
|
39
|
+
workspacePath: tempWorkspace,
|
|
40
|
+
createdAt: new Date().toISOString(),
|
|
41
|
+
},
|
|
42
|
+
repos: [],
|
|
43
|
+
};
|
|
44
|
+
const assistants = ['claude', 'antigravity', 'cursor', 'copilot', 'codex'];
|
|
45
|
+
await generateSkills(ctx, assistants, tempWorkspace);
|
|
46
|
+
// 1. Claude: .claude/skills/<skillName>/SKILL.md
|
|
47
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.claude', 'skills', 'pr-review-toolkit', 'SKILL.md'))).toBe(true);
|
|
48
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.claude', 'skills', 'verifier-workspace', 'SKILL.md'))).toBe(true);
|
|
49
|
+
// 2. Antigravity: .agents/skills/<skillName>/SKILL.md
|
|
50
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.agents', 'skills', 'pr-review-toolkit', 'SKILL.md'))).toBe(true);
|
|
51
|
+
// Cursor, Copilot, Codex, and Antigravity all discover the portable package
|
|
52
|
+
// from the shared Agent Skills location. No lossy rules/instructions copies.
|
|
53
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.cursor', 'rules', 'pr-review-toolkit.mdc'))).toBe(false);
|
|
54
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.github', 'instructions', 'pr-review-toolkit.instructions.md'))).toBe(false);
|
|
55
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.codex', 'skills', 'pr-review-toolkit'))).toBe(false);
|
|
56
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.nexusflow', 'resources.lock.json'))).toBe(true);
|
|
57
|
+
});
|
|
58
|
+
it('respects empty enabledSkills array and deploys nothing when all are disabled', async () => {
|
|
59
|
+
await saveWorkspaceSkillsConfig(tempWorkspace, {
|
|
60
|
+
enabledSkills: [],
|
|
61
|
+
});
|
|
62
|
+
const ctx = {
|
|
63
|
+
feature: {
|
|
64
|
+
id: 'test-feature',
|
|
65
|
+
branchName: 'feature-test',
|
|
66
|
+
description: 'Testing empty skills generation',
|
|
67
|
+
repos: [],
|
|
68
|
+
assistants: ['claude', 'antigravity'],
|
|
69
|
+
workspacePath: tempWorkspace,
|
|
70
|
+
createdAt: new Date().toISOString(),
|
|
71
|
+
},
|
|
72
|
+
repos: [],
|
|
73
|
+
};
|
|
74
|
+
await generateSkills(ctx, ['claude', 'antigravity'], tempWorkspace);
|
|
75
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.claude', 'skills', 'pr-review-toolkit'))).toBe(false);
|
|
76
|
+
expect(await fse.pathExists(path.join(tempWorkspace, '.agents', 'skills', 'pr-review-toolkit'))).toBe(false);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=skills-generator.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-generator.test.js","sourceRoot":"","sources":["../../src/generators/skills-generator.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAM,MAAM,QAAQ,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,aAAqB,CAAC;IAC1B,IAAI,QAAgB,CAAC;IACrB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAE/C,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,aAAa,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,0BAA0B,CAAC,CAAC,CAAC;QACrF,QAAQ,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,4BAA4B,CAAC,CAAC,CAAC;QAClF,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,QAAQ,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,WAAW,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c;gBAC1B,WAAW,EAAE,iCAAiC;gBAC9C,KAAK,EAAE,EAAE;gBACT,UAAU,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC;gBACrC,aAAa,EAAE,aAAa;gBAC5B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC;YACD,KAAK,EAAE,EAAE;SACV,CAAC;QAEF,MAAM,cAAc,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC;QAEpE,MAAM,CAAC,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7G,MAAM,CAAC,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/G,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,h as r,m as i,t as a}from"./button-cPldH5S4.js";import{t as ee,xt as o}from"./spinner-BCEaGbib.js";import{t as s}from"./bot-wH0FKlic.js";import{a as te,c,i as l,n as ne,o as re,r as ie,s as ae,t as oe}from"./alert-dialog-DjwFcE6b.js";import{t as se}from"./search-ChVovkOL.js";import{t as ce}from"./trash-2-Da8F2gKd.js";import{B as le,Ct as u,G as ue,R as de,Tt as fe,Y as pe,d,dt as me,et as he,f,ft as ge,g as p,h as m,kt as _e,mt as ve,p as h,u as g}from"./index-CfQEnn52.js";import{t as _}from"./badge-BnkhqVEF.js";import{t as ye}from"./card-82INhRRE.js";import{a as v,i as be,n as y,r as b,t as x}from"./empty-DWyDwDYB.js";import{t as S}from"./label-JFgMNsTn.js";import{t as C}from"./textarea-D3-elOAa.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}=de(),{data:U=[]}=ge(),W=me(t===`global`?``:t),G=he(),K=pe(),q=ue(),J=le(),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)(s,{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)(ve,{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)(fe,{className:`h-4 w-4 text-muted-foreground`}),(0,T.jsx)(S,{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)(u,{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)(se,{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)(ee,{})}):we||Y&&W.isError?(0,T.jsx)(x,{className:`border border-dashed py-12`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`Resources could not be loaded`}),(0,T.jsx)(y,{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)(v,{children:`Codex is not enabled for this workspace`}),(0,T.jsx)(y,{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)(be,{children:(0,T.jsx)(s,{className:`h-8 w-8 text-muted-foreground`})}),(0,T.jsxs)(b,{children:[(0,T.jsx)(v,{children:`No Codex agents found`}),(0,T.jsx)(y,{children:`Create an agent or import a native TOML definition.`})]}),!Y&&(0,T.jsxs)(a,{size:`sm`,onClick:$,children:[(0,T.jsx)(u,{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)(ye,{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)(_,{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)(_e,{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)(c,{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)(ce,{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)(_,{variant:`secondary`,children:e.sandboxMode}),e.modelReasoningEffort&&(0,T.jsx)(_,{variant:`secondary`,children:e.modelReasoningEffort}),e.model&&(0,T.jsx)(_,{variant:`secondary`,children:e.model})]})]},e.id)})})}),(0,T.jsx)(g,{open:Se,onOpenChange:k,children:(0,T.jsxs)(m,{className:`max-w-2xl`,children:[(0,T.jsxs)(h,{children:[(0,T.jsx)(p,{children:M?`Edit Codex agent`:`Create Codex agent`}),(0,T.jsx)(d,{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)(S,{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)(S,{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)(S,{htmlFor:`agent-instructions`,children:`Developer instructions`}),(0,T.jsx)(C,{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)(S,{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)(S,{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)(S,{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)(f,{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)(g,{open:A,onOpenChange:j,children:(0,T.jsxs)(m,{className:`max-w-2xl`,children:[(0,T.jsxs)(h,{children:[(0,T.jsx)(p,{children:`Import Codex agent TOML`}),(0,T.jsx)(d,{children:`The import accepts the required native fields and supported model, reasoning, and sandbox overrides.`})]}),(0,T.jsx)(C,{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)(f,{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)(re,{children:[(0,T.jsxs)(te,{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)(l,{children:[(0,T.jsx)(ne,{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 +1 @@
|
|
|
1
|
-
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./git-branch-Dw55pQWa.js";import{
|
|
1
|
+
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./git-branch-Dw55pQWa.js";import{Ct as r,Mt as i,St as a,Tt as o,c as s,l as c,wt as l,yt as u}from"./index-CfQEnn52.js";import{n as d,t as f}from"./card-82INhRRE.js";import{a as p,i as m,n as h,r as g,t as _}from"./empty-DWyDwDYB.js";import{t as v}from"./skeleton-CCPbfn1L.js";var y=e();function b({icon:e,label:t,value:n,tone:r}){return(0,y.jsxs)(d,{className:`gap-3.5 p-4`,children:[(0,y.jsx)(`div`,{className:`grid h-9 w-9 shrink-0 place-items-center rounded-md ${r}`,children:e}),(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsx)(`div`,{className:`text-xl font-bold leading-none text-foreground`,children:n}),(0,y.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:t})]})]})}function x({workspaces:e,workspaceStatuses:x,workspacesLoading:S,statusesLoading:C,onOpenWorkspace:w,onNewWorkspace:T}){let E=Object.values(x),D=E.filter(e=>e.changedFiles>0).length,O=E.reduce((e,t)=>e+t.runningServices,0),k=E.filter(e=>e.pendingValidation).length;return(0,y.jsxs)(`div`,{className:`mx-auto max-w-6xl animate-fade-in`,children:[(0,y.jsxs)(`header`,{className:`mb-6`,children:[(0,y.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:`Overview`}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Your multi-repo environment at a glance.`})]}),(0,y.jsxs)(`div`,{className:`mb-8 grid grid-cols-2 gap-3 lg:grid-cols-4`,children:[(0,y.jsx)(b,{icon:(0,y.jsx)(o,{size:18,className:`text-primary`}),tone:`bg-primary/10`,label:`Workspaces`,value:e.length}),(0,y.jsx)(b,{icon:(0,y.jsx)(n,{size:18,className:`text-warning`}),tone:`bg-warning/10`,label:`With uncommitted changes`,value:D}),(0,y.jsx)(b,{icon:(0,y.jsx)(l,{size:18,className:`text-running`}),tone:`bg-running/10`,label:`Running services`,value:O}),(0,y.jsx)(b,{icon:(0,y.jsx)(u,{size:18,className:`text-warning`}),tone:`bg-warning/10`,label:`Need validation`,value:k})]}),(0,y.jsx)(`div`,{className:`mb-3 flex items-center justify-between`,children:(0,y.jsx)(`h2`,{className:`text-sm font-semibold uppercase tracking-wider text-muted-foreground`,children:`Workspaces`})}),S?(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(v,{className:`h-20`}),(0,y.jsx)(v,{className:`h-20`}),(0,y.jsx)(v,{className:`h-20`})]}):e.length===0?(0,y.jsx)(f,{className:`border-dashed`,children:(0,y.jsxs)(_,{children:[(0,y.jsxs)(g,{children:[(0,y.jsx)(m,{variant:`icon`,children:(0,y.jsx)(o,{})}),(0,y.jsx)(p,{children:`No workspaces yet`}),(0,y.jsx)(h,{children:`Create a feature workspace to group repositories and give your AI assistants shared context.`})]}),(0,y.jsxs)(t,{onClick:T,children:[(0,y.jsx)(r,{size:16}),` New workspace`]})]})}):(0,y.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>{let t=x[e.branchName],n=t?s(t.syncStatus):null;return(0,y.jsxs)(d,{className:`group cursor-pointer gap-4 p-4 transition-colors hover:border-foreground/15 hover:bg-accent/50`,onClick:()=>w(e.branchName),children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate font-mono text-sm font-semibold text-foreground`,children:e.branchName}),(0,y.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:[e.repos.length,` repos`]})]}),e.description&&(0,y.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.description})]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[!t&&C?(0,y.jsx)(v,{className:`h-5 w-40`}):t?(0,y.jsxs)(y.Fragment,{children:[t.changedFiles>0?(0,y.jsxs)(c,{tone:`warning`,dot:!0,children:[t.changedFiles,` changed`]}):(0,y.jsx)(c,{tone:`idle`,dot:!0,children:`Clean`}),t.runningServices>0&&(0,y.jsxs)(c,{tone:`running`,dot:!0,children:[t.runningServices,` running`]}),n&&(0,y.jsxs)(c,{tone:n.tone,children:[(0,y.jsx)(a,{size:11}),` `,n.label]})]}):null,(0,y.jsx)(i,{size:16,className:`text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:text-foreground`})]})]},e.id)})})]})}export{x as DashboardPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./circle-plus-C0PNc7h4.js";import{
|
|
1
|
+
import{g as e,t}from"./button-cPldH5S4.js";import{t as n}from"./circle-plus-C0PNc7h4.js";import{xt as r}from"./index-CfQEnn52.js";var i=e();function a({config:e,onCreateWorkspace:a,onModifySettings:o}){return(0,i.jsxs)(`div`,{className:`max-w-4xl mx-auto animate-fade-in`,children:[(0,i.jsxs)(`header`,{className:`mb-10`,children:[(0,i.jsx)(`div`,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/10 text-primary border border-primary/20 text-xs font-semibold uppercase tracking-wider mb-4`,children:`Getting Started Guide`}),(0,i.jsx)(`h1`,{className:`text-3xl font-bold tracking-tight text-foreground mb-2`,children:`Welcome to NexusFlow`}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`NexusFlow orchestrates multi-repository developer environments. It combines isolated Git worktrees, automatic code analyzer sweeps, and background process running into a single dashboard.`})]}),(0,i.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-8 mb-10`,children:[(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm space-y-6`,children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`NexusFlow Workflows`}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`1`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Configure Folders`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Specify your Development folder (where repositories live) and Workspaces folder. These are currently set to:`,(0,i.jsx)(`code`,{className:`block mt-1 text-[10px] text-primary break-all`,children:e.devDir||`Not Configured`})]})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`2`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Build Workspaces`}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:`Choose repositories and feature branch. NexusFlow checks out dependencies under a unified workspace directory using Git Worktrees, keeping original projects clean.`})]})]}),(0,i.jsxs)(`div`,{className:`flex gap-4`,children:[(0,i.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 border border-primary/20 text-primary font-bold text-sm`,children:`3`}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Align AI Context`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`NexusFlow writes files like `,(0,i.jsx)(`code`,{children:`CLAUDE.md`}),`, `,(0,i.jsx)(`code`,{children:`.cursorrules`}),`, `,(0,i.jsx)(`code`,{children:`AGENTS.md`}),` prompting the LLM to inspect project relations and list key assumptions and questions before coding.`]})]})]})]}),(0,i.jsxs)(`div`,{className:`bg-card border border-border rounded-xl p-6 shadow-sm flex flex-col justify-between`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h2`,{className:`text-lg font-semibold text-foreground mb-4`,children:`Current Configuration`}),(0,i.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Dev Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.devDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Workspaces Folder:`}),(0,i.jsx)(`span`,{className:`text-foreground font-mono text-[10px] truncate max-w-[200px]`,children:e.workspacesDir})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5 border-b border-border`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Preferred AI:`}),(0,i.jsx)(`span`,{className:`text-primary font-semibold uppercase`,children:e.defaultAssistant||`None`})]}),(0,i.jsxs)(`div`,{className:`flex justify-between py-1.5`,children:[(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Scan Depth:`}),(0,i.jsxs)(`span`,{className:`text-foreground font-semibold`,children:[e.scanDepth,` levels`]})]})]})]}),(0,i.jsxs)(`div`,{className:`pt-6 border-t border-border flex flex-col gap-2`,children:[(0,i.jsxs)(t,{className:`w-full gap-2`,onClick:a,children:[(0,i.jsx)(n,{size:14}),` Create a Workspace`]}),(0,i.jsxs)(t,{variant:`outline`,className:`w-full gap-2`,onClick:o,children:[(0,i.jsx)(r,{size:14,className:`text-muted-foreground`}),` Modify Settings`]})]})]})]})]})}export{a as GettingStartedPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,g as n,t as r}from"./button-cPldH5S4.js";import{t as i,xt as a}from"./spinner-BCEaGbib.js";import{n as o,t as s}from"./ScaffoldRepoInline-ij7JLzmx.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-DjwFcE6b.js";import{t as g}from"./trash-2-Da8F2gKd.js";import{$ as _,Ct as v,H as y,K as b,Tt as x,Z as S,d as ee,f as C,ft as w,g as T,gt as E,h as D,m as O,ot as k,p as A,u as j,wt as M}from"./index-CfQEnn52.js";import{t as N}from"./badge-BnkhqVEF.js";import{a as P,i as F,n as I,r as L,t as te}from"./empty-DWyDwDYB.js";var R=t(e(),1),z=n(),B={editingId:null,name:``,description:``,repoPaths:[]};function V(){let e=E(),t=S(),n=_(),V=w(),H=y(),U=k(),W=b(),[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 items-center justify-between gap-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h1`,{className:`text-xl font-semibold`,children:`Projects`}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Named groups of repositories you start work from. Registered once, reused for every feature.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(v,{}),` New project`]})]}),t.isLoading?(0,z.jsx)(`div`,{className:`flex justify-center py-20`,children:(0,z.jsx)(i,{className:`size-6`})}):(t.data??[]).length===0?(0,z.jsxs)(te,{className:`border border-border border-dashed`,children:[(0,z.jsxs)(L,{children:[(0,z.jsx)(F,{variant:`icon`,children:(0,z.jsx)(x,{})}),(0,z.jsx)(P,{children:`No projects yet`}),(0,z.jsx)(I,{children:`Register your first project to start work without re-picking repositories every time.`})]}),(0,z.jsxs)(r,{onClick:Q,children:[(0,z.jsx)(v,{}),` 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 bg-card p-4 transition-colors hover:border-foreground/15`,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)(N,{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)(M,{}),` 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)(j,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,z.jsxs)(D,{className:`max-w-lg`,children:[(0,z.jsxs)(A,{children:[(0,z.jsx)(T,{children:G?.editingId?`Edit project`:`New project`}),(0,z.jsx)(ee,{children:`A project is a reusable group of source repositories. Removing one later never touches disk.`})]}),(0,z.jsxs)(O,{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)(a,{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)(a,{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)(C,{children:[(0,z.jsx)(r,{variant:`outline`,onClick:()=>K(null),children:`Cancel`}),(0,z.jsxs)(r,{onClick:ie,disabled:!oe||$,children:[$?(0,z.jsx)(i,{}):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)(i,{}):null,`Remove project`]})]})]})})]})}export{V as ProjectsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,b as t,d as n,g as r,h as i,i as a,l as o,m as s,o as c,p as l,s as u,t as d,u as ee}from"./button-cPldH5S4.js";import{$n as f,Bn as p,Ct as te,Ht as ne,Pt as m,Qn as re,S as ie,Ut as h,Vt as ae,Wt as g,Xn as oe,Yn as se,bt as ce,er as _,nr as v,qt as y,t as b,xt as x,yt as le}from"./spinner-BCEaGbib.js";import{t as S}from"./search-ChVovkOL.js";import{t as ue}from"./useAriaLabelledBy-DmwmZIqb.js";import{t as de}from"./useValueChanged-BfI2s7NX.js";import{U as C}from"./index-CfQEnn52.js";var fe=i(`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 pe(){return w.useContext(T)}var E=w.createContext(void 0);function me(e=!0){let t=w.useContext(E);if(t===void 0&&!e)throw Error(n(3));return t}function he(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}var D=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function ge(e){return w.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[D.checked]:``}:{[D.unchecked]:``}},..._}),[e.indeterminate])}var _e=w.createContext(void 0);function O(){let e=w.useContext(_e);if(e===void 0)throw Error(n(14));return e}var k=r(),ve=`data-parent`,ye=w.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":s,disabled:d=!1,form:h,id:g,indeterminate:_=!1,inputRef:y,name:b,onCheckedChange:x,parent:S=!1,readOnly:C=!1,render:fe,required:T=!1,uncheckedValue:E,value:D,nativeButton:O=!1,style:ye,...A}=e,{clearErrors:j}=re(),{disabled:M,name:N,setDirty:be,setFilled:P,setFocused:xe,setTouched:Se,state:Ce,validationMode:we,validityData:Te,validation:Ee}=f(),De=pe(),{labelId:Oe,controlId:ke,registerControlId:F,getDescriptionProps:Ae}=se(),I=me(),L=I?.parent,R=L&&I.allValues,z=M||De.disabled||I?.disabled||d,B=N??b,V=D??B,je=oe(),Me=oe(),H=ke;R?H=S?Me:`${L.id}-${V}`:g&&(H=g);let U={};R&&(S?U=I.parent.getParentProps():V&&(U=I.parent.getChildProps(V)));let{checked:Ne=n,indeterminate:Pe=_,onCheckedChange:Fe,...Ie}=U,W=I?.value,Le=I?.setValue,Re=I?.defaultValue,G=w.useRef(null),K=ee(()=>Symbol(`checkbox-control`)),q=w.useRef(!1),{getButtonProps:ze,buttonRef:Be}=ie({disabled:z,native:O}),J=I?.validation??Ee,[Y,Ve]=ne({controlled:V&&W&&!S?W.includes(V):Ne,default:V&&Re&&!S?Re.includes(V):i,name:`Checkbox`,state:`checked`}),X=R?!!Ne:Y,Z=R&&Pe||_;v(()=>{F!==u&&(q.current=!0,F(K.current,H))},[H,F,K]),w.useEffect(()=>{let e=K.current;return()=>{!q.current||F===u||(q.current=!1,F(e,void 0))}},[F,K]),ae(G,je,Y,void 0,!I&&!z,b);let Q=w.useRef(null),He=o(y,Q,J.inputRef,J.registerInput),Ue=ue(s,Oe,Q,!O,H??void 0);v(()=>{Q.current&&(Q.current.indeterminate=Z,Y&&P(!0))},[Y,Z,P]),de(Y,()=>{I||(j(B),P(Y),be(Y!==Te.initialValue),J.change(Y))});let We=l({checked:Y,disabled:z,form:h,name:S?void 0:B,id:O?void 0:H??void 0,required:T,ref:He,style:B?ce:le,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(C){e.preventDefault();return}let t=e.currentTarget.checked,n=te(m,e.nativeEvent);if(x?.(t,n),!n.isCanceled&&(Fe?.(t,n),!n.isCanceled&&(Ve(t),V&&W&&Le&&!S&&!R))){let e=t?[...W,V]:W.filter(e=>e!==V);Le(e,n)}},onFocus(){G.current?.focus()}},D===void 0?c:{value:(I?Y&&D:D)||``},Ae,e=>J.getValidationProps(z,e));w.useEffect(()=>{if(!L||!V)return;let e=L.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[L,z,V]);let $=w.useMemo(()=>({...Ce,checked:X,disabled:z,readOnly:C,required:T,indeterminate:Z}),[Ce,X,z,C,T,Z]),Ge=ge($),Ke=a(`span`,e,{state:$,ref:[Be,G,t,I?.registerControlRef],props:[{id:O?H??void 0:je,role:`checkbox`,"aria-checked":Z?`mixed`:X,"aria-readonly":C||void 0,"aria-required":T||void 0,"aria-labelledby":Ue,[ve]:S?``:void 0,onFocus(){z||xe(!0)},onBlur(){let e=Q.current;e&&(Se(!0),xe(!1),we===`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),p(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||he(t)?.click()})},onClick(e){if(C||z)return;e.preventDefault();let t=Q.current;t&&t.dispatchEvent(new(p(t)).PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},A,Ie,ze,Ae,e=>J.getValidationProps(z,e)],stateAttributesMapping:Ge});return(0,k.jsxs)(_e.Provider,{value:$,children:[Ke,!Y&&!I&&B&&!S&&E!==void 0&&(0,k.jsx)(`input`,{type:`hidden`,form:h,name:B,value:E,disabled:z}),(0,k.jsx)(`input`,{...We,suppressHydrationWarning:!0})]})}),A=w.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:o=!1,...s}=e,c=O(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:ee}=h(l),f=w.useRef(null),p={...c,transitionStatus:d};g({open:l,ref:f,onComplete(){l||ee(!1)}});let te={...ge(c),...y,..._},ne=o||u,m=a(`span`,e,{ref:[t,f],state:p,stateAttributesMapping:te,props:s});return ne?m:null});function j({className:e,...t}){return(0,k.jsx)(ye,{className:s(`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,k.jsx)(A,{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,k.jsx)(`span`,{...e,children:t.indeterminate?(0,k.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,k.jsx)(`path`,{d:`M5.252 12h13.496`})}):(0,k.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,k.jsx)(`path`,{d:`M5.252 12.7 10.2 18.63 18.748 5.37`})})})})})}function M({repos:e,selectedPaths:t,onToggle:n,loading:r,emptyHint:i,className:a}){let[o,c]=(0,w.useState)(``),l=(0,w.useMemo)(()=>{let t=o.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)):e},[e,o]);return(0,k.jsxs)(`div`,{className:s(`flex flex-col gap-2`,a),children:[(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(S,{className:`absolute top-1/2 left-2.5 size-4 -translate-y-1/2 text-muted-foreground`}),(0,k.jsx)(x,{value:o,onChange:e=>c(e.target.value),placeholder:`Filter repositories…`,className:`pl-8`,"aria-label":`Filter repositories`})]}),(0,k.jsx)(`div`,{className:`max-h-56 overflow-y-auto rounded-lg border border-border`,children:r?(0,k.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`Scanning for repositories…`}):l.length===0?(0,k.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:i??`No repositories found.`}):(0,k.jsx)(`ul`,{className:`divide-y divide-border`,children:l.map(e=>(0,k.jsx)(`li`,{children:(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-3 py-2 hover:bg-accent`,children:[(0,k.jsx)(j,{checked:t.includes(e.path),onCheckedChange:()=>n(e),"aria-label":e.name}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,k.jsx)(`span`,{className:`block truncate font-mono text-xs text-muted-foreground`,children:e.path})]}),(0,k.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:e.defaultBranch})]})},e.path))})})]})}function N({onCreated:e}){let[t,n]=(0,w.useState)(!1),[r,i]=(0,w.useState)(``),[a,o]=(0,w.useState)(null),s=C(),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,k.jsxs)(`div`,{className:`mt-1.5 flex flex-col gap-1.5`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(x,{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,k.jsxs)(d,{size:`xs`,onClick:c,disabled:!r.trim()||s.isPending,children:[s.isPending?(0,k.jsx)(b,{}):null,`Create`]}),(0,k.jsx)(d,{size:`xs`,variant:`ghost`,onClick:()=>{n(!1),o(null)},children:`Cancel`})]}),a&&(0,k.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:a})]}):(0,k.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,k.jsx)(fe,{className:`size-3.5`}),` Scaffold a brand-new repository`]})}export{M as n,j as r,N as t};
|