@tanagram/lore 0.1.87 → 0.1.89

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanagram/lore",
3
- "version": "0.1.87",
3
+ "version": "0.1.89",
4
4
  "description": "Lore CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,6 +40,7 @@
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "pnpm run postinstall && tsx src/index.ts",
43
+ "dev:watch": "tsx src/index.ts _run_upload --watch",
43
44
  "postinstall": "node scripts/runPostinstallCommand.mjs postinstall:migrate && node scripts/runPostinstallCommand.mjs postinstall:install-skills && node scripts/runPostinstallCommand.mjs postinstall:refresh-background-binary",
44
45
  "build": "node scripts/build.mjs",
45
46
  "build:prod": "node scripts/build.mjs --prod",
@@ -32,8 +32,7 @@ skill for read-only thread inspection.
32
32
  This skill needs two inputs:
33
33
 
34
34
  1. A Lore thread URL or ID. Accepted examples include `th_...`,
35
- `https://lore.tanagram.ai/session/th_...`, and
36
- `https://lore.tanagram.ai/thread/th_...`.
35
+ and `https://lore.tanagram.ai/thread/th_...`.
37
36
  2. Forker intent: what the user wants to do with the source thread.
38
37
 
39
38
  If either input is missing, ask one concise clarification question before
@@ -12,10 +12,11 @@ allowed-tools: Bash
12
12
 
13
13
  # Read from Lore
14
14
 
15
- Fetches data from Lore via the `lore` CLI. Two underlying commands:
15
+ Fetches data from Lore via the `lore` CLI. Three underlying commands:
16
16
 
17
- - `lore threads get <thread-id-or-url>` — fetch a single thread by ID or session URL.
18
- - `lore threads list [flags]` — list/search threads with optional filters.
17
+ - `lore threads get <thread-id-or-url>` — fetch a single thread by ID or Lore URL.
18
+ - `lore threads list [flags]` — list/search threads with optional deterministic filters.
19
+ - `lore threads ask --question=<question>` — search threads by semantic meaning; use when the user asks an open-ended question.
19
20
 
20
21
  Both print a JSON payload on stdout. Parse the JSON and summarize for the user; only show raw JSON if they ask for it.
21
22
 
@@ -33,7 +34,7 @@ Do NOT run proactively. Only on explicit request.
33
34
 
34
35
  ## Fetching a Single Thread
35
36
 
36
- When the user gives a thread ID (`th_...`) or a Lore session URL (`https://lore.tanagram.ai/session/th_...`):
37
+ When the user gives a thread ID (`th_...`) or a Lore thread URL (`https://lore.tanagram.ai/thread/th_...`):
37
38
 
38
39
  ```bash
39
40
  lore threads get <thread-id-or-url>
@@ -59,9 +60,21 @@ Flag reference:
59
60
 
60
61
  Combine flags freely — they AND together server-side.
61
62
 
63
+ ## Searching Threads Semantically:
64
+
65
+ ```bash
66
+ lore threads ask --question=<question>
67
+ ```
68
+
69
+ Use this when asks about threads in a broad way that can't be entirely captured by the flags listed above. For example:
70
+
71
+ - "what have we been thinking about our open-source strategy?"
72
+ - "what did we say about running multiple fastify replicas in railway?"
73
+ - "what are some recent decisions we've made about our Posthog setup?"
74
+
62
75
  ## Output
63
76
 
64
- Both commands emit a single JSON object/array on stdout. After running:
77
+ All commands emit a single JSON object/array on stdout. After running:
65
78
 
66
79
  1. Parse the JSON.
67
80
  2. Summarize the relevant fields for the user (thread ID, title/topic, author, created time, URL, matching filepaths, etc.) instead of dumping raw JSON.
@@ -20,9 +20,11 @@ Run when the user asks to:
20
20
 
21
21
  Do NOT run this proactively. Only on explicit request.
22
22
 
23
+ - "share to #channel" (share to Lore AND post to a Slack channel)
24
+
23
25
  ## Command
24
26
 
25
- **Always** pass `--session-id ${CLAUDE_SESSION_ID}` so the CLI exports *this* session — the one the user just asked to share. Claude Code substitutes `${CLAUDE_SESSION_ID}` with the current session's ID; the CLI will not guess it for you.
27
+ **Always** pass `--session-id ${CLAUDE_SESSION_ID}` so the CLI exports _this_ session — the one the user just asked to share. Claude Code substitutes `${CLAUDE_SESSION_ID}` with the current session's ID; the CLI will not guess it for you.
26
28
 
27
29
  Use this command as the default implementation:
28
30
 
@@ -30,9 +32,15 @@ Use this command as the default implementation:
30
32
  lore export --session-id ${CLAUDE_SESSION_ID} --visibility workspace
31
33
  ```
