@peer-agent/runtime-core 0.1.0-rc.10 → 0.1.0-rc.12

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.
@@ -420,6 +420,9 @@ function directToolMessage(message) {
420
420
  };
421
421
  }
422
422
  function projectMessage(value) {
423
+ const internal = recordOf(value);
424
+ if (internal?.kind === 'agent_message' || internal?.kind === 'agent_activity')
425
+ return [];
423
426
  const message = recordOf(value);
424
427
  if (!message || compactionMarker(message))
425
428
  return [];
@@ -46,6 +46,8 @@ export declare function decideGoalToolReplay(input: {
46
46
  readonly evidenceRefs?: readonly string[];
47
47
  readonly toolCallId?: string;
48
48
  }> | null;
49
+ /** Host-owned tool metadata; transient context must be re-admitted after recovery. */
50
+ readonly requiresFreshResult?: boolean;
49
51
  }): GoalToolReplayDecision;
50
52
  export interface GoalIdempotencyLedgerEntry {
51
53
  status: string;
@@ -16,6 +16,7 @@ export const GOAL_TOOL_REPLAY_POLICIES = Object.freeze([
16
16
  ]);
17
17
  const READ_ONLY_TOOLS = new Set([
18
18
  'read_file',
19
+ 'view_image',
19
20
  'list_files',
20
21
  'search_files',
21
22
  'batch_search',
@@ -151,6 +152,9 @@ export function decideGoalToolReplay(input) {
151
152
  intent: input.intent,
152
153
  });
153
154
  const ledgerHit = input.completedLedger?.get(idempotencyKey) ?? null;
155
+ if (input.requiresFreshResult && mutationClass === 'read_only') {
156
+ return { action: 'execute', reason: 'fresh_read_context_required', policy: 'safe_retry', mutationClass, idempotencyKey };
157
+ }
154
158
  if (ledgerHit && (ledgerHit.status === 'completed' || ledgerHit.status === 'succeeded')) {
155
159
  return {
156
160
  action: 'reuse',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peer-agent/runtime-core",
3
- "version": "0.1.0-rc.10",
3
+ "version": "0.1.0-rc.12",
4
4
  "description": "Host-neutral capability, permission, projection, and Evidence primitives for Peer Agent runtimes.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "LICENSE"
39
39
  ],
40
40
  "dependencies": {
41
- "@peer-agent/protocol": "0.1.0-rc.10"
41
+ "@peer-agent/protocol": "0.1.0-rc.12"
42
42
  },
43
43
  "devDependencies": {
44
44
  "typescript": "^5.9.3"