notesoup 0.53.2 → 0.54.1

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.
Files changed (186) hide show
  1. package/README.md +6 -4
  2. package/dist/plugins/claude/src/helper.d.ts +2 -1
  3. package/dist/plugins/claude/src/helper.js +21 -24
  4. package/dist/plugins/claude/src/history.d.ts +3 -14
  5. package/dist/plugins/claude/src/history.js +2 -298
  6. package/dist/plugins/claude/src/text.d.ts +0 -1
  7. package/dist/plugins/claude/src/text.js +0 -1
  8. package/dist/plugins/codex/src/history.d.ts +3 -8
  9. package/dist/plugins/codex/src/history.js +2 -238
  10. package/dist/plugins/codex/src/hooks.js +1 -1
  11. package/dist/plugins/codex/src/identity.d.ts +1 -1
  12. package/dist/plugins/codex/src/identity.js +3 -3
  13. package/dist/plugins/codex/src/mcp.js +9 -8
  14. package/dist/plugins/codex/src/text.d.ts +1 -1
  15. package/dist/plugins/codex/src/text.js +2 -2
  16. package/dist/plugins/codex/src/transcript.d.ts +3 -39
  17. package/dist/plugins/codex/src/transcript.js +2 -313
  18. package/dist/plugins/dsh/engine.js +2 -2
  19. package/dist/plugins/dsh/history.d.ts +3 -0
  20. package/dist/plugins/dsh/history.js +15 -0
  21. package/dist/plugins/dsh/tools.js +12 -12
  22. package/dist/plugins/dsh/window.d.ts +1 -0
  23. package/dist/plugins/dsh/window.js +7 -3
  24. package/dist/plugins/pi/history-tools.d.ts +1 -1
  25. package/dist/plugins/pi/history-tools.js +9 -5
  26. package/dist/plugins/pi/history.d.ts +2 -3
  27. package/dist/plugins/pi/history.js +4 -147
  28. package/dist/plugins/pi/notes/tools.js +8 -6
  29. package/dist/plugins/pi/render.js +7 -4
  30. package/dist/plugins/pi/runtime.js +2 -2
  31. package/dist/plugins/pi/window.js +21 -7
  32. package/dist/src/boot/render.js +9 -11
  33. package/dist/src/boot/snapshot.d.ts +7 -7
  34. package/dist/src/boot/snapshot.js +17 -17
  35. package/dist/src/boot/text.d.ts +5 -3
  36. package/dist/src/boot/text.js +18 -10
  37. package/dist/src/dream/git.d.ts +2 -11
  38. package/dist/src/dream/git.js +6 -23
  39. package/dist/src/dream/lock.d.ts +2 -2
  40. package/dist/src/dream/lock.js +3 -3
  41. package/dist/src/history/claude.d.ts +16 -0
  42. package/dist/src/history/claude.js +336 -0
  43. package/dist/src/history/codex-transcript.d.ts +39 -0
  44. package/dist/src/history/codex-transcript.js +315 -0
  45. package/dist/src/history/codex.d.ts +8 -0
  46. package/dist/src/history/codex.js +238 -0
  47. package/dist/src/history/corpus.d.ts +35 -0
  48. package/dist/src/history/corpus.js +54 -0
  49. package/dist/src/history/history.d.ts +4 -8
  50. package/dist/src/history/history.js +3 -11
  51. package/dist/src/history/local.d.ts +17 -0
  52. package/dist/src/history/local.js +101 -0
  53. package/dist/src/history/pi.d.ts +36 -0
  54. package/dist/src/history/pi.js +202 -0
  55. package/dist/src/history/query.d.ts +15 -5
  56. package/dist/src/history/query.js +42 -13
  57. package/dist/src/index.d.ts +6 -3
  58. package/dist/src/index.js +6 -4
  59. package/dist/src/notes/address.d.ts +8 -8
  60. package/dist/src/notes/address.js +13 -13
  61. package/dist/src/notes/errors.d.ts +1 -1
  62. package/dist/src/notes/frontmatter.js +2 -2
  63. package/dist/src/notes/index.d.ts +1 -1
  64. package/dist/src/notes/index.js +1 -1
  65. package/dist/src/notes/paths.d.ts +6 -6
  66. package/dist/src/notes/paths.js +9 -9
  67. package/dist/src/notes/{project-home.d.ts → project-namespace.d.ts} +7 -7
  68. package/dist/src/notes/{project-home.js → project-namespace.js} +67 -25
  69. package/dist/src/notes/store.d.ts +4 -4
  70. package/dist/src/notes/store.js +55 -52
  71. package/dist/src/tools/dream.d.ts +21 -3
  72. package/dist/src/tools/dream.js +54 -16
  73. package/dist/src/tools/history.d.ts +7 -19
  74. package/dist/src/tools/history.js +80 -93
  75. package/dist/src/tools/notes-context.d.ts +10 -0
  76. package/dist/src/tools/notes-context.js +27 -0
  77. package/dist/src/tools/notes.d.ts +69 -20
  78. package/dist/src/tools/notes.js +40 -31
  79. package/dist/test/boot.integration.test.js +2 -3
  80. package/dist/test/claude-history.test.js +47 -34
  81. package/dist/test/claude-mod.test.js +96 -50
  82. package/dist/test/codex-history.test.js +4 -10
  83. package/dist/test/codex-plugin.test.js +50 -12
  84. package/dist/test/context-edit-budget.test.js +121 -0
  85. package/dist/test/dependencies.test.js +73 -6
  86. package/dist/test/dream-tools.test.js +153 -8
  87. package/dist/test/dsh.test.js +88 -19
  88. package/dist/test/helpers/dsh.d.ts +4 -1
  89. package/dist/test/helpers/dsh.js +20 -4
  90. package/dist/test/helpers/extension.d.ts +5 -1
  91. package/dist/test/helpers/extension.js +33 -2
  92. package/dist/test/helpers/history-corpus.d.ts +7 -0
  93. package/dist/test/helpers/history-corpus.js +26 -0
  94. package/dist/test/history-corpus.test.js +307 -0
  95. package/dist/test/history.integration.test.js +40 -48
  96. package/dist/test/host-neutral.test.js +20 -33
  97. package/dist/test/model-facing-text.test.js +14 -8
  98. package/dist/test/notes-cwd.test.d.ts +1 -0
  99. package/dist/test/notes-cwd.test.js +114 -0
  100. package/dist/test/notes-library.test.js +4 -4
  101. package/dist/test/notes-query-namespaces.test.d.ts +1 -0
  102. package/dist/test/{notes-query-homes.test.js → notes-query-namespaces.test.js} +13 -13
  103. package/dist/test/notes.integration.test.js +73 -24
  104. package/dist/test/notes.test.js +51 -21
  105. package/dist/test/pi-render.test.js +33 -1
  106. package/dist/test/project-namespace.test.d.ts +1 -0
  107. package/dist/test/project-namespace.test.js +324 -0
  108. package/docs/architecture.md +19 -12
  109. package/docs/claude-code-mod.md +7 -5
  110. package/docs/codex.md +6 -6
  111. package/docs/dsh.md +9 -9
  112. package/docs/history-sessions.md +52 -0
  113. package/docs/notes-library.md +9 -5
  114. package/docs/skills.md +3 -3
  115. package/docs/tool-results.md +14 -8
  116. package/package.json +4 -6
  117. package/playbook.md +6 -6
  118. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  119. package/plugins/claude/dist/claude/helper.js +2164 -1341
  120. package/plugins/claude/hooks/register.ts +19 -11
  121. package/plugins/claude/playbook.md +6 -6
  122. package/plugins/claude/skills/memory/SKILL.md +9 -7
  123. package/plugins/claude/src/helper.ts +22 -25
  124. package/plugins/claude/src/history.ts +3 -257
  125. package/plugins/claude/src/text.ts +0 -1
  126. package/plugins/codex/README.md +1 -1
  127. package/plugins/codex/dist/codex/notesoup.js +1582 -969
  128. package/plugins/codex/src/history.ts +3 -193
  129. package/plugins/codex/src/hooks.ts +1 -1
  130. package/plugins/codex/src/identity.ts +3 -3
  131. package/plugins/codex/src/mcp.ts +9 -8
  132. package/plugins/codex/src/text.ts +2 -2
  133. package/plugins/codex/src/transcript.ts +3 -275
  134. package/plugins/dsh/engine.ts +2 -2
  135. package/plugins/dsh/history.ts +17 -0
  136. package/plugins/dsh/tools.ts +12 -12
  137. package/plugins/dsh/window.ts +8 -3
  138. package/plugins/paseo/OVERVIEW.md +4 -4
  139. package/plugins/paseo/README.md +1 -1
  140. package/plugins/paseo/client/brain-empty-card.tsx +3 -4
  141. package/plugins/paseo/client/markdown.tsx +159 -0
  142. package/plugins/paseo/client/notes-op-card.tsx +35 -34
  143. package/plugins/paseo/client/notes-op-transformer.ts +17 -68
  144. package/plugins/paseo/client/paper-card.tsx +8 -19
  145. package/plugins/paseo/client/paper-palette.ts +40 -0
  146. package/plugins/paseo/client/sticky-card.tsx +6 -4
  147. package/plugins/paseo/package.json +3 -0
  148. package/plugins/paseo/paseo-plugin.json +2 -2
  149. package/plugins/paseo/shared/notes-op.ts +13 -9
  150. package/plugins/paseo/test/notes-op.test.ts +52 -73
  151. package/plugins/paseo/test/paper-palette.test.ts +54 -0
  152. package/plugins/pi/history-tools.ts +11 -5
  153. package/plugins/pi/history.ts +8 -157
  154. package/plugins/pi/notes/tools.ts +8 -6
  155. package/plugins/pi/render.ts +6 -4
  156. package/plugins/pi/runtime.ts +2 -2
  157. package/plugins/pi/window.ts +22 -7
  158. package/skills/memory/SKILL.md +9 -7
  159. package/src/boot/render.ts +10 -13
  160. package/src/boot/snapshot.ts +20 -20
  161. package/src/boot/text.ts +18 -10
  162. package/src/dream/git.ts +7 -24
  163. package/src/dream/lock.ts +3 -3
  164. package/src/history/claude.ts +286 -0
  165. package/src/history/codex-transcript.ts +276 -0
  166. package/src/history/codex.ts +193 -0
  167. package/src/history/corpus.ts +69 -0
  168. package/src/history/history.ts +5 -12
  169. package/src/history/local.ts +93 -0
  170. package/src/history/pi.ts +199 -0
  171. package/src/history/query.ts +45 -15
  172. package/src/index.ts +8 -5
  173. package/src/notes/address.ts +13 -13
  174. package/src/notes/errors.ts +1 -1
  175. package/src/notes/frontmatter.ts +2 -2
  176. package/src/notes/index.ts +1 -1
  177. package/src/notes/paths.ts +9 -9
  178. package/src/notes/{project-home.ts → project-namespace.ts} +59 -28
  179. package/src/notes/store.ts +61 -58
  180. package/src/tools/dream.ts +63 -16
  181. package/src/tools/history.ts +71 -101
  182. package/src/tools/notes-context.ts +29 -0
  183. package/src/tools/notes.ts +39 -29
  184. package/dist/test/project-home.test.js +0 -134
  185. /package/dist/test/{notes-query-homes.test.d.ts → context-edit-budget.test.d.ts} +0 -0
  186. /package/dist/test/{project-home.test.d.ts → history-corpus.test.d.ts} +0 -0
