@myagentroam/agent 0.9.147 → 0.9.148

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.
@@ -48,17 +48,18 @@ export async function createMarAgentWithAdapter(options) {
48
48
  activeAdapters.add(adapter);
49
49
  return activeAdapters;
50
50
  };
51
+ const settings = {
52
+ ...(options.workspaceMapping === undefined
53
+ ? {}
54
+ : { workspaceMapping: options.workspaceMapping }),
55
+ ...(options.systemInstruction === undefined
56
+ ? {}
57
+ : { systemInstruction: options.systemInstruction })
58
+ };
51
59
  const openSession = createSessionOpener({
52
60
  host: options.host,
53
61
  description,
54
- settings: {
55
- ...(options.workspaceMapping === undefined
56
- ? {}
57
- : { workspaceMapping: options.workspaceMapping }),
58
- ...(options.systemInstruction === undefined
59
- ? {}
60
- : { systemInstruction: options.systemInstruction })
61
- },
62
+ settings,
62
63
  store,
63
64
  registry: {
64
65
  active,
@@ -95,6 +96,14 @@ export async function createMarAgentWithAdapter(options) {
95
96
  await options.host.disposeSessionResources?.(id);
96
97
  await store.clearSession(id);
97
98
  },
99
+ setSystemInstruction: (systemInstruction) => {
100
+ if (disposed)
101
+ throw new MarAgentError('MAR_AGENT_DISPOSED', 'Agent is disposed.');
102
+ if (systemInstruction === undefined)
103
+ delete settings.systemInstruction;
104
+ else
105
+ settings.systemInstruction = systemInstruction;
106
+ },
98
107
  reconfigureModels: async (input) => {
99
108
  if (disposed)
100
109
  throw new MarAgentError('MAR_AGENT_DISPOSED', 'Agent is disposed.');
@@ -109,6 +109,7 @@ export function createSessionOpener(services) {
109
109
  ...currentLocalTimeContext()
110
110
  };
111
111
  const { models: executionModels, defaultModelId: executionDefaultModelId, generation: executionModelGeneration } = services.modelState();
112
+ const executionSystemInstruction = settings.systemInstruction;
112
113
  const manualCompactionId = mode === 'compact' ? randomUUID() : undefined;
113
114
  active.set(`${sessionId}:${executionId}`, controller);
114
115
  const mailbox = [...(internal.initialMailbox ?? [])];
@@ -564,7 +565,7 @@ export function createSessionOpener(services) {
564
565
  .map((tool) => tool.name),
565
566
  highDensityCompaction: selectedModel.highDensityCompaction,
566
567
  extension: [
567
- settings.systemInstruction,
568
+ executionSystemInstruction,
568
569
  instructionContext?.skillCatalog,
569
570
  sessionSource.type === 'subagent' ? childSubagentInstruction : undefined
570
571
  ]
@@ -37,6 +37,8 @@ export interface MarAgent {
37
37
  }>;
38
38
  setSessionTitle(sessionId: string, title: string, input?: SessionTitleUpdateInput): Promise<boolean>;
39
39
  clearSession(sessionId: string): Promise<void>;
40
+ /** Updates future execution snapshots only; undefined clears the Host instruction extension. */
41
+ setSystemInstruction(systemInstruction?: string): void;
40
42
  /** Rebinds future main executions only; running subagents keep their captured model providers. */
41
43
  reconfigureModels(input: {
42
44
  readonly models: readonly MarAgentModelConfiguration[];
@@ -34,7 +34,7 @@ Tool calls:
34
34
 
35
35
  Built-in namespaces:
36
36
  - observe.result(result): void registers an unmodified complete tools.NAME result or caught tool error as a trusted tool_result, using the original text and all images without repeating program data. Non-original, copied or modified values are rejected. This selects evidence for the next model response, not a log and not a new model call. Prefer observe.result for inspecting tool results.
37
- - observe.text(value): void registers bounded text/JSON values. observe.image(value): void registers one image value using the existing capability, MIME, byte and count limits. Both accept original tool results for compatibility and use the same complete tool_result observation path; they do not select part of an original result. Extracted single images, copies and computed summaries are value observations, never trusted tool results. Observations are returned in registration order. Only explicitly observed evidence reaches the model; registration does not prove inspection. Sources and types are runtime-assigned. No out or callable observe(value) alias exists.
37
+ - observe.text(value): void registers bounded text/JSON values. observe.image(value): void registers one image value using the existing capability, MIME and byte limits. Both accept original tool results for compatibility and use the same complete tool_result observation path; they do not select part of an original result. Extracted single images, copies and computed summaries are value observations, never trusted tool results. Observations are returned in registration order. Only explicitly observed evidence reaches the model; registration does not prove inspection. Sources and types are runtime-assigned. No out or callable observe(value) alias exists.
38
38
  - state.get(key), state.has(key), state.set(key, value), state.delete(key) access bounded session JSON state. Mutations commit atomically only when the cell succeeds; failed or cancelled cells discard them.
39
39
  - catalog.tools() returns a read-only snapshot of the tools callable in this cell, including name, description, inputSchema and inputMode. It does not discover or authorize additional tools.
40
40
  - await cell.sleep(ms) performs a cancellable Host-side delay up to 30000 ms and remains subject to the cell deadline.
@@ -356,8 +356,6 @@ export class CodeModeTool {
356
356
  const addImage = (raw) => {
357
357
  if (!context.codeMode?.supportsImages)
358
358
  throw new MarAgentError('MAR_AGENT_INPUT_CAPABILITY_UNSUPPORTED', 'The current model cannot receive image observations.');
359
- if (images.length >= 5)
360
- throw new MarAgentError('MAR_AGENT_TOOL_OUTPUT_LIMIT', 'Code Mode emitted too many images.');
361
359
  const image = parseImage(raw);
362
360
  const index = images.length;
363
361
  images.push(image);
@@ -442,8 +440,6 @@ export class CodeModeTool {
442
440
  if (!context.codeMode?.supportsImages)
443
441
  throw new MarAgentError('MAR_AGENT_INPUT_CAPABILITY_UNSUPPORTED', 'The current Code Mode context does not support image output.');
444
442
  const image = parseImage(frame.value);
445
- if (images.length >= 5)
446
- throw new MarAgentError('MAR_AGENT_TOOL_OUTPUT_LIMIT', 'Code Mode emitted too many images.');
447
443
  images.push(image);
448
444
  output?.image(image);
449
445
  appendObservation({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/agent",
3
- "version": "0.9.147",
3
+ "version": "0.9.148",
4
4
  "description": "Embeddable MAR coding agent SDK and CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",