@lore-co/cli 0.2.22 → 0.2.24

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.
Files changed (73) hide show
  1. package/README.md +109 -13
  2. package/dist/approach-guidance.js +2 -2
  3. package/dist/approach-guidance.js.map +1 -1
  4. package/dist/approach.d.ts +1 -1
  5. package/dist/approach.d.ts.map +1 -1
  6. package/dist/approach.js +7 -0
  7. package/dist/approach.js.map +1 -1
  8. package/dist/ask.d.ts +2 -6
  9. package/dist/ask.d.ts.map +1 -1
  10. package/dist/ask.js +4 -21
  11. package/dist/ask.js.map +1 -1
  12. package/dist/chat.d.ts +15 -0
  13. package/dist/chat.d.ts.map +1 -0
  14. package/dist/chat.js +286 -0
  15. package/dist/chat.js.map +1 -0
  16. package/dist/cli.d.ts +80 -7
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/cli.js +626 -142
  19. package/dist/cli.js.map +1 -1
  20. package/dist/command-help.d.ts +4 -1
  21. package/dist/command-help.d.ts.map +1 -1
  22. package/dist/command-help.js +9 -0
  23. package/dist/command-help.js.map +1 -1
  24. package/dist/devin-capture.d.ts +6 -0
  25. package/dist/devin-capture.d.ts.map +1 -1
  26. package/dist/devin-capture.js +34 -3
  27. package/dist/devin-capture.js.map +1 -1
  28. package/dist/devin-cli.d.ts +7 -2
  29. package/dist/devin-cli.d.ts.map +1 -1
  30. package/dist/devin-cli.js +81 -8
  31. package/dist/devin-cli.js.map +1 -1
  32. package/dist/generated-assets.d.ts +8 -6
  33. package/dist/generated-assets.d.ts.map +1 -1
  34. package/dist/generated-assets.js +8 -6
  35. package/dist/generated-assets.js.map +1 -1
  36. package/dist/generic-mcp.d.ts +35 -0
  37. package/dist/generic-mcp.d.ts.map +1 -0
  38. package/dist/generic-mcp.js +83 -0
  39. package/dist/generic-mcp.js.map +1 -0
  40. package/dist/learnings.d.ts +20 -0
  41. package/dist/learnings.d.ts.map +1 -1
  42. package/dist/learnings.js +25 -16
  43. package/dist/learnings.js.map +1 -1
  44. package/dist/lore-agent.d.ts +50 -0
  45. package/dist/lore-agent.d.ts.map +1 -0
  46. package/dist/lore-agent.js +299 -0
  47. package/dist/lore-agent.js.map +1 -0
  48. package/dist/mcp-config.d.ts +46 -0
  49. package/dist/mcp-config.d.ts.map +1 -0
  50. package/dist/mcp-config.js +196 -0
  51. package/dist/mcp-config.js.map +1 -0
  52. package/dist/owned-files.d.ts +21 -0
  53. package/dist/owned-files.d.ts.map +1 -0
  54. package/dist/owned-files.js +88 -0
  55. package/dist/owned-files.js.map +1 -0
  56. package/dist/recovery-cloud.d.ts +1 -1
  57. package/dist/review.d.ts +30 -0
  58. package/dist/review.d.ts.map +1 -0
  59. package/dist/review.js +276 -0
  60. package/dist/review.js.map +1 -0
  61. package/dist/runtime.d.ts.map +1 -1
  62. package/dist/runtime.js +50 -19
  63. package/dist/runtime.js.map +1 -1
  64. package/dist/self-host.d.ts +1 -1
  65. package/dist/self-host.js +2 -2
  66. package/dist/skills.d.ts +2 -0
  67. package/dist/skills.d.ts.map +1 -1
  68. package/dist/skills.js +46 -97
  69. package/dist/skills.js.map +1 -1
  70. package/dist/update.d.ts.map +1 -1
  71. package/dist/update.js +39 -4
  72. package/dist/update.js.map +1 -1
  73. package/package.json +7 -4
@@ -10,6 +10,10 @@ interface LearningsArguments {
10
10
  json: boolean;
11
11
  }
12
12
  export declare function parseLearningsArguments(args: readonly string[]): LearningsArguments | null;
