agentel 0.3.0 → 0.3.1

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 CHANGED
@@ -47,7 +47,7 @@ ref for repeatable installs:
47
47
  ```sh
48
48
  npm install -g brianlzhou/agentlog
49
49
  # or
50
- npm install -g brianlzhou/agentlog#v0.3.0
50
+ npm install -g brianlzhou/agentlog#v0.3.1
51
51
  agentlog init
52
52
  ```
53
53
 
@@ -293,6 +293,22 @@ The detailed watcher/import contract, including sourcePath replacement rules for
293
293
  multi-session stores such as Cursor SQLite and Devin `sessions.db`, lives in
294
294
  [`docs/history-source-handling.md`](docs/history-source-handling.md).
295
295
 
296
+ Slack notifications are an optional, off-by-default notify layer. Run
297
+ `agentlog notify slack setup` for the guided path: it opens Slack's app
298
+ creation page pre-filled from a manifest (one personal app, `chat:write` plus
299
+ `chat:write.customize` for per-speaker identities), verifies the pasted bot
300
+ token, connects a channel, and sends a test post. Two surfaces toggle independently, each with its own channel: summaries
301
+ (one recap per session after it goes quiet for `--quiet-minutes`) and the
302
+ firehose (live turns streamed into one thread per session, batched every
303
+ `--batch-seconds`). Adjust with
304
+ `agentlog notify slack enable --summaries on|off --firehose on|off
305
+ --summary-channel C… --firehose-channel C…`. Only redacted archive output is
306
+ posted, the token can also come from `SLACK_BOT_TOKEN`, and `--repos`
307
+ restricts posting to an allowlist. Posting is at-least-once on a local queue:
308
+ going offline pauses posting but never archiving, and everything drains on
309
+ reconnect. See `docs/agentlog-slack-scope.md` for the design, thread
310
+ lifecycle, and the planned digest/noteworthy modes.
311
+
296
312
  Remote sync can be configured during init or from the CLI. Local storage remains
297
313
  canonical. Normal sync is upload-only: this machine pushes changed archive
298
314
  objects to the remote target and never deletes objects from the bucket just
@@ -1203,6 +1203,50 @@ Internal helpers:
1203
1203
  - `isAlive(pid)`: checks whether a PID is alive.
1204
1204
  - `log(message, env)`: appends to supervisor log.
1205
1205
 
1206
+ ## `src/slack-notify.js`
1207
+
1208
+ Slack notify layer (`notify.slack` config block; see
1209
+ `docs/agentlog-slack-scope.md`). `writeSession` appends changed sessions to a
1210
+ state-dir queue; the supervisor tick drains it in a child process and posts
1211
+ one completion summary per session after it goes quiet.
1212
+
1213
+ Exports:
1214
+
1215
+ - `slackNotifySettings(cfg, env)`: resolved settings with independent
1216
+ `summary` (channel, quietMinutes) and `stream` (channel, batchSeconds)
1217
+ blocks; legacy single-channel configs map onto `summary`. Token falls back
1218
+ to `AGENTLOG_SLACK_BOT_TOKEN`/`SLACK_BOT_TOKEN`, API base URL to
1219
+ `AGENTLOG_SLACK_API_BASE_URL` (test override).
1220
+ - `enqueueSlackNotification(session, cfg, env)`: gated hot-path append from
1221
+ `writeSession`; honors the per-repo allowlist.
1222
+ - `runSlackNotify(env, options)`: drains the queue into tracked state,
1223
+ streams new events for firehose sessions (one thread per session, event
1224
+ cursor per session, batched per `batchSeconds`), posts summaries for quiet
1225
+ sessions (also closing the firehose thread), and returns
1226
+ `{ posted, streamed, tracked, skipped, errors, nextCheckMs }`. Sessions
1227
+ older than 24h never post (reimport-flood guard); failed posts stay tracked
1228
+ for retry; `options.dryRun` collects messages without posting.
1229
+ - `streamMessagesForEvents(events, opts)`: per-turn firehose rendering —
1230
+ each prompt/response becomes its own Slack post under a per-speaker
1231
+ identity: the agent as its model name (`modelDisplayName`) with the
1232
+ company logo as avatar (GitHub org avatar PNGs; Slack's `icon_url` needs a
1233
+ public raster, and the viewer's brand logos are inline SVGs). Needs
1234
+ chat:write.customize; falls back to plain bot posts and remembers via
1235
+ `state.customizeUnsupported`. Whole messages, formatting preserved; tool
1236
+ calls only with `stream.includeTools`. Long in-flight sessions replay only
1237
+ the most recent turns on first attach.
1238
+ - Thread lifecycle: going quiet closes the session's thread (the recap, when
1239
+ summaries are on, doubles as the close), keeping the event cursor; a
1240
+ session picked back up later opens a fresh thread marked "(resumed)" and
1241
+ streams only the new turns.
1242
+ - `buildCompletionMessage(meta, tracked)`: summary text from session metadata.
1243
+ - `buildSlackAppManifest(appName)` / `slackAppCreationUrl(appName)`: app
1244
+ manifest (chat:write only) and the pre-filled api.slack.com creation link
1245
+ used by the `agentlog notify slack setup` wizard.
1246
+ - `postSlackMessage(settings, payload)` / `slackAuthTest(settings)`: Slack Web
1247
+ API via built-in fetch.
1248
+ - `queuePath(env)` / `statePath(env)`: state-dir file locations.
1249
+
1206
1250
  ## `src/source-watch.js`
