@exagone313/dsh-podman 1.0.3 → 1.1.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.
- package/README.md +1 -0
- package/README.zh.md +1 -0
- package/dist/approval-reasons.d.ts +12 -0
- package/dist/approval-reasons.js +15 -0
- package/dist/approval.js +21 -0
- package/dist/card-route.js +83 -1
- package/dist/client/ContainerCard.js +14 -2
- package/dist/client/card-protocol.d.ts +16 -1
- package/dist/client/container-card-controller.d.ts +8 -2
- package/dist/client/container-card-controller.js +21 -0
- package/dist/client/container-card-ports.d.ts +13 -0
- package/dist/client/container-card-ports.js +74 -0
- package/dist/client/container-card-row.d.ts +3 -0
- package/dist/client/container-card-row.js +12 -2
- package/dist/client/container-card-workspace.d.ts +3 -0
- package/dist/client/container-card-workspace.js +2 -2
- package/dist/client/index.js +653 -386
- package/dist/client/locales.d.ts +1 -1
- package/dist/client/locales.js +30 -0
- package/dist/client/tool-presentations.d.ts +167 -0
- package/dist/client/tool-presentations.js +167 -0
- package/dist/client/tool-views.d.ts +1 -2
- package/dist/client/tool-views.js +54 -190
- package/dist/generated/version.d.ts +2 -2
- package/dist/generated/version.js +2 -2
- package/dist/grpc/proto/dshctl/v1/control.proto +47 -1
- package/dist/grpc/proto/dshgateway/v1/gateway.proto +89 -0
- package/dist/grpc/proto/dshguest/v1/guest.proto +17 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/public.d.ts +1 -0
- package/dist/public.js +14 -0
- package/dist/publish-port.d.ts +6 -0
- package/dist/publish-port.js +37 -0
- package/dist/tool-defs.js +15 -1
- package/dist/tool-handlers.js +31 -1
- package/dist/tool-params.d.ts +48 -0
- package/dist/tool-params.js +42 -0
- package/docs/architecture.md +44 -7
- package/docs/architecture.zh.md +38 -6
- package/docs/configuration.md +25 -0
- package/docs/configuration.zh.md +23 -0
- package/docs/development.md +17 -6
- package/docs/development.zh.md +16 -6
- package/docs/install-dsh-and-dsh-podman.md +10 -4
- package/docs/install-dsh-and-dsh-podman.zh.md +9 -3
- package/docs/uninstall.md +4 -3
- package/docs/uninstall.zh.md +3 -2
- package/docs/update.md +23 -6
- package/docs/update.zh.md +23 -6
- package/docs/usage.md +48 -13
- package/docs/usage.zh.md +31 -2
- package/package.json +3 -1
- package/quadlet/dsh-podman-gateway.container +23 -0
- package/quadlet/dsh-podman-orchestrator.container +1 -1
- package/quadlet/dsh.container +1 -1
- package/dist/approval-reasons.test.d.ts +0 -1
- package/dist/approval-reasons.test.js +0 -143
- package/dist/approval.test.d.ts +0 -1
- package/dist/approval.test.js +0 -593
- package/dist/card-route.test.d.ts +0 -1
- package/dist/card-route.test.js +0 -223
- package/dist/card-test-support.d.ts +0 -15
- package/dist/card-test-support.js +0 -133
- package/dist/container-env.test.d.ts +0 -1
- package/dist/container-env.test.js +0 -93
- package/dist/containers.test.d.ts +0 -1
- package/dist/containers.test.js +0 -621
- package/dist/daemons.test.d.ts +0 -1
- package/dist/daemons.test.js +0 -167
- package/dist/dsh-version.test.d.ts +0 -1
- package/dist/dsh-version.test.js +0 -25
- package/dist/env-rows.test.d.ts +0 -1
- package/dist/env-rows.test.js +0 -43
- package/dist/fs-provider.test.d.ts +0 -1
- package/dist/fs-provider.test.js +0 -301
- package/dist/guest-rpc.test.d.ts +0 -1
- package/dist/guest-rpc.test.js +0 -241
- package/dist/images.test.d.ts +0 -1
- package/dist/images.test.js +0 -86
- package/dist/locales.test.d.ts +0 -1
- package/dist/locales.test.js +0 -34
- package/dist/misc.test.d.ts +0 -1
- package/dist/misc.test.js +0 -169
- package/dist/mounts.test.d.ts +0 -1
- package/dist/mounts.test.js +0 -478
- package/dist/naming.test.d.ts +0 -1
- package/dist/naming.test.js +0 -28
- package/dist/package-deps.test.d.ts +0 -1
- package/dist/package-deps.test.js +0 -49
- package/dist/paths.test.d.ts +0 -1
- package/dist/paths.test.js +0 -76
- package/dist/plugin-meta.test.d.ts +0 -1
- package/dist/plugin-meta.test.js +0 -29
- package/dist/project-path.test.d.ts +0 -1
- package/dist/project-path.test.js +0 -66
- package/dist/read-only-shell.test.d.ts +0 -1
- package/dist/read-only-shell.test.js +0 -182
- package/dist/runtime-client.test.d.ts +0 -1
- package/dist/runtime-client.test.js +0 -53
- package/dist/secrets.test.d.ts +0 -1
- package/dist/secrets.test.js +0 -196
- package/dist/settings-commands.test.d.ts +0 -1
- package/dist/settings-commands.test.js +0 -596
- package/dist/settings-create.test.d.ts +0 -1
- package/dist/settings-create.test.js +0 -416
- package/dist/settings-default-env.test.d.ts +0 -1
- package/dist/settings-default-env.test.js +0 -175
- package/dist/settings-mounts.test.d.ts +0 -1
- package/dist/settings-mounts.test.js +0 -506
- package/dist/settings-paths.test.d.ts +0 -1
- package/dist/settings-paths.test.js +0 -65
- package/dist/settings-schema.test.d.ts +0 -1
- package/dist/settings-schema.test.js +0 -35
- package/dist/settings-workspaces.test.d.ts +0 -1
- package/dist/settings-workspaces.test.js +0 -240
- package/dist/spill-store.test.d.ts +0 -1
- package/dist/spill-store.test.js +0 -82
- package/dist/subprocess.test.d.ts +0 -1
- package/dist/subprocess.test.js +0 -344
- package/dist/terminal-preference.test.d.ts +0 -1
- package/dist/terminal-preference.test.js +0 -62
- package/dist/terminal-route.test.d.ts +0 -1
- package/dist/terminal-route.test.js +0 -265
- package/dist/terminal-tab.test.d.ts +0 -1
- package/dist/terminal-tab.test.js +0 -58
- package/dist/terminal-targets.test.d.ts +0 -1
- package/dist/terminal-targets.test.js +0 -43
- package/dist/terminal-titles.test.d.ts +0 -1
- package/dist/terminal-titles.test.js +0 -36
- package/dist/test-support.d.ts +0 -358
- package/dist/test-support.js +0 -499
- package/dist/version-compat.test.d.ts +0 -1
- package/dist/version-compat.test.js +0 -27
- package/dist/views.test.d.ts +0 -1
- package/dist/views.test.js +0 -23
- package/dist/volumes.test.d.ts +0 -1
- package/dist/volumes.test.js +0 -40
- package/dist/workspace-binding.test.d.ts +0 -1
- package/dist/workspace-binding.test.js +0 -523
|
@@ -4,196 +4,55 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
4
4
|
// SPDX-License-Identifier: MIT
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { DisclosureRow, IconApiOutlineRegular, IconArchiveOutlineRegular, IconBrowseOutlineRegular, IconDataOutlineRegular, IconEditOutlineRegular, IconFolderOpenOutlineRegular, IconLinkOutlineRegular, IconPlayOutlineRegular, IconPlusOutlineRegular, IconRefreshOutlineRegular, IconSearchOutlineRegular, IconSparkleRegular, IconStopFillRegular, IconTrashOutlineRegular, StateDot, TerminalBlock, } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
7
|
+
import { toolPresentation } from "./tool-presentations.js";
|
|
8
|
+
export { TOOL_VIEW_KEYS } from "./tool-presentations.js";
|
|
7
9
|
import { TERMINAL_CLASS } from "./terminal-styles.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
container_recreate: {
|
|
55
|
-
titleKey: "toolTitle_container_recreate",
|
|
56
|
-
icon: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
57
|
-
summaryKeys: ["container", "image"],
|
|
58
|
-
},
|
|
59
|
-
container_remove: {
|
|
60
|
-
titleKey: "toolTitle_container_remove",
|
|
61
|
-
icon: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
62
|
-
summaryKeys: ["container"],
|
|
63
|
-
},
|
|
64
|
-
container_mount_list: {
|
|
65
|
-
titleKey: "toolTitle_container_mount_list",
|
|
66
|
-
icon: _jsx(IconFolderOpenOutlineRegular, { size: 14 }),
|
|
67
|
-
summaryKeys: ["container"],
|
|
68
|
-
},
|
|
69
|
-
container_mount_add: {
|
|
70
|
-
titleKey: "toolTitle_container_mount_add",
|
|
71
|
-
icon: _jsx(IconFolderOpenOutlineRegular, { size: 14 }),
|
|
72
|
-
summaryKeys: ["container", "kind"],
|
|
73
|
-
},
|
|
74
|
-
container_mount_remove: {
|
|
75
|
-
titleKey: "toolTitle_container_mount_remove",
|
|
76
|
-
icon: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
77
|
-
summaryKeys: ["container"],
|
|
78
|
-
},
|
|
79
|
-
container_mount_update: {
|
|
80
|
-
titleKey: "toolTitle_container_mount_update",
|
|
81
|
-
icon: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
82
|
-
summaryKeys: ["container", "mode"],
|
|
83
|
-
},
|
|
84
|
-
container_path_set: {
|
|
85
|
-
titleKey: "toolTitle_container_path_set",
|
|
86
|
-
icon: _jsx(IconEditOutlineRegular, { size: 14 }),
|
|
87
|
-
summaryKeys: ["container"],
|
|
88
|
-
},
|
|
89
|
-
container_path_add: {
|
|
90
|
-
titleKey: "toolTitle_container_path_add",
|
|
91
|
-
icon: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
92
|
-
summaryKeys: ["container", "path"],
|
|
93
|
-
},
|
|
94
|
-
container_path_remove: {
|
|
95
|
-
titleKey: "toolTitle_container_path_remove",
|
|
96
|
-
icon: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
97
|
-
summaryKeys: ["container", "path"],
|
|
98
|
-
},
|
|
99
|
-
container_secret_add: {
|
|
100
|
-
titleKey: "toolTitle_container_secret_add",
|
|
101
|
-
icon: _jsx(IconLinkOutlineRegular, { size: 14 }),
|
|
102
|
-
summaryKeys: ["container", "env"],
|
|
103
|
-
},
|
|
104
|
-
container_secret_remove: {
|
|
105
|
-
titleKey: "toolTitle_container_secret_remove",
|
|
106
|
-
icon: _jsx(IconLinkOutlineRegular, { size: 14 }),
|
|
107
|
-
summaryKeys: ["container", "env"],
|
|
108
|
-
},
|
|
109
|
-
image_list: {
|
|
110
|
-
titleKey: "toolTitle_image_list",
|
|
111
|
-
icon: _jsx(IconArchiveOutlineRegular, { size: 14 }),
|
|
112
|
-
summaryKeys: [],
|
|
113
|
-
},
|
|
114
|
-
image_get: {
|
|
115
|
-
titleKey: "toolTitle_image_get",
|
|
116
|
-
icon: _jsx(IconArchiveOutlineRegular, { size: 14 }),
|
|
117
|
-
summaryKeys: ["imageId"],
|
|
118
|
-
},
|
|
119
|
-
image_build: {
|
|
120
|
-
titleKey: "toolTitle_image_build",
|
|
121
|
-
icon: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
122
|
-
summaryKeys: ["imageId", "parent"],
|
|
123
|
-
},
|
|
124
|
-
image_rebuild: {
|
|
125
|
-
titleKey: "toolTitle_image_rebuild",
|
|
126
|
-
icon: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
127
|
-
summaryKeys: ["imageId"],
|
|
128
|
-
},
|
|
129
|
-
image_rebuild_all: {
|
|
130
|
-
titleKey: "toolTitle_image_rebuild_all",
|
|
131
|
-
icon: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
132
|
-
summaryKeys: [],
|
|
133
|
-
},
|
|
134
|
-
image_remove: {
|
|
135
|
-
titleKey: "toolTitle_image_remove",
|
|
136
|
-
icon: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
137
|
-
summaryKeys: ["imageId"],
|
|
138
|
-
},
|
|
139
|
-
volume_list: {
|
|
140
|
-
titleKey: "toolTitle_volume_list",
|
|
141
|
-
icon: _jsx(IconDataOutlineRegular, { size: 14 }),
|
|
142
|
-
summaryKeys: [],
|
|
143
|
-
},
|
|
144
|
-
volume_create: {
|
|
145
|
-
titleKey: "toolTitle_volume_create",
|
|
146
|
-
icon: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
147
|
-
summaryKeys: ["name"],
|
|
148
|
-
},
|
|
149
|
-
volume_remove: {
|
|
150
|
-
titleKey: "toolTitle_volume_remove",
|
|
151
|
-
icon: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
152
|
-
summaryKeys: ["name"],
|
|
153
|
-
},
|
|
154
|
-
secret_list: {
|
|
155
|
-
titleKey: "toolTitle_secret_list",
|
|
156
|
-
icon: _jsx(IconLinkOutlineRegular, { size: 14 }),
|
|
157
|
-
summaryKeys: [],
|
|
158
|
-
},
|
|
159
|
-
secret_create: {
|
|
160
|
-
titleKey: "toolTitle_secret_create",
|
|
161
|
-
icon: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
162
|
-
summaryKeys: ["name"],
|
|
163
|
-
},
|
|
164
|
-
secret_remove: {
|
|
165
|
-
titleKey: "toolTitle_secret_remove",
|
|
166
|
-
icon: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
167
|
-
summaryKeys: ["name"],
|
|
168
|
-
},
|
|
169
|
-
daemon_start: {
|
|
170
|
-
titleKey: "toolTitle_daemon_start",
|
|
171
|
-
icon: _jsx(IconPlayOutlineRegular, { size: 14 }),
|
|
172
|
-
summaryKeys: ["name"],
|
|
173
|
-
},
|
|
174
|
-
daemon_list: {
|
|
175
|
-
titleKey: "toolTitle_daemon_list",
|
|
176
|
-
icon: _jsx(IconPlayOutlineRegular, { size: 14 }),
|
|
177
|
-
summaryKeys: ["container"],
|
|
178
|
-
},
|
|
179
|
-
daemon_logs: {
|
|
180
|
-
titleKey: "toolTitle_daemon_logs",
|
|
181
|
-
icon: _jsx(IconBrowseOutlineRegular, { size: 14 }),
|
|
182
|
-
summaryKeys: ["name"],
|
|
183
|
-
},
|
|
184
|
-
daemon_restart: {
|
|
185
|
-
titleKey: "toolTitle_daemon_restart",
|
|
186
|
-
icon: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
187
|
-
summaryKeys: ["name"],
|
|
188
|
-
},
|
|
189
|
-
daemon_stop: {
|
|
190
|
-
titleKey: "toolTitle_daemon_stop",
|
|
191
|
-
icon: _jsx(IconStopFillRegular, { size: 14 }),
|
|
192
|
-
summaryKeys: ["name"],
|
|
193
|
-
},
|
|
10
|
+
// A domain-owned row for every podman tool, registered over the keyed
|
|
11
|
+
// `tool.call.toolview` slot. Without it the shipped client renders each call as
|
|
12
|
+
// "Tool call · <tool name>"; this row owns the icon, title, summary and body.
|
|
13
|
+
// The icon each row leads with, exhaustive over the data table: a tool added
|
|
14
|
+
// without an icon fails the build rather than silently falling back.
|
|
15
|
+
const TOOL_ICONS = {
|
|
16
|
+
container_bash: _jsx(IconApiOutlineRegular, { size: 14 }),
|
|
17
|
+
container_exec: _jsx(IconApiOutlineRegular, { size: 14 }),
|
|
18
|
+
container_read: _jsx(IconBrowseOutlineRegular, { size: 14 }),
|
|
19
|
+
container_write: _jsx(IconEditOutlineRegular, { size: 14 }),
|
|
20
|
+
container_edit: _jsx(IconEditOutlineRegular, { size: 14 }),
|
|
21
|
+
container_glob: _jsx(IconSearchOutlineRegular, { size: 14 }),
|
|
22
|
+
container_grep: _jsx(IconSearchOutlineRegular, { size: 14 }),
|
|
23
|
+
container_list: _jsx(IconDataOutlineRegular, { size: 14 }),
|
|
24
|
+
container_start: _jsx(IconPlayOutlineRegular, { size: 14 }),
|
|
25
|
+
container_recreate: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
26
|
+
container_remove: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
27
|
+
container_mount_list: _jsx(IconFolderOpenOutlineRegular, { size: 14 }),
|
|
28
|
+
container_mount_add: _jsx(IconFolderOpenOutlineRegular, { size: 14 }),
|
|
29
|
+
container_mount_remove: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
30
|
+
container_mount_update: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
31
|
+
container_publish_port: _jsx(IconLinkOutlineRegular, { size: 14 }),
|
|
32
|
+
container_unpublish_port: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
33
|
+
container_path_set: _jsx(IconEditOutlineRegular, { size: 14 }),
|
|
34
|
+
container_path_add: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
35
|
+
container_path_remove: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
36
|
+
container_secret_add: _jsx(IconLinkOutlineRegular, { size: 14 }),
|
|
37
|
+
container_secret_remove: _jsx(IconLinkOutlineRegular, { size: 14 }),
|
|
38
|
+
image_list: _jsx(IconArchiveOutlineRegular, { size: 14 }),
|
|
39
|
+
image_get: _jsx(IconArchiveOutlineRegular, { size: 14 }),
|
|
40
|
+
image_build: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
41
|
+
image_rebuild: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
42
|
+
image_rebuild_all: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
43
|
+
image_remove: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
44
|
+
volume_list: _jsx(IconDataOutlineRegular, { size: 14 }),
|
|
45
|
+
volume_create: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
46
|
+
volume_remove: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
47
|
+
secret_list: _jsx(IconLinkOutlineRegular, { size: 14 }),
|
|
48
|
+
secret_create: _jsx(IconPlusOutlineRegular, { size: 14 }),
|
|
49
|
+
secret_remove: _jsx(IconTrashOutlineRegular, { size: 14 }),
|
|
50
|
+
daemon_start: _jsx(IconPlayOutlineRegular, { size: 14 }),
|
|
51
|
+
daemon_list: _jsx(IconPlayOutlineRegular, { size: 14 }),
|
|
52
|
+
daemon_logs: _jsx(IconBrowseOutlineRegular, { size: 14 }),
|
|
53
|
+
daemon_restart: _jsx(IconRefreshOutlineRegular, { size: 14 }),
|
|
54
|
+
daemon_stop: _jsx(IconStopFillRegular, { size: 14 }),
|
|
194
55
|
};
|
|
195
|
-
/** The wire tool names this package owns a row for. */
|
|
196
|
-
export const TOOL_VIEW_KEYS = Object.keys(TOOL_PRESENTATION);
|
|
197
56
|
const sepStyle = {
|
|
198
57
|
flex: "none",
|
|
199
58
|
width: "2px",
|
|
@@ -262,6 +121,9 @@ function argSummary(args, keys, fallback) {
|
|
|
262
121
|
const value = args[key];
|
|
263
122
|
if (typeof value === "string" && value !== "")
|
|
264
123
|
return firstLine(value);
|
|
124
|
+
// Numeric operands (a pod port) are JSON numbers, not strings.
|
|
125
|
+
if (typeof value === "number")
|
|
126
|
+
return String(value);
|
|
265
127
|
if (Array.isArray(value) && value.length > 0) {
|
|
266
128
|
return firstLine(value.map((item) => String(item)).join(" "));
|
|
267
129
|
}
|
|
@@ -370,7 +232,7 @@ function terminalLabels(t) {
|
|
|
370
232
|
}
|
|
371
233
|
/** Render one podman tool call as an icon-titled, expandable row. */
|
|
372
234
|
export function PodmanToolRow({ toolName, block, cwd, home, inspect, t, }) {
|
|
373
|
-
const presentation =
|
|
235
|
+
const presentation = toolPresentation(toolName);
|
|
374
236
|
const title = presentation === undefined
|
|
375
237
|
? toolName
|
|
376
238
|
: t(presentation.titleKey);
|
|
@@ -397,7 +259,9 @@ export function PodmanToolRow({ toolName, block, cwd, home, inspect, t, }) {
|
|
|
397
259
|
? _jsx(StateDot, { state: "error" })
|
|
398
260
|
: state === "stopped"
|
|
399
261
|
? _jsx(StateDot, { state: "warning" })
|
|
400
|
-
: (presentation
|
|
262
|
+
: (presentation === undefined
|
|
263
|
+
? _jsx(IconSparkleRegular, { size: 14 })
|
|
264
|
+
: TOOL_ICONS[toolName]);
|
|
401
265
|
void inspect;
|
|
402
266
|
return (_jsx(DisclosureRow, { icon: leading, title: title, open: expanded && expandable, expandable: expandable, onToggle: () => setExpanded((value) => !value), expandOnRowClick: true, keepContentWhenOpen: true, collapsedContent: _jsxs(_Fragment, { children: [_jsx("span", { style: sepStyle, "aria-hidden": true }), _jsx("span", { style: failureLine !== null ? errorSummaryStyle : summaryStyle, children: summary })] }), children: terminal !== null
|
|
403
267
|
? (_jsx(TerminalBlock, { command: terminal.command, cwd: terminal.cwd, home: home, output: terminal.output, exitCode: terminal.exitCode, signal: terminal.signal, running: terminal.running, maxLines: MAX_RENDERED_LINES, className: TERMINAL_CLASS, labels: terminalLabels(t) }))
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.0
|
|
2
|
-
export declare const GIT_COMMIT = "
|
|
1
|
+
export declare const VERSION = "1.1.0";
|
|
2
|
+
export declare const GIT_COMMIT = "7afe2f3";
|
|
@@ -41,10 +41,14 @@ service OrchestratorControl {
|
|
|
41
41
|
rpc RemoveSecret(RemoveSecretRequest) returns (RemoveSecretResponse);
|
|
42
42
|
rpc AddContainerSecret(AddContainerSecretRequest) returns (Container);
|
|
43
43
|
rpc RemoveContainerSecret(RemoveContainerSecretRequest) returns (Container);
|
|
44
|
+
rpc PublishPort(PublishPortRequest) returns (PublishedPort);
|
|
45
|
+
rpc UnpublishPort(UnpublishPortRequest) returns (UnpublishPortResponse);
|
|
46
|
+
rpc ListPublishedPorts(ListPublishedPortsRequest) returns (ListPublishedPortsResponse);
|
|
47
|
+
rpc GetGatewayStatus(GetGatewayStatusRequest) returns (GetGatewayStatusResponse);
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
message GetVersionRequest {}
|
|
47
|
-
message GetVersionResponse { string version = 1; string commit = 2; }
|
|
51
|
+
message GetVersionResponse { string version = 1; string commit = 2; repeated string features = 3; }
|
|
48
52
|
message ListProjectsRequest {}
|
|
49
53
|
message ListProjectsResponse { repeated Project projects = 1; }
|
|
50
54
|
message Project { string name = 1; string host_path = 2; }
|
|
@@ -116,6 +120,7 @@ message Container {
|
|
|
116
120
|
map<string, string> env = 10;
|
|
117
121
|
map<string, string> secret_env = 11;
|
|
118
122
|
repeated string paths = 12;
|
|
123
|
+
repeated PublishedPort published_ports = 13;
|
|
119
124
|
}
|
|
120
125
|
message StartContainerRequest { string workspace_slug = 1; string container = 2; string image_id = 3; repeated ProjectMount mounts = 4; map<string, string> env = 5; map<string, string> secret_env = 6; repeated string paths = 7; }
|
|
121
126
|
message EnsureContainerRequest { string workspace_slug = 1; string container = 2; }
|
|
@@ -141,3 +146,44 @@ message RemoveSecretRequest { string name = 1; }
|
|
|
141
146
|
message RemoveSecretResponse {}
|
|
142
147
|
message AddContainerSecretRequest { string workspace_slug = 1; string container = 2; string env = 3; string secret = 4; }
|
|
143
148
|
message RemoveContainerSecretRequest { string workspace_slug = 1; string container = 2; string env = 3; }
|
|
149
|
+
|
|
150
|
+
// Protocol is the transport a published pod port speaks. Only TCP is
|
|
151
|
+
// implemented today; the others are reserved so the wire format does not have
|
|
152
|
+
// to change when they land.
|
|
153
|
+
enum Protocol { PROTOCOL_UNSPECIFIED = 0; PROTOCOL_TCP = 1; PROTOCOL_UDP = 2; PROTOCOL_HTTP = 3; }
|
|
154
|
+
|
|
155
|
+
// A pod port exposed on the host by the gateway. `address` is the host address
|
|
156
|
+
// the gateway bound — loopback today, a hostname once HTTP publishing arrives —
|
|
157
|
+
// and `endpoint` is the address string a caller shows the user, composed as
|
|
158
|
+
// "<scheme>://<address>:<host_port>".
|
|
159
|
+
message PublishedPort {
|
|
160
|
+
string container = 1;
|
|
161
|
+
Protocol protocol = 2;
|
|
162
|
+
uint32 port = 3;
|
|
163
|
+
string address = 4;
|
|
164
|
+
uint32 host_port = 5;
|
|
165
|
+
string endpoint = 6;
|
|
166
|
+
}
|
|
167
|
+
message PublishPortRequest { string workspace_slug = 1; string container = 2; uint32 port = 3; Protocol protocol = 4; uint32 suggested_host_port = 5; }
|
|
168
|
+
message UnpublishPortRequest { string workspace_slug = 1; string container = 2; uint32 port = 3; Protocol protocol = 4; }
|
|
169
|
+
message UnpublishPortResponse {}
|
|
170
|
+
message ListPublishedPortsRequest { string workspace_slug = 1; }
|
|
171
|
+
message ListPublishedPortsResponse { repeated PublishedPort published_ports = 1; }
|
|
172
|
+
|
|
173
|
+
// GatewayState is a coarse, internals-free view of the optional gateway. The
|
|
174
|
+
// settings card shows it, so it never carries a raw error or a socket path.
|
|
175
|
+
// UNSPECIFIED means the orchestrator has not probed the gateway yet.
|
|
176
|
+
enum GatewayState {
|
|
177
|
+
GATEWAY_STATE_UNSPECIFIED = 0;
|
|
178
|
+
GATEWAY_STATE_RUNNING = 1;
|
|
179
|
+
GATEWAY_STATE_ABSENT = 2;
|
|
180
|
+
GATEWAY_STATE_INCOMPATIBLE = 3;
|
|
181
|
+
}
|
|
182
|
+
message GetGatewayStatusRequest {}
|
|
183
|
+
message GetGatewayStatusResponse {
|
|
184
|
+
GatewayState state = 1;
|
|
185
|
+
string version = 2;
|
|
186
|
+
string commit = 3;
|
|
187
|
+
string instance = 4;
|
|
188
|
+
uint32 bindings = 5;
|
|
189
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
|
|
5
|
+
syntax = "proto3";
|
|
6
|
+
package dshgateway.v1;
|
|
7
|
+
option go_package = "github.com/Exagone313/dsh-podman/internal/genproto/dshgateway/v1;dshgatewayv1";
|
|
8
|
+
|
|
9
|
+
// Gateway bridges a host address to the Unix socket a guest agent publishes for
|
|
10
|
+
// a pod port. It runs on the host network so it can bind the host's loopback,
|
|
11
|
+
// and it mounts the same socket root as the orchestrator and the plugin.
|
|
12
|
+
//
|
|
13
|
+
// It is optional and never a source of truth: the orchestrator keeps the
|
|
14
|
+
// desired binding set in its own state and re-binds it on startup, after a
|
|
15
|
+
// gateway restart and after a container recreate. The gateway holds bindings
|
|
16
|
+
// only while a Lease stream is open, so a host port cannot outlive the
|
|
17
|
+
// orchestrator that asked for it.
|
|
18
|
+
service Gateway {
|
|
19
|
+
// GetVersion reports the gateway's version. It is exempt from the
|
|
20
|
+
// orchestrator-version check so a caller can always read it.
|
|
21
|
+
rpc GetVersion(GetVersionRequest) returns (GetVersionResponse);
|
|
22
|
+
// Bind exposes a published socket on a host address and returns the address
|
|
23
|
+
// and port it chose. It is idempotent per (podman_name, socket_name,
|
|
24
|
+
// protocol): binding an already-bound target returns the same pair.
|
|
25
|
+
rpc Bind(BindRequest) returns (BindResponse);
|
|
26
|
+
rpc Unbind(UnbindRequest) returns (UnbindResponse);
|
|
27
|
+
rpc List(ListRequest) returns (ListResponse);
|
|
28
|
+
// Lease ties every binding to the caller's liveness. The orchestrator holds
|
|
29
|
+
// the stream open and pings it; when the stream ends, because the
|
|
30
|
+
// orchestrator stopped or crashed, the gateway releases everything.
|
|
31
|
+
rpc Lease(stream LeaseRequest) returns (stream LeaseResponse);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Protocol is the transport a published port speaks. Only TCP is implemented;
|
|
35
|
+
// the others are reserved so the wire format does not have to change.
|
|
36
|
+
enum Protocol {
|
|
37
|
+
PROTOCOL_UNSPECIFIED = 0;
|
|
38
|
+
PROTOCOL_TCP = 1;
|
|
39
|
+
PROTOCOL_UDP = 2;
|
|
40
|
+
PROTOCOL_HTTP = 3;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message GetVersionRequest {}
|
|
44
|
+
message GetVersionResponse {
|
|
45
|
+
string version = 1;
|
|
46
|
+
string commit = 2;
|
|
47
|
+
// A random id generated once per gateway process, so a caller can tell a
|
|
48
|
+
// live gateway from a restarted one and re-establish its bindings.
|
|
49
|
+
string instance = 3;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message BindRequest {
|
|
53
|
+
// The guest container's podman name, which locates its socket directory
|
|
54
|
+
// under the socket root. Internal to the deployment; never returned.
|
|
55
|
+
string podman_name = 1;
|
|
56
|
+
// The socket file name inside that directory, e.g. "t8080".
|
|
57
|
+
string socket_name = 2;
|
|
58
|
+
Protocol protocol = 3;
|
|
59
|
+
// The host port to prefer. 0 asks the gateway to choose a free one.
|
|
60
|
+
uint32 suggested_host_port = 4;
|
|
61
|
+
}
|
|
62
|
+
// The address is returned alongside the port because the gateway owns the
|
|
63
|
+
// address: loopback today, a hostname once HTTP publishing lands.
|
|
64
|
+
message BindResponse {
|
|
65
|
+
string address = 1;
|
|
66
|
+
uint32 port = 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message UnbindRequest {
|
|
70
|
+
string podman_name = 1;
|
|
71
|
+
string socket_name = 2;
|
|
72
|
+
Protocol protocol = 3;
|
|
73
|
+
}
|
|
74
|
+
message UnbindResponse {}
|
|
75
|
+
|
|
76
|
+
message ListRequest {}
|
|
77
|
+
message ListResponse { repeated Binding bindings = 1; }
|
|
78
|
+
message Binding {
|
|
79
|
+
string podman_name = 1;
|
|
80
|
+
string socket_name = 2;
|
|
81
|
+
Protocol protocol = 3;
|
|
82
|
+
string address = 4;
|
|
83
|
+
uint32 port = 5;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// LeaseRequest is a liveness ping; LeaseResponse acknowledges one. An empty
|
|
87
|
+
// request is a valid ping and an empty response a valid acknowledgement.
|
|
88
|
+
message LeaseRequest {}
|
|
89
|
+
message LeaseResponse {}
|
|
@@ -28,6 +28,8 @@ service WorkspaceGuestAgent {
|
|
|
28
28
|
rpc StopAllDaemons(StopAllDaemonsRequest) returns (StopAllDaemonsResponse);
|
|
29
29
|
rpc RestartDaemon(RestartDaemonRequest) returns (DaemonInfo);
|
|
30
30
|
rpc DaemonLogs(DaemonLogsRequest) returns (DaemonLogsResponse);
|
|
31
|
+
rpc PublishPort(PublishPortRequest) returns (PublishPortResponse);
|
|
32
|
+
rpc UnpublishPort(UnpublishPortRequest) returns (UnpublishPortResponse);
|
|
31
33
|
rpc Terminal(stream TerminalInput) returns (stream TerminalOutput);
|
|
32
34
|
}
|
|
33
35
|
message PingRequest {}
|
|
@@ -82,3 +84,18 @@ message TerminalStarted { int32 pid = 1; }
|
|
|
82
84
|
message TerminalExit { int32 exit_code = 1; bool signaled = 2; string signal = 3; }
|
|
83
85
|
message TerminalForeground { string request_id = 1; bool found = 2; int32 process_group_id = 3; bool input_waiting = 4; }
|
|
84
86
|
message TerminalSignalled { string request_id = 1; bool found = 2; int32 process_group_id = 3; }
|
|
87
|
+
|
|
88
|
+
// Protocol is the transport a published pod port speaks. Only TCP is
|
|
89
|
+
// implemented today; the others are reserved so the wire format does not have
|
|
90
|
+
// to change when they land.
|
|
91
|
+
enum Protocol { PROTOCOL_UNSPECIFIED = 0; PROTOCOL_TCP = 1; PROTOCOL_UDP = 2; PROTOCOL_HTTP = 3; }
|
|
92
|
+
|
|
93
|
+
// PublishPort makes the agent listen on a Unix socket inside the container's
|
|
94
|
+
// socket directory and forward every connection to 127.0.0.1:<port> in the
|
|
95
|
+
// pod's network namespace. The socket name is deterministic (see
|
|
96
|
+
// internal/guestagent/publish), so publishing again after a recreate lands on
|
|
97
|
+
// the same path and the gateway's binding keeps working.
|
|
98
|
+
message PublishPortRequest { uint32 port = 1; Protocol protocol = 2; }
|
|
99
|
+
message PublishPortResponse { string socket_name = 1; }
|
|
100
|
+
message UnpublishPortRequest { uint32 port = 1; Protocol protocol = 2; }
|
|
101
|
+
message UnpublishPortResponse {}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,8 +10,9 @@ export { globCwd, remoteArgv, resolveGuestCwd, resolveGuestPath, } from "./guest
|
|
|
10
10
|
export { inferMountKind, projectMountDestinationReason, projectMountMirror, } from "./mount-input.js";
|
|
11
11
|
export { HARNESS_SOURCE_SECTION, podmanRuntimeSection, withoutHarnessSourceSection, } from "./prompts.js";
|
|
12
12
|
export { Config } from "./settings-schema.js";
|
|
13
|
-
export { publicContainer, publicDaemon, publicImage, publicMount, } from "./public.js";
|
|
13
|
+
export { publicContainer, publicDaemon, publicImage, publicMount, publicPublishedPort, } from "./public.js";
|
|
14
|
+
export { portProtocolFromProto, portProtocolToProto } from "./publish-port.js";
|
|
14
15
|
export { createSubprocessProvider, OutputReader, outputReader, SubprocessProvider, } from "./subprocess.js";
|
|
15
16
|
export { toolHandlers } from "./tool-handlers.js";
|
|
16
|
-
export { containerBashParameters, containerEditParameters, containerExecParameters, containerGlobParameters, containerGrepParameters, containerListParameters, containerMountAddParameters, containerMountListParameters, containerMountRemoveParameters, containerReadParameters, containerRecreateParameters, containerRemoveParameters, containerSecretAddParameters, containerSecretRemoveParameters, containerStartParameters, containerWriteParameters, daemonListParameters, daemonLogsParameters, daemonRestartParameters, daemonStartParameters, daemonStopParameters, defineTool, envParam, imageBuildParameters, imageGetParameters, imageListParameters, imageRebuildAllParameters, imageRebuildParameters, imageRemoveParameters, secretCreateParameters, secretListParameters, secretRemoveParameters, ToolDefinition, toolOutput, TOOLS, volumeCreateParameters, volumeListParameters, volumeRemoveParameters, } from "./tool-schemas.js";
|
|
17
|
+
export { containerBashParameters, containerEditParameters, containerExecParameters, containerGlobParameters, containerGrepParameters, containerListParameters, containerMountAddParameters, containerMountListParameters, containerMountRemoveParameters, containerPublishPortParameters, containerReadParameters, containerRecreateParameters, containerRemoveParameters, containerSecretAddParameters, containerSecretRemoveParameters, containerStartParameters, containerUnpublishPortParameters, containerWriteParameters, daemonListParameters, daemonLogsParameters, daemonRestartParameters, daemonStartParameters, daemonStopParameters, defineTool, envParam, imageBuildParameters, imageGetParameters, imageListParameters, imageRebuildAllParameters, imageRebuildParameters, imageRemoveParameters, secretCreateParameters, secretListParameters, secretRemoveParameters, ToolDefinition, toolOutput, TOOLS, volumeCreateParameters, volumeListParameters, volumeRemoveParameters, } from "./tool-schemas.js";
|
|
17
18
|
export { toolCallView, toolResultView } from "./tool-views.js";
|
package/dist/index.js
CHANGED
|
@@ -144,8 +144,9 @@ export { globCwd, remoteArgv, resolveGuestCwd, resolveGuestPath, } from "./guest
|
|
|
144
144
|
export { inferMountKind, projectMountDestinationReason, projectMountMirror, } from "./mount-input.js";
|
|
145
145
|
export { HARNESS_SOURCE_SECTION, podmanRuntimeSection, withoutHarnessSourceSection, } from "./prompts.js";
|
|
146
146
|
export { Config } from "./settings-schema.js";
|
|
147
|
-
export { publicContainer, publicDaemon, publicImage, publicMount, } from "./public.js";
|
|
147
|
+
export { publicContainer, publicDaemon, publicImage, publicMount, publicPublishedPort, } from "./public.js";
|
|
148
|
+
export { portProtocolFromProto, portProtocolToProto } from "./publish-port.js";
|
|
148
149
|
export { createSubprocessProvider, outputReader, } from "./subprocess.js";
|
|
149
150
|
export { toolHandlers } from "./tool-handlers.js";
|
|
150
|
-
export { containerBashParameters, containerEditParameters, containerExecParameters, containerGlobParameters, containerGrepParameters, containerListParameters, containerMountAddParameters, containerMountListParameters, containerMountRemoveParameters, containerReadParameters, containerRecreateParameters, containerRemoveParameters, containerSecretAddParameters, containerSecretRemoveParameters, containerStartParameters, containerWriteParameters, daemonListParameters, daemonLogsParameters, daemonRestartParameters, daemonStartParameters, daemonStopParameters, defineTool, envParam, imageBuildParameters, imageGetParameters, imageListParameters, imageRebuildAllParameters, imageRebuildParameters, imageRemoveParameters, secretCreateParameters, secretListParameters, secretRemoveParameters, toolOutput, TOOLS, volumeCreateParameters, volumeListParameters, volumeRemoveParameters, } from "./tool-schemas.js";
|
|
151
|
+
export { containerBashParameters, containerEditParameters, containerExecParameters, containerGlobParameters, containerGrepParameters, containerListParameters, containerMountAddParameters, containerMountListParameters, containerMountRemoveParameters, containerPublishPortParameters, containerReadParameters, containerRecreateParameters, containerRemoveParameters, containerSecretAddParameters, containerSecretRemoveParameters, containerStartParameters, containerUnpublishPortParameters, containerWriteParameters, daemonListParameters, daemonLogsParameters, daemonRestartParameters, daemonStartParameters, daemonStopParameters, defineTool, envParam, imageBuildParameters, imageGetParameters, imageListParameters, imageRebuildAllParameters, imageRebuildParameters, imageRemoveParameters, secretCreateParameters, secretListParameters, secretRemoveParameters, toolOutput, TOOLS, volumeCreateParameters, volumeListParameters, volumeRemoveParameters, } from "./tool-schemas.js";
|
|
151
152
|
export { toolCallView, toolResultView } from "./tool-views.js";
|
package/dist/public.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function publicMount(mount: any): Record<string, unknown>;
|
|
2
|
+
export declare function publicPublishedPort(port: any): Record<string, unknown>;
|
|
2
3
|
export declare function publicContainer(row: any): Record<string, unknown>;
|
|
3
4
|
export declare function publicImage(image: any): Record<string, unknown>;
|
|
4
5
|
export declare function publicDaemon(info: any): Record<string, unknown>;
|
package/dist/public.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// SPDX-License-Identifier: MIT
|
|
4
4
|
import { mountKindFromProto, mountModeFromProto } from "./mount-enums.js";
|
|
5
|
+
import { portProtocolFromProto } from "./publish-port.js";
|
|
5
6
|
// Rebuild API objects so tool results never expose internal fields (see
|
|
6
7
|
// AGENTS.md "Security"): only allow-listed attributes reach the model.
|
|
7
8
|
export function publicMount(mount) {
|
|
@@ -16,6 +17,18 @@ export function publicMount(mount) {
|
|
|
16
17
|
...(mode !== undefined ? { mode } : {}),
|
|
17
18
|
};
|
|
18
19
|
}
|
|
20
|
+
/// A published pod port: the address string plus the parts it was built from.
|
|
21
|
+
/// The gateway owns the address, so it is echoed rather than assumed.
|
|
22
|
+
export function publicPublishedPort(port) {
|
|
23
|
+
const protocol = portProtocolFromProto(port?.protocol);
|
|
24
|
+
return {
|
|
25
|
+
...(protocol !== undefined ? { protocol } : {}),
|
|
26
|
+
port: port?.port ?? 0,
|
|
27
|
+
address: port?.address ?? "",
|
|
28
|
+
hostPort: port?.hostPort ?? 0,
|
|
29
|
+
endpoint: port?.endpoint ?? "",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
19
32
|
export function publicContainer(row) {
|
|
20
33
|
return {
|
|
21
34
|
containerName: row?.containerName ?? "",
|
|
@@ -25,6 +38,7 @@ export function publicContainer(row) {
|
|
|
25
38
|
paths: row?.paths ?? [],
|
|
26
39
|
env: row?.env ?? {},
|
|
27
40
|
secretEnv: row?.secretEnv ?? {},
|
|
41
|
+
publishedPorts: (row?.publishedPorts ?? []).map(publicPublishedPort),
|
|
28
42
|
};
|
|
29
43
|
}
|
|
30
44
|
export function publicImage(image) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The protocol a call uses when it does not name one. */
|
|
2
|
+
export declare const DEFAULT_PORT_PROTOCOL = "tcp";
|
|
3
|
+
/** The logical protocol for a proto enum value, or undefined when unspecified. */
|
|
4
|
+
export declare function portProtocolFromProto(proto: string | undefined): string | undefined;
|
|
5
|
+
/** The proto enum value for a logical protocol name. */
|
|
6
|
+
export declare function portProtocolToProto(protocol: string | undefined): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
// The transport a published pod port speaks. Only TCP is implemented; udp and
|
|
5
|
+
// http are reserved on the wire so a later publish does not have to change the
|
|
6
|
+
// request shape.
|
|
7
|
+
const PROTOCOLS = {
|
|
8
|
+
tcp: "PROTOCOL_TCP",
|
|
9
|
+
udp: "PROTOCOL_UDP",
|
|
10
|
+
http: "PROTOCOL_HTTP",
|
|
11
|
+
};
|
|
12
|
+
const PROTOCOL_FROM_PROTO = {
|
|
13
|
+
PROTOCOL_TCP: "tcp",
|
|
14
|
+
PROTOCOL_UDP: "udp",
|
|
15
|
+
PROTOCOL_HTTP: "http",
|
|
16
|
+
};
|
|
17
|
+
/** The protocol a call uses when it does not name one. */
|
|
18
|
+
export const DEFAULT_PORT_PROTOCOL = "tcp";
|
|
19
|
+
/** The logical protocol for a proto enum value, or undefined when unspecified. */
|
|
20
|
+
export function portProtocolFromProto(proto) {
|
|
21
|
+
if (proto === undefined)
|
|
22
|
+
return undefined;
|
|
23
|
+
return Object.prototype.hasOwnProperty.call(PROTOCOL_FROM_PROTO, proto)
|
|
24
|
+
? PROTOCOL_FROM_PROTO[proto]
|
|
25
|
+
: undefined;
|
|
26
|
+
}
|
|
27
|
+
/** The proto enum value for a logical protocol name. */
|
|
28
|
+
export function portProtocolToProto(protocol) {
|
|
29
|
+
const name = protocol ?? DEFAULT_PORT_PROTOCOL;
|
|
30
|
+
const proto = Object.prototype.hasOwnProperty.call(PROTOCOLS, name)
|
|
31
|
+
? PROTOCOLS[name]
|
|
32
|
+
: undefined;
|
|
33
|
+
if (proto === undefined) {
|
|
34
|
+
throw new Error(`unknown port protocol: ${JSON.stringify(protocol)}`);
|
|
35
|
+
}
|
|
36
|
+
return proto;
|
|
37
|
+
}
|
package/dist/tool-defs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
|
|
2
2
|
//
|
|
3
3
|
// SPDX-License-Identifier: MIT
|
|
4
|
-
import { containerBashParameters, containerEditParameters, containerExecParameters, containerGlobParameters, containerGrepParameters, containerListParameters, containerMountAddParameters, containerMountListParameters, containerMountRemoveParameters, containerMountUpdateParameters, containerPathAddParameters, containerPathRemoveParameters, containerPathSetParameters, containerReadParameters, containerRecreateParameters, containerRemoveParameters, containerSecretAddParameters, containerSecretRemoveParameters, containerStartParameters, containerWriteParameters, daemonListParameters, daemonLogsParameters, daemonRestartParameters, daemonStartParameters, daemonStopParameters, imageBuildParameters, imageGetParameters, imageListParameters, imageRebuildAllParameters, imageRebuildParameters, imageRemoveParameters, secretCreateParameters, secretListParameters, secretRemoveParameters, volumeCreateParameters, volumeListParameters, volumeRemoveParameters, } from "./tool-params.js";
|
|
4
|
+
import { containerBashParameters, containerEditParameters, containerExecParameters, containerGlobParameters, containerGrepParameters, containerListParameters, containerMountAddParameters, containerMountListParameters, containerMountRemoveParameters, containerMountUpdateParameters, containerPathAddParameters, containerPathRemoveParameters, containerPathSetParameters, containerPublishPortParameters, containerReadParameters, containerRecreateParameters, containerRemoveParameters, containerSecretAddParameters, containerSecretRemoveParameters, containerStartParameters, containerUnpublishPortParameters, containerWriteParameters, daemonListParameters, daemonLogsParameters, daemonRestartParameters, daemonStartParameters, daemonStopParameters, imageBuildParameters, imageGetParameters, imageListParameters, imageRebuildAllParameters, imageRebuildParameters, imageRemoveParameters, secretCreateParameters, secretListParameters, secretRemoveParameters, volumeCreateParameters, volumeListParameters, volumeRemoveParameters, } from "./tool-params.js";
|
|
5
5
|
export function defineTool(definition) {
|
|
6
6
|
return definition;
|
|
7
7
|
}
|
|
@@ -77,6 +77,16 @@ export const TOOLS = [
|
|
|
77
77
|
parameters: containerMountUpdateParameters,
|
|
78
78
|
approval: true,
|
|
79
79
|
},
|
|
80
|
+
{
|
|
81
|
+
name: "container_publish_port",
|
|
82
|
+
parameters: containerPublishPortParameters,
|
|
83
|
+
approval: true,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "container_unpublish_port",
|
|
87
|
+
parameters: containerUnpublishPortParameters,
|
|
88
|
+
approval: true,
|
|
89
|
+
},
|
|
80
90
|
{
|
|
81
91
|
name: "container_path_set",
|
|
82
92
|
parameters: containerPathSetParameters,
|
|
@@ -143,6 +153,8 @@ export const TOOL_DESCRIPTIONS = {
|
|
|
143
153
|
container_mount_add: "Add a mount to a container in the current workspace: a project bind (project, a path under the projects root), a tmpfs, a named volume, or a secret, selected by kind (default project). Recreates the container, terminating its running processes; bind-mounted volume data persists. Requires approval: adding a mount changes the container filesystem view.",
|
|
144
154
|
container_mount_remove: "Remove a mount from a container in the current workspace. Identify it by kind plus its own handle: project for a project mount, volume for a named volume, secret for a secret, and destination for tmpfs. A handle that matches more than one mount is rejected, so pass destination as well when a volume or secret is mounted more than once; copy the exact values from container_mount_list. Recreates the container, terminating its running processes; bind-mounted volume data persists. Requires approval: removing a mount changes the container filesystem view.",
|
|
145
155
|
container_mount_update: "Change the mode of an existing project or volume mount in the current workspace (read_only or read_write). Identify it by kind plus its own handle, exactly like container_mount_remove; a handle that matches more than one mount is rejected. The default container's workspace project mount can be remounted read-only. Recreates the container, terminating its running processes; bind-mounted volume data persists. Requires approval: changing a mount's mode changes the container filesystem view.",
|
|
156
|
+
container_publish_port: "Expose a TCP port a daemon listens on inside the current workspace's pod on the host's loopback, and return the address to show the user. The dsh-podman gateway must be installed and running. Pass suggestedHostPort to ask for a specific host port (1024-65535) or omit it to get a free one. The exposure survives a container recreate. Requires approval: publishing a port reaches a service from the host.",
|
|
157
|
+
container_unpublish_port: "Stop exposing a published pod port in the current workspace. Identify it by the port inside the pod and its protocol, exactly as passed to container_publish_port. Unpublishing a port that is not published is a no-op. Requires approval: it changes what the host reaches.",
|
|
146
158
|
container_path_set: "Replace the directories the container prepends to PATH for every command it runs, highest priority first. Applied immediately to future shell, exec, terminal, and daemon runs without recreating the container; already-running daemons keep their old PATH. A recreated container restores the list. Requires approval: changing PATH changes which binaries run.",
|
|
147
159
|
container_path_add: "Prepend one directory to the container's PATH additions, moving it to the front when it is already there. Applied immediately without recreating the container; already-running daemons keep their old PATH. Requires approval: changing PATH changes which binaries run.",
|
|
148
160
|
container_path_remove: "Remove one directory from the container's PATH additions. A directory that is only part of the container's default PATH cannot be removed. Applied immediately without recreating the container; already-running daemons keep their old PATH. Requires approval: changing PATH changes which binaries run.",
|
|
@@ -184,6 +196,8 @@ export const TOOL_UI = {
|
|
|
184
196
|
container_mount_add: { title: "Add mount", kind: "edit" },
|
|
185
197
|
container_mount_remove: { title: "Remove mount", kind: "delete" },
|
|
186
198
|
container_mount_update: { title: "Change mount mode", kind: "edit" },
|
|
199
|
+
container_publish_port: { title: "Publish port", kind: "execute" },
|
|
200
|
+
container_unpublish_port: { title: "Unpublish port", kind: "delete" },
|
|
187
201
|
container_path_set: { title: "Set PATH additions", kind: "edit" },
|
|
188
202
|
container_path_add: { title: "Add PATH entry", kind: "edit" },
|
|
189
203
|
container_path_remove: { title: "Remove PATH entry", kind: "delete" },
|