notesoup 0.61.0 → 0.63.0
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/.agents/plugins/marketplace.json +15 -0
- package/README.md +14 -11
- package/dist/plugins/antigravity/src/cli.d.ts +1 -0
- package/dist/plugins/antigravity/src/cli.js +23 -0
- package/dist/plugins/antigravity/src/hooks.d.ts +18 -0
- package/dist/plugins/antigravity/src/hooks.js +53 -0
- package/dist/plugins/antigravity/src/identity.d.ts +26 -0
- package/dist/plugins/antigravity/src/identity.js +129 -0
- package/dist/plugins/claude/src/helper.js +24 -5
- package/dist/plugins/claude/src/text.d.ts +7 -0
- package/dist/plugins/claude/src/text.js +12 -1
- package/dist/plugins/codex/src/hooks.js +1 -0
- package/dist/plugins/codex/src/identity.d.ts +6 -1
- package/dist/plugins/codex/src/identity.js +13 -1
- package/dist/plugins/codex/src/mcp.d.ts +35 -7
- package/dist/plugins/codex/src/mcp.js +26 -88
- package/dist/plugins/codex/src/text.js +3 -3
- package/dist/plugins/dsh/tools.js +8 -4
- package/dist/plugins/mcp/operations.d.ts +15 -0
- package/dist/plugins/mcp/operations.js +43 -0
- package/dist/plugins/mcp/server.d.ts +14 -0
- package/dist/plugins/mcp/server.js +13 -0
- package/dist/plugins/pi/budget.d.ts +4 -1
- package/dist/plugins/pi/budget.js +35 -8
- package/dist/plugins/pi/entries.d.ts +2 -0
- package/dist/plugins/pi/entries.js +2 -0
- package/dist/plugins/pi/history-tools.js +2 -1
- package/dist/plugins/pi/history.js +18 -1
- package/dist/plugins/pi/notes/tools.js +7 -3
- package/dist/plugins/pi/render.d.ts +7 -1
- package/dist/plugins/pi/render.js +2 -2
- package/dist/plugins/pi/reset/artifacts.d.ts +1 -1
- package/dist/plugins/pi/reset/artifacts.js +4 -4
- package/dist/plugins/pi/reset/lifecycle.d.ts +9 -2
- package/dist/plugins/pi/reset/lifecycle.js +109 -31
- package/dist/plugins/pi/runtime.js +104 -63
- package/dist/plugins/pi/tool-result.js +7 -7
- package/dist/plugins/pi/window.d.ts +25 -3
- package/dist/plugins/pi/window.js +219 -9
- package/dist/src/boot/render.js +18 -15
- package/dist/src/boot/text.d.ts +3 -1
- package/dist/src/boot/text.js +22 -20
- package/dist/src/budget/text.d.ts +7 -3
- package/dist/src/budget/text.js +24 -15
- package/dist/src/history/claude.d.ts +2 -0
- package/dist/src/history/claude.js +46 -0
- package/dist/src/history/codex-transcript.js +7 -5
- package/dist/src/history/codex.js +3 -0
- package/dist/src/history/corpus.d.ts +28 -1
- package/dist/src/history/corpus.js +40 -0
- package/dist/src/history/history.d.ts +37 -46
- package/dist/src/history/history.js +21 -40
- package/dist/src/history/local.js +67 -32
- package/dist/src/history/pi.d.ts +2 -1
- package/dist/src/history/pi.js +122 -48
- package/dist/src/history/prefilter.js +76 -19
- package/dist/src/history/query.d.ts +28 -49
- package/dist/src/history/query.js +83 -68
- package/dist/src/history/summary-cache.d.ts +8 -1
- package/dist/src/history/summary-cache.js +138 -12
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.js +1 -1
- package/dist/src/notes/errors.d.ts +1 -1
- package/dist/src/notes/frontmatter.d.ts +0 -2
- package/dist/src/notes/frontmatter.js +0 -2
- package/dist/src/notes/index.d.ts +1 -1
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/policy.d.ts +15 -1
- package/dist/src/notes/policy.js +46 -5
- package/dist/src/notes/store.d.ts +12 -0
- package/dist/src/notes/store.js +16 -20
- package/dist/src/text-match.d.ts +10 -1
- package/dist/src/text-match.js +42 -3
- package/dist/src/tools/dream.d.ts +22 -93
- package/dist/src/tools/dream.js +30 -27
- package/dist/src/tools/history.d.ts +33 -26
- package/dist/src/tools/history.js +257 -163
- package/dist/src/tools/notes.d.ts +51 -163
- package/dist/src/tools/notes.js +146 -100
- package/dist/src/tools/output.d.ts +2 -1
- package/dist/src/tools/output.js +2 -1
- package/dist/src/tools/result.d.ts +4 -7
- package/dist/src/tools/result.js +8 -9
- package/dist/src/tools/schema.d.ts +4 -1
- package/dist/src/tools/schema.js +25 -1
- package/dist/test/agent-loop.test.js +394 -56
- package/dist/test/antigravity-live.test.d.ts +1 -0
- package/dist/test/antigravity-live.test.js +142 -0
- package/dist/test/antigravity-plugin.test.d.ts +1 -0
- package/dist/test/antigravity-plugin.test.js +101 -0
- package/dist/test/boot.integration.test.js +156 -15
- package/dist/test/budget-settings.integration.test.js +4 -4
- package/dist/test/claude-history.test.js +14 -13
- package/dist/test/claude-mod.test.js +199 -16
- package/dist/test/claude-validation.test.js +69 -2
- package/dist/test/codex-history.test.js +15 -3
- package/dist/test/codex-plugin.test.js +76 -38
- package/dist/test/dependencies.test.js +7 -3
- package/dist/test/dream-skill.test.js +3 -3
- package/dist/test/dream-tools.test.js +101 -56
- package/dist/test/dsh.test.js +34 -19
- package/dist/test/helpers/dependency-graph.js +2 -2
- package/dist/test/helpers/extension.d.ts +68 -3
- package/dist/test/helpers/extension.js +74 -5
- package/dist/test/history-corpus.test.js +79 -77
- package/dist/test/history-summary-cache.test.js +97 -9
- package/dist/test/history.integration.test.js +234 -168
- package/dist/test/host-neutral.test.js +69 -19
- package/dist/test/marker.test.js +1 -1
- package/dist/test/model-facing-text.test.js +13 -3
- package/dist/test/note-policy.test.js +96 -77
- package/dist/test/notes.integration.test.js +212 -94
- package/dist/test/notes.test.js +184 -113
- package/dist/test/pi-render.test.js +20 -12
- package/dist/test/project-namespace.test.js +3 -2
- package/dist/test/reset-lifecycle.test.js +12 -2
- package/docs/antigravity.md +44 -0
- package/docs/architecture.md +6 -4
- package/docs/claude-code-mod.md +7 -7
- package/docs/codex.md +36 -38
- package/docs/dsh.md +3 -3
- package/docs/history-sessions.md +28 -50
- package/docs/notes-library.md +4 -4
- package/docs/reset-lifecycle.md +1 -1
- package/docs/skills.md +3 -3
- package/docs/tool-results.md +47 -28
- package/package.json +3 -2
- package/playbook.md +1 -1
- package/plugins/antigravity/dist/antigravity/notesoup.js +26886 -0
- package/plugins/antigravity/hooks.json +7 -0
- package/plugins/antigravity/mcp_config.json +8 -0
- package/plugins/antigravity/plugin.json +6 -0
- package/plugins/antigravity/src/cli.ts +22 -0
- package/plugins/antigravity/src/hooks.ts +51 -0
- package/plugins/antigravity/src/identity.ts +127 -0
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/dist/claude/helper.js +1108 -539
- package/plugins/claude/hooks/register.ts +202 -62
- package/plugins/claude/playbook.md +1 -1
- package/plugins/claude/skills/dream/SKILL.md +1 -1
- package/plugins/claude/skills/notesoup-guide/SKILL.md +92 -0
- package/plugins/claude/src/helper.ts +24 -5
- package/plugins/claude/src/text.ts +14 -1
- package/plugins/codex/.codex-plugin/plugin.json +8 -0
- package/plugins/codex/.mcp.json +11 -0
- package/plugins/codex/README.md +5 -21
- package/plugins/codex/dist/codex/notesoup.js +18480 -17946
- package/plugins/codex/src/hooks.ts +1 -0
- package/plugins/codex/src/identity.ts +14 -1
- package/plugins/codex/src/mcp.ts +28 -98
- package/plugins/codex/src/text.ts +3 -3
- package/plugins/dsh/tools.ts +8 -4
- package/plugins/mcp/operations.ts +50 -0
- package/plugins/mcp/server.ts +23 -0
- package/plugins/paseo/README.md +5 -10
- package/plugins/paseo/client/brain-empty-card.tsx +3 -3
- package/plugins/paseo/client/markdown.tsx +50 -38
- package/plugins/paseo/client/notes-op-card.tsx +12 -9
- package/plugins/paseo/client/paper-card.tsx +6 -5
- package/plugins/paseo/client/paper-palette.ts +2 -9
- package/plugins/paseo/client/sticky-card.tsx +2 -2
- package/plugins/paseo/client/tool-result.ts +7 -14
- package/plugins/paseo/package-lock.json +3406 -0
- package/plugins/paseo/package.json +1 -0
- package/plugins/paseo/test/markdown-core.test.ts +73 -66
- package/plugins/pi/budget.ts +31 -8
- package/plugins/pi/entries.ts +2 -0
- package/plugins/pi/history-tools.ts +2 -1
- package/plugins/pi/history.ts +30 -1
- package/plugins/pi/notes/tools.ts +7 -3
- package/plugins/pi/render.ts +6 -6
- package/plugins/pi/reset/artifacts.ts +4 -3
- package/plugins/pi/reset/lifecycle.ts +125 -32
- package/plugins/pi/runtime.ts +98 -62
- package/plugins/pi/tool-result.ts +8 -8
- package/plugins/pi/window.ts +210 -10
- package/skills/dream/SKILL.md +1 -1
- package/skills/notesoup-guide/SKILL.md +92 -0
- package/src/boot/render.ts +18 -15
- package/src/boot/text.ts +23 -19
- package/src/budget/text.ts +27 -15
- package/src/history/claude.ts +41 -0
- package/src/history/codex-transcript.ts +6 -4
- package/src/history/codex.ts +2 -0
- package/src/history/corpus.ts +51 -2
- package/src/history/history.ts +35 -44
- package/src/history/local.ts +67 -27
- package/src/history/pi.ts +113 -35
- package/src/history/prefilter.ts +73 -15
- package/src/history/query.ts +93 -73
- package/src/history/summary-cache.ts +142 -17
- package/src/index.ts +2 -2
- package/src/notes/errors.ts +1 -1
- package/src/notes/frontmatter.ts +0 -3
- package/src/notes/index.ts +1 -1
- package/src/notes/policy.ts +44 -5
- package/src/notes/store.ts +17 -20
- package/src/text-match.ts +46 -4
- package/src/tools/dream.ts +29 -31
- package/src/tools/history.ts +249 -142
- package/src/tools/notes.ts +145 -113
- package/src/tools/output.ts +2 -1
- package/src/tools/result.ts +12 -11
- package/src/tools/schema.ts +24 -1
- package/plugins/claude/skills/memory/SKILL.md +0 -69
- package/plugins/codex/mcp.json +0 -10
- package/plugins/codex/plugin.json +0 -6
- package/plugins/paseo/client/markdown-core.tsx +0 -189
- package/plugins/paseo/client/typography.ts +0 -24
- package/skills/memory/SKILL.md +0 -69
package/plugins/codex/mcp.json
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
// Manually mirrored between square and pi-context (notesoup):
|
|
2
|
-
// plugins/paseo/client/markdown-core.tsx. Keep both copies byte-identical.
|
|
3
|
-
// Mechanics only: palettes, attribution and preview controls belong to the adapters.
|
|
4
|
-
import type { ReactNode } from "react";
|
|
5
|
-
import { Linking, ScrollView, Text, View, type TextStyle, type ViewStyle } from "react-native";
|
|
6
|
-
import { Lexer, type Token, type Tokens } from "marked";
|
|
7
|
-
|
|
8
|
-
export interface MarkdownStyles {
|
|
9
|
-
text: TextStyle;
|
|
10
|
-
strong: TextStyle;
|
|
11
|
-
em: TextStyle;
|
|
12
|
-
del: TextStyle;
|
|
13
|
-
link: TextStyle;
|
|
14
|
-
// Keep nested Text backgrounds square; rounded inline backgrounds are unreliable on iOS.
|
|
15
|
-
inlineCode: TextStyle;
|
|
16
|
-
heading: TextStyle;
|
|
17
|
-
quoteText: TextStyle;
|
|
18
|
-
codeText: TextStyle;
|
|
19
|
-
bullet: TextStyle;
|
|
20
|
-
tableCell: TextStyle;
|
|
21
|
-
codeBlock: ViewStyle;
|
|
22
|
-
codeContent: ViewStyle;
|
|
23
|
-
quote: ViewStyle;
|
|
24
|
-
separator: ViewStyle;
|
|
25
|
-
list: ViewStyle;
|
|
26
|
-
listRow: ViewStyle;
|
|
27
|
-
listItem: ViewStyle;
|
|
28
|
-
table: ViewStyle;
|
|
29
|
-
tableHead: ViewStyle;
|
|
30
|
-
tableRow: ViewStyle;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** Children of a token, if it has any: `Token` is a union, so the optional field needs one cast. */
|
|
34
|
-
const children = (node: Token | { tokens?: Token[] }): Token[] => (node as { tokens?: Token[] }).tokens ?? [];
|
|
35
|
-
|
|
36
|
-
const ENTITIES: Record<string, string> = {
|
|
37
|
-
lt: "<", gt: ">", quot: '"', apos: "'", amp: "&", nbsp: "\u00a0", mdash: "—", ndash: "–",
|
|
38
|
-
};
|
|
39
|
-
const HTML_BR = /^<br\s*\/?>$/i;
|
|
40
|
-
const SAFE_LINK = /^(?:https?:|mailto:)/i;
|
|
41
|
-
|
|
42
|
-
function unescape(text: string): string {
|
|
43
|
-
return text.replace(/&(?:#(\d+)|#x([0-9a-fA-F]+)|([a-zA-Z0-9]+));/g, (raw, dec?: string, hex?: string, named?: string) => {
|
|
44
|
-
if (dec !== undefined || hex !== undefined) {
|
|
45
|
-
const code = Number.parseInt((dec ?? hex)!, dec !== undefined ? 10 : 16);
|
|
46
|
-
return code > 0 && code <= 0x10ffff && (code < 0xd800 || code > 0xdfff) ? String.fromCodePoint(code) : raw;
|
|
47
|
-
}
|
|
48
|
-
return ENTITIES[named!] ?? raw;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function linkPress(href: string, openLinks: boolean): (() => void) | undefined {
|
|
53
|
-
const url = unescape(href);
|
|
54
|
-
return openLinks && SAFE_LINK.test(url) ? () => { void Promise.resolve(Linking.openURL(url)).catch(() => {}); } : undefined;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function inlinePlain(tokens: Token[]): string {
|
|
58
|
-
return tokens.map(token => {
|
|
59
|
-
switch (token.type) {
|
|
60
|
-
case "checkbox": return "";
|
|
61
|
-
case "br": return "\n";
|
|
62
|
-
case "html": return HTML_BR.test(token.raw.trim()) ? "\n" : token.raw;
|
|
63
|
-
case "codespan": return token.text;
|
|
64
|
-
case "image": return inlinePlain(children(token)) || token.text || "[image]";
|
|
65
|
-
default: {
|
|
66
|
-
const inline = token as Tokens.Generic;
|
|
67
|
-
return inline.tokens !== undefined ? inlinePlain(inline.tokens) : unescape(inline.text ?? inline.raw);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}).join("");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function cellWidth(cell: Tokens.TableCell | undefined): number {
|
|
74
|
-
if (!cell) return 56;
|
|
75
|
-
const widest = Math.max(...inlinePlain(children(cell)).split("\n").map(line =>
|
|
76
|
-
[...line].reduce((sum, ch) => sum + (ch.codePointAt(0)! > 0x2e7f ? 14 : 7.5), 16)));
|
|
77
|
-
return Math.min(240, Math.max(56, widest));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/** Inline runs nest inside their block's Text, so they carry only what differs from it. */
|
|
81
|
-
export function renderInlines(tokens: Token[], styles: MarkdownStyles, prefix: string, openLinks = false): ReactNode[] {
|
|
82
|
-
return tokens.map((token, index) => {
|
|
83
|
-
const key = `${prefix}-${index}`;
|
|
84
|
-
const nested = (style?: TextStyle, onPress?: () => void): ReactNode => (
|
|
85
|
-
<Text key={key} style={style} onPress={onPress}>{renderInlines(children(token), styles, key, openLinks)}</Text>
|
|
86
|
-
);
|
|
87
|
-
switch (token.type) {
|
|
88
|
-
case "checkbox": return null;
|
|
89
|
-
case "strong": return nested(styles.strong);
|
|
90
|
-
case "em": return nested(styles.em);
|
|
91
|
-
case "del": return nested(styles.del);
|
|
92
|
-
case "link": return nested(styles.link, linkPress((token as Tokens.Link).href, openLinks));
|
|
93
|
-
case "codespan": return <Text key={key} style={styles.inlineCode}>{token.text}</Text>;
|
|
94
|
-
case "br": return "\n";
|
|
95
|
-
case "html": return HTML_BR.test(token.raw.trim()) ? "\n" : token.raw;
|
|
96
|
-
case "image": {
|
|
97
|
-
const image = token as Tokens.Image;
|
|
98
|
-
const label = inlinePlain(children(image)) || image.text || "[image]";
|
|
99
|
-
return <Text key={key} style={styles.link} onPress={linkPress(image.href, openLinks)}>{label}</Text>;
|
|
100
|
-
}
|
|
101
|
-
default: {
|
|
102
|
-
const inline = token as Tokens.Generic;
|
|
103
|
-
if (inline.tokens !== undefined) return nested();
|
|
104
|
-
return unescape(inline.text ?? inline.raw);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export function renderBlocks(tokens: Token[], styles: MarkdownStyles, prefix: string, textStyle?: TextStyle, openLinks = true): ReactNode[] {
|
|
111
|
-
const visible = tokens.filter(token =>
|
|
112
|
-
token.type !== "space" && token.type !== "checkbox" && token.type !== "def"
|
|
113
|
-
&& !(token.type === "html" && HTML_BR.test(token.raw.trim())));
|
|
114
|
-
return visible.map((token, index) => {
|
|
115
|
-
const key = `${prefix}-${index}`;
|
|
116
|
-
switch (token.type) {
|
|
117
|
-
case "html":
|
|
118
|
-
return <Text key={key} selectable style={[styles.text, textStyle]}>{token.raw}</Text>;
|
|
119
|
-
case "hr":
|
|
120
|
-
return <View key={key} style={styles.separator} />;
|
|
121
|
-
case "code":
|
|
122
|
-
return (
|
|
123
|
-
<ScrollView key={key} horizontal style={styles.codeBlock} contentContainerStyle={styles.codeContent}>
|
|
124
|
-
<Text selectable style={styles.codeText}>{token.text}</Text>
|
|
125
|
-
</ScrollView>
|
|
126
|
-
);
|
|
127
|
-
case "heading": {
|
|
128
|
-
// Headings sit closer to the section they introduce than to whatever preceded them.
|
|
129
|
-
const rhythm = { marginTop: index > 0 ? 4 : 0, marginBottom: index < visible.length - 1 ? -2 : 0 };
|
|
130
|
-
return (
|
|
131
|
-
<Text key={key} selectable style={[styles.text, textStyle, styles.heading, rhythm]}>
|
|
132
|
-
{renderInlines(children(token), styles, key, openLinks)}
|
|
133
|
-
</Text>
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
case "blockquote":
|
|
137
|
-
return <View key={key} style={styles.quote}>{renderBlocks(children(token), styles, key, styles.quoteText, openLinks)}</View>;
|
|
138
|
-
case "list": {
|
|
139
|
-
const list = token as Tokens.List;
|
|
140
|
-
const start = typeof list.start === "number" ? list.start : 1;
|
|
141
|
-
return (
|
|
142
|
-
<View key={key} style={styles.list}>
|
|
143
|
-
{list.items.map((item, itemIndex) => (
|
|
144
|
-
<View key={`${key}-${itemIndex}`} style={styles.listRow}>
|
|
145
|
-
<Text style={styles.bullet}>
|
|
146
|
-
{item.task ? (item.checked === true ? "☑" : "☐") : list.ordered ? `${start + itemIndex}.` : "•"}
|
|
147
|
-
</Text>
|
|
148
|
-
<View style={styles.listItem}>{renderBlocks(children(item), styles, `${key}-${itemIndex}`, textStyle, openLinks)}</View>
|
|
149
|
-
</View>
|
|
150
|
-
))}
|
|
151
|
-
</View>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
case "table": {
|
|
155
|
-
const table = token as Tokens.Table;
|
|
156
|
-
const rows = [table.header, ...table.rows];
|
|
157
|
-
// Columns size to their widest cell (within reason) and the table scrolls sideways
|
|
158
|
-
// on narrow screens instead of crushing every cell to a sliver.
|
|
159
|
-
const widths = table.header.map((_, column) => Math.max(...rows.map(cells => cellWidth(cells[column]))));
|
|
160
|
-
return (
|
|
161
|
-
<ScrollView key={key} horizontal>
|
|
162
|
-
<View style={styles.table}>
|
|
163
|
-
{rows.map((cells, rowIndex) => (
|
|
164
|
-
<View key={`${key}-${rowIndex}`} style={rowIndex === 0 ? [styles.tableRow, styles.tableHead, { borderTopWidth: 0 }] : styles.tableRow}>
|
|
165
|
-
{cells.map((cell, cellIndex) => (
|
|
166
|
-
<Text
|
|
167
|
-
key={`${key}-${rowIndex}-${cellIndex}`}
|
|
168
|
-
selectable
|
|
169
|
-
style={[styles.text, textStyle, styles.tableCell, { width: widths[cellIndex], textAlign: table.align[cellIndex] ?? "left" },
|
|
170
|
-
rowIndex === 0 ? styles.strong : undefined]}
|
|
171
|
-
>{renderInlines(children(cell), styles, `${key}-${rowIndex}-${cellIndex}`, openLinks)}</Text>
|
|
172
|
-
))}
|
|
173
|
-
</View>
|
|
174
|
-
))}
|
|
175
|
-
</View>
|
|
176
|
-
</ScrollView>
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
default: {
|
|
180
|
-
const block = token as Tokens.Generic;
|
|
181
|
-
return (
|
|
182
|
-
<Text key={key} selectable style={[styles.text, textStyle]}>
|
|
183
|
-
{renderInlines(block.tokens ?? Lexer.lexInline(block.text ?? block.raw), styles, key, openLinks)}
|
|
184
|
-
</Text>
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { PluginTheme } from "@getpaseo/plugin";
|
|
2
|
-
import { Platform } from "react-native";
|
|
3
|
-
|
|
4
|
-
type ThemeTypography = {
|
|
5
|
-
fontSize?: Partial<Record<"sm" | "base" | "code", number>>;
|
|
6
|
-
fontFamily?: Partial<Record<"ui" | "mono", string>>;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const MONO = Platform.select({ ios: "Menlo", android: "monospace", default: "ui-monospace, Menlo, monospace" });
|
|
10
|
-
const lineHeight = (size: number, ratio: number) => Math.round(size * ratio * 2) / 2;
|
|
11
|
-
|
|
12
|
-
export function typography(theme: PluginTheme) {
|
|
13
|
-
// The host can supply these roles before the SDK exposes them (#6600).
|
|
14
|
-
const { fontSize, fontFamily } = (theme as PluginTheme & { typography?: ThemeTypography }).typography ?? {};
|
|
15
|
-
const text = (size: number) => ({ fontSize: size, lineHeight: lineHeight(size, 1.5), fontFamily: fontFamily?.ui });
|
|
16
|
-
const size = fontSize?.code ?? 13;
|
|
17
|
-
const inlineCode = { fontSize: size, fontFamily: fontFamily?.mono ?? MONO };
|
|
18
|
-
return {
|
|
19
|
-
sm: text(fontSize?.sm ?? 11.5), base: text(fontSize?.base ?? 13), body: text(size),
|
|
20
|
-
inlineCode, code: { ...inlineCode, lineHeight: lineHeight(size, 1.4) },
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type Typography = ReturnType<typeof typography>;
|
package/skills/memory/SKILL.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: memory
|
|
3
|
-
description: How notesoup's `notes_*` and `history_*` tools fit together — note addresses and notebooks, finding things again, and saving recovery state. Use when the context-window protocol is missing or unclear, or when unsure where a note belongs or how to find something again.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Memory
|
|
7
|
-
|
|
8
|
-
Two stores outlive the context window. Anything in neither is lost when the window ends or is wiped.
|
|
9
|
-
|
|
10
|
-
- **Notes** (`notes_*`) — what you choose to keep. Plain markdown, written on purpose.
|
|
11
|
-
- **History** (`history_*`) — recorded messages, tool calls and summaries. Current session by default; other local sessions/harnesses through `session`. Read-only.
|
|
12
|
-
|
|
13
|
-
Each tool's own description covers its parameters and paging. This guide covers what the descriptions cannot: where notes belong, and how the tools work together.
|
|
14
|
-
|
|
15
|
-
## Addresses
|
|
16
|
-
|
|
17
|
-
The address decides who a note belongs to and how long it lasts.
|
|
18
|
-
|
|
19
|
-
| Address | Note | Keep there |
|
|
20
|
-
| --- | --- | --- |
|
|
21
|
-
| `<path>`, no `@` | session note | current task state and loose ends; gone with the session |
|
|
22
|
-
| `@project/<path>` | project note | decisions and constraints future work must respect |
|
|
23
|
-
| `@human/<path>` | human note | how to work with this human, across projects |
|
|
24
|
-
| `@self/<path>` | self note | your reminders; yours alone if you have a name, shared by everyone nameless |
|
|
25
|
-
| `@model/<path>` | model note | what applies to this model only |
|
|
26
|
-
| `@projects/<name>/<path>` | named project, read-only | discover names and root paths with `notes_list` glob `@projects/*/**` |
|
|
27
|
-
| `@sessions/<id>/<path>` | named session, read-only | recover earlier task state; discover with glob `@sessions/*/**` |
|
|
28
|
-
|
|
29
|
-
When notes conflict, the one most relevant to what you're doing applies. If that doesn't settle it, judge the case.
|
|
30
|
-
|
|
31
|
-
Any other `@` prefix is refused. A path is relative and `/`-separated, with no empty, `.` or `..` segments.
|
|
32
|
-
|
|
33
|
-
`@` addresses are not file paths: never pass them to file tools like `read`, `write`, `edit`, or `bash`. That creates a stray directory instead of a note.
|
|
34
|
-
|
|
35
|
-
`CHEATSHEET.md` at each notebook's root is the default-pinned page you wake up with; absent or crumpled pages are skipped. Set `pinned`, `budget`, and `readonly` through `notes_write`/`notes_update` or frontmatter. Explicit `pinned:false` unpins even a default page. Each notebook allows five live pins; ordinary pages default to a 4096-code-point advisory budget (2048 for root `CHEATSHEET.md`), adjustable per note. Overflow warns but saves, and pinned bodies load whole. `readonly:true` is a soft lock, not security; explicitly set `readonly:false` to unlock, alone or alongside your changes. Keep standing reminders in `CHEATSHEET.md`, to five lines. Give each durable note a one-line `description` (max 160 characters, set with `notes_write`/`notes_update`): boot lists every notebook's unpinned pages newest first as address, age, and description, so it is the only index. Do not create empty pages.
|
|
36
|
-
|
|
37
|
-
Keep notes focused on what is true now; if a piece of past context still matters (such as why an approach was ruled out), keep only a brief summary rather than a blow-by-blow log. Crumple notes that are no longer true; a stale note is worse than none.
|
|
38
|
-
|
|
39
|
-
## Finding things again
|
|
40
|
-
|
|
41
|
-
In `notes_list`, omit `glob` for this session and the current shared notebooks. Use `**` for all notebooks or `@sessions/*/**` for all sessions.
|
|
42
|
-
|
|
43
|
-
- **A note**: add `glob` to narrow where `notes_list` looks, and `query` if you remember a phrase. Then use `notes_read` with the address and, for a match, its `offset_chars`.
|
|
44
|
-
- **Something that happened**: `history_list` browses or searches this session's events. Add `context: 1` with a `query` to include neighboring events. Use `history_read` with the seq for the whole event.
|
|
45
|
-
- **An earlier window**: use its seq range from the boot window tree with `history_list`'s exclusive `after` / `before` bounds, or search for a remembered phrase. With `after` you page forward; otherwise you page back from the newest eligible end.
|
|
46
|
-
- **Another session**: pass `session: "<id-or-prefix>"` or `"pi:<id>"`, `"claude:<id>"`, `"codex:<id>"`, `"dsh:<id>"`. An unqualified selector checks this harness first. If ambiguous, use a longer ID or a harness prefix; never pick a candidate blindly.
|
|
47
|
-
- **A phrase across sessions**: `history_list({ session: "*", query: "remembered phrase" })`, or restrict to a harness with `"pi:*"`. A wildcard takes ISO 8601 times only in `after` / `before` and cannot use `history_read`. Hits cover every role unless `roles` narrows them. Results are chronological and have no paging cursors; narrow by time, role, query or session pattern instead. DSH sessions are discoverable only from DSH.
|
|
48
|
-
|
|
49
|
-
- **Recent sessions, no remembered phrase**: `history_list({ session: "*" })` returns one representative event per session, preferring its first visible user prompt, up to `limit` (default 20). Sessions are chosen newest-modified first (oldest-modified first with `after`), then results are sorted chronologically. Empty queries also browse. Role/time filters apply before choosing representatives; with `roles`, the latest matching event represents each session. No paging cursors.
|
|
50
|
-
|
|
51
|
-
Seqs are stable **within a session**. When a hit carries `session`, copy it together with `seq` into `history_read` and save both in your note. The paging/expand/neighborhood recipes already preserve the resolved session. Omit `session` only when you mean your current host session. A single unreadable or unsupported local transcript refuses explicitly; wildcards skip individual sessions that cannot load. An empty result is not proof the remembered event never happened.
|
|
52
|
-
|
|
53
|
-
## Saving recovery state
|
|
54
|
-
|
|
55
|
-
Before a long or risky step, or when room runs low, keep session notes named for what they hold (not `current.md`) and rewrite them to the current state instead of starting new ones or appending a timeline. Record:
|
|
56
|
-
|
|
57
|
-
- the goal and the current step
|
|
58
|
-
- decisions made, and why
|
|
59
|
-
- blockers and the next action
|
|
60
|
-
- how the work was being done, and which skills are still needed
|
|
61
|
-
- where to dig: seqs, note addresses, files
|
|
62
|
-
|
|
63
|
-
`get_context_remaining` reports the room left. `empty_brain` starts a fresh window, so save the note first.
|
|
64
|
-
|
|
65
|
-
## When a tool is missing or refuses
|
|
66
|
-
|
|
67
|
-
A refusal returns `{ error, code }`; read `error` before retrying.
|
|
68
|
-
|
|
69
|
-
If a `notes_*` or `history_*` tool is absent or fails at the host level, do not imitate it: no filesystem tools on `@` addresses, and no reading or editing note storage or session files directly. Use the tools that remain, tell the human which one is missing, and keep essential state in the reply.
|