@myagentroam/agent 0.9.104 → 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.
- package/dist/prompts/compact.js +50 -62
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.js +1 -1
- package/package.json +1 -1
package/dist/prompts/compact.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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> -> <
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
}
|
package/dist/prompts/index.d.ts
CHANGED
package/dist/prompts/index.js
CHANGED
|
@@ -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.
|
|
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 = [
|