@mnemom/mnemom 0.17.3-next.3 → 0.17.3-next.4
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.
|
@@ -195,6 +195,13 @@ export function buildGoalShowView(record, body, opts) {
|
|
|
195
195
|
L.push(fmt.label("verdict: ", v
|
|
196
196
|
? `${v.verdict.toUpperCase()} at turn ${v.turn}${v.superseded ? " (superseded)" : ""}`
|
|
197
197
|
: fmt.dim("none yet")));
|
|
198
|
+
const unverified = body.unverified_mid_turn_messages ?? [];
|
|
199
|
+
if (unverified.length) {
|
|
200
|
+
L.push(fmt.label("unverified: ", fmt.dim("mid-turn messages seen in tool output; they did NOT change the goal")));
|
|
201
|
+
for (const u of unverified) {
|
|
202
|
+
L.push(` ${formatRelativeAge(u.at)} ${JSON.stringify(u.text)}`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
198
205
|
if (body.threads) {
|
|
199
206
|
L.push(fmt.label("threads:", ""));
|
|
200
207
|
for (const t of body.threads) {
|
|
@@ -115,6 +115,8 @@ export interface AgentShowOptions {
|
|
|
115
115
|
/** Why the live read could not happen, from the thrown error. */
|
|
116
116
|
export declare function unavailableReason(err: unknown): string;
|
|
117
117
|
/** `rev N[ · pinned]` from a live show body, or `rev 0 (no goal yet)`. */
|
|
118
|
+
/** Longest goal statement `agent show` prints inline; `mnemom agent goal show` has the full text. */
|
|
119
|
+
export declare const LIVE_GOAL_STATEMENT_MAX = 80;
|
|
118
120
|
export declare function liveGoalLine(body: GoalShowResponse): string;
|
|
119
121
|
/** `mnemom agent show [ref] [--json]` */
|
|
120
122
|
export declare function agentShowCommand(ref: string | undefined, opts: AgentShowOptions, deps: SessionCommandDeps): Promise<void>;
|
|
@@ -274,10 +274,19 @@ export function unavailableReason(err) {
|
|
|
274
274
|
return err instanceof Error ? err.message : String(err);
|
|
275
275
|
}
|
|
276
276
|
/** `rev N[ · pinned]` from a live show body, or `rev 0 (no goal yet)`. */
|
|
277
|
+
/** Longest goal statement `agent show` prints inline; `mnemom agent goal show` has the full text. */
|
|
278
|
+
export const LIVE_GOAL_STATEMENT_MAX = 80;
|
|
277
279
|
export function liveGoalLine(body) {
|
|
278
280
|
if (!body.intent)
|
|
279
281
|
return "rev 0 (no goal yet)";
|
|
280
|
-
|
|
282
|
+
const rev = `rev ${body.intent.revision}${body.intent.pinned ? " · pinned" : ""}`;
|
|
283
|
+
const statement = body.intent.statement.replace(/\s+/g, " ").trim();
|
|
284
|
+
if (!statement)
|
|
285
|
+
return rev;
|
|
286
|
+
if (statement.length <= LIVE_GOAL_STATEMENT_MAX)
|
|
287
|
+
return `${rev} — "${statement}"`;
|
|
288
|
+
const cut = statement.slice(0, LIVE_GOAL_STATEMENT_MAX - 1).trimEnd();
|
|
289
|
+
return `${rev} — "${cut}…" (full: mnemom agent goal show)`;
|
|
281
290
|
}
|
|
282
291
|
/** `mnemom agent show [ref] [--json]` */
|
|
283
292
|
export async function agentShowCommand(ref, opts, deps) {
|
package/dist/lib/goal-api.d.ts
CHANGED
|
@@ -99,6 +99,21 @@ export interface GoalShowResponse {
|
|
|
99
99
|
verdict: GoalVerdictView | null;
|
|
100
100
|
last_revision: number;
|
|
101
101
|
threads?: GoalThreadRow[];
|
|
102
|
+
/**
|
|
103
|
+
* IG4 steer: mid-turn messages found in a tool_result. RECORD ONLY: tool output can forge one,
|
|
104
|
+
* so they never changed the goal. Absent when there are none.
|
|
105
|
+
*/
|
|
106
|
+
unverified_mid_turn_messages?: GoalUnverifiedMessage[];
|
|
107
|
+
}
|
|
108
|
+
export interface GoalUnverifiedMessage {
|
|
109
|
+
/**
|
|
110
|
+
* Clipped to 500 chars by the gateway. UNTRUSTED: it can be attacker-written tool output, so a
|
|
111
|
+
* consumer must escape it (the CLI prints it JSON-quoted; a web view must never render it as HTML).
|
|
112
|
+
*/
|
|
113
|
+
text: string;
|
|
114
|
+
chars: number;
|
|
115
|
+
hash: string;
|
|
116
|
+
at: string;
|
|
102
117
|
}
|
|
103
118
|
export interface GoalPinResponse {
|
|
104
119
|
conversation_id: string;
|