@exagone313/dsh-podman 1.5.0 → 1.6.0

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.
@@ -29,7 +29,7 @@ __export(index_exports, {
29
29
  name: () => name
30
30
  });
31
31
  module.exports = __toCommonJS(index_exports);
32
- var import_dsh_client_ui_primitives24 = require("@deepseek-ai/dsh-client-ui-primitives");
32
+ var import_dsh_client_ui_primitives26 = require("@deepseek-ai/dsh-client-ui-primitives");
33
33
 
34
34
  // src/client/directory-picker.ts
35
35
  var DirectoryPickerError = class extends Error {
@@ -6065,8 +6065,8 @@ function ContainerRow(props) {
6065
6065
  )
6066
6066
  )) }),
6067
6067
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FieldGroup, { label: t("pathsTitle"), children: container.paths.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(NoEntries, { t }) : container.paths.map((path, index) => (
6068
- // A PATH list carries no id and duplicates are legal, so the
6069
- // positional index is the only collision-free key here.
6068
+ // A PATH list carries no id and duplicates are legal, so
6069
+ // the positional index is the only collision-free key here.
6070
6070
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PathRow, { t, mode: "view", path }, index)
6071
6071
  )) }),
6072
6072
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FieldGroup, { label: t("containerSecretsTitle"), children: secretEnvEntries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(NoEntries, { t }) : secretEnvEntries.map(([name2, value]) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
@@ -6186,7 +6186,8 @@ function WorkspaceSection(props) {
6186
6186
  onCreateSecret,
6187
6187
  onStartContainer,
6188
6188
  onApplyContainerConfig,
6189
- gatewayUnavailable
6189
+ gatewayUnavailable,
6190
+ extraAction
6190
6191
  } = props;
6191
6192
  const [createOpen, setCreateOpen] = (0, import_react16.useState)(
6192
6193
  null
@@ -6279,7 +6280,8 @@ function WorkspaceSection(props) {
6279
6280
  },
6280
6281
  children: removeWorkspacePending ? t("busy") : t("removeWorkspace")
6281
6282
  }
6282
- ) : null
6283
+ ) : null,
6284
+ extraAction
6283
6285
  ] })
6284
6286
  ] }),
