@lucasschirm/devin-session-sync 0.1.0

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.
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "devin-session-sync",
3
+ "version": "0.1.0",
4
+ "description": "Sync Devin CLI session data to S3-compatible storage.",
5
+ "author": {
6
+ "name": "lucasschirm"
7
+ }
8
+ }
package/README.md ADDED
@@ -0,0 +1,183 @@
1
+ # @lucasschirm/devin-session-sync
2
+
3
+ A [Devin CLI](https://docs.devin.ai/) plugin that synchronizes your session data
4
+ — the local `sessions.db` transcript and telemetry — to S3-compatible storage
5
+ via the [`@lucasschirm/sal-sync`](../../sync) engine.
6
+
7
+ ## What it does
8
+
9
+ The Devin CLI maintains a local SQLite database at
10
+ `~/.local/share/devin/cli/sessions.db` (or `$XDG_DATA_HOME/devin/cli/sessions.db`).
11
+ This plugin reads that database and produces deterministic, ordered
12
+ `devin-session-jsonl/v1` output, then uploads it through the SAL sync engine so
13
+ the [Agentic Sessions Dashboard](../../../) can analyze it alongside Claude Code
14
+ and other agentic session sources.
15
+
16
+ ### Plugin lifecycle
17
+
18
+ The plugin is driven by the Devin CLI hook system (declared in
19
+ [`hooks.json`](hooks.json)):
20
+
21
+ | Event | What happens |
22
+ | -------------- | ----------------------------------------------------------------------------- |
23
+ | `SessionStart` | Records the session and starts the `watcher` to observe incremental state. |
24
+ | `SessionEnd` | Performs the final sync: flushes remaining state, uploads the manifest, and ends cleanly. |
25
+
26
+ The `watcher` also keeps a watermark so repeated runs are incremental and do not
27
+ transmit data that has already been synced.
28
+
29
+ ## Installation
30
+
31
+ Devin plugins are installed directly from a git source subdirectory; there is no
32
+ `marketplace.json` file in the Devin install model. The repository's root
33
+ [`.claude-plugin/marketplace.json`](../../../.claude-plugin/marketplace.json) is
34
+ the Claude Code marketplace and intentionally lists only the Claude plugin.
35
+
36
+ ### From the remote repository
37
+
38
+ Use the `owner/repo#path` shorthand to install from the subdirectory:
39
+
40
+ ```bash
41
+ devin plugins install lucasschirm/session-analyzer#packages/plugins/devin-session-sync
42
+ ```
43
+
44
+ Add `--local` to install it only for the current project, or `-y` to skip
45
+ confirmations:
46
+
47
+ ```bash
48
+ devin plugins install lucasschirm/session-analyzer#packages/plugins/devin-session-sync --local -y
49
+ ```
50
+
51
+ ### Pinning a version
52
+
53
+ Pin to a specific commit `sha`:
54
+
55
+ ```bash
56
+ devin plugins install lucasschirm/session-analyzer#packages/plugins/devin-session-sync --sha=<commit-sha>
57
+ ```
58
+
59
+ Or pin to a branch or tag `ref`:
60
+
61
+ ```bash
62
+ devin plugins install lucasschirm/session-analyzer#packages/plugins/devin-session-sync --ref=main
63
+ ```
64
+
65
+ Use **either** `--sha` or `--ref`, not both.
66
+
67
+ ### From a local clone (for development)
68
+
69
+ Build the plugin bundle first, then install from the local path:
70
+
71
+ ```bash
72
+ pnpm --filter @lucasschirm/devin-session-sync build
73
+ devin plugins install ./packages/plugins/devin-session-sync
74
+ ```
75
+
76
+ The build produces self-contained executables in `bin/` (no `node_modules`
77
+ required at runtime):
78
+
79
+ ```
80
+ bin/session-start # SessionStart hook entry point
81
+ bin/session-end # SessionEnd hook entry point
82
+ bin/hook # Generic hook entry
83
+ bin/watcher # Watermark / state watcher
84
+ bin/devin-sync # Standalone CLI for manual sync/list/download
85
+ ```
86
+
87
+ The npm package also publishes the `devin-session-sync` bin name as an alias for
88
+ `devin-sync`.
89
+
90
+ ## Standalone CLI
91
+
92
+ In addition to the Devin CLI hooks, this package ships a standalone CLI
93
+ (`devin-sync`) for manually uploading, listing, and downloading sessions from
94
+ S3 storage. It is useful for backfilling historical sessions, inspecting what
95
+ has been synced, or restoring data to a new machine.
96
+
97
+ ### Installation
98
+
99
+ The CLI is included in the same npm package. You can run it via `npx` without
100
+ installing anything:
101
+
102
+ ```bash
103
+ npx @lucasschirm/devin-session-sync -v
104
+ ```
105
+
106
+ Or install it globally for shorter commands:
107
+
108
+ ```bash
109
+ npm install -g @lucasschirm/devin-session-sync
110
+ devin-sync -v
111
+ ```
112
+
113
+ ### Commands
114
+
115
+ ```
116
+ devin-sync sync # Upload all local sessions to S3
117
+ devin-sync sync --force # Re-upload all sessions, ignoring local state
118
+ devin-sync list # List all projects in storage
119
+ devin-sync list --current # List sessions for the current project
120
+ devin-sync list <project-id> # List sessions for a project
121
+ devin-sync download --session-id=<id> --output=<dir>
122
+ devin-sync download all --output=<dir>
123
+ devin-sync remove <project-id> # Dry run: list what would be removed
124
+ devin-sync remove <project-id> --yes
125
+ devin-sync migrate # Dry run: list old-format keys and missing manifests
126
+ ```
127
+
128
+ Run `devin-sync --help` for the full command reference.
129
+
130
+ ### Configuration
131
+
132
+ The CLI and plugin read configuration from environment variables, falling back to
133
+ `.devin/config.local.json` and `.devin/config.json` `env` keys. Required
134
+ variables are the same as the sync engine:
135
+
136
+ | Variable | Description |
137
+ | --------------------------- | ------------------------------------------------ |
138
+ | `SAL_PROJECT_ID` | Unique project identifier. |
139
+ | `SAL_STORAGE_TYPE` | Storage backend (`s3` only today). |
140
+ | `SAL_STORAGE_BUCKET` | S3 bucket name. |
141
+ | `SAL_STORAGE_REGION` | AWS region. |
142
+ | `SAL_STORAGE_ACCESS_KEY_ID` | AWS access key ID. |
143
+ | `SAL_STORAGE_SECRET_ACCESS_KEY` | AWS secret access key. |
144
+
145
+ See the sync engine documentation for the full option list and LocalStack
146
+ configuration.
147
+
148
+ ## Distribution note
149
+
150
+ - The Claude plugin is listed in the repository's
151
+ [`.claude-plugin/marketplace.json`](../../../.claude-plugin/marketplace.json);
152
+ that file intentionally contains only the Claude plugin.
153
+ - Devin's plugin installer does not consume a `marketplace.json` file. The devin
154
+ plugin is distributed **only** via direct git-subdir install:
155
+ `devin plugins install lucasschirm/session-analyzer#packages/plugins/devin-session-sync`.
156
+ There is no devin `marketplace.json` equivalent, and adding one would not be
157
+ consumed by the installer.
158
+
159
+ ## Publishing
160
+
161
+ This package is auto-published by `.github/workflows/version-patch.yml` on every
162
+ push to `main`, alongside the Claude plugin. It shares the same esbuild-bundled,
163
+ provenance-enabled, public npm publish path.
164
+
165
+ ## Development
166
+
167
+ ```bash
168
+ # Build the plugin
169
+ pnpm --filter @lucasschirm/devin-session-sync build
170
+
171
+ # Run tests
172
+ pnpm --filter @lucasschirm/devin-session-sync test
173
+
174
+ # Typecheck
175
+ pnpm --filter @lucasschirm/devin-session-sync typecheck
176
+
177
+ # Lint
178
+ pnpm --filter @lucasschirm/devin-session-sync lint
179
+ ```
180
+
181
+ ## License
182
+
183
+ ISC