@@ -5,10 +5,11 @@ import { defineTool, type JsonSchemaNode, type ObjectJsonSchema, type ToolRunCon
5
5
  import type { Static, TSchema } from "typebox";
6
6
  import { Check, Errors } from "typebox/value";
7
7
  import { notesList, notesRead, notesSearch, notesUpdate, notesWrite } from "../../src/tools/notes.js";
8
- import { historyList, historyRead, historyWindows } from "../../src/tools/history.js";
8
+ import { historyList, historyRead } from "../../src/tools/history.js";
9
9
  import { success, type Operation } from "../../src/tools/result.js";
10
- import { historyProjection } from "./history.js";
11
- import { notesIdentity } from "./window.js";
10
+ import { historyContext } from "./history.js";
11
+ import { notesCwd, notesIdentity } from "./window.js";
12
+ import { notesToolContext } from "../../src/tools/notes-context.js";
12
13
  import { measureBudget } from "./budget.js";
13
14
  import { preflight, type NotesoupCompactionEngine } from "./engine.js";
14
15
 
@@ -70,15 +71,14 @@ export function registerTools(ctx: Context, engine: NotesoupCompactionEngine): v
70
71
  }
71
72
  if (!exec.parent && nestedResets.get(exec.agent)?.delete(exec.rootCallId) && !result.isError) state.pendingReset = true;