6285
6287
  hasContainer ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: TABLE_CARD_CONTENT_CLASS, style: cardContent, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: cardList, children: containers.map((container, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
@@ -6818,6 +6820,381 @@ function ContainerCardToast(props) {
6818
6820
  );
6819
6821
  }
6820
6822
 
6823
+ // src/client/podman-containers.tsx
6824
+ var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
6825
+ var import_react18 = require("react");
6826
+
6827
+ // src/client/container-panel-scope.ts
6828
+ function containersInWorkspace(containers, target) {
6829
+ if (target === void 0 || target.workspaceSlug === "") return [];
6830
+ const workspaceSlug = target.workspaceSlug;
6831
+ return containers.filter(
6832
+ (container) => container.workspaceSlug === workspaceSlug && // Defensive: a row without a workspace belongs to no scope, and the
6833
+ // shared PTC container belongs to none by definition.
6834
+ container.workspaceSlug !== "" && container.containerName !== "" && container.containerName !== PTC_CONTAINER_NAME
6835
+ ).sort(byDefaultThenName);
6836
+ }
6837
+ function byDefaultThenName(left, right) {
6838
+ const leftDefault = left.containerName === "default";
6839
+ const rightDefault = right.containerName === "default";
6840
+ if (leftDefault !== rightDefault) return leftDefault ? -1 : 1;
6841
+ return left.containerName.localeCompare(right.containerName);
6842
+ }
6843
+
6844
+ // src/client/plugin-navigation.ts
6845
+ var PLUGIN_PACKAGE = "@exagone313/dsh-podman";
6846
+ var navigation;
6847
+ var listeners = /* @__PURE__ */ new Set();
6848
+ function setPluginNavigation(service) {
6849
+ if (navigation === service) return;
6850
+ navigation = service;
6851
+ for (const listener of listeners) listener();
6852
+ }
6853
+ function pluginSettingsAvailable() {
6854
+ return navigation !== void 0;
6855
+ }
6856
+ function subscribePluginSettings(listener) {
6857
+ listeners.add(listener);
6858
+ return () => {
6859
+ listeners.delete(listener);
6860
+ };
6861
+ }
6862
+ function openPluginSettings() {
6863
+ navigation?.openBundle(PLUGIN_PACKAGE);
6864
+ }
6865
+
6866
+ // src/client/podman-containers-styles.ts
6867
+ var CONTAINERS_PANEL_CLASS = "dsh-podman-containers-panel";
6868
+ var CONTAINERS_PANEL_STYLES = `
6869
+ .${CONTAINERS_PANEL_CLASS} > .${TABLE_CARD_CLASS} {
6870
+ border: 0 !important;
6871
+ }
6872
+ `;
6873
+ function installContainersPanelStyles(ctx) {
6874
+ if (typeof document === "undefined") return;
6875
+ ctx.effect(() => {
6876
+ const tag = document.createElement("style");
6877
+ tag.dataset.plugin = "@exagone313/dsh-podman";
6878
+ tag.textContent = CONTAINERS_PANEL_STYLES;
6879
+ document.head.appendChild(tag);
6880
+ return () => {
6881
+ tag.remove();
6882
+ };
6883
+ }, "podman: containers panel styles");
6884
+ }
6885
+
6886
+ // src/client/terminal-protocol.ts
6887
+ var TERMINAL_PATH = "/api/podman/terminal";
6888
+ var TERMINAL_SHELLS_PATH = "/api/podman/terminal/shells";
6889
+ var TERMINAL_TARGET_PATH = "/api/podman/terminal/target";
6890
+
6891
+ // src/client/terminal-transport.ts
6892
+ async function failure(response) {
6893
+ try {
6894
+ const body = await response.json();
6895
+ if (typeof body.error === "string" && body.error !== "") {
6896
+ return new Error(body.error);
6897
+ }
6898
+ } catch {
6899
+ }
6900
+ return new Error(`terminal request failed (${response.status})`);
6901
+ }
6902
+ function endpoint(path) {
6903
+ return new URL(path, globalThis.location.origin);
6904
+ }
6905
+ function trimmed(value) {
6906
+ return typeof value === "string" ? value : "";
6907
+ }
6908
+ async function openTerminalStream(query, onFrame, signal) {
6909
+ const url = endpoint(TERMINAL_PATH);
6910
+ url.searchParams.set("sessionId", query.sessionId);
6911
+ url.searchParams.set("tabId", query.tabId);
6912
+ url.searchParams.set("workspace", query.workspace);
6913
+ url.searchParams.set("container", query.container);
6914
+ url.searchParams.set("shell", query.shell);
6915
+ url.searchParams.set("cols", String(query.cols));
6916
+ url.searchParams.set("rows", String(query.rows));
6917
+ if (query.reopen === true) url.searchParams.set("reopen", "1");
6918
+ const response = await fetch(url, {
6919
+ headers: { accept: "application/x-ndjson" },
6920
+ signal
6921
+ });
6922
+ if (!response.ok) throw await failure(response);
6923
+ if (response.body === null) throw new Error("terminal stream has no body");
6924
+ const reader = response.body.getReader();
6925
+ const decoder = new TextDecoder();
6926
+ let buffered = "";
6927
+ const emit2 = (line) => {
6928
+ const text = line.trim();
6929
+ if (text === "") return;
6930
+ onFrame(JSON.parse(text));
6931
+ };
6932
+ for (; ; ) {
6933
+ const { done, value } = await reader.read();
6934
+ if (done) break;
6935
+ buffered += decoder.decode(value, { stream: true });
6936
+ let newline = buffered.indexOf("\n");
6937
+ while (newline !== -1) {
6938
+ emit2(buffered.slice(0, newline));
6939
+ buffered = buffered.slice(newline + 1);
6940
+ newline = buffered.indexOf("\n");
6941
+ }
6942
+ }
6943
+ buffered += decoder.decode();
6944
+ if (buffered !== "") emit2(buffered);
6945
+ }
6946
+ async function sendTerminalControl(control) {
6947
+ const response = await fetch(endpoint(TERMINAL_PATH), {
6948
+ method: "POST",
6949
+ headers: {
6950
+ accept: "application/json",
6951
+ "content-type": "application/json"
6952
+ },
6953
+ body: JSON.stringify(control)
6954
+ });
6955
+ if (!response.ok) throw await failure(response);
6956
+ }
6957
+ async function fetchTerminalShells(workspace, container, sessionId, signal) {
6958
+ const url = endpoint(TERMINAL_SHELLS_PATH);
6959
+ url.searchParams.set("workspace", workspace);
6960
+ url.searchParams.set("container", container);
6961
+ url.searchParams.set("sessionId", sessionId);
6962
+ const response = await fetch(url, {
6963
+ headers: { accept: "application/json" },
6964
+ signal
6965
+ });
6966
+ if (!response.ok) throw await failure(response);
6967
+ const body = await response.json();
6968
+ if (!Array.isArray(body.shells)) return [];
6969
+ return body.shells.map((shell) => ({
6970
+ name: trimmed(shell.name),
6971
+ path: trimmed(shell.path)
6972
+ }));
6973
+ }
6974
+ async function fetchTerminalTarget(sessionId, signal) {
6975
+ const url = endpoint(TERMINAL_TARGET_PATH);
6976
+ url.searchParams.set("sessionId", sessionId);
6977
+ const response = await fetch(url, {
6978
+ headers: { accept: "application/json" },
6979
+ signal
6980
+ });
6981
+ if (!response.ok) throw await failure(response);
6982
+ const body = await response.json();
6983
+ return {
6984
+ workspace: trimmed(body.workspace),
6985
+ workspaceSlug: trimmed(body.workspaceSlug)
6986
+ };
6987
+ }
6988
+ function bytesToBase64(bytes) {
6989
+ let binary = "";
6990
+ for (let index = 0; index < bytes.length; index++) {
6991
+ binary += String.fromCharCode(bytes[index]);
6992
+ }
6993
+ return btoa(binary);
6994
+ }
6995
+ function base64ToBytes(data) {
6996
+ const binary = atob(data);
6997
+ const bytes = new Uint8Array(binary.length);
6998
+ for (let index = 0; index < binary.length; index++) {
6999
+ bytes[index] = binary.charCodeAt(index);
7000
+ }
7001
+ return bytes;
7002
+ }
7003
+
7004
+ // src/client/podman-containers.tsx
7005
+ var import_jsx_runtime23 = require("react/jsx-runtime");
7006
+ function PodmanContainers(props) {
7007
+ const { t, sessionId } = props;
7008
+ const state = props.useContainerCard((snapshot) => snapshot);
7009
+ const settingsAvailable = (0, import_react18.useSyncExternalStore)(
7010
+ subscribePluginSettings,
7011
+ pluginSettingsAvailable
7012
+ );
7013
+ const [target, setTarget] = (0, import_react18.useState)({ phase: "loading" });
7014
+ const scope = target.phase === "ready" ? target.target : void 0;
7015
+ const listedWorkspace = scope === void 0 ? void 0 : state.workspaces.find(
7016
+ (entry) => entry.workspaceSlug === scope.workspaceSlug
7017
+ );
7018
+ const workspace = scope === void 0 || scope.workspaceSlug === "" ? void 0 : listedWorkspace ?? {
7019
+ workspaceSlug: scope.workspaceSlug,
7020
+ projectName: scope.workspace,
7021
+ containerName: "",
7022
+ imageId: "",
7023
+ status: "",
7024
+ createdAt: "",
7025
+ mounts: []
7026
+ };
7027
+ (0, import_react18.useEffect)(() => {
7028
+ props.reload();
7029
+ }, [props.reload]);
7030
+ (0, import_react18.useEffect)(() => {
7031
+ const controller = new AbortController();
7032
+ setTarget({ phase: "loading" });
7033
+ void fetchTerminalTarget(sessionId, controller.signal).then(
7034
+ (resolved) => {
7035
+ if (!controller.signal.aborted) {
7036
+ setTarget({ phase: "ready", target: resolved });
7037
+ }
7038
+ },
7039
+ (error) => {
7040
+ if (controller.signal.aborted) return;
7041
+ setTarget({
7042
+ phase: "failed",
7043
+ message: error instanceof Error ? error.message : String(error)
7044
+ });
7045
+ }
7046
+ );
7047
+ return () => {
7048
+ controller.abort();
7049
+ };
7050
+ }, [sessionId]);
7051
+ const containers = containersInWorkspace(state.containers, scope);
7052
+ const settingsAction = settingsAvailable ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7053
+ import_dsh_client_ui_primitives20.Button,
7054
+ {
7055
+ variant: "outline",
7056
+ size: "sm",
7057
+ onClick: openPluginSettings,
7058
+ children: t("moreSettings")
7059
+ }
7060
+ ) : void 0;
7061
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7062
+ "section",
7063
+ {
7064
+ className: CONTAINERS_PANEL_CLASS,
7065
+ style: PANE_STYLE,
7066
+ "data-dsh-podman-containers": true,
7067
+ children: state.loadState === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: hint, role: "status", children: t("loading") }) : !state.available ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: hint, role: "alert", children: t("unavailable") }) : target.phase === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: hint, role: "status", children: t("loading") }) : target.phase === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: hint, role: "alert", children: target.message }) : workspace === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: hint, role: "status", children: t("containersPanelNoWorkspace") }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7068
+ WorkspaceSection,
7069
+ {
7070
+ t,
7071
+ workspace,
7072
+ containers,
7073
+ images: state.images,
7074
+ volumes: state.volumes,
7075
+ secrets: state.secrets,
7076
+ busy: state.busy,
7077
+ writable: state.writable,
7078
+ locale: state.locale,
7079
+ pendingActions: state.pendingActions,
7080
+ defaultImage: state.defaultImage,
7081
+ defaultEnv: state.containerEnv,
7082
+ projectsRoot: state.projectsRoot,
7083
+ directoryPicker: state.directoryPicker,
7084
+ onRemove: props.remove,
7085
+ onRecreate: props.recreate,
7086
+ onRemoveWorkspace: props.removeWorkspace,
7087
+ onCreate: props.createContainer,
7088
+ onCreateSecret: props.createSecret,
7089
+ onStartContainer: props.startContainer,
7090
+ onApplyContainerConfig: props.applyContainerConfig,
7091
+ gatewayUnavailable: state.gatewayState === "absent" || state.gatewayState === "incompatible",
7092
+ extraAction: settingsAction
7093
+ }
7094
+ )
7095
+ }
7096
+ );
7097
+ }
7098
+ var PANE_STYLE = {
7099
+ boxSizing: "border-box",
7100
+ height: "100%",
7101
+ minHeight: 0,
7102
+ overflowY: "auto",
7103
+ padding: "10px",
7104
+ color: "var(--dsw-alias-label-primary)",
7105
+ background: "var(--dsw-alias-bg-layer-2)",
7106
+ fontSize: "13px"
7107
+ };
7108
+
7109
+ // src/client/podman-containers-guide.tsx
7110
+ var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
7111
+
7112
+ // src/client/containers-tab.ts
7113
+ var PODMAN_CONTAINERS_KIND = "podman-containers";
7114
+ var PODMAN_CONTAINERS_TAB_ID = "@exagone313/dsh-podman#containers";
7115
+ function resolveContainersOpen(navigator2, target) {
7116
+ const captured = navigator2.commandTarget(target);
7117
+ if (captured === void 0) return { status: "blocked" };
7118
+ return {
7119
+ status: "handled",
7120
+ run: () => {
7121
+ navigator2.openTabFromTarget(PODMAN_CONTAINERS_KIND, captured);
7122
+ }
7123
+ };
7124
+ }
7125
+
7126
+ // src/client/podman-containers-guide.tsx
7127
+ var import_jsx_runtime24 = require("react/jsx-runtime");
7128
+ function PodmanContainersGuide(props) {
7129
+ const { tab } = props.useTabInfo();
7130
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
7131
+ "button",
7132
+ {
7133
+ type: "button",
7134
+ style: CARD_STYLE,
7135
+ "data-sidebar-right-guide-entry": props.kind,
7136
+ onClick: () => {
7137
+ tab.actions.openTab(PODMAN_CONTAINERS_KIND, { replaceTab: true });
7138
+ },
7139
+ children: [
7140
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: ICON_STYLE, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives21.PluginArtworkDefault, { size: 22 }) }),
7141
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { style: TEXT_STYLE, children: [
7142
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: TITLE_STYLE, children: props.title }),
7143
+ props.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: DESCRIPTION_STYLE, children: props.description })
7144
+ ] })
7145
+ ]
7146
+ }
7147
+ );
7148
+ }
7149
+ var CARD_STYLE = {
7150
+ display: "flex",
7151
+ alignItems: "center",
7152
+ gap: "14px",
7153
+ boxSizing: "border-box",
7154
+ width: "100%",
7155
+ minHeight: "56px",
7156
+ padding: "14px 20px",
7157
+ color: "var(--dsw-alias-label-primary)",
7158
+ font: "inherit",
7159
+ textAlign: "left",
7160
+ cursor: "pointer",
7161
+ border: "0.5px solid var(--dsw-alias-border-l3)",
7162
+ borderRadius: "var(--dsl-guide-entry-radius)",
7163
+ background: "var(--dsw-alias-bg-layer-1)"
7164
+ };
7165
+ var ICON_STYLE = {
7166
+ display: "flex",
7167
+ flex: "none",
7168
+ alignItems: "center",
7169
+ justifyContent: "center",
7170
+ width: "26px",
7171
+ height: "26px",
7172
+ color: "var(--dsw-alias-label-secondary)"
7173
+ };
7174
+ var TEXT_STYLE = {
7175
+ display: "flex",
7176
+ flex: 1,
7177
+ flexDirection: "column",
7178
+ gap: "2px",
7179
+ minWidth: 0
7180
+ };
7181
+ var TITLE_STYLE = {
7182
+ overflow: "hidden",
7183
+ color: "var(--dsw-alias-label-primary)",
7184
+ fontSize: "14px",
7185
+ lineHeight: 1.4,
7186
+ whiteSpace: "nowrap",
7187
+ textOverflow: "ellipsis"
7188
+ };
7189
+ var DESCRIPTION_STYLE = {
7190
+ overflow: "hidden",
7191
+ color: "var(--dsw-alias-label-tertiary)",
7192
+ fontSize: "11px",
7193
+ lineHeight: 1.4,
7194
+ whiteSpace: "nowrap",
7195
+ textOverflow: "ellipsis"
7196
+ };
7197
+
6821
7198
  // node_modules/.pnpm/@xterm+addon-fit@0.11.0/node_modules/@xterm/addon-fit/lib/addon-fit.mjs
