@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
package/README.md CHANGED
@@ -30,7 +30,7 @@ The package requires Node.js 22 or newer and installs the `lore` command.
30
30
 
31
31
  In Connect, **This project** asks your agent to confirm the current folder. **Choose another project** offers a native folder picker, GitHub selection, and manual path entry. The CLI also supports `--current-project` (interactive confirmation), `--choose-folder` (a picker on this machine), and `--repository github.com/owner/repo` alongside a folder choice to verify its Git origin. Cancelling or choosing a mismatched checkout stops setup before recording. GitHub selection does not change workspace policy.
32
32
 
33
- Run setup from the project you want to record: `--folder .` includes that folder and its subfolders. Repeat `--folder <path>` for additional folders, or choose `--all-projects` explicitly. New connections stay paused without a capture choice; reconnecting without one preserves your existing rules. Existing exclusions remain in effect. Use `lore scope check <folder>` to verify. Learning repository scope controls where knowledge applies and is separate from capture scope.
33
+ Run setup from the project you want to record: `--folder .` includes that folder and its subfolders. Repeat `--folder <path>` for additional folders, or choose `--all-projects` explicitly. New connections stay paused without a capture choice; reconnecting without one preserves your existing rules. Existing exclusions remain in effect. Add `--no-capture` (or run `lore capture off`) for retrieval-only mode: context, Guard, `lore ask`, and `lore remember` without automatic turn recording; `lore capture on` turns it back on. Use `lore scope check <folder>` to verify. Learning repository scope controls where knowledge applies and is separate from capture scope.
34
34
 
35
35
  ### Windows
36
36
 
@@ -181,6 +181,21 @@ excerpts. `--repo` and
181
181
  response. Requires a connected workspace (`lore connect`) and a server that
182
182
  exposes `POST /v1/ask`.
183
183
 
