@myagentroam/agent 0.10.31 → 0.10.32

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.
@@ -1,6 +1,6 @@
1
1
  import type { ModelMessage } from '../../model/contracts.js';
2
2
  import { type SessionRecord } from '../../session/jsonl-store.js';
3
- export declare const SMART_COMPACTION_MARKER = "<mar_runtime>\n<smart_compaction scope=\"this_message\">eligible</smart_compaction>\n</mar_runtime>";
3
+ export declare const SMART_COMPACTION_MARKER = "<mar_runtime>\n<smart_compaction>For this message only, smart_compact may be considered at a clear transition into sustained new work, when the previous phase is largely complete and its details have low continuation value.</smart_compaction>\n</mar_runtime>";
4
4
  export interface SmartCompactionInput {
5
5
  readonly recordId: string;
6
6
  readonly eligible: boolean;
@@ -1,6 +1,6 @@
1
1
  import { MarAgentError } from '../../error.js';
2
2
  import { compactSummaryFromCheckpoint } from '../../session/jsonl-store.js';
3
- export const SMART_COMPACTION_MARKER = '<mar_runtime>\n<smart_compaction scope="this_message">eligible</smart_compaction>\n</mar_runtime>';
3
+ export const SMART_COMPACTION_MARKER = '<mar_runtime>\n<smart_compaction>For this message only, smart_compact may be considered at a clear transition into sustained new work, when the previous phase is largely complete and its details have low continuation value.</smart_compaction>\n</mar_runtime>';
4
4
  /** A measured watermark, not the stricter native-request budget calibration. */
5
5
  export function latestSmartContextTokens(records, modelId, contextWindowTokens) {
6
6
  let tokens;
@@ -1,9 +1,12 @@
1
1
  import { MarAgentError } from '../../error.js';
2
+ import { SMART_COMPACTION_MARKER } from '../../runtime/compaction/smart.js';
2
3
  export const smartCompactToolDefinition = {
3
4
  name: 'smart_compact',
4
5
  allowedCallers: ['direct', 'programmatic'],
5
6
  parallelSafety: 'safe',
6
- description: 'Request background context compaction only when the current real user message ends with <mar_runtime><smart_compaction scope="this_message">eligible</smart_compaction></mar_runtime> (on separate lines). The scope applies only to the containing user message; a historical marker does not authorize the current input. Call only when prior work is substantially complete, the request begins a sustained new work phase, and prior detailed context has low continuation value while key state can be retained in a summary. Do not call merely because the conversation is long, for a one-off question, or while prior evidence is still needed. Prefer calling alongside the first batch of necessary read/search/exec tools rather than creating a separate rollout. Acceptance does not wait for generation or installation.',
7
+ description: 'Request background context compaction only when the current real user message includes this runtime note: ' +
8
+ SMART_COMPACTION_MARKER +
9
+ ' The note indicates capacity eligibility, not a recommendation; historical notes do not qualify the current input. Judge the phase transition from the conversation; call only if key state can be retained in a summary. Do not call merely because context is long, for a one-off question, or while continuing unresolved work that still needs prior evidence. A new user message or completed reply alone is not a phase transition. If uncertain, skip. Prefer calling alongside the first necessary tools. Acceptance does not wait for generation or installation.',
7
10
  inputSchema: { type: 'object', properties: {}, additionalProperties: false }
8
11
  };
9
12
  export function executeSmartCompact(arguments_, context) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/agent",
3
- "version": "0.10.31",
3
+ "version": "0.10.32",
4
4
  "description": "Embeddable MAR coding agent SDK and CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",