6822
7199
  var h = 2;
6823
7200
  var _ = 1;
@@ -16245,8 +16622,8 @@ var xterm_default = `/**
16245
16622
  `;
16246
16623
 
16247
16624
  // src/client/podman-terminal.tsx
16248
- var import_dsh_client_ui_primitives20 = require("@deepseek-ai/dsh-client-ui-primitives");
16249
- var import_react18 = require("react");
16625
+ var import_dsh_client_ui_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
16626
+ var import_react19 = require("react");
16250
16627
 
16251
16628
  // src/client/terminal-targets.ts
16252
16629
  function containerOptions(containers, workspaceSlug) {
@@ -16278,9 +16655,9 @@ function shellName(path) {
16278
16655
 
16279
16656
  // src/client/terminal-titles.ts
16280
16657
  var titles = /* @__PURE__ */ new Map();
16281
- var listeners = /* @__PURE__ */ new Set();
16658
+ var listeners2 = /* @__PURE__ */ new Set();
16282
16659
  function emit() {
16283
- for (const listener of listeners) listener();
16660
+ for (const listener of listeners2) listener();
16284
16661
  }
16285
16662
  function publishTerminalTitle(key, title) {
16286
16663
  if (title === "" || titles.get(key) === title) return;
@@ -16294,132 +16671,14 @@ function terminalTitle(key) {
16294
16671
  return titles.get(key);
16295
16672
  }
16296
16673
  function subscribeTerminalTitles(listener) {
16297
- listeners.add(listener);
16674
+ listeners2.add(listener);
16298
16675
  return () => {
16299
- listeners.delete(listener);
16676
+ listeners2.delete(listener);
16300
16677
  };
16301
16678
  }
16302
16679
 
16303
- // src/client/terminal-protocol.ts
16304
- var TERMINAL_PATH = "/api/podman/terminal";
16305
- var TERMINAL_SHELLS_PATH = "/api/podman/terminal/shells";
16306
- var TERMINAL_TARGET_PATH = "/api/podman/terminal/target";
16307
-
16308
- // src/client/terminal-transport.ts
16309
- async function failure(response) {
16310
- try {
16311
- const body = await response.json();
16312
- if (typeof body.error === "string" && body.error !== "") {
16313
- return new Error(body.error);
16314
- }
16315
- } catch {
16316
- }
16317
- return new Error(`terminal request failed (${response.status})`);
16318
- }
16319
- function endpoint(path) {
16320
- return new URL(path, globalThis.location.origin);
16321
- }
16322
- function trimmed(value) {
16323
- return typeof value === "string" ? value : "";
16324
- }
16325
- async function openTerminalStream(query, onFrame, signal) {
16326
- const url = endpoint(TERMINAL_PATH);
16327
- url.searchParams.set("sessionId", query.sessionId);
16328
- url.searchParams.set("tabId", query.tabId);
16329
- url.searchParams.set("workspace", query.workspace);
16330
- url.searchParams.set("container", query.container);
16331
- url.searchParams.set("shell", query.shell);
16332
- url.searchParams.set("cols", String(query.cols));
16333
- url.searchParams.set("rows", String(query.rows));
16334
- if (query.reopen === true) url.searchParams.set("reopen", "1");
16335
- const response = await fetch(url, {
16336
- headers: { accept: "application/x-ndjson" },
16337
- signal
16338
- });
16339
- if (!response.ok) throw await failure(response);
16340
- if (response.body === null) throw new Error("terminal stream has no body");
16341
- const reader = response.body.getReader();
16342
- const decoder = new TextDecoder();
16343
- let buffered = "";
16344
- const emit2 = (line) => {
16345
- const text = line.trim();
16346
- if (text === "") return;
16347
- onFrame(JSON.parse(text));
16348
- };
16349
- for (; ; ) {
16350
- const { done, value } = await reader.read();
16351
- if (done) break;
16352
- buffered += decoder.decode(value, { stream: true });
16353
- let newline = buffered.indexOf("\n");
16354
- while (newline !== -1) {
16355
- emit2(buffered.slice(0, newline));
16356
- buffered = buffered.slice(newline + 1);
16357
- newline = buffered.indexOf("\n");
16358
- }
16359
- }
16360
- buffered += decoder.decode();
16361
- if (buffered !== "") emit2(buffered);
16362
- }
16363
- async function sendTerminalControl(control) {
16364
- const response = await fetch(endpoint(TERMINAL_PATH), {
16365
- method: "POST",
16366
- headers: {
16367
- accept: "application/json",
16368
- "content-type": "application/json"
16369
- },
16370
- body: JSON.stringify(control)
16371
- });
16372
- if (!response.ok) throw await failure(response);
16373
- }
16374
- async function fetchTerminalShells(workspace, container, sessionId, signal) {
16375
- const url = endpoint(TERMINAL_SHELLS_PATH);
16376
- url.searchParams.set("workspace", workspace);
16377
- url.searchParams.set("container", container);
16378
- url.searchParams.set("sessionId", sessionId);
16379
- const response = await fetch(url, {
16380
- headers: { accept: "application/json" },
16381
- signal
16382
- });
16383
- if (!response.ok) throw await failure(response);
16384
- const body = await response.json();
16385
- if (!Array.isArray(body.shells)) return [];
16386
- return body.shells.map((shell) => ({
16387
- name: trimmed(shell.name),
16388
- path: trimmed(shell.path)
16389
- }));
16390
- }
16391
- async function fetchTerminalTarget(sessionId, signal) {
16392
- const url = endpoint(TERMINAL_TARGET_PATH);
16393
- url.searchParams.set("sessionId", sessionId);
16394
- const response = await fetch(url, {
16395
- headers: { accept: "application/json" },
16396
- signal
16397
- });
16398
- if (!response.ok) throw await failure(response);
16399
- const body = await response.json();
16400
- return {
16401
- workspace: trimmed(body.workspace),
16402
- workspaceSlug: trimmed(body.workspaceSlug)
16403
- };
16404
- }
16405
- function bytesToBase64(bytes) {
16406
- let binary = "";
16407
- for (let index = 0; index < bytes.length; index++) {
16408
- binary += String.fromCharCode(bytes[index]);
16409
- }
16410
- return btoa(binary);
16411
- }
16412
- function base64ToBytes(data) {
16413
- const binary = atob(data);
16414
- const bytes = new Uint8Array(binary.length);
16415
- for (let index = 0; index < binary.length; index++) {
16416
- bytes[index] = binary.charCodeAt(index);
16417
- }
16418
- return bytes;
16419
- }
16420
-
16421
16680
  // src/client/podman-terminal.tsx
16422
- var import_jsx_runtime23 = require("react/jsx-runtime");
16681
+ var import_jsx_runtime25 = require("react/jsx-runtime");
16423
16682
  var TEXT_ENCODER = new TextEncoder();
16424
16683
  var XTERM_STYLE_ATTRIBUTE = "data-dsh-podman-xterm";
16425
16684
  var XTERM_CLASS = "dsh-podman-xterm";
@@ -16458,9 +16717,9 @@ function readTerminalTheme() {
16458
16717
  };
16459
16718
  }
16460
16719
  function ContainerField(props) {
16461
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
16462
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: fieldLabel, children: props.label }),
16463
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
16720
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
16721
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { style: fieldLabel, children: props.label }),
16722
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
16464
16723
  "select",
16465
16724
  {
16466
16725
  style: props.selectStyle ?? imageSelect,
@@ -16471,8 +16730,8 @@ function ContainerField(props) {
16471
16730
  props.onContainer(event.target.value);
16472
16731
  },
16473
16732
  children: [
16474
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "", children: props.defaultLabel }),
16475
- containerOptions(props.containers, props.workspaceSlug).map((name2) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: name2, children: name2 }, name2))
16733
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: "", children: props.defaultLabel }),
16734
+ containerOptions(props.containers, props.workspaceSlug).map((name2) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: name2, children: name2 }, name2))
16476
16735
  ]
16477
16736
  }
16478
16737
  )
