@vendian/cli 0.0.21 → 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 +60 -22
- 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) {
|
|
@@ -38754,6 +38785,7 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38754
38785
|
const serveRoot = selectedAgentsDir || "./agents";
|
|
38755
38786
|
setAgentsDir(serveRoot);
|
|
38756
38787
|
setPendingAgentsDir(serveRoot);
|
|
38788
|
+
setServeScopeChoice(null);
|
|
38757
38789
|
setStartupError("");
|
|
38758
38790
|
setLoadingWorkspaces(true);
|
|
38759
38791
|
try {
|
|
@@ -38804,35 +38836,41 @@ function ServeScreen({ env: env3, platform: platform2, input, onBack, onState, o
|
|
|
38804
38836
|
agentCount: agentCount ?? folders.length,
|
|
38805
38837
|
folders
|
|
38806
38838
|
});
|
|
38839
|
+
setServeScopeIndex(0);
|
|
38807
38840
|
return "scope";
|
|
38808
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
|
+
}
|
|
38809
38855
|
if (!started) {
|
|
38810
38856
|
if (serveScopeChoice) {
|
|
38811
|
-
const scopeItems =
|
|
38812
|
-
{
|
|
38813
|
-
label: `All agents in ${serveScopeChoice.rootPath} (${serveScopeChoice.agentCount} agents)`,
|
|
38814
|
-
value: serveScopeChoice.rootPath
|
|
38815
|
-
},
|
|
38816
|
-
...serveScopeChoice.folders.map((folder) => ({
|
|
38817
|
-
label: `One: ${folder.path}`,
|
|
38818
|
-
value: folder.path
|
|
38819
|
-
})),
|
|
38820
|
-
{ label: "Back", value: "__back__" }
|
|
38821
|
-
];
|
|
38857
|
+
const scopeItems = serveScopeItems(serveScopeChoice);
|
|
38822
38858
|
return h(
|
|
38823
38859
|
Box2,
|
|
38824
38860
|
{ flexDirection: "column" },
|
|
38825
38861
|
h(Text2, { bold: true }, "Serve one or many agents:"),
|
|
38826
|
-
h(
|
|
38827
|
-
|
|
38828
|
-
|
|
38829
|
-
|
|
38830
|
-
|
|
38831
|
-
|
|
38832
|
-
|
|
38833
|
-
|
|
38834
|
-
}
|
|
38835
|
-
|
|
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}`)),
|
|
38866
|
+
loadingWorkspaces && h(
|
|
38867
|
+
Box2,
|
|
38868
|
+
null,
|
|
38869
|
+
h(Text2, { color: colors.brand }, " "),
|
|
38870
|
+
h(Spinner2, { type: "dots" }),
|
|
38871
|
+
h(Text2, { color: colors.brand }, " Loading workspaces")
|
|
38872
|
+
),
|
|
38873
|
+
startupError && h(Text2, { color: colors.error }, ` ${fig.cross} ${startupError}`),
|
|
38836
38874
|
h(Text2, null, ""),
|
|
38837
38875
|
h(FooterBar, { items: [
|
|
38838
38876
|
{ key: "\u2191\u2193", label: "Navigate" },
|