@exagone313/dsh-podman 1.3.0 → 1.5.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 (48) hide show
  1. package/dist/card-route.d.ts +2 -1
  2. package/dist/card-route.js +89 -6
  3. package/dist/client/ContainerCard.js +1 -1
  4. package/dist/client/card-protocol.d.ts +12 -1
  5. package/dist/client/card-protocol.js +20 -0
  6. package/dist/client/container-card-controller.d.ts +5 -1
  7. package/dist/client/container-card-controller.js +12 -1
  8. package/dist/client/container-card-create-modal.js +14 -12
  9. package/dist/client/container-card-images.d.ts +9 -0
  10. package/dist/client/container-card-images.js +25 -3
  11. package/dist/client/container-card-ptc-section.d.ts +11 -0
  12. package/dist/client/container-card-ptc-section.js +36 -0
  13. package/dist/client/container-card-ptc.d.ts +69 -0
  14. package/dist/client/container-card-ptc.js +148 -0
  15. package/dist/client/container-card-resources.d.ts +1 -0
  16. package/dist/client/container-card-resources.js +13 -8
  17. package/dist/client/container-card-row.js +4 -2
  18. package/dist/client/container-card-shared.d.ts +1 -0
  19. package/dist/client/container-card-shared.js +4 -3
  20. package/dist/client/container-card-status.d.ts +6 -0
  21. package/dist/client/container-card-status.js +18 -14
  22. package/dist/client/index.js +835 -511
  23. package/dist/client/locales.d.ts +1 -1
  24. package/dist/client/locales.js +22 -0
  25. package/dist/client/relative-time.d.ts +2 -2
  26. package/dist/client/relative-time.js +8 -7
  27. package/dist/client/tool-views.js +1 -0
  28. package/dist/container-kind.d.ts +10 -0
  29. package/dist/container-kind.js +38 -0
  30. package/dist/dsh-version.d.ts +2 -0
  31. package/dist/dsh-version.js +33 -0
  32. package/dist/generated/version.d.ts +2 -2
  33. package/dist/generated/version.js +2 -2
  34. package/dist/grpc/proto/dshctl/v1/control.proto +35 -7
  35. package/dist/grpc/proto/dshguest/v1/guest.proto +17 -1
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/public.d.ts +2 -0
  39. package/dist/public.js +19 -0
  40. package/dist/subprocess.js +271 -105
  41. package/dist/tool-handlers.js +12 -13
  42. package/dist/workspace-binding.d.ts +2 -0
  43. package/dist/workspace-binding.js +54 -11
  44. package/docs/configuration.md +6 -5
  45. package/docs/configuration.zh.md +6 -5
  46. package/docs/usage.md +37 -1
  47. package/docs/usage.zh.md +31 -1
  48. package/package.json +31 -31
