@myagentroam/agent 0.9.103 → 0.9.105

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.
@@ -25,70 +25,58 @@ Remove aggressively:
25
25
  Use compact Markdown with these headings when applicable: Objective, Instructions and constraints, Decisions and facts, Completed work, Verification and evidence, Active state, Open issues and risks, Next action. Omit empty headings. Prefer precise paths, IDs, error codes, and short evidence over narrative. Output only the handoff.`;
26
26
  }
27
27
  export function highDensityCompactionPrompt() {
28
- return `将 visible conversation 编译为供下一 Agent 直接续作的 Textual Continuation IR;原 transcript 将丢弃。This is factual state transfer, not recap, user reply, or new work. 不调用工具、不推进任务、不虚构完成。
28
+ 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.
29
29
 
30
- 目标:在 handoff budget 内最大化 continuation accuracy、信息密度、可恢复性。Token reduction 仅在不损害续作后有价值;必要时约 10K tokens 可接受。
30
+ Optimize for continuation fidelity first and density second. Prefer sufficient continuation state over brevity; never omit information required to resume correctly.
31
31
 
32
- IR 不是 prose summary。默认使用最短且无歧义的事实短语、状态原子、精确引用;仅在短语无法说清因果、冲突或边界时使用完整句。优先两种形式:
32
+ ## Output contract
33
+ Use these English section names when applicable; omit empty sections:
34
+ 1. Goal contract
35
+ 2. Current state
36
+ 3. Settled matters
37
+ 4. Necessary evidence
38
+ 5. Open loops
39
+
40
+ 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.
41
+
42
+ Prefer records over prose:
33
43
  <object> | <key>=<value> | <key>=<value>
34
- <event/condition> -> <effect> | <effect>
35
- 例如:
36
- src/discount.js | cause=verified | edit=pending | comment=required | tests=not run
44
+ <event/condition> -> <object>.<key>=<value> | <effect>
45
+
46
+ 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.
47
+
48
+ Examples:
49
+ src/discount.js | cause=verified | edit=pending | tests=not run
37
50
  patch(src/discount.js) -> prior_read=stale | next=re-evidence
