notesoup 0.50.0 → 0.51.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.
- package/README.md +12 -1
- package/dist/{src/claude → plugins/claude/src}/helper.js +7 -7
- package/dist/{src/claude → plugins/claude/src}/history.d.ts +1 -1
- package/dist/{src/claude → plugins/claude/src}/history.js +1 -1
- package/dist/plugins/claude/src/text.d.ts +6 -0
- package/dist/plugins/claude/src/text.js +7 -0
- package/dist/{src/claude → plugins/claude/src}/thresholds.js +3 -3
- package/dist/{src → plugins}/dsh/budget.js +1 -1
- package/dist/{src → plugins}/dsh/engine.d.ts +1 -1
- package/dist/{src → plugins}/dsh/engine.js +1 -1
- package/dist/{src → plugins}/dsh/history.d.ts +1 -1
- package/dist/{src → plugins}/dsh/history.js +1 -1
- package/dist/{src → plugins}/dsh/index.js +1 -1
- package/dist/{src → plugins}/dsh/tools.js +3 -3
- package/dist/{src → plugins}/dsh/window.d.ts +1 -1
- package/dist/{src → plugins}/dsh/window.js +5 -5
- package/dist/{src → plugins}/pi/boot.d.ts +1 -1
- package/dist/{src → plugins}/pi/boot.js +5 -4
- package/dist/{src → plugins}/pi/budget.js +4 -4
- package/dist/{src → plugins}/pi/dream/cli.d.ts +1 -1
- package/dist/{src → plugins}/pi/dream/cli.js +6 -6
- package/dist/{src → plugins}/pi/dream/runner.d.ts +1 -1
- package/dist/{src → plugins}/pi/dream/runner.js +3 -3
- package/dist/{src → plugins}/pi/dream/settings.d.ts +1 -1
- package/dist/{src → plugins}/pi/dream/settings.js +2 -2
- package/dist/{src → plugins}/pi/history-tools.js +1 -1
- package/dist/{src → plugins}/pi/history.d.ts +1 -1
- package/dist/{src → plugins}/pi/history.js +1 -1
- package/dist/plugins/pi/index.d.ts +1 -0
- package/dist/plugins/pi/index.js +1 -0
- package/dist/{src → plugins}/pi/notes/adapter.d.ts +1 -1
- package/dist/{src → plugins}/pi/notes/adapter.js +1 -1
- package/dist/{src → plugins}/pi/notes/tools.js +1 -1
- package/dist/{src → plugins}/pi/reset/artifacts.d.ts +1 -1
- package/dist/{src → plugins}/pi/reset/artifacts.js +1 -1
- package/dist/{src → plugins}/pi/reset/lifecycle.d.ts +1 -1
- package/dist/{src → plugins}/pi/reset/lifecycle.js +1 -1
- package/dist/{src → plugins}/pi/runtime.js +2 -2
- package/dist/plugins/pi/text.d.ts +23 -0
- package/dist/plugins/pi/text.js +30 -0
- package/dist/{src → plugins}/pi/thresholds.d.ts +1 -1
- package/dist/{src → plugins}/pi/thresholds.js +4 -4
- package/dist/{src → plugins}/pi/tool-result.d.ts +1 -1
- package/dist/{src → plugins}/pi/tool-result.js +1 -1
- package/dist/{src → plugins}/pi/window.d.ts +1 -1
- package/dist/src/boot/text.d.ts +4 -13
- package/dist/src/boot/text.js +1 -11
- package/dist/src/budget/policy.d.ts +2 -3
- package/dist/src/budget/policy.js +1 -1
- package/dist/src/budget/text.d.ts +1 -12
- package/dist/src/budget/text.js +2 -24
- package/dist/src/dream/settings.d.ts +1 -2
- package/dist/src/dream/settings.js +4 -2
- package/dist/src/index.d.ts +29 -1
- package/dist/src/index.js +26 -1
- package/dist/src/notes/address.d.ts +5 -4
- package/dist/src/notes/address.js +13 -7
- package/dist/src/notes/identity.js +3 -7
- package/dist/src/notes/paths.d.ts +4 -2
- package/dist/src/notes/paths.js +11 -6
- package/dist/src/notes/store.d.ts +4 -1
- package/dist/src/notes/store.js +66 -34
- package/dist/src/settings.d.ts +7 -16
- package/dist/src/settings.js +7 -10
- package/dist/src/tools/notes.d.ts +5 -5
- package/dist/src/tools/notes.js +5 -4
- package/dist/test/agent-loop.test.js +5 -4
- package/dist/test/boot.integration.test.js +5 -5
- package/dist/test/budget-settings.integration.test.js +1 -1
- package/dist/test/claude-history.test.js +2 -2
- package/dist/test/claude-mod.test.js +12 -11
- package/dist/test/claude-validation.test.js +3 -3
- package/dist/test/dependencies.test.js +52 -44
- package/dist/test/doctor.test.js +1 -1
- package/dist/test/dream-skill.test.js +4 -4
- package/dist/test/dream.test.js +2 -2
- package/dist/test/dsh-cli.test.js +2 -2
- package/dist/test/dsh-compaction-parity.test.js +1 -1
- package/dist/test/dsh.test.js +4 -4
- package/dist/test/helpers/dependency-graph.js +9 -7
- package/dist/test/helpers/dsh.d.ts +1 -1
- package/dist/test/helpers/dsh.js +2 -2
- package/dist/test/helpers/extension.js +6 -5
- package/dist/test/helpers/notes.js +1 -1
- package/dist/test/model-facing-text.test.js +4 -2
- package/dist/test/notes-query-homes.test.d.ts +1 -0
- package/dist/test/notes-query-homes.test.js +161 -0
- package/dist/test/notes.integration.test.js +3 -2
- package/dist/test/notes.test.js +1 -1
- package/dist/test/reset-lifecycle.test.js +8 -7
- package/docs/architecture.md +21 -18
- package/docs/claude-code-mod.md +3 -3
- package/docs/dsh.md +1 -1
- package/docs/dsh.profile.patch.yml +1 -1
- package/docs/notes-library.md +17 -10
- package/docs/reset-lifecycle.md +1 -1
- package/package.json +13 -13
- package/{mods/notesoup → plugins/claude}/.claude-plugin/plugin.json +1 -1
- package/{mods/notesoup → plugins/claude}/dist/claude/helper.js +80 -55
- package/{mods/notesoup → plugins/claude}/skills/memory/SKILL.md +3 -0
- package/{src/claude → plugins/claude/src}/helper.ts +10 -9
- package/{src/claude → plugins/claude/src}/history.ts +1 -1
- package/plugins/claude/src/text.ts +10 -0
- package/{src/claude → plugins/claude/src}/thresholds.ts +3 -3
- package/{src → plugins}/dsh/budget.ts +1 -1
- package/{src → plugins}/dsh/engine.ts +1 -1
- package/{src → plugins}/dsh/history.ts +1 -1
- package/{src → plugins}/dsh/index.ts +1 -1
- package/{src → plugins}/dsh/tools.ts +3 -3
- package/{src → plugins}/dsh/window.ts +5 -5
- package/{src → plugins}/pi/boot.ts +5 -4
- package/{src → plugins}/pi/budget.ts +4 -4
- package/{src → plugins}/pi/dream/cli.ts +8 -8
- package/{src → plugins}/pi/dream/runner.ts +4 -4
- package/{src → plugins}/pi/dream/settings.ts +2 -2
- package/{src → plugins}/pi/history-tools.ts +1 -1
- package/{src → plugins}/pi/history.ts +1 -1
- package/plugins/pi/index.ts +1 -0
- package/{src → plugins}/pi/notes/adapter.ts +1 -1
- package/{src → plugins}/pi/notes/tools.ts +2 -2
- package/{src → plugins}/pi/reset/artifacts.ts +1 -1
- package/{src → plugins}/pi/reset/lifecycle.ts +2 -2
- package/{src → plugins}/pi/runtime.ts +2 -2
- package/plugins/pi/text.ts +35 -0
- package/{src → plugins}/pi/thresholds.ts +4 -4
- package/{src → plugins}/pi/tool-result.ts +1 -1
- package/{src → plugins}/pi/window.ts +1 -1
- package/skills/memory/SKILL.md +3 -0
- package/src/boot/text.ts +5 -15
- package/src/budget/policy.ts +3 -3
- package/src/budget/text.ts +2 -30
- package/src/dream/settings.ts +6 -3
- package/src/index.ts +52 -1
- package/src/notes/address.ts +12 -8
- package/src/notes/identity.ts +2 -8
- package/src/notes/paths.ts +12 -6
- package/src/notes/store.ts +62 -29
- package/src/settings.ts +8 -24
- package/src/tools/notes.ts +5 -4
- package/docs/sdk-integration.md +0 -39
- /package/dist/{src/claude → plugins/claude/src}/helper.d.ts +0 -0
- /package/dist/{src/claude → plugins/claude/src}/thresholds.d.ts +0 -0
- /package/dist/{src → plugins}/dsh/budget.d.ts +0 -0
- /package/dist/{src → plugins}/dsh/index.d.ts +0 -0
- /package/dist/{src → plugins}/dsh/tools.d.ts +0 -0
- /package/dist/{src → plugins}/pi/anchored.d.ts +0 -0
- /package/dist/{src → plugins}/pi/anchored.js +0 -0
- /package/dist/{src → plugins}/pi/budget.d.ts +0 -0
- /package/dist/{src → plugins}/pi/entries.d.ts +0 -0
- /package/dist/{src → plugins}/pi/entries.js +0 -0
- /package/dist/{src → plugins}/pi/estimate.d.ts +0 -0
- /package/dist/{src → plugins}/pi/estimate.js +0 -0
- /package/dist/{src → plugins}/pi/extension.d.ts +0 -0
- /package/dist/{src → plugins}/pi/extension.js +0 -0
- /package/dist/{src → plugins}/pi/history-tools.d.ts +0 -0
- /package/dist/{src → plugins}/pi/notes/tools.d.ts +0 -0
- /package/dist/{src → plugins}/pi/reset/committed.d.ts +0 -0
- /package/dist/{src → plugins}/pi/reset/committed.js +0 -0
- /package/dist/{src → plugins}/pi/runtime.d.ts +0 -0
- /package/dist/{src → plugins}/pi/session-reader.d.ts +0 -0
- /package/dist/{src → plugins}/pi/session-reader.js +0 -0
- /package/dist/{src → plugins}/pi/window.js +0 -0
- /package/{mods/notesoup → plugins/claude}/hooks/hooks.json +0 -0
- /package/{mods/notesoup → plugins/claude}/hooks/register.ts +0 -0
- /package/{mods/notesoup → plugins/claude}/playbook.md +0 -0
- /package/{mods/notesoup → plugins/claude}/skills/dream/SKILL.md +0 -0
- /package/{src → plugins}/pi/anchored.ts +0 -0
- /package/{src → plugins}/pi/entries.ts +0 -0
- /package/{src → plugins}/pi/estimate.ts +0 -0
- /package/{src → plugins}/pi/extension.ts +0 -0
- /package/{src → plugins}/pi/reset/committed.ts +0 -0
- /package/{src → plugins}/pi/session-reader.ts +0 -0
package/src/settings.ts
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
+
/** The one settings key every host reads its own fields from. */
|
|
1
2
|
export const NOTESOUP_SETTINGS_KEY = "notesoup";
|
|
2
|
-
/** Nested under "notesoup": the default dreamer model pattern, overridden by CLI --dreamer. */
|
|
3
|
-
export const NOTESOUP_DREAMER_KEY = "dreamer";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The one notesoup settings shape both hosts read. `reminderMarginTokens` is Pi's early
|
|
7
|
-
* reminder margin; `resetMarginTokens` and `warningRunwayTokens` are the Claude mod's
|
|
8
|
-
* margins against Claude's own auto-compact point (see src/claude/thresholds.ts). A host
|
|
9
|
-
* ignores the keys it does not use; every value is validated where it is consumed.
|
|
10
|
-
*/
|
|
11
|
-
export type NotesoupSettings = {
|
|
12
|
-
reminderMarginTokens?: unknown;
|
|
13
|
-
resetMarginTokens?: unknown;
|
|
14
|
-
warningRunwayTokens?: unknown;
|
|
15
|
-
dreamer?: unknown;
|
|
16
|
-
};
|
|
17
3
|
|
|
18
4
|
/** A plain settings object; arrays and null are not one. */
|
|
19
5
|
export function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
@@ -27,13 +13,11 @@ function notesoupSettings(settings: unknown): Record<string, unknown> {
|
|
|
27
13
|
return isPlainObject(value) ? value : {};
|
|
28
14
|
}
|
|
29
15
|
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
dreamer: merged.dreamer,
|
|
38
|
-
};
|
|
16
|
+
/**
|
|
17
|
+
* Merge the global and project "notesoup" objects per key; project wins, mirroring Pi's deep
|
|
18
|
+
* merge. The record is exactly what the scopes contain: this core module owns the key and the
|
|
19
|
+
* merge, while each host names, reads and validates the fields it consumes.
|
|
20
|
+
*/
|
|
21
|
+
export function mergeNotesoupSettings(globalSettings: unknown, projectSettings: unknown): Record<string, unknown> {
|
|
22
|
+
return { ...notesoupSettings(globalSettings), ...notesoupSettings(projectSettings) };
|
|
39
23
|
}
|
package/src/tools/notes.ts
CHANGED
|
@@ -14,8 +14,9 @@ const ORIGIN = Type.Optional(Type.Union([...ORIGIN_VALUES], {
|
|
|
14
14
|
const CRUMPLED_PARAMETER = Type.Optional(Type.Boolean({ description: "(optional) true = crumple (hide from list and search, still readable); false = restore." }));
|
|
15
15
|
const CRUMPLED_LIST_PARAMETER = Type.Optional(Type.Boolean({ description: "(optional) true = list only crumpled notes." }));
|
|
16
16
|
const FILE_LIMIT_PARAMETER = Type.Optional(Type.Integer({ minimum: 1, description: "(optional, default as many as fit) Max notes." }));
|
|
17
|
-
const GLOB_PARAMETER = nullableString("(optional) Glob over full addresses.");
|
|
18
|
-
const
|
|
17
|
+
const GLOB_PARAMETER = nullableString("(optional) Glob over full addresses, or @default for the current homes.");
|
|
18
|
+
const QUERY_HOMES_DESCRIPTION = "Omit `glob` or use `@default` for this session and current shared homes; `**` searches all homes, `@sessions/*/**` searches all sessions.";
|
|
19
|
+
const ADDRESS_DESCRIPTION = "Addresses: a bare path is this session's note; `@project/`, `@human/`, `@self/`, `@model/` are durable homes; `@projects/<name>/<path>` and `@sessions/<id>/<path>` read named project and session notes (read-only). Not file paths: never pass them to file tools.";
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Typed refusal. Every fact a caller needs is already in the message; there is no separate context.
|
|
@@ -311,7 +312,7 @@ function renderListData(data: NotesListData): string {
|
|
|
311
312
|
|
|
312
313
|
export const notesList = {
|
|
313
314
|
name: "notes_list", label: "Notes list",
|
|
314
|
-
description: `List notes
|
|
315
|
+
description: `List notes, newest first. Not pageable; \`more\` counts the rest. ${QUERY_HOMES_DESCRIPTION} ${ADDRESS_DESCRIPTION}`,
|
|
315
316
|
parameters: notesListParameters, outputSchema: resultSchema(NotesListDataSchema),
|
|
316
317
|
async execute(params: Static<typeof notesListParameters>, identity: NotesIdentity): Promise<Outcome<NotesListData>> {
|
|
317
318
|
try {
|
|
@@ -358,7 +359,7 @@ function fitSearchFile(file: SearchFile, fits: (candidate: SearchFile) => boolea
|
|
|
358
359
|
|
|
359
360
|
export const notesSearch = {
|
|
360
361
|
name: "notes_search", label: "Notes search",
|
|
361
|
-
description: `Search note bodies for literal text, case-insensitive. Without a query, lists notes with no match lines. Returns matching lines with offsets for \`notes_read\`. Not pageable; \`more\` counts the rest. ${ADDRESS_DESCRIPTION}`,
|
|
362
|
+
description: `Search note bodies for literal text, case-insensitive. Without a query, lists notes with no match lines. Returns matching lines with offsets for \`notes_read\`. Not pageable; \`more\` counts the rest. ${QUERY_HOMES_DESCRIPTION} ${ADDRESS_DESCRIPTION}`,
|
|
362
363
|
parameters: notesSearchParameters, outputSchema: resultSchema(NotesSearchDataSchema),
|
|
363
364
|
async execute(params: Static<typeof notesSearchParameters>, identity: NotesIdentity): Promise<Outcome<NotesSearchData>> {
|
|
364
365
|
try {
|
package/docs/sdk-integration.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# SDK integration
|
|
2
|
-
|
|
3
|
-
SDK hosts that create a session directly can bind notesoup to the exact same public `SettingsManager` authority as the session:
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
import {
|
|
7
|
-
createAgentSession,
|
|
8
|
-
DefaultResourceLoader,
|
|
9
|
-
SettingsManager,
|
|
10
|
-
} from "@earendil-works/pi-coding-agent";
|
|
11
|
-
import { createNotesoup } from "notesoup";
|
|
12
|
-
|
|
13
|
-
const cwd = process.cwd();
|
|
14
|
-
const agentDir = "/tmp/my-pi-agent";
|
|
15
|
-
const settingsManager = SettingsManager.inMemory({
|
|
16
|
-
compaction: { enabled: true, reserveTokens: 16_384 },
|
|
17
|
-
});
|
|
18
|
-
const resourceLoader = new DefaultResourceLoader({
|
|
19
|
-
cwd,
|
|
20
|
-
agentDir,
|
|
21
|
-
settingsManager,
|
|
22
|
-
noExtensions: true,
|
|
23
|
-
extensionFactories: [createNotesoup({ settingsManager })],
|
|
24
|
-
});
|
|
25
|
-
await resourceLoader.reload();
|
|
26
|
-
|
|
27
|
-
const { session } = await createAgentSession({
|
|
28
|
-
cwd,
|
|
29
|
-
agentDir,
|
|
30
|
-
settingsManager,
|
|
31
|
-
resourceLoader,
|
|
32
|
-
});
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
The root entry exports only the default Pi extension and `createNotesoup`. This is a breaking source/API refactor: `NotesContext` is replaced by `NotesIdentity`; old internal export bags, root history helpers and the `./dist/src/index.js` export alias are removed. Import the root for Pi integration and `/notes` for the standalone library. The configured dream executable is now `dist/src/pi/dream/cli.js`. Stored notes, session paths, metadata and raw histories are unchanged; no migration runs.
|
|
36
|
-
|
|
37
|
-
The manager must be shared by the resource loader's factory and `createAgentSession`. If the host replaces its settings authority, it must create and bind a new `createNotesoup({ settingsManager })` factory together with the replacement manager; an existing factory remains bound to the manager it was created with.
|
|
38
|
-
|
|
39
|
-
The default extension export is file-backed: it reads Pi's standard global settings directory plus the trusted project's `.pi/settings.json`, with project values winning per key. It cannot discover an arbitrary SDK session manager from `cwd`, environment variables, session IDs, or private SDK fields. For an injected manager, compaction settings come from the manager's public `getCompactionSettings(model)` getter, including the active model's `modelOverrides`; notesoup margins are read from the public `getGlobalSettings()` and `getProjectSettings()` scopes. Opaque runtime overrides that those public scope getters do not expose are intentionally not treated as notesoup configuration. Live public manager changes apply on the next policy query/turn, and the extension does not drain the manager's settings I/O diagnostics.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|