@songsid/agend 2.3.5-alpha.11 → 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/accounts-view.d.ts +3 -0
- package/dist/accounts-view.js +2 -2
- package/dist/accounts-view.js.map +1 -1
- 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 +15 -29
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.js +16 -3
- package/dist/backend/claude-code.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/credential-profile.d.ts +16 -0
- package/dist/backend/credential-profile.js +44 -0
- package/dist/backend/credential-profile.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/muse.d.ts +3 -1
- package/dist/backend/muse.js +31 -1
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +18 -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/create-host-account.d.ts +17 -0
- package/dist/create-host-account.js +47 -0
- package/dist/create-host-account.js.map +1 -0
- package/dist/daemon.d.ts +25 -0
- package/dist/daemon.js +203 -16
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.js +7 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +40 -9
- package/dist/fleet-manager.js +198 -47
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +1 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +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/instance-lifecycle.js +29 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +13 -9
- package/dist/locale.js.map +1 -1
- package/dist/public-web-link.d.ts +5 -0
- package/dist/public-web-link.js +8 -0
- package/dist/public-web-link.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-api.js +5 -17
- package/dist/settings-api.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/signin-keepalive.d.ts +25 -1
- package/dist/signin-keepalive.js +44 -1
- package/dist/signin-keepalive.js.map +1 -1
- 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/accounts-view.js +9 -7
- 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 +10 -6
- package/dist/ui/native-instance-settings.js +47 -14
- package/dist/ui/panel-chat.js +2 -1
- package/dist/ui/panel-details.js +38 -14
- package/dist/ui/panel-fleet.js +9 -3
- package/dist/ui/panel-settings.js +17 -8
- package/dist/ui/settings-access-overview.js +188 -0
- package/dist/ui/settings-access-strings.js +1 -1
- package/dist/ui/settings-confirm.js +5 -5
- package/dist/ui/settings-devices.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 +1 -1
- package/dist/ui/settings-model.js +15 -0
- package/dist/ui/settings-strings.js +8 -8
- 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 +145 -4
- package/dist/ui/shared/app-store.js +2 -0
- package/dist/ui/shared/app.css +69 -7
- package/dist/ui/shared/chat-render.js +17 -5
- package/dist/ui/shared/device-roles.js +1 -1
- package/dist/ui/shared/instance-nav.js +5 -1
- package/dist/ui/shared/signin.js +130 -43
- package/dist/ui/shared/usage-dialog.js +27 -15
- package/dist/ui/shared/view-strings.js +2 -0
- package/dist/ui/shared/web-authorize.js +2 -2
- package/dist/ui/signin.html +19 -8
- 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/usage/format-rich.js +1 -1
- package/dist/usage/format-rich.js.map +1 -1
- package/dist/usage/usage-api.d.ts +8 -2
- package/dist/usage/usage-api.js +12 -5
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.d.ts +5 -0
- package/dist/web-api.js +58 -0
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +2 -0
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-remote-access.d.ts +71 -3
- package/dist/web-remote-access.js +197 -6
- package/dist/web-remote-access.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
- package/dist/ui/shared/signin-authenticator.js +0 -60
- package/dist/ui/signin-authenticator.html +0 -60
package/dist/ui/hub-strings.js
CHANGED
|
@@ -63,6 +63,8 @@ register("hub", {
|
|
|
63
63
|
heldTitle: "On hold", holdClear: "Start over",
|
|
64
64
|
hold_unknown_outcome: "The last pairing step's result is unknown. Nothing runs until it is checked.",
|
|
65
65
|
hold_expired: "The pairing request expired.", hold_unsaved: "This fleet couldn't save its Hub settings. Nothing connects until they can be saved.",
|
|
66
|
+
offlineRecovery: "A temporary outage reconnects automatically. If the Hub was restored or no longer recognises this fleet, pair again.",
|
|
67
|
+
hold_rejected: "The Hub cannot resume this fleet’s saved connection. It may have been restored to an older state or no longer recognise this fleet. Pair again to reconnect.",
|
|
66
68
|
hold_refused: "The Hub refused the pairing.", hold_revoked: "The Hub revoked this fleet's pairing.", hold_other: "Pairing is on hold.",
|
|
67
69
|
sharedTitle: "Shared agents",
|
|
68
70
|
sharedLead: "Every agent is private unless you share it. Only an agent that can run in a restricted, read-only mode can be shared.",
|
|
@@ -107,7 +109,7 @@ register("hub", {
|
|
|
107
109
|
noGrants: "目前沒有人可以提問。", grantLogin: "允許這個帳號提問", grantDays: "期間", days: "{0} 天", allow: "允許",
|
|
108
110
|
freeze: "停止所有提問", freezeAsk: "要停止所有人向 {0} 提問嗎?之後要再公開,需要你的 Fleet 重新核准。",
|
|
109
111
|
revoke: "撤銷", revokeAsk: "要撤銷 {0} 的權限嗎?對方的對話會關閉。",
|
|
110
|
-
adminOnly: "只有 Hub
|
|
112
|
+
adminOnly: "只有 Hub 管理員可以查看", adminOnlyHint: "已配對的 Fleet 與配對碼在這裡管理。",
|
|
111
113
|
pairTitle: "配對 Fleet", pairLead: "為已登入過這個 Hub 的人建立一次性配對碼,只能使用一次,十分鐘內有效。",
|
|
112
114
|
pairOwner: "擁有者帳號", pairCreate: "建立配對碼", pairCode: "請把這組配對碼交給 {0},在對方 Fleet 的設定頁輸入:",
|
|
113
115
|
pendingPairings: "配對請求", codeUnused: "配對碼尚未使用", ownerConfirmed: "擁有者已確認", ownerWaiting: "等待擁有者確認",
|
|
@@ -116,24 +118,26 @@ register("hub", {
|
|
|
116
118
|
noFleets: "還沒有配對的 Fleet。",
|
|
117
119
|
title: "連線到 Hub",
|
|
118
120
|
lead: "Hub 讓組織裡的人可以向你選擇公開的 Agent 提問。你的 Fleet 仍然屬於你:要公開哪些 Agent、誰可以提問,都由你決定。",
|
|
119
|
-
address: "Hub 位址", addressPh: "https://", addressHint: "Hub
|
|
121
|
+
address: "Hub 位址", addressPh: "https://", addressHint: "Hub 管理員給你的 https:// 位址。", code: "一次性配對碼", connect: "連線",
|
|
120
122
|
errAddress: "請輸入 Hub 的 https:// 位址。", errCode: "請完整輸入配對碼。",
|
|
121
123
|
errBusy: "這個 Fleet 已經連線,或正在等待核准。", errUnreachable: "無法連到這個位址的 Hub。",
|
|
122
124
|
errRefused: "Hub 拒絕了這個配對碼。", errFailed: "沒有成功,請再試一次。",
|
|
123
125
|
pendingTitle: "等待核准", pairingFp: "配對指紋",
|
|
124
126
|
pendingCompare: "請和 Hub 畫面上的指紋比對,兩者相同後再到 Hub 確認。",
|
|
125
|
-
pendingSteps: "還需要:", ownerStep: "你用自己的 Hub 帳號確認", adminStep: "Hub
|
|
127
|
+
pendingSteps: "還需要:", ownerStep: "你用自己的 Hub 帳號確認", adminStep: "Hub 管理員核准",
|
|
126
128
|
done: "已完成", waiting: "等待中", expires: "{0} 到期", cancel: "取消請求", showFull: "顯示完整指紋", hideFull: "收合",
|
|
127
129
|
pairedTitle: "已連線到 {0}", online: "在線", offline: "離線,正在重新連線", hubKeyFp: "Hub 金鑰指紋",
|
|
128
130
|
openHub: "開啟 Hub", disconnect: "中斷連線",
|
|
129
131
|
disconnectAsk: "要中斷與 {0} 的連線嗎?你在那裡公開的 Agent 都會撤回。",
|
|
130
132
|
disconnectPending: "已在這裡中斷。Hub 尚未確認,連得上時會再通知它。",
|
|
131
133
|
keyTitle: "Hub 的金鑰已變更",
|
|
132
|
-
keyLead: "重新配對前不會連線。若你沒有預期這個變更,請先詢問 Hub
|
|
134
|
+
keyLead: "重新配對前不會連線。若你沒有預期這個變更,請先詢問 Hub 管理員,再重新配對。",
|
|
133
135
|
keyApproved: "已核准的金鑰", keyOffered: "Hub 目前提供的金鑰", repair: "重新配對",
|
|
134
136
|
heldTitle: "暫停中", holdClear: "重新開始",
|
|
135
137
|
hold_unknown_outcome: "最後一個配對步驟的結果不明,確認之前不會執行任何工作。",
|
|
136
138
|
hold_expired: "配對請求已過期。", hold_unsaved: "這個 Fleet 無法儲存 Hub 設定,可以儲存之前不會連線。",
|
|
139
|
+
offlineRecovery: "暫時離線會自動重新連線。若 Hub 已還原,或不再接受這個 Fleet,請重新配對。",
|
|
140
|
+
hold_rejected: "Hub 無法繼續使用這個 Fleet 儲存的連接。Hub 可能已還原至較舊的狀態,或不再接受這個 Fleet;請重新配對。",
|
|
137
141
|
hold_refused: "Hub 拒絕了這次配對。", hold_revoked: "Hub 已撤銷這個 Fleet 的配對。", hold_other: "配對已暫停。",
|
|
138
142
|
sharedTitle: "公開的 Agent",
|
|
139
143
|
sharedLead: "每個 Agent 預設都不公開。只有能在受限、唯讀模式下執行的 Agent 才能公開。",
|
|
@@ -143,9 +147,9 @@ register("hub", {
|
|
|
143
147
|
waitingConfirm: "等待你的確認", pendingSent: "已送出確認:請在 General 的聊天或設定中確認,才會公開。",
|
|
144
148
|
errLimit: "最多只能公開 64 個 Agent。", notAvailable: "這個 AgEnD 版本無法使用此功能。",
|
|
145
149
|
hubStillNeeded: "還需要在 Hub 完成:", ownerStepHub: "你的確認:登入 Hub,在「我的公開 Agent」確認這個指紋。",
|
|
146
|
-
adminStepHub: "Hub
|
|
150
|
+
adminStepHub: "Hub 管理員核准這個指紋。", hubProgressHidden: "這個頁面看不到 Hub 那邊的進度,兩項都完成後就會連線。",
|
|
147
151
|
localMatch: "和 Hub 畫面上的一致", localConfirmed: "你已在這裡確認這個指紋。",
|
|
148
|
-
hold_disconnected: "已在這裡中斷連線。Hub
|
|
152
|
+
hold_disconnected: "已在這裡中斷連線。Hub 管理員撤銷之前,Hub 上仍會列出這個 Fleet。", startOver: "重新開始",
|
|
149
153
|
errConflict: "這份清單在其他分頁有變更,已重新載入,請再試一次。", errUnsaved: "無法儲存這個變更。",
|
|
150
154
|
errNotPaired: "請先連線到 Hub。", withdrawPending: "已在這裡撤回,連得上 Hub 時會再通知它。",
|
|
151
155
|
},
|
|
@@ -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-chat.js
CHANGED
|
@@ -563,7 +563,8 @@ function Thread({ name, label = name, th }) {
|
|
|
563
563
|
// Through the composer's own typing path (its onInput: the draft, the palette, the box's height), as a keystroke
|
|
564
564
|
// would — the store alone doesn't redraw the box. No composer on screen: the draft, for when it is.
|
|
565
565
|
if (field) {
|
|
566
|
-
Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set
|
|
566
|
+
const set = typeof HTMLTextAreaElement === "function" ? Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set : null;
|
|
567
|
+
if (set) set.call(field, r.value); else field.value = r.value;
|
|
567
568
|
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
568
569
|
} else store.setDraft(name, r.value);
|
|
569
570
|
const phone = typeof matchMedia === "function" && matchMedia("(pointer: coarse)").matches;
|
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
|
@@ -17,6 +17,8 @@ import { CliPicker, cliLabel as productLabel } from "./cli-picker.js";
|
|
|
17
17
|
import { useWindowsCliCatalog, WindowsCliDiscoveryStatus, detectionText } from "./windows-cli-catalog.js";
|
|
18
18
|
import { useRuntimeCatalog } from "./runtime-catalog.js";
|
|
19
19
|
import { ClaudeAccountSelect } from "./credential-profile-select.js";
|
|
20
|
+
import { AccountSelect } from "./accounts-view.js"; // the same Account field as the agent dialog (a new module: never a stale named import)
|
|
21
|
+
import { capsOf } from "./cli-caps.js";
|
|
20
22
|
import { chatPath, fleetPath, FLEET_TABS, rememberFleetTab } from "/assets/app-route.js";
|
|
21
23
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
22
24
|
import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
@@ -65,7 +67,7 @@ register("fleet", {
|
|
|
65
67
|
backend: "Backend",
|
|
66
68
|
newInstance: "New instance", directory: "Directory", directoryHint: "Optional — a workspace is created if empty", topic: "Name", topicHint: "From the directory name",
|
|
67
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",
|
|
68
|
-
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”)",
|
|
69
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",
|
|
70
72
|
},
|
|
71
73
|
"zh-TW": {
|
|
@@ -92,7 +94,7 @@ register("fleet", {
|
|
|
92
94
|
backend: "Backend",
|
|
93
95
|
newInstance: "新增 Agent", directory: "目錄", directoryHint: "可留空——留空會自動建立工作區", topic: "名稱", topicHint: "預設取自目錄名稱",
|
|
94
96
|
topicRequired: "目錄留空時必須填寫名稱", description: "說明", descriptionHint: "這個 Agent 做什麼", model: "模型", modelHint: "例如 sonnet、opus、gpt-5",
|
|
95
|
-
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」)",
|
|
96
98
|
fleetDefault: "使用 fleet 預設", notInstalled: "(未安裝)", notSignedIn: "(未登入,請用 /login)", tooOld: "(需要 {0} 以上版本)", unchecked: "(尚未檢查)", deprecated: "(已淘汰)", instanceCreated: "Agent 已建立",
|
|
97
99
|
},
|
|
98
100
|
});
|
|
@@ -544,6 +546,9 @@ export function CreateInstanceDialog({ onClose }) {
|
|
|
544
546
|
};
|
|
545
547
|
const [sandbox,setSandbox] = useState("read-only");
|
|
546
548
|
const nativeCli = native?.clis?.find(cli => cli.id === f.backend);
|
|
549
|
+
// This host (WSL / Linux): the account the new agent starts under, for a CLI with named accounts — the same field as the Agent dialog's.
|
|
550
|
+
const hostBackend = f.backend || defaultBackend;
|
|
551
|
+
const hostAccount = !!runtime && !windows && !!capsOf(hostBackend)?.namedAccounts;
|
|
547
552
|
const nativeChoices = (native?.clis || []).filter(cli => cli.path && cli.supports?.execution !== false && cli.supports?.resume !== false).map(cli => ({value:cli.id,label:productLabel(cli.id),disabled:!cli.runnable,description:cli.authenticated === false ? t("fleet.notSignedIn") : cli.version || "Windows"}));
|
|
548
553
|
useEffect(() => {
|
|
549
554
|
if(nativeAdapter==="pane"&&!['codex','claude-code'].includes(f.backend))setNativeAdapter("exec");
|
|
@@ -569,6 +574,7 @@ export function CreateInstanceDialog({ onClose }) {
|
|
|
569
574
|
if (f.branch.trim()) body.branch = f.branch.trim();
|
|
570
575
|
const tags = f.tags.split(",").map(x => x.trim()).filter(Boolean); if (tags.length) body.tags = tags;
|
|
571
576
|
if (f.prompt.trim()) body.systemPrompt = f.prompt.trim();
|
|
577
|
+
if (hostAccount && credentialProfile) body.credentialProfile = credentialProfile;
|
|
572
578
|
return body;
|
|
573
579
|
} };
|
|
574
580
|
const canNext = !!runtime && (!machineId || machine?.status === "online") && (windows ? nativeCli?.runnable === true : backends !== null);
|
|
@@ -584,7 +590,7 @@ export function CreateInstanceDialog({ onClose }) {
|
|
|
584
590
|
${machineId ? html`<p class="note">${tr(!nativeChoices.length ? "noRemoteCli" : "remotePolicy")}</p>${machine?.inventoryUpdatedAt ? html`<p class="note">${t("runtime.inventoryAt",new Date(machine.inventoryUpdatedAt).toLocaleString())}</p>` : null}` : html`<${WindowsCliDiscoveryStatus} state=${discovery} />`}
|
|
585
591
|
${!machineId && native && !discovery.loading && !discovery.error ? html`<p class="note">${!nativeChoices.length ? tr("noCli") : tr("nativeHint")}</p>` : null}
|
|
586
592
|
${machineId ? html`<${ClaudeAccountSelect} id="native-create-claude-account" machine=${machine} backend=${f.backend} value=${credentialProfile} onChange=${setCredentialProfile} disabled=${machine?.status !== "online"} />` : null}</div>`
|
|
587
|
-
: field(tr("backend"),backends ? html`<${CliPicker} label=${tr("backend")} value=${f.backend} choices=${[{value:"",label:t("fleet.fleetDefault")},...backends.filter(b => backendState(b) !== "not_installed" && !b.deprecated).map(b => ({value:b.name,label:productLabel(b.name),disabled:backendBlocked(b),description:backendNote(b)}))]} onChange=${value => setF(x => ({...x,backend:value,model:""}))} />` : html`<div role="status" aria-busy="true"><${Skeleton} lines=${1} /><span class="note">${tr("loadingClis")}</span></div>`)
|
|
593
|
+
: html`${field(tr("backend"),backends ? html`<${CliPicker} label=${tr("backend")} value=${f.backend} choices=${[{value:"",label:t("fleet.fleetDefault")},...backends.filter(b => backendState(b) !== "not_installed" && !b.deprecated).map(b => ({value:b.name,label:productLabel(b.name),disabled:backendBlocked(b),description:backendNote(b)}))]} onChange=${value => { setCredentialProfile(""); setF(x => ({...x,backend:value,model:""})); }} />` : html`<div role="status" aria-busy="true"><${Skeleton} lines=${1} /><span class="note">${tr("loadingClis")}</span></div>`)}${hostAccount ? html`<${AccountSelect} id="create-host-account" backend=${hostBackend} value=${credentialProfile} onChange=${setCredentialProfile} creating=${true} />` : null}`;
|
|
588
594
|
const actions = ({busy,go}) => step === 3 ? html`<button type="button" class="btn" onClick=${onClose}>${tr("finish")}</button><button type="button" class="btn btn-primary" onClick=${() => { onClose(); navigate(destination || "/settings/agents"); }}>${tr(destination ? "openChat" : "viewAgents")}<${Icon} name="forward" size=${16} /></button>`
|
|
589
595
|
: html`<button type="button" class="btn" disabled=${busy || assistBusy} onClick=${step === 1 ? onClose : () => setStep(1)}>${step === 1 ? t("fleet.cancel") : tr("back")}</button>
|
|
590
596
|
<button type="button" class="btn btn-primary" disabled=${busy || (step === 1 ? !canNext : !canCreate)} onClick=${step === 1 ? advance : go}>${step === 1 ? tr("next") : busy ? t("fleet.creating") : t("fleet.create")}${step === 1 ? html`<${Icon} name="forward" size=${16} />` : null}</button>`;
|
|
@@ -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,6 +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";
|
|
66
|
+
import { AccessOverview, accessOverviewLabel } from "./settings-access-overview.js";
|
|
65
67
|
import { HubSection, hubSectionText } from "./settings-hub-section.js";
|
|
66
68
|
import { NamedLinkTest, setTypedTunnelToken } from "./settings-named-test.js";
|
|
67
69
|
import { SignInList } from "./backend-signin.js";
|
|
@@ -101,7 +103,7 @@ async function read(lease, path) {
|
|
|
101
103
|
|
|
102
104
|
let loads = 0;
|
|
103
105
|
/** Everything the panel shows, in the order the old page read it. Returns null if the lease ended meanwhile. */
|
|
104
|
-
async function loadAll(lease) {
|
|
106
|
+
export async function loadAll(lease) {
|
|
105
107
|
const out = { schema: DEFAULT_SCHEMA };
|
|
106
108
|
const schema = await read(lease, "/api/settings/schema");
|
|
107
109
|
if (!lease.current()) return null;
|
|
@@ -344,7 +346,7 @@ export function SettingsPanel({ route, navKey }) {
|
|
|
344
346
|
// A panel that went while a question was open asks nothing more, and says nothing.
|
|
345
347
|
for (const c of [...stagedRef.current.values()]) {
|
|
346
348
|
for (const k of c.confirms || []) {
|
|
347
|
-
const yes = await ask(tn(k));
|
|
349
|
+
const yes = await ask(k.includes(".") ? t(k) : tn(k));
|
|
348
350
|
if (!mount.current()) return;
|
|
349
351
|
if (!yes) { toast(tn("accessChangeCancelled"), false); return; }
|
|
350
352
|
}
|
|
@@ -516,7 +518,7 @@ export function SettingsPanel({ route, navKey }) {
|
|
|
516
518
|
</${PanelHeader}>
|
|
517
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}`}>
|
|
518
520
|
<span class="s-nav-head" id=${`s-grp-${g.id}`}>${tn(`grp_${g.id}`)}</span>
|
|
519
|
-
${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}`)}
|
|
520
522
|
aria-current=${k === section ? "page" : undefined}><${Icon} name=${ICONS[k]} size=${16} /><span>${tn(`sec_${k}`)}</span></a>`)}</div>`)}</div></nav>
|
|
521
523
|
<div data-trust="panel-content" class="panel-body"><div class="col" data-settings-section=${section}>
|
|
522
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>
|
|
@@ -738,7 +740,7 @@ export function ProfileCard({ embedded = false } = {}) {
|
|
|
738
740
|
}
|
|
739
741
|
|
|
740
742
|
/** The operation in hand still owns Apply: its writes and job, or a restart of AgEnD from the press to its end. */
|
|
741
|
-
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");
|
|
742
744
|
function dropSecrets(staged) { for (const c of staged.values()) if (c.connectionSecret) c.connectionSecret.secret = ""; }
|
|
743
745
|
|
|
744
746
|
function renderDialog(d, ctx, close) {
|
|
@@ -752,7 +754,7 @@ function renderDialog(d, ctx, close) {
|
|
|
752
754
|
}
|
|
753
755
|
|
|
754
756
|
/** What the sections and dialogs work with: the data, and the ways to change it (staging, or a direct write). */
|
|
755
|
-
function makeCtx(data, setData, stage, unstage, reload, reloadLive, alive, extra = {}) {
|
|
757
|
+
export function makeCtx(data, setData, stage, unstage, reload, reloadLive, alive, extra = {}) {
|
|
756
758
|
const { fleet, classic, schema } = data;
|
|
757
759
|
const chs = channelsOf(fleet);
|
|
758
760
|
const edit = (fn) => setData((d) => { const next = structuredClone(d); fn(next); return next; });
|
|
@@ -776,6 +778,8 @@ function makeCtx(data, setData, stage, unstage, reload, reloadLive, alive, extra
|
|
|
776
778
|
});
|
|
777
779
|
stage(`agent:${name}`, {
|
|
778
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"] } : {}),
|
|
779
783
|
impact: inst.runtime === "windows" ? "now" : batchImpact(schema, Object.keys(patch), (k) => impactOf(schema, `instance.${k}`)),
|
|
780
784
|
request: { method: "PATCH", url: inst.runtime === "windows" ? `/ui/instances/${encodeURIComponent(name)}` : `/api/settings/fleet/instances/${encodeURIComponent(name)}`, body: patch },
|
|
781
785
|
});
|
|
@@ -1234,7 +1238,7 @@ export function uploadMbInEffect(web) {
|
|
|
1234
1238
|
}
|
|
1235
1239
|
function WebSection({ ctx, staged, part = "all" }) {
|
|
1236
1240
|
const { schema } = ctx;
|
|
1237
|
-
const [accessTab, setAccessTab] = useSettingsTabs("access", "
|
|
1241
|
+
const [accessTab, setAccessTab] = useSettingsTabs("access", "overview");
|
|
1238
1242
|
const web = ctx.fleet.web || {}, local = (web.session && web.session.local) || {}, term = ctx.fleet.web_terminal || {};
|
|
1239
1243
|
// Over the public link the fields read only; the Guests and Web authority cards are not offered (the server never
|
|
1240
1244
|
// serves their reads there).
|
|
@@ -1373,6 +1377,7 @@ function WebSection({ ctx, staged, part = "all" }) {
|
|
|
1373
1377
|
const has = (p) => part === "all" || part === p;
|
|
1374
1378
|
const lock = (body) => html`<fieldset class="s-web-fields" disabled=${overPublicLink}>${body}</fieldset>`;
|
|
1375
1379
|
const tabs = [
|
|
1380
|
+
{ id: "overview", label: accessOverviewLabel() },
|
|
1376
1381
|
{ id: "login", label: layoutText("accessLogin") },
|
|
1377
1382
|
{ id: "guests", label: layoutText("accessGuests") },
|
|
1378
1383
|
{ id: "sharing", label: layoutText("accessSharing") },
|
|
@@ -1389,6 +1394,10 @@ function WebSection({ ctx, staged, part = "all" }) {
|
|
|
1389
1394
|
${overPublicLink && part !== "readonly" ? html`<p class="note s-access-notice" role="status" id="webPublicRefused">${tn("webPublicRefused")}</p>` : null}
|
|
1390
1395
|
${has("access") ? html`<${SettingsTabs} id="access" value=${accessTab} onChange=${setAccessTab} items=${tabs} />
|
|
1391
1396
|
<div class="s-access-banner"><${Icon} name="info" size=${18} /><p>${layoutText("revAccessPolicy")}</p><details class="s-access-policy"><summary>${layoutText("revDetails")}</summary><p class="note">${tn("webLead")}</p></details></div>
|
|
1397
|
+
<${SettingsTabPanel} group="access" id="overview" active=${accessTab === "overview"}>
|
|
1398
|
+
<${AccessOverview} web=${web} hub=${!!ctx.fleet.hub?.hubId} overPublicLink=${overPublicLink} active=${accessTab === "overview"}
|
|
1399
|
+
openTab=${(tab, anchor) => { setAccessTab(tab); if (anchor) setTimeout(() => globalThis.document?.getElementById(anchor)?.scrollIntoView({ block: "start" }), 50); }} />
|
|
1400
|
+
</${SettingsTabPanel}>
|
|
1392
1401
|
<${SettingsTabPanel} group="access" id="login" active=${accessTab === "login"}>
|
|
1393
1402
|
<div class="s-access-login-layout"><div class="s-access-stack">
|
|
1394
1403
|
${/* #3008: a web-only fleet's connections from outside — changed on this computer only, shown (read-only) elsewhere. */ ""}
|
|
@@ -1547,7 +1556,7 @@ function Developer({ ctx }) {
|
|
|
1547
1556
|
* #2347: the section's Save. Shown while anything is unsaved: how many changes, what they will cost, Discard and Save —
|
|
1548
1557
|
* Save waits while a field is invalid ("Fix 1 field to save").
|
|
1549
1558
|
*/
|
|
1550
|
-
function PendingBar({ staged, busy, onApply, onDiscard, section }) {
|
|
1559
|
+
export function PendingBar({ staged, busy, onApply, onDiscard, section }) {
|
|
1551
1560
|
const changes = [...staged.values()];
|
|
1552
1561
|
// What Save will cost, one line each: a change that knows its own words (the shared agent settings: how many agents
|
|
1553
1562
|
// restart) says them; any other says its impact label.
|
|
@@ -1574,7 +1583,7 @@ function PendingBar({ staged, busy, onApply, onDiscard, section }) {
|
|
|
1574
1583
|
}
|
|
1575
1584
|
|
|
1576
1585
|
/** The Apply in hand (the app's, settings-apply.js): its writes, its job, and a restart when one is needed. */
|
|
1577
|
-
function OperationCard({ op, schema }) {
|
|
1586
|
+
export function OperationCard({ op, schema }) {
|
|
1578
1587
|
const [restarting, setRestarting] = useState(false);
|
|
1579
1588
|
const busy = opBusy(op); // nothing to dismiss while it, or its restart, runs
|
|
1580
1589
|
const phaseBusy = ["writing", "posting", "watching"].includes(op.phase);
|