@vendian/cli 0.0.22 → 0.0.23
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/cli-wrapper.mjs +51 -23
- package/package.json +1 -1
package/cli-wrapper.mjs
CHANGED
|
@@ -36804,7 +36804,7 @@ import fs12 from "node:fs";
|
|
|
36804
36804
|
import readlinePromises from "node:readline/promises";
|
|
36805
36805
|
|
|
36806
36806
|
// src/version.js
|
|
36807
|
-
var CLI_VERSION = true ? "0.0.
|
|
36807
|
+
var CLI_VERSION = true ? "0.0.23" : process.env.npm_package_version || "0.0.0-dev";
|
|
36808
36808
|
|
|
36809
36809
|
// src/npm-update.js
|
|
36810
36810
|
var NPM_CHECK_INTERVAL_MS = 30 * 60 * 1e3;
|
|
@@ -38610,6 +38610,22 @@ function CreateScreen({ env: env3, platform: platform2, onBack }) {
|
|
|
38610
38610
|
h(BackHint, { onBack })
|
|
38611
38611
|
);
|
|
38612
38612
|
}
|
|
38613
|
+
function serveScopeItems(choice) {
|
|
38614
|
+
if (!choice) {
|
|
38615
|
+
return [];
|
|
38616
|
+
}
|
|
38617
|
+
return [
|
|
38618
|
+
{
|
|
38619
|
+
label: `All agents in ${choice.rootPath} (${choice.agentCount} agents)`,
|
|
38620
|
+
value: choice.rootPath
|
|
38621
|
+
},
|
|
38622
|
+
...choice.folders.map((folder) => ({
|
|
38623
|
+
label: `One: ${folder.path}`,
|
|
38624
|
+
value: folder.path
|
|
38625
|
+
})),
|
|
38626
|
+
{ label: "Back", value: "__back__" }
|
|
38627
|
+
];
|
|
38628
|
+
}
|
|
38613
38629
|
function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, onExitApp }) {
|
|
38614
38630
|
const [agentDirCandidates] = useState5(() => findAgentDirectoryCandidates());
|
|
38615
38631
|
const [agentsDir, setAgentsDir] = useState5(() => defaultAgentsDir(agentDirCandidates));
|
|
@@ -38617,6 +38633,7 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38617
38633
|
const [workspaceChoices, setWorkspaceChoices] = useState5([]);
|
|
38618
38634
|
const [pendingAgentsDir, setPendingAgentsDir] = useState5("");
|
|
38619
38635
|
const [serveScopeChoice, setServeScopeChoice] = useState5(null);
|
|
38636
|
+
const [serveScopeIndex, setServeScopeIndex] = useState5(0);
|
|
38620
38637
|
const [loadingWorkspaces, setLoadingWorkspaces] = useState5(false);
|
|
38621
38638
|
const [started, setStarted] = useState5(false);
|
|
38622
38639
|
const [state, setState] = useState5(initialServeState());
|
|
@@ -38682,6 +38699,20 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38682
38699
|
handleInterrupt();
|
|
38683
38700
|
return;
|
|
38684
38701
|
}
|
|
38702
|
+
if (!started && serveScopeChoice) {
|
|
38703
|
+
const scopeItems = serveScopeItems(serveScopeChoice);
|
|
38704
|
+
if (key.upArrow) {
|
|
38705
|
+
setServeScopeIndex((index) => (index - 1 + scopeItems.length) % scopeItems.length);
|
|
38706
|
+
} else if (key.downArrow) {
|
|
38707
|
+
setServeScopeIndex((index) => (index + 1) % scopeItems.length);
|
|
38708
|
+
} else if (key.return) {
|
|
38709
|
+
handleServeScopeItem(scopeItems[serveScopeIndex] || scopeItems[0]);
|
|
38710
|
+
} else if (key.escape) {
|
|
38711
|
+
setServeScopeChoice(null);
|
|
38712
|
+
setServeScopeIndex(0);
|
|
38713
|
+
}
|
|
38714
|
+
return;
|
|
38715
|
+
}
|
|
38685
38716
|
if (!started) return;
|
|
38686
38717
|
if (logMode !== null) {
|
|
38687
38718
|
if (key.escape) {
|
|
@@ -38805,36 +38836,33 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38805
38836
|
agentCount: agentCount ?? folders.length,
|
|
38806
38837
|
folders
|
|
38807
38838
|
});
|
|
38839
|
+
setServeScopeIndex(0);
|
|
38808
38840
|
return "scope";
|
|
38809
38841
|
}
|
|
38842
|
+
function handleServeScopeItem(item) {
|
|
38843
|
+
if (!item) {
|
|
38844
|
+
return;
|
|
38845
|
+
}
|
|
38846
|
+
if (item.value === "__back__") {
|
|
38847
|
+
setServeScopeChoice(null);
|
|
38848
|
+
setServeScopeIndex(0);
|
|
38849
|
+
return;
|
|
38850
|
+
}
|
|
38851
|
+
setServeScopeChoice(null);
|
|
38852
|
+
setServeScopeIndex(0);
|
|
38853
|
+
chooseWorkspaceThenStart(item.value);
|
|
38854
|
+
}
|
|
38810
38855
|
if (!started) {
|
|
38811
38856
|
if (serveScopeChoice) {
|
|
38812
|
-
const scopeItems =
|
|
38813
|
-
{
|
|
38814
|
-
label: `All agents in ${serveScopeChoice.rootPath} (${serveScopeChoice.agentCount} agents)`,
|
|
38815
|
-
value: serveScopeChoice.rootPath
|
|
38816
|
-
},
|
|
38817
|
-
...serveScopeChoice.folders.map((folder) => ({
|
|
38818
|
-
label: `One: ${folder.path}`,
|
|
38819
|
-
value: folder.path
|
|
38820
|
-
})),
|
|
38821
|
-
{ label: "Back", value: "__back__" }
|
|
38822
|
-
];
|
|
38857
|
+
const scopeItems = serveScopeItems(serveScopeChoice);
|
|
38823
38858
|
return h(
|
|
38824
38859
|
Box2,
|
|
38825
38860
|
{ flexDirection: "column" },
|
|
38826
38861
|
h(Text2, { bold: true }, "Serve one or many agents:"),
|
|
38827
|
-
h(
|
|
38828
|
-
|
|
38829
|
-
|
|
38830
|
-
|
|
38831
|
-
setServeScopeChoice(null);
|
|
38832
|
-
return;
|
|
38833
|
-
}
|
|
38834
|
-
setServeScopeChoice(null);
|
|
38835
|
-
chooseWorkspaceThenStart(item.value);
|
|
38836
|
-
}
|
|
38837
|
-
}),
|
|
38862
|
+
...scopeItems.map((item, index) => h(Text2, {
|
|
38863
|
+
key: item.value,
|
|
38864
|
+
color: index === serveScopeIndex ? colors.brand : void 0
|
|
38865
|
+
}, `${index === serveScopeIndex ? fig.pointer : " "} ${item.label}`)),
|
|
38838
38866
|
loadingWorkspaces && h(
|
|
38839
38867
|
Box2,
|
|
38840
38868
|
null,
|