@ai_mind/dsh-a2a 1.1.3 → 1.1.4

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 CHANGED
@@ -322,8 +322,11 @@ A2A 前面的 Nginx/Caddy 等反代需要保留原始 `Host` 和协议头:
322
322
  proxy_set_header Host $host;
323
323
  proxy_set_header X-Forwarded-Proto $scheme;
324
324
  proxy_set_header X-Forwarded-Host $host;
325
+ proxy_set_header X-Forwarded-Port $server_port;
325
326
  ```
326
327
 
328
+ 自定义外部端口时,代理除了 `Host` 还要传 `X-Forwarded-Port`(或让 `Host` 直接包含端口),卡片才会带上正确端口。
329
+
327
330
  并设置:
328
331
 
329
332
  ```yaml
package/lib/panel.js CHANGED
@@ -287,7 +287,7 @@ export function createPanelRouter({ ctx, config, mountPath, logger, status, heal
287
287
  res.setHeader('Cache-Control', 'no-store')
288
288
  res.json({
289
289
  ok: true,
290
- plugin: { name: PLUGIN_NAME, version: '1.1.3' },
290
+ plugin: { name: PLUGIN_NAME, version: '1.1.4' },
291
291
  mountPath,
292
292
  ...payload,
293
293
  ...(typeof status === 'function' ? { server: status() } : {}),
@@ -384,7 +384,7 @@ export function createPanelRouter({ ctx, config, mountPath, logger, status, heal
384
384
  logger.info('[a2a] configuration updated from the settings panel')
385
385
  res.json({
386
386
  ok: true,
387
- plugin: { name: PLUGIN_NAME, version: '1.1.3' },
387
+ plugin: { name: PLUGIN_NAME, version: '1.1.4' },
388
388
  mountPath,
389
389
  ...describe(live, liveEntry, []),
390
390
  ...(typeof status === 'function' ? { server: status() } : {}),
package/lib/server.js CHANGED
@@ -94,6 +94,13 @@ function baseFromHeaders(headers, config, fallbackProtocol = 'http') {
94
94
  try {
95
95
  const url = new URL(`${protocol}://${host}`)
96
96
  if (url.protocol !== 'http:' && url.protocol !== 'https:') return null
97
+ // A proxy may expose the service on a non-standard port while forwarding
98
+ // only the hostname; X-Forwarded-Port carries the client-facing port.
99
+ if (trusted && url.port === '') {
100
+ const forwardedPort = firstHeader(headers?.['x-forwarded-port'])
101
+ const port = Number(forwardedPort?.split(',')[0].trim())
102
+ if (Number.isInteger(port) && port >= 1 && port <= 65535) url.port = String(port)
103
+ }
97
104
  return trimTrailingSlash(url.origin)
98
105
  } catch {
99
106
  return null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai_mind/dsh-a2a",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Production A2A (Agent2Agent) v1.0 server for DeepSeek Harness agents: JSON-RPC + HTTP+JSON bindings, streaming, tasks, push notifications and signed Agent Cards.",
5
5
  "type": "module",
6
6
  "license": "MIT",