@@ -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" | "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" | "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" | "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";
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.
@@ -51,6 +51,8 @@ export const en = {
51
51
  discardChangesTitle: "Discard changes?",
52
52
  confirmDiscardChanges: "Close this dialog and discard your unsaved edits?",
53
53
  containerNameReserved: '"default" is reserved for the workspace\'s default container.',
54
+ containerNamePtcReserved: '"ptc" is reserved for the workspace\'s PTC container.',
55
+ containerKindPtc: "PTC",
54
56
  invalidSecretLength: "Length must be between 1 and 1024.",
55
57
  secretLengthHint: "Between 1 and 1024; empty uses 32.",
56
58
  portPendingSuffix: "(pending)",
@@ -98,6 +100,14 @@ export const en = {
98
100
  orchestratorNotReady: "orchestrator not ready",
99
101
  orchestratorUnknown: "orchestrator unknown",
100
102
  noWorkspaces: "No workspaces.",
103
+ ptcMissing: "The PTC container has not been created yet; it is created on first use.",
104
+ ptcContainerTooltip: "This container is used for Programmatic Tool Calling",
105
+ ptcImageTooltip: "This image is used for Programmatic Tool Calling",
106
+ recreatePtcTitle: "Recreate PTC container",
107
+ confirmRecreatePtc: "Recreate the shared PTC container “{container}”? It is removed and rebuilt from the current PTC image.",
108
+ ptcImageReserved: "This image is reserved to PTC (Programmatic Tool Calling).",
109
+ removePtcTitle: "Remove PTC container",
110
+ confirmRemovePtc: "Remove the shared PTC container “{container}”? It is recreated on the next PTC run.",
101
111
  createContainer: "Create container",
102
112
  containerName: "Name",
103
113
  image: "Image",
@@ -243,6 +253,7 @@ export const en = {
243
253
  containerNameTaken: "Container name already exists",
244
254
  invalidName: "Start with a letter or digit; only letters, digits, '.', '_', '-' (max 64).",
245
255
  invalidImageId: "Start with a letter, digit, or '_'; only letters, digits, '.', '_', '-', '/', ':' (max 128).",
256
+ terminalCommandLine: "Command line {n}",
246
257
  terminalSignal: "signal {signal}",
247
258
  terminalExitCode: "exit code {code}",
248
259
  terminalNoExitCode: "no exit code",
@@ -360,6 +371,8 @@ export const zh = {
360
371
  discardChangesTitle: "放弃更改?",
361
372
  confirmDiscardChanges: "关闭此对话框并放弃未保存的编辑?",
362
373
  containerNameReserved: "“default”是工作区默认容器的保留名称。",
374
+ containerNamePtcReserved: "“ptc”是工作区 PTC 容器的保留名称。",
375
+ containerKindPtc: "PTC",
363
376
  invalidSecretLength: "长度必须在 1 到 1024 之间。",
364
377
  secretLengthHint: "1 到 1024;留空使用 32。",
365
378
  portPendingSuffix: "(待发布)",
@@ -407,6 +420,14 @@ export const zh = {
407
420
  orchestratorNotReady: "orchestrator 未就绪",
408
421
  orchestratorUnknown: "orchestrator 状态未知",
409
422
  noWorkspaces: "无工作区。",
423
+ ptcMissing: "PTC 容器尚未创建;它会在首次使用时创建。",
424
+ ptcContainerTooltip: "此容器用于程序化工具调用",
425
+ ptcImageTooltip: "此镜像用于程序化工具调用",
426
+ recreatePtcTitle: "重建 PTC 容器",
427
+ confirmRecreatePtc: "重建共享的 PTC 容器“{container}”?它将被移除并由当前 PTC 镜像重新构建。",
428
+ ptcImageReserved: "该镜像专用于 PTC(Programmatic Tool Calling)。",
429
+ removePtcTitle: "移除 PTC 容器",
430
+ confirmRemovePtc: "移除共享的 PTC 容器“{container}”?下次运行 PTC 时会重新创建它。",
410
431
  createContainer: "创建容器",
411
432
  containerName: "名称",
412
433
  image: "镜像",
@@ -552,6 +573,7 @@ export const zh = {
552
573
  containerNameTaken: "容器名称已存在",
553
574
  invalidName: "以字母或数字开头,仅可使用字母、数字、'.'、'_'、'-'(最长 64 个字符)。",
554
575
  invalidImageId: "以字母、数字或 '_' 开头,仅可使用字母、数字、'.'、'_'、'-'、'/'、':'(最长 128 个字符)。",
576
+ terminalCommandLine: "命令第 {n} 行",
555
577
  terminalSignal: "信号 {signal}",
556
578
  terminalExitCode: "退出码 {code}",
557
579
  terminalNoExitCode: "无退出码",
@@ -1,6 +1,6 @@
1
1
  /**
2
- * The relative creation time of a container, e.g. "5 minutes ago", "today" or
3
- * "yesterday". A stamp the browser cannot read, and a runtime without
2
+ * The relative creation time of a container, e.g. "1 second ago", "5 minutes
3
+ * ago" or "yesterday". A stamp the browser cannot read, and a runtime without
4
4
  * {@link Intl.RelativeTimeFormat}, both fall back to the raw value.
5
5
  *
6
6
  * @param createdAt - the container's timestamp, as the snapshot reported it.
@@ -4,7 +4,7 @@
4
4
  // A relative creation time in the reader's own language. The exact instant
5
5
  // stays available beside it — a container field copies it, a build time keeps
6
6
  // it as a title tooltip — so this never has to be precise: it names the moment
7
- // the way a person would ("5 minutes ago", "today", "yesterday").
7
+ // the way a person would ("5 seconds ago", "5 minutes ago", "yesterday").
8
8
  const MINUTE = 60_000;
9
9
  const HOUR = 60 * MINUTE;
10
10
  const DAY = 24 * HOUR;
@@ -39,8 +39,8 @@ function formatter(locale) {
39
39
  return created;
40
40
  }
41
41
  /**
42
- * The relative creation time of a container, e.g. "5 minutes ago", "today" or
43
- * "yesterday". A stamp the browser cannot read, and a runtime without
42
+ * The relative creation time of a container, e.g. "1 second ago", "5 minutes
43
+ * ago" or "yesterday". A stamp the browser cannot read, and a runtime without
44
44
  * {@link Intl.RelativeTimeFormat}, both fall back to the raw value.
45
45
  *
46
46
  * @param createdAt - the container's timestamp, as the snapshot reported it.
@@ -56,10 +56,11 @@ export function relativeTimeLabel(createdAt, locale, now = Date.now()) {
56
56
  return createdAt;
57
57
  // A clock ahead of this browser must not read as a future creation.
58
58
  const elapsed = Math.max(0, now - at);
59
- // A moment ago is named as today: that is how a creation time reads, and the
60
- // exact instant still sits beside it.
61
- if (elapsed < MINUTE)
62
- return format.format(0, "day");
59
+ // A moment ago is counted in seconds, so a fresh creation reads "1 second
60
+ // ago" rather than "today"; the exact instant still sits beside it.
61
+ if (elapsed < MINUTE) {
62
+ return format.format(-Math.max(1, Math.floor(elapsed / 1000)), "second");
63
+ }
63
64
  if (elapsed < HOUR) {
64
65
  return format.format(-Math.floor(elapsed / MINUTE), "minute");
65
66
  }
@@ -215,6 +215,7 @@ function terminalCard(toolName, args, block, cwd) {
215
215
  // and `collapse` resolve from the shared common vocabulary.
216
216
  function terminalLabels(t) {
217
217
  return {
218
+ commandLine: (line) => t("terminalCommandLine", { n: line }),
218
219
  signal: (signal) => t("terminalSignal", { signal }),
219
220
  exitCode: (code) => t("terminalExitCode", { code }),
220
221
  noExitCode: t("terminalNoExitCode"),
@@ -0,0 +1,10 @@
1
+ export type ContainerKind = "guest" | "ptc";
2
+ /**
3
+ * The logical kind of a decoded container row. A decoder may produce the enum
4
+ * name with or without its CONTAINER_KIND_ prefix, or the enum number, so the
5
+ * value is normalized here rather than at each consumer. An unspecified or
6
+ * unknown kind reads as guest: it cannot accidentally expose the reserved
7
+ * container as an ordinary one, and every pre-marker row is a guest.
8
+ */
9
+ export declare function containerKindFromProto(kind: unknown): ContainerKind;
10
+ export declare function isPtcContainer(row: any): boolean;
@@ -0,0 +1,38 @@
1
+ // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
2
+ //
3
+ // SPDX-License-Identifier: MIT
4
+ const KIND_NAMES = {
5
+ unspecified: "guest",
6
+ guest: "guest",
7
+ ptc: "ptc",
8
+ };
9
+ const KIND_NUMBERS = {
10
+ 0: "guest",
11
+ 1: "guest",
12
+ 2: "ptc",
13
+ };
14
+ /**
15
+ * The logical kind of a decoded container row. A decoder may produce the enum
16
+ * name with or without its CONTAINER_KIND_ prefix, or the enum number, so the
17
+ * value is normalized here rather than at each consumer. An unspecified or
18
+ * unknown kind reads as guest: it cannot accidentally expose the reserved
19
+ * container as an ordinary one, and every pre-marker row is a guest.
20
+ */
21
+ export function containerKindFromProto(kind) {
22
+ if (typeof kind === "number")
23
+ return KIND_NUMBERS[kind] ?? "guest";
24
+ if (typeof kind !== "string")
25
+ return "guest";
26
+ const short = kind.startsWith("CONTAINER_KIND_")
27
+ ? kind.slice("CONTAINER_KIND_".length).toLowerCase()
28
+ : kind.toLowerCase();
29
+ return Object.prototype.hasOwnProperty.call(KIND_NAMES, short)
30
+ ? KIND_NAMES[short]
31
+ : "guest";
32
+ }
33
+ // isPtcContainer reports whether a row is the orchestrator-owned PTC container.
34
+ // Model-facing tool results never expose it; the card renders it from its own
35
+ // workspace-less snapshot entry instead of among the workspace containers.
36
+ export function isPtcContainer(row) {
37
+ return containerKindFromProto(row?.kind) === "ptc";
38
+ }
@@ -5,3 +5,5 @@ export interface PluginPackageLookup {
5
5
  }
6
6
  export declare function dshVersion(packages?: PluginPackageLookup): string;
7
7
  export declare function versionFromPackages(packages?: PluginPackageLookup): string | undefined;
8
+ export declare function harnessVersionFromManifest(manifest: unknown): string;
9
+ export declare function pinnedDshVersion(): string;
@@ -29,6 +29,39 @@ export function versionFromPackages(packages) {
29
29
  const version = packages?.packageOf?.(PACKAGE, import.meta.url)?.version;
30
30
  return typeof version === "string" && version !== "" ? version : undefined;
31
31
  }
32
+ // PINNED_PACKAGE is one of the harness packages the plugin pins. Every
33
+ // @deepseek-ai/dsh-* specifier carries the same release (package-deps.test.ts
34
+ // enforces it), so any of them is a single source of truth for the release the
35
+ // plugin targets.
36
+ const PINNED_PACKAGE = "@deepseek-ai/dsh-subprocess";
37
+ // harnessVersionFromManifest reads the pinned harness release from package
38
+ // metadata. "" when the manifest does not pin it.
39
+ export function harnessVersionFromManifest(manifest) {
40
+ const dependencies = manifest?.peerDependencies;
41
+ const version = dependencies?.[PINNED_PACKAGE];
42
+ return typeof version === "string" ? version : "";
43
+ }
44
+ let cachedPinned;
45
+ // pinnedDshVersion returns the harness release this plugin targets, read from
46
+ // its own package metadata rather than duplicated in code. The orchestrator
47
+ // builds the PTC image for it, so it must be the release the plugin's
48
+ // @deepseek-ai/dsh-* dependencies were built against. "" when it cannot be
49
+ // resolved.
50
+ export function pinnedDshVersion() {
51
+ if (cachedPinned !== undefined)
52
+ return cachedPinned;
53
+ let resolved = "";
54
+ try {
55
+ resolved = harnessVersionFromManifest(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")));
56
+ }
57
+ catch {
58
+ // An unreadable manifest leaves the pinned version unknown.
59
+ }
60
+ // Only a resolved version is cached, like dshVersion above.
61
+ if (resolved !== "")
62
+ cachedPinned = resolved;
63
+ return resolved;
64
+ }
32
65
  // resolveDshVersion walks the physical module search paths, for an install
33
66
  // whose app package is a real node_modules entry (a source checkout).
34
67
  function resolveDshVersion() {
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.3.0";
2
- export declare const GIT_COMMIT = "cf0e325";
1
+ export declare const VERSION = "1.5.0";
2
+ export declare const GIT_COMMIT = "653ed18";
@@ -2,5 +2,5 @@
2
2
  //
3
3
  // SPDX-License-Identifier: MIT
4
4
  // Generated by scripts/generate-version.mjs; do not edit.
5
- export const VERSION = "1.3.0";
6
- export const GIT_COMMIT = "cf0e325";
5
+ export const VERSION = "1.5.0";
6
+ export const GIT_COMMIT = "653ed18";
@@ -85,13 +85,21 @@ message Workspace {
85
85
  message ListImagesRequest {}
86
86
  message ListImagesResponse { repeated Image images = 1; }
87
87
  message Image { string image_id = 1; string parent = 2; repeated string packages = 3; string image_tag = 4; string built_at = 5; bool is_base = 6; string status = 7; string primitive = 8; string package_manager = 9; bool base_public = 10; }
88
- message RebuildImageRequest { string image_id = 1; }
89
- message RebuildAllImagesRequest {}
88
+ // dsh_version is the harness release the caller targets. It is required when
89
+ // `image_id` names the reserved PTC image, whose single image is built
90
+ // unconditionally for that release; it is ignored for an ordinary image.
91
+ message RebuildImageRequest { string image_id = 1; string dsh_version = 2; }
92
+ // dsh_version is the harness release the caller targets. When set, the call
93
+ // also builds the reserved PTC image for that release after the stored images;
94
+ // when empty, only the stored images are considered, so an older caller keeps
95
+ // its previous behaviour.
96
+ message RebuildAllImagesRequest { string dsh_version = 1; }
90
97
  // The images one RebuildAllImages call rebuilt or could not provide. `rebuilt`
91
- // names the stored custom images that were rebuilt, in dependency order; a base
92
- // image ensured beforehand is not listed. `skipped` names every image the call
93
- // could not make available: base short names first, then the custom images
94
- // whose rebuild failed and the images that depend on them.
98
+ // names the stored custom images that were rebuilt, in dependency order, plus
99
+ // the reserved PTC image when the call built it; a base image ensured beforehand
100
+ // is not listed. `skipped` names every image the call could not make available:
101
+ // base short names first, then the custom images whose rebuild failed and the
102
+ // images that depend on them, plus the PTC image when its build failed.
95
103
  message RebuildAllImagesResponse { repeated string rebuilt = 1; repeated string skipped = 2; }
96
104
  message RemoveImageRequest { string image_id = 1; }
97
105
  message RemoveImageResponse {}
@@ -107,6 +115,15 @@ message CleanCachesRequest { CacheCleanMode mode = 1; }
107
115
  message CleanCachesResponse { CacheCleanMode mode = 1; int32 removed_files = 2; int64 removed_bytes = 3; repeated Cache caches = 4; }
108
116
  message ListContainersRequest {}
109
117
  message ListContainersResponse { repeated Container containers = 1; }
118
+ // ContainerKind distinguishes the containers a workspace holds: an ordinary
119
+ // guest container a caller may drive, and the reserved PTC container the
120
+ // orchestrator creates and owns. The kind lets the plugin recognize the PTC
121
+ // container without relying on its name.
122
+ enum ContainerKind {
123
+ CONTAINER_KIND_UNSPECIFIED = 0;
124
+ CONTAINER_KIND_GUEST = 1;
125
+ CONTAINER_KIND_PTC = 2;
126
+ }
110
127
  message Container {
111
128
  string container_name = 1;
112
129
  string workspace_slug = 2;
@@ -121,10 +138,21 @@ message Container {
121
138
  map<string, string> secret_env = 11;
122
139
  repeated string paths = 12;
123
140
  repeated PublishedPort published_ports = 13;
141
+ ContainerKind kind = 14;
124
142
  }
125
143
  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; }
126
- message EnsureContainerRequest { string workspace_slug = 1; string container = 2; }
144
+ // dsh_version is the harness release the caller targets. It is required when
145
+ // `container` names the reserved PTC container, whose image is built on demand
146
+ // for that release, and ignored otherwise.
147
+ //
148
+ // workspace_slug is required for a guest container and optional for the
149
+ // reserved PTC container: the PTC container is a single shared container, not
150
+ // bound to a workspace, so an empty slug addresses it.
151
+ message EnsureContainerRequest { string workspace_slug = 1; string container = 2; string dsh_version = 3; }
127
152
  message RecreateContainerRequest { string workspace_slug = 1; string image_id = 2; string container = 3; repeated ProjectMount mounts = 4; map<string, string> env = 5; repeated string paths = 6; map<string, string> secret_env = 7; }
153
+ // workspace_slug is required for a guest container. An empty slug with
154
+ // `container` naming the reserved PTC container removes the single shared PTC
155
+ // container, which belongs to no workspace.
128
156
  message RemoveContainerRequest { string workspace_slug = 1; string container = 2; }
129
157
  message RemoveContainerResponse {}
130
158
  message AddContainerMountRequest { string workspace_slug = 1; string container = 2; string project = 3; reserved 4; string destination = 5; MountMode mode = 6; MountKind kind = 7; string volume = 8; string secret = 9; }
@@ -31,13 +31,29 @@ service WorkspaceGuestAgent {
31
31
  rpc PublishPort(PublishPortRequest) returns (PublishPortResponse);
32
32
  rpc UnpublishPort(UnpublishPortRequest) returns (UnpublishPortResponse);
33
33
  rpc Terminal(stream TerminalInput) returns (stream TerminalOutput);
34
+ // GetCapabilities reports the optional features this agent implements, so a
35
+ // caller can fall back when it talks to an older agent.
36
+ rpc GetCapabilities(GetCapabilitiesRequest) returns (GetCapabilitiesResponse);
37
+ // ExecControl attaches the caller's end of an exec's control channel. The
38
+ // first frame names the exec; later frames carry opaque bytes both ways.
39
+ rpc ExecControl(stream ExecControlFrame) returns (stream ExecControlFrame);
34
40
  }
35
41
  message PingRequest {}
36
42
  message PingResponse { string version = 1; string commit = 2; }
37
43
  message ExecInput { oneof payload { ExecStart start = 1; bytes stdin_chunk = 2; } }
38
- message ExecStart { repeated string argv = 1; string cwd = 2; map<string, string> env = 3; repeated string unset_env = 4; SpillTarget spill_stdout = 5; SpillTarget spill_stderr = 6; google.protobuf.Int32Value uid = 7; google.protobuf.Int32Value gid = 8; repeated uint32 groups = 9; bool stdin_pipe = 10; }
44
+ message ExecStart { repeated string argv = 1; string cwd = 2; map<string, string> env = 3; repeated string unset_env = 4; SpillTarget spill_stdout = 5; SpillTarget spill_stderr = 6; google.protobuf.Int32Value uid = 7; google.protobuf.Int32Value gid = 8; repeated uint32 groups = 9; bool stdin_pipe = 10; bool control = 11; }
39
45
  message ExecOutput { oneof payload { bytes stdout_chunk = 1; bytes stderr_chunk = 2; ExecExit exit = 3; } string process_id = 4; }
40
46
  message ExecExit { int32 exit_code = 1; bool signaled = 2; string signal = 3; bool stdout_spill_valid = 4; bool stderr_spill_valid = 5; }
47
+ // ExecControlFrame is one frame of an exec's control channel. The first frame
48
+ // carries the exec id; every later frame carries opaque bytes in either
49
+ // direction, which the agent relays to and from the child's fd 7.
50
+ message ExecControlFrame { oneof payload { string exec_id = 1; bytes data = 2; } }
51
+ // GetCapabilitiesRequest has no fields: the caller asks the agent which
52
+ // optional features it implements.
53
+ message GetCapabilitiesRequest {}
54
+ // GetCapabilitiesResponse reports the optional features this agent implements.
55
+ // exec_control means an exec may request the fd-7 control channel.
56
+ message GetCapabilitiesResponse { bool exec_control = 1; }
41
57
  // SpillTarget is a bounded full-stream copy of one output stream, written in
42
58
  // the guest's execution world so the caller can read the complete output after
43
59
  // an in-memory truncation.
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ 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, publicPublishedPort, } from "./public.js";
13
+ export { publicContainer, publicContainerResult, publicContainers, publicDaemon, publicImage, publicMount, publicPublishedPort, } from "./public.js";
14
14
  export { portProtocolFromProto, portProtocolToProto } from "./publish-port.js";
15
15
  export { createSubprocessProvider, OutputReader, outputReader, SubprocessProvider, } from "./subprocess.js";
16
16
  export { toolHandlers } from "./tool-handlers.js";
package/dist/index.js CHANGED
@@ -157,7 +157,7 @@ export { globCwd, remoteArgv, resolveGuestCwd, resolveGuestPath, } from "./guest
157
157
  export { inferMountKind, projectMountDestinationReason, projectMountMirror, } from "./mount-input.js";
158
158
  export { HARNESS_SOURCE_SECTION, podmanRuntimeSection, withoutHarnessSourceSection, } from "./prompts.js";
159
159
  export { Config } from "./settings-schema.js";
160
- export { publicContainer, publicDaemon, publicImage, publicMount, publicPublishedPort, } from "./public.js";
160
+ export { publicContainer, publicContainerResult, publicContainers, publicDaemon, publicImage, publicMount, publicPublishedPort, } from "./public.js";
161
161
  export { portProtocolFromProto, portProtocolToProto } from "./publish-port.js";
162
162
  export { createSubprocessProvider, outputReader, } from "./subprocess.js";
163
163
  export { toolHandlers } from "./tool-handlers.js";
package/dist/public.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export declare function publicMount(mount: any): Record<string, unknown>;
2
2
  export declare function publicPublishedPort(port: any): Record<string, unknown>;
3
3
  export declare function publicContainer(row: any): Record<string, unknown>;
4
+ export declare function publicContainers(rows: readonly any[]): Record<string, unknown>[];
5
+ export declare function publicContainerResult(row: any): Record<string, unknown>;
4
6
  export declare function publicImage(image: any): Record<string, unknown>;
5
7
  export declare function publicDaemon(info: any): Record<string, unknown>;
package/dist/public.js CHANGED
@@ -1,8 +1,10 @@
1
1
  // SPDX-FileCopyrightText: 2026 Elouan Martinet <exa@elou.world>
2
2
  //
3
3
  // SPDX-License-Identifier: MIT
4
+ import { isPtcContainer } from "./container-kind.js";
4
5
  import { mountKindFromProto, mountModeFromProto } from "./mount-enums.js";
5
6
  import { portProtocolFromProto } from "./publish-port.js";
7
+ import { containerNotFound } from "./workspace-binding.js";
6
8
  // Rebuild API objects so tool results never expose internal fields (see
7
9
  // AGENTS.md "Security"): only allow-listed attributes reach the model.
8
10
  export function publicMount(mount) {
@@ -41,6 +43,23 @@ export function publicContainer(row) {
41
43
  publishedPorts: (row?.publishedPorts ?? []).map(publicPublishedPort),
42
44
  };
43
45
  }
46
+ // publicContainers is the listing shape: the orchestrator-owned PTC container
47
+ // is not a container a caller may address, so it never reaches a model-facing
48
+ // list. Filtering lives here, with the other allow-list builders, rather than
49
+ // in the orchestrator snapshot the settings card renders.
50
+ export function publicContainers(rows) {
51
+ return rows.filter((row) => !isPtcContainer(row)).map(publicContainer);
52
+ }
53
+ // publicContainerResult is the single-container response shape. A mutation
54
+ // never legitimately answers with the PTC container — the orchestrator refuses
55
+ // every user-addressed mutation on its reserved name — but reporting it as the
56
+ // caller's missing container keeps such a row out of every tool result too.
57
+ export function publicContainerResult(row) {
58
+ if (isPtcContainer(row)) {
59
+ throw containerNotFound(String(row?.containerName ?? ""), typeof row?.workspaceSlug === "string" ? row.workspaceSlug : undefined);
60
+ }
61
+ return publicContainer(row);
62
+ }
44
63
  export function publicImage(image) {
45
64
  return {
46
65
  imageId: image?.imageId ?? "",