@@ -16484,28 +16743,28 @@ function PodmanTerminal(props) {
16484
16743
  const tabId = `${sessionId}:${info.tab.id}`;
16485
16744
  const state = props.useContainerCard((snapshot) => snapshot);
16486
16745
  const params = info.tab.navigation.params;
16487
- const [target, setTarget] = (0, import_react18.useState)({ phase: "loading" });
16746
+ const [target, setTarget] = (0, import_react19.useState)({ phase: "loading" });
16488
16747
  const workspace = target.phase === "ready" ? target.target.workspace : void 0;
16489
16748
  const workspaceSlug = target.phase === "ready" ? target.target.workspaceSlug : void 0;
16490
16749
  const unknownWorkspace = target.phase === "failed";
16491
- const [container, setContainer] = (0, import_react18.useState)(
16750
+ const [container, setContainer] = (0, import_react19.useState)(
16492
16751
  params?.container
16493
16752
  );
16494
- const [shell, setShell] = (0, import_react18.useState)(params?.shell);
16495
- const [shells, setShells] = (0, import_react18.useState)({ phase: "loading" });
16496
- const [status, setStatus] = (0, import_react18.useState)({ kind: "idle" });
16497
- const [title, setTitle] = (0, import_react18.useState)("");
16498
- const [attempt, setAttempt] = (0, import_react18.useState)(0);
16499
- const node = (0, import_react18.useRef)(null);
16500
- const terminal = (0, import_react18.useRef)();
16501
- const stream = (0, import_react18.useRef)();
16502
- const terminalId = (0, import_react18.useRef)();
16503
- const alive = (0, import_react18.useRef)(true);
16504
- const reopen = (0, import_react18.useRef)(false);
16505
- (0, import_react18.useEffect)(() => {
16753
+ const [shell, setShell] = (0, import_react19.useState)(params?.shell);
16754
+ const [shells, setShells] = (0, import_react19.useState)({ phase: "loading" });
16755
+ const [status, setStatus] = (0, import_react19.useState)({ kind: "idle" });
16756
+ const [title, setTitle] = (0, import_react19.useState)("");
16757
+ const [attempt, setAttempt] = (0, import_react19.useState)(0);
16758
+ const node = (0, import_react19.useRef)(null);
16759
+ const terminal = (0, import_react19.useRef)();
16760
+ const stream = (0, import_react19.useRef)();
16761
+ const terminalId = (0, import_react19.useRef)();
16762
+ const alive = (0, import_react19.useRef)(true);
16763
+ const reopen = (0, import_react19.useRef)(false);
16764
+ (0, import_react19.useEffect)(() => {
16506
16765
  props.reload();
16507
16766
  }, [props.reload]);
16508
- (0, import_react18.useEffect)(() => {
16767
+ (0, import_react19.useEffect)(() => {
16509
16768
  const controller = new AbortController();
16510
16769
  setTarget({ phase: "loading" });
16511
16770
  void fetchTerminalTarget(sessionId, controller.signal).then(
@@ -16526,11 +16785,11 @@ function PodmanTerminal(props) {
16526
16785
  controller.abort();
16527
16786
  };
16528
16787
  }, [sessionId]);
16529
- (0, import_react18.useEffect)(() => {
16788
+ (0, import_react19.useEffect)(() => {
16530
16789
  if (workspace === void 0 || container !== void 0) return;
16531
16790
  setContainer("");
16532
16791
  }, [workspace, container]);
16533
- (0, import_react18.useEffect)(() => {
16792
+ (0, import_react19.useEffect)(() => {
16534
16793
  if (workspace === void 0 || workspace === "" || container === void 0) {
16535
16794
  return;
16536
16795
  }
@@ -16559,7 +16818,7 @@ function PodmanTerminal(props) {
16559
16818
  controller.abort();
16560
16819
  };
16561
16820
  }, [workspace, container, sessionId]);
16562
- (0, import_react18.useLayoutEffect)(() => {
16821
+ (0, import_react19.useLayoutEffect)(() => {
16563
16822
  const element = node.current;
16564
16823
  if (element === null) return;
16565
16824
  alive.current = true;
@@ -16613,7 +16872,7 @@ function PodmanTerminal(props) {
16613
16872
  terminal.current = void 0;
16614
16873
  };
16615
16874
  }, []);
16616
- (0, import_react18.useEffect)(() => {
16875
+ (0, import_react19.useEffect)(() => {
16617
16876
  const term = terminal.current;
16618
16877
  if (term === void 0) return;
16619
16878
  if (workspace === void 0 || workspace === "" || container === void 0 || shell === void 0 || shell === "") {
@@ -16695,7 +16954,7 @@ function PodmanTerminal(props) {
16695
16954
  }
16696
16955
  };
16697
16956
  }, [sessionId, tabId, workspace, container, shell, attempt]);
16698
- (0, import_react18.useEffect)(() => {
16957
+ (0, import_react19.useEffect)(() => {
16699
16958
  if (info.tab.visible) terminal.current?.focus();
16700
16959
  }, [info.tab.visible]);
16701
16960
  const canConnect = workspace !== void 0 && workspace !== "" && shell !== void 0 && shell !== "";
@@ -16740,9 +16999,9 @@ function PodmanTerminal(props) {
16740
16999
  }
16741
17000
  const idle = status.kind === "idle";
16742
17001
  const ended = status.kind === "exited" || status.kind === "error";
16743
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("section", { style: ROOT_STYLE, "data-dsh-podman-terminal": true, children: [
16744
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: TOOLBAR_STYLE, children: [
16745
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
17002
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("section", { style: ROOT_STYLE, "data-dsh-podman-terminal": true, children: [
17003
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { style: TOOLBAR_STYLE, children: [
17004
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16746
17005
  ContainerField,
16747
17006
  {
16748
17007
  containers: state.containers,
@@ -16757,8 +17016,8 @@ function PodmanTerminal(props) {
16757
17016
  }
16758
17017
  }
16759
17018
  ),
16760
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: fieldLabel, children: t("terminalShell") }),
16761
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
17019
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { style: fieldLabel, children: t("terminalShell") }),
17020
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16762
17021
  "select",
16763
17022
  {
16764
17023
  style: imageSelect,
@@ -16768,11 +17027,11 @@ function PodmanTerminal(props) {
16768
17027
  onChange: (event) => {
16769
17028
  setShell(event.target.value);
16770
17029
  },
16771
- children: shellList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: "", children: unknownWorkspace ? "" : shells.phase === "loading" ? t("terminalLoading") : t("terminalNoShells") }) : shellList.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("option", { value: entry.path, children: entry.name }, entry.path))
17030
+ children: shellList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: "", children: unknownWorkspace ? "" : shells.phase === "loading" ? t("terminalLoading") : t("terminalNoShells") }) : shellList.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: entry.path, children: entry.name }, entry.path))
16772
17031
  }
16773
17032
  ),
16774
- (idle || ended) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
16775
- import_dsh_client_ui_primitives20.Button,
17033
+ (idle || ended) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
17034
+ import_dsh_client_ui_primitives22.Button,
16776
17035
  {
16777
17036
  variant: "outline",
16778
17037
  size: "sm",
@@ -16783,13 +17042,13 @@ function PodmanTerminal(props) {
16783
17042
  children: idle ? t("terminalConnect") : t("terminalReconnect")
16784
17043
  }
16785
17044
  ),
16786
- statusLabel === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: STATUS_STYLE, role: "status", children: statusLabel }),
16787
- title === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { style: TITLE_STYLE, children: title })
17045
+ statusLabel === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { style: STATUS_STYLE, role: "status", children: statusLabel }),
17046
+ title === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { style: TITLE_STYLE2, children: title })
16788
17047
  ] }),
16789
- state.workspaces.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: ERROR_STYLE, role: "status", children: state.busy ? t("terminalLoading") : t("unavailable") }),
16790
- target.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: ERROR_STYLE, role: "alert", children: target.message }),
16791
- shells.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: ERROR_STYLE, role: "alert", children: t("terminalShellsFailed", { message: shells.message }) }),
16792
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { ref: node, className: XTERM_CLASS, style: SCREEN_STYLE })
17048
+ state.workspaces.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { style: ERROR_STYLE, role: "status", children: state.busy ? t("terminalLoading") : t("unavailable") }),
17049
+ target.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { style: ERROR_STYLE, role: "alert", children: target.message }),
17050
+ shells.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { style: ERROR_STYLE, role: "alert", children: t("terminalShellsFailed", { message: shells.message }) }),
17051
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref: node, className: XTERM_CLASS, style: SCREEN_STYLE })
16793
17052
  ] });
16794
17053
  }
