pi-maestro-teammate 2.2.0 → 2.4.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 (123) hide show
  1. package/README.md +11 -1
  2. package/package.json +221 -209
  3. package/src/backends/acp-cli-catalog.ts +6 -0
  4. package/src/backends/acp-cli.ts +24 -8
  5. package/src/cli-tools/cli-tools-config.ts +86 -26
  6. package/src/cli-tools/local-acp.ts +8 -4
  7. package/src/completion-outbox/coordinator.ts +7 -12
  8. package/src/completion-outbox/file-store.ts +195 -123
  9. package/src/completion-outbox/types.ts +2 -0
  10. package/src/extension/herdr-window-provider.ts +794 -0
  11. package/src/extension/index.ts +1387 -286
  12. package/src/extension/mailbox/file-store.ts +25 -8
  13. package/src/extension/mailbox/host.ts +2 -0
  14. package/src/extension/mailbox/rollout.ts +12 -2
  15. package/src/extension/mailbox/router.ts +77 -33
  16. package/src/extension/mailbox/service.ts +4 -0
  17. package/src/extension/mailbox/types.ts +8 -1
  18. package/src/extension/monitor-window-lifecycle.ts +278 -0
  19. package/src/extension/monitor-window-state.ts +514 -0
  20. package/src/extension/monitor.ts +616 -15
  21. package/src/extension/remote-window-monitor.ts +357 -0
  22. package/src/extension/remote-window-session.ts +50 -0
  23. package/src/extension/runtime-actor-host.ts +113 -2
  24. package/src/extension/schemas.ts +112 -6
  25. package/src/extension/session-endpoints.ts +168 -20
  26. package/src/extension/teammate-helpers.ts +6 -0
  27. package/src/extension/teammate-proxy.ts +37 -0
  28. package/src/extension/tool-error-signal.ts +42 -0
  29. package/src/extension/workspace-peers.ts +8 -2848
  30. package/src/extension/workspace-turns-observation.ts +8 -5
  31. package/src/models/cli-add.ts +8 -2
  32. package/src/models/model-routing.ts +92 -0
  33. package/src/public/v1/index.ts +3 -0
  34. package/src/public/v1/monitor-window-state.ts +525 -0
  35. package/src/public/v1/session-history.ts +2 -0
  36. package/src/public/v1/ssh-hosts.ts +209 -0
  37. package/src/public/v2/runtime-broker.ts +6 -0
  38. package/src/public/v2/runtime.ts +3 -0
  39. package/src/remote/child-security.ts +30 -4
  40. package/src/remote/cli.ts +3 -1
  41. package/src/remote/config.ts +131 -17
  42. package/src/remote/driver.ts +15 -0
  43. package/src/remote/process-tree.ts +12 -28
  44. package/src/remote/protocol.ts +164 -1
  45. package/src/remote/server.ts +93 -1
  46. package/src/remote/ssh-exec.ts +17 -1
  47. package/src/remote/ssh.ts +162 -17
  48. package/src/remote/types.ts +29 -2
  49. package/src/remote/window-protocol.ts +501 -0
  50. package/src/remote/window-service.ts +566 -0
  51. package/src/runs/execution-infra.ts +61 -6
  52. package/src/runs/execution.ts +2 -0
  53. package/src/runs/pi-subprocess-attempt.ts +246 -99
  54. package/src/runtime-broker/client.ts +59 -11
  55. package/src/runtime-broker/mailbox-commit.ts +4 -3
  56. package/src/runtime-broker/session-commit.ts +121 -0
  57. package/src/runtime-v2/session-broker-read-model.ts +101 -0
  58. package/src/runtime-v2/session-domain.ts +397 -0
  59. package/src/runtime-v2/session-rollout.ts +90 -0
  60. package/src/sessions/session-core.ts +152 -19
  61. package/src/sessions/workspace-peer-core.ts +2997 -0
  62. package/src/shared/agent-status.ts +4 -1
  63. package/src/shared/types.ts +6 -3
  64. package/src/transcript/session-history.ts +788 -0
  65. package/src/tui/connection-wizards.ts +177 -16
  66. package/src/tui/locale-catalog-model.ts +36 -0
  67. package/src/tui/model-mapping-overlay.ts +60 -3
  68. package/src/tui/remote-config-pane.ts +114 -16
  69. package/src/tui/render.ts +504 -25
  70. package/types/cli-tools/cli-tools-config.d.ts +8 -3
  71. package/types/completion-outbox/file-store.d.ts +3 -5
  72. package/types/completion-outbox/types.d.ts +2 -0
  73. package/types/extension/herdr-window-provider.d.ts +165 -0
  74. package/types/extension/mailbox/host.d.ts +1 -0
  75. package/types/extension/mailbox/rollout.d.ts +6 -0
  76. package/types/extension/mailbox/router.d.ts +4 -0
  77. package/types/extension/mailbox/service.d.ts +4 -0
  78. package/types/extension/mailbox/types.d.ts +7 -0
  79. package/types/extension/monitor-window-lifecycle.d.ts +96 -0
  80. package/types/extension/monitor-window-state.d.ts +45 -0
  81. package/types/extension/monitor.d.ts +105 -0
  82. package/types/extension/remote-window-monitor.d.ts +52 -0
  83. package/types/extension/remote-window-session.d.ts +12 -0
  84. package/types/extension/runtime-actor-host.d.ts +3 -0
  85. package/types/extension/schemas.d.ts +19 -8
  86. package/types/extension/session-endpoints.d.ts +27 -3
  87. package/types/extension/teammate-helpers.d.ts +2 -0
  88. package/types/extension/tool-error-signal.d.ts +7 -0
  89. package/types/extension/workspace-peers.d.ts +4 -558
  90. package/types/models/model-routing.d.ts +17 -0
  91. package/types/public/v1/index.d.ts +3 -0
  92. package/types/public/v1/monitor-window-state.d.ts +183 -0
  93. package/types/public/v1/session-history.d.ts +2 -0
  94. package/types/public/v1/ssh-hosts.d.ts +24 -0
  95. package/types/public/v2/runtime-broker.d.ts +1 -0
  96. package/types/public/v2/runtime.d.ts +3 -0
  97. package/types/remote/child-security.d.ts +1 -0
  98. package/types/remote/config.d.ts +12 -4
  99. package/types/remote/driver.d.ts +8 -2
  100. package/types/remote/process-tree.d.ts +4 -4
  101. package/types/remote/protocol.d.ts +40 -4
  102. package/types/remote/server.d.ts +9 -1
  103. package/types/remote/ssh-exec.d.ts +3 -0
  104. package/types/remote/ssh.d.ts +9 -1
  105. package/types/remote/types.d.ts +22 -2
  106. package/types/remote/window-protocol.d.ts +127 -0
  107. package/types/remote/window-service.d.ts +21 -0
  108. package/types/runs/execution-infra.d.ts +3 -0
  109. package/types/runtime-broker/client.d.ts +2 -0
  110. package/types/runtime-broker/mailbox-commit.d.ts +2 -1
  111. package/types/runtime-broker/session-commit.d.ts +33 -0
  112. package/types/runtime-v2/session-broker-read-model.d.ts +16 -0
  113. package/types/runtime-v2/session-domain.d.ts +84 -0
  114. package/types/runtime-v2/session-rollout.d.ts +24 -0
  115. package/types/sessions/session-core.d.ts +47 -7
  116. package/types/sessions/workspace-peer-core.d.ts +603 -0
  117. package/types/shared/types.d.ts +4 -2
  118. package/types/transcript/session-history.d.ts +180 -0
  119. package/types/tui/connection-wizards.d.ts +13 -2
  120. package/types/tui/locale-catalog-model.d.ts +36 -0
  121. package/types/tui/model-mapping-overlay.d.ts +2 -0
  122. package/types/tui/remote-config-pane.d.ts +20 -0
  123. package/types/tui/render.d.ts +32 -1