38
- branch changed -> inherited_evidence=unverified
39
-
40
- 语法:
41
- - | 并列同一 object 的独立事实;= 表示 current fact/state/constraint;-> 仅表示 cause、invalidation、transition。
42
- - key 使用最短且无歧义的 established term;value 可为状态原子或短语;enum 默认 lowercase。
43
- - 使用 required/forbidden/pending 等语义值,不写 YES/NO。省略无续作价值的 unknown 和空字段。
44
- - 同一 key 只保留已归约的 current value。无法消解:state=conflict | candidates=<short values> | next=re-evidence;不得任选一方。
45
- - transition effect 优先 <object>.<key>=<value>;object 已唯一明确时可省略,不得省略到歧义。
46
- - exact path/symbol/ID/command/number/user-designated text 原样保留。值含 |、换行或需逐字保存时,使用紧邻 record 的 Markdown code span/block,不发明 escaping protocol。
47
- - pending、not run、unverified、failed 不得互换。
48
-
49
- 按需覆盖五类信息职责,空块省略。双语名称仅解释职责;输出标题只选当前任务合适的一种语言,不同时复制两套。
50
-
51
- 1. 目标契约 / Goal contract
52
- - 主目标、当前交付、完成标准、非目标/边界。
53
- - direct user/caller authorization、prohibition、exclusion 保留 exact action/scope,不概括成更宽泛边界。
54
- - authorization 必须归约 exact actionscopelifetime。仅当三者在 latest active task/request 中仍有效时记录 active;已完成或被取代作用域中的授权只能记录 expired/superseded historical evidence,不得恢复为 current permission
55
-
56
- 2. 当前状态 / Current state
57
- - 对象:file、symbol、feature、migration、test、worktree、selected SkillTodo/plan、external decision、external side effect。retained process/subagent inventory Runtime 重建,不进入 IR。
58
- - 分离 completion(pending / in_progress / completed / blocked)、epistemic(observed / verified / inferred / proposed / disproved)、freshness(current / stale / superseded)、scope(turn / worktree / base / branch / external system);仅在消歧时标注。
59
- - 明确 completed、not started、unverified、active。相同精度下选择更短状态原子;中文、English 均可,如 根因已证、edit=pending、tests=not run。
60
- - selected Skill | 保留仍适用的 skill name + 续作必需约束;Todo/plan | 保留 revision、item/status、当前最小 step。
61
- - verified claim 后无 source mutation/base/branch change 等 invalidating event:freshness=current | re-diagnosis=not needed。为 patch 获取当前行上下文的 targeted reread 仍可保留,不等同重新调查已证结论。
62
-
63
- 3. 已定事项 / Settled matters
64
- - confirmed decision/interface/constraint + 续作仍需的最短理由。
65
- - disproved/rejected direction + scope/evidence。
66
- - recovery path、event shape、implementation option、next action 未经 direct evidence 前保持 proposed/unverified。
67
-
68
- 4. 必要证据 / Necessary evidence
69
- - 仅保留不可廉价恢复、决定后续判断、记录不可重复 side effect,或精确值影响 correctness 的 evidence;紧邻 claim,绑定 scope/freshness。
70
- - completed check/result 若决定后续判断:保留 decisive values,或可确定恢复这些值的 exact artifact path/command;不得只留 count/schema。
71
- - path、symbol/class/function/variable、API/tool/model/provider、JSON key/enum/protocol field、command/arguments、error code、commit hash、callId、sequence、version、number、用户指定原文:原样保留,不翻译、不猜测。
72
- - 下一 Agent 无法使用、仅供 local storage validation 的 integrity hash:删除。
73
-
74
- 5. 未闭环 / Open loops
75
- - unresolved、unverified、blocker、pending external decision、Todo/plan current step、仍需 evidence。
76
- - 只保留已确定的最小 next action + preconditions;不复制可重算的长 plan。
77
- - 需要独立授权的 action 只有在 current direct authorization 覆盖 exact action/scope 且 lifetime 仍有效时才能标为 pending/next。对象状态、完成度、工具可用性或执行便利性均不得推导 authorization;无有效授权时省略该动作,必要时记录 authorization | action=<exact> | status=expired|superseded|absent。
78
-
79
- 编译规则:
80
- 1. latest user intent 定目标;newer correction 覆盖 older intent。历史指令不得因仍出现在 retained user messages 中而恢复为 active authorization。
81
- 2. 归约 before -> event -> after;source mutation 或 base/branch change 后 affected read/conclusion stale,除非已有 newer evidence;history replacement 仅使 Responses continuation invalid,不使 factual evidence 自动失效;无 invalidating event 的 verified claim 保持 current;current 取最后已证 after-state 或 later direct observation。
82
- 3. 每个 continuation object 一条 current record;等价事实去重。
83
- 4. 仅保留仍约束 open work 的 settled decision/exclusion。
84
- 5. evidence 绑定 claim;verified conclusion 优先于 raw snapshot/intermediate hypothesis。
85
- 6. 预算受压时依次保护:目标、当前进度、边界、不可重复副作用、未闭环、必要证据;再删 provenance/可恢复实现细节。
86
-
87
- observed HEAD、validated base、target commit、current worktree 不得折叠;evidence 只更新直接证明的 axis。跨 axis/base/branch 推导无 direct evidence 时保持 unverified。状态冲突无法归约:保留 conflict + re-evidence,不替模型选择。
88
-
89
- 语言:标题/一般叙述跟随 latest active user instructions 和当前任务主语言;每条 record 按局部精度与密度选择中文、English 或 mixed phrasing。保留 established term/exact identifier,不为语言统一展开或翻译。English codebase 不等于 English handoff。
90
-
91
- 删除 greetings、progress chatter、过程叙事、重复事实、无剩余约束的 superseded hypothesis、长日志、source body、verbose payload、可从精确 path/command 廉价恢复的正文。删除 user/project/directory AGENTS.md 正文及仅由这些文件派生的 constraint,包括其中 exclusions;下一 Execution 会重新加载并整体替换。删除 retained process/Subagent inventory、ID、status、command、cwd 和 reuse instruction;Runtime 会重新加载并替换。不得保留 hidden reasoning、secret、credential、无关内容。
92
-
93
- 只输出 compact Markdown IR。`;
51
+ authorization | action=<exact> | scope=<exact> | lifetime=<exact> | status=active
52
+
53
+ ## Compiler
54
+ 1. Resolve intent. The latest user correction overrides older intent. Extract the primary objective, current deliverable, completion criteria, non-goals, and boundaries.
55
+ 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.
56
+ 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.
57
+ 4. Separate status axes when needed:
58
+ - completion=pending|in_progress|completed|blocked
59
+ - epistemic=observed|verified|inferred|proposed|disproved
60
+ - freshness=current|stale|superseded
61
+ - scope=turn|worktree|base|branch|external
62
+ 5. Bind evidence to the claim it proves. Prefer a verified conclusion over raw snapshots or intermediate hypotheses.
63
+ 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.
64
+
65
+ ## Retention rules
66
+ - 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.
67
+ - 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.
68
+ - 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.
69
+ - 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.
70
+ - Preserve selected Skill names with only continuation-critical constraints. Preserve Todo/plan revision, item/status, and current minimum step.
71
+ - 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.
72
+ - If evidence conflicts, use state=conflict | candidates=<short values> | next=re-evidence. Never choose a side without evidence.
73
+
74
+ ## Exclusions
75
+ 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.
76
+
77
+ 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.
78
+
79
+ 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.
80
+
81
+ Output only compact Markdown IR.`;
94
82
  }
@@ -1,5 +1,5 @@
1
1
  import type { ExecutionMode } from '../sdk/types.js';
2
- export declare const MAR_AGENT_PROMPT_VERSION = "1.56";
2
+ export declare const MAR_AGENT_PROMPT_VERSION = "1.57";
3
3
  export declare function buildSystemPrompt(input: {
4
4
  mode: ExecutionMode;
5
5
  platform: string;
@@ -4,7 +4,7 @@ import { modePrompt } from './modes.js';
4
4
  import { outputStylePrompt } from './output.js';
5
5
  import { subagentPrompt } from './subagent.js';
6
6
  import { interactionPrompt, longRunningPrompt, safetyPrompt, toolUsagePrompt, workflowPrompt } from './workflow.js';
7
- export const MAR_AGENT_PROMPT_VERSION = '1.56';
7
+ export const MAR_AGENT_PROMPT_VERSION = '1.57';
8
8
  export function buildSystemPrompt(input) {
9
9
  const toolNames = new Set(input.tools);
10
10
  const hasLongRunningCapability = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myagentroam/agent",
3
- "version": "0.9.103",
3
+ "version": "0.9.105",
4
4
  "description": "Embeddable MAR coding agent SDK and CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",