184
+ ```sh
185
+ lore chat
186
+ lore chat "Has anyone on the team run into flaky auth tests?"
187
+ lore chat "What did we decide about payment retries?" --repo acme/billing --json
188
+ ```
189
+
190
+ `chat` is a read-only discussion over the same knowledge: Lore answers in
191
+ prose, numbers the learnings and sessions it cited (with dashboard links when a
192
+ dashboard URL is configured), and says when nothing in the workspace covers a
193
+ question. In the prompt, a follow-up keeps the previous answer's sources, a
194
+ number prints that source in full, `scope <repo>` changes the repository, and
195
+ `quit` exits. Nothing typed in the chat is saved. Prose answers need a server
196
+ with `EXTRACTOR_PROVIDER=hybrid` or `openai-compatible`; a heuristic server
197
+ lists the retrieved sources instead.
198
+
184
199
  ```sh
185
200
  lore learnings
186
201
  lore learnings --repo acme/billing --json > learnings.json
@@ -197,6 +212,33 @@ table with each learning's ID, category, update date, and text; `--json` prints
197
212
  through `GET /v1/learnings` until every match is loaded, and honours the
198
213
  workspace repository restrictions before reading anything.
199
214
 
215
+ ```sh
216
+ lore review
217
+ lore review --repo acme/app
218
+ lore review show <id>
219
+ lore review approve <id> --reason "Matches the deployment runbook."
220
+ lore review decline <id> --reason "Superseded by the new lint rule."
221
+ lore review --all-repositories --json
222
+ ```
223
+
224
+ `review` handles pending learning proposals without opening the dashboard.
225
+ Automatic extraction, `lore github harvest`, agent saves, and members'
226
+ submissions all land as proposals that an owner or admin must approve before
227
+ agents receive them. `lore review` lists the proposals waiting for a
228
+ repository (defaulting to the current folder's Git repository; `--repo` or
229
+ `--all-repositories` change that), `show` prints one proposal with its source
230
+ and any conflicts, and `approve` or `decline` records the decision with an
231
+ optional `--reason`. `--json` prints the server records for scripts.
232
+
233
+ Deciding needs a connection that identifies you: connect with
234
+ `lore connect --login`, which mints a credential you approved for this machine.
235
+ Workspace tokens created in the dashboard for integrations are refused, so an
236
+ agent cannot approve its own captures; they can still list and show proposals.
237
+ Members can read proposals but not decide them, the same rules the dashboard
238
+ applies. A proposal with an open
239
+ conflict against an existing learning is decided in the dashboard, where the
240
+ current learning can be replaced or kept alongside the proposal.
241
+
200
242
  ## Use Lore with your agent
201
243
 
202
244
  Choose **lore** in your agent's skills to find shared knowledge or save what you
@@ -211,8 +253,9 @@ checks existing learnings, and uses the current repository's connection. Saving
211
253
  requires write access and may need workspace review; it does not make a learning
212
254
  a Required rule.
213
255
 
214
- After updating the CLI, run `lore connect` and restart your agent. Setup replaces
215
- the previous `lore-remember` skill with `lore`, preserving customer-edited files.
256
+ Both `lore connect` and `lore update` install the current skill files; restart
257
+ your agent afterwards. Setup replaces the previous `lore-remember` skill with
258
+ `lore`, preserving customer-edited files.
216
259
  Claude Code also supports `/lore`; Codex supports `$lore`.
217
260
 
218
261
  The skill is installed in `~/.agents/skills/lore` for Codex, Cursor, Copilot and
@@ -225,6 +268,36 @@ Installation paths follow the official [Codex](https://developers.openai.com/cod
225
268
  [Cursor](https://cursor.com/docs/skills), and [OpenCode](https://opencode.ai/docs/skills/)
226
269
  skill conventions.
227
270
 
271
+ ### Lore as an agent
272
+
273
+ For Claude Code, Copilot CLI, Copilot in VS Code, Cursor, and OpenCode,
274
+ `lore connect` also installs Lore as a defined agent: a separate agent with a fresh context, a
275
+ Lore-only prompt, and only the Lore tools plus read-only file access. Delegate
276
+ to it when the answer should not be shaped by the task your main agent is in:
277
+
278
+ - Claude Code: “use the lore agent to review my pending learnings”, or `@lore`.
279
+ - Codex: “use the lore agent to recap this session”; `/subagents` switches
280
+ between running agent threads.
281
+ - Copilot CLI: `/agent` → **lore**, or `copilot --agent lore`.
282
+ - Cursor: `/lore recap this session`, or “use the lore subagent to …”.
283
+ - OpenCode: `@lore recap this session`, or Tab to switch to it.
284
+
285
+ It finds prior knowledge and sessions, reviews pending proposals, recaps a
286
+ session into learnings you select, and shares links. It is not a coding agent
287
+ and reports only verified saves with their workspace and repository scope.
288
+ Files: `~/.claude/agents/lore.md`, `~/.codex/agents/lore.toml`,
289
+ `~/.copilot/agents/lore.agent.md`, `.github/agents/lore.agent.md` (VS Code),
290
+ `~/.cursor/agents/lore.md`, and `~/.config/opencode/agents/lore.md`;
291
+ `lore disconnect` removes the ones Lore wrote. Cursor can only mark the
292
+ subagent read-only, and Codex can only switch off the shell tool, apps,
293
+ plugins, memories, and permission requests (its custom agents inherit the
294
+ parent's sandbox and MCP servers,
295
+ [docs](https://learn.chatgpt.com/docs/agent-configuration/subagents)), so
296
+ there the prompt is the tool limit. Connecting Copilot CLI or
297
+ OpenCode now also registers the Lore MCP server (`~/.copilot/mcp-config.json`,
298
+ `mcp.lore` in `opencode.json`) so the agent has its tools. See
299
+ [Lore as an agent](../../docs/guides/lore-agent.md).
300
+
228
301
  ## Save knowledge manually
229
302
 
230
303
  ```sh
@@ -329,7 +402,7 @@ content-free `guard_check` audit event.
329
402
 
330
403
  ```sh
331
404
  lore update
332
- lore update --version v0.2.22
405
+ lore update --version v0.2.24
333
406
  ```
334
407
 
335
408
  `update` resolves the latest release to an exact tag, or uses the exact
@@ -339,12 +412,19 @@ version before replacing the current target. `LORE_REPO` selects another
339
412
  GitHub repository and `LORE_RELEASE_BASE_URL` selects an HTTPS release mirror;
340
413
  `LORE_BIN_DIR` overrides the standalone install directory.
341
414
 