package/README.md CHANGED
@@ -187,7 +187,17 @@ project .pi/agents > project .agents > ~/.agents > legacy user directory > bundl
187
187
 
188
188
  ## Model Routing Profiles
189
189
 
190
- Configure task-type defaults with `Alt+M` or `/teammate-models`. The Control Center's **Profiles** tab manages named routing Profiles shared by every project. Its **Routing** tab edits the active global Profile and combines built-in task types, discovered agent types, and types already present in that Profile.
190
+ Configure task-type defaults with `Alt+M` or `/teammate-models`. The Control Center's **Profiles** tab is the saved-template system: it manages multiple named routing Profiles shared by every project. Its **Routing** tab edits the active global Profile and combines built-in task types, discovered agent types, and types already present in that Profile.
191
+
192
+ Switch the current project's template directly by stable Profile ID or display name. With no argument, the command opens the Control Center on **Profiles**:
193
+
194
+ ```text
195
+ /teammate-model fast-lane
196
+ /teammate-model Fast Lane
197
+ /teammate-model
198
+ ```
199
+
200
+ Command completion lists every saved template and marks the project-active and global-default entries. If display names are duplicated, use the stable ID. Direct switching disables but preserves project overrides, matching the Profiles UI.
191
201
 
192
202
  The **Roles** tab lists discovered roles and their effective durable route. Role-scoped settings can be edited through the unified Settings surface as `role.<role-name>.model`, `role.<role-name>.fallbacks`, and `role.<role-name>.thinking`. These settings are stored in the same global Profile or project override file; package updates never rewrite role definitions or user routing data.