32
34
 
33
- Do **not** omit `--session-id` and rely on the cwd-match fallback. The fallback picks the most recent history entry for the current directory, which is frequently a *different* session (a prior run, a parallel worktree, etc.) — the user then has to retry with the explicit flag. The skill runtime gives you the session ID for free, so always pass it.
35
+ If the user includes a natural-language highlight request after `/share`, pass that request through with `--highlight`. For example, `/share where I made Claude also update the API in addition to UI` should run:
36
+
37
+ ```bash
38
+ lore export --session-id ${CLAUDE_SESSION_ID} --visibility workspace --highlight "where I made Claude also update the API in addition to UI"
39
+ ```
40
+
41
+ Do **not** omit `--session-id` and rely on the cwd-match fallback. The fallback picks the most recent history entry for the current directory, which is frequently a _different_ session (a prior run, a parallel worktree, etc.) — the user then has to retry with the explicit flag. The skill runtime gives you the session ID for free, so always pass it.
34
42
 
35
- If the user wants to share a *different* session, substitute their ID for `${CLAUDE_SESSION_ID}` in the export command above.
43
+ If the user wants to share a _different_ session, substitute their ID for `${CLAUDE_SESSION_ID}` in the export command above.
36
44
 
37
45
  If the user explicitly asks to share publicly (anyone with the link) or to keep the thread private to themselves, change the `--visibility` flag in the export command to `public` or `private` respectively. Default to `workspace` whenever the user just says "share".
38
46
 
@@ -43,23 +51,68 @@ The first command prints a single JSON object on stdout:
43
51
  ```json
44
52
  {
45
53
  "thread_id": "th_...",
46
- "url": "https://lore.tanagram.ai/session/th_...",
54
+ "url": "https://lore.tanagram.ai/thread/th_...",
47
55
  "session_id": "...",
48
56
  "project": "/Users/me/repo",
49
57
  "reused": false,
50
58
  "visibility": "workspace",
51
- "clipboard_copied": true
59
+ "clipboard_copied": true,
60
+ "highlight": {
61
+ "query": "where I made Claude also update the API in addition to UI",
62
+ "matched": true,
63
+ "start_block_id": "tb_...",
64
+ "end_block_id": null
65
+ }
52
66
  }
53
67
  ```
54
68
 
55
69
  - `url` — the shareable Lore link for the session thread. **Always show this to the user as the primary result.**
70
+ - `highlight` — present only when `--highlight` was supplied. When `matched` is true, the `url` already includes the server-selected block anchor or range.
56
71
  - `clipboard_copied` — `true` when the URL was copied to the system clipboard (via `pbcopy` on macOS, `wl-copy`/`xclip`/`xsel` on Linux, `clip.exe` on Windows). `false` when no clipboard tool was available. Mention this to the user when `true` so they know they can paste it directly.
57
72
 
73
+ ## Slack Integration
74
+
75
+ If the user says "share to #channel", "post to #eng", or includes a Slack channel name (with or without the `#` prefix), do the following **after** the Lore export succeeds:
76
+
77
+ 1. Extract the `thread_id` from the export output.
78
+ 2. Strip the leading `#` from the channel name if present.
79
+ 3. Read the auth token from `~/.lore/token` (prod) or `~/.lore-dev/token` (dev). If neither exists, tell the user to run `lore login` first.
80
+ 4. Determine the API base URL: use `LORE_API_URL` env var if set, otherwise `https://api.lore.tanagram.ai` for prod or `http://localhost:4000` for dev (check which token file exists).
81
+ 5. Post to Slack via the API directly:
82
+
83
+ ```bash
84
+ TOKEN=$(cat ~/.lore/token 2>/dev/null || cat ~/.lore-dev/token 2>/dev/null)
85
+ API_BASE="${LORE_API_URL:-https://api.lore.tanagram.ai}"
86
+ curl -s -X POST "$API_BASE/api/slack/post" \
87
+ -H "Authorization: Bearer $TOKEN" \
88
+ -H "Content-Type: application/json" \
89
+ -d "{\"channel_name\": \"CHANNEL\", \"thread_id\": \"THREAD_ID\"}"
90
+ ```
91
+
92
+ Replace `CHANNEL` with the channel name (no `#` prefix) and `THREAD_ID` with the `thread_id` from the export output.
93
+
94
+ If `lore slack post` is available (check with `lore slack --help 2>/dev/null`), you may use that instead:
95
+
96
+ ```bash
97
+ lore slack post CHANNEL --thread-id THREAD_ID
98
+ ```
99
+
100
+ 6. If the response contains `"ok":true`, confirm to the user that the thread was posted to the channel.
101
+ 7. If it fails with "No Slack installation", tell the user to connect Slack from Account Settings first.
102
+ 8. If it fails with a channel error, tell the user the bot may not be in that channel and suggest `/invite @Lore` in Slack.
103
+
104
+ When Slack posting is requested, the response should look like:
105
+
106
+ > Shared: https://lore.tanagram.ai/session/th_abc123 (copied to clipboard).
107
+ > Posted to #eng in Slack.
108
+
109
+ If the user just says "share" without mentioning a channel, skip the Slack step entirely.
110
+
58
111
  ## After Running