342
- The command merges Lore-owned entries into `~/.codex/hooks.json`,
343
- `~/.claude/settings.json`, and `~/.cursor/hooks.json`, and merges
344
- `@lore-co/opencode` into the `plugin` array in
345
- `~/.config/opencode/opencode.json`. Existing settings, hooks, keys, and plugins
346
- are retained. Changed agent config files receive timestamped backups, and
347
- rerunning `connect` does not duplicate entries or backups.
415
+ Once the binary is in place, `update` re-applies the Lore-owned entries for
416
+ every agent recorded in the stored connection: the hooks in files such as
417
+ `~/.claude/settings.json`, `~/.codex/hooks.json`, and `~/.cursor/hooks.json`,
418
+ the `lore` MCP server entries next to them, the `@lore-co/opencode` plugin, the
419
+ `lore` skill files, and the hook runtime when an agent needs it. It uses the
420
+ same merge as `connect`, so unchanged files are left alone, changed files
421
+ receive timestamped backups, customer-edited skill files are preserved with a
422
+ warning, and the refreshed files are listed after the `Updated Lore to
423
+ <version>` line.
424
+ Authorization is not repeated and folder rules are untouched; with no stored
425
+ connection, `update` only replaces the binary. The refresh runs from the
426
+ updater that was already installed, so an update from a release that predates
427
+ it still needs one `lore connect` afterwards.
348
428
 
349
429
  ## Inspect or remove
350
430
 
@@ -482,6 +562,21 @@ command has subcommand-specific `--help`, and `up`, `down`, and `status` support
482
562
 
483
563
  ## Runtime behavior
484
564
 
565
+ Claude Code, Codex, and Cursor also receive the `lore` MCP server, run by this
566
+ CLI from the same protected config. Hooks keep delivering context into each
567
+ prompt and capturing turns; the server adds the explicit tools behind "ask Lore
568
+ what we decided", "remember this", "let's review my pending learnings", "share
569
+ this", and "make this repeatable" (`ask_lore`, `search_learnings`,
570
+ `remember_learning`, `list_proposals`, `decide_proposal`, `share_lore`, and the
571
+ approach tools; `decide_proposal` follows the same rules as `lore review`). It skips `prepare_context` because the hooks already deliver
572
+ context, and its saves stay proposals until an owner or admin approves them.
573
+ Connect writes the entry to `~/.claude.json`, a marked block in
574
+ `~/.codex/config.toml`, and `~/.cursor/mcp.json`; `lore status` reports it as
575
+ the `mcp-tools` unit, and disconnect removes only that entry. Claude Code asks
576
+ once before it runs a new MCP server. `lore update` re-applies the entry after
577
+ it replaces the binary, so an existing installation does not need a reconnect
578
+ to receive it.
579
+
485
580
  Cursor installs five hooks and a `lore-native` MCP server. Its `sessionStart`
486
581
  hook instructs the agent to call `lore_context` before each request and
487
582
  `lore_complete` after its response. The bridge retrieves scoped context, captures
@@ -489,7 +584,7 @@ teachings, and stages prior attempts even in CLI print mode. Repository identity
489
584
  comes from the native session; MCP input cannot override it. Credentials remain
490
585
  in Lore's protected config. Keep the server enabled, reconnect with the updated
491
586
  CLI (`lore connect --agent cursor`), and start a new conversation to activate it.
492
- `lore status` checks all five hooks plus the MCP server. Other MCP entries are
587
+ `lore status` checks all five hooks plus both MCP servers. Other MCP entries are
493
588
  preserved during connect and disconnect.
494
589
 
495
590
  The Claude/Codex/Cursor/Polytoken command-hook handler:
@@ -519,7 +614,8 @@ First prompts use `POST /v1/observations` and audited
519
614
  workspace bearer token and an `Idempotency-Key` header. Automatic teachings
520
615
  default to repository scope and follow the workspace learning policy. In
521
616
  `proposal_only` mode, every automatic capture remains proposed and cannot be
522
- retrieved or injected until dashboard review activates it. Rejected,
617
+ retrieved or injected until an owner or admin activates it (`lore review` or
618
+ the dashboard). Rejected,
523
619
  suppressed, superseded, and deleted learnings are also excluded. Dirty files
524
620
  and the current directory remain task relevance evidence and do not narrow
525
621
  every learning. Only an explicit correction with clear team-, company,
@@ -674,7 +770,7 @@ same-repository, non-draft pull requests bearing the corresponding
674
770
  `lore:codex-review` or `lore:devin-review` label.
675
771
 
676
772
  Generated jobs require a published standalone binary release and default to
