@myagentroam/node 0.9.173 → 0.9.174

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,4 +1,5 @@
1
1
  import { buildCompactEvidence, countModelTokens, generateModelText, MarAgentError } from '@myagentroam/agent';
2
+ import { highDensityCompactionPrompt } from './compact-prompt.js';
2
3
  import { marAgentRuntimeCompactConfigurationSchema } from '@myagentroam/protocol';
3
4
  /** Resolve optional dedicated credentials in the same factory batch without widening the SDK catalog. */
4
5
  export function compactRuntimeConfigurations(models, raw) {
@@ -59,7 +60,7 @@ export function marAgentCompactExtensionSource(state) {
59
60
  export async function generateMarAgentCompact(context, selected, signal) {
60
61
  signal.throwIfAborted();
61
62
  const startedAt = Date.now();
62
- const instruction = context.getPrompt();
63
+ const instruction = highDensityCompactionPrompt();
63
64
  const overhead = countModelTokens(system) + countModelTokens(instruction) + 128;
64
65
  const full = buildCompactEvidence(context.messages, {
65
66
  maxTokens: Number.MAX_SAFE_INTEGER,
@@ -0,0 +1,56 @@
1
+ export function highDensityCompactionPrompt() {
2
+ return `Compile the visible conversation into Textual Continuation IR that lets the next agent continue correctly after the transcript is discarded. Transfer state; do not recap, address the user, call tools, advance the task, or invent facts.
3
+
4
+ Optimize for continuation fidelity first and density second. Prefer sufficient continuation state over brevity; never omit information required to resume correctly.
5
+
6
+ ## Output contract
7
+ Use these English section names when applicable; omit empty sections:
8
+ 1. Goal contract
9
+ 2. Current state
10
+ 3. Settled matters
11
+ 4. Necessary evidence
12
+ 5. Open loops
13
+
14
+ IR grammar and vocabulary are English: headings, keys, enums, state atoms, and control terms. Natural-language values may follow the task's dominant language. Preserve exact user-designated text and established domain terms; do not translate identifiers or invent localized IR terminology.
15
+
16
+ Prefer records over prose:
17
+ <object> | <key>=<value> | <key>=<value>
18
+ <event/condition> -> <object>.<key>=<value> | <effect>
19
+
20
+ Use | for parallel facts, = for current state, and -> only for causality, invalidation, or transition. Keep enums lowercase and semantic: required, forbidden, pending; never YES/NO. Omit empty or irrelevant unknown fields. Keep pending, not run, unverified, and failed distinct. Use a sentence only when records cannot express a multi-object cause, conflict, authorization, or safety boundary unambiguously.
21
+
22
+ Examples:
23
+ src/discount.js | cause=verified | edit=pending | tests=not run
24
+ patch(src/discount.js) -> prior_read=stale | next=re-evidence
25
+ authorization | action=<exact> | scope=<exact> | lifetime=<exact> | status=active
26
+
27
+ ## Compiler
28
+ 1. Resolve intent. The latest user correction overrides older intent. Extract the primary objective, current deliverable, completion criteria, non-goals, and boundaries.
29
+ 2. Reduce time. Convert before -> event -> after into the latest evidenced state. Source mutation or base/branch change makes only affected evidence stale. History replacement invalidates Responses continuation, not factual evidence. Without an invalidating event, a verified claim remains current.
30
+ 3. Build objects. Emit one current record per file, symbol, feature, migration, test, worktree axis, selected Skill, Todo/plan item, external decision, or external side effect. Deduplicate equivalent facts.
31
+ 4. Separate status axes when needed:
32
+ - completion=pending|in_progress|completed|blocked
33
+ - epistemic=observed|verified|inferred|proposed|disproved
34
+ - freshness=current|stale|superseded
35
+ - scope=turn|worktree|base|branch|external
36
+ 5. Bind evidence to the claim it proves. Prefer a verified conclusion over raw snapshots or intermediate hypotheses.
37
+ 6. Select under budget. Protect, in order: objective, progress, boundaries and authorization, non-repeatable side effects, open loops, then necessary evidence. Remove provenance and recoverable detail only after those remain sufficient.
38
+
39
+ ## Retention rules
40
+ - Preserve active caller/user instructions outside filesystem-loaded AGENTS.md, exact authorization boundaries, confirmed decisions and exclusions, completed edits and side effects, verification actually run, reproducible failures, failed approaches that constrain the next step, unresolved risks, and the smallest established next action.
41
+ - Authorization is valid only for its exact action, scope, and lifetime in the active request. Completed or superseded scopes cannot revive it. Object state, completion, tool availability, and convenience never imply permission.
42
+ - Preserve decisive values, or an exact artifact path/command that deterministically recovers them, when a result controls later work. Counts or schemas alone are insufficient.
43
+ - Preserve paths, symbols, APIs, tools, models, providers, JSON keys, protocol fields, commands, arguments, error codes, commit hashes, call IDs, sequences, versions, numbers, and user-designated text verbatim.
44
+ - Preserve selected Skill names with only continuation-critical constraints. Preserve Todo/plan revision, item/status, and current minimum step.
45
+ - Keep observed HEAD, validated base, target commit, and current worktree as separate axes. Evidence updates only what it directly proves; cross-axis, cross-base, and cross-branch inference remains unverified.
46
+ - If evidence conflicts, use state=conflict | candidates=<short values> | next=re-evidence. Never choose a side without evidence.
47
+
48
+ ## Exclusions
49
+ Remove greetings, progress chatter, chronology that does not affect current state, duplicate facts, superseded hypotheses without remaining constraints, long logs, source bodies, verbose payloads, cheap-to-recover content, local-only integrity hashes, hidden reasoning, secrets, credentials, and unrelated content.
50
+
51
+ Remove user/project/directory AGENTS.md text and constraints derived only from those files; the next Execution reloads them. Remove retained process/Subagent inventory, IDs, status, commands, cwd, and reuse instructions; Runtime reloads them.
52
+
53
+ Before emitting, verify that objective, current progress, authorization/boundaries, completed versus unverified work, decisive evidence, open loops, and next action are explicit and non-contradictory.
54
+
55
+ Output only compact Markdown IR.`;
56
+ }
@@ -64,7 +64,6 @@ export class MarAgentRuntimeModelFactory {
64
64
  defaultReasoningEffort: resolveMarAgentDefaultReasoningEffort(configuration.defaultReasoningEffort, configuration.reasoningEfforts),
65
65
  titleGeneration: configuration.titleGeneration,
66
66
  codeMode: configuration.codeMode,
67
- highDensityCompaction: configuration.highDensityCompaction,
68
67
  ...(configuration.serviceTier === undefined
69
68
  ? {}
70
69
  : { serviceTier: configuration.serviceTier }),
@@ -1950,7 +1950,6 @@ function modelSummary(model, index) {
1950
1950
  defaultReasoningEffort: resolveMarAgentDefaultReasoningEffort(model.defaultReasoningEffort, model.reasoningEfforts),
1951
1951
  titleGeneration: model.titleGeneration,
1952
1952
  codeMode: model.codeMode,
1953
- highDensityCompaction: model.highDensityCompaction,
1954
1953
  ...(model.fastMode === true ? { fastMode: true } : {}),
1955
1954
  hostedWebSearch: model.hostedWebSearch,
1956
1955
  ...(model.responsesTransport === undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/node",
3
- "version": "0.9.173",
3
+ "version": "0.9.174",
4
4
  "description": "MyAgentRoam Node runtime CLI.",
5
5
  "license": "Apache-2.0 AND GPL-2.0-or-later",
6
6
  "type": "module",
@@ -36,10 +36,10 @@
36
36
  "playwright": "1.62.1",
37
37
  "ws": "^8.21.3",
38
38
  "zod": "4.4.3",
39
- "@myagentroam/agent": "0.9.173",
39
+ "@myagentroam/agent": "0.9.174",
40
+ "@myagentroam/protocol": "0.9.174",
40
41
  "@myagentroam/code-navigation": "0.9.129",
41
- "@myagentroam/marctl": "0.9.123",
42
- "@myagentroam/protocol": "0.9.173"
42
+ "@myagentroam/marctl": "0.9.123"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/ws": "^8.18.1"