59
112
 
60
113
  Echo the session URL back to the user as a clickable link. If `clipboard_copied` is `true`, add a short note that the URL is on their clipboard. Do not list other threads, summarize the conversation, or take any additional action unless the user asks. A minimal response looks like:
61
114
 
62
- > Shared: https://lore.tanagram.ai/session/th_abc123 (copied to clipboard).
115
+ > Shared: https://lore.tanagram.ai/thread/th_abc123 (copied to clipboard).
63
116
 
64
117
  ## Failure Modes
65
118
 
@@ -39,6 +39,15 @@ lore share-codex --session-file "$SESSION_FILE" --visibility workspace
39
39
  `${CODEX_SESSION_ID}` is set by Codex inside the running session. If it is
40
40
  empty, ask the user which session they want to share and substitute the ID.
41
41
 
42
+ If the user includes a natural-language highlight request after `/share-codex`,
43
+ pass that request through with `--highlight`. For example,
44
+ `/share-codex where I made Codex also update the API in addition to UI` should
45
+ run:
46
+
47
+ ```bash
48
+ lore share-codex --session-file "$SESSION_FILE" --visibility workspace --highlight "where I made Codex also update the API in addition to UI"
49
+ ```
50
+
42
51
  If the user explicitly asks to share publicly (anyone with the link) or to
43
52
  keep the thread private to themselves, change the `--visibility` flag to
44
53
  `public` or `private` respectively. Default to `workspace` whenever the user
@@ -51,16 +60,23 @@ The command prints a single JSON object on stdout:
51
60
  ```json
52
61
  {
53
62
  "thread_id": "th_...",
54
- "url": "https://lore.tanagram.ai/session/th_...",
63
+ "url": "https://lore.tanagram.ai/thread/th_...",
55
64
  "session_id": "...",
56
65
  "project": "",
57
66
  "reused": false,
58
67
  "visibility": "workspace",
59
- "clipboard_copied": true
68
+ "clipboard_copied": true,
69
+ "highlight": {
70
+ "query": "where I made Codex also update the API in addition to UI",
71
+ "matched": true,
72
+ "start_block_id": "tb_...",
73
+ "end_block_id": null
74
+ }
60
75
  }
61
76
  ```
62
77
 
63
78
  - `url` — the shareable Lore link for the session thread. **Always show this to the user as the primary result.**
79
+ - `highlight` — present only when `--highlight` was supplied. When `matched` is true, the `url` already includes the server-selected block anchor or range.
64
80
  - `clipboard_copied` — `true` when the URL was copied to the system clipboard. Mention this when `true` so the user knows they can paste it directly.
65
81
  - `project` — intentionally empty for Codex sessions. Codex does not record a project directory in the rollout file.
66
82
 
@@ -71,7 +87,7 @@ Echo the session URL back to the user as a clickable link. If
71
87
  clipboard. Do not list other threads, summarize the conversation, or take any
72
88
  additional action unless the user asks. A minimal response looks like:
73
89
 
74
- > Shared: https://lore.tanagram.ai/session/th_abc123 (copied to clipboard).
90
+ > Shared: https://lore.tanagram.ai/thread/th_abc123 (copied to clipboard).
75
91
 
76
92
  ## Failure Modes
77
93