@the-librarian/pi-extension 1.49.0 → 1.50.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/README.md
CHANGED
|
@@ -42,7 +42,7 @@ Librarian primer into the system prompt. One install, zero config files.
|
|
|
42
42
|
fail-soft — a Librarian outage never blocks a turn or leaks a stack trace.
|
|
43
43
|
Private mode is an in-conversation instruction; the server cannot verify its
|
|
44
44
|
marker. A curator review queued by a flag from public context may still correct that memory after switching private; the toggle does not cancel queued work.
|
|
45
|
-
- **
|
|
45
|
+
- **Three slash commands** (optional sugar): `/handoff`, `/takeover`,
|
|
46
46
|
`/toggle-private` — thin prompt templates that drive the corresponding tool
|
|
47
47
|
flows. See [`docs/slash-commands.md`](../../docs/slash-commands.md).
|
|
48
48
|
- **Fail-soft everywhere** — if the Librarian is down, tools return a short
|
|
@@ -95,7 +95,7 @@ Set two environment variables in the shell that launches `pi`:
|
|
|
95
95
|
| `LIBRARIAN_PI_DATA` | *(optional)* where the per-session capture state lives, default `$HOME/.librarian/pi-extension-data` |
|
|
96
96
|
|
|
97
97
|
Without both required variables the extension stays **dormant**: no tools, no
|
|
98
|
-
network calls — only the
|
|
98
|
+
network calls — only the three slash commands register, and they explain what's
|
|
99
99
|
missing.
|
|
100
100
|
|
|
101
101
|
Security posture (inherited from the security-reviewed clients in this family):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Native Pi slash commands for The Librarian — optional sugar (rethink D9).
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// Three thin prompt templates aligned with docs/slash-commands.md and the
|
|
4
4
|
// 8-verb surface. Each handler injects a user message that drives the LLM
|
|
5
5
|
// through the corresponding tool flow; the tools (and the primer) carry the
|
|
6
6
|
// actual protocol, so these stay deliberately skeletal. Pi's `registerCommand`
|
|
@@ -20,12 +20,6 @@ const TAKEOVER_PROMPT =
|
|
|
20
20
|
"never auto-select — then `claim_handoff` the chosen id and continue the " +
|
|
21
21
|
"work its document describes. If the user supplied a handoff id, claim it directly.";
|
|
22
22
|
|
|
23
|
-
const LEARN_PROMPT =
|
|
24
|
-
"Extract durable lessons from this conversation and feed user-approved ones " +
|
|
25
|
-
"to `remember`, one call per lesson — fire-and-forget: the user picking a " +
|
|
26
|
-
"lesson is the review, so submit and move on; the curator dedupes, merges, " +
|
|
27
|
-
"and files each one asynchronously.";
|
|
28
|
-
|
|
29
23
|
const TOGGLE_ON =
|
|
30
24
|
"Private mode is ON. `[librarian:private=on]` — do not call `remember`, " +
|
|
31
25
|
"`store_handoff`, or `flag_memory` until told otherwise. `recall`, " +
|
|
@@ -53,11 +47,6 @@ export const COMMAND_SPECS = [
|
|
|
53
47
|
description: "Pick up a handoff from another agent / harness",
|
|
54
48
|
prompt: TAKEOVER_PROMPT,
|
|
55
49
|
},
|
|
56
|
-
{
|
|
57
|
-
name: "learn",
|
|
58
|
-
description: "Extract durable lessons from this conversation into durable memory",
|
|
59
|
-
prompt: LEARN_PROMPT,
|
|
60
|
-
},
|
|
61
50
|
{
|
|
62
51
|
name: "toggle-private",
|
|
63
52
|
description: "Toggle in-conversation private mode (no server state, no hook)",
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
// appended to the system prompt via `before_agent_start` — see `primer.ts`;
|
|
12
12
|
// - the recent window of the conversation journal, fetched once per session and
|
|
13
13
|
// appended after the primer (spec 078) — see `journal.ts`;
|
|
14
|
-
// -
|
|
15
|
-
// `/toggle-private`) as thin prompt templates — see `commands.ts`.
|
|
14
|
+
// - three user-facing slash commands (`/handoff`, `/takeover`, `/toggle-private`) as thin prompt templates — see `commands.ts`.
|
|
16
15
|
//
|
|
17
16
|
// Private mode is purely in-conversation: an `[librarian:private=on|off]`
|
|
18
17
|
// marker the LLM owns. There is no server flag, no on-disk state, and no
|
|
@@ -30,7 +29,7 @@ import { registerLibrarianTools } from "./tools.js";
|
|
|
30
29
|
const CONFIG_HINT =
|
|
31
30
|
"The Librarian is not configured. Set LIBRARIAN_MCP_URL and LIBRARIAN_AGENT_TOKEN.";
|
|
32
31
|
|
|
33
|
-
const COMMAND_VERBS = ["handoff", "takeover", "
|
|
32
|
+
const COMMAND_VERBS = ["handoff", "takeover", "toggle-private"] as const;
|
|
34
33
|
|
|
35
34
|
export default function librarian(pi: ExtensionAPI): void {
|
|
36
35
|
const config = readConfig();
|
|
@@ -80,6 +79,6 @@ export default function librarian(pi: ExtensionAPI): void {
|
|
|
80
79
|
// returns before reaching here, so an unconfigured install captures nothing).
|
|
81
80
|
registerCaptureHook(pi, resolveDataDir(process.env), (cwd) => journal.projectFor(cwd));
|
|
82
81
|
|
|
83
|
-
// The
|
|
82
|
+
// The three user-facing slash commands (optional sugar, D9).
|
|
84
83
|
registerCommands(pi);
|
|
85
84
|
}
|