@exagone313/dsh-podman 1.2.1 → 1.3.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.
Files changed (94) hide show
  1. package/dist/card-route.d.ts +8 -0
  2. package/dist/card-route.js +19 -8
  3. package/dist/client/ContainerCard.js +147 -110
  4. package/dist/client/card-protocol.d.ts +4 -0
  5. package/dist/client/card-protocol.js +34 -0
  6. package/dist/client/container-card-caches.d.ts +1 -1
  7. package/dist/client/container-card-caches.js +19 -17
  8. package/dist/client/container-card-config.d.ts +47 -0
  9. package/dist/client/container-card-config.js +160 -0
  10. package/dist/client/container-card-controller.d.ts +35 -3
  11. package/dist/client/container-card-controller.js +263 -41
  12. package/dist/client/container-card-create-modal.d.ts +5 -1
  13. package/dist/client/container-card-create-modal.js +111 -94
  14. package/dist/client/container-card-defaults.d.ts +16 -0
  15. package/dist/client/container-card-defaults.js +147 -0
  16. package/dist/client/container-card-dialog-styles.d.ts +7 -0
  17. package/dist/client/container-card-dialog-styles.js +70 -0
  18. package/dist/client/container-card-dialog.d.ts +12 -0
  19. package/dist/client/container-card-dialog.js +47 -0
  20. package/dist/client/container-card-directory-styles.d.ts +1 -1
  21. package/dist/client/container-card-directory-styles.js +5 -5
  22. package/dist/client/container-card-directory.js +8 -7
  23. package/dist/client/container-card-edit-modal.d.ts +39 -0
  24. package/dist/client/container-card-edit-modal.js +29 -0
  25. package/dist/client/container-card-editors.d.ts +5 -2
  26. package/dist/client/container-card-editors.js +109 -134
  27. package/dist/client/container-card-field-styles.d.ts +7 -0
  28. package/dist/client/container-card-field-styles.js +63 -0
  29. package/dist/client/container-card-form.d.ts +47 -0
  30. package/dist/client/container-card-form.js +61 -0
  31. package/dist/client/container-card-group.d.ts +9 -0
  32. package/dist/client/container-card-group.js +22 -0
  33. package/dist/client/container-card-images.d.ts +6 -2
  34. package/dist/client/container-card-images.js +63 -23
  35. package/dist/client/container-card-paths.js +43 -52
  36. package/dist/client/container-card-ports.d.ts +3 -4
  37. package/dist/client/container-card-ports.js +74 -38
  38. package/dist/client/container-card-resources.d.ts +38 -0
  39. package/dist/client/container-card-resources.js +73 -0
  40. package/dist/client/container-card-row.d.ts +11 -19
  41. package/dist/client/container-card-row.js +122 -122
  42. package/dist/client/container-card-secrets.d.ts +31 -3
  43. package/dist/client/container-card-secrets.js +174 -56
  44. package/dist/client/container-card-shared.d.ts +173 -6
  45. package/dist/client/container-card-shared.js +616 -57
  46. package/dist/client/container-card-status.d.ts +18 -0
  47. package/dist/client/container-card-status.js +166 -0
  48. package/dist/client/container-card-styles.d.ts +49 -7
  49. package/dist/client/container-card-styles.js +396 -40
  50. package/dist/client/container-card-table-styles.d.ts +15 -0
  51. package/dist/client/container-card-table-styles.js +237 -0
  52. package/dist/client/container-card-tabs-styles.d.ts +5 -0
  53. package/dist/client/container-card-tabs-styles.js +46 -0
  54. package/dist/client/container-card-toast.d.ts +5 -0
  55. package/dist/client/container-card-toast.js +10 -0
  56. package/dist/client/container-card-volumes.d.ts +1 -0
  57. package/dist/client/container-card-volumes.js +14 -19
  58. package/dist/client/container-card-workspace.d.ts +8 -12
  59. package/dist/client/container-card-workspace.js +76 -14
  60. package/dist/client/index.js +6488 -3474
  61. package/dist/client/locales.d.ts +10 -1
  62. package/dist/client/locales.js +268 -114
  63. package/dist/client/relative-time.d.ts +10 -0
  64. package/dist/client/relative-time.js +74 -0
  65. package/dist/client/slot-contract.d.ts +8 -0
  66. package/dist/client/tool-views.js +1 -1
  67. package/dist/container-env.js +1 -1
  68. package/dist/env-rows.d.ts +9 -11
  69. package/dist/env-rows.js +72 -40
  70. package/dist/generated/version.d.ts +2 -2
  71. package/dist/generated/version.js +2 -2
  72. package/dist/guest-terminal.js +1 -1
  73. package/dist/mount-enums.d.ts +11 -0
  74. package/dist/mount-enums.js +60 -0
  75. package/dist/subprocess.js +1 -1
  76. package/dist/terminal-sessions.js +2 -2
  77. package/dist/terminal-shells.js +1 -1
  78. package/dist/tool-handlers.js +1 -1
  79. package/dist/workspace-binding.js +2 -2
  80. package/docs/architecture.md +4 -4
  81. package/docs/architecture.zh.md +1 -1
  82. package/docs/configuration.md +26 -25
  83. package/docs/configuration.zh.md +13 -11
  84. package/docs/development-prompt.md +7 -7
  85. package/docs/development-prompt.zh.md +7 -7
  86. package/docs/development.md +20 -16
  87. package/docs/development.zh.md +17 -16
  88. package/docs/install-dsh-and-dsh-podman.md +13 -12
  89. package/docs/install-dsh-and-dsh-podman.zh.md +13 -9
  90. package/docs/usage.md +189 -39
  91. package/docs/usage.zh.md +148 -29
  92. package/package.json +5 -1
  93. package/dist/client/container-card-default-env.d.ts +0 -10
  94. package/dist/client/container-card-default-env.js +0 -69