16795
17054
  var ROOT_STYLE = {
@@ -16815,7 +17074,7 @@ var STATUS_STYLE = {
16815
17074
  fontSize: "12px",
16816
17075
  color: "var(--dsw-alias-label-tertiary)"
16817
17076
  };
16818
- var TITLE_STYLE = {
17077
+ var TITLE_STYLE2 = {
16819
17078
  flex: 1,
16820
17079
  minWidth: 0,
16821
17080
  overflow: "hidden",
@@ -16839,8 +17098,8 @@ var SCREEN_STYLE = {
16839
17098
  };
16840
17099
 
16841
17100
  // src/client/podman-terminal-guide.tsx
16842
- var import_dsh_client_ui_primitives21 = require("@deepseek-ai/dsh-client-ui-primitives");
16843
- var import_react19 = require("react");
17101
+ var import_dsh_client_ui_primitives23 = require("@deepseek-ai/dsh-client-ui-primitives");
17102
+ var import_react20 = require("react");
16844
17103
 
16845
17104
  // src/client/terminal-tab.ts
16846
17105
  var PODMAN_TERMINAL_KIND = "podman-terminal";
@@ -16901,23 +17160,23 @@ function writeTerminalTarget(target, storage) {
16901
17160
  }
16902
17161
 
16903
17162
  // src/client/podman-terminal-guide.tsx
16904
- var import_jsx_runtime24 = require("react/jsx-runtime");
17163
+ var import_jsx_runtime26 = require("react/jsx-runtime");
16905
17164
  function PodmanTerminalGuide(props) {
16906
17165
  const { t, sessionId } = props;
16907
17166
  const { tab } = props.useTabInfo();
16908
17167
  const state = props.useContainerCard((snapshot) => snapshot);
16909
- const [target, setTarget] = (0, import_react19.useState)({ phase: "loading" });
17168
+ const [target, setTarget] = (0, import_react20.useState)({ phase: "loading" });
16910
17169
  const workspace = target.phase === "ready" ? target.target.workspace : void 0;
16911
17170
  const workspaceSlug = target.phase === "ready" ? target.target.workspaceSlug : void 0;
16912
17171
  const unknownWorkspace = target.phase === "failed";
16913
- const [container, setContainer] = (0, import_react19.useState)(void 0);
16914
- const [shells, setShells] = (0, import_react19.useState)({ phase: "loading" });
16915
- const [shell, setShell] = (0, import_react19.useState)(void 0);
16916
- const [stored] = (0, import_react19.useState)(() => readTerminalTarget());
16917
- (0, import_react19.useEffect)(() => {
17172
+ const [container, setContainer] = (0, import_react20.useState)(void 0);
17173
+ const [shells, setShells] = (0, import_react20.useState)({ phase: "loading" });
17174
+ const [shell, setShell] = (0, import_react20.useState)(void 0);
17175
+ const [stored] = (0, import_react20.useState)(() => readTerminalTarget());
17176
+ (0, import_react20.useEffect)(() => {
16918
17177
  props.reload();
16919
17178
  }, [props.reload]);
16920
- (0, import_react19.useEffect)(() => {
17179
+ (0, import_react20.useEffect)(() => {
16921
17180
  const controller = new AbortController();
16922
17181
  setTarget({ phase: "loading" });
16923
17182
  void fetchTerminalTarget(sessionId, controller.signal).then(
@@ -16938,7 +17197,7 @@ function PodmanTerminalGuide(props) {
16938
17197
  controller.abort();
16939
17198
  };
16940
17199
  }, [sessionId]);
16941
- (0, import_react19.useEffect)(() => {
17200
+ (0, import_react20.useEffect)(() => {
16942
17201
  if (unknownWorkspace || workspace === void 0 || container !== void 0) {
16943
17202
  return;
16944
17203
  }
@@ -16958,7 +17217,7 @@ function PodmanTerminalGuide(props) {
16958
17217
  workspaceSlug,
16959
17218
  stored
16960
17219
  ]);
16961
- (0, import_react19.useEffect)(() => {
17220
+ (0, import_react20.useEffect)(() => {
16962
17221
  if (workspace === void 0 || workspace === "" || container === void 0) {
16963
17222
  return;
16964
17223
  }
@@ -16991,18 +17250,18 @@ function PodmanTerminalGuide(props) {
16991
17250
  }, [workspace, container, sessionId]);
16992
17251
  const shellList = shells.phase === "ready" ? shells.shells : [];
16993
17252
  const ready = !unknownWorkspace && container !== void 0 && shell !== void 0 && shellList.length > 0;
16994
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: CARD_STYLE, "data-sidebar-right-guide-entry": props.kind, children: [
16995
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: HEADER_STYLE, children: [
16996
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: ICON_STYLE, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_dsh_client_ui_primitives21.PluginArtworkTerminal, { size: 22 }) }),
16997
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { style: TEXT_STYLE, children: [
16998
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: TITLE_STYLE2, children: props.title }),
16999
- props.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: DESCRIPTION_STYLE, children: props.description })
17253
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: CARD_STYLE2, "data-sidebar-right-guide-entry": props.kind, children: [
17254
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: HEADER_STYLE, children: [
17255
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { style: ICON_STYLE2, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_dsh_client_ui_primitives23.PluginArtworkTerminal, { size: 22 }) }),
17256
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("span", { style: TEXT_STYLE2, children: [
17257
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { style: TITLE_STYLE3, children: props.title }),
17258
+ props.description === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { style: DESCRIPTION_STYLE2, children: props.description })
17000
17259
  ] })
17001
17260
  ] }),
17002
- state.workspaces.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: hint, role: "status", children: state.busy ? t("terminalLoading") : t("unavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
17003
- target.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: hint, role: "alert", children: target.message }),
17004
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: FIELDS_STYLE, children: [
17005
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
17261
+ state.workspaces.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { style: hint, role: "status", children: state.busy ? t("terminalLoading") : t("unavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
17262
+ target.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { style: hint, role: "alert", children: target.message }),
17263
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: FIELDS_STYLE, children: [
17264
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17006
17265
  ContainerField,
17007
17266
  {
17008
17267
  containers: state.containers,
@@ -17018,8 +17277,8 @@ function PodmanTerminalGuide(props) {
17018
17277
  }
17019
17278
  }
17020
17279
  ),
17021
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: fieldLabel, children: t("terminalShell") }),
17022
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
17280
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { style: fieldLabel, children: t("terminalShell") }),
17281
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17023
17282
  "select",
17024
17283
  {
17025
17284
  style: fieldSelect,
@@ -17029,15 +17288,15 @@ function PodmanTerminalGuide(props) {
17029
17288
  onChange: (event) => {
17030
17289
  setShell(event.target.value);
17031
17290
  },
17032
- children: shellList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: unknownWorkspace ? "" : shells.phase === "loading" ? t("terminalLoading") : t("terminalNoShells") }) : shellList.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: entry.path, children: entry.name }, entry.path))
17291
+ children: shellList.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "", children: unknownWorkspace ? "" : shells.phase === "loading" ? t("terminalLoading") : t("terminalNoShells") }) : shellList.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: entry.path, children: entry.name }, entry.path))
17033
17292
  }
17034
17293
  )
17035
17294
  ] }),
17036
- !unknownWorkspace && shells.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: hint, role: "alert", children: t("terminalShellsFailed", { message: shells.message }) }),
17037
- !unknownWorkspace && shells.phase === "loading" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: hint, role: "status", children: t("terminalLoading") }),
17038
- !unknownWorkspace && shells.phase === "ready" && shellList.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: hint, role: "status", children: t("terminalNoShells") }),
17039
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: ACTIONS_STYLE, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
17040
- import_dsh_client_ui_primitives21.Button,
17295
+ !unknownWorkspace && shells.phase === "failed" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { style: hint, role: "alert", children: t("terminalShellsFailed", { message: shells.message }) }),
17296
+ !unknownWorkspace && shells.phase === "loading" && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { style: hint, role: "status", children: t("terminalLoading") }),
17297
+ !unknownWorkspace && shells.phase === "ready" && shellList.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { style: hint, role: "status", children: t("terminalNoShells") }),
17298
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: ACTIONS_STYLE, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17299
+ import_dsh_client_ui_primitives23.Button,
17041
17300
  {
17042
17301
  variant: "primary",
17043
17302
  size: "sm",
@@ -17056,7 +17315,7 @@ function PodmanTerminalGuide(props) {
17056
17315
  ] })
17057
17316
  ] });
17058
17317
  }
