notesoup 0.51.7 → 0.51.9

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/package.json CHANGED
@@ -1,151 +1,156 @@
1
1
  {
2
- "name": "notesoup",
3
- "version": "0.51.7",
4
- "type": "module",
5
- "main": "./dist/src/index.js",
6
- "types": "./dist/src/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/src/index.d.ts",
10
- "import": "./dist/src/index.js"
11
- },
12
- "./notes": {
13
- "types": "./dist/src/notes/index.d.ts",
14
- "import": "./dist/src/notes/index.js"
15
- },
16
- "./package.json": "./package.json",
17
- "./dsh": {
18
- "types": "./dist/plugins/dsh/index.d.ts",
19
- "import": "./dist/plugins/dsh/index.js"
20
- },
21
- "./dsh/engine": {
22
- "types": "./dist/plugins/dsh/engine.d.ts",
23
- "import": "./dist/plugins/dsh/engine.js"
24
- }
25
- },
26
- "description": "Host-neutral notes, history and context-window core, with plugins for Pi, Claude Code and the DeepSeek Harness.",
27
- "license": "MIT",
28
- "keywords": [
29
- "pi-package",
30
- "pi-extension",
31
- "agent-memory",
32
- "notes"
33
- ],
34
- "repository": {
35
- "type": "git",
36
- "url": "https://github.com/astrosheep-zero/notesoup.git"
37
- },
38
- "pi": {
39
- "extensions": [
40
- "./plugins/pi/index.ts"
41
- ],
42
- "skills": [
43
- "./skills"
44
- ]
45
- },
46
- "files": [
47
- "src",
48
- "plugins",
49
- "dist",
50
- "docs",
51
- "LICENSE",
52
- "README.md",
53
- "playbook.md",
54
- "skills",
55
- "!plugins/claude/types",
56
- "!plugins/claude/tsconfig.json",
57
- "cordis.patch.yml"
58
- ],
59
- "bin": {
60
- "dream": "dist/plugins/pi/dream/cli.js"
61
- },
62
- "scripts": {
63
- "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json && node scripts/build-extension.mjs && node -e \"require('node:fs').chmodSync('dist/plugins/pi/dream/cli.js', 0o755)\"",
64
- "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p plugins/claude/tsconfig.json",
65
- "test": "npm run build && node --test --test-concurrency=4 $(ls dist/test/*.test.js | grep -v dist/test/claude-validation.test.js) && node --test dist/test/claude-validation.test.js",
66
- "prepublishOnly": "npm run typecheck",
67
- "prepack": "npm run build"
68
- },
69
- "peerDependencies": {
70
- "@earendil-works/pi-agent-core": "*",
71
- "@earendil-works/pi-ai": "*",
72
- "@earendil-works/pi-coding-agent": "*",
73
- "typebox": "*",
74
- "@deepseek-ai/cordis": "*",
75
- "@deepseek-ai/cordis-plugin-loader": "*",
76
- "@deepseek-ai/dsh-agent": "*",
77
- "@deepseek-ai/dsh-compaction": "*",
78
- "@deepseek-ai/dsh-commands": "*",
79
- "@deepseek-ai/dsh-llm": "*",
80
- "@deepseek-ai/dsh-session": "*",
81
- "@deepseek-ai/dsh-session-query": "*",
82
- "@deepseek-ai/dsh-system-prompt": "*",
83
- "@deepseek-ai/dsh-token-meter": "*",
84
- "@deepseek-ai/dsh-tools": "*"
85
- },
86
- "peerDependenciesMeta": {
87
- "@earendil-works/pi-agent-core": {
88
- "optional": true
89
- },
90
- "@earendil-works/pi-ai": {
91
- "optional": true
92
- },
93
- "@earendil-works/pi-coding-agent": {
94
- "optional": true
95
- },
96
- "typebox": {
97
- "optional": true
98
- },
99
- "@deepseek-ai/cordis": {
100
- "optional": true
101
- },
102
- "@deepseek-ai/cordis-plugin-loader": {
103
- "optional": true
104
- },
105
- "@deepseek-ai/dsh-agent": {
106
- "optional": true
107
- },
108
- "@deepseek-ai/dsh-compaction": {
109
- "optional": true
110
- },
111
- "@deepseek-ai/dsh-commands": {
112
- "optional": true
113
- },
114
- "@deepseek-ai/dsh-llm": {
115
- "optional": true
116
- },
117
- "@deepseek-ai/dsh-session": {
118
- "optional": true
119
- },
120
- "@deepseek-ai/dsh-session-query": {
121
- "optional": true
122
- },
123
- "@deepseek-ai/dsh-system-prompt": {
124
- "optional": true
125
- },
126
- "@deepseek-ai/dsh-token-meter": {
127
- "optional": true
128
- },
129
- "@deepseek-ai/dsh-tools": {
130
- "optional": true
131
- }
132
- },
133
- "devDependencies": {
134
- "@deepseek-ai/dsh": "0.2.1-alpha.2",
135
- "@earendil-works/pi-agent-core": "^1.0.0",
136
- "@earendil-works/pi-ai": "^1.0.0",
137
- "@earendil-works/pi-coding-agent": "^1.0.0",
138
- "@types/node": "^22.19.19",
139
- "esbuild": "^0.28.2",
140
- "typebox": "1.3.27",
141
- "typescript": "^5.9.3"
142
- },
143
- "publishConfig": {
144
- "access": "public"
145
- },
146
- "dsh": {
147
- "bundle": {
148
- "patch": "./cordis.patch.yml"
149
- }
150
- }
2
+ "name": "notesoup",
3
+ "version": "0.51.9",
4
+ "type": "module",
5
+ "main": "./dist/src/index.js",
6
+ "types": "./dist/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/src/index.d.ts",
10
+ "import": "./dist/src/index.js"
11
+ },
12
+ "./notes": {
13
+ "types": "./dist/src/notes/index.d.ts",
14
+ "import": "./dist/src/notes/index.js"
15
+ },
16
+ "./package.json": "./package.json",
17
+ "./dsh": {
18
+ "types": "./dist/plugins/dsh/index.d.ts",
19
+ "import": "./dist/plugins/dsh/index.js"
20
+ },
21
+ "./dsh/engine": {
22
+ "types": "./dist/plugins/dsh/engine.d.ts",
23
+ "import": "./dist/plugins/dsh/engine.js"
24
+ }
25
+ },
26
+ "description": "Host-neutral notes, history and context-window core, with plugins for Pi, Claude Code and the DeepSeek Harness.",
27
+ "license": "MIT",
28
+ "keywords": [
29
+ "pi-package",
30
+ "pi-extension",
31
+ "agent-memory",
32
+ "notes"
33
+ ],
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/astrosheep-zero/notesoup.git"
37
+ },
38
+ "pi": {
39
+ "extensions": [
40
+ "./plugins/pi/index.ts"
41
+ ],
42
+ "skills": [
43
+ "./skills"
44
+ ]
45
+ },
46
+ "files": [
47
+ "src",
48
+ "plugins",
49
+ "dist",
50
+ "docs",
51
+ "LICENSE",
52
+ "README.md",
53
+ "playbook.md",
54
+ "skills",
55
+ "!plugins/claude/types",
56
+ "!plugins/claude/tsconfig.json",
57
+ "cordis.patch.yml"
58
+ ],
59
+ "bin": {
60
+ "dream": "dist/plugins/pi/dream/cli.js"
61
+ },
62
+ "scripts": {
63
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json && node scripts/build-extension.mjs && node -e \"require('node:fs').chmodSync('dist/plugins/pi/dream/cli.js', 0o755)\"",
64
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p plugins/claude/tsconfig.json",
65
+ "test": "npm run build && node --test --test-concurrency=4 $(ls dist/test/*.test.js | grep -v dist/test/claude-validation.test.js) && node --test dist/test/claude-validation.test.js",
66
+ "prepublishOnly": "npm run typecheck",
67
+ "prepack": "npm run build"
68
+ },
69
+ "peerDependencies": {
70
+ "@earendil-works/pi-agent-core": "*",
71
+ "@earendil-works/pi-ai": "*",
72
+ "@earendil-works/pi-coding-agent": "*",
73
+ "@earendil-works/pi-tui": "*",
74
+ "typebox": "*",
75
+ "@deepseek-ai/cordis": "*",
76
+ "@deepseek-ai/cordis-plugin-loader": "*",
77
+ "@deepseek-ai/dsh-agent": "*",
78
+ "@deepseek-ai/dsh-compaction": "*",
79
+ "@deepseek-ai/dsh-commands": "*",
80
+ "@deepseek-ai/dsh-llm": "*",
81
+ "@deepseek-ai/dsh-session": "*",
82
+ "@deepseek-ai/dsh-session-query": "*",
83
+ "@deepseek-ai/dsh-system-prompt": "*",
84
+ "@deepseek-ai/dsh-token-meter": "*",
85
+ "@deepseek-ai/dsh-tools": "*"
86
+ },
87
+ "peerDependenciesMeta": {
88
+ "@earendil-works/pi-agent-core": {
89
+ "optional": true
90
+ },
91
+ "@earendil-works/pi-ai": {
92
+ "optional": true
93
+ },
94
+ "@earendil-works/pi-coding-agent": {
95
+ "optional": true
96
+ },
97
+ "@earendil-works/pi-tui": {
98
+ "optional": true
99
+ },
100
+ "typebox": {
101
+ "optional": true
102
+ },
103
+ "@deepseek-ai/cordis": {
104
+ "optional": true
105
+ },
106
+ "@deepseek-ai/cordis-plugin-loader": {
107
+ "optional": true
108
+ },
109
+ "@deepseek-ai/dsh-agent": {
110
+ "optional": true
111
+ },
112
+ "@deepseek-ai/dsh-compaction": {
113
+ "optional": true
114
+ },
115
+ "@deepseek-ai/dsh-commands": {
116
+ "optional": true
117
+ },
118
+ "@deepseek-ai/dsh-llm": {
119
+ "optional": true
120
+ },
121
+ "@deepseek-ai/dsh-session": {
122
+ "optional": true
123
+ },
124
+ "@deepseek-ai/dsh-session-query": {
125
+ "optional": true
126
+ },
127
+ "@deepseek-ai/dsh-system-prompt": {
128
+ "optional": true
129
+ },
130
+ "@deepseek-ai/dsh-token-meter": {
131
+ "optional": true
132
+ },
133
+ "@deepseek-ai/dsh-tools": {
134
+ "optional": true
135
+ }
136
+ },
137
+ "devDependencies": {
138
+ "@deepseek-ai/dsh": "0.2.1-alpha.2",
139
+ "@earendil-works/pi-agent-core": "^1.0.0",
140
+ "@earendil-works/pi-ai": "^1.0.0",
141
+ "@earendil-works/pi-coding-agent": "^1.0.0",
142
+ "@earendil-works/pi-tui": "1.0.0",
143
+ "@types/node": "^22.19.19",
144
+ "esbuild": "^0.28.2",
145
+ "typebox": "1.3.27",
146
+ "typescript": "^5.9.3"
147
+ },
148
+ "publishConfig": {
149
+ "access": "public"
150
+ },
151
+ "dsh": {
152
+ "bundle": {
153
+ "patch": "./cordis.patch.yml"
154
+ }
155
+ }
151
156
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notesoup",
3
- "version": "0.51.7",
3
+ "version": "0.51.9",
4
4
  "description": "Durable notes and a host-scoped notes boot section for Claude Code.",
