@exagone313/dsh-podman 1.5.1 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/container-card-workspace.d.ts +1 -0
- package/dist/client/container-card-workspace.js +2 -2
- package/dist/client/container-panel-scope.d.ts +13 -0
- package/dist/client/container-panel-scope.js +45 -0
- package/dist/client/containers-tab.d.ts +26 -0
- package/dist/client/containers-tab.js +39 -0
- package/dist/client/index.js +673 -295
- package/dist/client/locales.d.ts +1 -1
- package/dist/client/locales.js +12 -0
- package/dist/client/plugin-navigation.d.ts +24 -0
- package/dist/client/plugin-navigation.js +44 -0
- package/dist/client/podman-containers-guide.d.ts +5 -0
- package/dist/client/podman-containers-guide.js +73 -0
- package/dist/client/podman-containers-styles.d.ts +5 -0
- package/dist/client/podman-containers-styles.js +33 -0
- package/dist/client/podman-containers.d.ts +11 -0
- package/dist/client/podman-containers.js +113 -0
- package/dist/fs-guard.d.ts +2 -0
- package/dist/fs-guard.js +14 -0
- package/dist/fs-key.d.ts +1 -0
- package/dist/fs-key.js +26 -0
- package/dist/fs-provider.js +121 -70
- package/dist/generated/version.d.ts +2 -2
- package/dist/generated/version.js +2 -2
- package/dist/guest-rpc.d.ts +2 -1
- package/dist/guest-rpc.js +13 -6
- package/docs/install-dsh-and-dsh-podman.md +3 -1
- package/docs/install-dsh-and-dsh-podman.zh.md +2 -1
- package/docs/usage.md +38 -17
- package/docs/usage.zh.md +24 -4
- package/package.json +6 -1
package/dist/client/locales.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const NS = "podman";
|
|
2
|
-
export type ContainerPluginKey = "cardTitle" | "loading" | "versionMismatchMajor" | "versionMismatchMinor" | "versionIncompatible" | "versionCompatibleDifferent" | "stateReady" | "stateNotReady" | "stateUnknown" | "stateAbsent" | "valueMissing" | "columnComponent" | "columnState" | "columnVersion" | "columnCommit" | "versionsTitle" | "orchestrator" | "gateway" | "gatewayNotRunning" | "gatewayIncompatible" | "dsh" | "copyVersions" | "copied" | "copyFailed" | "copyWorkspaceId" | "reload" | "notice" | "defaultImage" | "noDefaultImage" | "defaultEnvironment" | "addMissingVars" | "applyTo" | "allContainers" | "variablesToAdd" | "addMissingVarsApply" | "gitIdentity" | "gitName" | "gitEmail" | "save" | "discard" | "unsavedChanges" | "stagedChanges" | "recreateContainer" | "updateContainer" | "confirmUpdate" | "discardChanges" | "discardChangesTitle" | "confirmDiscardChanges" | "containerNameReserved" | "containerNamePtcReserved" | "containerKindPtc" | "invalidSecretLength" | "secretLengthHint" | "portPendingSuffix" | "portDuplicate" | "groupDefaultsTitle" | "groupStatusTitle" | "tabWorkspaces" | "tabImages" | "tabStorage" | "tabDefaults" | "tabStatus" | "settingsTabs" | "statusOverview" | "gatewayReady" | "gatewayNotReady" | "gatewayUnknown" | "edit" | "editContainerTitle" | "done" | "countImageOne" | "countImageMany" | "countVolumeOne" | "countVolumeMany" | "countSecretOne" | "countSecretMany" | "countCacheOne" | "countCacheMany" | "statusRunning" | "statusStopped" | "statusMissing" | "statusPulled" | "statusBuilt" | "countWorkspaceOne" | "countWorkspaceMany" | "countContainerOne" | "countContainerMany" | "countRunningContainerOne" | "countRunningContainerMany" | "countStoppedContainerOne" | "countStoppedContainerMany" | "countVersionOne" | "countVersionMany" | "orchestratorReady" | "orchestratorUnavailable" | "orchestratorNotReady" | "orchestratorUnknown" | "noWorkspaces" | "ptcMissing" | "ptcContainerTooltip" | "ptcImageTooltip" | "recreatePtcTitle" | "confirmRecreatePtc" | "ptcImageReserved" | "removePtcTitle" | "confirmRemovePtc" | "createContainer" | "containerName" | "image" | "copyImage" | "copyCreated" | "remove" | "removeWorkspace" | "confirmRemoveWorkspace" | "recreate" | "imageName" | "built" | "packages" | "noPackages" | "volumesTitle" | "noVolumes" | "createVolume" | "removeVolume" | "volumeName" | "secretsTitle" | "noSecrets" | "createSecret" | "secretName" | "secretCharset" | "setSecret" | "removeSecret" | "removeImage" | "rebuildImage" | "rebuildAllImages" | "buildImage" | "build" | "buildImageTitle" | "pullImage" | "setDefaultImage" | "baseImagesTitle" | "noBaseImages" | "customImagesTitle" | "noCustomImages" | "parentImage" | "cancel" | "removeTag" | "envTitle" | "envKey" | "copyEnvKey" | "envValue" | "copyEnvValue" | "addEnv" | "removeEnv" | "removeVariable" | "envNameRequired" | "envNameDuplicate" | "secretLength" | "containerSecretsTitle" | "addSecretEnv" | "secretEnvName" | "portsTitle" | "publishPort" | "unpublishPort" | "containerPort" | "copyContainerPort" | "hostPort" | "hostPortOptional" | "copyHostPort" | "protocol" | "copyProtocol" | "invalidPort" | "invalidHostPort" | "publishNeedsGateway" | "containerNotRunning" | "confirmUnpublishPort" | "none" | "unavailable" | "busy" | "confirmRemoveContainer" | "confirmRecreate" | "confirmRemoveImage" | "confirmRebuildImage" | "confirmRebuildAllImages" | "confirmRemoveVolume" | "confirmRemoveSecret" | "mountsTitle" | "addMount" | "mountKind" | "mountProject" | "mountProjectShort" | "mountPath" | "browse" | "browseTitle" | "browseSelect" | "browseLoading" | "browseError" | "browseUnavailable" | "browseHidden" | "browseTruncated" | "browseOutsideRoot" | "mountDestination" | "pathsTitle" | "path" | "copyPathEntry" | "noPaths" | "editPaths" | "addPathEntry" | "moveUp" | "moveDown" | "apply" | "dragToReorder" | "remountWaiting" | "remountApprove" | "remountReject" | "mountVolume" | "mountSecret" | "mountTmpfs" | "mountAt" | "mountMode" | "copyMountPath" | "copyMountName" | "copyMountMode" | "readOnly" | "readWrite" | "mountReadOnlySuffix" | "mountReadWriteSuffix" | "confirmRemoveMount" | "removeContainerTitle" | "removeVolumeTitle" | "removeImageTitle" | "removeSecretTitle" | "removeMountTitle" | "defaultMountNotRemovable" | "rebuildImageTitle" | "rebuildAllImagesTitle" | "setSecretTitle" | "acknowledgeRemoveWorkspace" | "acknowledgeRebuildAllImages" | "cachesTitle" | "noCaches" | "cacheUsage" | "cacheKeepLatest" | "confirmCacheKeepLatest" | "cacheRemoveAll" | "confirmCacheRemoveAll" | "addContainer" | "invalidContainerName" | "containerNameTaken" | "invalidName" | "invalidImageId" | "terminalCommandLine" | "terminalSignal" | "terminalExitCode" | "terminalNoExitCode" | "terminalRunning" | "terminalFailed" | "terminalDone" | "terminalNoOutput" | "terminalCollapseAria" | "terminalExpandAria" | "terminalExpandRest" | "toolTitle_container_bash" | "toolTitle_container_exec" | "toolTitle_container_read" | "toolTitle_container_write" | "toolTitle_container_edit" | "toolTitle_container_glob" | "toolTitle_container_grep" | "toolTitle_container_list" | "toolTitle_container_start" | "toolTitle_container_recreate" | "toolTitle_container_remove" | "toolTitle_container_mount_list" | "toolTitle_container_mount_add" | "toolTitle_container_mount_remove" | "toolTitle_container_mount_update" | "toolTitle_container_path_set" | "toolTitle_container_path_add" | "toolTitle_container_path_remove" | "toolTitle_container_secret_add" | "toolTitle_container_secret_remove" | "toolTitle_container_publish_port" | "toolTitle_container_unpublish_port" | "toolTitle_image_list" | "toolTitle_image_get" | "toolTitle_image_build" | "toolTitle_image_rebuild" | "toolTitle_image_rebuild_all" | "toolTitle_image_remove" | "toolTitle_volume_list" | "toolTitle_volume_create" | "toolTitle_volume_remove" | "toolTitle_secret_list" | "toolTitle_secret_create" | "toolTitle_secret_remove" | "toolTitle_daemon_start" | "toolTitle_daemon_list" | "toolTitle_daemon_logs" | "toolTitle_daemon_restart" | "toolTitle_daemon_stop" | "terminalTabTitle" | "terminalGuideTitle" | "terminalGuideDescription" | "terminalShortcut" | "terminalShortcutNoSession" | "terminalContainer" | "terminalShell" | "terminalDefaultContainer" | "terminalStart" | "terminalConnect" | "terminalReconnect" | "terminalStatusConnecting" | "terminalStatusRunning" | "terminalStatusExited" | "terminalStatusDetached" | "terminalNoShells" | "terminalShellsFailed" | "terminalLoading";
|
|
2
|
+
export type ContainerPluginKey = "cardTitle" | "loading" | "versionMismatchMajor" | "versionMismatchMinor" | "versionIncompatible" | "versionCompatibleDifferent" | "stateReady" | "stateNotReady" | "stateUnknown" | "stateAbsent" | "valueMissing" | "columnComponent" | "columnState" | "columnVersion" | "columnCommit" | "versionsTitle" | "orchestrator" | "gateway" | "gatewayNotRunning" | "gatewayIncompatible" | "dsh" | "copyVersions" | "copied" | "copyFailed" | "copyWorkspaceId" | "reload" | "notice" | "defaultImage" | "noDefaultImage" | "defaultEnvironment" | "addMissingVars" | "applyTo" | "allContainers" | "variablesToAdd" | "addMissingVarsApply" | "gitIdentity" | "gitName" | "gitEmail" | "save" | "discard" | "unsavedChanges" | "stagedChanges" | "recreateContainer" | "updateContainer" | "confirmUpdate" | "discardChanges" | "discardChangesTitle" | "confirmDiscardChanges" | "containerNameReserved" | "containerNamePtcReserved" | "containerKindPtc" | "invalidSecretLength" | "secretLengthHint" | "portPendingSuffix" | "portDuplicate" | "groupDefaultsTitle" | "groupStatusTitle" | "tabWorkspaces" | "tabImages" | "tabStorage" | "tabDefaults" | "tabStatus" | "settingsTabs" | "statusOverview" | "gatewayReady" | "gatewayNotReady" | "gatewayUnknown" | "edit" | "editContainerTitle" | "done" | "countImageOne" | "countImageMany" | "countVolumeOne" | "countVolumeMany" | "countSecretOne" | "countSecretMany" | "countCacheOne" | "countCacheMany" | "statusRunning" | "statusStopped" | "statusMissing" | "statusPulled" | "statusBuilt" | "countWorkspaceOne" | "countWorkspaceMany" | "countContainerOne" | "countContainerMany" | "countRunningContainerOne" | "countRunningContainerMany" | "countStoppedContainerOne" | "countStoppedContainerMany" | "countVersionOne" | "countVersionMany" | "orchestratorReady" | "orchestratorUnavailable" | "orchestratorNotReady" | "orchestratorUnknown" | "noWorkspaces" | "ptcMissing" | "ptcContainerTooltip" | "ptcImageTooltip" | "recreatePtcTitle" | "confirmRecreatePtc" | "ptcImageReserved" | "removePtcTitle" | "confirmRemovePtc" | "createContainer" | "containerName" | "image" | "copyImage" | "copyCreated" | "remove" | "removeWorkspace" | "confirmRemoveWorkspace" | "recreate" | "imageName" | "built" | "packages" | "noPackages" | "volumesTitle" | "noVolumes" | "createVolume" | "removeVolume" | "volumeName" | "secretsTitle" | "noSecrets" | "createSecret" | "secretName" | "secretCharset" | "setSecret" | "removeSecret" | "removeImage" | "rebuildImage" | "rebuildAllImages" | "buildImage" | "build" | "buildImageTitle" | "pullImage" | "setDefaultImage" | "baseImagesTitle" | "noBaseImages" | "customImagesTitle" | "noCustomImages" | "parentImage" | "cancel" | "removeTag" | "envTitle" | "envKey" | "copyEnvKey" | "envValue" | "copyEnvValue" | "addEnv" | "removeEnv" | "removeVariable" | "envNameRequired" | "envNameDuplicate" | "secretLength" | "containerSecretsTitle" | "addSecretEnv" | "secretEnvName" | "portsTitle" | "publishPort" | "unpublishPort" | "containerPort" | "copyContainerPort" | "hostPort" | "hostPortOptional" | "copyHostPort" | "protocol" | "copyProtocol" | "invalidPort" | "invalidHostPort" | "publishNeedsGateway" | "containerNotRunning" | "confirmUnpublishPort" | "none" | "unavailable" | "busy" | "confirmRemoveContainer" | "confirmRecreate" | "confirmRemoveImage" | "confirmRebuildImage" | "confirmRebuildAllImages" | "confirmRemoveVolume" | "confirmRemoveSecret" | "mountsTitle" | "addMount" | "mountKind" | "mountProject" | "mountProjectShort" | "mountPath" | "browse" | "browseTitle" | "browseSelect" | "browseLoading" | "browseError" | "browseUnavailable" | "browseHidden" | "browseTruncated" | "browseOutsideRoot" | "mountDestination" | "pathsTitle" | "path" | "copyPathEntry" | "noPaths" | "editPaths" | "addPathEntry" | "moveUp" | "moveDown" | "apply" | "dragToReorder" | "remountWaiting" | "remountApprove" | "remountReject" | "mountVolume" | "mountSecret" | "mountTmpfs" | "mountAt" | "mountMode" | "copyMountPath" | "copyMountName" | "copyMountMode" | "readOnly" | "readWrite" | "mountReadOnlySuffix" | "mountReadWriteSuffix" | "confirmRemoveMount" | "removeContainerTitle" | "removeVolumeTitle" | "removeImageTitle" | "removeSecretTitle" | "removeMountTitle" | "defaultMountNotRemovable" | "rebuildImageTitle" | "rebuildAllImagesTitle" | "setSecretTitle" | "acknowledgeRemoveWorkspace" | "acknowledgeRebuildAllImages" | "cachesTitle" | "noCaches" | "cacheUsage" | "cacheKeepLatest" | "confirmCacheKeepLatest" | "cacheRemoveAll" | "confirmCacheRemoveAll" | "addContainer" | "invalidContainerName" | "containerNameTaken" | "invalidName" | "invalidImageId" | "terminalCommandLine" | "terminalSignal" | "terminalExitCode" | "terminalNoExitCode" | "terminalRunning" | "terminalFailed" | "terminalDone" | "terminalNoOutput" | "terminalCollapseAria" | "terminalExpandAria" | "terminalExpandRest" | "toolTitle_container_bash" | "toolTitle_container_exec" | "toolTitle_container_read" | "toolTitle_container_write" | "toolTitle_container_edit" | "toolTitle_container_glob" | "toolTitle_container_grep" | "toolTitle_container_list" | "toolTitle_container_start" | "toolTitle_container_recreate" | "toolTitle_container_remove" | "toolTitle_container_mount_list" | "toolTitle_container_mount_add" | "toolTitle_container_mount_remove" | "toolTitle_container_mount_update" | "toolTitle_container_path_set" | "toolTitle_container_path_add" | "toolTitle_container_path_remove" | "toolTitle_container_secret_add" | "toolTitle_container_secret_remove" | "toolTitle_container_publish_port" | "toolTitle_container_unpublish_port" | "toolTitle_image_list" | "toolTitle_image_get" | "toolTitle_image_build" | "toolTitle_image_rebuild" | "toolTitle_image_rebuild_all" | "toolTitle_image_remove" | "toolTitle_volume_list" | "toolTitle_volume_create" | "toolTitle_volume_remove" | "toolTitle_secret_list" | "toolTitle_secret_create" | "toolTitle_secret_remove" | "toolTitle_daemon_start" | "toolTitle_daemon_list" | "toolTitle_daemon_logs" | "toolTitle_daemon_restart" | "toolTitle_daemon_stop" | "terminalTabTitle" | "terminalGuideTitle" | "terminalGuideDescription" | "terminalShortcut" | "terminalShortcutNoSession" | "terminalContainer" | "terminalShell" | "terminalDefaultContainer" | "terminalStart" | "terminalConnect" | "terminalReconnect" | "terminalStatusConnecting" | "terminalStatusRunning" | "terminalStatusExited" | "terminalStatusDetached" | "terminalNoShells" | "terminalShellsFailed" | "terminalLoading" | "containersTabTitle" | "containersCommand" | "containersPanelNoWorkspace" | "containersGuideTitle" | "containersGuideDescription" | "moreSettings";
|
|
3
3
|
/**
|
|
4
4
|
* Translate one key, interpolating `{name}` placeholders when given. Components
|
|
5
5
|
* that build dialog copy declare this so they can name their subject.
|
package/dist/client/locales.js
CHANGED
|
@@ -321,6 +321,12 @@ export const en = {
|
|
|
321
321
|
terminalNoShells: "No shells available",
|
|
322
322
|
terminalShellsFailed: "Could not list shells: {message}",
|
|
323
323
|
terminalLoading: "Loading…",
|
|
324
|
+
containersTabTitle: "Containers",
|
|
325
|
+
containersCommand: "Containers",
|
|
326
|
+
containersPanelNoWorkspace: "This session is not in a known workspace.",
|
|
327
|
+
containersGuideTitle: "Workspace containers",
|
|
328
|
+
containersGuideDescription: "Manage the Session workspace's containers",
|
|
329
|
+
moreSettings: "More settings…",
|
|
324
330
|
};
|
|
325
331
|
export const zh = {
|
|
326
332
|
cardTitle: "dsh-podman",
|
|
@@ -641,4 +647,10 @@ export const zh = {
|
|
|
641
647
|
terminalNoShells: "没有可用的 Shell",
|
|
642
648
|
terminalShellsFailed: "读取 Shell 失败:{message}",
|
|
643
649
|
terminalLoading: "正在加载…",
|
|
650
|
+
containersTabTitle: "容器",
|
|
651
|
+
containersCommand: "容器",
|
|
652
|
+
containersPanelNoWorkspace: "此会话不属于任何已知工作区。",
|
|
653
|
+
containersGuideTitle: "工作区容器",
|
|
654
|
+
containersGuideDescription: "管理会话工作区中的容器",
|
|
655
|
+
moreSettings: "更多设置…",
|
|
644
656
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const PLUGIN_PACKAGE = "@exagone313/dsh-podman";
|
|
2
|
+
/** The plugin-navigation service's face, as this client half uses it. */
|
|
3
|
+
export interface PluginNavigation {
|
|
4
|
+
/**
|
|
5
|
+
* Open one bundle's page on the Plugins panel.
|
|
6
|
+
* @param packageName - npm package name of the bundle.
|
|
7
|
+
*/
|
|
8
|
+
openBundle(packageName: string): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Record the plugin-navigation service (or clear it).
|
|
12
|
+
* @param service - the live service, or undefined on teardown.
|
|
13
|
+
*/
|
|
14
|
+
export declare function setPluginNavigation(service: PluginNavigation | undefined): void;
|
|
15
|
+
/** Whether a plugin-navigation face is currently adopted. */
|
|
16
|
+
export declare function pluginSettingsAvailable(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Observe whether the navigation face is available.
|
|
19
|
+
* @param listener - invoked when the face is adopted or cleared.
|
|
20
|
+
* @returns the disposer removing it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function subscribePluginSettings(listener: () => void): () => void;
|
|
23
|
+
/** Open this plugin's page on the Plugins panel, when the client UI is served. */
|
|
24
|
+
export declare function openPluginSettings(): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
// The plugin's installed package name. The Plugins page keys
|
|
5
|
+
// `plugins.bundle.config` by the bundle package name, so it must match
|
|
6
|
+
// package.json's `name`.
|
|
7
|
+
export const PLUGIN_PACKAGE = "@exagone313/dsh-podman";
|
|
8
|
+
// The service the apply closure adopted, or undefined before it mounts (and
|
|
9
|
+
// after a plugin reload). A missing service makes the button a no-op rather
|
|
10
|
+
// than a failed click.
|
|
11
|
+
let navigation;
|
|
12
|
+
// Render seats observing adoption, so the pane's settings action appears as
|
|
13
|
+
// soon as the face does and disappears with it.
|
|
14
|
+
const listeners = new Set();
|
|
15
|
+
/**
|
|
16
|
+
* Record the plugin-navigation service (or clear it).
|
|
17
|
+
* @param service - the live service, or undefined on teardown.
|
|
18
|
+
*/
|
|
19
|
+
export function setPluginNavigation(service) {
|
|
20
|
+
if (navigation === service)
|
|
21
|
+
return;
|
|
22
|
+
navigation = service;
|
|
23
|
+
for (const listener of listeners)
|
|
24
|
+
listener();
|
|
25
|
+
}
|
|
26
|
+
/** Whether a plugin-navigation face is currently adopted. */
|
|
27
|
+
export function pluginSettingsAvailable() {
|
|
28
|
+
return navigation !== undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Observe whether the navigation face is available.
|
|
32
|
+
* @param listener - invoked when the face is adopted or cleared.
|
|
33
|
+
* @returns the disposer removing it.
|
|
34
|
+
*/
|
|
35
|
+
export function subscribePluginSettings(listener) {
|
|
36
|
+
listeners.add(listener);
|
|
37
|
+
return () => {
|
|
38
|
+
listeners.delete(listener);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** Open this plugin's page on the Plugins panel, when the client UI is served. */
|
|
42
|
+
export function openPluginSettings() {
|
|
43
|
+
navigation?.openBundle(PLUGIN_PACKAGE);
|
|
44
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PropsLocale, PropsRuntime } from "@deepseek-ai/dsh-client-ui-slots";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { NS } from "./locales.js";
|
|
4
|
+
export type PodmanContainersGuideProps = PropsRuntime<"sidebar.right.tab.guide.entry"> & PropsLocale<typeof NS>;
|
|
5
|
+
export declare function PodmanContainersGuide(props: PodmanContainersGuideProps): ReactNode;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
3
|
+
//
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
// The workspace Containers panel's guide card: one capsule saying what the
|
|
6
|
+
// panel shows, and a click that opens it in the guide tab's place. Unlike the
|
|
7
|
+
// terminal's card it has nothing to choose, so the capsule the guide would draw
|
|
8
|
+
// itself is all it needs; it is still this plugin's own card so the entry reads
|
|
9
|
+
// in the same vocabulary as the terminal's.
|
|
10
|
+
import { PluginArtworkDefault } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
11
|
+
import { PODMAN_CONTAINERS_KIND } from "./containers-tab.js";
|
|
12
|
+
export function PodmanContainersGuide(props) {
|
|
13
|
+
const { tab } = props.useTabInfo();
|
|
14
|
+
return (_jsxs("button", { type: "button", style: CARD_STYLE, "data-sidebar-right-guide-entry": props.kind, onClick: () => {
|
|
15
|
+
// Replace the guide tab in place, exactly like the shipped entry
|
|
16
|
+
// capsules: the guide is a doorway, not a page that stays open.
|
|
17
|
+
tab.actions.openTab(PODMAN_CONTAINERS_KIND, { replaceTab: true });
|
|
18
|
+
}, children: [_jsx("span", { style: ICON_STYLE, "aria-hidden": "true", children: _jsx(PluginArtworkDefault, { size: 22 }) }), _jsxs("span", { style: TEXT_STYLE, children: [_jsx("span", { style: TITLE_STYLE, children: props.title }), props.description === undefined
|
|
19
|
+
? null
|
|
20
|
+
: _jsx("span", { style: DESCRIPTION_STYLE, children: props.description })] })] }));
|
|
21
|
+
}
|
|
22
|
+
// The card mirrors the harness guide capsule skin (`GuideBody .entry`): same
|
|
23
|
+
// padding, radius token, border and background as the entries beside it, so the
|
|
24
|
+
// glyph and title line up. Being a button, it also carries the capsule's
|
|
25
|
+
// pointer cursor and left-aligned text.
|
|
26
|
+
const CARD_STYLE = {
|
|
27
|
+
display: "flex",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
gap: "14px",
|
|
30
|
+
boxSizing: "border-box",
|
|
31
|
+
width: "100%",
|
|
32
|
+
minHeight: "56px",
|
|
33
|
+
padding: "14px 20px",
|
|
34
|
+
color: "var(--dsw-alias-label-primary)",
|
|
35
|
+
font: "inherit",
|
|
36
|
+
textAlign: "left",
|
|
37
|
+
cursor: "pointer",
|
|
38
|
+
border: "0.5px solid var(--dsw-alias-border-l3)",
|
|
39
|
+
borderRadius: "var(--dsl-guide-entry-radius)",
|
|
40
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
41
|
+
};
|
|
42
|
+
const ICON_STYLE = {
|
|
43
|
+
display: "flex",
|
|
44
|
+
flex: "none",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
width: "26px",
|
|
48
|
+
height: "26px",
|
|
49
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
50
|
+
};
|
|
51
|
+
const TEXT_STYLE = {
|
|
52
|
+
display: "flex",
|
|
53
|
+
flex: 1,
|
|
54
|
+
flexDirection: "column",
|
|
55
|
+
gap: "2px",
|
|
56
|
+
minWidth: 0,
|
|
57
|
+
};
|
|
58
|
+
const TITLE_STYLE = {
|
|
59
|
+
overflow: "hidden",
|
|
60
|
+
color: "var(--dsw-alias-label-primary)",
|
|
61
|
+
fontSize: "14px",
|
|
62
|
+
lineHeight: 1.4,
|
|
63
|
+
whiteSpace: "nowrap",
|
|
64
|
+
textOverflow: "ellipsis",
|
|
65
|
+
};
|
|
66
|
+
const DESCRIPTION_STYLE = {
|
|
67
|
+
overflow: "hidden",
|
|
68
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
69
|
+
fontSize: "11px",
|
|
70
|
+
lineHeight: 1.4,
|
|
71
|
+
whiteSpace: "nowrap",
|
|
72
|
+
textOverflow: "ellipsis",
|
|
73
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Context as ClientContext } from "@deepseek-ai/cordis";
|
|
2
|
+
export declare const CONTAINERS_PANEL_CLASS = "dsh-podman-containers-panel";
|
|
3
|
+
export declare const CONTAINERS_PANEL_STYLES = "\n.dsh-podman-containers-panel > .dsh-podman-table-card {\n border: 0 !important;\n}\n";
|
|
4
|
+
/** Inject the panel's border override for the owning plugin lifetime. */
|
|
5
|
+
export declare function installContainersPanelStyles(ctx: ClientContext): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
import { TABLE_CARD_CLASS } from "./container-card-table-styles.js";
|
|
5
|
+
// The class on the workspace containers panel's own wrapper. The panel renders
|
|
6
|
+
// the settings page's WorkspaceSection, whose card keeps everything it draws in
|
|
7
|
+
// the panel — its fill, its padding and the rules between its own rows — but not
|
|
8
|
+
// its outline: the pane is already the surface, so the card's border would only
|
|
9
|
+
// draw a box inside a box. Keying the override to this wrapper is what leaves the
|
|
10
|
+
// settings page's card exactly as it was, since no card there sits under it.
|
|
11
|
+
export const CONTAINERS_PANEL_CLASS = "dsh-podman-containers-panel";
|
|
12
|
+
// The card's border is an inline style (`card` in container-card-styles.ts), so
|
|
13
|
+
// only an important declaration can drop it; the rule touches no other property,
|
|
14
|
+
// which is what keeps the card's own look inside the panel unchanged.
|
|
15
|
+
export const CONTAINERS_PANEL_STYLES = `
|
|
16
|
+
.${CONTAINERS_PANEL_CLASS} > .${TABLE_CARD_CLASS} {
|
|
17
|
+
border: 0 !important;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
/** Inject the panel's border override for the owning plugin lifetime. */
|
|
21
|
+
export function installContainersPanelStyles(ctx) {
|
|
22
|
+
if (typeof document === "undefined")
|
|
23
|
+
return;
|
|
24
|
+
ctx.effect(() => {
|
|
25
|
+
const tag = document.createElement("style");
|
|
26
|
+
tag.dataset.plugin = "@exagone313/dsh-podman";
|
|
27
|
+
tag.textContent = CONTAINERS_PANEL_STYLES;
|
|
28
|
+
document.head.appendChild(tag);
|
|
29
|
+
return () => {
|
|
30
|
+
tag.remove();
|
|
31
|
+
};
|
|
32
|
+
}, "podman: containers panel styles");
|
|
33
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from "@deepseek-ai/dsh-client-ui-slots";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import type { ContainerCardFace } from "./container-card-controller.js";
|
|
4
|
+
import { NS } from "./locales.js";
|
|
5
|
+
/** Everything the tab body is given: framework shares plus the injected card face. */
|
|
6
|
+
export interface PodmanContainersInjected extends ContainerCardFace {
|
|
7
|
+
/** Owning session, resolved by the host to its own workspace. */
|
|
8
|
+
readonly sessionId: string;
|
|
9
|
+
}
|
|
10
|
+
export type PodmanContainersProps = PropsRuntime<"sidebar.right.pane.tab"> & PropsLocale<typeof NS> & InjectFace<PodmanContainersInjected>;
|
|
11
|
+
export declare function PodmanContainers(props: PodmanContainersProps): ReactNode;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
3
|
+
//
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
// The Containers right-Sidebar tab's body: the Session workspace's containers
|
|
6
|
+
// only, rendered as the same workspace block the settings card shows — the
|
|
7
|
+
// workspace's name, its copyable ID, its running-container count and its Add
|
|
8
|
+
// container / Remove containers actions, followed by the full container rows
|
|
9
|
+
// with their labelled fields. The workspace is the Session's own — never
|
|
10
|
+
// chosen, never shown as another workspace's rows — and it is resolved once
|
|
11
|
+
// through the host route the terminal uses.
|
|
12
|
+
//
|
|
13
|
+
// The slot body is unpadded, so this pane brings its own insets and scroll
|
|
14
|
+
// container. The settings action opens the harness's Plugins panel and is
|
|
15
|
+
// hidden while no plugin-navigation face is mounted, rather than doing nothing
|
|
16
|
+
// silently.
|
|
17
|
+
import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
18
|
+
import { useEffect, useState, useSyncExternalStore, } from "react";
|
|
19
|
+
import { hint } from "./container-card-styles.js";
|
|
20
|
+
import { WorkspaceSection } from "./container-card-workspace.js";
|
|
21
|
+
import { containersInWorkspace } from "./container-panel-scope.js";
|
|
22
|
+
import { openPluginSettings, pluginSettingsAvailable, subscribePluginSettings, } from "./plugin-navigation.js";
|
|
23
|
+
import { CONTAINERS_PANEL_CLASS } from "./podman-containers-styles.js";
|
|
24
|
+
import { fetchTerminalTarget } from "./terminal-transport.js";
|
|
25
|
+
export function PodmanContainers(props) {
|
|
26
|
+
const { t, sessionId } = props;
|
|
27
|
+
const state = props.useContainerCard((snapshot) => snapshot);
|
|
28
|
+
// The settings action opens the harness's Plugins panel, whose navigation
|
|
29
|
+
// face the plugin-manager client UI provides lazily. The pane follows that
|
|
30
|
+
// availability through this module's store rather than reading a service, so
|
|
31
|
+
// a shell without the UI hides the action instead of offering a failed click.
|
|
32
|
+
const settingsAvailable = useSyncExternalStore(subscribePluginSettings, pluginSettingsAvailable);
|
|
33
|
+
// The host resolves the Session's workspace from the Session itself; the
|
|
34
|
+
// browser neither chooses nor guesses one. `failed` means it cannot place this
|
|
35
|
+
// session in a workspace, so the panel says so instead of listing every row.
|
|
36
|
+
const [target, setTarget] = useState({ phase: "loading" });
|
|
37
|
+
const scope = target.phase === "ready" ? target.target : undefined;
|
|
38
|
+
const listedWorkspace = scope === undefined
|
|
39
|
+
? undefined
|
|
40
|
+
: state.workspaces.find((entry) => entry.workspaceSlug === scope.workspaceSlug);
|
|
41
|
+
// The settings snapshot may not have listed the workspace yet; the host's
|
|
42
|
+
// target already names it, so the header can still render its identity while
|
|
43
|
+
// the full row follows.
|
|
44
|
+
const workspace = scope === undefined || scope.workspaceSlug === ""
|
|
45
|
+
? undefined
|
|
46
|
+
: listedWorkspace ?? {
|
|
47
|
+
workspaceSlug: scope.workspaceSlug,
|
|
48
|
+
projectName: scope.workspace,
|
|
49
|
+
containerName: "",
|
|
50
|
+
imageId: "",
|
|
51
|
+
status: "",
|
|
52
|
+
createdAt: "",
|
|
53
|
+
mounts: [],
|
|
54
|
+
};
|
|
55
|
+
// The card snapshot is the only source of containers, and the settings scope
|
|
56
|
+
// may not have loaded when this tab opens.
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
props.reload();
|
|
59
|
+
}, [props.reload]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
const controller = new AbortController();
|
|
62
|
+
setTarget({ phase: "loading" });
|
|
63
|
+
void fetchTerminalTarget(sessionId, controller.signal).then((resolved) => {
|
|
64
|
+
if (!controller.signal.aborted) {
|
|
65
|
+
setTarget({ phase: "ready", target: resolved });
|
|
66
|
+
}
|
|
67
|
+
}, (error) => {
|
|
68
|
+
if (controller.signal.aborted)
|
|
69
|
+
return;
|
|
70
|
+
setTarget({
|
|
71
|
+
phase: "failed",
|
|
72
|
+
message: error instanceof Error ? error.message : String(error),
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
return () => {
|
|
76
|
+
controller.abort();
|
|
77
|
+
};
|
|
78
|
+
}, [sessionId]);
|
|
79
|
+
const containers = containersInWorkspace(state.containers, scope);
|
|
80
|
+
// The workspace header is the settings card's own block header, with this
|
|
81
|
+
// pane's settings action appended to its action group. Both places render the
|
|
82
|
+
// same identity, copy button, count and Add/Remove controls.
|
|
83
|
+
const settingsAction = settingsAvailable
|
|
84
|
+
? (_jsx(Button, { variant: "outline", size: "sm", onClick: openPluginSettings, children: t("moreSettings") }))
|
|
85
|
+
: undefined;
|
|
86
|
+
return (_jsx("section", { className: CONTAINERS_PANEL_CLASS, style: PANE_STYLE, "data-dsh-podman-containers": true, children: state.loadState === "loading"
|
|
87
|
+
? _jsx("p", { style: hint, role: "status", children: t("loading") })
|
|
88
|
+
: !state.available
|
|
89
|
+
? _jsx("p", { style: hint, role: "alert", children: t("unavailable") })
|
|
90
|
+
: target.phase === "loading"
|
|
91
|
+
? _jsx("p", { style: hint, role: "status", children: t("loading") })
|
|
92
|
+
: target.phase === "failed"
|
|
93
|
+
? _jsx("p", { style: hint, role: "alert", children: target.message })
|
|
94
|
+
: workspace === undefined
|
|
95
|
+
? _jsx("p", { style: hint, role: "status", children: t("containersPanelNoWorkspace") })
|
|
96
|
+
: (_jsx(WorkspaceSection, { t: t, workspace: workspace, containers: containers, images: state.images, volumes: state.volumes, secrets: state.secrets, busy: state.busy, writable: state.writable, locale: state.locale, pendingActions: state.pendingActions, defaultImage: state.defaultImage, defaultEnv: state.containerEnv, projectsRoot: state.projectsRoot, directoryPicker: state.directoryPicker, onRemove: props.remove, onRecreate: props.recreate, onRemoveWorkspace: props.removeWorkspace, onCreate: props.createContainer, onCreateSecret: props.createSecret, onStartContainer: props.startContainer, onApplyContainerConfig: props.applyContainerConfig, gatewayUnavailable: state.gatewayState === "absent" ||
|
|
97
|
+
state.gatewayState === "incompatible", extraAction: settingsAction })) }));
|
|
98
|
+
}
|
|
99
|
+
// The slot body has no padding of its own, so the pane supplies its insets and
|
|
100
|
+
// scrolls the workspace block as one unit. The pane is the panel's one surface:
|
|
101
|
+
// the card it holds draws no outline here (see podman-containers-styles.ts),
|
|
102
|
+
// while its fill, padding and inner rules stay exactly as the settings page
|
|
103
|
+
// renders them.
|
|
104
|
+
const PANE_STYLE = {
|
|
105
|
+
boxSizing: "border-box",
|
|
106
|
+
height: "100%",
|
|
107
|
+
minHeight: 0,
|
|
108
|
+
overflowY: "auto",
|
|
109
|
+
padding: "10px",
|
|
110
|
+
color: "var(--dsw-alias-label-primary)",
|
|
111
|
+
background: "var(--dsw-alias-bg-layer-2)",
|
|
112
|
+
fontSize: "13px",
|
|
113
|
+
};
|
package/dist/fs-guard.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
// guardDecision compares an observed version with the target's current one. An
|
|
5
|
+
// absent current version means the target is gone, which the edit guard reports
|
|
6
|
+
// as not found; an unobserved caller (no expected version) is unguarded and may
|
|
7
|
+
// proceed; otherwise the two versions must match exactly.
|
|
8
|
+
export function guardDecision(expectedVersion, currentVersion) {
|
|
9
|
+
if (currentVersion === undefined)
|
|
10
|
+
return "missing";
|
|
11
|
+
if (expectedVersion === undefined)
|
|
12
|
+
return "unchanged";
|
|
13
|
+
return expectedVersion === currentVersion ? "unchanged" : "stale";
|
|
14
|
+
}
|
package/dist/fs-key.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeFsKey(path: string): string;
|
package/dist/fs-key.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
// The target key the observation policy records and the stale guards compare.
|
|
5
|
+
// One file can reach resolve() through different spellings — a doubled slash, a
|
|
6
|
+
// "." segment, a trailing slash, or a ".." left by a relative path — and they
|
|
7
|
+
// must share one record, so the key is collapsed lexically. Symbolic links are
|
|
8
|
+
// deliberately not resolved: the key is the guest path the caller named, not a
|
|
9
|
+
// realpath, and two links to one file stay distinct targets.
|
|
10
|
+
export function normalizeFsKey(path) {
|
|
11
|
+
const absolute = path.startsWith("/");
|
|
12
|
+
const segments = [];
|
|
13
|
+
for (const segment of path.split("/")) {
|
|
14
|
+
if (segment === "" || segment === ".")
|
|
15
|
+
continue;
|
|
16
|
+
if (segment === "..") {
|
|
17
|
+
segments.pop();
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
segments.push(segment);
|
|
21
|
+
}
|
|
22
|
+
const joined = segments.join("/");
|
|
23
|
+
if (absolute)
|
|
24
|
+
return `/${joined}`;
|
|
25
|
+
return joined === "" ? "." : joined;
|
|
26
|
+
}
|