677
- `treadiehq/lore-releases` at `v0.2.22`. Set `LORE_CLI_REPOSITORY` to the publicly
773
+ `treadiehq/lore-releases` at `v0.2.24`. Set `LORE_CLI_REPOSITORY` to the publicly
678
774
  readable `owner/repository` and `LORE_CLI_VERSION` to an existing release tag
679
775
  when using another release source.
680
776
 
@@ -1,9 +1,9 @@
1
1
  export function approachGuidance(prompt, agent, sessionId, retained = []) {
2
2
  // A capability cue lets the agent recognize ordinary requests itself. Reuse
3
3
  // must not depend on the user knowing a feature name or a trigger phrase.
4
- const discovery = `Lore can save and reuse reviewed approaches in Learnings. If the user asks to repeat earlier work or do it the way it was done before, run \`lore approach --help\`, list active approaches in this repository, and choose by the task, without requiring an exact name. Infer inputs from the request and repository; ask only for missing information or an ambiguous match. Use the saved version, check prerequisites before editing, and record the actual result. Your native session is ${JSON.stringify({ agent, sessionId })}.`;
4
+ const discovery = `Lore can save and reuse reviewed approaches in Learnings. If the user asks to repeat earlier work or do it the way it was done before, list active approaches in this repository and choose by the task, without requiring an exact name. Prefer the Lore MCP tools when your host offers them (search_approaches, get_approach, use_approach, report_approach_run, decide_approach_run); they record the run without a shell command. Otherwise run \`lore approach --help\` and pass each request through \`--input <file>\` from a temporary JSON file; never pipe approach JSON inline or put its free-text values on the command line. Infer inputs from the request and repository; ask only for missing information or an ambiguous match. Use the saved version, check prerequisites before editing, and record the actual result. Your native session is ${JSON.stringify({ agent, sessionId })}.`;
5
5
  const detailed = /\bmake (?:this|that|it|the work) repeatable\b|\b(?:saved|reusable) approach\b/iu.test(prompt);
6
- const instructions = ["Run `lore approach --help` for the JSON command contract. These commands use this folder's existing connection.",
6
+ const instructions = ["Prefer the Lore MCP approach tools when your host offers them; prepare_approach, draft_approach, and save_approach carry the same contract as the CLI operations. Otherwise run `lore approach --help` for the JSON command contract, write each request to a temporary JSON file, and pass its path with `--input`; do not pipe the JSON inline, so summaries, notes, and other free text stay off the command line. Both paths use this folder's existing connection.",
7
7
  `For source preparation, use an explicit Lore source session if the user supplied one. Otherwise your native session reference is ${JSON.stringify({ externalSessionId: sessionId, agent })}. Resolve it with prepare; never invent a Lore session UUID. If it is not captured yet, use explicit source notes and describe missing evidence.`,
8
8
  "For saving: prepare the source, preserve human corrections, show the name, inputs, steps, prerequisites, and checks, then keep a draft. Save only after the user reviews and asks to save. Missing final work or checks must stay a draft. Agent saves are proposals and need owner or admin approval in Learnings before reuse.",
9
9
  "For sources: when a correction in the session was already captured as an active learning in this repository, pass its id in learningIds and cite it from the step, prerequisite, check, or stop condition it supports. Pass further captured sessions in sessionIds. Cite only ids that prepare returned under sources. Do not create learnings while saving an approach; an uncaptured correction stays an uncited item for the reviewer.",
@@ -1 +1 @@
1
- {"version":3,"file":"approach-guidance.js","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,KAAa,EAAE,SAAiB,EAAE,WAA8B,EAAE;IACjH,4EAA4E;IAC5E,0EAA0E;IAC1E,MAAM,SAAS,GAAG,keAAke,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC;IAC5hB,MAAM,QAAQ,GAAG,iFAAiF,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChH,MAAM,YAAY,GAAG,CAAC,iHAAiH;QACrI,oIAAoI,IAAI,CAAC,SAAS,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,kJAAkJ;QAC7U,kUAAkU;QAClU,4aAA4a;QAC5a,irBAAirB;QACjrB,4QAA4Q;QAC5Q,giBAAgiB;KACjiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,yEAAyE;IACzE,uEAAuE;IACvE,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACpD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"approach-guidance.js","sourceRoot":"","sources":["../src/approach-guidance.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,KAAa,EAAE,SAAiB,EAAE,WAA8B,EAAE;IACjH,4EAA4E;IAC5E,0EAA0E;IAC1E,MAAM,SAAS,GAAG,q0BAAq0B,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC;IAC/3B,MAAM,QAAQ,GAAG,iFAAiF,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChH,MAAM,YAAY,GAAG,CAAC,ycAAyc;QAC7d,oIAAoI,IAAI,CAAC,SAAS,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,kJAAkJ;QAC7U,kUAAkU;QAClU,4aAA4a;QAC5a,irBAAirB;QACjrB,4QAA4Q;QAC5Q,giBAAgiB;KACjiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,yEAAyE;IACzE,uEAAuE;IACvE,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACpD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;AAC/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { LoreClient } from "@lore-co/sdk";
2
2
  import type { ConnectorConfig } from "./cli.js";
3
- export declare const APPROACH_HELP = "lore approach \u2014 save and reuse a reviewed way of working\n\nUsage: lore approach <operation> --input <JSON-file|->\n\nOperations (JSON response):\n prepare {repo?, sessionId?, externalSessionId?, agent?, sessionIds?, learningIds?, notes?, task?}\n Reads captured source work. sessionId is Lore's UUID; externalSessionId\n resolves the current native agent session. sessionIds adds further\n captured sessions (10 at most) and learningIds adds active learnings\n from the same repository (50 at most). Pass notes for missing work.\n The response lists every source under \"sources\" with its current state.\n draft {repo?, document, source, agent, requestId}\n Keeps a draft using the exact source from prepare. Does not activate it.\n list {repo?, query?, status?} (defaults to active in the current repository)\n get {id, version?}\n revise {id, expectedVersion, document} (creates a separate draft version)\n save {id, expectedVersion, validation}\n Only after the user reviews and asks to save. Describe the actual final\n artifact and checks; keep a draft when these are missing.\n Submits for owner or admin approval in Learnings before reuse.\n use {id, version, repo?, agent, sessionId, inputs, requestId}\n Returns steps and records a run. Check current prerequisites BEFORE\n editing. The agent executes with its normal tools and permissions.\n report {id, outcome, summary, prerequisiteChecks, checks, artifacts, adjustment?}\n Outcomes: needs_input, completed, failed, unknown, stopped.\n Each prerequisite: {prerequisite, result: passed|changed|unknown, detail}\n Each check: {check, result: passed|failed|unknown, output}\n decide {id, action: continue|stop, reason}\n Record the user's explicit decision for a paused run; never infer it.\n runs {id}\n\nDocument: {name, purpose, inputs: [{name, description, required}], steps: string[],\n prerequisites: string[], checks: string[], stopConditions: string[],\n citations?: [{field: steps|prerequisites|checks|stopConditions, index,\n sources: [{kind: session|learning, id}]}]}\nCite the learning or session an item rests on; cite only ids from prepare's\nsources. Items without a citation are allowed and are shown as unsupported for\nreview. Citing never creates a learning: capture a missing correction separately.\nDraft variable task values (resource, fields, ordering) as inputs. Preserve actual\nrepository helper names, module paths, and contracts as prerequisites; replacing\na dependency requires a decision. Keep essential steps and durable constraints,\nnot incidental tool failures or the original task's chosen input values.\nAim for 3\u20137 essential steps. Every result check is REQUIRED for every supported\nuse. Put optional diagnostics in steps, not checks; reproducing the source\ndefect must not block new work with no prior defect.\nStop conditions must not contradict the inputs the approach supports.\nUse the exact prerequisite/check text in reports. Missing evidence is unknown;\nGuard authorization is not proof of execution. A one-run adjustment does not\nchange the shared approach. Request IDs are UUIDs; reuse them on uncertain retries.\nUse source snapshots returned by prepare, never construct them yourself.\nThese commands use the current folder's existing Lore connection.\n";
3
+ export declare const APPROACH_HELP = "lore approach \u2014 save and reuse a reviewed way of working\n\nUsage: lore approach <operation> --input <JSON-file|->\n\nWrite the request to a temporary JSON file and pass its path. Standard input (-)\nis for programs that pipe JSON; an agent should not put approach JSON or its\nfree-text values on the command line. Hosts that offer the Lore MCP tools\n(search_approaches, get_approach, prepare_approach, use_approach,\nreport_approach_run, decide_approach_run) record the same operations without a\nshell command; prefer them when available.\n\nOperations (JSON response):\n prepare {repo?, sessionId?, externalSessionId?, agent?, sessionIds?, learningIds?, notes?, task?}\n Reads captured source work. sessionId is Lore's UUID; externalSessionId\n resolves the current native agent session. sessionIds adds further\n captured sessions (10 at most) and learningIds adds active learnings\n from the same repository (50 at most). Pass notes for missing work.\n The response lists every source under \"sources\" with its current state.\n draft {repo?, document, source, agent, requestId}\n Keeps a draft using the exact source from prepare. Does not activate it.\n list {repo?, query?, status?} (defaults to active in the current repository)\n get {id, version?}\n revise {id, expectedVersion, document} (creates a separate draft version)\n save {id, expectedVersion, validation}\n Only after the user reviews and asks to save. Describe the actual final\n artifact and checks; keep a draft when these are missing.\n Submits for owner or admin approval in Learnings before reuse.\n use {id, version, repo?, agent, sessionId, inputs, requestId}\n Returns steps and records a run. Check current prerequisites BEFORE\n editing. The agent executes with its normal tools and permissions.\n report {id, outcome, summary, prerequisiteChecks, checks, artifacts, adjustment?}\n Outcomes: needs_input, completed, failed, unknown, stopped.\n Each prerequisite: {prerequisite, result: passed|changed|unknown, detail}\n Each check: {check, result: passed|failed|unknown, output}\n decide {id, action: continue|stop, reason}\n Record the user's explicit decision for a paused run; never infer it.\n runs {id}\n\nDocument: {name, purpose, inputs: [{name, description, required}], steps: string[],\n prerequisites: string[], checks: string[], stopConditions: string[],\n citations?: [{field: steps|prerequisites|checks|stopConditions, index,\n sources: [{kind: session|learning, id}]}]}\nCite the learning or session an item rests on; cite only ids from prepare's\nsources. Items without a citation are allowed and are shown as unsupported for\nreview. Citing never creates a learning: capture a missing correction separately.\nDraft variable task values (resource, fields, ordering) as inputs. Preserve actual\nrepository helper names, module paths, and contracts as prerequisites; replacing\na dependency requires a decision. Keep essential steps and durable constraints,\nnot incidental tool failures or the original task's chosen input values.\nAim for 3\u20137 essential steps. Every result check is REQUIRED for every supported\nuse. Put optional diagnostics in steps, not checks; reproducing the source\ndefect must not block new work with no prior defect.\nStop conditions must not contradict the inputs the approach supports.\nUse the exact prerequisite/check text in reports. Missing evidence is unknown;\nGuard authorization is not proof of execution. A one-run adjustment does not\nchange the shared approach. Request IDs are UUIDs; reuse them on uncertain retries.\nUse source snapshots returned by prepare, never construct them yourself.\nThese commands use the current folder's existing Lore connection.\n";
4
4
  export declare function runApproachCommand(args: readonly string[], config: ConnectorConfig | null): Promise<void>;
5
5
  export declare function executeApproachCommand(client: LoreClient, operation: string, value: Record<string, unknown>, repo: string): Promise<unknown>;
6
6
  //# sourceMappingURL=approach.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"approach.d.ts","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,eAAO,MAAM,aAAa,i8GAmDzB,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB/G;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BlJ"}
1
+ {"version":3,"file":"approach.d.ts","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,eAAO,MAAM,aAAa,62HA0DzB,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB/G;AAED,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BlJ"}
package/dist/approach.js CHANGED
@@ -7,6 +7,13 @@ export const APPROACH_HELP = `lore approach — save and reuse a reviewed way of
7
7
 
8
8
  Usage: lore approach <operation> --input <JSON-file|->
9
9
 
10
+ Write the request to a temporary JSON file and pass its path. Standard input (-)
11
+ is for programs that pipe JSON; an agent should not put approach JSON or its
12
+ free-text values on the command line. Hosts that offer the Lore MCP tools
13
+ (search_approaches, get_approach, prepare_approach, use_approach,
14
+ report_approach_run, decide_approach_run) record the same operations without a
15
+ shell command; prefer them when available.
16
+
10
17
  Operations (JSON response):
11
18
  prepare {repo?, sessionId?, externalSessionId?, agent?, sessionIds?, learningIds?, notes?, task?}
12
19
  Reads captured source work. sessionId is Lore's UUID; externalSessionId
@@ -1 +1 @@
1
- {"version":3,"file":"approach.js","sourceRoot":"","sources":["../src/approach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmD5B,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAuB,EAAE,MAA8B;IAC9F,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FromCheckout as detectRepository } from "@lore-co/core/repository-location";
1
2
  import type { ConnectorConfig } from "./cli.js";
2
- /**
3
- * The repository the capture hooks record for this folder: the origin of the
4
- * enclosing Git checkout, or none outside one. Asking from inside a repository
5
- * should rank its learnings the same way a session there does.
6
- */
7
- export declare function detectRepository(cwd: string): Promise<string | undefined>;
3
+ export { detectRepository };
8
4
  export declare function runAskCommand(args: readonly string[], config: ConnectorConfig | null, options?: {
9
5
  cwd?: string;
10
6
  }): Promise<void>;
package/dist/ask.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../src/ask.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+FhD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAU/E;AAqDD,wBAAsB,aAAa,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7B,OAAO,CAAC,IAAI,CAAC,CAiEf"}
1
+ {"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../src/ask.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,2BAA2B,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACpG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAkJ5B,wBAAsB,aAAa,CACjC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAC7B,OAAO,CAAC,IAAI,CAAC,CAiEf"}
package/dist/ask.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AskResponseSchema, formatRetrievalExplanation, } from "@lore-co/core";
2
- import { repositoryScopeFromGitRoot } from "@lore-co/core/repository-location";
3
- import { access } from "node:fs/promises";
4
- import { dirname, resolve } from "node:path";
2
+ import { repositoryScopeFromCheckout as detectRepository } from "@lore-co/core/repository-location";
3
+ // The repository the capture hooks record for this folder, or none outside a checkout.
4
+ export { detectRepository };
5
5
  const ASK_HELP = `lore ask
6
6
  Query Lore's shared context: durable knowledge plus prior work sessions.
7
7
 
@@ -84,26 +84,9 @@ function parseAskArguments(args) {
84
84
  }
85
85
  return parsed;
86
86
  }
87
- /**
88
- * The repository the capture hooks record for this folder: the origin of the
89
- * enclosing Git checkout, or none outside one. Asking from inside a repository
90
- * should rank its learnings the same way a session there does.
91
- */
92
- export async function detectRepository(cwd) {
93
- let root = resolve(cwd);
94
- for (;;) {
95
- if (await access(resolve(root, ".git")).then(() => true, () => false)) {
96
- return repositoryScopeFromGitRoot(root);
97
- }
98
- const parent = dirname(root);
99
- if (parent === root)
100
- return undefined;
101
- root = parent;
102
- }
103
- }
104
87
  function formatRepositoryLine(repo, source) {
105
88
  if (repo === undefined) {
106
- return "Repository: none detected in this folder; showing workspace-wide knowledge only.\n";
89
+ return "Repository: none detected in this folder; searching every repository Lore is on for.\n";
107
90
  }
108
91
  return `Repository: ${repo} (${source === "flag" ? "from --repo" : "detected from the current folder"})\n`;
109
92
  }
package/dist/ask.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ask.js","sourceRoot":"","sources":["../src/ask.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,GAG3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,QAAQ,GAAG;;;;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AAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1E,OAAO;IACT,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CACpF,CAAC;AACJ,CAAC"}
package/dist/chat.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type { Readable, Writable } from "node:stream";
2
+ import { type ChatResponse, type ChatSource } from "@lore-co/core";
3
+ import type { ConnectorConfig } from "./cli.js";
4
+ export interface ChatCommandOptions {
5
+ cwd?: string;
6
+ /** Lines for the prompt; defaults to standard input. */
7
+ input?: Readable;
8
+ output?: Writable;
9
+ }
10
+ export declare function formatChatAnswer(response: ChatResponse, dashboard: URL | null): {
11
+ text: string;
12
+ sources: ChatSource[];
13
+ };
14
+ export declare function runChatCommand(args: readonly string[], config: ConnectorConfig | null, options?: ChatCommandOptions): Promise<void>;
15
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA2EhD,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB;AAiFD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,EAAE,CAAA;CAAE,CAcvH;AAyED,wBAAsB,cAAc,CAClC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAsDf"}