@@ -2,72 +2,190 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
2
2
  // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
3
3
  //
4
4
  // SPDX-License-Identifier: MIT
5
- import { ConfirmButton, Field, namePattern, sanitizeName, } from "./container-card-shared.js";
6
- import { greyId, hint, imageSelect, sectionTitle, wsBody, } from "./container-card-styles.js";
7
- import { Button, DisclosureRow, Input, Modal, } from "@deepseek-ai/dsh-client-ui-primitives";
8
- import { useId, useState } from "react";
5
+ import { ConfirmButton, countLabel, Field, namePattern, SecretEnvRow, } from "./container-card-shared.js";
6
+ import { CardGroup } from "./container-card-group.js";
7
+ import { recordsEqual } from "./container-card-config.js";
8
+ import { scopedActionKey } from "./card-protocol.js";
9
+ import { cardList, cardRow, greyId, hint, imageSelect, rowActions, rowDivider, rowMain, rowName, } from "./container-card-styles.js";
10
+ import { ROW_LIST_CLASS } from "./container-card-table-styles.js";
11
+ import { COMPACT_DIALOG_CLASS } from "./container-card-dialog-styles.js";
12
+ import { conflictingEnvNames, emptyEnvRow, envEditRows, envRecordFromRows, firstDuplicateEnvName, } from "../env-rows.js";
13
+ import { Button, Input, Modal } from "@deepseek-ai/dsh-client-ui-primitives";
14
+ import { useEffect, useId, useMemo, useRef, useState, } from "react";
15
+ // One secret row: its name and the two actions that act on it — Edit, which
16
+ // opens the one secret form on this secret's write-only value, then the
17
+ // confirm-gated Remove. The value itself never leaves the browser.
9
18
  export function SecretRow(props) {
10
- const { t, name, busy, writable, onSet, onRemove } = props;
11
- const [content, setContent] = useState("");
12
- const canSave = content !== "" && !busy;
13
- const submit = () => {
14
- if (content === "")
15
- return;
16
- onSet(name, content);
17
- setContent("");
18
- };
19
- return (_jsxs("div", { style: {
20
- display: "flex",
21
- flexWrap: "wrap",
22
- alignItems: "center",
23
- gap: "8px",
24
- }, children: [_jsx("code", { style: {
25
- ...greyId,
26
- flex: 1,
27
- fontSize: "13px",
28
- color: "var(--dsw-alias-label-primary)",
29
- }, children: name }), _jsx(Input, { type: "password", value: content, disabled: !writable || busy, placeholder: t("setSecret"), onChange: (event) => setContent(event.target.value), onKeyDown: (event) => {
30
- if (event.key === "Enter")
31
- submit();
32
- }, style: { width: "200px" } }), _jsx(ConfirmButton, { t: t, label: t("setSecret"), title: t("confirmTitle"), description: t("confirmSetSecret", { secret: name }), disabled: !writable || !canSave, onConfirm: submit }), _jsx(ConfirmButton, { t: t, label: t("removeSecret"), title: t("confirmTitle"), description: t("confirmRemoveSecret", { secret: name }), disabled: !writable || busy, onConfirm: () => onRemove(name) })] }));
19
+ const { t, name, writable, last, pendingActions, onEdit, onRemove } = props;
20
+ const setPending = pendingActions.includes(scopedActionKey("secret_set", name));
21
+ const removePending = pendingActions.includes(scopedActionKey("secret_remove", name));
22
+ return (_jsxs("div", { style: last ? cardRow : { ...cardRow, ...rowDivider }, children: [_jsx("div", { style: rowMain, children: _jsx("code", { style: {
23
+ ...greyId,
24
+ ...rowName,
25
+ fontSize: "13px",
26
+ color: "var(--dsw-alias-label-primary)",
27
+ }, children: name }) }), _jsxs("div", { style: rowActions, children: [_jsx(Button, { variant: "outline", size: "sm", disabled: !writable || setPending, onClick: () => onEdit(name), children: setPending ? t("busy") : t("edit") }), _jsx(ConfirmButton, { t: t, destructive: true, label: t("removeSecret"), title: t("removeSecretTitle"), description: t("confirmRemoveSecret", { secret: name }), confirmLabel: t("removeSecretTitle"), disabled: !writable, pending: removePending, onConfirm: () => onRemove(name) })] })] }));
33
28
  }