72
73
  });
73
- const identity = (agent: Agent) => notesIdentity(agent, engine.config);
74
- register(ctx, notesWrite, (agent) => [identity(agent)] as const);
75
- register(ctx, notesUpdate, (agent) => [identity(agent)] as const);
76
- register(ctx, notesRead, (agent) => [identity(agent)] as const);
77
- register(ctx, notesList, (agent) => [identity(agent)] as const);
78
- register(ctx, notesSearch, (agent) => [identity(agent)] as const);
79
- register(ctx, historyList, async (agent) => [await historyProjection(ctx, agent.session.id)] as const);
80
- register(ctx, historyRead, async (agent) => [await historyProjection(ctx, agent.session.id)] as const);
81
- register(ctx, historyWindows, async (agent) => [await historyProjection(ctx, agent.session.id), agent.session.id] as const);
74
+ const toolContext = (agent: Agent) => notesToolContext(notesIdentity(agent, engine.config), notesCwd(agent));
75
+ register(ctx, notesWrite, (agent) => [toolContext(agent)] as const);
76
+ register(ctx, notesUpdate, (agent) => [toolContext(agent)] as const);
77
+ register(ctx, notesRead, (agent) => [toolContext(agent)] as const);
78
+ register(ctx, notesList, (agent) => [toolContext(agent)] as const);
79
+ register(ctx, notesSearch, (agent) => [toolContext(agent)] as const);
80
+ register(ctx, historyList, (agent) => [historyContext(ctx, agent.session.id)] as const);
81
+ register(ctx, historyRead, (agent) => [historyContext(ctx, agent.session.id)] as const);
82
82
  ctx.tools.register(defineTool({
83
83
  name: "empty_brain",
84
84
  description: "Open a fresh context window after this tool batch. Write recovery notes first; notes and raw history stay on disk.",
@@ -86,13 +86,17 @@ export function recoverSnapshot(events: readonly SessionEvent[]): WindowSnapshot
86
86
  return latest;
87
87
  }
88
88
 
89
+ export function notesCwd(agent: Pick<Agent, "session" | "options">): string {
90
+ return agent.session.header.cwd ?? process.cwd();
91
+ }
92
+
89
93
  /** Identity is extracted here, never in the filesystem domain. */
90
94
  export function notesIdentity(agent: Pick<Agent, "session" | "options">, config: NotesConfig): NotesIdentity {
91
95
  const home = config.notesHome ?? join(homedir(), ".agents", "notes");
92
96
  return snapshotNotesIdentity({
93
97
  home,
94
98
  sessionId: agent.session.id,
95
- projectKey: projectKey(agent.session.header.cwd ?? process.cwd(), home),
99
+ projectKey: projectKey(notesCwd(agent), home),
96
100
  agent: slugify(config.agentName ?? "dsh"),
97
101
  model: slugify(agent.session.requestHeader()?.config.model ?? agent.options.model ?? "unknown"),
98
102
  });
@@ -111,9 +115,10 @@ export class Windows {
111
115
  const existing = this.states.get(agent.session);
112
116
  if (existing) return existing;
113
117
  const restored = recoverSnapshot(agent.session.snapshotEvents());
114
- const snapshot = restored ?? await this.mint(agent, 0, agent.session.header.createdAt);
118
+ const sameSession = restored !== undefined && restored.windowId === windowId(agent.session.id, restored.window);
119
+ const snapshot = sameSession ? restored : await this.mint(agent, restored?.window ?? 0, agent.session.header.createdAt);
115
120
  signal?.throwIfAborted();
116
- if (!restored) appendPluginRecord(agent.session, WINDOW_RECORD, snapshot);
121
+ if (!sameSession) appendPluginRecord(agent.session, WINDOW_RECORD, snapshot);
117
122
  const state = { snapshot, pendingReset: false, warned: false, reminded: false };
118
123
  restoreWarnings(state, agent.session.snapshotEvents());
119
124
  this.states.set(agent.session, state);
@@ -1,12 +1,12 @@
1
- # Notesoup last word
1
+ # Notesoup
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; a crumple call turns its card grey and strikes the address. 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 paper palette that follows Paseo’s theme: pale paper in light themes and warm charcoal paper in dark themes, with matching ink, tape and diff colors. Both keep small corners and compact spacing; a crumple call dulls its paper and strikes the address. Requires Paseo 0.11.2 or newer 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 accepts the bare Pi tool names and Claude's exact `mcp__notesoup__` prefix; same-named tools from other MCP servers are unchanged. It does not read session files or append messages. Other timeline items are unchanged.
6
6
 
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.
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. Read text and diffs come from the existing tool-result text; writes come from the call's content argument. Live and history use the same projection without a persisted copy. Each displayed body/diff is capped at 32,000 UTF-16 units, retaining the beginning and end with a visible omission line; collapsed previews are capped at 1,000 units before layout. Expanding does not fetch more content; original tool results and notes are unchanged. Diff lines of the same color share a text run rather than one component per line.
8
8
 
9
- Notes cards prefer Pi's structured tool payload on live events. Pi replayed history carries only rendered text blocks; Claude carries rendered text under the adapter's `output` field. Both use the same text fallback parser, and write previews come from the call arguments. Failed calls also read the adapter's error content (string or text blocks) or transport message when no result is available.
9
+ Notes cards use the same rendered-text parser for Pi live events and replayed history; Claude supplies that text under the adapter's `output` field. Write previews come from the call arguments. The UI does not depend on Pi's live-only `structuredContent`. Failed calls also read the adapter's error content (string or text blocks) or transport message when no result is available.
10
10
 
11
11
  `empty_brain` (including `mcp__notesoup__empty_brain`) becomes a divider for running, completed and failed calls. Pi's JSON rollover outcomes are preserved. Claude's plain acknowledgement only completes the tool call; it does not invent a Pi outcome or assert that the deferred reset has committed.
12
12
 
@@ -9,4 +9,4 @@ npm run typecheck
9
9
  npm test
10
10
  ```
11
11
 
12
- Install this directory with `paseo plugin install /absolute/path/to/plugins/paseo`. Source changes require `paseo plugin reload notesoup-last-word`; no daemon restart is needed.
12
+ Install this directory with `paseo plugin install /absolute/path/to/plugins/paseo`. Source changes require `paseo plugin reload notesoup`; no daemon restart is needed.
@@ -1,7 +1,6 @@
1
1
  import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
2
2
  import { Text, View } from "react-native";
3
3
  import type { BrainEmpty } from "../shared/brain-empty.ts";
4
- import { PAPER } from "./paper-card.tsx";
5
4
 
6
5
  function label(data: BrainEmpty): string {
7
6
  if (data.status === "running") return "✂ emptying brain …";
@@ -23,10 +22,10 @@ function CutLine({ color }: { color: string }) {
23
22
  );
24
23
  }
25
24
 
26
- export function BrainEmptyDivider({ item }: PluginTimelineItemProps<BrainEmpty>) {
25
+ export function BrainEmptyDivider({ item, theme }: PluginTimelineItemProps<BrainEmpty>) {
27
26
  const data = item.data;
28
27
  const refused = data.error !== undefined || data.status === "failed";
29
- const color = refused ? PAPER.removed : PAPER.inkMuted;
28
+ const color = refused ? theme.colors.statusDanger : theme.colors.foregroundMuted;
30
29
  return (
31
30
  <View style={{ paddingVertical: 6, gap: 3 }}>
32
31
  <View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
@@ -35,7 +34,7 @@ export function BrainEmptyDivider({ item }: PluginTimelineItemProps<BrainEmpty>)
35
34
  <CutLine color={color} />
36
35
  </View>
37
36
  {data.error !== undefined && (
38
- <Text selectable style={{ color: PAPER.removed, fontSize: 12, textAlign: "center" }}>{data.error}</Text>
37
+ <Text selectable style={{ color: theme.colors.statusDanger, fontSize: 12, textAlign: "center" }}>{data.error}</Text>
39
38
  )}
40
39
  </View>
41
40
  );
@@ -0,0 +1,159 @@
1
+ import { Lexer, lexer, type Token, type Tokens } from "marked";
2
+ import type { ReactNode } from "react";
3
+ import { StyleSheet, Text, View, type TextStyle, type ViewStyle } from "react-native";
4
+ import { MONO } from "./paper-card.tsx";
5
+ import type { PaperPalette } from "./paper-palette.ts";
6
+
7
+ type Styles = {
8
+ block: ViewStyle;
9
+ text: TextStyle; muted: TextStyle; strong: TextStyle; em: TextStyle; del: TextStyle;
10
+ codespan: TextStyle; link: TextStyle; heading: TextStyle; quoteText: TextStyle;
11
+ code: TextStyle; marker: TextStyle; tableCell: TextStyle;
12
+ quote: ViewStyle; hr: ViewStyle; list: ViewStyle; listItem: ViewStyle;
13
+ table: ViewStyle; tableRow: ViewStyle;
14
+ };
15
+
16
+ function markdownStyles(paper: PaperPalette): Styles {
17
+ return {
18
+ block: { gap: 6 },
19
+ text: { color: paper.ink, fontSize: 13, lineHeight: 19 },
20
+ muted: { color: paper.inkMuted, fontSize: 13, lineHeight: 19 },
21
+ strong: { fontWeight: "500", color: paper.ink },
22
+ em: { color: paper.inkMuted, fontStyle: "italic" },
23
+ del: { color: paper.inkMuted, textDecorationLine: "line-through" },
24
+ codespan: { fontFamily: MONO },
25
+ link: { color: paper.added, textDecorationLine: "underline" },
26
+ heading: { fontWeight: "500", color: paper.ink },
27
+ quote: { borderLeftWidth: 2, borderLeftColor: paper.edge, paddingLeft: 8, gap: 4 },
28
+ quoteText: { color: paper.inkMuted, fontSize: 13, lineHeight: 19 },
29
+ code: {
30
+ fontFamily: MONO, fontSize: 13, lineHeight: 19, color: paper.ink,
31
+ backgroundColor: paper.crumpled, borderRadius: 3, paddingVertical: 6, paddingHorizontal: 8,
32
+ },
33
+ hr: { height: StyleSheet.hairlineWidth, backgroundColor: paper.edge },
34
+ list: { gap: 3 },
35
+ listItem: { flexDirection: "row", gap: 6 },
36
+ marker: { color: paper.inkMuted, minWidth: 14 },
37
+ table: { gap: 2 },
38
+ tableRow: { flexDirection: "row", gap: 8 },
39
+ tableCell: { flex: 1 },
40
+ };
41
+ }
42
+
43
+ /** Inline tokens keep their nesting: strong/em/del/link hold the tokens they wrap. */
44
+ function renderInlines(tokens: Token[] | undefined, styles: Styles, keyPrefix: string): ReactNode[] {
45
+ if (!tokens) return [];
46
+ return tokens.map((token, index) => {
47
+ const key = `${keyPrefix}.${index}`;
48
+ switch (token.type) {
49
+ case "strong":
50
+ return <Text key={key} style={styles.strong}>{renderInlines(token.tokens, styles, key)}</Text>;
51
+ case "em":
52
+ return <Text key={key} style={styles.em}>{renderInlines(token.tokens, styles, key)}</Text>;
53
+ case "del":
54
+ return <Text key={key} style={styles.del}>{renderInlines(token.tokens, styles, key)}</Text>;
55
+ case "codespan":
56
+ return <Text key={key} style={styles.codespan}>{token.text}</Text>;
57
+ case "link":
58
+ return <Text key={key} style={styles.link}>{renderInlines(token.tokens, styles, key)}</Text>;
59
+ case "br":
60
+ return "\n";
61
+ case "image":
62
+ return <Text key={key} style={styles.link}>{token.text}</Text>;
63
+ default: {
64
+ const nested = (token as Tokens.Generic).tokens;
65
+ if (nested?.length) return <Text key={key}>{renderInlines(nested, styles, key)}</Text>;
66
+ const { text } = token as Tokens.Text;
67
+ return text ?? token.raw;
68
+ }
69
+ }
70
+ });
71
+ }
72
+
73
+ function renderListItem(item: Tokens.ListItem, marker: string, key: string, styles: Styles, textStyle: TextStyle): ReactNode {
74
+ return (
75
+ <View key={key} style={styles.listItem}>
76
+ <Text style={[styles.marker, textStyle]}>{item.task ? (item.checked ? "☑" : "☐") : marker}</Text>
77
+ <View style={{ flex: 1, gap: 4 }}>{renderBlocks(item.tokens, styles, key, textStyle)}</View>
78
+ </View>
79
+ );
80
+ }
81
+
82
+ function renderBlocks(tokens: Token[] | undefined, styles: Styles, keyPrefix: string, textStyle: TextStyle): ReactNode[] {
83
+ if (!tokens) return [];
84
+ return tokens.map((token, index) => {
85
+ const key = `${keyPrefix}.${index}`;
86
+ switch (token.type) {
87
+ case "space":
88
+ case "checkbox":
89
+ case "def":
90
+ return null;
91
+ case "hr":
92
+ return <View key={key} style={styles.hr} />;
93
+ case "code":
94
+ return <Text key={key} selectable style={styles.code}>{token.text}</Text>;
95
+ case "heading":
96
+ return <Text key={key} selectable style={[textStyle, styles.heading]}>{renderInlines(token.tokens, styles, key)}</Text>;
97
+ case "blockquote":
98
+ return <View key={key} style={styles.quote}>{renderBlocks(token.tokens, styles, key, styles.quoteText)}</View>;
99
+ case "list": {
100
+ const list = token as Tokens.List;
101
+ const start = typeof list.start === "number" ? list.start : 1;
102
+ return (
103
+ <View key={key} style={styles.list}>
104
+ {list.items.map((item, itemIndex) =>
105
+ renderListItem(item, list.ordered ? `${start + itemIndex}.` : "•", `${key}.${itemIndex}`, styles, textStyle))}
106
+ </View>
107
+ );
108
+ }
109
+ case "table": {
110
+ const table = token as Tokens.Table;
111
+ return (
112
+ <View key={key} style={styles.table}>
113
+ {[table.header, ...table.rows].map((row, rowIndex) => (
114
+ <View key={`${key}.${rowIndex}`} style={styles.tableRow}>
115
+ {row.map((cell, cellIndex) => (
116
+ <Text
117
+ key={`${key}.${rowIndex}.${cellIndex}`}
118
+ selectable
119
+ style={[textStyle, styles.tableCell, { textAlign: cell.align ?? "left" }, cell.header && styles.strong]}
120
+ >
121
+ {renderInlines(cell.tokens, styles, `${key}.${rowIndex}.${cellIndex}`)}
122
+ </Text>
123
+ ))}
124
+ </View>
125
+ ))}
126
+ </View>
127
+ );
128
+ }
129
+ default: {
130
+ const generic = token as Tokens.Generic;
131
+ return (
132
+ <Text key={key} selectable style={textStyle}>
133
+ {generic.tokens?.length ? renderInlines(generic.tokens, styles, key) : generic.text ?? generic.raw}
134
+ </Text>
135
+ );
136
+ }
137
+ }
138
+ });
139
+ }
140
+
141
+ export function NoteInline({ text, paper, color, numberOfLines }: {
142
+ text: string;
143
+ paper: PaperPalette;
144
+ color?: string;
145
+ numberOfLines?: number;
146
+ }) {
147
+ const styles = markdownStyles(paper);
148
+ return (
149
+ <Text numberOfLines={numberOfLines} style={{ ...styles.text, color: color ?? paper.ink }}>
150
+ {renderInlines(Lexer.lexInline(text), styles, "inline")}
151
+ </Text>
152
+ );
153
+ }
154
+
155
+ export function NoteMarkdown({ text, paper, muted = false }: { text: string; paper: PaperPalette; muted?: boolean }) {
156
+ const styles = markdownStyles(paper);
157
+ const textStyle = muted ? styles.muted : styles.text;
158
+ return <View style={styles.block}>{renderBlocks(lexer(text), styles, "block", textStyle)}</View>;
159
+ }
@@ -2,46 +2,46 @@ import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
2
2
  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
- import type { NotesOp } from "../shared/notes-op.ts";
6
- import { MONO, PAPER, PaperCard } from "./paper-card.tsx";
5
+ import { COLLAPSED_PREVIEW_MAX_CHARS, outputPreview, type NotesOp } from "../shared/notes-op.ts";
6
+ import { NoteInline, NoteMarkdown } from "./markdown.tsx";
7
+ import { MONO, PaperCard } from "./paper-card.tsx";
8
+ import { paperPalette, type PaperPalette } from "./paper-palette.ts";
7
9
 
8
10
  const OP_LABEL: Record<NotesOp["op"], string> = { read: "read", write: "wrote", update: "edited" };
9
11
  const OP_LABEL_RUNNING: Record<NotesOp["op"], string> = { read: "reading", write: "writing", update: "editing" };
10
12
 
11
13
  /** First added line of an update diff, without its line-number prefix: the sentence the agent just wrote down. */
12
14
  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;
15
+ return /^\+.*/m.exec(diff)?.[0].replace(/^\+\s*\d+\s+\+\s?/, "");
18
16
  }
19
17
 
20
- function DiffBody({ diff }: { diff: string }) {
18
+ function DiffBody({ diff, paper }: { diff: string; paper: PaperPalette }) {
19
+ const runs: { color: string; lines: string[] }[] = [];
20
+ for (const line of diff.split("\n")) {
21
+ const color = line.startsWith("+") ? paper.added : line.startsWith("-") ? paper.removed : paper.inkMuted;
22
+ const last = runs[runs.length - 1];
23
+ if (last?.color === color) last.lines.push(line);
24
+ else runs.push({ color, lines: [line] });
25
+ }
21
26
  return (
22
- <View style={{ gap: 2 }}>
23
- {diff.split("\n").map((line, index) => {
24
- const color = line.startsWith("+") ? PAPER.added
25
- : line.startsWith("-") ? PAPER.removed
26
- : PAPER.inkMuted;
27
- return <Text key={index} selectable style={{ color, fontSize: 12, fontFamily: MONO }}>{line}</Text>;
28
- })}
29
- </View>
27
+ <Text selectable style={{ fontSize: 12, lineHeight: 18, fontFamily: MONO }}>
28
+ {runs.map((run, index) => <Text key={index} style={{ color: run.color }}>{index > 0 ? "\n" : ""}{run.lines.join("\n")}</Text>)}
29
+ </Text>
30
30
  );
31
31
  }
32
32
 
33
- export function NotesOpCard({ item, layout }: PluginTimelineItemProps<NotesOp>) {
33
+ export function NotesOpCard({ item, layout, theme }: PluginTimelineItemProps<NotesOp>) {
34
34
  const [expanded, setExpanded] = useState(false);
35
+ const paper = paperPalette(theme);
35
36
  const data = item.data;
36
37
  const title = data.status === "running" ? OP_LABEL_RUNNING[data.op] : OP_LABEL[data.op];
37
- const showEllipsis = data.truncated && data.diff === undefined;
38
38
  const hasBody = Boolean(data.text || data.preview || data.diff);
39
39
  // Collapsed: one glance at what happened. Updates show the new sentence; writes the first of the content.
40
40
  const peek = expanded || data.crumpled ? undefined
41
41
  : data.diff !== undefined ? addedLine(data.diff)
42
42
  : data.preview;
43
43
  return (
44
- <PaperCard compact={layout.compact} crumpled={data.crumpled}>
44
+ <PaperCard paper={paper} compact={layout.compact} crumpled={data.crumpled}>
45
45
  <Pressable
46
46
  accessibilityRole="button"
47
47
  accessibilityLabel={`${expanded ? "收起" : "展开"} ${data.address}`}
@@ -50,30 +50,31 @@ export function NotesOpCard({ item, layout }: PluginTimelineItemProps<NotesOp>)
50
50
  disabled={!hasBody}
51
51
  style={({ pressed }) => ({ gap: 4, opacity: pressed && hasBody ? 0.7 : 1 })}
52
52
  >
53
- <View style={{ flexDirection: "row", alignItems: "baseline", gap: 8 }}>
54
- <Text style={{ color: PAPER.inkMuted, fontSize: 11.5 }}>
53
+ <View style={{ flexDirection: "row", alignItems: "center", gap: 8 }}>
54
+ <Text style={{ color: paper.inkMuted, fontSize: 11.5 }}>
55
55
  {data.crumpled ? "crumpled" : title}{data.status === "running" ? " …" : ""}
56
56
  </Text>
57
- <Text style={{ color: data.crumpled ? PAPER.inkMuted : PAPER.ink, fontSize: 13, flexShrink: 1, textDecorationLine: data.crumpled ? "line-through" : "none" }}>
57
+ <Text numberOfLines={1} style={{ color: data.crumpled ? paper.inkMuted : paper.ink, fontSize: 13, flex: 1, textDecorationLine: data.crumpled ? "line-through" : "none" }}>
58
58
  {data.address}
59
59
  </Text>
60
- <View style={{ flex: 1 }} />
61
- {hasBody && <Icon name={expanded ? "ChevronUp" : "ChevronDown"} size={16} color={PAPER.inkMuted} />}
60
+ {hasBody && <Icon name={expanded ? "ChevronUp" : "ChevronDown"} size={16} color={paper.inkMuted} />}
62
61
  </View>
63
62
  {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>
63
+ <NoteInline
64
+ text={`${data.diff !== undefined ? "+ " : ""}${outputPreview(peek, COLLAPSED_PREVIEW_MAX_CHARS).replace(/\s+/g, " ")}`}
65
+ paper={paper}
66
+ color={data.diff !== undefined ? paper.added : paper.ink}
67
+ numberOfLines={2}
68
+ />
67
69
  )}
68
- {data.error !== undefined && <Text selectable style={{ color: PAPER.removed, fontSize: 13, lineHeight: 19 }}>{data.error}</Text>}
70
+ {data.error !== undefined && <Text selectable style={{ color: paper.removed, fontSize: 13, lineHeight: 19 }}>{data.error}</Text>}
69
71
  </Pressable>
70
72
  {expanded && hasBody && (
71
- <ScrollView style={{ maxHeight: layout.compact ? 280 : 400 }} contentContainerStyle={{ gap: 5 }} nestedScrollEnabled>
72
- {data.text !== undefined && <Text selectable style={{ color: PAPER.ink, fontSize: 13, lineHeight: 19 }}>{data.text}{showEllipsis && " …"}</Text>}
73
- {data.preview !== undefined && <Text selectable style={{ color: PAPER.inkMuted, fontSize: 13, lineHeight: 19 }}>{data.preview}{showEllipsis && " …"}</Text>}
74
- {data.diff !== undefined && <DiffBody diff={data.diff} />}
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>}
73
+ <ScrollView style={{ maxHeight: layout.compact ? 280 : 400, borderTopWidth: 1, borderTopColor: paper.edge }} contentContainerStyle={{ gap: 5, paddingTop: 8 }} nestedScrollEnabled>
74
+ {data.text !== undefined && <NoteMarkdown text={outputPreview(data.text)} paper={paper} />}
75
+ {data.preview !== undefined && <NoteMarkdown text={outputPreview(data.preview)} paper={paper} muted />}
76
+ {data.diff !== undefined && <DiffBody diff={outputPreview(data.diff)} paper={paper} />}
77
+ {data.renamedFrom !== undefined && <Text style={{ color: paper.inkMuted, fontSize: 11 }}>renamed from {data.renamedFrom}</Text>}
77
78
  </ScrollView>
78
79
  )}
79
80
  </PaperCard>
@@ -1,10 +1,8 @@
1
1
  import type { PluginClientContext } from "@getpaseo/plugin/client";
2
2
  import {
3
- DIFF_MAX_CHARS,
4
3
  NOTES_OP_KIND,
5
4
  NOTES_OP_TOOLS,
6
- PREVIEW_MAX_CHARS,
7
- READ_TEXT_MAX_CHARS,
5
+ outputPreview,
8
6
  type NotesOp,
9
7
  type NotesOpTool,
10
8
  } from "../shared/notes-op.ts";
@@ -20,80 +18,31 @@ const OP_BY_TOOL: Record<NotesOpTool, NotesOp["op"]> = {
20
18
  notes_update: "update",
21
19
  };
22
20
 
23
- function clip(text: string, maxChars: number): { text: string; truncated: boolean } {
24
- const chars = Array.from(text);
25
- return chars.length <= maxChars
26
- ? { text, truncated: false }
27
- : { text: chars.slice(0, maxChars).join(""), truncated: true };
28
- }
29
-
30
- function baseData(item: ToolCallItem, op: NotesOp["op"], input: unknown): NotesOp | undefined {
31
- const address = isRecord(input) && typeof input.address === "string" ? input.address : undefined;
32
- if (!address) return undefined;
33
- const status = item.status === "running" ? "running" : item.status === "failed" ? "failed" : "completed";
34
- const crumpled = isRecord(input) && input.crumpled === true ? true : undefined;
35
- return { op, address, status, ...(crumpled ? { crumpled } : {}) };
36
- }
37
-
38
21
  function notesOpData(item: ToolCallItem, tool: NotesOpTool): NotesOp | undefined {
39
22
  const op = OP_BY_TOOL[tool];
40
23
  if (item.detail.type !== "unknown") return undefined;
41
24
  const { input, output } = item.detail;
42
- const data = baseData(item, op, input);
43
- if (!data) return undefined;
25
+ const address = isRecord(input) && typeof input.address === "string" ? input.address : undefined;
26
+ if (!address) return undefined;
27
+ const data: NotesOp = {
28
+ op,
29
+ address,
30
+ status: item.status === "running" ? "running" : item.status === "failed" ? "failed" : "completed",
31
+ ...(isRecord(input) && input.crumpled === true ? { crumpled: true } : {}),
32
+ };
44
33
  if (data.status === "running") return data;
45
34
 
46
- const wire = isRecord(output) && isRecord(output.structuredContent) ? output.structuredContent : undefined;
47
- if (wire && typeof wire.error === "string") return { ...data, error: wire.error };
48
35
  if (data.status === "failed") return { ...data, error: resultError(output, item.error) };
49
- if (!wire) {
50
- // Pi history and Claude carry rendered text, not the structured Notesoup payload.
51
- const text = resultText(output);
52
- if (text === undefined) return data;
53
- if (op === "read") {
54
- const clipped = clip(text.split("\n").slice(2).join("\n").replace(/^\n/, ""), READ_TEXT_MAX_CHARS);
55
- return { ...data, text: clipped.text, ...(clipped.truncated ? { truncated: true } : {}) };
56
- }
57
- if (op === "write") {
58
- const outcome = text.split(" ")[0];
59
- // Replay still carries the call arguments; the preview comes from input on every path.
60
- const preview = isRecord(input) && typeof input.content === "string" ? clip(input.content, PREVIEW_MAX_CHARS) : undefined;
61
- return { ...data, ...(["created", "overwrote", "uncrumpled"].includes(outcome) ? { outcome } : {}), ...(preview ? { preview: preview.text, ...(preview.truncated ? { truncated: true } : {}) } : {}) };
62
- }
63
- const head = text.split("\n")[0] ?? "";
64
- const changeKind = head.startsWith("moved ") ? "moved" : head.startsWith("updated ") ? "body" : head.startsWith("unchanged ") ? "none" : undefined;
65
- const diffStart = text.indexOf("\ndiff:\n");
66
- const clippedDiff = diffStart >= 0 ? clip(text.slice(diffStart + 7), DIFF_MAX_CHARS) : undefined;
67
- return {
68
- ...data,
69
- ...(changeKind ? { changeKind } : {}),
70
- ...(clippedDiff && clippedDiff.text.length > 0 ? { diff: clippedDiff.text, ...(clippedDiff.truncated ? { truncated: true } : {}) } : {}),
71
- };
72
- }
73
-
74
- if (op === "read" && typeof wire.text === "string") {
75
- const clipped = clip(wire.text, READ_TEXT_MAX_CHARS);
76
- return {
77
- ...data,
78
- text: clipped.text,
79
- truncated: clipped.truncated || wire.next_offset_chars !== null,
80
- ...(typeof wire.total_chars === "number" ? { totalChars: wire.total_chars } : {}),
81
- };
82
- }
83
- if (op === "write") {
84
- const preview = isRecord(input) && typeof input.content === "string" ? clip(input.content, PREVIEW_MAX_CHARS) : undefined;
85
- return {
86
- ...data,
87
- ...(typeof wire.outcome === "string" ? { outcome: wire.outcome } : {}),
88
- ...(preview ? { preview: preview.text, ...(preview.truncated ? { truncated: true } : {}) } : {}),
89
- };
90
- }
91
- const clippedDiff = typeof wire.diff === "string" && wire.diff.length > 0 ? clip(wire.diff, DIFF_MAX_CHARS) : undefined;
36
+ if (op === "write") return { ...data, ...(isRecord(input) && typeof input.content === "string" ? { preview: outputPreview(input.content) } : {}) };
37
+ // One projection for Pi live/history and Claude; keep upstream continuation markers.
38
+ const text = resultText(output);
39
+ if (text === undefined) return data;
40
+ if (op === "read") return { ...data, text: outputPreview(text.split("\n").slice(2).join("\n").replace(/^\n/, "")) };
41
+ const diffStart = text.indexOf("\ndiff:\n");
92
42
  return {
93
43
  ...data,
94
- ...(typeof wire.change_kind === "string" ? { changeKind: wire.change_kind } : {}),
95
- ...(typeof wire.rename_from === "string" ? { renamedFrom: wire.rename_from } : {}),
96
- ...(clippedDiff ? { diff: clippedDiff.text, ...(clippedDiff.truncated ? { truncated: true } : {}) } : {}),
44
+ ...(text.startsWith("moved ") && isRecord(input) && typeof input.rename_to === "string" ? { renamedFrom: data.address, address: input.rename_to } : {}),
45
+ ...(diffStart >= 0 ? { diff: outputPreview(text.slice(diffStart + 7)) } : {}),
97
46
  };
98
47
  }
99
48
 
@@ -1,39 +1,28 @@
1
1
  import type { ReactNode } from "react";
2
2
  import { Platform, StyleSheet, View } from "react-native";
3
-
4
- /** Shared paper palette, independent of the host theme. */
5
- export const PAPER = {
6
- background: "#f8f3e1",
7
- edge: "#cbbd94",
8
- tape: "rgba(222, 205, 140, 0.72)",
9
- tapeEdge: "rgba(160, 140, 80, 0.18)",
10
- ink: "#33301f",
11
- inkMuted: "#867c63",
12
- added: "#357a44",
13
- removed: "#b0493e",
14
- crumpled: "#ece6d1",
15
- };
3
+ import type { PaperPalette } from "./paper-palette.ts";
16
4
 
17
5
  export const MONO = Platform.select({ ios: "Menlo", android: "monospace", default: "ui-monospace, Menlo, monospace" });
18
6
 
19
- export function Tape() {
7
+ function Tape({ paper }: { paper: PaperPalette }) {
20
8
  return (
21
9
  <View style={{
22
10
  alignSelf: "flex-start", width: 76, height: 15, marginLeft: 28, marginBottom: -9, zIndex: 1,
23
- backgroundColor: PAPER.tape, borderLeftWidth: 1, borderRightWidth: 1, borderColor: PAPER.tapeEdge,
11
+ backgroundColor: paper.tape, borderLeftWidth: 1, borderRightWidth: 1, borderColor: paper.tapeEdge,
24
12
  transform: [{ rotate: "-2deg" }],
25
13
  }} />
26
14
  );
27
15
  }
28
16
 
29
- export function PaperCard({ compact, crumpled = false, children }: {
17
+ export function PaperCard({ paper, compact, crumpled = false, children }: {
18
+ paper: PaperPalette;
30
19
  compact: boolean;
31
20
  crumpled?: boolean;
32
21
  children: ReactNode;
33
22
  }) {
34
23
  return (
35
24
  <View style={{ paddingTop: 7 }}>
36
- <Tape />
25
+ <Tape paper={paper} />
37
26
  <View style={{
38
27
  paddingVertical: compact ? 8 : 9,
39
28
  paddingHorizontal: 10,
@@ -41,8 +30,8 @@ export function PaperCard({ compact, crumpled = false, children }: {
41
30
  minWidth: 0,
42
31
  borderRadius: 3,
43
32
  borderWidth: StyleSheet.hairlineWidth,
44
- borderColor: PAPER.edge,
45
- backgroundColor: crumpled ? PAPER.crumpled : PAPER.background,
33
+ borderColor: paper.edge,
34
+ backgroundColor: crumpled ? paper.crumpled : paper.background,
46
35
  }}>
47
36
  {children}
48
37
  </View>
@@ -0,0 +1,40 @@
1
+ import type { PluginTheme } from "@getpaseo/plugin";
2
+
3
+ const LIGHT_PAPER = {
4
+ background: "#f8f3e1",
5
+ edge: "#cbbd94",
6
+ tape: "rgba(222, 205, 140, 0.72)",
7
+ tapeEdge: "rgba(160, 140, 80, 0.18)",
8
+ ink: "#33301f",
9
+ inkMuted: "#867c63",
10
+ added: "#357a44",
11
+ removed: "#b0493e",
12
+ crumpled: "#ece6d1",
13
+ };
14
+
15
+ export type PaperPalette = typeof LIGHT_PAPER;
16
+
17
+ const DARK_PAPER: PaperPalette = {
18
+ background: "#302e27",
19
+ edge: "#58513e",
20
+ tape: "rgba(139, 122, 70, 0.55)",
21
+ tapeEdge: "rgba(194, 170, 100, 0.18)",
22
+ ink: "#e8e1cc",
23
+ inkMuted: "#b5aa8e",
24
+ added: "#91c79a",
25
+ removed: "#e69a8f",
26
+ crumpled: "#292824",
27
+ };
28
+
29
+ /** Paseo theme colors are hex (#RGB, #RRGGBB or #RRGGBBAA). */
30
+ function brightness(hex: string): number {
31
+ const rgb = hex.length === 4 ? hex.slice(1).replace(/./g, digit => digit + digit) : hex.slice(1, 7);
32
+ return 0.299 * parseInt(rgb.slice(0, 2), 16)
33
+ + 0.587 * parseInt(rgb.slice(2, 4), 16)
34
+ + 0.114 * parseInt(rgb.slice(4, 6), 16);
35
+ }
36
+
37
+ export function paperPalette(theme: PluginTheme): PaperPalette {
38
+ // The SDK exposes colors, not appearance. Use the host theme, never the OS color scheme.
39
+ return brightness(theme.colors.foreground) > brightness(theme.colors.surface0) ? DARK_PAPER : LIGHT_PAPER;
40
+ }
@@ -1,13 +1,15 @@
1
1
  import type { PluginTimelineItemProps } from "@getpaseo/plugin/client";
2
2
  import { Text } from "react-native";
3
3
  import type { LastWord } from "../shared/last-word.ts";
4
- import { PAPER, PaperCard } from "./paper-card.tsx";
4
+ import { PaperCard } from "./paper-card.tsx";
5
+ import { paperPalette } from "./paper-palette.ts";
5
6
 
6
- export function StickyCard({ item, layout }: PluginTimelineItemProps<LastWord>) {
7
+ export function StickyCard({ item, layout, theme }: PluginTimelineItemProps<LastWord>) {
8
+ const paper = paperPalette(theme);
7
9
  const text = item.data.text.replace(/^\*You peel a sticky note off your forehead\.\*\n/, "");
8
10
  return (
9
- <PaperCard compact={layout.compact}>
10
- <Text selectable style={{ color: PAPER.ink, fontSize: 13, lineHeight: 19, flexShrink: 1 }}>{text}</Text>
11
+ <PaperCard paper={paper} compact={layout.compact}>
12
+ <Text selectable style={{ color: paper.ink, fontSize: 13, lineHeight: 19, flexShrink: 1 }}>{text}</Text>
11
13
  </PaperCard>
12
14
  );
13
15
  }
@@ -7,6 +7,9 @@
7
7
  "typecheck": "tsc --noEmit",
8
8
  "test": "node --experimental-strip-types --test test/*.test.ts"
9
9
  },
10
+ "dependencies": {
11
+ "marked": "^17.0.6"
12
+ },
10
13
  "devDependencies": {
11
14
  "@getpaseo/plugin": "0.11.2",
12
15
  "@types/node": "^22.19.19",