sketchi 0.1.1 → 0.2.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.
package/README.md CHANGED
@@ -15,9 +15,10 @@
15
15
  <a href="https://github.com/shpitdev/sketchi/blob/main/LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-2F855A" /></a>
16
16
  </p>
17
17
 
18
- Sketchi stores canonical diagram documents and deterministic Excalidraw artifacts
19
- under `~/.sketchi/diagrams`. Its manual workflow stays local; generation is one
20
- explicit, credential-free network command.
18
+ Sketchi stores canonical diagram documents and authoritative Excalidraw artifacts
19
+ under `~/.sketchi/diagrams`. Its manual and recovery workflows stay local;
20
+ generation and encrypted snapshot exchange are explicit, credential-free network
21
+ commands.
21
22
 
22
23
  ## Install
23
24
 
@@ -90,8 +91,75 @@ sketchi generate --prompt "Map release approval with pass and revise branches"
90
91
  sketchi generate --prompt "Organize launch readiness" --type mindmap --output json
91
92
  ```
92
93
 
93
- It requires no API key, token, account, or login. It is the CLI's only network
94
- boundary.
94
+ It requires no API key, token, account, or login. `generate`, `share`, and
95
+ `pull` are the CLI's three explicit network commands; each makes one HTTPS
96
+ request.
97
+
98
+ ## Share, pull, and restore browser edits
99
+
100
+ Create an immutable encrypted Excalidraw snapshot link from the record's current
101
+ authoritative artifact:
102
+
103
+ ```sh
104
+ sketchi share release-flow
105
+ sketchi share release-flow --open --output json
106
+ ```
107
+
108
+ The URL is a bearer secret: anyone who receives the complete URL can decrypt the
109
+ snapshot. Encryption hides the drawing from the storage service, but the service
110
+ can observe connection metadata, timing, and ciphertext size. Retention is
111
+ uncontrolled and may be indefinite; Sketchi cannot revoke or delete a link.
112
+ `--open` is opt-in, discloses the URL to the local opener and browser history,
113
+ and reports only whether the OS accepted the request—not whether a visible
114
+ window opened.
115
+
116
+ Browser edits do not update an existing link. In Excalidraw choose
117
+ **Save to… → Export to Link**, then pull the newly exported link:
118
+
119
+ ```sh
120
+ sketchi pull release-flow --link 'https://excalidraw.com/#json=ID,KEY'
121
+ printf '%s\n' 'https://excalidraw.com/#json=ID,KEY' | sketchi pull release-flow --link -
122
+ ```
123
+
124
+ The linked drawing has no trusted Sketchi identity and may be unrelated to
125
+ `release-flow`. A successful pull preserves the complete prior record under
126
+ `revisions/`, removes any stale stored PNG, and makes `diagram.excalidraw` the
127
+ sole authoritative artifact. `show` and `list` then report `authority:
128
+ "detached"` and `documentAuthoritative: false`; retained `document.json` and
129
+ `scene.json` are provenance only. Detached `edit` refuses, scene export is
130
+ unavailable, and on-demand PNG renders directly from `diagram.excalidraw` using
131
+ its background without a stale canonical title.
132
+
133
+ Recover any retained full snapshot through the strictly offline CLI:
134
+
135
+ ```sh
136
+ sketchi restore release-flow --revision 1
137
+ ```
138
+
139
+ Restore archives the displaced current state first, does not consume the chosen
140
+ snapshot, and advances revision numbering monotonically. New edit/pull/restore
141
+ history uses full `revisions/000001/` authority snapshots; legacy
142
+ `revisions/000001.json` document revisions remain restorable on canonical
143
+ records.
144
+
145
+ Share/pull v1 supports exactly `rectangle`, `ellipse`, `diamond`, `arrow`,
146
+ `line`, `freedraw`, and `text`. Text must use Excalifont `fontFamily` id `5`.
147
+ Images, non-empty `files`, frames, embeddables, iframes, external resources,
148
+ custom fonts, libraries, and unknown element types are rejected. Compatibility
149
+ is pinned to Excalidraw `e6ae6bf` and excalidraw-store `76de642`; both commands
150
+ use the unofficial `json.excalidraw.com` API without retries.
151
+
152
+ The enforced v1 bounds are a 4 KiB bearer link, 2 MiB encrypted body, 16 MiB
153
+ inflated contents, 10,000 elements, and JSON depth 64. Before any raster
154
+ allocation, Sketchi also limits each element dimension to 8,192 units, each
155
+ canvas dimension to 8,192 units, canvas area to 4,194,304 square units, and the
156
+ final PNG to 16,777,216 pixels. Share enforces its compressed-output budget
157
+ while streaming and reserves framing plus encryption overhead before encryption.
158
+ Pull requires exactly one literal root
159
+ `https://excalidraw.com/#json=ID,KEY` or
160
+ `https://www.excalidraw.com/#json=ID,KEY` URL (or one such URL through stdin);
161
+ userinfo, ports, query strings, alternate spellings, and repeated `--link`
162
+ flags are rejected.
95
163
 
96
164
  ## Shell completions
97
165
 
@@ -133,17 +201,20 @@ source ~/.sketchi/completions/sketchi.fish
133
201
 
134
202
  ## For AI agents
135
203
 
136
- The five deterministic commands—`create`, `show`, `edit`, `list`, and
137
- `export`—are fully offline and require no credentials, account, browser, model,
138
- or MCP server. They never send stored records to a provider. Agents can use
204
+ The six deterministic commands—`create`, `show`, `edit`, `list`, `export`, and
205
+ `restore`—are fully offline and require no credentials, account, browser, model,
206
+ or MCP server. Those six commands never send stored records to a provider.
207
+ Agents can use
139
208
  `--output json`, complete noninteractive input through `--json` or `--file`, and
140
209
  raw artifact output through `export --dest -` without prompts.
141
210
 
142
211
  After exporting PNG to a file, agents can follow the returned hint to display
143
212
  that path as an inline Markdown image for the user.
144
213
 
145
- `generate` is deliberately separate: it uses the public Sketchi API, remains
146
- credential-free, and is the only command that uses the network.
214
+ `generate`, `share`, and `pull` are deliberately separate, explicit network
215
+ commands. They remain credential-free and each makes one HTTPS request. Share
216
+ is randomized by its key and IV; pull depends on remote availability and
217
+ untrusted input, so neither belongs to determinism claims.
147
218
 
148
219
  ## License
149
220
 
@@ -158,6 +229,9 @@ availability details.
158
229
  sketchi --help
159
230
  sketchi create --help
160
231
  sketchi generate --help
232
+ sketchi share --help
233
+ sketchi pull --help
234
+ sketchi restore --help
161
235
  ```
162
236
 
163
237
  Source, issue tracking, and architecture documentation live in the
@@ -41,6 +41,31 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41
41
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
42
  SOFTWARE.
43
43
 
44
+ pako 2.0.3
45
+ -----------
46
+
47
+ The MIT License
48
+
49
+ Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn
50
+
51
+ Permission is hereby granted, free of charge, to any person obtaining a copy
52
+ of this software and associated documentation files (the "Software"), to deal
53
+ in the Software without restriction, including without limitation the rights
54
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
55
+ copies of the Software, and to permit persons to whom the Software is
56
+ furnished to do so, subject to the following conditions:
57
+
58
+ The above copyright notice and this permission notice shall be included in
59
+ all copies or substantial portions of the Software.
60
+
61
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
62
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
63
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
64
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
65
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
66
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
67
+ THE SOFTWARE.
68
+
44
69
  Excalifont
45
70
  -----------
46
71