17059
- var CARD_STYLE = {
17318
+ var CARD_STYLE2 = {
17060
17319
  display: "flex",
17061
17320
  flexDirection: "column",
17062
17321
  gap: "8px",
@@ -17073,7 +17332,7 @@ var HEADER_STYLE = {
17073
17332
  gap: "14px",
17074
17333
  minWidth: 0
17075
17334
  };
17076
- var ICON_STYLE = {
17335
+ var ICON_STYLE2 = {
17077
17336
  display: "flex",
17078
17337
  flex: "none",
17079
17338
  alignItems: "center",
@@ -17082,14 +17341,14 @@ var ICON_STYLE = {
17082
17341
  height: "26px",
17083
17342
  color: "var(--dsw-alias-label-secondary)"
17084
17343
  };
17085
- var TEXT_STYLE = {
17344
+ var TEXT_STYLE2 = {
17086
17345
  display: "flex",
17087
17346
  flex: 1,
17088
17347
  flexDirection: "column",
17089
17348
  gap: "2px",
17090
17349
  minWidth: 0
17091
17350
  };
17092
- var TITLE_STYLE2 = {
17351
+ var TITLE_STYLE3 = {
17093
17352
  overflow: "hidden",
17094
17353
  color: "var(--dsw-alias-label-primary)",
17095
17354
  fontSize: "14px",
@@ -17097,7 +17356,7 @@ var TITLE_STYLE2 = {
17097
17356
  whiteSpace: "nowrap",
17098
17357
  textOverflow: "ellipsis"
17099
17358
  };
17100
- var DESCRIPTION_STYLE = {
17359
+ var DESCRIPTION_STYLE2 = {
17101
17360
  overflow: "hidden",
17102
17361
  color: "var(--dsw-alias-label-tertiary)",
17103
17362
  fontSize: "11px",
@@ -17122,24 +17381,24 @@ var ACTIONS_STYLE = {
17122
17381
  };
17123
17382
 
17124
17383
  // src/client/podman-terminal-title.tsx
17125
- var import_react20 = require("react");
17126
- var import_jsx_runtime25 = require("react/jsx-runtime");
17384
+ var import_react21 = require("react");
17385
+ var import_jsx_runtime27 = require("react/jsx-runtime");
17127
17386
  function PodmanTerminalTitle(props) {
17128
17387
  const { tab } = props.useTabInfo();
17129
17388
  const params = tab.navigation.params;
17130
17389
  const key = `${props.sessionId}:${tab.id}`;
17131
17390
  const fallback = shellName(params?.shell) ?? tab.title;
17132
- const title = (0, import_react20.useSyncExternalStore)(
17391
+ const title = (0, import_react21.useSyncExternalStore)(
17133
17392
  subscribeTerminalTitles,
17134
17393
  () => terminalTitle(key) ?? fallback
17135
17394
  );
17136
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { style: CHIP_STYLE, children: [
17137
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TerminalGlyph, {}),
17138
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { style: TITLE_STYLE3, children: title })
17395
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { style: CHIP_STYLE, children: [
17396
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TerminalGlyph, {}),
17397
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { style: TITLE_STYLE4, children: title })
17139
17398
  ] });
17140
17399
  }
17141
17400
  function TerminalGlyph() {
17142
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
17401
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
17143
17402
  "svg",
17144
17403
  {
17145
17404
  width: "16",
@@ -17148,8 +17407,8 @@ function TerminalGlyph() {
17148
17407
  fill: "none",
17149
17408
  "aria-hidden": "true",
17150
17409
  children: [
17151
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M3 4L7 8L3 12", stroke: "currentColor" }),
17152
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("path", { d: "M9 12H13", stroke: "currentColor" })
17410
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { d: "M3 4L7 8L3 12", stroke: "currentColor" }),
17411
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("path", { d: "M9 12H13", stroke: "currentColor" })
17153
17412
  ]
17154
17413
  }
17155
17414
  );
@@ -17160,26 +17419,26 @@ var CHIP_STYLE = {
17160
17419
  gap: "4px",
17161
17420
  minWidth: 0
17162
17421
  };
17163
- var TITLE_STYLE3 = {
17422
+ var TITLE_STYLE4 = {
17164
17423
  overflow: "hidden",
17165
17424
  whiteSpace: "nowrap",
17166
17425
  textOverflow: "ellipsis"
17167
17426
  };
17168
17427
 
17169
17428
  // src/client/read-only-approval.tsx
17170
- var import_dsh_client_ui_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
17171
- var import_react21 = require("react");
17172
- var import_jsx_runtime26 = require("react/jsx-runtime");
17429
+ var import_dsh_client_ui_primitives24 = require("@deepseek-ai/dsh-client-ui-primitives");
17430
+ var import_react22 = require("react");
17431
+ var import_jsx_runtime28 = require("react/jsx-runtime");
17173
17432
  var BUILTIN_PROMPT_PREFIX = "dsh_podman_builtin_";
17174
17433
  function ReadOnlyApprovalPanel(props) {
17175
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ReadOnlyApprovalFlow, { ...props }, props.matched.key);
17434
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ReadOnlyApprovalFlow, { ...props }, props.matched.key);
17176
17435
  }
17177
17436
  function ReadOnlyApprovalFlow({
17178
17437
  t,
17179
17438
  matched
17180
17439
  }) {
17181
- const [answered, setAnswered] = (0, import_react21.useState)(false);
17182
- const [error, setError] = (0, import_react21.useState)("");
17440
+ const [answered, setAnswered] = (0, import_react22.useState)(false);
17441
+ const [error, setError] = (0, import_react22.useState)("");
17183
17442
  const answer = (outcome) => {
17184
17443
  setAnswered(true);
17185
17444
  setError("");
@@ -17188,7 +17447,7 @@ function ReadOnlyApprovalFlow({
17188
17447
  setError(failure3 instanceof Error ? failure3.message : String(failure3));
17189
17448
  });
17190
17449
  };
17191
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17450
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17192
17451
  "div",
17193
17452
  {
17194
17453
  style: {
@@ -17197,7 +17456,7 @@ function ReadOnlyApprovalFlow({
17197
17456
  alignItems: "center",
17198
17457
  padding: "8px calc(var(--dsh-composer-side-clearance) + 16px) 12px"
17199
17458
  },
17200
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
17459
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
17201
17460
  "div",
17202
17461
  {
17203
17462
  style: {
@@ -17210,7 +17469,7 @@ function ReadOnlyApprovalFlow({
17210
17469
  boxShadow: "var(--dsw-shadow-lv2)"
17211
17470
  },
17212
17471
  children: [
17213
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
17472
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
17214
17473
  "div",
17215
17474
  {
17216
17475
  role: "status",
@@ -17226,7 +17485,7 @@ function ReadOnlyApprovalFlow({
17226
17485
  lineHeight: "18px"
17227
17486
  },
17228
17487
  children: [
17229
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17488
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17230
17489
  "span",
17231
17490
  {
17232
17491
  style: {
@@ -17241,7 +17500,7 @@ function ReadOnlyApprovalFlow({
17241
17500
  ]
17242
17501
  }
17243
17502
  ),
17244
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17503
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17245
17504
  "div",
17246
17505
  {
17247
17506
  style: {
@@ -17250,7 +17509,7 @@ function ReadOnlyApprovalFlow({
17250
17509
  overflowY: "auto",
17251
17510
  padding: "12px 16px 0"
17252
17511
  },
17253
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17512
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17254
17513
  "div",
17255
17514
  {
17256
17515
  style: {
@@ -17265,7 +17524,7 @@ function ReadOnlyApprovalFlow({
17265
17524
  )
17266
17525
  }
17267
17526
  ),
17268
- error === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17527
+ error === "" ? null : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17269
17528
  "p",
17270
17529
  {
17271
17530
  role: "alert",
@@ -17278,7 +17537,7 @@ function ReadOnlyApprovalFlow({
17278
17537
  children: error
17279
17538
  }
17280
17539
  ),
17281
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
17540
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
17282
17541
  "div",
17283
17542
  {
17284
17543
  style: {
@@ -17288,8 +17547,8 @@ function ReadOnlyApprovalFlow({
17288
17547
  padding: "14px 16px"
17289
17548
  },
17290
17549
  children: [
17291
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17292
- import_dsh_client_ui_primitives22.Button,
17550
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17551
+ import_dsh_client_ui_primitives24.Button,
17293
17552
  {
17294
17553
  variant: "outline",
17295
17554
  size: "sm",
@@ -17298,8 +17557,8 @@ function ReadOnlyApprovalFlow({
17298
17557
  children: t("remountReject")
17299
17558
  }
17300
17559
  ),
17301
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17302
- import_dsh_client_ui_primitives22.Button,
17560
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17561
+ import_dsh_client_ui_primitives24.Button,
17303
17562
  {
17304
17563
  variant: "primary",
17305
17564
  size: "sm",
@@ -17319,8 +17578,8 @@ function ReadOnlyApprovalFlow({
17319
17578
  }
17320
17579
 
17321
17580
  // src/client/tool-views.tsx
17322
- var import_react22 = require("react");
17323
- var import_dsh_client_ui_primitives23 = require("@deepseek-ai/dsh-client-ui-primitives");
17581
+ var import_react23 = require("react");
17582
+ var import_dsh_client_ui_primitives25 = require("@deepseek-ai/dsh-client-ui-primitives");
17324
17583
 
17325
17584
  // src/client/tool-presentations.ts
17326
17585
  var TOOL_PRESENTATION = {
@@ -17511,47 +17770,47 @@ function installTerminalStyles(ctx) {
17511
17770
  }
17512
17771
 
17513
17772
  // src/client/tool-views.tsx
17514
- var import_jsx_runtime27 = require("react/jsx-runtime");
17773
+ var import_jsx_runtime29 = require("react/jsx-runtime");
17515
17774
  var TOOL_ICONS = {
17516
- container_bash: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconApiOutlineRegular, { size: 14 }),
17517
- container_exec: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconApiOutlineRegular, { size: 14 }),
17518
- container_read: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconBrowseOutlineRegular, { size: 14 }),
17519
- container_write: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconEditOutlineRegular, { size: 14 }),
17520
- container_edit: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconEditOutlineRegular, { size: 14 }),
17521
- container_glob: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconSearchOutlineRegular, { size: 14 }),
17522
- container_grep: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconSearchOutlineRegular, { size: 14 }),
17523
- container_list: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconDataOutlineRegular, { size: 14 }),
17524
- container_start: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconPlayOutlineRegular, { size: 14 }),
17525
- container_recreate: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconRefreshOutlineRegular, { size: 14 }),
17526
- container_remove: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 14 }),
17527
- container_mount_list: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconFolderOpenOutlineRegular, { size: 14 }),
17528
- container_mount_add: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconFolderOpenOutlineRegular, { size: 14 }),
17529
- container_mount_remove: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 14 }),
17530
- container_mount_update: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconRefreshOutlineRegular, { size: 14 }),
17531
- container_publish_port: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconLinkOutlineRegular, { size: 14 }),
17532
- container_unpublish_port: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 14 }),
17533
- container_path_set: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconEditOutlineRegular, { size: 14 }),
17534
- container_path_add: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconPlusOutlineRegular, { size: 14 }),
17535
- container_path_remove: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 14 }),
17536
- container_secret_add: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconLinkOutlineRegular, { size: 14 }),
17537
- container_secret_remove: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconLinkOutlineRegular, { size: 14 }),
17538
- image_list: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconArchiveOutlineRegular, { size: 14 }),
17539
- image_get: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconArchiveOutlineRegular, { size: 14 }),
17540
- image_build: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconPlusOutlineRegular, { size: 14 }),
17541
- image_rebuild: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconRefreshOutlineRegular, { size: 14 }),
17542
- image_rebuild_all: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconRefreshOutlineRegular, { size: 14 }),
17543
- image_remove: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 14 }),
17544
- volume_list: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconDataOutlineRegular, { size: 14 }),
17545
- volume_create: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconPlusOutlineRegular, { size: 14 }),
17546
- volume_remove: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 14 }),
17547
- secret_list: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconLinkOutlineRegular, { size: 14 }),
17548
- secret_create: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconPlusOutlineRegular, { size: 14 }),
17549
- secret_remove: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconTrashOutlineRegular, { size: 14 }),
17550
- daemon_start: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconPlayOutlineRegular, { size: 14 }),
17551
- daemon_list: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconPlayOutlineRegular, { size: 14 }),
17552
- daemon_logs: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconBrowseOutlineRegular, { size: 14 }),
17553
- daemon_restart: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconRefreshOutlineRegular, { size: 14 }),
17554
- daemon_stop: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconStopFillRegular, { size: 14 })
17775
+ container_bash: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconApiOutlineRegular, { size: 14 }),
17776
+ container_exec: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconApiOutlineRegular, { size: 14 }),
17777
+ container_read: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconBrowseOutlineRegular, { size: 14 }),
17778
+ container_write: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconEditOutlineRegular, { size: 14 }),
17779
+ container_edit: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconEditOutlineRegular, { size: 14 }),
17780
+ container_glob: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconSearchOutlineRegular, { size: 14 }),
17781
+ container_grep: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconSearchOutlineRegular, { size: 14 }),
17782
+ container_list: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconDataOutlineRegular, { size: 14 }),
17783
+ container_start: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconPlayOutlineRegular, { size: 14 }),
17784
+ container_recreate: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 14 }),
17785
+ container_remove: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconTrashOutlineRegular, { size: 14 }),
17786
+ container_mount_list: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconFolderOpenOutlineRegular, { size: 14 }),
17787
+ container_mount_add: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconFolderOpenOutlineRegular, { size: 14 }),
17788
+ container_mount_remove: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconTrashOutlineRegular, { size: 14 }),
17789
+ container_mount_update: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 14 }),
17790
+ container_publish_port: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 14 }),
17791
+ container_unpublish_port: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconTrashOutlineRegular, { size: 14 }),
17792
+ container_path_set: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconEditOutlineRegular, { size: 14 }),
17793
+ container_path_add: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 14 }),
17794
+ container_path_remove: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconTrashOutlineRegular, { size: 14 }),
17795
+ container_secret_add: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 14 }),
17796
+ container_secret_remove: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 14 }),
17797
+ image_list: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconArchiveOutlineRegular, { size: 14 }),
17798
+ image_get: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconArchiveOutlineRegular, { size: 14 }),
17799
+ image_build: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 14 }),
17800
+ image_rebuild: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 14 }),
17801
+ image_rebuild_all: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 14 }),
17802
+ image_remove: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconTrashOutlineRegular, { size: 14 }),
17803
+ volume_list: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconDataOutlineRegular, { size: 14 }),
17804
+ volume_create: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 14 }),
17805
+ volume_remove: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconTrashOutlineRegular, { size: 14 }),
17806
+ secret_list: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 14 }),
17807
+ secret_create: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 14 }),
17808
+ secret_remove: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconTrashOutlineRegular, { size: 14 }),
17809
+ daemon_start: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconPlayOutlineRegular, { size: 14 }),
17810
+ daemon_list: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconPlayOutlineRegular, { size: 14 }),
17811
+ daemon_logs: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconBrowseOutlineRegular, { size: 14 }),
17812
+ daemon_restart: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 14 }),
17813
+ daemon_stop: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconStopFillRegular, { size: 14 })
17555
17814
  };