34
- export function SecretsSection(props) {
35
- const { t, secrets, busy, writable, onCreate, onRemove, onSet } = props;
36
- const [open, setOpen] = useState(false);
37
- const [openSecret, setOpenSecret] = useState(null);
38
- const [name, setName] = useState("");
29
+ // The one secret form, shared by creating and editing: creating takes a name,
30
+ // an optional length and a charset, while editing takes only the new value of an
31
+ // existing secret, which is write-only and so opens blank. The Storage tab and
32
+ // the container dialogs all open this dialog, so the form has a single home. It
33
+ // owns its draft and resets it on every open, so a caller only learns the secret
34
+ // that was created (to list it, or to select it in its own picker) or the value
35
+ // that was applied.
36
+ export function SecretModal(props) {
37
+ const { t, mode, name, open, busy, writable, onCreate, onSet, onClose, } = props;
38
+ const [newName, setNewName] = useState("");
39
39
  const [length, setLength] = useState("32");
40
40
  const [charset, setCharset] = useState("alphanumeric");
41
+ const [value, setValue] = useState("");
41
42
  const secretNameId = useId();
42
43
  const secretLengthId = useId();
43
44
  const secretCharsetId = useId();
44
- const canCreate = namePattern.test(name);
45
- const submit = () => {
46
- if (!namePattern.test(name))
45
+ const secretValueId = useId();
46
+ const editing = mode === "edit";
47
+ const parsedLength = parseInt(length, 10);
48
+ // An empty length falls back to the host default, which the hint states; a
49
+ // value outside 1–1024 is refused here rather than silently clamped.
50
+ const lengthValid = length.trim() === "" ||
51
+ (/^[0-9]+$/.test(length.trim()) && parsedLength >= 1 &&
52
+ parsedLength <= 1024);
53
+ const canCreate = namePattern.test(newName) && lengthValid;
54
+ const canApply = value !== "";
55
+ // A draft abandoned by closing is dropped, so it can never apply to the next
56
+ // secret.
57
+ useEffect(() => {
58
+ if (!open)
47
59
  return;
48
- const parsedLength = parseInt(length, 10);
49
- const normalized = length.trim() === "" || Number.isNaN(parsedLength) || parsedLength < 1
50
- ? undefined
51
- : parsedLength;
52
- onCreate(name.trim(), normalized, charset);
53
- setName("");
60
+ setNewName("");
54
61
  setLength("32");
55
62
  setCharset("alphanumeric");
56
- setOpen(false);
63
+ setValue("");
64
+ }, [open]);
65
+ const submit = () => {
66
+ if (editing) {
67
+ if (value === "" || name === undefined)
68
+ return;
69
+ onSet?.(name, value);
70
+ }
71
+ else {
72
+ if (!namePattern.test(newName) || !lengthValid)
73
+ return;
74
+ onCreate?.(newName.trim(), length.trim() === "" ? undefined : parsedLength, charset);
75
+ }
76
+ onClose();
57
77
  };
58
- return (_jsxs("section", { children: [_jsxs("div", { style: {
78
+ return (_jsx(Modal, { open: open, onClose: onClose, title: editing ? t("setSecretTitle") : t("createSecret"), closeLabel: t("cancel"), className: COMPACT_DIALOG_CLASS, footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", size: "sm", onClick: onClose, children: t("cancel") }), _jsx(Button, { variant: "primary", size: "sm", disabled: !writable || busy || (editing ? !canApply : !canCreate), onClick: submit, children: editing ? t("save") : t("createSecret") })] }), children: editing
79
+ ? (_jsx(Field, { label: t("setSecret"), htmlFor: secretValueId, children: _jsx(Input, { id: secretValueId, type: "password", value: value, disabled: !writable || busy, autoFocus: true, onChange: (event) => setValue(event.target.value), onKeyDown: (event) => {
80
+ if (event.key === "Enter")
81
+ submit();
82
+ } }) }))
83
+ : (_jsxs("div", { style: {
59
84
  display: "flex",
60
- flexWrap: "wrap",
61
- alignItems: "center",
62
- gap: "8px",
63
- }, children: [_jsx("div", { style: { ...sectionTitle, flex: 1 }, children: t("secretsTitle") }), _jsx(Button, { variant: "outline", size: "sm", disabled: !writable || busy, onClick: () => setOpen(true), children: t("createSecret") })] }), secrets.length === 0 ? _jsx("p", { style: hint, children: t("none") }) : (secrets.map((secret) => (_jsx(DisclosureRow, { icon: _jsx("span", {}), title: secret.name, open: openSecret === secret.name, expandable: true, onToggle: () => setOpenSecret(openSecret === secret.name ? null : secret.name), children: _jsx("div", { style: wsBody, children: _jsx(SecretRow, { t: t, name: secret.name, busy: busy, writable: writable, onSet: onSet, onRemove: onRemove }) }) }, secret.name)))), _jsx(Modal, { open: open, onClose: () => setOpen(false), title: t("secretsTitle"), closeLabel: t("cancel"), footer: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setOpen(false), children: t("cancel") }), _jsx(Button, { variant: "primary", size: "sm", disabled: !canCreate, onClick: submit, children: t("createSecret") })] }), children: _jsxs("div", { style: {
64
- display: "flex",
65
- flexDirection: "column",
66
- gap: "12px",
67
- }, children: [_jsxs(Field, { label: t("secretName"), htmlFor: secretNameId, children: [_jsx(Input, { id: secretNameId, value: name, disabled: !writable || busy, autoFocus: true, onChange: (event) => setName(sanitizeName(event.target.value)), onKeyDown: (event) => {
68
- if (event.key === "Enter")
69
- submit();
70
- } }), name !== "" && !namePattern.test(name)
71
- ? _jsx("p", { style: { ...hint, margin: 0 }, children: t("invalidName") })
72
- : null] }), _jsx(Field, { label: t("secretLength"), htmlFor: secretLengthId, children: _jsx(Input, { id: secretLengthId, type: "number", min: 1, max: 1024, value: length, disabled: !writable || busy, onChange: (event) => setLength(event.target.value) }) }), _jsx(Field, { label: t("secretCharset"), htmlFor: secretCharsetId, children: _jsxs("select", { id: secretCharsetId, style: imageSelect, value: charset, disabled: !writable || busy, onChange: (event) => setCharset(event.target.value), children: [_jsx("option", { value: "alphanumeric", children: "alphanumeric" }), _jsx("option", { value: "hex", children: "hex" }), _jsx("option", { value: "base64url", children: "base64url" })] }) })] }) })] }));
85
+ flexDirection: "column",
86
+ gap: "12px",
87
+ }, children: [_jsxs(Field, { label: t("secretName"), htmlFor: secretNameId, children: [_jsx(Input, { id: secretNameId, value: newName, disabled: !writable || busy, autoFocus: true, onChange: (event) => setNewName(event.target.value), onKeyDown: (event) => {
88
+ if (event.key === "Enter")
89
+ submit();
90
+ } }), newName !== "" && !namePattern.test(newName)
91
+ ? (_jsx("p", { style: { ...hint, margin: 0 }, role: "alert", children: t("invalidName") }))
92
+ : null] }), _jsxs(Field, { label: t("secretLength"), htmlFor: secretLengthId, children: [_jsx(Input, { id: secretLengthId, type: "number", min: 1, max: 1024, value: length, disabled: !writable || busy, onChange: (event) => setLength(event.target.value) }), _jsx("p", { style: { ...hint, margin: 0 }, "aria-live": "polite", children: lengthValid ? t("secretLengthHint") : t("invalidSecretLength") })] }), _jsx(Field, { label: t("secretCharset"), htmlFor: secretCharsetId, children: _jsxs("select", { id: secretCharsetId, style: imageSelect, value: charset, disabled: !writable || busy, onChange: (event) => setCharset(event.target.value), children: [_jsx("option", { value: "alphanumeric", children: "alphanumeric" }), _jsx("option", { value: "hex", children: "hex" }), _jsx("option", { value: "base64url", children: "base64url" })] }) })] })) }));
93
+ }
94
+ // The secret environment variables of a container being configured: one row
95
+ // per attached variable — the shared secret row, its Key editable like the
96
+ // environment editor's and its Value the picker that chooses another secret,
97
+ // each with its own Remove — then the button that appends a row for another
98
+ // variable. Nothing applies until the dialog's own action, so removing one or
99
+ // renaming its variable only stages the change. A workspace without secrets
100
+ // offers no picker and no "None" the user could pick, only the one action that
101
+ // fixes it. Creating a secret opens the shared dialog on top of the caller's
102
+ // own, and selects the new secret as soon as the snapshot lists it, so the
103
+ // caller's draft is never disturbed.
104
+ export function SecretEnvEditor(props) {
105
+ const { t, secretEnv, secrets, busy, enabled, writable, onCreateSecret, onChange, onBlockingError, otherNames, onNames, } = props;
106
+ // The rows are the editor's own: a row keeps its place while its name is
107
+ // retyped, so clearing a key never drops the row — it stays, red, until its
108
+ // own Remove — and renaming one onto a name another row already holds keeps
109
+ // both rows. The parent's record is derived from the named rows alone, so an
110
+ // unnamed row is never attached.
111
+ const [rows, setRows] = useState(() => envEditRows(secretEnv));
112
+ // A parent record that no longer matches what these rows derive is an outside
113
+ // change — the snapshot resynced after an apply — so the rows are rebuilt
114
+ // from it instead of echoing the ones it replaced.
115
+ if (!recordsEqual(secretEnv, envRecordFromRows(rows))) {
116
+ setRows(envEditRows(secretEnv));
117
+ }
118
+ const [createOpen, setCreateOpen] = useState(false);
119
+ const [pendingSecret, setPendingSecret] = useState("");
120
+ // The row the user appended, where a newly created secret is selected; it is
121
+ // kept while that row exists, so the secret lands where the user was working.
122
+ const [draftRowId, setDraftRowId] = useState(undefined);
123
+ const rowsRef = useRef(rows);
124
+ rowsRef.current = rows;
125
+ // The host creates a secret asynchronously, so it cannot be selected at
126
+ // submit time; it is selected on the first snapshot that lists it, in the row
127
+ // the caller already opened.
128
+ useEffect(() => {
129
+ if (pendingSecret === "" ||
130
+ !secrets.some((secret) => secret.name === pendingSecret)) {
131
+ return;
132
+ }
133
+ setPendingSecret("");
134
+ if (draftRowId === undefined)
135
+ return;
136
+ const next = rowsRef.current.map((row) => row.id === draftRowId ? { ...row, value: pendingSecret } : row);
137
+ setRows(next);
138
+ onChange(envRecordFromRows(next));
139
+ }, [secrets, pendingSecret, draftRowId, onChange]);
140
+ // Every name this group holds — the rows as they are typed — then the other
141
+ // group's. A name that is empty or listed twice is a conflict, recomputed
142
+ // from the current rows on every change.
143
+ const names = useMemo(() => rows.map((row) => row.key), [rows]);
144
+ const conflicts = conflictingEnvNames([...names, ...(otherNames ?? [])]);
145
+ const duplicate = firstDuplicateEnvName([...names, ...(otherNames ?? [])]);
146
+ const nameMissing = names.includes("");
147
+ useEffect(() => {
148
+ onBlockingError?.(nameMissing
149
+ ? { key: "envNameRequired" }
150
+ : duplicate === undefined
151
+ ? undefined
152
+ : { key: "envNameDuplicate", params: { key: duplicate } });
153
+ }, [nameMissing, duplicate, onBlockingError]);
154
+ useEffect(() => {
155
+ onNames?.(names);
156
+ }, [names, onNames]);
157
+ const update = (next) => {
158
+ setRows(next);
159
+ onChange(envRecordFromRows(next));
160
+ };
161
+ const addRow = () => {
162
+ const row = { ...emptyEnvRow(), value: secrets[0]?.name ?? "" };
163
+ setDraftRowId(row.id);
164
+ update([...rows, row]);
165
+ };
166
+ const updateRow = (id, patch) => {
167
+ update(rows.map((row) => (row.id === id ? { ...row, ...patch } : row)));
168
+ };
169
+ const removeRow = (id) => {
170
+ if (id === draftRowId)
171
+ setDraftRowId(undefined);
172
+ update(rows.filter((row) => row.id !== id));
173
+ };
174
+ return (_jsxs("div", { className: ROW_LIST_CLASS, style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [rows.map((row) => (_jsx(SecretEnvRow, { t: t, mode: "edit", name: row.key, secret: row.value, secrets: secrets, disabled: !enabled, autoFocus: row.id === draftRowId, keyInvalid: conflicts.has(row.key), onChangeName: (name) => updateRow(row.id, { key: name }), onChangeSecret: (secret) => updateRow(row.id, { value: secret }), onRemove: () => removeRow(row.id) }, row.id))), secrets.length === 0 ? null : (_jsx("div", { children: _jsx(Button, { variant: "outline", size: "sm", disabled: !enabled, onClick: addRow, children: t("addSecretEnv") }) })), _jsx("div", { children: _jsx(Button, { variant: "outline", size: "sm", disabled: !writable || busy, onClick: () => setCreateOpen(true), children: t("createSecret") }) }), _jsx(SecretModal, { t: t, mode: "create", open: createOpen, busy: busy, writable: writable, onCreate: (name, length, charset) => {
175
+ setPendingSecret(name);
176
+ onCreateSecret(name, length, charset);
177
+ }, onClose: () => setCreateOpen(false) })] }));
178
+ }
179
+ export function SecretsSection(props) {
180
+ const { t, secrets, busy, writable, pendingActions, onCreate, onRemove, onSet, } = props;
181
+ const [createOpen, setCreateOpen] = useState(false);
182
+ // The secret whose value the shared form edits; undefined while the form is
183
+ // closed or creating another secret.
184
+ const [editing, setEditing] = useState(undefined);
185
+ return (_jsxs(CardGroup, { title: t("secretsTitle"), summary: countLabel(t, secrets.length, "countSecretOne", "countSecretMany"), hasContent: secrets.length > 0, action: _jsx(Button, { variant: "primary", size: "sm", disabled: !writable || busy, onClick: () => setCreateOpen(true), children: t("createSecret") }), children: [secrets.length === 0
186
+ ? _jsx("p", { style: { ...hint, margin: 0 }, children: t("noSecrets") })
187
+ : (_jsx("div", { style: cardList, children: secrets.map((secret, index) => (_jsx(SecretRow, { t: t, name: secret.name, writable: writable, last: index === secrets.length - 1, pendingActions: pendingActions, onEdit: (name) => setEditing(name), onRemove: onRemove }, secret.name))) })), _jsx(SecretModal, { t: t, mode: editing === undefined ? "create" : "edit", name: editing, open: createOpen || editing !== undefined, busy: busy, writable: writable, onCreate: onCreate, onSet: onSet, onClose: () => {
188
+ setCreateOpen(false);
189
+ setEditing(undefined);
190
+ } })] }));
73
191
  }
