@songsid/agend 2.3.5-alpha.12 → 2.3.5-alpha.13
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/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/agent-workspace.d.ts +1 -2
- package/dist/agent-workspace.js +8 -29
- package/dist/agent-workspace.js.map +1 -1
- package/dist/auth-api.js +3 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/codex.d.ts +7 -14
- package/dist/backend/codex.js +25 -29
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok-mcp.d.ts +5 -0
- package/dist/backend/grok-mcp.js +221 -0
- package/dist/backend/grok-mcp.js.map +1 -0
- package/dist/backend/grok.d.ts +0 -10
- package/dist/backend/grok.js +5 -82
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +6 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -1
- package/dist/codex-pane-ownership.d.ts +13 -0
- package/dist/codex-pane-ownership.js +192 -0
- package/dist/codex-pane-ownership.js.map +1 -0
- package/dist/daemon.d.ts +2 -0
- package/dist/daemon.js +89 -8
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-manager.d.ts +8 -1
- package/dist/fleet-manager.js +52 -16
- package/dist/fleet-manager.js.map +1 -1
- package/dist/hub/client.d.ts +1 -1
- package/dist/hub/client.js +11 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +2 -2
- package/dist/hub/compose/member.js +11 -3
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/member/exposure-api.d.ts +2 -0
- package/dist/hub/member/exposure-api.js +4 -2
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/pairing-api.d.ts +2 -2
- package/dist/hub/member/pairing-api.js +2 -2
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/server.js +8 -0
- package/dist/hub/server.js.map +1 -1
- package/dist/hub-pairing-summary.d.ts +3 -1
- package/dist/hub-pairing-summary.js +6 -3
- package/dist/hub-pairing-summary.js.map +1 -1
- package/dist/locale.js +6 -2
- package/dist/locale.js.map +1 -1
- package/dist/runtime-client-store.js +5 -0
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-pane-private.d.ts +2 -0
- package/dist/runtime-pane-private.js +25 -0
- package/dist/runtime-pane-private.js.map +1 -1
- package/dist/runtime-pane-private.ps1 +74 -7
- package/dist/selection-card.d.ts +4 -3
- package/dist/selection-card.js +2 -1
- package/dist/selection-card.js.map +1 -1
- package/dist/settings-change.d.ts +2 -0
- package/dist/settings-change.js +74 -31
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +23 -0
- package/dist/settings-confirmation.js +13 -2
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +4 -0
- package/dist/settings-effect.js +14 -14
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -1
- package/dist/settings-http-confirmation.js +12 -7
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-summary.d.ts +24 -0
- package/dist/settings-summary.js +42 -0
- package/dist/settings-summary.js.map +1 -0
- package/dist/transcript-delta-reader.d.ts +9 -1
- package/dist/transcript-delta-reader.js +37 -8
- package/dist/transcript-delta-reader.js.map +1 -1
- package/dist/ui/agent-details-settings.js +253 -0
- package/dist/ui/agent-instructions-field.js +69 -0
- package/dist/ui/agent-page-strings.js +148 -0
- package/dist/ui/chat-quote.js +12 -17
- package/dist/ui/hub-client.js +1 -1
- package/dist/ui/hub-company-join-strings.js +1 -1
- package/dist/ui/hub-company-join.js +7 -0
- package/dist/ui/hub-strings.js +4 -0
- package/dist/ui/native-instance-settings.js +47 -14
- package/dist/ui/panel-details.js +38 -14
- package/dist/ui/panel-fleet.js +2 -2
- package/dist/ui/panel-settings.js +12 -9
- package/dist/ui/settings-access-overview.js +24 -3
- package/dist/ui/settings-confirm.js +5 -5
- package/dist/ui/settings-dialogs.js +208 -100
- package/dist/ui/settings-hub-company-join.js +69 -14
- package/dist/ui/settings-hub.js +13 -5
- package/dist/ui/settings-layout.js +0 -2
- package/dist/ui/settings-model.js +15 -0
- package/dist/ui/shared/access-overview.css +48 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +144 -3
- package/dist/ui/shared/app.css +74 -50
- package/dist/ui/shared/instance-nav.js +5 -1
- package/dist/ui/shared/view-strings.js +2 -0
- package/dist/update-dispatch.d.ts +50 -0
- package/dist/update-dispatch.js +58 -2
- package/dist/update-dispatch.js.map +1 -1
- package/dist/web-session.d.ts +4 -2
- package/dist/web-session.js +5 -2
- package/dist/web-session.js.map +1 -1
- package/dist/workspace-file-policy.d.ts +2 -0
- package/dist/workspace-file-policy.js +31 -0
- package/dist/workspace-file-policy.js.map +1 -0
- package/dist/workspace-follow.js +2 -1
- package/dist/workspace-follow.js.map +1 -1
- package/package.json +2 -2
- package/templates/runtime-assets/runtime-pane-private.ps1 +74 -7
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
// Windows uses the same staged instance settings flow, with its runtime's supported fields.
|
|
2
|
+
// the form is a hook (useNativeForm) and its fields are grouped by category (NativeFields), so the Settings dialog
|
|
3
|
+
// and the Details & settings page (agent-details-settings.js) draw the same fields, each with its ⓘ.
|
|
2
4
|
import { html, useState } from "/assets/app-html.js";
|
|
3
5
|
import { t } from "/assets/app-i18n.js";
|
|
4
6
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
5
7
|
import { ChipList, ModelSelect } from "./settings-dialogs.js";
|
|
8
|
+
import { InfoTip } from "./settings-shared.js";
|
|
6
9
|
import { useWindowsCliCatalog } from "./windows-cli-catalog.js";
|
|
7
10
|
import { useRuntimeCatalog, instanceMachineId } from "./runtime-catalog.js";
|
|
8
11
|
import { NativeAgendToolsHint, tr } from "./agent-runtime.js";
|
|
9
12
|
import {AgentRuntimeSettings} from "./agent-runtime-settings.js";
|
|
13
|
+
import "./agent-page-strings.js";
|
|
14
|
+
import { pt } from "./agent-page-strings.js";
|
|
10
15
|
const tn = key => t(`settings.${key}`);
|
|
11
|
-
|
|
16
|
+
/** The categories a Windows native agent has (it has no channel binding, tool sets or idle settings: the page shows only these). */
|
|
17
|
+
export const NATIVE_CATEGORIES = ["basic", "runtime", "work", "adv"];
|
|
18
|
+
const Lab = ({ id, text, tip }) => html`<div class="s-lab"><label for=${id}>${text}</label><${InfoTip} text=${tip} name=${text} /></div>`;
|
|
19
|
+
const Card = ({ title, span, children }) => html`<section class=${`card${span ? " ap-span2" : ""}`}><h3>${title}</h3>${children}</section>`;
|
|
20
|
+
|
|
21
|
+
export function useNativeForm({ name, inst, ctx }) {
|
|
12
22
|
const machineId = instanceMachineId(inst);
|
|
13
23
|
const catalog = useWindowsCliCatalog(!machineId), machines = useRuntimeCatalog(!!machineId);
|
|
14
24
|
const machine = machines.data?.machines?.find(item => item.id === machineId);
|
|
@@ -17,28 +27,51 @@ export function NativeInstanceSettings({ name, inst, ctx, onClose }) {
|
|
|
17
27
|
const set = key => value => setForm(current => ({...current,[key]:value}));
|
|
18
28
|
const dirty=Object.entries(form).some(([key,value])=>JSON.stringify(typeof value==="string"?value.trim():value)!==JSON.stringify(key==="display_name"?inst.display_name||name:key==="native_sandbox"?inst.native_sandbox||"read-only":key==="tags"?inst.tags||[]:inst[key]||""));
|
|
19
29
|
const ready = !!form.display_name.trim() && !(form.native_sandbox === "read-only" && native?.readOnlySupport === false);
|
|
20
|
-
const
|
|
21
|
-
if (!ready) return;
|
|
30
|
+
const pending = () => {
|
|
22
31
|
const patch = {};
|
|
23
32
|
for (const [key,value] of Object.entries(form)) {
|
|
24
33
|
const before = key === "display_name" ? inst.display_name || name : key === "native_sandbox" ? inst.native_sandbox || "read-only" : key === "tags" ? inst.tags || [] : inst[key] || "";
|
|
25
34
|
const next = typeof value === "string" ? value.trim() : value;
|
|
26
35
|
if (JSON.stringify(next) !== JSON.stringify(before)) patch[key] = next;
|
|
27
36
|
}
|
|
37
|
+
return patch;
|
|
38
|
+
};
|
|
39
|
+
const stage = done => {
|
|
40
|
+
if (!ready) return;
|
|
41
|
+
const patch = pending();
|
|
28
42
|
if (Object.keys(patch).length) ctx.stageAgent(name,inst,patch);
|
|
29
|
-
|
|
43
|
+
if (done) done();
|
|
30
44
|
};
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
45
|
+
return { name, inst, ctx, form, set, dirty, ready, native, machine, machines, machineId, pending, stage };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function NativeFields({ m, cat }) {
|
|
49
|
+
const { name, inst, ctx, form, set, dirty, ready, native, machine, machines, machineId } = m;
|
|
50
|
+
if (cat === "basic") return html`<div class="ap-grid"><${Card} title=${pt("cardName")} span=${true}>
|
|
51
|
+
<div class="grid2">
|
|
52
|
+
<div class="field"><${Lab} id="ni-dn" text=${tn("displayName")} tip=${pt("tip_displayName")} /><input id="ni-dn" value=${form.display_name} maxLength=${64} onInput=${event => set("display_name")(event.target.value)} /></div>
|
|
53
|
+
<div class="field"><${Lab} id="ni-tags" text=${tn("tags")} tip=${pt("tip_tags")} /><${ChipList} items=${form.tags} onChange=${set("tags")} placeholder=${tn("tagPlaceholder")} label=${tn("tags")} /></div>
|
|
54
|
+
</div>
|
|
55
|
+
<div class="field"><${Lab} id="ni-desc" text=${tn("description")} tip=${pt("tip_description")} /><input id="ni-desc" value=${form.description} maxLength=${512} onInput=${event => set("description")(event.target.value)} /><p class="note">${pt("note_description")}</p></div></${Card}></div>`;
|
|
56
|
+
if (cat === "runtime") return html`<div class="ap-grid">
|
|
57
|
+
<${Card} title=${pt("cardRuntime")}><${AgentRuntimeSettings} name=${name} inst=${{...inst,machine_name:machine?.name||inst.machine_name,machine_status:machine?.status||inst.machine_status,machine_missing:!!machineId&&!!machines.data&&machines.data.enabled!==false&&!machine}} disabled=${dirty||ctx.staged?.size>0} onChanged=${()=>{ctx.reload();if(m.onChanged)m.onChanged();}}/></${Card}>
|
|
58
|
+
<${Card} title=${pt("cardModel")}><div class="field"><${Lab} id="native-instance-model" text=${tn("model")} tip=${pt("tip_model")} /><${ModelSelect} id="native-instance-model" value=${form.model} onChange=${set("model")} backend=${inst.backend} instance=${name} runtime="windows" machineId=${machineId} inherit=${tr("model")} /></div></${Card}></div>`;
|
|
59
|
+
if (cat === "work") return html`<div class="ap-grid"><${Card} title=${pt("cardWorkspace")} span=${true}>
|
|
60
|
+
<div class="field"><${Lab} id="ni-wd" text=${tn("workingDir")} tip=${pt("tip_workdirNative")} /><input id="ni-wd" value=${inst.working_directory || ""} readOnly=${true} aria-readonly="true" /><small>${t("nativeInstance.workspace")}</small></div>
|
|
61
|
+
<div class="field"><${Lab} id="ni-sb" text=${tr("access")} tip=${pt("tip_sandbox")} /><select id="ni-sb" value=${form.native_sandbox} onChange=${event => set("native_sandbox")(event.target.value)}><option value="read-only" disabled=${native?.readOnlySupport === false}>${tr("read")}</option><option value="workspace-write">${tr("write")}</option></select></div>
|
|
38
62
|
<${NativeAgendToolsHint} cli=${native} sandbox=${form.native_sandbox} />
|
|
39
63
|
${!ready && form.native_sandbox === "read-only" && native?.readOnlySupport === false ? html`<p class="note">${tr("noReadOnly")}</p>` : null}
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
64
|
+
<p class="s-info"><span aria-hidden="true">ⓘ</span><span>${pt("nativeLimits")}</span></p></${Card}></div>`;
|
|
65
|
+
return html`<div class="ap-grid"><${Card} title=${pt("cardSystemPrompt")} span=${true}>
|
|
66
|
+
<div class="field"><${Lab} id="ni-sys" text=${tn("systemPrompt")} tip=${pt("tip_systemPromptNative")} /><textarea id="ni-sys" rows="5" maxLength=${8000} value=${form.systemPrompt} onInput=${event => set("systemPrompt")(event.target.value)} /></div>
|
|
67
|
+
<p class="note">${pt("note_systemPrompt")}</p></${Card}></div>`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function NativeInstanceSettings({ name, inst, ctx, onClose }) {
|
|
71
|
+
const m = useNativeForm({ name, inst, ctx });
|
|
72
|
+
m.onChanged = onClose;
|
|
73
|
+
const stage = () => m.stage(onClose);
|
|
74
|
+
return html`<${Dialog} title=${ctx.shortName(name,inst)} onClose=${onClose} wide=${true} drawer=${true} actions=${html`<button type="button" class="btn" onClick=${onClose}>${tn("cancel")}</button><button type="button" class="btn btn-primary" disabled=${!m.ready} onClick=${stage}>${tn("modalDone")}</button>`}>
|
|
75
|
+
<div class="form native-instance-settings">${NATIVE_CATEGORIES.map(cat => html`<${NativeFields} key=${cat} m=${m} cat=${cat} />`)}</div>
|
|
43
76
|
</${Dialog}>`;
|
|
44
77
|
}
|
package/dist/ui/panel-details.js
CHANGED
|
@@ -2,8 +2,9 @@ import { NativePaneRecovery } from "./native-pane-recovery.js";
|
|
|
2
2
|
// #1523 N2 (§3.3, Q1 = B): Details — "the Fleet side of one instance", at /ui/fleet/agent/<name>. Behind the session
|
|
3
3
|
// gate (/ui/js/). What it holds:
|
|
4
4
|
// - runtime and recent activity (what Chat's details dialog showed, now a page);
|
|
5
|
-
// - a read-only config summary — directory, binding, tags, description —
|
|
6
|
-
//
|
|
5
|
+
// - a read-only config summary — directory, binding, tags, description — in the Overview;
|
|
6
|
+
// - "Details & settings" — the settings of that agent beside it, by category (agent-details-settings.js), with
|
|
7
|
+
// Settings' own staged Apply and confirmations;
|
|
7
8
|
// - the instance's actions (⋯), carried over with their calls and confirmations, none new: start / restart / stop (Chat's
|
|
8
9
|
// ⋯), pause / wake (Settings' agent row). Deletion stays where it already lives (Chat's ⋯, Settings).
|
|
9
10
|
// One read of /ui/instance/<name> when it opens (#1374: nothing recurring); the live status is the app's.
|
|
@@ -13,7 +14,7 @@ import { appStore, useStore } from "/assets/app-store.js";
|
|
|
13
14
|
import { useLease } from "/assets/app-ctx.js";
|
|
14
15
|
import { PanelHeader, setTitle, statusClass, statusLabel, openDrawer } from "/assets/app-shell.js";
|
|
15
16
|
import { navigate } from "/assets/app-nav.js";
|
|
16
|
-
import {
|
|
17
|
+
import { detailsPath } from "/assets/app-route.js";
|
|
17
18
|
import { InstanceSwitch } from "/assets/instance-switch.js";
|
|
18
19
|
import { modelText } from "/assets/instance-nav.js";
|
|
19
20
|
import { HeaderTools } from "/assets/header-tools.js";
|
|
@@ -27,7 +28,10 @@ import { toast } from "/assets/ui-toast.js";
|
|
|
27
28
|
import "/assets/chat-strings.js";
|
|
28
29
|
import { api } from "./settings-confirm.js";
|
|
29
30
|
import { InstanceBoardWork } from "./fleet-task-work.js";
|
|
30
|
-
import {
|
|
31
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
32
|
+
import { AgentCategoryNav, AgentPageHead, AgentSettingsPanels, agentKind, categoryFromSearch, categoryLabel, useAgentSettings } from "./agent-details-settings.js";
|
|
33
|
+
import "./agent-page-strings.js";
|
|
34
|
+
import { pt } from "./agent-page-strings.js";
|
|
31
35
|
|
|
32
36
|
export function DetailsPanel({ route, navKey }) {
|
|
33
37
|
const app = useStore(appStore);
|
|
@@ -53,6 +57,15 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
53
57
|
const [failed, setFailed] = useState(false);
|
|
54
58
|
const [busy, setBusy] = useState("");
|
|
55
59
|
const body = useRef(null);
|
|
60
|
+
// the category the address names (`?cat=`); none is Overview on a wide screen, the list of categories on a phone.
|
|
61
|
+
const [opened, setOpened] = useState(false);
|
|
62
|
+
const [dirty, setDirty] = useState(() => new Set());
|
|
63
|
+
const kind = agentKind(d, inst);
|
|
64
|
+
const cat = categoryFromSearch(kind);
|
|
65
|
+
const shownCat = cat || "overview";
|
|
66
|
+
useEffect(() => { if (d && cat && cat !== "overview") setOpened(true); }, [!!d, cat]);
|
|
67
|
+
const sess = useAgentSettings({ name, lease, enabled: opened, navKey });
|
|
68
|
+
const onDirty = (next) => setDirty((cur) => (cur.size === next.size && [...cur].every((c) => next.has(c)) ? cur : next));
|
|
56
69
|
// Each read is numbered: only the latest one (on this page) may set what is shown — a Retry still on its way never
|
|
57
70
|
// overwrites a newer answer, failed or not (#1561 review).
|
|
58
71
|
const reads = useRef(0);
|
|
@@ -95,17 +108,14 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
95
108
|
// A ClassicBot room (classicBot.yaml) keeps Classic's split: its own Settings dialog, and only the actions Settings'
|
|
96
109
|
// Classic rows have (pause / wake) — never the fleet agent's (#1561 review).
|
|
97
110
|
const classic = !!(d && d.kind === "classic");
|
|
98
|
-
const editInSettings = () => { requestAgentSettings(name, classic ? "classic" : "agent"); navigate(sectionPath(classic ? "classic" : undefined)); };
|
|
99
111
|
const st = inst.status;
|
|
100
112
|
// Until its read is in, the page does not know which kind it is: no actions yet (only Edit is offered once known).
|
|
101
113
|
const items = !d ? [] : classic ? [
|
|
102
|
-
{ key: "edit", label: t("chat.dEditInSettings"), icon: "settings", onSelect: editInSettings },
|
|
103
114
|
st === "running" ? { key: "pause", label: t("chat.dPause"), icon: "pause", disabled: !!busy, onSelect: () => pauseWake("pause") } : null,
|
|
104
115
|
st === "paused" ? { key: "wake", label: t("chat.dWake"), icon: "play", disabled: !!busy, onSelect: () => pauseWake("wake") } : null,
|
|
105
116
|
colorMenuItem(name, inst), // #1958
|
|
106
117
|
...themeMenuItems(name), // #1629
|
|
107
118
|
] : [
|
|
108
|
-
{ key: "edit", label: t("chat.dEditInSettings"), icon: "settings", onSelect: editInSettings },
|
|
109
119
|
st === "running" ? null : st === "paused" ? null : { key: "start", label: t("chat.start"), icon: "play", disabled: !!busy, onSelect: () => lifecycle("start") },
|
|
110
120
|
st === "running" ? { key: "restart", label: t("chat.restart"), icon: "restart", disabled: !!busy, onSelect: () => lifecycle("restart") } : null,
|
|
111
121
|
st === "running" ? { key: "stop", label: t("chat.stopInstance"), icon: "stop", disabled: !!busy, onSelect: () => lifecycle("stop") } : null,
|
|
@@ -117,7 +127,9 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
117
127
|
];
|
|
118
128
|
|
|
119
129
|
const cls = statusClass(inst, exec, awaiting);
|
|
120
|
-
|
|
130
|
+
// On a phone the header shows only the dot (the name needs the room): the word is in `title` and the accessible name.
|
|
131
|
+
const statusText = statusLabel(inst, exec, awaiting);
|
|
132
|
+
const sub = html`<span class="status" role="img" title=${statusText} aria-label=${statusText}><span class=${`dot ${cls}`} aria-hidden="true"></span><span class="status-text">${statusText}</span></span>`;
|
|
121
133
|
const src = (s) => (s === "instance" ? ` ${t("chat.configured")}` : s === "fleet-default" ? ` ${t("chat.fleetDefault")}` : "");
|
|
122
134
|
const bar = (pct, level) => html`<span class="progress-bar"><span class=${`progress-fill${level ? ` ${level}` : ""}`} data-pct=${Math.max(0, Math.min(Number(pct) || 0, 100))}></span></span>`;
|
|
123
135
|
const row = (k, v) => html`<div class="kv"><span class="k">${k}</span><span class="v">${v}</span></div>`;
|
|
@@ -141,9 +153,7 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
141
153
|
${row(t("chat.dDescription"), d.description || "--")}
|
|
142
154
|
${d.working_directory ? row(t("chat.dDirectory"), html`<span class="mono">${d.working_directory}</span>`) : null}
|
|
143
155
|
${row(t("chat.dBinding"), binding)}
|
|
144
|
-
${row(t("chat.dTags"), Array.isArray(d.tags) && d.tags.length ? html`<span class="d-tags">${d.tags.map((x) => html`<span key=${x} class="tag">${x}</span>`)}</span>` : "--")}
|
|
145
|
-
<div class="d-edit"><span class="note">${t("chat.dReadOnly")}</span>
|
|
146
|
-
<button type="button" class="btn btn-sm d-edit-settings" onClick=${editInSettings}>${t("chat.dEditInSettings")}</button></div></section>
|
|
156
|
+
${row(t("chat.dTags"), Array.isArray(d.tags) && d.tags.length ? html`<span class="d-tags">${d.tags.map((x) => html`<span key=${x} class="tag">${x}</span>`)}</span>` : "--")}</section>
|
|
147
157
|
<section class="card"><h3>${t("chat.dRuntime")}</h3>
|
|
148
158
|
${row(t("chat.dBackend"), d.backend || "--")}
|
|
149
159
|
${row(t("chat.dModel"), `${(d.model && modelText(d)) || sl.model?.display_name || "--"}${d.model_source === "live" ? "" : src(d.model_source)}`)}
|
|
@@ -157,9 +167,23 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
157
167
|
<span class="mono muted">${a.timestamp ? new Date(`${a.timestamp.replace(" ", "T")}Z`).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ""}</span>
|
|
158
168
|
<span class="ev">${a.event}</span> ${a.summary || ""}</div>`) : html`<p class="note">${t("chat.dNoActivity")}</p>`}</section>`;
|
|
159
169
|
}
|
|
160
|
-
|
|
170
|
+
const actions = items.filter((i) => i && ["start", "restart", "stop", "pause", "wake"].includes(i.key));
|
|
171
|
+
const overview = html`<${NativePaneRecovery} name=${name} inst=${inst} lease=${lease} />${busy ? html`<p class="note" role="status">${t("chat.dWorking")}</p>` : null}<${IdentityCard} name=${name} card=${card} />
|
|
172
|
+
<${AgentWidget} slot="details" widget=${widgetFor(name, "details")} binds=${instanceBinds(inst, exec, awaiting)} />${content}
|
|
173
|
+
${actions.length ? html`<section class="card d-actions"><h3>${pt("actions")}</h3><div class="field-row">${actions.map((i) => html`<button key=${i.key} type="button" class="btn btn-sm" disabled=${i.disabled} onClick=${i.onSelect}>${i.label}</button>`)}</div>
|
|
174
|
+
<p class="note">${pt("actionsNote")}</p></section>` : null}`;
|
|
175
|
+
const Pending = sess.mod && sess.mod.PendingBar, OpCard = sess.mod && sess.mod.OperationCard;
|
|
176
|
+
return html`<div data-effect-panel="details" class="panel p-details p-settings p-agent-page" data-view=${cat ? "section" : "index"}>
|
|
161
177
|
<${PanelHeader} title=${name} sub=${sub} nav=${html`<${InstanceSwitch} name=${name} current="details" />`}><${HeaderTools} navKey=${navKey} /><${Menu} items=${items} label=${t("app.more")} /></${PanelHeader}>
|
|
162
|
-
|
|
163
|
-
|
|
178
|
+
<${AgentCategoryNav} name=${name} kind=${kind} cat=${shownCat} dirty=${dirty} />
|
|
179
|
+
<div data-trust="panel-content" class="panel-body"><div class="col" ref=${body}>
|
|
180
|
+
<a class="s-back" href=${detailsPath(name)}><${Icon} name="back" size=${16} /><span>${t("app.details")}</span><span class="s-back-here">${categoryLabel(kind, shownCat)}</span></a>
|
|
181
|
+
<${AgentPageHead} name=${name} kind=${kind} cat=${shownCat} inst=${null} />
|
|
182
|
+
${OpCard && sess.op ? html`<${OpCard} op=${sess.op} schema=${sess.data && sess.data.schema} />` : null}
|
|
183
|
+
<div class="s-section-layout" data-agent-category=${shownCat}>
|
|
184
|
+
<div class="ap-panel" id="ap-panel-overview" hidden=${shownCat !== "overview"}>${overview}</div>
|
|
185
|
+
${opened ? html`<${AgentSettingsPanels} name=${name} kind=${kind} cat=${shownCat} sess=${sess} onDirty=${onDirty} />` : null}
|
|
186
|
+
</div></div></div>
|
|
187
|
+
${sess.staged.size && Pending ? html`<${Pending} staged=${sess.staged} busy=${!!sess.op && ["writing", "posting", "watching"].includes(sess.op.phase)} onApply=${sess.apply} onDiscard=${sess.discard} section="agents" />` : null}
|
|
164
188
|
</div>`;
|
|
165
189
|
}
|
package/dist/ui/panel-fleet.js
CHANGED
|
@@ -67,7 +67,7 @@ register("fleet", {
|
|
|
67
67
|
backend: "Backend",
|
|
68
68
|
newInstance: "New instance", directory: "Directory", directoryHint: "Optional — a workspace is created if empty", topic: "Name", topicHint: "From the directory name",
|
|
69
69
|
topicRequired: "Name is required when Directory is empty", description: "Description", descriptionHint: "What this instance does", model: "Model", modelHint: "e.g. sonnet, opus, gpt-5",
|
|
70
|
-
branch: "Branch (git worktree)", branchHint: "e.g. feature-x", tags: "Tags", tagsHint: "comma-separated, e.g. dev, review", systemPrompt: "
|
|
70
|
+
branch: "Branch (git worktree)", branchHint: "e.g. feature-x", tags: "Tags", tagsHint: "comma-separated, e.g. dev, review", systemPrompt: "Agent instructions", systemPromptHint: "Custom instructions for this instance (formerly “System prompt”)",
|
|
71
71
|
fleetDefault: "Use the fleet default", notInstalled: "(not installed)", notSignedIn: "(not signed in — use /login)", tooOld: "(needs {0} or newer)", unchecked: "(not checked yet)", deprecated: "(deprecated)", instanceCreated: "Instance created",
|
|
72
72
|
},
|
|
73
73
|
"zh-TW": {
|
|
@@ -94,7 +94,7 @@ register("fleet", {
|
|
|
94
94
|
backend: "Backend",
|
|
95
95
|
newInstance: "新增 Agent", directory: "目錄", directoryHint: "可留空——留空會自動建立工作區", topic: "名稱", topicHint: "預設取自目錄名稱",
|
|
96
96
|
topicRequired: "目錄留空時必須填寫名稱", description: "說明", descriptionHint: "這個 Agent 做什麼", model: "模型", modelHint: "例如 sonnet、opus、gpt-5",
|
|
97
|
-
branch: "分支(git worktree)", branchHint: "例如 feature-x", tags: "標籤", tagsHint: "以逗號分隔,例如 dev, review", systemPrompt: "
|
|
97
|
+
branch: "分支(git worktree)", branchHint: "例如 feature-x", tags: "標籤", tagsHint: "以逗號分隔,例如 dev, review", systemPrompt: "Agent 指示", systemPromptHint: "這個 Agent 的自訂指示(以前叫「System prompt」)",
|
|
98
98
|
fleetDefault: "使用 fleet 預設", notInstalled: "(未安裝)", notSignedIn: "(未登入,請用 /login)", tooOld: "(需要 {0} 以上版本)", unchecked: "(尚未檢查)", deprecated: "(已淘汰)", instanceCreated: "Agent 已建立",
|
|
99
99
|
},
|
|
100
100
|
});
|
|
@@ -27,6 +27,7 @@ import { toast } from "/assets/ui-toast.js";
|
|
|
27
27
|
import { GroupMark, groupLabel, groupOf as navGroupOf, modelText } from "/assets/instance-nav.js";
|
|
28
28
|
import "./settings-strings.js";
|
|
29
29
|
import "./settings-shared-strings.js"; // see settings-shared.js: the words Shared agent settings added, which an older settings-strings.js in an open tab lacks
|
|
30
|
+
import "./agent-page-strings.js"; // the confirmation text of the MCP proxy reply
|
|
30
31
|
import "./settings-restart-strings.js"; // S-92: the restart words for a fleet with no chat connection (a file of its own: an open tab may hold an old settings-strings.js)
|
|
31
32
|
import "./settings-access-strings.js"; // the words Access & security added (settings.webLoginQr…): an older settings-strings.js from a tab that visited Fleet first lacks them (#3061)
|
|
32
33
|
import { UpdatePillMark, UpdateSection } from "./settings-update.js";
|
|
@@ -62,7 +63,7 @@ import { syncStage, useDraft } from "./settings-draft.js";
|
|
|
62
63
|
import { WebAuthorityCard } from "./settings-web-authority.js";
|
|
63
64
|
import { OutsideCard } from "./settings-outside.js";
|
|
64
65
|
import { DevicesCard } from "./settings-devices.js";
|
|
65
|
-
import { AccessOverview } from "./settings-access-overview.js";
|
|
66
|
+
import { AccessOverview, accessOverviewLabel } from "./settings-access-overview.js";
|
|
66
67
|
import { HubSection, hubSectionText } from "./settings-hub-section.js";
|
|
67
68
|
import { NamedLinkTest, setTypedTunnelToken } from "./settings-named-test.js";
|
|
68
69
|
import { SignInList } from "./backend-signin.js";
|
|
@@ -102,7 +103,7 @@ async function read(lease, path) {
|
|
|
102
103
|
|
|
103
104
|
let loads = 0;
|
|
104
105
|
/** Everything the panel shows, in the order the old page read it. Returns null if the lease ended meanwhile. */
|
|
105
|
-
async function loadAll(lease) {
|
|
106
|
+
export async function loadAll(lease) {
|
|
106
107
|
const out = { schema: DEFAULT_SCHEMA };
|
|
107
108
|
const schema = await read(lease, "/api/settings/schema");
|
|
108
109
|
if (!lease.current()) return null;
|
|
@@ -345,7 +346,7 @@ export function SettingsPanel({ route, navKey }) {
|
|
|
345
346
|
// A panel that went while a question was open asks nothing more, and says nothing.
|
|
346
347
|
for (const c of [...stagedRef.current.values()]) {
|
|
347
348
|
for (const k of c.confirms || []) {
|
|
348
|
-
const yes = await ask(tn(k));
|
|
349
|
+
const yes = await ask(k.includes(".") ? t(k) : tn(k));
|
|
349
350
|
if (!mount.current()) return;
|
|
350
351
|
if (!yes) { toast(tn("accessChangeCancelled"), false); return; }
|
|
351
352
|
}
|
|
@@ -517,7 +518,7 @@ export function SettingsPanel({ route, navKey }) {
|
|
|
517
518
|
</${PanelHeader}>
|
|
518
519
|
<nav data-trust="panel-navigation" class="seg s-nav" aria-label=${tn("title")}><${SettingsSearch} /><div class="s-nav-groups">${SETTINGS_GROUPS.map((g) => html`<div key=${g.id} class="s-nav-group" role="group" aria-labelledby=${`s-grp-${g.id}`}>
|
|
519
520
|
<span class="s-nav-head" id=${`s-grp-${g.id}`}>${tn(`grp_${g.id}`)}</span>
|
|
520
|
-
${g.sections.map((k) => html`<a key=${k} href=${sectionPath(k)} class=${`seg-item${k === section ? " active" : ""}`}
|
|
521
|
+
${g.sections.map((k) => html`<a key=${k} href=${sectionPath(k)} class=${`seg-item${k === section ? " active" : ""}`} title=${tn(`sec_${k}`)}
|
|
521
522
|
aria-current=${k === section ? "page" : undefined}><${Icon} name=${ICONS[k]} size=${16} /><span>${tn(`sec_${k}`)}</span></a>`)}</div>`)}</div></nav>
|
|
522
523
|
<div data-trust="panel-content" class="panel-body"><div class="col" data-settings-section=${section}>
|
|
523
524
|
<a class="s-back" href=${settingsPath()}><${Icon} name="back" size=${16} /><span>${tn("title")}</span><span class="s-back-here">${tn(`sec_${section}`)}</span></a>
|
|
@@ -739,7 +740,7 @@ export function ProfileCard({ embedded = false } = {}) {
|
|
|
739
740
|
}
|
|
740
741
|
|
|
741
742
|
/** The operation in hand still owns Apply: its writes and job, or a restart of AgEnD from the press to its end. */
|
|
742
|
-
const opBusy = (op) => !!op && (["writing", "posting", "watching"].includes(op.phase) || op.restart === "busy");
|
|
743
|
+
export const opBusy = (op) => !!op && (["writing", "posting", "watching"].includes(op.phase) || op.restart === "busy");
|
|
743
744
|
function dropSecrets(staged) { for (const c of staged.values()) if (c.connectionSecret) c.connectionSecret.secret = ""; }
|
|
744
745
|
|
|
745
746
|
function renderDialog(d, ctx, close) {
|
|
@@ -753,7 +754,7 @@ function renderDialog(d, ctx, close) {
|
|
|
753
754
|
}
|
|
754
755
|
|
|
755
756
|
/** What the sections and dialogs work with: the data, and the ways to change it (staging, or a direct write). */
|
|
756
|
-
function makeCtx(data, setData, stage, unstage, reload, reloadLive, alive, extra = {}) {
|
|
757
|
+
export function makeCtx(data, setData, stage, unstage, reload, reloadLive, alive, extra = {}) {
|
|
757
758
|
const { fleet, classic, schema } = data;
|
|
758
759
|
const chs = channelsOf(fleet);
|
|
759
760
|
const edit = (fn) => setData((d) => { const next = structuredClone(d); fn(next); return next; });
|
|
@@ -777,6 +778,8 @@ function makeCtx(data, setData, stage, unstage, reload, reloadLive, alive, extra
|
|
|
777
778
|
});
|
|
778
779
|
stage(`agent:${name}`, {
|
|
779
780
|
label: tn("updateAgent", shortName(name, { ...inst, ...patch })),
|
|
781
|
+
// turning the MCP proxy reply on is asked about first (agent-page-strings.js).
|
|
782
|
+
...(patch.mcp_proxy_reply === true ? { confirms: ["agentPage.confirmMcpProxy"] } : {}),
|
|
780
783
|
impact: inst.runtime === "windows" ? "now" : batchImpact(schema, Object.keys(patch), (k) => impactOf(schema, `instance.${k}`)),
|
|
781
784
|
request: { method: "PATCH", url: inst.runtime === "windows" ? `/ui/instances/${encodeURIComponent(name)}` : `/api/settings/fleet/instances/${encodeURIComponent(name)}`, body: patch },
|
|
782
785
|
});
|
|
@@ -1374,7 +1377,7 @@ function WebSection({ ctx, staged, part = "all" }) {
|
|
|
1374
1377
|
const has = (p) => part === "all" || part === p;
|
|
1375
1378
|
const lock = (body) => html`<fieldset class="s-web-fields" disabled=${overPublicLink}>${body}</fieldset>`;
|
|
1376
1379
|
const tabs = [
|
|
1377
|
-
{ id: "overview", label:
|
|
1380
|
+
{ id: "overview", label: accessOverviewLabel() },
|
|
1378
1381
|
{ id: "login", label: layoutText("accessLogin") },
|
|
1379
1382
|
{ id: "guests", label: layoutText("accessGuests") },
|
|
1380
1383
|
{ id: "sharing", label: layoutText("accessSharing") },
|
|
@@ -1553,7 +1556,7 @@ function Developer({ ctx }) {
|
|
|
1553
1556
|
* #2347: the section's Save. Shown while anything is unsaved: how many changes, what they will cost, Discard and Save —
|
|
1554
1557
|
* Save waits while a field is invalid ("Fix 1 field to save").
|
|
1555
1558
|
*/
|
|
1556
|
-
function PendingBar({ staged, busy, onApply, onDiscard, section }) {
|
|
1559
|
+
export function PendingBar({ staged, busy, onApply, onDiscard, section }) {
|
|
1557
1560
|
const changes = [...staged.values()];
|
|
1558
1561
|
// What Save will cost, one line each: a change that knows its own words (the shared agent settings: how many agents
|
|
1559
1562
|
// restart) says them; any other says its impact label.
|
|
@@ -1580,7 +1583,7 @@ function PendingBar({ staged, busy, onApply, onDiscard, section }) {
|
|
|
1580
1583
|
}
|
|
1581
1584
|
|
|
1582
1585
|
/** The Apply in hand (the app's, settings-apply.js): its writes, its job, and a restart when one is needed. */
|
|
1583
|
-
function OperationCard({ op, schema }) {
|
|
1586
|
+
export function OperationCard({ op, schema }) {
|
|
1584
1587
|
const [restarting, setRestarting] = useState(false);
|
|
1585
1588
|
const busy = opBusy(op); // nothing to dismiss while it, or its restart, runs
|
|
1586
1589
|
const phaseBusy = ["writing", "posting", "watching"].includes(op.phase);
|
|
@@ -17,7 +17,7 @@ import { roleName } from "/assets/device-roles.js";
|
|
|
17
17
|
|
|
18
18
|
register("accessov", {
|
|
19
19
|
en: {
|
|
20
|
-
devicesTitle: "Signed-in devices", devicesCount: "{0} signed in", more: "{0} more in Devices & sign-in", manageDevices: "Devices & sign-in", manageGuests: "Guests",
|
|
20
|
+
tab: "Overview", devicesTitle: "Signed-in devices", devicesCount: "{0} signed in", more: "{0} more in Devices & sign-in", manageDevices: "Devices & sign-in", manageGuests: "Guests",
|
|
21
21
|
legend: "✓ the verified owner: may add devices and sign others out. Not verified: everyday use only.",
|
|
22
22
|
blockedOwner: "Verify as the owner first to sign out other devices.", blockedOther: "Another admin's device: only that admin can sign it out.",
|
|
23
23
|
signOutTitle: "Sign out {0}?", signOutLead: "{0} is signed out at once and has to sign in again.", signedOut: "{0} was signed out.",
|
|
@@ -36,7 +36,7 @@ register("accessov", {
|
|
|
36
36
|
accounts: "AI accounts", accountsHint: "The Claude, Codex and other accounts your agents use", hubOn: "Connected", paired: "{0} connected",
|
|
37
37
|
},
|
|
38
38
|
"zh-TW": {
|
|
39
|
-
devicesTitle: "已登入的裝置", devicesCount: "{0} 個登入", more: "另外 {0} 個,到「裝置與登入」查看", manageDevices: "裝置與登入", manageGuests: "訪客",
|
|
39
|
+
tab: "總覽", devicesTitle: "已登入的裝置", devicesCount: "{0} 個登入", more: "另外 {0} 個,到「裝置與登入」查看", manageDevices: "裝置與登入", manageGuests: "訪客",
|
|
40
40
|
legend: "✓ 已驗證的擁有者:可新增裝置、登出其他裝置。未驗證:只能使用一般功能。",
|
|
41
41
|
blockedOwner: "要先驗證為擁有者,才能登出其他裝置。", blockedOther: "別的管理員的裝置,只有那位管理員本人能登出。",
|
|
42
42
|
signOutTitle: "登出 {0}?", signOutLead: "{0} 會立即登出,之後需要重新登入。", signedOut: "已登出 {0}。",
|
|
@@ -56,6 +56,22 @@ register("accessov", {
|
|
|
56
56
|
},
|
|
57
57
|
});
|
|
58
58
|
const to = (k, ...a) => t(`accessov.${k}`, ...a);
|
|
59
|
+
/** M-2855: the tab's own label (a tab opened before this page existed holds an older settings-layout.js without it). */
|
|
60
|
+
export const accessOverviewLabel = () => to("tab");
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* M-2855: this page's stylesheet, linked once when the module loads (a tab opened before this page existed holds an
|
|
64
|
+
* older app.css with none of its rules). Before first render, so the cards never paint unstyled.
|
|
65
|
+
*/
|
|
66
|
+
export function linkAccessOverviewCss(doc = typeof document !== "undefined" ? document : null) {
|
|
67
|
+
try {
|
|
68
|
+
if (!doc || !doc.head || doc.querySelector('link[data-access-overview-css="1"]')) return;
|
|
69
|
+
const link = doc.createElement("link");
|
|
70
|
+
link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/access-overview.css"); link.setAttribute("data-access-overview-css", "1");
|
|
71
|
+
doc.head.appendChild(link);
|
|
72
|
+
} catch { /* the page still works without it */ }
|
|
73
|
+
}
|
|
74
|
+
linkAccessOverviewCss();
|
|
59
75
|
const SHOWN = 4;
|
|
60
76
|
const leftWords = (ms) => { const m = Math.max(1, Math.round(ms / 60_000)); return m >= 60 ? (m % 60 ? to("hm", Math.floor(m / 60), m % 60) : to("h", Math.floor(m / 60))) : to("m", m); };
|
|
61
77
|
const day = (ms) => { const d = new Date(ms); return `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, "0")}/${String(d.getDate()).padStart(2, "0")}`; };
|
|
@@ -74,6 +90,9 @@ export function AccessOverview({ web = {}, hub, openTab, overPublicLink, active
|
|
|
74
90
|
const [shares, setShares] = useState(null), [machines, setMachines] = useState(null);
|
|
75
91
|
const [ask, setAsk] = useState(null), [askClose, setAskClose] = useState(false), [linkNote, setLinkNote] = useState("");
|
|
76
92
|
const { publicLink } = useStore(appStore);
|
|
93
|
+
// #3600: the status frame this page saw when its close went through. Until the next frame arrives (each frame is a new
|
|
94
|
+
// object), that frame still says "open" for a link that is already closed: it is shown as closed, at once.
|
|
95
|
+
const [closedFrame, setClosedFrame] = useState(null);
|
|
77
96
|
const [busy, setBusy] = useState(false);
|
|
78
97
|
const [note, setNote] = useState("");
|
|
79
98
|
const load = async () => {
|
|
@@ -98,14 +117,16 @@ export function AccessOverview({ web = {}, hub, openTab, overPublicLink, active
|
|
|
98
117
|
};
|
|
99
118
|
// The link's state: the shell's status frame (every fleet; a tab from before S-120 has none — then /ui/outside's).
|
|
100
119
|
const pub = web.public_link || {};
|
|
101
|
-
const framed = publicLink && publicLink.state !== "closed" ? { ...publicLink, quick: !pub.hostname } : null;
|
|
120
|
+
const framed = publicLink && publicLink.state !== "closed" && publicLink !== closedFrame ? { ...publicLink, quick: !pub.hostname } : null;
|
|
102
121
|
const link = framed || (outside && outside.link) || null;
|
|
103
122
|
// A web-only fleet's outside link is the owner's switch (#3008): closed there, not here (the route answers 409).
|
|
104
123
|
const outsideOwned = !!(link && outside && outside.webOnly && outside.outside);
|
|
105
124
|
const closeLink = async () => {
|
|
106
125
|
setBusy(true);
|
|
126
|
+
const seen = publicLink;
|
|
107
127
|
const r = await api("/ui/public-link/close", { method: "POST", body: "{}" });
|
|
108
128
|
setBusy(false); setAskClose(false);
|
|
129
|
+
if (r.ok && r.body && r.body.closed === true) setClosedFrame(seen); // only a close that happened; a refusal changes nothing
|
|
109
130
|
setLinkNote(r.ok ? to("closed") : r.body && r.body.error === "outside_link" ? to("outsideOwned") : to("closeFailed"));
|
|
110
131
|
load();
|
|
111
132
|
};
|
|
@@ -63,8 +63,7 @@ const finals = new Map(); // id → its decided view
|
|
|
63
63
|
let timer = null, polling = false;
|
|
64
64
|
|
|
65
65
|
function publish() {
|
|
66
|
-
|
|
67
|
-
pendingChanges: [...tracked.values()].map(({ view, at, label, retry, displaySummary }) => ({
|
|
66
|
+
const views = [...tracked.values()].map(({ view, at, label, retry, displaySummary }) => ({
|
|
68
67
|
...view,
|
|
69
68
|
label: label || null,
|
|
70
69
|
// Display only: the server owns the diff, confirmation digest and execution.
|
|
@@ -84,8 +83,9 @@ function publish() {
|
|
|
84
83
|
dismiss: TERMINAL.has(view.state) ? () => forget(view.id) : null,
|
|
85
84
|
// AGEND-118: a request that ended without applying can be sent again (the same write, a new confirmation).
|
|
86
85
|
retry: retry && resendable(view) ? () => resend(view.id) : null,
|
|
87
|
-
}))
|
|
88
|
-
|
|
86
|
+
}));
|
|
87
|
+
appStore.set({ pendingChanges: views.filter(view => view.presentation !== "hub-join"),
|
|
88
|
+
hubJoinChanges: views.filter(view => view.presentation === "hub-join") });
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function forget(id) {
|
|
@@ -303,5 +303,5 @@ export function resetConfirmations() {
|
|
|
303
303
|
for (const e of tracked.values()) if (e.doneTimer) clearTimeout(e.doneTimer);
|
|
304
304
|
tracked.clear(); finals.clear();
|
|
305
305
|
if (timer) { clearTimeout(timer); timer = null; }
|
|
306
|
-
appStore.set({ pendingChanges: [] });
|
|
306
|
+
appStore.set({ pendingChanges: [], hubJoinChanges: [] });
|
|
307
307
|
}
|