1207
1251
 
1208
1252
  Filesystem-event layer for the supervisor. Maps each import source to its
@@ -267,49 +267,49 @@ package-prefixed scheme.
267
267
 
268
268
  | Source type | Version |
269
269
  | --- | --- |
270
- | `codex-cli-history` | `0.3.0.0` |
271
- | `codex-desktop-history` | `0.3.0.0` |
272
- | `codex-sdk-history` | `0.3.0.0` |
273
- | `cli-history` | `0.3.0.0` |
274
- | `claude-sdk-history` | `0.3.0.0` |
275
- | `claude-code-desktop-metadata` | `0.3.0.0` |
276
- | `claude-workspace-desktop` | `0.3.0.0` |
277
- | `cursor-workspace-sqlite` | `0.3.0.0` |
278
- | `cursor-global-sqlite` | `0.3.0.0` |
279
- | `cursor-raw-sqlite-salvage` | `0.3.0.0` |
280
- | `cursor-agent-transcripts` | `0.3.0.0` |
281
- | `devin-cli-history` | `0.3.0.0` |
282
- | `devin-desktop-acp-events` | `0.3.0.0` |
283
- | `copilot-cli-history` | `0.3.0.0` |
284
- | `factory-droid-history` | `0.3.0.0` |
285
- | `grok-build-history` | `0.3.0.0` |
286
- | `pi-cli-history` | `0.3.0.0` |
287
- | `gemini-cli-history` | `0.3.0.0` |
288
- | `cline-task-history` | `0.3.0.0` |
289
- | `opencode-cli-history` | `0.3.0.0` |
290
- | `opencode-cli-sqlite-history` | `0.3.0.0` |
291
- | `opencode-desktop-history` | `0.3.0.0` |
292
- | `opencode-desktop-sqlite-history` | `0.3.0.0` |
293
- | `opencode-web-sqlite-history` | `0.3.0.0` |
294
- | `opencode-history` | `0.3.0.0` |
295
- | `opencode-sqlite-history` | `0.3.0.0` |
296
- | `aider-chat-history` | `0.3.0.0` |
297
- | `antigravity-history` | `0.3.0.0` |
298
- | `antigravity-transcript-log` | `0.3.0.0` |
299
- | `antigravity-cli-transcript-log` | `0.3.0.0` |
300
- | `antigravity-cli-brain` | `0.3.0.0` |
301
- | `antigravity-ide-transcript-log` | `0.3.0.0` |
302
- | `antigravity-ide-brain` | `0.3.0.0` |
303
- | `antigravity-summary-proto` | `0.3.0.0` |
304
- | `antigravity-trajectory-summary` | `0.3.0.0` |
305
- | `windsurf-cascade-brain` | `0.3.0.0` |
306
- | `windsurf-cascade-protobuf` | `0.3.0.0` |
307
- | `windsurf-trajectory-export` | `0.3.0.0` |
308
- | `web-chat-export` | `0.3.0.0` |
309
- | `chatgpt-export` | `0.3.0.0` |
310
- | `claude-web-export` | `0.3.0.0` |
311
- | `claude-web-memory` | `0.3.0.0` |
312
- | `import` | `0.3.0.0` |
270
+ | `codex-cli-history` | `0.3.1.0` |
271
+ | `codex-desktop-history` | `0.3.1.0` |
272
+ | `codex-sdk-history` | `0.3.1.0` |
273
+ | `cli-history` | `0.3.1.0` |
274
+ | `claude-sdk-history` | `0.3.1.0` |
275
+ | `claude-code-desktop-metadata` | `0.3.1.0` |
276
+ | `claude-workspace-desktop` | `0.3.1.0` |
277
+ | `cursor-workspace-sqlite` | `0.3.1.0` |
278
+ | `cursor-global-sqlite` | `0.3.1.0` |
279
+ | `cursor-raw-sqlite-salvage` | `0.3.1.0` |
280
+ | `cursor-agent-transcripts` | `0.3.1.0` |
281
+ | `devin-cli-history` | `0.3.1.0` |
282
+ | `devin-desktop-acp-events` | `0.3.1.0` |
283
+ | `copilot-cli-history` | `0.3.1.0` |
284
+ | `factory-droid-history` | `0.3.1.0` |
285
+ | `grok-build-history` | `0.3.1.0` |
286
+ | `pi-cli-history` | `0.3.1.0` |
287
+ | `gemini-cli-history` | `0.3.1.0` |
288
+ | `cline-task-history` | `0.3.1.0` |
289
+ | `opencode-cli-history` | `0.3.1.0` |
290
+ | `opencode-cli-sqlite-history` | `0.3.1.0` |
291
+ | `opencode-desktop-history` | `0.3.1.0` |
292
+ | `opencode-desktop-sqlite-history` | `0.3.1.0` |
293
+ | `opencode-web-sqlite-history` | `0.3.1.0` |
294
+ | `opencode-history` | `0.3.1.0` |
295
+ | `opencode-sqlite-history` | `0.3.1.0` |
296
+ | `aider-chat-history` | `0.3.1.0` |
297
+ | `antigravity-history` | `0.3.1.0` |
298
+ | `antigravity-transcript-log` | `0.3.1.0` |
299
+ | `antigravity-cli-transcript-log` | `0.3.1.0` |
300
+ | `antigravity-cli-brain` | `0.3.1.0` |
301
+ | `antigravity-ide-transcript-log` | `0.3.1.0` |
302
+ | `antigravity-ide-brain` | `0.3.1.0` |
303
+ | `antigravity-summary-proto` | `0.3.1.0` |
304
+ | `antigravity-trajectory-summary` | `0.3.1.0` |
305
+ | `windsurf-cascade-brain` | `0.3.1.0` |
306
+ | `windsurf-cascade-protobuf` | `0.3.1.0` |
307
+ | `windsurf-trajectory-export` | `0.3.1.0` |
308
+ | `web-chat-export` | `0.3.1.0` |
309
+ | `chatgpt-export` | `0.3.1.0` |
310
+ | `claude-web-export` | `0.3.1.0` |
311
+ | `claude-web-memory` | `0.3.1.0` |
312
+ | `import` | `0.3.1.0` |
313
313
 
