@hmharness/agent 0.23.37 → 0.23.39

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/dist/i18n.d.ts CHANGED
@@ -98,6 +98,20 @@ export interface Strings {
98
98
  /** palette footer key hint: how to drive the slash/model picker (TUI) */
99
99
  panelHint: string;
100
100
  cmdModelPreset: (name: string, envVar: string) => string;
101
+ cmdConfig: string;
102
+ cfgTitle: string;
103
+ cfgListHint: string;
104
+ cfgNewRow: string;
105
+ cfgColUse: string;
106
+ cfgFieldName: string;
107
+ cfgFieldBaseUrl: string;
108
+ cfgFieldModel: string;
109
+ cfgFieldKey: string;
110
+ cfgFormHint: string;
111
+ cfgKeyNote: string;
112
+ cfgSavedOk: string;
113
+ cfgBackRow: string;
114
+ cfgSaveRow: string;
101
115
  cmdProvidersListed: string;
102
116
  /** tail hint after a bare /providers listing (TUI) */
103
117
  cmdProvidersScanHint: string;
package/dist/i18n.js CHANGED
@@ -77,6 +77,20 @@ const zh = {
77
77
  cmdModelHint: '切换 chat 路由: /model <name>',
78
78
  panelHint: '↑↓/滚轮/点击 选择 · Enter 确认 · Esc 关闭',
79
79
  cmdModelPreset: (name, envVar) => `${name} 尚未配置 — 设置 ${envVar} 后运行 /providers scan 添加`,
80
+ cmdConfig: '配置 API 密钥 / 模型(可视化编辑)',
81
+ cfgTitle: '配置 · Providers',
82
+ cfgListHint: '↑↓ 选择 · Enter 编辑 · Esc 关闭 · 鼠标点击行直达',
83
+ cfgNewRow: '+ 新增 provider…',
84
+ cfgColUse: '用途',
85
+ cfgFieldName: '名称',
86
+ cfgFieldBaseUrl: '地址',
87
+ cfgFieldModel: '模型',
88
+ cfgFieldKey: 'API 密钥',
89
+ cfgFormHint: 'Enter 下一项(末项=保存) · Esc 返回 · 点击行跳转',
90
+ cfgKeyNote: '留空 = 保留已存密钥;输入新值 = 覆盖',
91
+ cfgSavedOk: '✓ 已保存',
92
+ cfgBackRow: '← 返回列表',
93
+ cfgSaveRow: '✓ 保存并返回',
80
94
  cmdProvidersListed: '未探测到新的本地厂商(环境变量/opencode 配置)',
81
95
  cmdProvidersScanHint: '/providers scan 将它们写入配置',
82
96
  thinkingLabel: '[思考中] ',
@@ -233,6 +247,20 @@ const en = {
233
247
  cmdModelHint: 'switch chat route: /model <name>',
234
248
  panelHint: '↑↓ / wheel / click to select · Enter confirms · Esc closes',
235
249
  cmdModelPreset: (name, envVar) => `${name} not configured - set ${envVar}, then run /providers scan`,
250
+ cmdConfig: 'Configure API keys / models (visual editor)',
251
+ cfgTitle: 'Settings · Providers',
252
+ cfgListHint: '↑↓ select · Enter edit · Esc close · click a row',
253
+ cfgNewRow: '+ add provider…',
254
+ cfgColUse: 'use',
255
+ cfgFieldName: 'name',
256
+ cfgFieldBaseUrl: 'baseURL',
257
+ cfgFieldModel: 'model',
258
+ cfgFieldKey: 'API key',
259
+ cfgFormHint: 'Enter next field (last saves) · Esc back · click a field row',
260
+ cfgKeyNote: 'blank keeps the stored key; typing overwrites',
261
+ cfgSavedOk: '✓ saved',
262
+ cfgBackRow: '← back to list',
263
+ cfgSaveRow: '✓ save & back',
236
264
  cmdProvidersListed: 'no new local providers detected (env vars / opencode config)',
237
265
  cmdProvidersScanHint: '/providers scan writes them into the config',
238
266
  thinkingLabel: '[thinking] ',
package/dist/runner.d.ts CHANGED
@@ -119,6 +119,11 @@ export interface InjectPoll {
119
119
  }
120
120
  export interface AgentTaskOptions {
121
121
  task: string;
122
+ /** Native image attachments (data URLs) for multimodal chat models:
123
+ * passed through to the first user message when the chat provider sees
124
+ * images (default-multimodal policy, 2026-10-22). Text-only providers
125
+ * never get these - the caller describes images into text instead. */
126
+ images?: string[];
122
127
  registry: Registry;
123
128
  cfg?: HmhConfig;
124
129
  ctx?: ToolContext;
package/dist/runner.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Also owns the native registry factory (spawn_agent recursion) and the
6
6
  * approval gate construction.
7
7
  */
8
- import { homeDir, loadConfig, resolveProvider, getGoal, mcpServerTools, Registry, runLoop, Session, } from '@hmharness/kernel';
8
+ import { chatSeesImages, homeDir, loadConfig, resolveProvider, getGoal, mcpServerTools, Registry, runLoop, Session, } from '@hmharness/kernel';
9
9
  import { brief, createTrajectoryRecorder } from '@hmharness/observability';
10
10
  import { CognitiveRunRecorder } from "./cognitive-recorder.js";
11
11
  import { readFile } from 'node:fs/promises';
@@ -412,10 +412,14 @@ export async function runAgentTask(opts) {
412
412
  session,
413
413
  onLine: (l) => events.onLine?.(l),
414
414
  };
415
+ // default-multimodal (2026-10-22): only attach images natively when the
416
+ // chat model can actually see them; a text-only chat model must receive
417
+ // text the caller already described
418
+ const nativeImages = chatSeesImages(resolveProvider(cfg, 'chat')) ? opts.images : undefined;
415
419
  const messages = [
416
420
  { role: 'system', content: system },
417
421
  ...(opts.resumeMessages ?? []),
418
- { role: 'user', content: opts.task },
422
+ { role: 'user', content: opts.task, ...(nativeImages && nativeImages.length ? { images: nativeImages } : {}) },
419
423
  ];
420
424
  const toolsUsed = [];
421
425
  // self-noted failure patterns: 2+ errors from one tool become a memory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/agent",
3
- "version": "0.23.37",
3
+ "version": "0.23.39",
4
4
  "description": "hmharness agent execution layer: base tools, system prompt, sub-agent spawn, and the shared task runner that frontends (cli, web) drive.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,16 +15,16 @@
15
15
  "build": "tsc -p tsconfig.build.json"
16
16
  },
17
17
  "dependencies": {
18
- "@hmharness/cognitive": "0.23.37",
19
- "@hmharness/domain-harmony": "0.23.37",
20
- "@hmharness/domain-ops": "0.23.37",
21
- "@hmharness/evolution": "0.23.37",
22
- "@hmharness/kernel": "0.23.37",
23
- "@hmharness/observability": "0.23.37",
24
- "@hmharness/sandbox": "0.23.37",
25
- "@hmharness/lsp": "0.23.37",
26
- "@hmharness/browser": "0.23.37",
27
- "@hmharness/extension": "0.23.37"
18
+ "@hmharness/cognitive": "0.23.39",
19
+ "@hmharness/domain-harmony": "0.23.39",
20
+ "@hmharness/domain-ops": "0.23.39",
21
+ "@hmharness/evolution": "0.23.39",
22
+ "@hmharness/kernel": "0.23.39",
23
+ "@hmharness/observability": "0.23.39",
24
+ "@hmharness/sandbox": "0.23.39",
25
+ "@hmharness/lsp": "0.23.39",
26
+ "@hmharness/browser": "0.23.39",
27
+ "@hmharness/extension": "0.23.39"
28
28
  },
29
29
  "files": [
30
30
  "dist"