@ai_mind/dsh-a2a 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -228,6 +228,16 @@ JSON-RPC 方法名:`SendMessage`、`SendStreamingMessage`、`GetTask`、`ListT
228
228
 
229
229
  凭据来源(可组合):`auth.clients[{id,token}]`、`auth.tokens[]`、`auth.token`、`auth.tokenEnv`(环境变量,支持逗号/换行分隔多个)。启用鉴权后 Agent Card 会自动声明 `securitySchemes` 与 `securityRequirements`。
230
230
 
231
+ 内联令牌可以直接写在插件配置里(设置页的「A2A 访问令牌(内联)」字段等价):
232
+
233
+ ```yaml
234
+ auth:
235
+ mode: bearer
236
+ token: 'your-long-random-token'
237
+ ```
238
+
239
+ > 在设置页输入令牌时,如果 `auth.mode` 还是 `none`,保存会自动切换为 `bearer`。令牌不会回显;它会以明文保存在 profile 的 `cordis.patch.yml`(权限 600),生产环境建议改用 `auth.tokenEnv` 或 `auth.clients`。
240
+
231
241
  **每个凭据是一个独立的租户边界**:任务与 Push 配置按凭据 id 隔离,客户端 A 看不到客户端 B 的任务。未鉴权时所有 loopback 调用方共享 `anonymous` 作用域。
232
242
 
233
243
  ### 默认安全姿态
package/client.js CHANGED
@@ -72,11 +72,11 @@ window.__ModuleLoader__.load({
72
72
  saveError: '保存失败',
73
73
  reload: '重新读取',
74
74
  dirty: '有未保存的修改',
75
- token: '访问令牌',
76
- tokenHint: '写回 profile YAML;推荐改用 auth.tokenEnv 从环境变量读取。',
77
- tokenPlaceholder: '留空保持不变',
75
+ token: 'A2A 访问令牌(内联)',
76
+ tokenHint: '保存后写入插件配置的 auth.token;如果鉴权模式为 none,会自动切换为 bearer。值不会回显。',
77
+ tokenPlaceholder: '输入新的访问令牌',
78
78
  clearToken: '清除已保存的内联令牌',
79
- tokenConfigured: '已配置内联令牌',
79
+ tokenConfigured: '已配置内联令牌(值不会回显)',
80
80
  tokenNotConfigured: '未配置内联令牌',
81
81
  tokenEnvConfigured: '环境变量已配置:{name}',
82
82
  openCard: '打开 Agent Card',
@@ -183,11 +183,11 @@ window.__ModuleLoader__.load({
183
183
  saveError: 'Save failed',
184
184
  reload: 'Reload',
185
185
  dirty: 'Unsaved changes',
186
- token: 'Access token',
187
- tokenHint: 'Stored in the profile YAML. Prefer auth.tokenEnv instead.',
188
- tokenPlaceholder: 'Leave empty to keep',
186
+ token: 'A2A access token (inline)',
187
+ tokenHint: 'Saved as auth.token in the plugin config. A mode of "none" switches to bearer automatically. The value is never echoed.',
188
+ tokenPlaceholder: 'Enter a new access token',
189
189
  clearToken: 'Clear the saved inline token',
190
- tokenConfigured: 'Inline token configured',
190
+ tokenConfigured: 'Inline token configured (value is never shown)',
191
191
  tokenNotConfigured: 'No inline token',
192
192
  tokenEnvConfigured: 'Environment variable: {name}',
193
193
  openCard: 'Open Agent Card',
@@ -653,7 +653,7 @@ window.__ModuleLoader__.load({
653
653
  const secretBlock = panel
654
654
  ? h(
655
655
  'div',
656
- { className: 'a2aui-group' },
656
+ { className: 'a2aui-group', key: 'inline-token' },
657
657
  h('h5', { className: 'a2aui-group-title' }, t('token')),
658
658
  h(
659
659
  'div',
@@ -704,8 +704,8 @@ window.__ModuleLoader__.load({
704
704
  ? h(
705
705
  'div',
706
706
  { className: 'a2aui-form' },
707
- ...groups.map(([group, fields]) =>
708
- h(
707
+ ...groups.flatMap(([group, fields]) => {
708
+ const node = h(
709
709
  'div',
710
710
  { className: 'a2aui-group', key: group },
711
711
  h('h5', { className: 'a2aui-group-title' }, groupLabel(t, group)),
@@ -717,9 +717,9 @@ window.__ModuleLoader__.load({
717
717
  h('div', null, renderControl(field)),
718
718
  ),
719
719
  ),
720
- ),
721
- ),
722
- secretBlock,
720
+ )
721
+ return group === 'auth' ? [node, secretBlock] : [node]
722
+ }),
723
723
  h(
724
724
  'div',
725
725
  { className: 'a2aui-form-foot' },
package/lib/panel.js CHANGED
@@ -286,7 +286,7 @@ export function createPanelRouter({ ctx, config, mountPath, logger, status, heal
286
286
  res.setHeader('Cache-Control', 'no-store')
287
287
  res.json({
288
288
  ok: true,
289
- plugin: { name: PLUGIN_NAME, version: '1.1.0' },
289
+ plugin: { name: PLUGIN_NAME, version: '1.1.1' },
290
290
  mountPath,
291
291
  ...payload,
292
292
  ...(typeof status === 'function' ? { server: status() } : {}),
@@ -342,6 +342,9 @@ export function createPanelRouter({ ctx, config, mountPath, logger, status, heal
342
342
  if (typeof body.token !== 'string') throw new Error('token must be a string')
343
343
  if (body.token.trim() === '') throw new Error('token must not be empty')
344
344
  setAt(next, 'auth.token', body.token)
345
+ // A token with auth.mode "none" would be stored but never used. Treat
346
+ // an explicitly supplied token as the intent to enable bearer auth.
347
+ if ((next.auth?.mode ?? 'none') === 'none') setAt(next, 'auth.mode', 'bearer')
345
348
  }
346
349
 
347
350
  const normalized = normalizeConfig(next)
@@ -380,7 +383,7 @@ export function createPanelRouter({ ctx, config, mountPath, logger, status, heal
380
383
  logger.info('[a2a] configuration updated from the settings panel')
381
384
  res.json({
382
385
  ok: true,
383
- plugin: { name: PLUGIN_NAME, version: '1.1.0' },
386
+ plugin: { name: PLUGIN_NAME, version: '1.1.1' },
384
387
  mountPath,
385
388
  ...describe(live, liveEntry, []),
386
389
  ...(typeof status === 'function' ? { server: status() } : {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai_mind/dsh-a2a",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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",