5
5
  "author": {
6
6
  "name": "AstroSheep"
@@ -10070,7 +10070,7 @@ function selectContinuation(origin) {
10070
10070
  const pool = origin === "forced" ? FORCED_CONTINUATIONS : NORMAL_CONTINUATIONS;
10071
10071
  return pool[Math.floor(Math.random() * pool.length)];
10072
10072
  }
10073
- var WARNING_BODY = "This brain is about to be emptied. The notes stay where they are; history has the rest written down, though digging it back out is on you. Whatever lives only in this brain goes with it.\nBefore that, put down what the next window can't get back:\n- what you're in the middle of, and how far it has progressed\n- decisions the human has made, in their words\n- what is blocked or pending\n- the next step\n- where the unfinished work sits (branches, scratch directories, uncommitted changes)\n- what failed, and why\n- skills to re-read, and history seqs, notes, or files to consult\n- anything else you expect to be useful after the reset\nCorrect or crumple notes that are no longer accurate, starting with MAP files, since every new window loads them.";
10073
+ var WARNING_BODY = "This brain is already spent. Whatever lives only in this brain goes with it \u2014 but the notes stay where they are, and history has the rest written down, though digging it back out is on you.\nUse the last of this brain to put down what the next window can't get back:\n- what you're in the middle of, and how far it has progressed\n- decisions the human has made, in their words\n- what is blocked or pending\n- the next step\n- where the unfinished work sits (branches, scratch directories, uncommitted changes)\n- what failed, and why\n- skills to re-read, and history seqs, notes, or files to consult\n- anything else you expect to be useful after the reset\n- and refresh the stale notes with what has changed since you last wrote them \u2014 the notes the next window gets are the old ones, unless you fix them now\nCorrect or crumple notes that are no longer accurate, starting with MAP files, since every new window loads them.";
10074
10074
  var COUNTDOWN_LINE = "Brain emptied in 3\u2026 2\u2026";
10075
10075
 
10076
10076
  // plugins/claude/src/text.ts
@@ -1,11 +1,11 @@
1
1
  # Notesoup last word
2
2
 
3
- Displays notesoup last-word messages already present in Paseo’s timeline as expanded, selectable paper cards. Last-word and notes cards share a pale-paper palette, tape accent, small corners, and compact spacing; last-word text stays visible without folding. Requires Paseo 0.11.2 on the client and daemon.
3
+ Displays notesoup last-word messages already present in Paseo’s timeline as expanded, selectable paper cards. Last-word and notes cards share a pale-paper palette, tape accent, small corners, and compact spacing; a crumple call turns its card grey and strikes the address. Requires Paseo 0.11.2 on the client and daemon.
4
4
 
5
5
  This client-only plugin transforms existing timeline rows in place: last-word custom messages become sticky cards, and notes_read/notes_write/notes_update tool calls become paper cards with the address, state, and a content or diff preview. It does not read session files or append messages. Other timeline items are unchanged.
6
6
 
7
- Notes cards start collapsed, with an expand arrow at the top right and a collapse arrow below the expanded body. Long content scrolls inside a bounded panel. Display limits are 4000 characters for reads and writes, and 8000 for diffs; expanding does not fetch more content.
7
+ Notes cards start collapsed; update cards also show the sentence just added. The whole header row expands and collapses the body. Long content scrolls inside a bounded panel. Display limits are 4000 characters for reads and writes, and 8000 for diffs; expanding does not fetch more content.
8
8
 
9
- Notes cards prefer the structured tool payload on live events. Replayed history carries only the rendered result text, so the transformer parses that fallback; replayed writes show no content preview.
9
+ Notes cards prefer the structured tool payload on live events. Replayed history carries only the rendered result text, so the transformer parses that fallback; write previews come from the call arguments on every path.
10
10
 
11
11
  Paseo 0.11.2 drops Pi boundary `entry_appended` events from its live timeline. This plugin cannot display messages that Paseo has not received; that adapter gap needs an upstream fix. Messages available through history can be rendered.
@@ -4,23 +4,33 @@ import type { BrainEmpty } from "../shared/brain-empty.ts";
4
4
  import { PAPER } from "./paper-card.tsx";
5
5
 
6
6
  function label(data: BrainEmpty): string {
7
- if (data.status === "running") return "EMPTYING BRAIN …";
8
- if (data.error !== undefined) return "BRAIN REFUSED TO EMPTY";
9
- if (data.outcome === "rollover_already_pending") return "BRAIN ALREADY BEING EMPTIED";
10
- return "✂ BRAIN EMPTIED";
7
+ if (data.status === "running") return "✂ emptying brain …";
8
+ if (data.error !== undefined) return "✂ brain refused to empty";
9
+ if (data.outcome === "rollover_already_pending") return "✂ already emptying";
10
+ return "✂ brain emptied";
11
+ }
12
+
13
+ /** Single-side dashed borders are unreliable on iOS, so the cut line is a row of dash segments. */
14
+ function CutLine({ color }: { color: string }) {
15
+ return (
16
+ <View style={{ flex: 1, height: 1.5, overflow: "hidden", opacity: 0.55, flexDirection: "row", gap: 5 }}>
17
+ {Array.from({ length: 60 }, (_, index) => (
18
+ <View key={index} style={{ width: 6, height: 1.5, borderRadius: 0.75, backgroundColor: color }} />
19
+ ))}
20
+ </View>
21
+ );
11
22
  }
12
23
 
13
24
  export function BrainEmptyDivider({ item }: PluginTimelineItemProps<BrainEmpty>) {
14
25
  const data = item.data;
15
26
  const refused = data.error !== undefined || data.status === "failed";
16
27
  const color = refused ? PAPER.removed : PAPER.inkMuted;
17
- const line = { flex: 1, height: 1, backgroundColor: color, opacity: 0.6 };
18
28
  return (
19
29
  <View style={{ paddingVertical: 6, gap: 3 }}>
20
30
  <View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
21
- <View style={line} />
22
- <Text style={{ color, fontSize: 11, letterSpacing: 1 }}>{label(data)}</Text>
23
- <View style={line} />
31
+ <CutLine color={color} />
32
+ <Text style={{ color, fontSize: 11.5, letterSpacing: 0.3 }}>{label(data)}</Text>
33
+ <CutLine color={color} />
24
34
  </View>
25
35
  {data.error !== undefined && (
26
36
  <Text selectable style={{ color: PAPER.removed, fontSize: 12, textAlign: "center" }}>{data.error}</Text>
@@ -3,11 +3,19 @@ import { Icon } from "@getpaseo/plugin/client/react-native";
3
3
  import { useState } from "react";
4
4
  import { Pressable, ScrollView, Text, View } from "react-native";
5
5
  import type { NotesOp } from "../shared/notes-op.ts";
6
- import { PAPER, PaperCard } from "./paper-card.tsx";
6
+ import { MONO, PAPER, PaperCard } from "./paper-card.tsx";
7
7
 
8
- const OP_LABEL: Record<NotesOp["op"], string> = { read: "READ NOTE", write: "WROTE NOTE", update: "UPDATED NOTE" };
9
- const OP_LABEL_RUNNING: Record<NotesOp["op"], string> = { read: "READING NOTE", write: "WRITING NOTE", update: "UPDATING NOTE" };
10
- const CHANGE_LABEL: Record<string, string> = { body: "edited", metadata: "metadata", moved: "renamed", none: "unchanged" };
8
+ const OP_LABEL: Record<NotesOp["op"], string> = { read: "read", write: "wrote", update: "edited" };
9
+ const OP_LABEL_RUNNING: Record<NotesOp["op"], string> = { read: "reading", write: "writing", update: "editing" };
10
+
11
+ /** First added line of an update diff, without its line-number prefix: the sentence the agent just wrote down. */
12
+ function addedLine(diff: string): string | undefined {
13
+ for (const line of diff.split("\n")) {
14
+ if (!line.startsWith("+")) continue;
15
+ return line.replace(/^\+\s*\d+\s+\+\s?/, "");
16
+ }
17
+ return undefined;
18
+ }
11
19
 
12
20
  function DiffBody({ diff }: { diff: string }) {
13
21
  return (
@@ -16,7 +24,7 @@ function DiffBody({ diff }: { diff: string }) {
16
24
  const color = line.startsWith("+") ? PAPER.added
17
25
  : line.startsWith("-") ? PAPER.removed
18
26
  : PAPER.inkMuted;
19
- return <Text key={index} selectable style={{ color, fontSize: 12, fontFamily: "Menlo" }}>{line}</Text>;
27
+ return <Text key={index} selectable style={{ color, fontSize: 12, fontFamily: MONO }}>{line}</Text>;
20
28
  })}
21
29
  </View>
22
30
  );
@@ -26,54 +34,48 @@ export function NotesOpCard({ item, layout }: PluginTimelineItemProps<NotesOp>)
26
34
  const [expanded, setExpanded] = useState(false);
27
35
  const data = item.data;
28
36
  const title = data.status === "running" ? OP_LABEL_RUNNING[data.op] : OP_LABEL[data.op];
29
- const state = data.error !== undefined ? "failed"
30
- : data.op === "write" ? data.outcome
31
- : data.op === "update" ? CHANGE_LABEL[data.changeKind ?? ""] ?? data.changeKind
32
- : undefined;
33
- const footnotes: string[] = [];
34
- if (data.renamedFrom !== undefined) footnotes.push(`renamed from ${data.renamedFrom}`);
35
- if (data.diff !== undefined && data.truncated) footnotes.push("diff shortened for display");
36
37
  const showEllipsis = data.truncated && data.diff === undefined;
37
- const hasBody = Boolean(data.text || data.preview || data.diff || footnotes.length);
38
+ const hasBody = Boolean(data.text || data.preview || data.diff);
39
+ // Collapsed: one glance at what happened. Updates show the new sentence; writes the first of the content.
40
+ const peek = expanded || data.crumpled ? undefined
41
+ : data.diff !== undefined ? addedLine(data.diff)
42
+ : data.preview;
38
43
  return (
39
- <PaperCard compact={layout.compact}>
40
- <View style={{ gap: 5, paddingRight: hasBody && !expanded ? 34 : 0 }}>
41
- <View style={{ gap: 3 }}>
42
- <Text style={{ color: PAPER.inkMuted, fontSize: 11, letterSpacing: 0.5 }}>
43
- {title}{data.status === "running" ? " …" : ""}
44
+ <PaperCard compact={layout.compact} crumpled={data.crumpled}>
45
+ <Pressable
46
+ accessibilityRole="button"
47
+ accessibilityLabel={`${expanded ? "收起" : "展开"} ${data.address}`}
48
+ aria-expanded={expanded}
49
+ onPress={hasBody ? () => setExpanded(value => !value) : undefined}
50
+ disabled={!hasBody}
51
+ style={({ pressed }) => ({ gap: 4, opacity: pressed && hasBody ? 0.7 : 1 })}
52
+ >
53
+ <View style={{ flexDirection: "row", alignItems: "baseline", gap: 8 }}>
54
+ <Text style={{ color: PAPER.inkMuted, fontSize: 11.5 }}>
55
+ {data.crumpled ? "crumpled" : title}{data.status === "running" ? " …" : ""}
44
56
  </Text>
45
- <Text style={{ color: PAPER.ink, fontSize: 13, flexShrink: 1 }}>
57
+ <Text style={{ color: data.crumpled ? PAPER.inkMuted : PAPER.ink, fontSize: 13, flexShrink: 1, textDecorationLine: data.crumpled ? "line-through" : "none" }}>
46
58
  {data.address}
47
- {state !== undefined && <Text style={{ color: PAPER.inkMuted, fontSize: 12, fontWeight: "400" }}>{" "}{state}</Text>}
48
59
  </Text>
60
+ <View style={{ flex: 1 }} />
61
+ {hasBody && <Icon name={expanded ? "ChevronUp" : "ChevronDown"} size={16} color={PAPER.inkMuted} />}
49
62
  </View>
63
+ {peek !== undefined && (
64
+ <Text numberOfLines={2} style={{ color: data.diff !== undefined ? PAPER.added : PAPER.ink, fontSize: 13, lineHeight: 19 }}>
65
+ {data.diff !== undefined ? "+ " : ""}{peek}
66
+ </Text>
67
+ )}
50
68
  {data.error !== undefined && <Text selectable style={{ color: PAPER.removed, fontSize: 13, lineHeight: 19 }}>{data.error}</Text>}
51
- {expanded && hasBody && <ScrollView
52
- style={{ maxHeight: layout.compact ? 280 : 400 }}
53
- contentContainerStyle={{ gap: 5 }}
54
- nestedScrollEnabled
55
- >
69
+ </Pressable>
70
+ {expanded && hasBody && (
71
+ <ScrollView style={{ maxHeight: layout.compact ? 280 : 400 }} contentContainerStyle={{ gap: 5 }} nestedScrollEnabled>
56
72
  {data.text !== undefined && <Text selectable style={{ color: PAPER.ink, fontSize: 13, lineHeight: 19 }}>{data.text}{showEllipsis && " …"}</Text>}
57
73
  {data.preview !== undefined && <Text selectable style={{ color: PAPER.inkMuted, fontSize: 13, lineHeight: 19 }}>{data.preview}{showEllipsis && " …"}</Text>}
58
74
  {data.diff !== undefined && <DiffBody diff={data.diff} />}
59
- {footnotes.length > 0 && <Text style={{ color: PAPER.inkMuted, fontSize: 11 }}>{footnotes.join(" · ")}</Text>}
60
- </ScrollView>}
61
- {hasBody && <Pressable
62
- accessibilityRole="button"
63
- accessibilityLabel={`${expanded ? "收起" : "展开"} ${data.address}`}
64
- aria-expanded={expanded}
65
- onPress={() => setExpanded(value => !value)}
66
- hitSlop={6}
67
- style={({ pressed }) => ({
68
- ...(expanded
69
- ? { alignSelf: "flex-end" as const, marginTop: -3, marginBottom: -4 }
70
- : { position: "absolute" as const, right: 0, bottom: 0 }),
71
- paddingHorizontal: 5, opacity: pressed ? 0.6 : 1,
72
- })}
73
- >
74
- <Icon name={expanded ? "ChevronUp" : "ChevronDown"} size={18} color={PAPER.inkMuted} />
75
- </Pressable>}
76
- </View>
75
+ {data.renamedFrom !== undefined && <Text style={{ color: PAPER.inkMuted, fontSize: 11 }}>renamed from {data.renamedFrom}</Text>}
76
+ {data.truncated && <Text style={{ color: PAPER.inkMuted, fontSize: 11 }}>shortened for display</Text>}
77
+ </ScrollView>
78
+ )}
77
79
  </PaperCard>
78
80
  );
79
81
  }
@@ -41,7 +41,8 @@ function baseData(item: ToolCallItem, op: NotesOp["op"], input: unknown): NotesO
41
41
  const address = isRecord(input) && typeof input.address === "string" ? input.address : undefined;
42
42
  if (!address) return undefined;
43
43
  const status = item.status === "running" ? "running" : item.status === "failed" ? "failed" : "completed";
44
- return { op, address, status };
44
+ const crumpled = isRecord(input) && input.crumpled === true ? true : undefined;
45
+ return { op, address, status, ...(crumpled ? { crumpled } : {}) };
45
46
  }
46
47
 
47
48
  function notesOpData(item: ToolCallItem): NotesOp | undefined {
@@ -65,7 +66,9 @@ function notesOpData(item: ToolCallItem): NotesOp | undefined {
65
66
  }
66
67
  if (op === "write") {
67
68
  const outcome = text.split(" ")[0];
68
- return { ...data, ...(["created", "overwrote", "uncrumpled"].includes(outcome) ? { outcome } : {}) };
69
+ // Replay still carries the call arguments; the preview comes from input on every path.
70
+ const preview = isRecord(input) && typeof input.content === "string" ? clip(input.content, PREVIEW_MAX_CHARS) : undefined;
71
+ return { ...data, ...(["created", "overwrote", "uncrumpled"].includes(outcome) ? { outcome } : {}), ...(preview ? { preview: preview.text, ...(preview.truncated ? { truncated: true } : {}) } : {}) };
69
72
  }
70
73
  const head = text.split("\n")[0] ?? "";
71
74
  const changeKind = head.startsWith("moved ") ? "moved" : head.startsWith("updated ") ? "body" : head.startsWith("unchanged ") ? "none" : undefined;
@@ -1,33 +1,48 @@
1
1
  import type { ReactNode } from "react";
2
- import { View } from "react-native";
2
+ import { Platform, StyleSheet, View } from "react-native";
3
3
 
4
4
  /** Shared paper palette, independent of the host theme. */
5
5
  export const PAPER = {
6
- background: "#f7f2df",
7
- border: "#d9cdaa",
8
- tape: "#d8c98f",
6
+ background: "#f8f3e1",
7
+ edge: "#cbbd94",
8
+ tape: "rgba(222, 205, 140, 0.72)",
9
+ tapeEdge: "rgba(160, 140, 80, 0.18)",
9
10
  ink: "#33301f",
10
11
  inkMuted: "#867c63",
11
12
  added: "#357a44",
12
13
  removed: "#b0493e",
14
+ crumpled: "#ece6d1",
13
15
  };
14
16
 
15
- export function PaperCard({ compact, children }: { compact: boolean; children: ReactNode }) {
17
+ export const MONO = Platform.select({ ios: "Menlo", android: "monospace", default: "ui-monospace, Menlo, monospace" });
18
+
19
+ export function Tape() {
16
20
  return (
17
- <View style={{ paddingTop: 6 }}>
18
- <View style={{
19
- alignSelf: "flex-start", width: 84, height: 14, marginLeft: 28, marginBottom: -9, zIndex: 1,
20
- backgroundColor: PAPER.tape, opacity: 0.9, borderRadius: 2,
21
- transform: [{ rotate: "-2deg" }],
22
- }} />
21
+ <View style={{
22
+ alignSelf: "flex-start", width: 76, height: 15, marginLeft: 28, marginBottom: -9, zIndex: 1,
23
+ backgroundColor: PAPER.tape, borderLeftWidth: 1, borderRightWidth: 1, borderColor: PAPER.tapeEdge,
24
+ transform: [{ rotate: "-2deg" }],
25
+ }} />
26
+ );
27
+ }
28
+
29
+ export function PaperCard({ compact, crumpled = false, children }: {
30
+ compact: boolean;
31
+ crumpled?: boolean;
32
+ children: ReactNode;
33
+ }) {
34
+ return (
35
+ <View style={{ paddingTop: 7 }}>
36
+ <Tape />
23
37
  <View style={{
24
- padding: compact ? 10 : 12,
25
- gap: 5,
38
+ paddingVertical: compact ? 8 : 9,
39
+ paddingHorizontal: 10,
40
+ gap: 4,
26
41
  minWidth: 0,
27
- borderRadius: 4,
28
- borderWidth: 1,
29
- borderColor: PAPER.border,
30
- backgroundColor: PAPER.background,
42
+ borderRadius: 3,
43
+ borderWidth: StyleSheet.hairlineWidth,
44
+ borderColor: PAPER.edge,
45
+ backgroundColor: crumpled ? PAPER.crumpled : PAPER.background,
31
46
  }}>
32
47
  {children}
33
48
  </View>
@@ -7,7 +7,6 @@ export function StickyCard({ item, layout }: PluginTimelineItemProps<LastWord>)
7
7
  const text = item.data.text.replace(/^\*You peel a sticky note off your forehead\.\*\n/, "");
8
8
  return (
9
9
  <PaperCard compact={layout.compact}>
10
- <Text style={{ color: PAPER.inkMuted, fontSize: 11, letterSpacing: 0.5 }}>LAST WORD</Text>
11
10
  <Text selectable style={{ color: PAPER.ink, fontSize: 13, lineHeight: 19, flexShrink: 1 }}>{text}</Text>
12
11
  </PaperCard>
13
12
  );
@@ -24,6 +24,7 @@ export const notesOpSchema = z.object({
24
24
  changeKind: z.string().optional(),
25
25
  diff: z.string().optional(),
26
26
  renamedFrom: z.string().optional(),
27
+ crumpled: z.boolean().optional(),
27
28
  truncated: z.boolean().optional(),
28
29
  });
29
30
  export type NotesOp = z.infer<typeof notesOpSchema>;