@cloudagentfleet/ui 0.1.4 → 0.1.8
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/CHANGELOG.md +14 -0
- package/dist/public/app.js +59 -13
- package/dist/public/fleet-host-switcher.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @cloudagentfleet/ui
|
|
2
2
|
|
|
3
|
+
## 0.1.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`895eaa1`](https://github.com/hirenf14/cloudagentfleet/commit/895eaa1cb81a75bc617020cc984c3b4f10ed66bb) Thanks [@hirenf14](https://github.com/hirenf14)! - Republish packages after ui@0.1.7 registry tarball was missing.
|
|
8
|
+
|
|
9
|
+
## 0.1.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`e8300b3`](https://github.com/hirenf14/cloudagentfleet/commit/e8300b3321289b1544c1cd8026c01fb363ab666e) Thanks [@hirenf14](https://github.com/hirenf14)! - Keep Shell (raw CLI) in the agent list and clarify provider CLI labels in Start session.
|
|
14
|
+
|
|
15
|
+
- [`e8300b3`](https://github.com/hirenf14/cloudagentfleet/commit/e8300b3321289b1544c1cd8026c01fb363ab666e) Thanks [@hirenf14](https://github.com/hirenf14)! - Use cloudagentfleet consistently in CLI help and Hub branding (hosted-agents remains a compatibility alias).
|
|
16
|
+
|
|
3
17
|
## 0.1.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/public/app.js
CHANGED
|
@@ -753,29 +753,40 @@
|
|
|
753
753
|
const readyWorkspaces = (instance?.workspaces || []).filter((workspace) => workspace.health === "ready");
|
|
754
754
|
const allAgents = instance?.agents || [];
|
|
755
755
|
const readyAgents = allAgents.filter((agent) => agent.ready);
|
|
756
|
-
const [workspaceSource, setWorkspaceSource] = useState(
|
|
756
|
+
const [workspaceSource, setWorkspaceSource] = useState(
|
|
757
|
+
readyWorkspaces.length ? "workspace" : (instance?.workspacePolicy ? "path" : "workspace"),
|
|
758
|
+
);
|
|
757
759
|
const [workspaceId, setWorkspaceId] = useState(readyWorkspaces[0]?.id || "");
|
|
758
760
|
const [workspacePath, setWorkspacePath] = useState("");
|
|
759
761
|
const [pathSuggestions, setPathSuggestions] = useState([]);
|
|
760
762
|
const [activeSuggestion, setActiveSuggestion] = useState(-1);
|
|
761
763
|
const [suggesting, setSuggesting] = useState(false);
|
|
762
764
|
const [suggestionError, setSuggestionError] = useState("");
|
|
763
|
-
const [agentId, setAgentId] = useState(readyAgents
|
|
765
|
+
const [agentId, setAgentId] = useState(preferredAgentId(readyAgents, allAgents));
|
|
764
766
|
const [title, setTitle] = useState("");
|
|
765
767
|
const [creating, setCreating] = useState(false);
|
|
766
768
|
|
|
767
769
|
useEffect(() => {
|
|
768
770
|
const nextWorkspaces = (instance?.workspaces || []).filter((workspace) => workspace.health === "ready");
|
|
769
|
-
const nextAgents =
|
|
770
|
-
|
|
771
|
+
const nextAgents = instance?.agents || [];
|
|
772
|
+
const nextReady = nextAgents.filter((agent) => agent.ready);
|
|
773
|
+
setWorkspaceSource(nextWorkspaces.length ? "workspace" : (instance?.workspacePolicy ? "path" : "workspace"));
|
|
771
774
|
setWorkspaceId(nextWorkspaces[0]?.id || "");
|
|
772
775
|
setWorkspacePath("");
|
|
773
776
|
setPathSuggestions([]);
|
|
774
777
|
setActiveSuggestion(-1);
|
|
775
778
|
setSuggestionError("");
|
|
776
|
-
setAgentId(nextAgents
|
|
779
|
+
setAgentId(preferredAgentId(nextReady, nextAgents));
|
|
777
780
|
}, [instanceId]);
|
|
778
781
|
|
|
782
|
+
useEffect(() => {
|
|
783
|
+
const nextAgents = instance?.agents || [];
|
|
784
|
+
const nextReady = nextAgents.filter((agent) => agent.ready);
|
|
785
|
+
if (!nextAgents.some((agent) => agent.id === agentId)) {
|
|
786
|
+
setAgentId(preferredAgentId(nextReady, nextAgents));
|
|
787
|
+
}
|
|
788
|
+
}, [instance?.agents, agentId]);
|
|
789
|
+
|
|
779
790
|
useEffect(() => {
|
|
780
791
|
if (workspaceSource !== "path" || !instance?.workspacePolicy) {
|
|
781
792
|
setPathSuggestions([]);
|
|
@@ -834,7 +845,14 @@
|
|
|
834
845
|
async function createSession(event) {
|
|
835
846
|
event.preventDefault();
|
|
836
847
|
const path = workspacePath.trim();
|
|
837
|
-
|
|
848
|
+
const selectedAgent = allAgents.find((agent) => agent.id === agentId);
|
|
849
|
+
if (
|
|
850
|
+
!instance
|
|
851
|
+
|| (!workspaceId && workspaceSource === "workspace")
|
|
852
|
+
|| (!path && workspaceSource === "path")
|
|
853
|
+
|| !selectedAgent
|
|
854
|
+
|| !selectedAgent.ready
|
|
855
|
+
) return;
|
|
838
856
|
setCreating(true);
|
|
839
857
|
try {
|
|
840
858
|
const result = await api(`/api/instances/${encodeURIComponent(instance.id)}/sessions`, {
|
|
@@ -886,7 +904,7 @@
|
|
|
886
904
|
h(
|
|
887
905
|
"select",
|
|
888
906
|
{ value: workspaceSource, onChange: (event) => setWorkspaceSource(event.target.value), required: true },
|
|
889
|
-
h("option", { value: "workspace" }, "Known workspace"),
|
|
907
|
+
h("option", { value: "workspace", disabled: readyWorkspaces.length === 0 }, "Known workspace"),
|
|
890
908
|
h("option", { value: "path", disabled: !instance?.workspacePolicy }, "Enter a path (policy required)"),
|
|
891
909
|
),
|
|
892
910
|
),
|
|
@@ -956,18 +974,30 @@
|
|
|
956
974
|
h("span", null, "Agent"),
|
|
957
975
|
h(
|
|
958
976
|
"select",
|
|
959
|
-
{
|
|
960
|
-
|
|
977
|
+
{
|
|
978
|
+
value: agentId,
|
|
979
|
+
onChange: (event) => setAgentId(event.target.value),
|
|
980
|
+
required: true,
|
|
981
|
+
disabled: allAgents.length === 0,
|
|
982
|
+
},
|
|
983
|
+
allAgents.length
|
|
961
984
|
? allAgents.map((agent) => h(
|
|
962
985
|
"option",
|
|
963
986
|
{ value: agent.id, key: agent.id, disabled: !agent.ready },
|
|
964
|
-
agent
|
|
987
|
+
formatAgentOption(agent),
|
|
965
988
|
))
|
|
966
|
-
: h("option", { value: "" }, "No
|
|
989
|
+
: h("option", { value: "" }, "No agents advertised yet"),
|
|
990
|
+
),
|
|
991
|
+
allAgents.length > 0 && h(
|
|
992
|
+
"small",
|
|
993
|
+
null,
|
|
994
|
+
"Shell (raw CLI) is a bare Codeman terminal. CLI options launch a provider inside that shell.",
|
|
967
995
|
),
|
|
968
996
|
),
|
|
969
997
|
!readyAgents.length && allAgents.length > 0
|
|
970
|
-
&& h("small", null, "
|
|
998
|
+
&& h("small", null, "No ready agents yet — check Worker Codeman mode, or install/authenticate a provider CLI."),
|
|
999
|
+
!allAgents.length
|
|
1000
|
+
&& h("small", null, "Run Check health on the instance after the Worker is online."),
|
|
971
1001
|
h(
|
|
972
1002
|
"label",
|
|
973
1003
|
{ className: "field" },
|
|
@@ -985,7 +1015,7 @@
|
|
|
985
1015
|
|| !instance
|
|
986
1016
|
|| instance.status !== "online"
|
|
987
1017
|
|| (workspaceSource === "workspace" ? !workspaceId : !workspacePath.trim())
|
|
988
|
-
|| !agentId,
|
|
1018
|
+
|| !readyAgents.some((agent) => agent.id === agentId),
|
|
989
1019
|
}, creating ? "Starting…" : "Start session"),
|
|
990
1020
|
),
|
|
991
1021
|
),
|
|
@@ -993,5 +1023,21 @@
|
|
|
993
1023
|
);
|
|
994
1024
|
}
|
|
995
1025
|
|
|
1026
|
+
function preferredAgentId(readyAgents, allAgents = readyAgents) {
|
|
1027
|
+
const preferred = readyAgents.find((agent) => agent.id === "shell")
|
|
1028
|
+
|| readyAgents.find((agent) => agent.mode === "shell")
|
|
1029
|
+
|| readyAgents[0]
|
|
1030
|
+
|| allAgents[0];
|
|
1031
|
+
return preferred?.id || "";
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
function formatAgentOption(agent) {
|
|
1035
|
+
const base = agent.name || agent.id;
|
|
1036
|
+
const modeNote = agent.mode && agent.mode !== agent.id && !String(base).toLowerCase().includes(agent.mode)
|
|
1037
|
+
? ` · ${agent.mode}`
|
|
1038
|
+
: "";
|
|
1039
|
+
return agent.ready ? `${base}${modeNote}` : `${base}${modeNote} (not ready)`;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
996
1042
|
ReactDOM.createRoot(document.getElementById("root")).render(h(App));
|
|
997
1043
|
})();
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"font:13px system-ui,sans-serif",
|
|
22
22
|
].join(";");
|
|
23
23
|
const label = document.createElement("strong");
|
|
24
|
-
label.textContent = "
|
|
24
|
+
label.textContent = "Cloud Agent Fleet";
|
|
25
25
|
const select = document.createElement("select");
|
|
26
26
|
select.setAttribute("aria-label", "Codeman host");
|
|
27
27
|
select.style.cssText = [
|