@@ -1,29 +1,195 @@
1
+ import { type ActionEmphasis } from "./container-card-styles.js";
1
2
  import { type MountInput, type ProjectMountView } from "./container-card-controller.js";
2
3
  import { type ContainerPluginKey, type Translate } from "./locales.js";
3
- import { type StateDotState } from "@deepseek-ai/dsh-client-ui-primitives";
4
4
  import { type ReactNode } from "react";
5
- export declare function containerStateDot(status: string): StateDotState;
5
+ export declare function countLabel(t: Translate, n: number, one: ContainerPluginKey, many: ContainerPluginKey): string;
6
6
  export declare function Field(props: {
7
7
  label: string;
8
8
  htmlFor: string;
9
9
  children: ReactNode;
10
10
  }): ReactNode;
11
+ export declare function LockGlyph(): ReactNode;
12
+ export declare function ReadOnlyValue(props: {
13
+ t: Translate;
14
+ id: string;
15
+ value: string;
16
+ copyLabel: string;
17
+ copyValue?: string;
18
+ hint?: string;
19
+ }): ReactNode;
20
+ export declare function CopyField(props: {
21
+ t: Translate;
22
+ label: string;
23
+ value: string;
24
+ copyLabel: string;
25
+ copyValue?: string;
26
+ }): ReactNode;
27
+ export declare function CopyButton(props: {
28
+ t: Translate;
29
+ value: string;
30
+ label: string;
31
+ }): ReactNode;
11
32
  export declare const namePattern: RegExp;
