@tanagram/lore 0.1.91 → 0.1.93

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.91",
3
+ "version": "0.1.93",
4
4
  "description": "Lore CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,6 @@
8
8
  },
9
9
  "files": [
10
10
  "dist",
11
- "skills",
12
11
  "scripts/nodeVersionGuard.mjs",
13
12
  "scripts/runPostinstallCommand.mjs"
14
13
  ],
@@ -28,8 +27,10 @@
28
27
  "ink-testing-library": "^4.0.0",
29
28
  "tsx": "^4.20.6",
30
29
  "typescript": "^5.9.3",
31
- "@lore/contracts": "0.1.0",
32
- "@lore/transcripts": "0.1.0"
30
+ "@lore/identity-store": "0.1.0",
31
+ "@lore/transcript-locate": "0.1.0",
32
+ "@lore/transcripts": "0.1.0",
33
+ "@lore/contracts": "0.1.0"
33
34
  },
34
35
  "dependencies": {
35
36
  "@sentry/node": "^10.47.0",
@@ -41,7 +42,7 @@
41
42
  "scripts": {
42
43
  "dev": "pnpm run postinstall && tsx src/index.ts",
43
44
  "dev:watch": "tsx src/index.ts _run_upload --watch",
44
- "postinstall": "node scripts/runPostinstallCommand.mjs postinstall:migrate && node scripts/runPostinstallCommand.mjs postinstall:install-skills && node scripts/runPostinstallCommand.mjs postinstall:refresh-background-binary",
45
+ "postinstall": "node scripts/runPostinstallCommand.mjs postinstall:migrate && node scripts/runPostinstallCommand.mjs postinstall:cleanup-legacy-skills && node scripts/runPostinstallCommand.mjs postinstall:refresh-background-binary",
45
46
  "build": "node scripts/build.mjs",
46
47
  "build:prod": "node scripts/build.mjs --prod",
47
48
  "start": "node dist/index.js",
@@ -17,9 +17,8 @@ if (!nodeVersion.ok) {
17
17
 
18
18
  const allowedCommands = new Set([
19
19
  'postinstall:migrate',
20
- 'postinstall:install-skills',
20
+ 'postinstall:cleanup-legacy-skills',
21
21
  'postinstall:refresh-background-binary',
22
- 'postinstall:uninstall-skills',
23
22
  ]);
24
23
 
25
24
  const command = process.argv[2];
@@ -1,83 +0,0 @@
1
- ---
2
- name: fork
3
- description: >-
4
- Distills a Lore thread into handoff context for continuing work. Use when the
5
- user asks to "continue work from thread", "fork from thread", "pick up from
6
- this Lore thread", or invokes /fork with a Lore thread URL/ID and forker
7
- intent.
8
- argument-hint: "<lore-thread-url-or-id> <forker-intent>"
9
- allowed-tools: Bash
10
- ---
11
-
12
- # Fork a Lore Thread
13
-
14
- Fetches an intent-conditioned handoff summary for a Lore thread and returns the
15
- `source_distilled` payload to the agent so it can continue from that context.
16
-
17
- ## When to Use
18
-
19
- Run when the user asks to:
20
-
21
- - "continue work from thread <thread-url-or-id>"
22
- - "fork from thread <thread-url-or-id>"
23
- - "pick up from this Lore thread"
24
- - "use this thread as context for <intent>"
25
- - invoke `/fork <thread-url-or-id> <forker-intent>`
26
-
27
- Do not use this for merely reading or listing Lore threads. Use the `lore-read`
28
- skill for read-only thread inspection.
29
-
30
- ## Inputs
31
-
32
- This skill needs two inputs:
33
-
34
- 1. A Lore thread URL or ID. Accepted examples include `th_...`,
35
- and `https://lore.tanagram.ai/thread/th_...`.
36
- 2. Forker intent: what the user wants to do with the source thread.
37
-
38
- If either input is missing, ask one concise clarification question before
39
- running the command.
40
-
41
- ## Command
42
-
43
- Run `lore threads fork` with the thread reference and intent. The command emits
44
- JSON; extract and return only `source_distilled`.
45
-
46
- ```bash
47
- THREAD_REF='<lore-thread-url-or-id>'
48
- FORKER_INTENT='<what the user wants to do next>'
49
-
50
- lore threads fork "$THREAD_REF" --forker-intent "$FORKER_INTENT" \
51
- | node -e 'let input = "";
52
- process.stdin.on("data", (chunk) => { input += chunk; });
53
- process.stdin.on("end", () => {
54
- const parsed = JSON.parse(input);
55
- if (typeof parsed.source_distilled !== "string" || parsed.source_distilled.length === 0) {
56
- console.error("lore threads fork did not return source_distilled");
57
- process.exit(1);
58
- }
59
- process.stdout.write(parsed.source_distilled);
60
- });'
61
- ```
62
-
63
- Use shell-safe quoting for both values. Do not pass the full thread transcript to
64
- the model yourself; the CLI/API performs the intent-conditioned distillation.
65
-
66
- ## After Running
67
-
68
- Treat the printed `source_distilled` text as the source-thread context for the
69
- current task. Use it to continue the requested work. Do not show raw JSON to the
70
- user unless they explicitly ask for it.
71
-
72
- If the user only asked to prepare the fork context, return the distilled text
73
- verbatim. If they asked to continue the work, briefly acknowledge that the fork
74
- context was loaded and proceed with the task using that context.
75
-
76
- ## Failure Modes
77
-
78
- - **Not logged in**: the command returns a login error. Tell the user to run
79
- `lore login` and retry.
80
- - **Thread not found or not visible**: tell the user the thread could not be
81
- found or they do not have access, and ask for a visible Lore thread URL/ID.
82
- - **Missing `source_distilled`**: surface the error and do not invent fork
83
- context.
@@ -1,95 +0,0 @@
1
- ---
2
- name: lore-read
3
- description: >-
4
- Read information from Lore (the team's shared thread library). Use when the
5
- user asks to fetch a specific Lore thread, search/list threads, or find
6
- threads by filepath, author, or time range. Examples: "show me that Lore
7
- thread", "what did my coworker share on Lore last week", "find Lore
8
- threads that touched src/foo.ts", "list recent Lore sessions". Shells out
9
- to the `lore threads get` and `lore threads list` CLI commands.
10
- allowed-tools: Bash
11
- ---
12
-
13
- # Read from Lore
14
-
15
- Fetches data from Lore via the `lore` CLI. Three underlying commands:
16
-
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.
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.
22
-
23
- ## When to Use
24
-
25
- Run when the user asks to:
26
-
27
- - "show me / open / read Lore thread <id-or-url>"
28
- - "what did <coworker> post / share on Lore"
29
- - "find Lore threads about <filepath / directory>"
30
- - "list recent Lore threads" or "Lore threads from <time range>"
31
- - "search Lore for ..."
32
-
33
- Do NOT run proactively. Only on explicit request.
34
-
35
- ## Fetching a Single Thread
36
-
37
- When the user gives a thread ID (`th_...`) or a Lore thread URL (`https://lore.tanagram.ai/thread/th_...`):
38
-
39
- ```bash
40
- lore threads get <thread-id-or-url>
41
- ```
42
-
43
- The argument can be either form — the CLI extracts the thread ID from a URL automatically.
44
-
45
- ## Listing / Searching Threads
46
-
47
- ```bash
48
- lore threads list [--before <cursor>] [--after <cursor>] \
49
- [--author_ids <id1,id2,...>] \
50
- [--created_at <unix> | <start>...<end>] \
51
- [--filepath_prefixes <prefix1,prefix2,...>]
52
- ```
53
-
54
- Flag reference:
55
-
56
- - `--filepath_prefixes` — comma-separated filepath prefixes. Matches threads whose sessions touched files under any of those prefixes. Use this for "threads about <some path>".
57
- - `--author_ids` — comma-separated **Lore user IDs** (not names or emails). If the user names a coworker, you need their Lore user ID; if you don't have it, ask the user or fetch a recent unfiltered list and look for their ID in the results before filtering.
58
- - `--created_at` — either a single Unix timestamp (seconds) or a `<start>...<end>` range of Unix timestamps. Convert any human time range ("last week", "since Monday") into Unix seconds before passing. Today is provided in the system context.
59
- - `--before` / `--after` — pagination cursors returned in a previous list response. Use these to page through large result sets, not for time filtering (that's `--created_at`).
60
-
61
- Combine flags freely — they AND together server-side.
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
-
75
- ## Output
76
-
77
- All commands emit a single JSON object/array on stdout. After running:
78
-
79
- 1. Parse the JSON.
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.
81
- 3. If the user asked for a single thread, surface its Lore URL prominently so they can click through.
82
- 4. If listing, show the top results with their URLs and a one-line hint each. Mention pagination cursors only if the user is likely to want more.
83
-
84
- ## Failure Modes
85
-
86
- - **Not logged in**: command returns `not logged in — run 'lore login' first`. Tell the user to run `lore login`.
87
- - **Bad thread ref**: `lore threads get` requires either a `th_...` ID or a Lore session URL. If the user passes something else, ask them to clarify or provide the URL.
88
- - **Unknown author**: `--author_ids` only accepts Lore user IDs. If the user gives a name/email and you don't have a mapping, run `lore threads list` without the author filter (optionally narrowed by `--created_at` or `--filepath_prefixes`) and find the ID from the results, or ask the user.
89
- - **Empty results**: not an error — tell the user no threads matched and suggest loosening filters.
90
-
91
- ## What This Does NOT Do
92
-
93
- - It does not export the current session — that's the `share` skill (`lore export`).
94
- - It does not modify threads, comments, visibility, or any Lore state. It is read-only.
95
- - It does not start or manage the Lore background daemon.
@@ -1,126 +0,0 @@
1
- ---
2
- name: share
3
- description: Share (export) the current Claude Code session to Lore and get back a shareable URL. Use when the user says "share this thread", "send this to Lore", "export this conversation", "post this to Lore", or asks for a link to the current session. Safe to invoke explicitly on request — do not run proactively.
4
- allowed-tools: Bash
5
- ---
6
-
7
- # Share to Lore
8
-
9
- Exports the Claude Code session you are currently running in to Lore (the team's shared thread library) and prints the URL. Lore dedupes session exports by session ID, so re-sharing the same session is safe — it returns the existing thread.
10
-
11
- ## When to Use
12
-
13
- Run when the user asks to:
14
-
15
- - "share this thread / conversation / session"
16
- - "send this to Lore"
17
- - "export this to Lore"
18
- - "get a Lore link for this"
19
- - "post this to Lore"
20
-
21
- Do NOT run this proactively. Only on explicit request.
22
-
23
- - "share to #channel" (share to Lore AND post to a Slack channel)
24
-
25
- ## Command
26
-
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.
28
-
29
- Use this command as the default implementation:
30
-
31
- ```bash
32
- lore export --session-id ${CLAUDE_SESSION_ID} --visibility workspace
33
- ```
34
-
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.
42
-
43
- If the user wants to share a _different_ session, substitute their ID for `${CLAUDE_SESSION_ID}` in the export command above.
44
-
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".
46
-
47
- ## Output
48
-
49
- The first command prints a single JSON object on stdout:
50
-
51
- ```json
52
- {
53
- "thread_id": "th_...",
54
- "url": "https://lore.tanagram.ai/thread/th_...",
55
- "session_id": "...",
56
- "project": "/Users/me/repo",
57
- "reused": false,
58
- "visibility": "workspace",
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
- }
66
- }
67
- ```
68
-
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.
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.
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
-
111
- ## After Running
112
-
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:
114
-
115
- > Shared: https://lore.tanagram.ai/thread/th_abc123 (copied to clipboard).
116
-
117
- ## Failure Modes
118
-
119
- - **Not logged in**: the command returns `not logged in — run 'lore login' first`. Tell the user to run `lore login` and try again.
120
- - **No matching history entry**: this happens when `${CLAUDE_SESSION_ID}` isn't present in `~/.claude/history.jsonl` yet (very fresh session) or when the user asked to share a session that the CLI can't find. Ask the user which session they want to share, or suggest `--session-id <id>` / `--project <path>` with the value they provide.
121
-
122
- ## What This Does NOT Do
123
-
124
- - It does not start the Lore background daemon. For ongoing auto-sync of every session, `lore enable` is the right command.
125
- - It does not change the thread title, comments, or other metadata. The user can adjust those in the Lore UI after sharing.
126
- - It does not advance the background daemon's sync cursor. If the daemon is running, it may re-upload the same session on its next cycle — Lore will return the same thread ID, so this is a no-op.
@@ -1,102 +0,0 @@
1
- ---
2
- name: share-codex
3
- description: Share (export) the current Codex session to Lore and get back a shareable URL. Use when the user is running inside Codex and says "share this thread", "send this to Lore", "export this conversation", "post this to Lore", or asks for a link to the current Codex session. Safe to invoke explicitly on request — do not run proactively.
4
- allowed-tools: Bash
5
- ---
6
-
7
- # Share Codex session to Lore
8
-
9
- Exports the Codex session you are currently running in to Lore (the team's shared thread library) and prints the URL.
10
-
11
- Codex stores each session as a JSONL rollout file on disk under
12
- `~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<uuid>.jsonl`. This skill
13
- locates the file by the current Codex session ID, then hands it to the lore
14
- CLI which uploads it as a Codex thread.
15
-
16
- ## When to Use
17
-
18
- Run when the user asks to:
19
-
20
- - "share this thread / conversation / session"
21
- - "send this to Lore"
22
- - "export this to Lore"
23
- - "get a Lore link for this"
24
- - "post this to Lore"
25
-
26
- Do NOT run this proactively. Only on explicit request.
27
-
28
- ## Command
29
-
30
- ```bash
31
- SESSION_FILE=$(find "$HOME/.codex/sessions" -name "*${CODEX_SESSION_ID}.jsonl" 2>/dev/null | head -1)
32
- if [ -z "$SESSION_FILE" ]; then
33
- echo "Could not locate Codex session file for session id ${CODEX_SESSION_ID}" >&2
34
- exit 1
35
- fi
36
- lore share-codex --session-file "$SESSION_FILE" --visibility workspace
37
- ```
38
-
39
- `${CODEX_SESSION_ID}` is set by Codex inside the running session. If it is
40
- empty, ask the user which session they want to share and substitute the ID.
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
-
51
- If the user explicitly asks to share publicly (anyone with the link) or to
52
- keep the thread private to themselves, change the `--visibility` flag to
53
- `public` or `private` respectively. Default to `workspace` whenever the user
54
- just says "share".
55
-
56
- ## Output
57
-
58
- The command prints a single JSON object on stdout:
59
-
60
- ```json
61
- {
62
- "thread_id": "th_...",
63
- "url": "https://lore.tanagram.ai/thread/th_...",
64
- "session_id": "...",
65
- "project": "",
66
- "reused": false,
67
- "visibility": "workspace",
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
- }
75
- }
76
- ```
77
-
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.
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.
81
- - `project` — intentionally empty for Codex sessions. Codex does not record a project directory in the rollout file.
82
-
83
- ## After Running
84
-
85
- Echo the session URL back to the user as a clickable link. If
86
- `clipboard_copied` is `true`, add a short note that the URL is on their
87
- clipboard. Do not list other threads, summarize the conversation, or take any
88
- additional action unless the user asks. A minimal response looks like:
89
-
90
- > Shared: https://lore.tanagram.ai/thread/th_abc123 (copied to clipboard).
91
-
92
- ## Failure Modes
93
-
94
- - **Not logged in**: the command returns `lore is logged out`. Tell the user to run `lore login` and try again.
95
- - **Session file not found**: the rollout file may not exist yet for very fresh Codex sessions. Ask the user to send another message in Codex (which forces the rollout to flush) and retry.
96
- - **Lore is offline**: the command surfaces network errors. Relay the message verbatim.
97
-
98
- ## What This Does NOT Do
99
-
100
- - It does not start any background daemon. This skill is a one-shot upload.
101
- - It does not change the thread title, comments, or other metadata. The user can adjust those in the Lore UI after sharing.
102
- - No plan export is wired up for Codex. Codex planning is event-stream/UI-first with no clean finalized-plan boundary; plan steps are surfaced by Lore from the session transcript itself.