314
314
  `cursor-sqlite-history` and `antigravity-brain` are compatibility aliases for
315
315
  older labels. Fingerprints include the parser version prefix, so changing the
package/docs/release.md CHANGED
@@ -91,5 +91,5 @@ After tagging and pushing the release, sanity-check both public install forms:
91
91
 
92
92
  ```sh
93
93
  npm install -g agentel
94
- npm install -g brianlzhou/agentlog#v0.3.0
94
+ npm install -g brianlzhou/agentlog#v0.3.1
95
95
  ```
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "agentel",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "agentel",
9
- "version": "0.3.0",
9
+ "version": "0.3.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentel",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Local-first archive and recall layer for agent coding sessions.",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
package/src/archive.js CHANGED
@@ -10,6 +10,7 @@ const { canonicalRepo } = require("./repo");
10
10
  const { loadRedactionConfig, loadEnvValues, mergeSummaries, redactText, styleRedactionMarkersForMarkdown } = require("./redaction");
11
11
  const { ensureBaseDirs, ensureDir, paths, readJson, writeJson } = require("./paths");
12
12
  const sessionStore = require("./session-store");
13
+ const { enqueueSlackNotification } = require("./slack-notify");
13
14
 
14
15
  const SHARED_RAW_SOURCE_CACHE = new Map();
15
16
  const ESTIMATED_TOKEN_CHARS = 4;
@@ -234,6 +235,7 @@ function writeSession(input, env = process.env) {
234
235
  replaceSourcePathCopies: input.replaceSourcePathCopies !== false
235
236
  });
236
237
  invalidateSessionsSnapshotCache();
238
+ enqueueSlackNotification({ ...session, metadataPath }, cfg, env);
237
239
  return { session, conversationPath, metadataPath, transcriptPath, eventPath, viewPath, rawPath: session.rawPath || "", artifactsPath: session.artifactsPath || "" };
238
240
  }
239
241