12
33
  export declare const imageIdPattern: RegExp;
13
- export declare const sanitizeName: (raw: string) => string;
14
- export declare const sanitizeImageId: (raw: string) => string;
15
- export declare const mountKindShort: (kind: string) => string;
16
- export declare const mountModeShort: (mode: string) => string;
34
+ export type StatusTone = "ok" | "warn" | "error" | "business" | "violet" | "muted";
35
+ export declare function StatusChip(props: {
36
+ tone: StatusTone;
37
+ label: ReactNode;
38
+ }): ReactNode;
39
+ export declare function MountKindChip(props: {
40
+ label: string;
41
+ tone: StatusTone;
42
+ }): ReactNode;
43
+ export declare function MountKindField(props: {
44
+ t: Translate;
45
+ kind: string;
46
+ children?: ReactNode;
47
+ }): ReactNode;
48
+ export declare function FieldSlot(props: {
49
+ label: string;
50
+ htmlFor: string;
51
+ className?: string;
52
+ children: ReactNode;
53
+ }): ReactNode;
54
+ export interface FieldRowSlot {
55
+ label: string;
56
+ className?: string;
57
+ render: (id: string) => ReactNode;
58
+ }
59
+ export declare function FieldRow(props: {
60
+ leading?: ReactNode;
61
+ fields: readonly FieldRowSlot[];
62
+ actions?: ReactNode;
63
+ }): ReactNode;
64
+ export type RowMode = "view" | "edit";
65
+ export declare function ImageRow(props: {
66
+ t: Translate;
67
+ mode: RowMode;
68
+ image: string;
69
+ candidates?: readonly string[];
70
+ disabled?: boolean;
71
+ onChange?: (image: string) => void;
72
+ }): ReactNode;
73
+ export declare function EnvRow(props: {
74
+ t: Translate;
75
+ mode: RowMode;
76
+ name: string;
77
+ value: string;
78
+ disabled?: boolean;
79
+ autoFocus?: boolean;
80
+ onChangeName?: (name: string) => void;
81
+ onChangeValue?: (value: string) => void;
82
+ onRemove?: () => void;
83
+ removeLabel?: string;
84
+ keyInvalid?: boolean;
85
+ }): ReactNode;
86
+ export declare function MountRow(props: {
87
+ t: Translate;
88
+ mode: RowMode;
89
+ mount: MountInput;
90
+ destination: string;
91
+ kindValue?: ReactNode;
92
+ disabled?: boolean;
93
+ volumes?: readonly {
94
+ name: string;
95
+ }[];
96
+ secrets?: readonly {
97
+ name: string;
98
+ }[];
99
+ onUpdate?: (patch: Partial<MountInput>) => void;
100
+ onBrowse?: () => void;
101
+ browseError?: string;
102
+ onRemove?: () => void;
103
+ confirmRemove?: boolean;
104
+ removeDisabledReason?: string;
105
+ }): ReactNode;
106
+ export declare function PathRow(props: {
107
+ t: Translate;
108
+ mode: RowMode;
109
+ path: string;
110
+ disabled?: boolean;
111
+ autoFocus?: boolean;
112
+ first?: boolean;
113
+ last?: boolean;
114
+ onChange?: (path: string) => void;
115
+ onMove?: (delta: number) => void;
116
+ onRemove?: () => void;
117
+ onDragStart?: () => void;
118
+ onDrop?: () => void;
119
+ }): ReactNode;
120
+ export declare function SecretEnvRow(props: {
121
+ t: Translate;
122
+ mode: RowMode;
123
+ name: string;
124
+ secret: string;
125
+ secrets?: readonly {
126
+ name: string;
127
+ }[];
128
+ disabled?: boolean;
129
+ autoFocus?: boolean;
130
+ onChangeName?: (name: string) => void;
131
+ onChangeSecret?: (secret: string) => void;
132
+ onRemove?: () => void;
133
+ keyInvalid?: boolean;
134
+ }): ReactNode;
135
+ export declare function PortRow(props: {
136
+ t: Translate;
137
+ mode: RowMode;
138
+ port: number;
139
+ protocol: string;
140
+ hostPort: number;
141
+ suggestedHostPort?: number;
142
+ pending?: boolean;
143
+ disabled?: boolean;
144
+ onRemove?: () => void;
145
+ removeLabel?: string;
146
+ }): ReactNode;
147
+ export declare function containerStatusTone(status: string): StatusTone;
148
+ export declare function imageStatusTone(status: string): StatusTone;
149
+ export declare function Subsection(props: {
150
+ title: string;
151
+ action?: ReactNode;
152
+ children: ReactNode;
153
+ }): ReactNode;
154
+ export declare function DialogGroup(props: {
155
+ title: string;
156
+ guidance?: string;
157
+ children: ReactNode;
158
+ }): ReactNode;
159
+ export declare const mountKindLabel: (t: Translate, kind: string) => string;
160
+ export declare const mountKindTone: (kind: string) => StatusTone;
161
+ export declare const mountSourceLabel: (t: Translate, kind: string) => string;
162
+ export declare const mountSourceName: (mount: MountInput) => string;
163
+ export declare const mountHasSource: (kind: string) => boolean;
164
+ export declare const mountHasMode: (kind: string) => boolean;
17
165
  export declare const mountViewToInput: (mount: ProjectMountView) => MountInput;
