@hmharness/agent 0.23.37 → 0.23.38

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/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.38",
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.38",
19
+ "@hmharness/domain-harmony": "0.23.38",
20
+ "@hmharness/domain-ops": "0.23.38",
21
+ "@hmharness/evolution": "0.23.38",
22
+ "@hmharness/kernel": "0.23.38",
23
+ "@hmharness/observability": "0.23.38",
24
+ "@hmharness/sandbox": "0.23.38",
25
+ "@hmharness/lsp": "0.23.38",
26
+ "@hmharness/browser": "0.23.38",
27
+ "@hmharness/extension": "0.23.38"
28
28
  },
29
29
  "files": [
30
30
  "dist"