193
203
 
package/package.json CHANGED
@@ -1,209 +1,221 @@
1
- {
2
- "name": "pi-maestro-teammate",
3
- "version": "2.2.0",
4
- "description": "Pi extension — teammate agent dispatch with DAG task graphs, RPC messaging, and compact TUI",
5
- "type": "module",
6
- "engines": {
7
- "node": ">=22.19.0"
8
- },
9
- "bin": {
10
- "pi-teammate-broker": "./bin/pi-teammate-broker.mjs",
11
- "pi-teammate-models": "./bin/pi-teammate-models.mjs",
12
- "pi-teammate-outbox": "./bin/pi-teammate-outbox.mjs",
13
- "pi-teammate-remote": "./bin/pi-teammate-remote.mjs"
14
- },
15
- "keywords": [
16
- "pi-package",
17
- "pi-extension",
18
- "pi",
19
- "teammate",
20
- "agents"
21
- ],
22
- "scripts": {
23
- "test": "node --experimental-transform-types --import ./test/setup.ts --test --test-concurrency=2 \"test/*.test.ts\"",
24
- "typecheck": "tsc -p tsconfig.build.json",
25
- "build:declarations": "tsc -p tsconfig.declarations.json",
26
- "check:declarations": "node scripts/check-declarations.mjs",
27
- "prepack": "npm run build:declarations && node ../../scripts/bundle-settings-core.mjs",
28
- "postpack": "node ../../scripts/bundle-settings-core.mjs --clean",
29
- "test:e2e": "node --experimental-transform-types --import ./test/setup.ts --test --test-timeout=300000 test/backend-registry-dsh.e2e.test.ts",
30
- "refresh:acp-registry": "node scripts/refresh-acp-registry.mjs",
31
- "check:acp-registry": "node scripts/refresh-acp-registry.mjs --check"
32
- },
33
- "main": "./src/index.ts",
34
- "types": "./types/index.d.ts",
35
- "exports": {
36
- ".": {
37
- "types": "./types/index.d.ts",
38
- "default": "./src/index.ts"
39
- },
40
- "./v1": {
41
- "types": "./types/public/v1/index.d.ts",
42
- "default": "./src/public/v1/index.ts"
43
- },
44
- "./v1/acp-cli": {
45
- "types": "./types/backends/acp-cli.d.ts",
46
- "default": "./src/backends/acp-cli.ts"
47
- },
48
- "./v1/agents": {
49
- "types": "./types/public/v1/agents.d.ts",
50
- "default": "./src/public/v1/agents.ts"
51
- },
52
- "./v1/backends": {
53
- "types": "./types/public/v1/backends.d.ts",
54
- "default": "./src/public/v1/backends.ts"
55
- },
56
- "./v1/child-extensions": {
57
- "types": "./types/public/v1/child-extensions.d.ts",
58
- "default": "./src/public/v1/child-extensions.ts"
59
- },
60
- "./v1/events": {
61
- "types": "./types/public/v1/events.d.ts",
62
- "default": "./src/public/v1/events.ts"
63
- },
64
- "./v1/execution": {
65
- "types": "./types/public/v1/execution.d.ts",
66
- "default": "./src/public/v1/execution.ts"
67
- },
68
- "./v1/extension": {
69
- "types": "./types/public/v1/extension.d.ts",
70
- "default": "./src/public/v1/extension.ts"
71
- },
72
- "./v1/model-routing": {
73
- "types": "./types/public/v1/model-routing.d.ts",
74
- "default": "./src/public/v1/model-routing.ts"
75
- },
76
- "./v1/cli-tools": {
77
- "types": "./types/public/v1/cli-tools.d.ts",
78
- "default": "./src/public/v1/cli-tools.ts"
79
- },
80
- "./v1/completion-durability": {
81
- "types": "./types/public/v1/completion-durability.d.ts",
82
- "default": "./src/public/v1/completion-durability.ts"
83
- },
84
- "./v1/mailbox": {
85
- "types": "./types/public/v1/mailbox.d.ts",
86
- "default": "./src/public/v1/mailbox.ts"
87
- },
88
- "./v1/observation": {
89
- "types": "./types/public/v1/observation.d.ts",
90
- "default": "./src/public/v1/observation.ts"
91
- },
92
- "./v1/progress-tree": {
93
- "types": "./types/public/v1/progress-tree.d.ts",
94
- "default": "./src/public/v1/progress-tree.ts"
95
- },
96
- "./v1/remote": {
97
- "types": "./types/public/v1/remote.d.ts",
98
- "default": "./src/public/v1/remote.ts"
99
- },
100
- "./v1/retry": {
101
- "types": "./types/public/v1/retry.d.ts",
102
- "default": "./src/public/v1/retry.ts"
103
- },
104
- "./v1/scheduler": {
105
- "types": "./types/public/v1/scheduler.d.ts",
106
- "default": "./src/public/v1/scheduler.ts"
107
- },
108
- "./v1/sessions": {
109
- "types": "./types/public/v1/sessions.d.ts",
110
- "default": "./src/public/v1/sessions.ts"
111
- },
112
- "./v1/supervision": {
113
- "types": "./types/public/v1/supervision.d.ts",
114
- "default": "./src/public/v1/supervision.ts"
115
- },
116
- "./v1/workspace-projections": {
117
- "types": "./types/public/v1/workspace-projections.d.ts",
118
- "default": "./src/public/v1/workspace-projections.ts"
119
- },
120
- "./v1/workspace-completion": {
121
- "types": "./types/public/v1/workspace-completion.d.ts",
122
- "default": "./src/public/v1/workspace-completion.ts"
123
- },
124
- "./v1/todo-context": {
125
- "types": "./types/public/v1/todo-context.d.ts",
126
- "default": "./src/public/v1/todo-context.ts"
127
- },
128
- "./v1/types": {
129
- "types": "./types/public/v1/types.d.ts",
130
- "default": "./src/public/v1/types.ts"
131
- },
132
- "./v2/runtime": {
133
- "types": "./types/public/v2/runtime.d.ts",
134
- "default": "./src/public/v2/runtime.ts"
135
- },
136
- "./v2/runtime-broker": {
137
- "types": "./types/public/v2/runtime-broker.d.ts",
138
- "default": "./src/public/v2/runtime-broker.ts"
139
- },
140
- "./src/*": "./src/*"
141
- },
142
- "deprecatedSubpaths": {
143
- "./src/*": "Compatibility only; use the versioned ./v1/* public API."
144
- },
145
- "files": [
146
- "bin/*.mjs",
147
- "src/**/*.{ts,json}",
148
- "types/**/*.d.ts",
149
- "agents/",
150
- "README.md"
151
- ],
152
- "pi": {
153
- "extensions": [
154
- "./src/extension/index.ts"
155
- ]
156
- },
157
- "peerDependencies": {
158
- "@earendil-works/pi-agent-core": "*",
159
- "@earendil-works/pi-ai": "*",
160
- "@earendil-works/pi-coding-agent": "*",
161
- "@earendil-works/pi-tui": "*",
162
- "typebox": "*"
163
- },
164
- "peerDependenciesMeta": {
165
- "@earendil-works/pi-agent-core": {
166
- "optional": true
167
- },
168
- "@earendil-works/pi-ai": {
169
- "optional": true
170
- },
171
- "@earendil-works/pi-coding-agent": {
172
- "optional": true
173
- },
174
- "@earendil-works/pi-tui": {
175
- "optional": true
176
- },
177
- "typebox": {
178
- "optional": true
179
- }
180
- },
181
- "dependencies": {
182
- "@agentclientprotocol/sdk": "1.3.0",
183
- "cross-spawn": "7.0.6",
184
- "jiti": "2.7.0",
185
- "pi-maestro-settings-core": "0.2.1",
186
- "pi-maestro-backend-core": "*",
187
- "pi-maestro-backends": "*",
188
- "proper-lockfile": "4.1.2",
189
- "ssh2": "1.17.0",
190
- "zod": "4.4.3"
191
- },
192
- "bundledDependencies": [
193
- "pi-maestro-settings-core"
194
- ],
195
- "devDependencies": {
196
- "@earendil-works/pi-agent-core": "0.83.0",
197
- "@types/cross-spawn": "6.0.6",
198
- "@earendil-works/pi-ai": "0.83.0",
199
- "@earendil-works/pi-coding-agent": "0.83.0",
200
- "@earendil-works/pi-tui": "0.83.0",
201
- "@types/ssh2": "1.15.5",
202
- "typebox": "1.3.7"
203
- },
204
- "directories": {
205
- "test": "test"
206
- },
207
- "author": "",
208
- "license": "ISC"
209
- }
1
+ {
2
+ "name": "pi-maestro-teammate",
3
+ "version": "2.4.0",
4
+ "description": "Pi extension — teammate agent dispatch with DAG task graphs, RPC messaging, and compact TUI",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=22.19.0"
8
+ },
9
+ "bin": {
10
+ "pi-teammate-broker": "./bin/pi-teammate-broker.mjs",
11
+ "pi-teammate-models": "./bin/pi-teammate-models.mjs",
12
+ "pi-teammate-outbox": "./bin/pi-teammate-outbox.mjs",
13
+ "pi-teammate-remote": "./bin/pi-teammate-remote.mjs"
14
+ },
15
+ "keywords": [
16
+ "pi-package",
17
+ "pi-extension",
18
+ "pi",
19
+ "teammate",
20
+ "agents"
21
+ ],
22
+ "scripts": {
23
+ "test": "node --experimental-transform-types --import ./test/setup.ts --test --test-concurrency=2 \"test/*.test.ts\"",
24
+ "typecheck": "tsc -p tsconfig.build.json",
25
+ "build:declarations": "tsc -p tsconfig.declarations.json",
26
+ "check:declarations": "node scripts/check-declarations.mjs",
27
+ "prepack": "npm run build:declarations && node ../../scripts/bundle-settings-core.mjs",
28
+ "postpack": "node ../../scripts/bundle-settings-core.mjs --clean",
29
+ "test:e2e": "node --experimental-transform-types --import ./test/setup.ts --test --test-timeout=300000 test/backend-registry-dsh.e2e.test.ts",
30
+ "refresh:acp-registry": "node scripts/refresh-acp-registry.mjs",
31
+ "check:acp-registry": "node scripts/refresh-acp-registry.mjs --check"
32
+ },
33
+ "main": "./src/index.ts",
34
+ "types": "./types/index.d.ts",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./types/index.d.ts",
38
+ "default": "./src/index.ts"
39
+ },
40
+ "./v1": {
41
+ "types": "./types/public/v1/index.d.ts",
42
+ "default": "./src/public/v1/index.ts"
43
+ },
44
+ "./v1/acp-cli": {
45
+ "types": "./types/backends/acp-cli.d.ts",
46
+ "default": "./src/backends/acp-cli.ts"
47
+ },
48
+ "./v1/agents": {
49
+ "types": "./types/public/v1/agents.d.ts",
50
+ "default": "./src/public/v1/agents.ts"
51
+ },
52
+ "./v1/backends": {
53
+ "types": "./types/public/v1/backends.d.ts",
54
+ "default": "./src/public/v1/backends.ts"
55
+ },
56
+ "./v1/child-extensions": {
57
+ "types": "./types/public/v1/child-extensions.d.ts",
58
+ "default": "./src/public/v1/child-extensions.ts"
59
+ },
60
+ "./v1/events": {
61
+ "types": "./types/public/v1/events.d.ts",
62
+ "default": "./src/public/v1/events.ts"
63
+ },
64
+ "./v1/execution": {
65
+ "types": "./types/public/v1/execution.d.ts",
66
+ "default": "./src/public/v1/execution.ts"
67
+ },
68
+ "./v1/extension": {
69
+ "types": "./types/public/v1/extension.d.ts",
70
+ "default": "./src/public/v1/extension.ts"
71
+ },
72
+ "./v1/model-routing": {
73
+ "types": "./types/public/v1/model-routing.d.ts",
74
+ "default": "./src/public/v1/model-routing.ts"
75
+ },
76
+ "./v1/monitor-window-state": {
77
+ "types": "./types/public/v1/monitor-window-state.d.ts",
78
+ "default": "./src/public/v1/monitor-window-state.ts"
79
+ },
80
+ "./v1/cli-tools": {
81
+ "types": "./types/public/v1/cli-tools.d.ts",
82
+ "default": "./src/public/v1/cli-tools.ts"
83
+ },
84
+ "./v1/completion-durability": {
85
+ "types": "./types/public/v1/completion-durability.d.ts",
86
+ "default": "./src/public/v1/completion-durability.ts"
87
+ },
88
+ "./v1/mailbox": {
89
+ "types": "./types/public/v1/mailbox.d.ts",
90
+ "default": "./src/public/v1/mailbox.ts"
91
+ },
92
+ "./v1/observation": {
93
+ "types": "./types/public/v1/observation.d.ts",
94
+ "default": "./src/public/v1/observation.ts"
95
+ },
96
+ "./v1/progress-tree": {
97
+ "types": "./types/public/v1/progress-tree.d.ts",
98
+ "default": "./src/public/v1/progress-tree.ts"
99
+ },
100
+ "./v1/remote": {
101
+ "types": "./types/public/v1/remote.d.ts",
102
+ "default": "./src/public/v1/remote.ts"
103
+ },
104
+ "./v1/retry": {
105
+ "types": "./types/public/v1/retry.d.ts",
106
+ "default": "./src/public/v1/retry.ts"
107
+ },
108
+ "./v1/session-history": {
109
+ "types": "./types/public/v1/session-history.d.ts",
110
+ "default": "./src/public/v1/session-history.ts"
111
+ },
112
+ "./v1/scheduler": {
113
+ "types": "./types/public/v1/scheduler.d.ts",
114
+ "default": "./src/public/v1/scheduler.ts"
115
+ },
116
+ "./v1/sessions": {
117
+ "types": "./types/public/v1/sessions.d.ts",
118
+ "default": "./src/public/v1/sessions.ts"
119
+ },
120
+ "./v1/supervision": {
121
+ "types": "./types/public/v1/supervision.d.ts",
122
+ "default": "./src/public/v1/supervision.ts"
123
+ },
124
+ "./v1/ssh-hosts": {
125
+ "types": "./types/public/v1/ssh-hosts.d.ts",
126
+ "default": "./src/public/v1/ssh-hosts.ts"
127
+ },
128
+ "./v1/workspace-projections": {
129
+ "types": "./types/public/v1/workspace-projections.d.ts",
130
+ "default": "./src/public/v1/workspace-projections.ts"
131
+ },
132
+ "./v1/workspace-completion": {
133
+ "types": "./types/public/v1/workspace-completion.d.ts",
134
+ "default": "./src/public/v1/workspace-completion.ts"
135
+ },
136
+ "./v1/todo-context": {
137
+ "types": "./types/public/v1/todo-context.d.ts",
138
+ "default": "./src/public/v1/todo-context.ts"
139
+ },
140
+ "./v1/types": {
141
+ "types": "./types/public/v1/types.d.ts",
142
+ "default": "./src/public/v1/types.ts"
143
+ },
144
+ "./v2/runtime": {
145
+ "types": "./types/public/v2/runtime.d.ts",
146
+ "default": "./src/public/v2/runtime.ts"
147
+ },
148
+ "./v2/runtime-broker": {
149
+ "types": "./types/public/v2/runtime-broker.d.ts",
150
+ "default": "./src/public/v2/runtime-broker.ts"
151
+ },
152
+ "./src/*": "./src/*"
153
+ },
154
+ "deprecatedSubpaths": {
155
+ "./src/*": "Compatibility only; use the versioned ./v1/* public API."
156
+ },
157
+ "files": [
158
+ "bin/*.mjs",
159
+ "src/**/*.{ts,json}",
160
+ "types/**/*.d.ts",
161
+ "agents/",
162
+ "README.md"
163
+ ],
164
+ "pi": {
165
+ "extensions": [
166
+ "./src/extension/index.ts"
167
+ ]
168
+ },
169
+ "peerDependencies": {
170
+ "@earendil-works/pi-agent-core": "*",
171
+ "@earendil-works/pi-ai": "*",
172
+ "@earendil-works/pi-coding-agent": "*",
173
+ "@earendil-works/pi-tui": "*",
174
+ "typebox": "*"
175
+ },
176
+ "peerDependenciesMeta": {
177
+ "@earendil-works/pi-agent-core": {
178
+ "optional": true
179
+ },
180
+ "@earendil-works/pi-ai": {
181
+ "optional": true
182
+ },
183
+ "@earendil-works/pi-coding-agent": {
184
+ "optional": true
185
+ },
186
+ "@earendil-works/pi-tui": {
187
+ "optional": true
188
+ },
189
+ "typebox": {
190
+ "optional": true
191
+ }
192
+ },
193
+ "dependencies": {
194
+ "@agentclientprotocol/sdk": "1.3.0",
195
+ "cross-spawn": "7.0.6",
196
+ "jiti": "2.7.0",
197
+ "pi-maestro-settings-core": "0.2.1",
198
+ "pi-maestro-backend-core": "*",
199
+ "pi-maestro-backends": "*",
200
+ "proper-lockfile": "4.1.2",
201
+ "ssh2": "1.17.0",
202
+ "zod": "4.4.3"
203
+ },
204
+ "bundledDependencies": [
205
+ "pi-maestro-settings-core"
206
+ ],
207
+ "devDependencies": {
208
+ "@earendil-works/pi-agent-core": "0.84.4",
209
+ "@types/cross-spawn": "6.0.6",
210
+ "@earendil-works/pi-ai": "0.84.4",
211
+ "@earendil-works/pi-coding-agent": "0.84.4",
212
+ "@earendil-works/pi-tui": "0.84.4",
213
+ "@types/ssh2": "1.15.5",
214
+ "typebox": "1.3.7"
215
+ },
216
+ "directories": {
217
+ "test": "test"
218
+ },
219
+ "author": "",
220
+ "license": "ISC"
221
+ }
@@ -43,6 +43,9 @@ export const ACP_CLI_SETTINGS_CATALOGS: TranslationCatalogs = {
43
43
  "acpCli.mode": "Launch mode",
44
44
  "acpCli.mode.local": "Local process",
45
45
  "acpCli.mode.ssh": "Remote over SSH",
46
+ "acpCli.sshHostRef": "/ssh host reference",
47
+ "acpCli.sshHostRef.description":
48
+ "Host id from the unlocked encrypted /ssh manager. Use it instead of every embedded SSH connection field; the host is resolved again for each run.",
46
49
  "acpCli.host": "SSH host",
47
50
  "acpCli.user": "SSH user",
48
51
  "acpCli.port": "SSH port",
@@ -92,6 +95,9 @@ export const ACP_CLI_SETTINGS_CATALOGS: TranslationCatalogs = {
92
95
  "acpCli.mode": "启动方式",
93
96
  "acpCli.mode.local": "本地进程",
94
97
  "acpCli.mode.ssh": "经 SSH 远程",
98
+ "acpCli.sshHostRef": "/ssh 主机引用",
99
+ "acpCli.sshHostRef.description":
100
+ "已解锁加密 /ssh 管理器中的主机 id。它必须替代全部内嵌 SSH 连接字段,并在每次运行时重新解析。",
95
101
  "acpCli.host": "SSH 主机",
96
102
  "acpCli.user": "SSH 用户",
97
103
  "acpCli.port": "SSH 端口",
@@ -52,6 +52,7 @@ import type {
52
52
  import {
53
53
  cliToolArgv,
54
54
  probeCliToolCommand,
55
+ sshHostConfigIssue,
55
56
  type CliToolConfig,
56
57
  } from "../cli-tools/cli-tools-config.ts";
57
58
  import {
@@ -282,9 +283,18 @@ export const ACP_CLI_CONFIG_FIELDS: readonly BackendConfigField[] = [
282
283
  labelKey: "acpCli.mode",
283
284
  default: "local",
284
285
  },
286
+ {
287
+ key: "sshHostRef",
288
+ kind: "text",
289
+ labelKey: "acpCli.sshHostRef",
290
+ descriptionKey: "acpCli.sshHostRef.description",
291
+ },
285
292
  { key: "host", kind: "text", labelKey: "acpCli.host" },
286
293
  { key: "user", kind: "text", labelKey: "acpCli.user" },
287
- { key: "port", kind: "integer", labelKey: "acpCli.port", default: 22 },
294
+ // Applied only to embedded SSH below. Leaving this declaration without a
295
+ // generic default lets validation distinguish an explicit override from a
296
+ // reference that must take its port exclusively from `/ssh`.
297
+ { key: "port", kind: "integer", labelKey: "acpCli.port" },
288
298
  { key: "hostKeySha256", kind: "text", labelKey: "acpCli.hostKeySha256" },
289
299
  { key: "identityFile", kind: "path", labelKey: "acpCli.identityFile" },
290
300
  {
@@ -420,6 +430,7 @@ async function installedLaunchConfig(
420
430
  function launchConfigOf(config: Record<string, ConfigValue>): CliToolConfig {
421
431
  const command = text(config, "command");
422
432
  const cwd = text(config, "cwd");
433
+ const sshHostRef = text(config, "sshHostRef");
423
434
  const host = text(config, "host");
424
435
  const user = text(config, "user");
425
436
  const port = count(config, "port");
@@ -432,6 +443,7 @@ function launchConfigOf(config: Record<string, ConfigValue>): CliToolConfig {
432
443
  args: list(config, "args"),
433
444
  ...(cwd === undefined ? {} : { cwd }),
434
445
  env: list(config, "env"),
446
+ ...(sshHostRef === undefined ? {} : { sshHostRef }),
435
447
  ...(host === undefined ? {} : { host }),
436
448
  ...(user === undefined ? {} : { user }),
437
449
  ...(port === undefined ? {} : { port }),
@@ -605,14 +617,18 @@ export function createAcpCliBackend(
605
617
  + "parent process forwards by name; a name=value entry puts the value in the registration document",
606
618
  );
607
619
  }
608
- // Checked at load rather than at launch: the runner's ssh path already
609
- // fails closed on an incomplete host, but it does so per run, long after
610
- // the operator stopped looking at the file that caused it.
620
+ // Checked at load rather than at launch: one SSH source must be complete
621
+ // and authoritative. A reference cannot be paired with even a seemingly
622
+ // harmless port override, because that would recreate two sources of
623
+ // truth for the connection.
611
624
  if (mode === "ssh") {
612
- for (const key of ["host", "user", "hostKeySha256"]) {
613
- if ((text(config, key) ?? "").trim().length > 0) continue;
614
- errors.push(`"${key}" is required when "mode" is "ssh"`);
625
+ const issue = sshHostConfigIssue(launchConfigOf(values));
626
+ if (issue !== undefined) errors.push(issue);
627
+ else if ((text(values, "sshHostRef") ?? "").trim().length === 0 && count(values, "port") === undefined) {
628
+ values.port = 22;
615
629
  }
630
+ } else if ((text(values, "sshHostRef") ?? "").trim().length > 0) {
631
+ errors.push('"sshHostRef" requires "mode" to be "ssh"');
616
632
  }
617
633
  return { values, errors };
618
634
  },
@@ -638,7 +654,7 @@ export function createAcpCliBackend(
638
654
  // beats returning the local machine's answer for a remote target.
639
655
  throw new Error(
640
656
  `teammate backend "acp-cli" cannot list "${field}" for an "ssh" registration: `
641
- + "the probe launches the agent locally, so the target host's catalogue is not reachable here",
657
+ + "whether embedded or selected by sshHostRef, the target host's catalogue is not reachable by the local probe",
642
658
  );
643
659
  }
644
660
  const route = routeOf(config);