166
+ export declare function orderedMounts(mounts: readonly MountInput[], mainProject: string): {
167
+ mount: MountInput;
168
+ index: number;
169
+ }[];
18
170
  export declare const mountLabel: (t: (key: ContainerPluginKey) => string, mount: MountInput, withMode?: boolean) => string;
171
+ export declare function containerStatusLabel(t: Translate, status: string): string;
172
+ export declare function imageStatusLabel(t: Translate, status: string): string;
19
173
  export declare const emptyMount: (kind?: string) => MountInput;
174
+ export declare function DiscardChangesModal(props: {
175
+ t: Translate;
176
+ open: boolean;
177
+ onCancel: () => void;
178
+ onDiscard: () => void;
179
+ }): ReactNode;
20
180
  export declare function ConfirmButton(props: {
21
181
  t: Translate;
22
182
  label: string;
23
183
  title: string;
24
184
  description: string;
185
+ id?: string;
25
186
  disabled?: boolean;
187
+ pending?: boolean;
26
188
  ariaLabel?: string;
189
+ variant?: "primary" | "outline";
190
+ destructive?: boolean;
191
+ emphasis?: ActionEmphasis;
192
+ confirmLabel?: string;
27
193
  onConfirm: () => void;
28
194
  }): ReactNode;
29
195
  export declare function Chip(props: {
@@ -39,4 +205,5 @@ export declare function TagInput(props: {
39
205
  placeholder?: string;
40
206
  disabled?: boolean;
41
207
  id?: string;
208
+ chipsBelow?: boolean;
42
209
  }): ReactNode;