@standardagents/sip 0.13.1 → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Standard Agents <justin@standardagents.ai>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -17,6 +17,40 @@
17
17
  pnpm add @standardagents/sip
18
18
  ```
19
19
 
20
+ ## Docs Site
21
+
22
+ The repo includes a small static documentation site built with Arrow and Vite.
23
+
24
+ ```bash
25
+ pnpm docs:dev
26
+ pnpm docs:build
27
+ pnpm docs:preview
28
+ ```
29
+
30
+ - Source files live in `docs/`
31
+ - The production build outputs to `docs-dist/`
32
+
33
+ ## Release
34
+
35
+ Publishing is handled by GitHub Actions with npm trusted publishing. The workflow
36
+ publishes from version tags and does not use an `NPM_TOKEN`.
37
+
38
+ ```bash
39
+ pnpm verify
40
+ pnpm verify:release
41
+ pnpm release
42
+ pnpm release:next
43
+ pnpm release:dev
44
+ ```
45
+
46
+ - `pnpm release` on `main` bumps `package.json`, commits the new stable version, and pushes the branch plus the `vX.Y.Z` tag
47
+ - `pnpm release:next` and `pnpm release:dev` create a temporary tagged commit like `v1.1.1-next.231fa`, push only the tag, then restore your local branch to the original version
48
+ - You can pass `--bump=major|minor|patch` and `--tag=<dist-tag>` to the release script directly
49
+ - Stable tags create GitHub release notes after a successful npm publish; pre-release tags skip that step
50
+
51
+ Trusted publishing must be configured in npm for the `standardagents/sip`
52
+ repository and `.github/workflows/publish.yml`.
53
+
20
54
  ## Usage
21
55
 
22
56
  ```typescript
@@ -131,7 +165,6 @@ cd emsdk && ./emsdk install latest && ./emsdk activate latest
131
165
  source ./emsdk_env.sh
132
166
 
133
167
  # Build WASM
134
- cd packages/sip
135
168
  pnpm build:wasm
136
169
  ```
137
170
 
@@ -141,19 +174,23 @@ This downloads libjpeg-turbo, compiles it to WASM, and generates:
141
174
 
142
175
  ### Using WASM
143
176
 
144
- To enable streaming mode, register the WASM loader before processing:
177
+ For Cloudflare Workers and other workerd-based runtimes, the package wires up
178
+ the emitted WASM for you. The normal path is just:
145
179
 
146
180
  ```typescript
147
- import { sip } from '@standardagents/sip';
148
- import createSipModule from '@standardagents/sip/dist/sip.js';
181
+ import { ready, transform, collect } from '@standardagents/sip';
149
182
 
150
- // Register WASM loader (once at startup)
151
- globalThis.__SIP_WASM_LOADER__ = async () => createSipModule();
183
+ await ready();
152
184
 
153
- // Now sip.process() will use streaming for JPEG
154
- const result = await sip.process(jpegBuffer, { maxWidth: 2048 });
185
+ const image = transform(request.body ?? request, { width: 2048, height: 2048 });
186
+ const result = await collect(image);
155
187
  ```
156
188
 
189
+ If you need to override the default loader, `ready({ wasm })` still accepts a
190
+ compiled `WebAssembly.Module` or raw WASM bytes. The
191
+ `globalThis.__SIP_WASM_LOADER__` hook still exists as an internal escape hatch,
192
+ but it is not the intended public setup API.
193
+
157
194
  ## Architecture
158
195
 
159
196
  ```