13
+ export declare function formatDate(value: string): string;
14
+ export declare function singleLine(text: string, width: number): string;
15
+ export declare function scopeLabel(memory: Memory): string;
16
+ export declare function table(rows: readonly string[][], headers: readonly string[]): string;
13
17
  export interface LearningsListing {
14
18
  repo: string | null;
15
19
  statuses: readonly MemoryStatus[];
@@ -23,6 +27,22 @@ export declare function loadAllLearnings(client: Pick<SharedMemoryClient, "listL
23
27
  categories?: readonly MemoryCategory[];
24
28
  query?: string;
25
29
  }): Promise<Memory[]>;
30
+ export type RepositorySource = "flag" | "folder" | "all";
31
+ /**
32
+ * Which repository a listing covers, checked against the workspace repository
33
+ * policy before anything is read: `--repo`, the whole workspace, or the Git
34
+ * repository of the current folder.
35
+ */
36
+ export declare function resolveListingRepository(selection: {
37
+ repo?: string;
38
+ allRepositories: boolean;
39
+ }, config: ConnectorConfig, options?: {
40
+ cwd?: string;
41
+ fetcher?: typeof fetch;
42
+ }): Promise<{
43
+ repo: string | undefined;
44
+ repoSource: RepositorySource;
45
+ }>;
26
46
  export declare function runLearningsCommand(args: readonly string[], config: ConnectorConfig | null, options?: {
27
47
  cwd?: string;
28
48
  fetcher?: typeof fetch;
@@ -1 +1 @@
1
- {"version":3,"file":"learnings.d.ts","sourceRoot":"","sources":["../src/learnings.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAGL,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAyChD,UAAU,kBAAkB;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf;AAgBD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,kBAAkB,GAAG,IAAI,CAgD3B;AAqCD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,MAAM,GAAG,QAAQ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C;IAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,UAAU,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAsCrE;AAED,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CAAO,GACrD,OAAO,CAAC,IAAI,CAAC,CAsCf"}
package/dist/learnings.js CHANGED
@@ -99,14 +99,14 @@ export function parseLearningsArguments(args) {
99
99
  }
100
100
  return parsed;
101
101
  }
102
- function formatDate(value) {
102
+ export function formatDate(value) {
103
103
  return value.slice(0, 10);
104
104
  }
105
- function singleLine(text, width) {
105
+ export function singleLine(text, width) {
106
106
  const flat = text.replaceAll(/\s+/gu, " ").trim();
107
107
  return flat.length > width ? `${flat.slice(0, width - 1)}…` : flat;
108
108
  }
109
- function scopeLabel(memory) {
109
+ export function scopeLabel(memory) {
110
110
  const scope = memory.scope;
111
111
  const parts = [
112
112
  ...(scope.repo === undefined ? [] : [scope.repo]),
@@ -117,7 +117,7 @@ function scopeLabel(memory) {
117
117
  ];
118
118
  return parts.length === 0 ? "workspace" : parts.join(" · ");
119
119
  }
120
- function table(rows, headers) {
120
+ export function table(rows, headers) {
121
121
  const widths = headers.map((header, column) => Math.max(header.length, ...rows.map((row) => row[column].length)));
122
122
  const line = (cells) => cells
123
123
  .map((cell, column) => column === cells.length - 1 ? cell : cell.padEnd(widths[column]))
@@ -196,21 +196,19 @@ export async function loadAllLearnings(client, filters) {
196
196
  return learnings;
197
197
  }
198
198
  }
199
- export async function runLearningsCommand(args, config, options = {}) {
200
- const parsed = parseLearningsArguments(args);
201
- if (parsed === null)
202
- return;
203
- if (config === null) {
204
- throw new Error("Lore is not connected. Run: lore connect --token <workspace-token>");
205
- }
206
- const fetcher = options.fetcher ?? fetch;
199
+ /**
200
+ * Which repository a listing covers, checked against the workspace repository
201
+ * policy before anything is read: `--repo`, the whole workspace, or the Git
202
+ * repository of the current folder.
203
+ */
204
+ export async function resolveListingRepository(selection, config, options = {}) {
207
205
  let repo;
208
206
  let repoSource;
209
- if (parsed.allRepositories) {
207
+ if (selection.allRepositories) {
210
208
  repoSource = "all";
211
209
  }
212
- else if (parsed.repo !== undefined) {
213
- repo = parsed.repo;
210
+ else if (selection.repo !== undefined) {
211
+ repo = selection.repo;
214
212
  repoSource = "flag";
215
213
  }
216
214
  else {
@@ -222,7 +220,7 @@ export async function runLearningsCommand(args, config, options = {}) {
222
220
  }
223
221
  // The same workspace repository policy that hooks and lore ask honour.
224
222
  // Without a repository, only a workspace that allows every repository passes.
225
- const permission = await checkWorkspaceRepository(config, repo, fetcher);
223
+ const permission = await checkWorkspaceRepository(config, repo, options.fetcher ?? fetch);
226
224
  if (!permission.allowed) {
227
225
  if (permission.failure === "rejected") {
228
226
  throw new Error("Lore authentication failed. Reconnect with a valid workspace token.");
@@ -234,6 +232,17 @@ export async function runLearningsCommand(args, config, options = {}) {
234
232
  ? "This workspace limits Lore to selected repositories. Use --repo <owner/repository>."
235
233
  : `Lore is off for this repository. ${permission.reason}.`);
236
234
  }
235
+ return { repo, repoSource };
236
+ }
237
+ export async function runLearningsCommand(args, config, options = {}) {
238
+ const parsed = parseLearningsArguments(args);
239
+ if (parsed === null)
240
+ return;
241
+ if (config === null) {
242
+ throw new Error("Lore is not connected. Run: lore connect --token <workspace-token>");
243
+ }
244
+ const fetcher = options.fetcher ?? fetch;
245
+ const { repo, repoSource } = await resolveListingRepository(parsed, config, { ...options, fetcher });
237
246
  const client = new SharedMemoryClient({
238
247
  baseUrl: config.apiUrl,
239
248
  headers: { authorization: `Bearer ${config.token}` },
@@ -1 +1 @@
1
- {"version":3,"file":"learnings.js","sourceRoot":"","sources":["../src/learnings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GAInB,MAAM,eAAe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AE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAC3F,CAAC;QACF,OAAO;IACT,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Lore as a defined agent inside a coding harness: a fresh context, a
3
+ * Lore-only prompt, and only the Lore tools plus read-only file access, so a
4
+ * person can delegate recall, proposal review, or a recap without the main
5
+ * agent's task influencing the result. One prompt source
6
+ * (integrations/agents/lore/AGENT.md) is rendered per harness here: markdown
7
+ * with frontmatter for most hosts, a TOML custom agent for Codex.
8
+ */
9
+ export type LoreAgentHarness = "claude" | "codex" | "copilot" | "cursor" | "opencode";
10
+ interface AgentPaths {
11
+ home: string;
12
+ loreDirectory: string;
13
+ }
14
+ interface Installation {
15
+ agent: string;
16
+ configPath: string;
17
+ }
18
+ /** Lore MCP tools the agent may use, in the order the harness lists them. */
19
+ export declare const LORE_AGENT_TOOLS: readonly ["ask_lore", "search_learnings", "get_learning", "list_learnings", "list_sessions", "list_proposals", "get_proposal", "decide_proposal", "remember_learning", "correct_learning", "share_lore", "list_skills", "read_skill"];
20
+ /** Skills the agent builds on; preloaded where the harness supports it. */
21
+ export declare const LORE_AGENT_SKILLS: readonly ["lore", "recap"];
22
+ interface AgentSource {
23
+ name: string;
24
+ description: string;
25
+ body: string;
26
+ }
27
+ export declare function parseLoreAgentSource(asset?: string): AgentSource;
28
+ /**
29
+ * The agent body as a TOML multi-line basic string. Only a backslash and a
30
+ * run of three quotes have meaning inside `"""`: the backslash starts an
31
+ * escape or a line-ending continuation, and three quotes end the string. One
32
+ * escaped quote breaks each such run, and the final newline keeps the closing
33
+ * delimiter away from a trailing quote, which TOML limits to two.
34
+ */
35
+ export declare function tomlMultilineString(value: string): string;
36
+ /** The complete agent file for one harness. */
37
+ export declare function renderLoreAgent(harness: LoreAgentHarness, asset?: string): string;
38
+ export interface LoreAgentFile {
39
+ harness: LoreAgentHarness;
40
+ file: string;
41
+ }
42
+ /** Where each connected agent loads a user-level agent definition from. */
43
+ export declare function loreAgentFiles(installations: readonly Installation[]): LoreAgentFile[];
44
+ export declare function installLoreAgent(paths: AgentPaths, installations: readonly Installation[]): Promise<{
45
+ files: string[];
46
+ warnings: string[];
47
+ }>;
48
+ export declare function removeLoreAgent(paths: AgentPaths, installations: readonly Installation[]): Promise<void>;
49
+ export {};
50
+ //# sourceMappingURL=lore-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lore-agent.d.ts","sourceRoot":"","sources":["../src/lore-agent.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEtF,UAAU,UAAU;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE;AAC5D,UAAU,YAAY;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE;AAE5D,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB,uOAcnB,CAAC;AAEX,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,4BAA6B,CAAC;AAE5D,UAAU,WAAW;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAEzE,wBAAgB,oBAAoB,CAAC,KAAK,GAAE,MAAyB,GAAG,WAAW,CASlF;AAMD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGzD;AAuFD,+CAA+C;AAC/C,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,GAAE,MAAyB,GAAG,MAAM,CAmFnG;AAED,MAAM,WAAW,aAAa;IAAG,OAAO,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAE1E,2EAA2E;AAC3E,wBAAgB,cAAc,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,GAAG,aAAa,EAAE,CAmBtF;AAKD,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAgClJ;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9G"}
@@ -0,0 +1,299 @@
1
+ import { rm } from "node:fs/promises";
2
+ import { dirname, resolve } from "node:path";
3
+ import { LORE_AGENT_ASSET } from "./generated-assets.js";
4
+ import { atomicWrite, digest, ownedFileHint, readIfPresent, readOwnedManifest, regularPath, removeOwnedFile } from "./owned-files.js";
5
+ /** Lore MCP tools the agent may use, in the order the harness lists them. */
6
+ export const LORE_AGENT_TOOLS = [
7
+ "ask_lore",
8
+ "search_learnings",
9
+ "get_learning",
10
+ "list_learnings",
11
+ "list_sessions",
12
+ "list_proposals",
13
+ "get_proposal",
14
+ "decide_proposal",
15
+ "remember_learning",
16
+ "correct_learning",
17
+ "share_lore",
18
+ "list_skills",
19
+ "read_skill",
20
+ ];
21
+ /** Skills the agent builds on; preloaded where the harness supports it. */
22
+ export const LORE_AGENT_SKILLS = ["lore", "recap"];
23
+ export function parseLoreAgentSource(asset = LORE_AGENT_ASSET) {
24
+ const match = /^---\n([\s\S]*?)\n---\n([\s\S]*)$/u.exec(asset);
25
+ if (match === null)
26
+ throw new Error("The Lore agent source has no frontmatter");
27
+ const fields = Object.fromEntries(match[1].split("\n").map(line => {
28
+ const separator = line.indexOf(":");
29
+ return [line.slice(0, separator).trim(), line.slice(separator + 1).trim()];
30
+ }));
31
+ if (!fields.name || !fields.description)
32
+ throw new Error("The Lore agent source needs a name and a description");
33
+ return { name: fields.name, description: fields.description, body: match[2].trim() };
34
+ }
35
+ const yamlString = (value) => JSON.stringify(value);
36
+ // JSON escapes are a subset of TOML basic-string escapes, so one quoted line serves both.
37
+ const tomlString = yamlString;
38
+ /**
39
+ * The agent body as a TOML multi-line basic string. Only a backslash and a
40
+ * run of three quotes have meaning inside `"""`: the backslash starts an
41
+ * escape or a line-ending continuation, and three quotes end the string. One
42
+ * escaped quote breaks each such run, and the final newline keeps the closing
43
+ * delimiter away from a trailing quote, which TOML limits to two.
44
+ */
45
+ export function tomlMultilineString(value) {
46
+ const escaped = value.replace(/\\/gu, "\\\\").replace(/"""/gu, '""\\"');
47
+ return `"""\n${escaped.endsWith("\n") ? escaped : `${escaped}\n`}"""`;
48
+ }
49
+ const HOST_NOTES = {
50
+ claude: `## Host notes: Claude Code
51
+
52
+ Delegate with "use the lore agent to …" or an @lore mention; Claude Code also
53
+ delegates on its own when a request matches this agent's description. The
54
+ main agent passes the session to recap when it knows it. Claude Code stores
55
+ this project's transcripts as JSONL under
56
+ \`~/.claude/projects/<project-slug>/<session-id>.jsonl\`, where the slug is the
57
+ working directory path with each \`/\` replaced by \`-\`. Without a session ID,
58
+ take the most recently modified transcript in that folder and confirm with the
59
+ person that its first user message is the session they mean. Read only
60
+ \`user\` and \`assistant\` entries. The \`lore\` and \`recap\` skills are preloaded
61
+ when they are installed; their rules apply unchanged.
62
+
63
+ This definition grants Read, Glob, and Grep for evidence and the Lore tools
64
+ listed above by name. A listed tool that your Lore connection does not offer
65
+ yet is simply absent; say so rather than substituting another route.`,
66
+ codex: `## Host notes: Codex
67
+
68
+ Ask Codex to delegate to you: "use the lore agent to …" or "have the lore
69
+ agent review my pending learnings". Codex also delegates when AGENTS.md or a
70
+ skill asks it to. In the CLI, \`/subagents\` switches between running agent
71
+ threads and shows this one; it does not start an agent by itself. This file
72
+ turns off the shell tool, apps, plugins, memories, and the permission-request
73
+ tool. It cannot restrict MCP servers, which Codex inherits from the parent
74
+ session, and it cannot create a read-only sandbox: you run under the parent's
75
+ sandbox and approval policy. So the rule in this prompt is the only limit: use
76
+ the Lore tools named above from the \`lore\` MCP server and nothing from any
77
+ other server, and make no file edits even when the sandbox would allow them.
78
+ Codex does not list MCP tools as plain functions: they are reachable through
79
+ the \`exec\` code-mode tool as \`await tools.mcp__lore__<tool>({ … })\` (list
80
+ them with \`ALL_TOOLS\`), and \`tool_search\` can answer "unsupported call".
81
+ Use \`exec\` only to call the Lore tools named above, never to run shell
82
+ commands or change files; \`apply_patch\` and \`web.run\` stay exposed and are
83
+ not yours to use.
84
+ Codex keeps sessions in its own store rather than transcript files; recap from
85
+ the conversation the person shares, from what Lore recorded (\`list_sessions\`),
86
+ and from the repository's files. Skills inherit from the parent session; the
87
+ \`lore\` and \`recap\` skills, when installed under \`~/.agents/skills\`,
88
+ describe the flows you follow.`,
89
+ copilot: `## Host notes: GitHub Copilot
90
+
91
+ Select this agent with \`/agent\` in Copilot CLI, start a session with
92
+ \`copilot --agent lore\`, pick it in VS Code's agent picker, or say "use the
93
+ lore agent to …". The \`tools\` list limits you to read, search, and the Lore
94
+ tools named above; Copilot ignores names its MCP configuration does not
95
+ provide, so when a Lore tool is missing, say so rather than substituting
96
+ another route. Copilot keeps session logs in its own format rather than a
97
+ transcript you should read; recap from what the person shares, from what Lore
98
+ recorded (\`list_sessions\`), and from the repository's files. The \`lore\` and
99
+ \`recap\` skills, when installed, describe the flows you follow.`,
100
+ opencode: `## Host notes: OpenCode
101
+
102
+ Mention \`@lore\` in a message in the TUI to run this agent in a child session,
103
+ switch to it as the primary agent with Tab, or run
104
+ \`opencode run --agent lore "…"\` from a shell; \`opencode run\` treats an
105
+ \`@lore\` mention as plain text, so the main agent answers itself there. The
106
+ permission map denies edit, bash, web, task, and the to-do tools and allows
107
+ the Lore tools above by name; OpenCode cannot deny
108
+ tools from MCP servers this definition does not know about, so do not use
109
+ another server's tools even when they are listed. OpenCode keeps sessions in
110
+ its own store rather than transcript files; recap from the conversation the
111
+ person shares, from what Lore recorded (\`list_sessions\`), and from the
112
+ repository's files. The \`lore\` and \`recap\` skills, when installed, describe
113
+ the flows you follow.`,
114
+ cursor: `## Host notes: Cursor
115
+
116
+ Run this subagent with \`/lore …\` or "use the lore subagent to …"; Cursor also
117
+ delegates on its own when a request matches this subagent's description. This
118
+ file sets no \`readonly\` flag on purpose: Cursor runs a read-only subagent in
119
+ Ask mode, which rejects every MCP call, including the read-only Lore tools, so
120
+ a read-only Lore subagent cannot answer at all. Cursor has no per-subagent tool
121
+ list and subagents inherit every tool of the parent, including every MCP
122
+ server, so the rule in this prompt is the only limit: use the Lore tools named
123
+ above from the \`lore\` MCP server and nothing from any other server, edit no
124
+ file, and run no shell command even when a read-only one would be allowed. The
125
+ parent's permission allowlist (\`Mcp(lore:<tool>)\` entries in \`.cursor/cli.json\`
126
+ or \`~/.cursor/cli-config.json\`) still decides which Lore tools run without a
127
+ prompt. The \`lore-native\` server is Cursor's capture bridge for the main
128
+ agent, not a tool for you. Cursor keeps conversations in its own store rather
129
+ than transcript files; recap from the conversation the person shares, from
130
+ what Lore recorded (\`list_sessions\`), and from the repository's files. The
131
+ \`lore\` and \`recap\` skills, when installed, describe the flows you follow.`,
132
+ };
133
+ /** The complete agent file for one harness. */
134
+ export function renderLoreAgent(harness, asset = LORE_AGENT_ASSET) {
135
+ const source = parseLoreAgentSource(asset);
136
+ const body = `${source.body}\n\n${HOST_NOTES[harness]}\n`;
137
+ switch (harness) {
138
+ case "claude":
139
+ return [
140
+ "---",
141
+ `name: ${source.name}`,
142
+ `description: ${yamlString(source.description)}`,
143
+ `tools: Read, Glob, Grep, ${LORE_AGENT_TOOLS.map(tool => `mcp__lore__${tool}`).join(", ")}`,
144
+ "skills:",
145
+ ...LORE_AGENT_SKILLS.map(skill => ` - ${skill}`),
146
+ "---",
147
+ "",
148
+ body,
149
+ ].join("\n");
150
+ case "codex":
151
+ // Codex: a standalone TOML custom agent; `model` is left out so it inherits the parent's.
152
+ // sandbox_mode, approval_policy, and mcp_servers cannot be set here, so the prompt limits the tools.
153
+ return [
154
+ `name = ${tomlString(source.name)}`,
155
+ `description = ${tomlString(source.description)}`,
156
+ `developer_instructions = ${tomlMultilineString(body)}`,
157
+ "",
158
+ "[features]",
159
+ "shell_tool = false",
160
+ "apps = false",
161
+ "plugins = false",
162
+ "memories = false",
163
+ "request_permissions_tool = false",
164
+ "",
165
+ ].join("\n");
166
+ case "copilot":
167
+ return [
168
+ "---",
169
+ `name: ${source.name}`,
170
+ `description: ${yamlString(source.description)}`,
171
+ `tools: [${["read", "search", ...LORE_AGENT_TOOLS.map(tool => `lore/${tool}`)].map(yamlString).join(", ")}]`,
172
+ "---",
173
+ "",
174
+ body,
175
+ ].join("\n");
176
+ case "cursor":
177
+ // Cursor documents name, description, model, readonly, and is_background; no tool or MCP allowlist.
178
+ // `readonly: true` is left out: it runs the subagent in Ask mode, which rejects every MCP call,
179
+ // so the Lore tools would be unreachable (verified against cursor-agent 2026.09.02).
180
+ return [
181
+ "---",
182
+ `name: ${source.name}`,
183
+ `description: ${yamlString(source.description)}`,
184
+ "model: inherit",
185
+ "---",
186
+ "",
187
+ body,
188
+ ].join("\n");
189
+ case "opencode":
190
+ return [
191
+ "---",
192
+ `description: ${yamlString(source.description)}`,
193
+ "mode: all",
194
+ "permission:",
195
+ " read: allow",
196
+ " glob: allow",
197
+ " grep: allow",
198
+ " list: allow",
199
+ " skill: allow",
200
+ " external_directory: ask",
201
+ " edit: deny",
202
+ " bash: deny",
203
+ " webfetch: deny",
204
+ " websearch: deny",
205
+ " task: deny",
206
+ // OpenCode's to-do list tools are offered unless denied; the agent has no plan to track.
207
+ " todowrite: deny",
208
+ " todoread: deny",
209
+ // Last matching rule wins: deny the server, then allow the listed tools.
210
+ ' "lore_*": deny',
211
+ ...LORE_AGENT_TOOLS.map(tool => ` lore_${tool}: allow`),
212
+ "---",
213
+ "",
214
+ body,
215
+ ].join("\n");
216
+ }
217
+ }
218
+ /** Where each connected agent loads a user-level agent definition from. */
219
+ export function loreAgentFiles(installations) {
220
+ const seen = new Set();
221
+ const files = [];
222
+ for (const installation of installations) {
223
+ const configDirectory = dirname(resolve(installation.configPath));
224
+ let entry = null;
225
+ // Claude Code: `agents/` beside the settings file, so a custom CLAUDE_CONFIG_DIR is honored.
226
+ if (installation.agent === "claude")
227
+ entry = { harness: "claude", file: resolve(configDirectory, "agents/lore.md") };
228
+ // Codex: `~/.codex/agents/<name>.toml` beside hooks.json; the `name` field, not the filename, identifies the agent.
229
+ else if (installation.agent === "codex")
230
+ entry = { harness: "codex", file: resolve(configDirectory, "agents/lore.toml") };
231
+ // Copilot: `hooks/lore.json` lives under the Copilot home (CLI) or `.github` (VS Code); agents sit beside hooks.
232
+ else if (installation.agent === "copilot-cli" || installation.agent === "copilot-vscode")
233
+ entry = { harness: "copilot", file: resolve(dirname(configDirectory), "agents/lore.agent.md") };
234
+ // Cursor: `~/.cursor/agents/` beside hooks.json; it wins over `~/.claude/agents/lore.md`, which Cursor also reads.
235
+ else if (installation.agent === "cursor")
236
+ entry = { harness: "cursor", file: resolve(configDirectory, "agents/lore.md") };
237
+ // OpenCode: `agents/` beside opencode.json.
238
+ else if (installation.agent === "opencode")
239
+ entry = { harness: "opencode", file: resolve(configDirectory, "agents/lore.md") };
240
+ if (entry !== null && !seen.has(entry.file)) {
241
+ seen.add(entry.file);
242
+ files.push(entry);
243
+ }
244
+ }
245
+ return files;
246
+ }
247
+ const manifestFile = (paths) => resolve(paths.loreDirectory, "agents.json");
248
+ const hint = (subject, file, error) => ownedFileHint(subject, file, error, "Lore still works through the skill and hooks without the agent.");
249
+ export async function installLoreAgent(paths, installations) {
250
+ const files = [], warnings = [];
251
+ let manifest;
252
+ try {
253
+ manifest = await readOwnedManifest(manifestFile(paths), "Agent");
254
+ }
255
+ catch (error) {
256
+ warnings.push(hint("Lore agent not installed: cannot read", manifestFile(paths), error));
257
+ return { files, warnings };
258
+ }
259
+ // Best-effort per file, like skills: an unwritable agent directory must not fail the connection.
260
+ for (const { harness, file } of loreAgentFiles(installations)) {
261
+ const text = renderLoreAgent(harness);
262
+ try {
263
+ if (!await regularPath(file)) {
264
+ warnings.push(`Lore agent left unchanged because its path is symlinked: ${file}`);
265
+ continue;
266
+ }
267
+ const existing = await readIfPresent(file);
268
+ if (existing !== null && existing !== text && digest(existing) !== manifest[file]) {
269
+ warnings.push(`Lore agent left unchanged to preserve your edits: ${file}`);
270
+ continue;
271
+ }
272
+ if (existing !== text)
273
+ await atomicWrite(file, text);
274
+ manifest[file] = digest(text);
275
+ files.push(file);
276
+ }
277
+ catch (error) {
278
+ warnings.push(hint("Lore agent not installed at", file, error));
279
+ }
280
+ }
281
+ try {
282
+ await atomicWrite(manifestFile(paths), `${JSON.stringify(manifest, null, 2)}\n`);
283
+ }
284
+ catch (error) {
285
+ warnings.push(hint("Lore agent ownership not recorded in", manifestFile(paths), error));
286
+ }
287
+ return { files, warnings };
288
+ }
289
+ export async function removeLoreAgent(paths, installations) {
290
+ const manifest = await readOwnedManifest(manifestFile(paths), "Agent").catch(() => ({}));
291
+ // Manifest entries never select deletion targets; only known agent locations do.
292
+ for (const { file } of loreAgentFiles(installations)) {
293
+ // The agents directory is shared with the customer's own agents; keep it.
294
+ await removeOwnedFile(file, manifest, false);
295
+ }
296
+ if (await regularPath(manifestFile(paths)))
297
+ await rm(manifestFile(paths), { force: true });
298
+ }
299
+ //# sourceMappingURL=lore-agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lore-agent.js","sourceRoot":"","sources":["../src/lore-agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aA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C,IAAI,CAAC,IAAI,CAAC,6BAA6B,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IACD,IAAI,CAAC;QACH,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACnF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,sCAAsC,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,KAAiB,EAAE,aAAsC;IAC7F,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzF,iFAAiF;IACjF,KAAK,MAAM,EAAE,IAAI,EAAE,IAAI,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC;QACrD,0EAA0E;QAC1E,MAAM,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAAE,MAAM,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The full Lore MCP server entry that `lore connect` registers next to an
3
+ * agent's native hooks. Hooks deliver context and capture turns on their own;
4
+ * the server gives the agent explicit tools for "remember this", "what did we
5
+ * decide", "share this", and "make this repeatable".
6
+ */
7
+ export declare const LORE_MCP_SERVER_NAME = "lore";
8
+ /** Agents whose hooks or plugin are paired with the Lore MCP server. */
9
+ export declare const MCP_HOST_AGENTS: readonly ["claude", "codex", "cursor", "copilot-cli", "copilot-vscode"];
10
+ export type McpHostAgent = (typeof MCP_HOST_AGENTS)[number];
11
+ /** Every host that runs the Lore MCP server; OpenCode registers it beside its plugin. */
12
+ export type LoreMcpAgent = McpHostAgent | "opencode";
13
+ /**
14
+ * Build the server entry. `invocation` is the executable plus any script path
15
+ * the CLI needs (empty for the standalone binary); the stored home keeps the
16
+ * server on the same credentials and folder rules as the hooks, and the host
17
+ * name attributes saves whose caller passes no `agent`.
18
+ */
19
+ export declare function loreMcpServerEntry(invocation: readonly string[], home: string, agent: LoreMcpAgent): Record<string, unknown>;
20
+ export declare function isLoreMcpServer(value: unknown): boolean;
21
+ /** Merge the entry into a JSON host config that lists servers under `mcpServers`. */
22
+ export declare function mergeLoreMcpServers(config: Record<string, unknown>, entry: Record<string, unknown>, agent: string): Record<string, unknown>;
23
+ export declare function removeLoreMcpServers(config: Record<string, unknown>): Record<string, unknown>;
24
+ /**
25
+ * VS Code reads `.vscode/mcp.json` in the repository, with servers under
26
+ * `servers` in the same stdio shape (type, command, args, env) the shared
27
+ * entry already has, so the entry is stored as built.
28
+ */
29
+ export declare function mergeLoreVsCodeMcp(config: Record<string, unknown>, entry: Record<string, unknown>): Record<string, unknown>;
30
+ export declare function removeLoreVsCodeMcp(config: Record<string, unknown>): Record<string, unknown>;
31
+ /** The Lore entry in a VS Code `servers` map, or undefined when the map holds none. */
32
+ export declare function loreVsCodeMcpServer(config: unknown): unknown;
33
+ /** OpenCode lists servers under `mcp`, with the executable and arguments as one array. */
34
+ export declare function openCodeMcpEntry(entry: Record<string, unknown>): Record<string, unknown>;
35
+ export declare function isLoreOpenCodeMcp(value: unknown): boolean;
36
+ export declare function mergeLoreOpenCodeMcp(config: Record<string, unknown>, entry: Record<string, unknown>): Record<string, unknown>;
37
+ export declare function removeLoreOpenCodeMcp(config: Record<string, unknown>): Record<string, unknown>;
38
+ /** Add or refresh the Lore block without rewriting the rest of the user's file. */
39
+ export declare function mergeLoreCodexMcp(text: string, entry: Record<string, unknown>): string;
40
+ export declare function removeLoreCodexMcp(text: string): string;
41
+ /** How many Lore blocks the file holds and whether the parsed entry matches. */
42
+ export declare function inspectCodexMcp(text: string, entry: Record<string, unknown>): {
43
+ owned: number;
44
+ exact: boolean;
45
+ };
46
+ //# sourceMappingURL=mcp-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../src/mcp-config.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAE3C,wEAAwE;AACxE,eAAO,MAAM,eAAe,yEAA0E,CAAC;AACvG,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5D,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,UAAU,CAAC;AAiBrD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAc5H;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGvD;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,MAAM,GACZ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,C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