17556
17815
  var sepStyle = {
17557
17816
  flex: "none",
@@ -17724,12 +17983,12 @@ function PodmanToolRow({
17724
17983
  presentation?.summaryKeys ?? [],
17725
17984
  firstLine(argsRaw) || block.callId
17726
17985
  );
17727
- const [expanded, setExpanded] = (0, import_react22.useState)(false);
17986
+ const [expanded, setExpanded] = (0, import_react23.useState)(false);
17728
17987
  const expandable = terminal !== null || output !== null && output !== "";
17729
- const leading = state === "error" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.StateDot, { state: "error" }) : state === "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.StateDot, { state: "warning" }) : presentation === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_dsh_client_ui_primitives23.IconSparkleRegular, { size: 14 }) : TOOL_ICONS[toolName];
17988
+ const leading = state === "error" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.StateDot, { state: "error" }) : state === "stopped" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.StateDot, { state: "warning" }) : presentation === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_dsh_client_ui_primitives25.IconSparkleRegular, { size: 14 }) : TOOL_ICONS[toolName];
17730
17989
  void inspect;
17731
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17732
- import_dsh_client_ui_primitives23.DisclosureRow,
17990
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17991
+ import_dsh_client_ui_primitives25.DisclosureRow,
17733
17992
  {
17734
17993
  icon: leading,
17735
17994
  title,
@@ -17738,12 +17997,12 @@ function PodmanToolRow({
17738
17997
  onToggle: () => setExpanded((value) => !value),
17739
17998
  expandOnRowClick: true,
17740
17999
  keepContentWhenOpen: true,
17741
- collapsedContent: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
17742
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { style: sepStyle, "aria-hidden": true }),
17743
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { style: failureLine !== null ? errorSummaryStyle : summaryStyle, children: summary })
18000
+ collapsedContent: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
18001
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { style: sepStyle, "aria-hidden": true }),
18002
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { style: failureLine !== null ? errorSummaryStyle : summaryStyle, children: summary })
17744
18003
  ] }),
17745
- children: terminal !== null ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17746
- import_dsh_client_ui_primitives23.TerminalBlock,
18004
+ children: terminal !== null ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
18005
+ import_dsh_client_ui_primitives25.TerminalBlock,
17747
18006
  {
17748
18007
  command: terminal.command,
17749
18008
  cwd: terminal.cwd,
@@ -17756,7 +18015,7 @@ function PodmanToolRow({
17756
18015
  className: TERMINAL_CLASS,
17757
18016
  labels: terminalLabels(t)
17758
18017
  }
17759
- ) : expandable ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("pre", { style: state === "error" ? errorBodyStyle : bodyStyle, children: capLines(output ?? "", MAX_RENDERED_LINES) }) : null
18018
+ ) : expandable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("pre", { style: state === "error" ? errorBodyStyle : bodyStyle, children: capLines(output ?? "", MAX_RENDERED_LINES) }) : null
17760
18019
  }
17761
18020
  );
17762
18021
  }
@@ -18611,7 +18870,13 @@ var en2 = {
18611
18870
  terminalStatusDetached: "Detached (opened elsewhere)",
18612
18871
  terminalNoShells: "No shells available",
18613
18872
  terminalShellsFailed: "Could not list shells: {message}",
18614
- terminalLoading: "Loading\u2026"
18873
+ terminalLoading: "Loading\u2026",
18874
+ containersTabTitle: "Containers",
18875
+ containersCommand: "Containers",
18876
+ containersPanelNoWorkspace: "This session is not in a known workspace.",
18877
+ containersGuideTitle: "Workspace containers",
18878
+ containersGuideDescription: "Manage the Session workspace's containers",
18879
+ moreSettings: "More settings\u2026"
18615
18880
  };
