@tanagram/lore 0.1.88 → 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/README.md +49 -3
- package/dist/index.js +212 -211
- package/package.json +3 -3
- package/skills/lore-read/SKILL.md +16 -3
- package/skills/share/SKILL.md +40 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanagram/lore",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.89",
|
|
4
4
|
"description": "Lore CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"ink-testing-library": "^4.0.0",
|
|
29
29
|
"tsx": "^4.20.6",
|
|
30
30
|
"typescript": "^5.9.3",
|
|
31
|
-
"@lore/
|
|
32
|
-
"@lore/
|
|
31
|
+
"@lore/contracts": "0.1.0",
|
|
32
|
+
"@lore/transcripts": "0.1.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@sentry/node": "^10.47.0",
|
|
@@ -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.
|
|
15
|
+
Fetches data from Lore via the `lore` CLI. Three underlying commands:
|
|
16
16
|
|
|
17
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 filters.
|
|
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
|
|
|
@@ -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
|
-
|
|
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.
|
package/skills/share/SKILL.md
CHANGED
|
@@ -20,6 +20,8 @@ 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
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.
|
|
@@ -68,6 +70,44 @@ The first command prints a single JSON object on stdout:
|
|
|
68
70
|
- `highlight` — present only when `--highlight` was supplied. When `matched` is true, the `url` already includes the server-selected block anchor or range.
|
|
69
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.
|
|
70
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
|
+
|
|
71
111
|
## After Running
|
|
72
112
|
|
|
73
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:
|