@tryglen/cli 0.9.1 → 0.9.2
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.
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
// The plugin agent has NO `glen_search` MCP tool — it reaches memory only through
|
|
2
|
+
// the CLI (AGENTS.md §9, matching skills/search/SKILL.md). So we tell it to run
|
|
3
|
+
// `glen search` via Bash, and gate it on relevance + what the conversation already
|
|
4
|
+
// covers rather than forcing a search per question (that re-creates the
|
|
5
|
+
// over-injection the search funnel was built to avoid).
|
|
1
6
|
const PREFIX = "Your team's shared Glen memory may hold context relevant to this request. " +
|
|
2
|
-
|
|
7
|
+
'Before answering, run `glen search "<question>"` via Bash for any of these ' +
|
|
8
|
+
"the conversation so far doesn't already answer:";
|
|
3
9
|
const formatQuestions = (result) => {
|
|
4
10
|
const questions = result?.questions;
|
|
5
11
|
if (!Array.isArray(questions))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-questions.js","sourceRoot":"","sources":["../../src/_utils/format-questions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GACV,4EAA4E;IAC5E,
|
|
1
|
+
{"version":3,"file":"format-questions.js","sourceRoot":"","sources":["../../src/_utils/format-questions.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,gFAAgF;AAChF,mFAAmF;AACnF,wEAAwE;AACxE,wDAAwD;AACxD,MAAM,MAAM,GACV,4EAA4E;IAC5E,6EAA6E;IAC7E,iDAAiD,CAAC;AAEpD,MAAM,eAAe,GAAG,CAAC,MAAe,EAAiB,EAAE;IACzD,MAAM,SAAS,GAAI,MAAyC,EAAE,SAAS,CAAC;IACxE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAC5B,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAC7D,CAAC;IACF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,OAAO,GAAG,MAAM,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC/D,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -3,8 +3,17 @@
|
|
|
3
3
|
// elision marker where the middle was truncated. The agent reads this output
|
|
4
4
|
// directly, so we lead with a short receipt of how many memories came back and
|
|
5
5
|
// render each as a bullet — a few bullets on what was returned, rather than an
|
|
6
|
-
// undifferentiated block
|
|
6
|
+
// undifferentiated block — and close with a one-line reliability caveat.
|
|
7
|
+
// Returns null when there's no context to show.
|
|
7
8
|
const ELISION = /^…\[\d+ omitted\]…$/;
|
|
9
|
+
// Memories are LLM-extracted from past sessions — they can be stale, partial, or
|
|
10
|
+
// contradict each other. The nudge tells the agent to run `glen search` via Bash,
|
|
11
|
+
// which does NOT load skills/search/SKILL.md, so the caveat has to travel with the
|
|
12
|
+
// result itself rather than living only in the skill. One line — it rides every
|
|
13
|
+
// non-empty result.
|
|
14
|
+
const CAVEAT = "(Recalled from past sessions — may be outdated or conflicting. Weigh recency, " +
|
|
15
|
+
"use your judgment on what's relevant, and confirm with the user before relying " +
|
|
16
|
+
"on anything uncertain or contradictory.)";
|
|
8
17
|
const formatSearchResult = (result) => {
|
|
9
18
|
const context = result?.context;
|
|
10
19
|
if (typeof context !== "string" || context.trim() === "")
|
|
@@ -18,7 +27,7 @@ const formatSearchResult = (result) => {
|
|
|
18
27
|
// The elision marker isn't a memory — keep it inline (indented), un-bulleted.
|
|
19
28
|
.map((l) => (ELISION.test(l.trim()) ? ` ${l.trim()}` : `• ${l}`))
|
|
20
29
|
.join("\n");
|
|
21
|
-
return `[glen] recalled ${memoryCount} ${noun}:\n${bullets}`;
|
|
30
|
+
return `[glen] recalled ${memoryCount} ${noun}:\n${bullets}\n${CAVEAT}`;
|
|
22
31
|
};
|
|
23
32
|
export { formatSearchResult };
|
|
24
33
|
//# sourceMappingURL=format-search-result.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-search-result.js","sourceRoot":"","sources":["../../src/_utils/format-search-result.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,
|
|
1
|
+
{"version":3,"file":"format-search-result.js","sourceRoot":"","sources":["../../src/_utils/format-search-result.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE;AACzE,gDAAgD;AAChD,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAEtC,iFAAiF;AACjF,kFAAkF;AAClF,mFAAmF;AACnF,gFAAgF;AAChF,oBAAoB;AACpB,MAAM,MAAM,GACV,gFAAgF;IAChF,iFAAiF;IACjF,0CAA0C,CAAC;AAE7C,MAAM,kBAAkB,GAAG,CAAC,MAAe,EAAiB,EAAE;IAC5D,MAAM,OAAO,GAAI,MAAyC,EAAE,OAAO,CAAC;IACpE,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAEtE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACjE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,E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