18616
18881
  var zh2 = {
18617
18882
  cardTitle: "dsh-podman",
@@ -18931,12 +19196,17 @@ var zh2 = {
18931
19196
  terminalStatusDetached: "\u5DF2\u5728\u5176\u4ED6\u4F4D\u7F6E\u6253\u5F00",
18932
19197
  terminalNoShells: "\u6CA1\u6709\u53EF\u7528\u7684 Shell",
18933
19198
  terminalShellsFailed: "\u8BFB\u53D6 Shell \u5931\u8D25\uFF1A{message}",
18934
- terminalLoading: "\u6B63\u5728\u52A0\u8F7D\u2026"
19199
+ terminalLoading: "\u6B63\u5728\u52A0\u8F7D\u2026",
19200
+ containersTabTitle: "\u5BB9\u5668",
19201
+ containersCommand: "\u5BB9\u5668",
19202
+ containersPanelNoWorkspace: "\u6B64\u4F1A\u8BDD\u4E0D\u5C5E\u4E8E\u4EFB\u4F55\u5DF2\u77E5\u5DE5\u4F5C\u533A\u3002",
19203
+ containersGuideTitle: "\u5DE5\u4F5C\u533A\u5BB9\u5668",
19204
+ containersGuideDescription: "\u7BA1\u7406\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u4E2D\u7684\u5BB9\u5668",
19205
+ moreSettings: "\u66F4\u591A\u8BBE\u7F6E\u2026"
18935
19206
  };
18936
19207
 
18937
19208
  // src/client/index.ts
18938
19209
  var name = "podman";
18939
- var PLUGIN_PACKAGE = "@exagone313/dsh-podman";
18940
19210
  var inject = [
18941
19211
  "slots",
18942
19212
  "locale",
@@ -18945,21 +19215,37 @@ var inject = [
18945
19215
  "sidebarRightTabs",
18946
19216
  "shortcuts"
18947
19217
  ];
19218
+ var registrationFailures = /* @__PURE__ */ new Set();
19219
+ function reportRegistrationFailure(part, error) {
19220
+ if (registrationFailures.has(part)) return;
19221
+ registrationFailures.add(part);
19222
+ console.error(`podman: ${part} registration failed; continuing:`, error);
19223
+ }
18948
19224
  function apply(ctx) {
19225
+ const locale = ctx.locale;
19226
+ const t = locale.bind(NS);
19227
+ const sidebarRight = ctx.sidebarRight;
18949
19228
  installTerminalStyles(ctx);
18950
19229
  installDirectoryStyles(ctx);
18951
19230
  installDialogStyles(ctx);
18952
19231
  installFieldStyles(ctx);
18953
19232
  installTableStyles(ctx);
18954
19233
  installTabsStyles(ctx);
19234
+ installContainersPanelStyles(ctx);
18955
19235
  ctx.effect(
18956
- () => ctx.locale.register(NS, { en: en2, zh: zh2 }),
19236
+ () => locale.register(NS, { en: en2, zh: zh2 }),
18957
19237
  "podman: dictionaries"
18958
19238
  );
18959
19239
  const scope = ctx.configForms.get(CONTAINER_NS);
18960
19240
  const controller = new ContainerCardController(scope);
19241
+ ctx.inject(["pluginNavigation"], (navCtx) => {
19242
+ navCtx.effect(() => {
19243
+ setPluginNavigation(navCtx.pluginNavigation);
19244
+ return () => setPluginNavigation(void 0);
19245
+ }, "podman: plugin navigation");
19246
+ });
18961
19247
  const syncLocale = () => {
18962
- const active = ctx.locale.getSnapshot().active;
19248
+ const active = locale.getSnapshot().active;
18963
19249
  controller.setLocale(active);
18964
19250
  const snapshot = scope.getSnapshot();
18965
19251
  if (snapshot.status !== "ready" || !snapshot.writable) return;
@@ -18967,7 +19253,10 @@ function apply(ctx) {
18967
19253
  void scope.set("uiLocale", active);
18968
19254
  };
18969
19255
  syncLocale();
18970
- scope.subscribe(syncLocale);
19256
+ ctx.effect(
19257
+ () => scope.subscribe(syncLocale),
19258
+ "podman: settings locale sync"
19259
+ );
18971
19260
  ctx.effect(() => ctx.on("locale/change", syncLocale), "podman: locale sync");
18972
19261
  ctx.inject(["remote", "remote.directoryPicker"], (pickerCtx) => {
18973
19262
  controller.setDirectoryPicker(buildDirectoryPicker(pickerCtx.remote));
@@ -19019,7 +19308,6 @@ function apply(ctx) {
19019
19308
  },
19020
19309
  ReadOnlyApprovalPanel
19021
19310
  ));
19022
- const t = ctx.locale.bind(NS);
19023
19311
  ctx.effect(
19024
19312
  () => ctx.sidebarRightTabs.register({
19025
19313
  id: PODMAN_TERMINAL_TAB_ID,
@@ -19032,7 +19320,7 @@ function apply(ctx) {
19032
19320
  order: 20,
19033
19321
  title: () => t("terminalGuideTitle"),
19034
19322
  description: () => t("terminalGuideDescription"),
19035
- icon: import_dsh_client_ui_primitives24.PluginArtworkTerminal
19323
+ icon: import_dsh_client_ui_primitives26.PluginArtworkTerminal
19036
19324
  }]
19037
19325
  }),
19038
19326
  "podman: terminal type"
@@ -19078,6 +19366,96 @@ function apply(ctx) {
19078
19366
  ),
19079
19367
  "podman: terminal guide"
19080
19368
  );
19369
+ ctx.effect(
19370
+ () => {
19371
+ try {
19372
+ return ctx.sidebarRightTabs.register({
19373
+ id: PODMAN_CONTAINERS_TAB_ID,
19374
+ kind: PODMAN_CONTAINERS_KIND,
19375
+ multiple: false,
19376
+ keepMounted: true,
19377
+ title: () => t("containersTabTitle"),
19378
+ guide: [{
19379
+ id: "containers",
19380
+ order: 21,
19381
+ title: () => t("containersGuideTitle"),
19382
+ description: () => t("containersGuideDescription"),
19383
+ icon: import_dsh_client_ui_primitives26.PluginArtworkDefault
19384
+ }]
19385
+ });
19386
+ } catch (error) {
19387
+ reportRegistrationFailure("containers tab type", error);
19388
+ return () => {
19389
+ };
19390
+ }
19391
+ },
19392
+ "podman: containers type"
19393
+ );
19394
+ ctx.effect(
19395
+ () => ctx.slots.inject("sidebar.right.pane.tab", () => {
19396
+ try {
19397
+ return ctx.slots.register(
19398
+ {
19399
+ name: "sidebar.right.pane.tab",
19400
+ key: PODMAN_CONTAINERS_TAB_ID,
19401
+ locale: NS,
19402
+ inject: (sessionId) => ({ ...controller.inject(), sessionId })
19403
+ },
19404
+ PodmanContainers
19405
+ );
19406
+ } catch (error) {
19407
+ reportRegistrationFailure("containers tab body", error);
19408
+ return () => {
19409
+ };
19410
+ }
19411
+ }),
19412
+ "podman: containers body"
19413
+ );
19414
+ ctx.effect(
19415
+ () => ctx.slots.inject("sidebar.right.tab.guide.entry", () => {
19416
+ try {
19417
+ return ctx.slots.register(
19418
+ {
19419
+ name: "sidebar.right.tab.guide.entry",
19420
+ key: PODMAN_CONTAINERS_TAB_ID,
19421
+ locale: NS
19422
+ },
19423
+ PodmanContainersGuide
19424
+ );
19425
+ } catch (error) {
19426
+ reportRegistrationFailure("containers guide", error);
19427
+ return () => {
19428
+ };
19429
+ }
19430
+ }),
19431
+ "podman: containers guide"
19432
+ );
19433
+ const containersCommand = {
19434
+ id: "podman.containers.open",
19435
+ label: () => t("containersCommand"),
19436
+ aliases: ["containers", "workspace containers"],
19437
+ regions: ["page", "editable", "terminal"],
19438
+ modals: [],
19439
+ resolve: ({ target }) => {
19440
+ const resolution = resolveContainersOpen(sidebarRight, target);
19441
+ return resolution.status === "blocked" ? { status: "blocked", reason: t("terminalShortcutNoSession") } : { status: "handled", run: resolution.run };
19442
+ }
19443
+ };
19444
+ ctx.effect(
19445
+ () => {
19446
+ try {
19447
+ return ctx.shortcuts.register({
19448
+ ...containersCommand,
19449
+ defaults: {}
19450
+ });
19451
+ } catch (error) {
19452
+ reportRegistrationFailure("containers command", error);
19453
+ return () => {
19454
+ };
19455
+ }
19456
+ },
19457
+ "podman: containers command"
19458
+ );
19081
19459
  const terminalShortcut = {
19082
19460
  id: "podman.terminal.new",
19083
19461
  label: () => t("terminalShortcut"),
@@ -19085,11 +19463,11 @@ function apply(ctx) {
19085
19463
  regions: ["page", "editable", "terminal"],
19086
19464
  modals: [],
19087
19465
  resolve: ({ target }) => {
19088
- const captured = ctx.sidebarRight.commandTarget(target);
19466
+ const captured = sidebarRight.commandTarget(target);
19089
19467
  return captured === void 0 ? { status: "blocked", reason: t("terminalShortcutNoSession") } : {
19090
19468
  status: "handled",
19091
19469
  run: () => {
19092
- ctx.sidebarRight.openTabFromTarget(PODMAN_TERMINAL_KIND, captured);
19470
+ sidebarRight.openTabFromTarget(PODMAN_TERMINAL_KIND, captured);
19093
19471
  }
19094
19472
  };
19095
19473
  }