dsh-supermemory 0.1.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/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Evandro Camargo
4
+
5
+ Portions of this software are derived from the Claude Code `supermemory`
6
+ plugin, Copyright (c) Supermemory (https://github.com/supermemoryai/claude-supermemory),
7
+ also released under the MIT License. See NOTICE.
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,47 @@
1
+ dsh-supermemory
2
+ ===============
3
+
4
+ This package is a native DeepSeek Harness port of the Claude Code `supermemory`
5
+ plugin, version 0.1.6.
6
+
7
+ Upstream project
8
+ ----------------
9
+
10
+ Name: supermemory (Claude Code plugin)
11
+ Source: https://github.com/supermemoryai/claude-supermemory
12
+ Version: 0.1.6
13
+ Copyright: (c) Supermemory <support@supermemory.ai>
14
+ License: MIT
15
+
16
+ Derived material
17
+ ----------------
18
+
19
+ The following files are line-by-line ports of upstream sources and retain the
20
+ upstream behavior, wire format, prompt text, and file layout:
21
+
22
+ src/lib/api.ts <- plugin/hooks/lib/api.js
23
+ src/lib/auth.ts <- plugin/hooks/lib/auth.js
24
+ src/lib/colors.ts <- plugin/hooks/lib/colors.js
25
+ src/lib/container-tag.ts <- plugin/hooks/lib/container-tag.js
26
+ src/lib/error-helpers.ts <- plugin/hooks/lib/error-helpers.js
27
+ src/lib/git-utils.ts <- plugin/hooks/lib/git-utils.js
28
+ src/lib/last-session.ts <- plugin/hooks/lib/last-session.js
29
+ src/lib/project-config.ts <- plugin/hooks/lib/project-config.js
30
+ src/lib/settings.ts <- plugin/hooks/lib/settings.js
31
+ src/lib/statusline-state.ts <- plugin/hooks/lib/statusline-state.js
32
+ src/mcp-proxy.ts <- plugin/hooks/mcp-proxy.js
33
+ src/statusline.ts <- plugin/statusline.js
34
+ src/session-start.ts <- plugin/hooks/session-start.js
35
+ src/recall.ts <- plugin/hooks/recall-directive.js
36
+ src/approve.ts <- plugin/hooks/recall-approve.js
37
+ src/capture.ts <- plugin/hooks/capture.js
38
+ src/transcript.ts <- plugin/hooks/lib/transcript.js
39
+ src/status.ts <- plugin/commands/status.md
40
+ skills/supermemory-context-gatherer/SKILL.md
41
+ <- plugin/agents/context-gatherer.md
42
+ templates/auth-success.html <- plugin/hooks/templates/auth-success.html (verbatim)
43
+ templates/auth-error.html <- plugin/hooks/templates/auth-error.html (verbatim)
44
+
45
+ Supermemory, the Supermemory mark (◪), and the Supermemory brand colors belong
46
+ to Supermemory. This is an independent port and is not an official Supermemory
47
+ release.
package/README.md ADDED
@@ -0,0 +1,226 @@
1
+ # dsh-supermemory
2
+
3
+ Persistent memory across [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) sessions, using [Supermemory](https://supermemory.ai).
4
+
5
+ A native port of the Claude Code `supermemory` plugin v0.1.6 ([supermemoryai/claude-supermemory](https://github.com/supermemoryai/claude-supermemory)). Same memories, same containers, same credentials file, same wire format — so a repository you have been working on in Claude Code arrives in DSH already remembering, and everything DSH captures shows up in Claude Code.
6
+
7
+ ## What it does
8
+
9
+ - **Recalls at session start.** Your project's memory profile is fetched and injected before the first model request.
10
+ - **Recalls on every prompt.** Each substantive prompt searches supermemory and injects the relevance-ranked matches, deduplicated for the life of the session, instead of waiting for the model to spend a tool call.
11
+ - **Captures every turn.** When a turn closes, the new conversation delta is condensed into durable memory under this repository's container.
12
+ - **Runs read-only memory tools without asking.** `search_memory`, `listSpaces`, `whoAmI` and friends never raise an approval prompt; writes still do.
13
+ - **Mounts the hosted MCP server.** The bundled stdio proxy authenticates with the same key, so `mcp__supermemory__*` tools are available with no extra configuration.
14
+
15
+ Everything recalled from supermemory is marked `◪`, and the model is instructed to keep that mark when it cites a memory.
16
+
17
+ ## Install
18
+
19
+ Pick a profile name — `tui`, `web`, or whatever you boot with `dsh --profile <name>`. The examples use `tui`.
20
+
21
+ ### From npm
22
+
23
+ ```sh
24
+ dsh plugin --profile tui add dsh-supermemory
25
+ ```
26
+
27
+ ### From a release tarball
28
+
29
+ ```sh
30
+ curl -fsSLO https://github.com/nmindz/dsh-supermemory/releases/latest/download/dsh-supermemory.tgz
31
+ dsh plugin --profile tui add ./dsh-supermemory.tgz
32
+ ```
33
+
34
+ ### From GitHub
35
+
36
+ A git install builds the package on your machine, and pnpm blocks that until you allow it by exact commit. Run the command once to make pnpm print the key, paste the key into the profile's `pnpm-workspace.yaml`, then run it again:
37
+
38
+ ```sh
39
+ dsh plugin --profile tui add github:nmindz/dsh-supermemory
40
+ # pnpm refuses and prints an allowBuilds key — append it:
41
+ cat >> ~/.dsh/profiles/tui/pnpm-workspace.yaml <<'YAML'
42
+ allowBuilds:
43
+ dsh-supermemory@git+ssh://git@github.com/nmindz/dsh-supermemory.git#<the-sha-pnpm-printed>: true
44
+ YAML
45
+ dsh plugin --profile tui add github:nmindz/dsh-supermemory
46
+ ```
47
+
48
+ That key is permission to run this package's build script on your machine at install time, outside any sandbox. Pin the commit SHA pnpm printed rather than a branch.
49
+
50
+ ### From a clone
51
+
52
+ ```sh
53
+ git clone https://github.com/nmindz/dsh-supermemory.git
54
+ cd dsh-supermemory
55
+ pnpm install && pnpm run build
56
+ dsh plugin --profile tui add "$PWD"
57
+ ```
58
+
59
+ ### After installing
60
+
61
+ Restart the profile:
62
+
63
+ ```sh
64
+ dsh --profile tui
65
+ ```
66
+
67
+ On the first session with no stored key the browser login opens, and the key lands in `~/.supermemory-claude/credentials.json` — the same file the Claude Code plugin uses, so one login covers both. To skip the browser entirely:
68
+
69
+ ```sh
70
+ export SUPERMEMORY_CC_API_KEY=sm_your_key_here
71
+ ```
72
+
73
+ Confirm the plugin composed into your profile:
74
+
75
+ ```sh
76
+ dsh --profile tui --dump-config | grep -A2 'dsh-supermemory'
77
+ # == dsh-supermemory
78
+ # - id: supermemory
79
+ # name: dsh-supermemory
80
+ ```
81
+
82
+ Then, inside a session, check the live connection:
83
+
84
+ ```
85
+ /supermemory-status
86
+ ```
87
+
88
+ Nothing else is required — the bundle contributes its own patch row.
89
+
90
+ ### Uninstall
91
+
92
+ ```sh
93
+ dsh plugin --profile tui remove dsh-supermemory
94
+ ```
95
+
96
+ ## Configuration
97
+
98
+ Override the row in `~/.dsh/profiles/<name>/cordis.patch.yml` (or `~/.dsh/cordis.patch.yml` for every profile). A patch replaces the whole `config` block, so restate every key you want:
99
+
100
+ ```yaml
101
+ - id: supermemory
102
+ config:
103
+ injectProfile: true
104
+ recall: true
105
+ capture: true
106
+ autoApprove: true
107
+ browserLogin: true
108
+ mcp: true
109
+ mcpServerName: supermemory
110
+ command: true
111
+ contextGatherer: true
112
+ includeSubagents: false
113
+ ```
114
+
115
+ | Key | Default | Meaning |
116
+ |---|---|---|
117
+ | `injectProfile` | `true` | Inject this project's memory profile at session start |
118
+ | `recall` | `true` | Search supermemory with each prompt and inject the matches |
119
+ | `capture` | `true` | Save each turn's delta back to supermemory |
120
+ | `autoApprove` | `true` | Run read-only supermemory MCP tools without an approval prompt |
121
+ | `browserLogin` | `true` | Open the browser login when no API key is configured |
122
+ | `mcp` | `true` | Mount the hosted supermemory MCP server through the bundled proxy |
123
+ | `mcpServerName` | `supermemory` | MCP namespace; tools surface as `mcp__<name>__<tool>` |
124
+ | `command` | `true` | Register `/supermemory-status` |
125
+ | `contextGatherer` | `true` | Register the `supermemory-context-gatherer` skill |
126
+ | `includeSubagents` | `false` | Recall into and capture from delegated subagent sessions too |
127
+
128
+ ### Environment and files
129
+
130
+ | Where | What |
131
+ |---|---|
132
+ | `SUPERMEMORY_CC_API_KEY` | API key; wins over every stored credential |
133
+ | `SUPERMEMORY_API_URL` | API base URL (default `https://api.supermemory.ai`) |
134
+ | `SUPERMEMORY_MCP_URL` | MCP endpoint (default `https://mcp.supermemory.ai/mcp`) |
135
+ | `SUPERMEMORY_AUTH_URL` | Login page used by the browser flow |
136
+ | `SUPERMEMORY_REPO_TAG` | Force one memory container tag |
137
+ | `SUPERMEMORY_ISOLATE_WORKTREES` | `true` gives each linked git worktree its own container |
138
+ | `SUPERMEMORY_DEBUG` | `true` logs every decision with timestamps |
139
+ | `~/.supermemory-claude/credentials.json` | Stored API key (shared with the Claude Code plugin) |
140
+ | `~/.supermemory-claude/settings.json` | User settings: `maxProfileItems`, `includeTools`, `recallDirective`, `signalExtraction`, `signalKeywords`, `signalTurnsBefore`, `debug` |
141
+ | `<repo>/.claude/.supermemory-claude/config.json` | Per-project overrides: `apiKey`, `baseUrl`, `repoContainerTag`, `includeTools`, signal and recall keys |
142
+ | `~/.supermemory-claude/statusline/` | Per-session status state, pruned after 7 days |
143
+ | `~/.supermemory-claude/trackers/` | Per-session capture cursor |
144
+
145
+ ## Memory containers
146
+
147
+ A container tag is derived from the git remote, normalized so `git@github.com:acme/Widgets.git` and `https://github.com/ACME/widgets/` resolve to one identity: `repo_<name>__<16 hex>`. Linked worktrees share the main checkout's container unless `SUPERMEMORY_ISOLATE_WORKTREES=true`. A repository with no remote falls back to its resolved path. `repoContainerTag` in the project config wins over everything, which is how a team shares one container.
148
+
149
+ The derivation is byte-identical to the Claude Code plugin's, so both tools read and write the same container for the same repository.
150
+
151
+ ## Status
152
+
153
+ ```
154
+ /supermemory-status
155
+ ```
156
+
157
+ Reports the active project and container tag, whether a key is present and where it came from (never more than the first 6 and last 4 characters), and — because a stored key proves nothing — the result of a live `POST /v4/profile` probe, interpreted loudly: `401`/`403` means reachable but revoked, which is the silent-failure case the probe exists to catch. It also counts the registered `mcp__supermemory__*` tools.
158
+
159
+ ## Deeper history
160
+
161
+ The `supermemory-context-gatherer` skill fans several searches out across the project's containers and returns a synthesized brief with provenance. Use it when starting significant work, resuming after time away, or when one memory search cannot cover the history the conversation needs.
162
+
163
+ ## How the Claude Code plugin maps onto DSH
164
+
165
+ DSH has no command-hook runner, no markdown command loader, and no markdown agent loader. Each Claude Code hook becomes a typed listener on the equivalent DSH extension point:
166
+
167
+ | Claude Code | DSH |
168
+ |---|---|
169
+ | `SessionStart` hook | `agent/session-start` listener, delivered through the first `agent/pre-step` |
170
+ | `UserPromptSubmit` hook | `agent/pre-step` waterfall, folded onto the `enter` decision |
171
+ | `PreToolUse` hook (`mcp__.*supermemory.*`) | `tools/pre-execute` waterfall, registered `prepend: true`, returning `{ kind: 'allow' }` |
172
+ | `Stop` hook (async) | `agent/turn-stopping` serial listener, awaited before the turn commits |
173
+ | `.mcp.json` server | `@deepseek-ai/dsh-mcp-client` mounted as a child plugin |
174
+ | `commands/status.md` | `ctx.commands.register('supermemory-status')` |
175
+ | `agents/context-gatherer.md` | `ctx.skills.register('supermemory-context-gatherer')` |
176
+
177
+ DSH dispatches those points to every agent, including delegated subagents, while Claude Code's hooks only ever see the main session. Delegated sessions are therefore filtered out by default; set `includeSubagents: true` to let subagent work recall and capture too.
178
+
179
+ Two further differences are worth stating plainly:
180
+
181
+ **Session-start delivery is stronger here.** `agent/session-start` is an emit point that DSH never awaits, so an async memory fetch started there can miss the first request — the same gap the Claude Code hooks bridge documents. This plugin parks the fetch and the first `agent/pre-step`, which *is* awaited, folds it in. The first request always carries the project's memory.
182
+
183
+ **There is no status line to install.** Claude Code's plugin writes a `statusLine` entry into `~/.claude/settings.json`; DSH's status line is host-owned and takes no plugin command. The per-session state files are written exactly as before and the animated renderer ships as an entry point, so any status bar that can run a command renders the identical line:
184
+
185
+ ```sh
186
+ echo '{"session_id":"<id>"}' | node -e "import('dsh-supermemory/statusline')"
187
+ ```
188
+
189
+ Live one-line notices ("3 memories loaded for widgets", "recalled 2 memories") go to the logger, because DSH exposes no transient user-message channel equivalent to a hook `systemMessage`.
190
+
191
+ ## Development
192
+
193
+ ```sh
194
+ pnpm install
195
+ pnpm run check # typecheck + tests + build
196
+ ```
197
+
198
+ Requires Node `^22.19.0 || >=24.0.0`.
199
+
200
+ ## Releasing
201
+
202
+ Publishing runs from GitHub Actions through npm **trusted publishing (OIDC)** — no `NPM_TOKEN` secret exists, and every release carries provenance.
203
+
204
+ One-time setup on npm: open <https://www.npmjs.com/package/dsh-supermemory/access>, add a trusted publisher, choose GitHub Actions, and enter organization `nmindz`, repository `dsh-supermemory`, workflow `.github/workflows/release.yml`, environment `npm`.
205
+
206
+ Then each release is a version bump and a tag:
207
+
208
+ ```sh
209
+ npm version 0.1.1 --no-git-tag-version # edits package.json only
210
+ git commit -am 'Release v0.1.1'
211
+ git tag v0.1.1
212
+ git push origin master --tags
213
+ ```
214
+
215
+ The workflow refuses to publish when the tag and `package.json` version disagree, and runs `pnpm run check` before it publishes.
216
+
217
+ To publish by hand instead (requires `npm login` or a configured token):
218
+
219
+ ```sh
220
+ pnpm run check
221
+ npm publish --access public
222
+ ```
223
+
224
+ ## License
225
+
226
+ MIT. Derived from the MIT-licensed Claude Code `supermemory` plugin — see [NOTICE](NOTICE) for the file-by-file attribution. Supermemory, the `◪` mark, and the Supermemory brand belong to Supermemory; this is an independent port, not an official release.
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: supermemory
3
+ name: 'dsh-supermemory'
@@ -0,0 +1,200 @@
1
+ import z from "@deepseek-ai/schemastery";
2
+ import { UserMessage } from "@deepseek-ai/dsh-llm";
3
+ import { Context } from "@deepseek-ai/cordis";
4
+ import { Agent } from "@deepseek-ai/dsh-agent";
5
+ //#region src/config.d.ts
6
+ /**
7
+ * Every behavior the Claude Code plugin wires through `hooks.json` is on by
8
+ * default here too; the flags exist so a deployment can drop one without
9
+ * forking the package.
10
+ */
11
+ interface PluginConfig {
12
+ /** Inject this project's memory profile at session start. */
13
+ injectProfile?: boolean;
14
+ /** Search supermemory with each prompt and inject the top matches. */
15
+ recall?: boolean;
16
+ /** Save each turn's delta back to supermemory. */
17
+ capture?: boolean;
18
+ /** Run read-only supermemory MCP tools without an approval prompt. */
19
+ autoApprove?: boolean;
20
+ /** Open the browser login when no API key is configured. */
21
+ browserLogin?: boolean;
22
+ /** Mount the hosted supermemory MCP server through the bundled stdio proxy. */
23
+ mcp?: boolean;
24
+ /** MCP namespace; tools surface as `mcp__<mcpServerName>__<tool>`. */
25
+ mcpServerName?: string;
26
+ /** Register the `/supermemory-status` command. */
27
+ command?: boolean;
28
+ /** Register the bundled `supermemory-context-gatherer` skill. */
29
+ contextGatherer?: boolean;
30
+ /**
31
+ * Recall into and capture from delegated subagent sessions too. Off by
32
+ * default, because Claude Code's hooks only ever see the main session.
33
+ */
34
+ includeSubagents?: boolean;
35
+ }
36
+ declare const PluginConfig: z<PluginConfig>;
37
+ //#endregion
38
+ //#region src/runtime.d.ts
39
+ /** The `{kind:'plugin'}` source stamped on every context this plugin injects. */
40
+ declare const PLUGIN_SOURCE: {
41
+ readonly kind: "plugin";
42
+ readonly plugin: "supermemory";
43
+ };
44
+ /**
45
+ * Shared per-process state for the plugin's four behaviors.
46
+ *
47
+ * `bootstraps` holds the session-start memory fetch. `agent/session-start` is
48
+ * an emit point that is never awaited, so the fetch is parked here and the
49
+ * first `agent/pre-step` — a waterfall that IS awaited — folds the result into
50
+ * that step's messages. Claude Code's detached SessionStart hook can miss the
51
+ * first request; this cannot.
52
+ */
53
+ interface SupermemoryRuntime {
54
+ readonly ctx: Context;
55
+ readonly bootstraps: Map<string, Promise<string | null>>;
56
+ readonly delivered: Set<string>;
57
+ /**
58
+ * User-facing one-liner. Claude Code renders these as hook `systemMessage`s;
59
+ * DSH exposes no equivalent transient channel, so they go to the logger and
60
+ * the statusline state files carry the same numbers.
61
+ */
62
+ notify(text: string): void;
63
+ warn(text: string): void;
64
+ }
65
+ declare function createRuntime(ctx: Context): SupermemoryRuntime;
66
+ /** The session workspace an agent runs in, matching every other DSH plugin. */
67
+ declare function cwdOf(agent: Agent | undefined): string;
68
+ declare function sessionIdOf(agent: Agent | undefined): string;
69
+ /**
70
+ * Claude Code fires SessionStart, UserPromptSubmit, and Stop for the main
71
+ * session only — a Task subagent gets SubagentStart/SubagentStop, which this
72
+ * plugin does not hook. DSH dispatches the same extension points to every
73
+ * agent, so delegated sessions are filtered out to keep the behavior identical.
74
+ */
75
+ declare function isSubagent(agent: Agent | undefined): boolean;
76
+ //#endregion
77
+ //#region src/transcript.d.ts
78
+ /** Structural view of the content blocks this module reads. */
79
+ type TranscriptBlock = {
80
+ type: 'text';
81
+ text?: string;
82
+ } | {
83
+ type: 'tool-call';
84
+ id?: string;
85
+ name?: string;
86
+ arguments?: string;
87
+ } | {
88
+ type: 'tool-result';
89
+ toolCallId?: string;
90
+ content?: TranscriptBlock[];
91
+ isError?: boolean;
92
+ } | {
93
+ type: string;
94
+ [key: string]: unknown;
95
+ };
96
+ /** A Claude-Code-shaped conversation entry derived from one session event. */
97
+ interface TranscriptEntry {
98
+ type: 'user' | 'assistant';
99
+ seq: number;
100
+ timestamp: string;
101
+ content: TranscriptBlock[];
102
+ }
103
+ /** Structural view of the session-log events this module consumes. */
104
+ interface TranscriptEvent {
105
+ type: string;
106
+ seq: number;
107
+ time?: number;
108
+ data?: unknown;
109
+ }
110
+ /** Structural view of the session this module reads its delta from. */
111
+ interface TranscriptSession {
112
+ snapshotEvents(fromSeq?: number, toSeqExclusive?: number): readonly TranscriptEvent[];
113
+ }
114
+ interface TranscriptDelta {
115
+ formatted: string;
116
+ lastSeq: number;
117
+ }
118
+ /** The last captured sequence number for a session, or null before the first capture. */
119
+ declare function getLastCapturedSeq(sessionId: string): number | null;
120
+ declare function setLastCapturedSeq(sessionId: string, seq: number): void;
121
+ /**
122
+ * Project session-log events onto the user/assistant entry list the Claude
123
+ * Code formatter expects. A `tool/result` event becomes a user entry carrying
124
+ * one tool-result block, exactly where Claude Code's transcript puts it.
125
+ */
126
+ declare function entriesFromEvents(events: readonly TranscriptEvent[]): TranscriptEntry[];
127
+ declare function formatEntry(entry: TranscriptEntry): string;
128
+ declare function formatToolInputCompact(rawArguments: string | undefined): string;
129
+ declare function cleanContent(text: unknown): string;
130
+ declare function truncate(text: string | undefined, maxLength: number): string | undefined;
131
+ declare function getTextFromEntry(entry: TranscriptEntry): string;
132
+ interface TranscriptTurn {
133
+ userEntries: TranscriptEntry[];
134
+ assistantEntries: TranscriptEntry[];
135
+ allEntries: TranscriptEntry[];
136
+ }
137
+ declare function groupEntriesIntoTurns(entries: TranscriptEntry[]): TranscriptTurn[];
138
+ declare function findSignalTurnIndices(turns: TranscriptTurn[], keywords: string[]): number[];
139
+ declare function getTurnsAroundSignals(turns: TranscriptTurn[], signalIndices: number[], turnCount: number): TranscriptTurn[];
140
+ /** Signal-extraction mode: only the turns around keyword-bearing prompts. */
141
+ declare function formatSignalEntries(session: TranscriptSession, sessionId: string, cwd: string): TranscriptDelta | null;
142
+ /** Default mode: every new user and assistant entry since the last capture. */
143
+ declare function formatNewEntries(session: TranscriptSession, sessionId: string, cwd: string): TranscriptDelta | null;
144
+ //#endregion
145
+ //#region src/lib/api.d.ts
146
+ interface ProfileResult {
147
+ profile?: {
148
+ static?: string[];
149
+ dynamic?: string[];
150
+ };
151
+ searchResults?: {
152
+ results?: SearchHit[];
153
+ };
154
+ }
155
+ interface SearchHit {
156
+ memory?: string;
157
+ chunk?: string;
158
+ content?: string;
159
+ text?: string;
160
+ title?: string;
161
+ filepath?: string;
162
+ similarity?: number;
163
+ }
164
+ //#endregion
165
+ //#region src/session-start.d.ts
166
+ declare function formatContext(profileResult: ProfileResult | null, maxItems: number, containerTag: string, projectName: string): string | null;
167
+ //#endregion
168
+ //#region src/recall.d.ts
169
+ declare function shouldSkip(prompt: string): boolean;
170
+ declare function resultText(r: SearchHit | undefined): string | null;
171
+ declare function hashText(text: string): string;
172
+ declare function formatRecall(results: SearchHit[], containerTag: string): string;
173
+ /** Flatten the direct human prompt out of the messages claimed for this step. */
174
+ declare function promptFrom(messages: readonly UserMessage[]): string;
175
+ //#endregion
176
+ //#region src/approve.d.ts
177
+ /** The read-only tool name behind a supermemory MCP call, or null. */
178
+ declare function readOnlyToolOf(toolName: string, serverName: string): string | null;
179
+ //#endregion
180
+ //#region src/status.d.ts
181
+ /** Never print a full key: at most the first 6 and last 4 characters. */
182
+ declare function maskKey(key: string): string;
183
+ //#endregion
184
+ //#region src/context-gatherer.d.ts
185
+ /**
186
+ * The skill ships at the package root; the built bundle sits one level down
187
+ * and the sources one as well, so both candidates are probed.
188
+ */
189
+ declare function resolveSkillDir(): string;
190
+ /** Strip the YAML frontmatter block a filesystem skill provider would parse. */
191
+ declare function splitFrontmatter(source: string): {
192
+ data: Record<string, string>;
193
+ body: string;
194
+ };
195
+ //#endregion
196
+ //#region src/index.d.ts
197
+ declare const name = "supermemory";
198
+ declare function apply(ctx: Context, config: PluginConfig): void;
199
+ //#endregion
200
+ export { PluginConfig as Config, PluginConfig, PLUGIN_SOURCE, SupermemoryRuntime, TranscriptBlock, TranscriptDelta, TranscriptEntry, TranscriptEvent, TranscriptSession, TranscriptTurn, apply, cleanContent, createRuntime, cwdOf, entriesFromEvents, findSignalTurnIndices, formatContext, formatEntry, formatNewEntries, formatRecall, formatSignalEntries, formatToolInputCompact, getLastCapturedSeq, getTextFromEntry, getTurnsAroundSignals, groupEntriesIntoTurns, hashText, isSubagent, maskKey, name, promptFrom, readOnlyToolOf, resolveSkillDir, resultText, sessionIdOf, setLastCapturedSeq, shouldSkip, splitFrontmatter, truncate };