@canarycoders/ai 0.5.0 → 0.7.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
@@ -4,7 +4,7 @@ TypeScript SDK for the [CanaryCoders AI](https://ai.canarycoders.es) gateway. Ru
4
4
 
5
5
  **Docs:** https://docs.ai.canarycoders.es
6
6
 
7
- One client covers chat, image/video/audio generation, embeddings, vision, conversational agents, realtime sessions, and usage data. The queue polling, SSE streaming, retries, and error typing are handled for you, so most calls are a single `await`.
7
+ One client covers chat, image/video/audio generation, embeddings, vision, OCR/PII-redaction, conversational agents, realtime sessions, and usage data. The queue polling, SSE streaming, retries, and error typing are handled for you, so most calls are a single `await`.
8
8
 
9
9
  ## Install
10
10
 
@@ -77,6 +77,20 @@ const song = await client.audio.music({ prompt: "calm lo-fi", durationMs: 20000
77
77
  const { detections } = await client.vision.detect({ image });
78
78
  ```
79
79
 
80
+ ## OCR and PII redaction (local)
81
+
82
+ Text recognition with bounding boxes and PII redaction, processed fully on CanaryLLM's own EU infrastructure (Apple Vision). Images and extracted text are never stored.
83
+
84
+ ```ts
85
+ const { text, lines } = await client.ocr.recognize({ image, granularity: "word" });
86
+
87
+ const { redactedImage, counts } = await client.ocr.redact({
88
+ image,
89
+ presets: ["email", "phone", "iban"],
90
+ style: "blur", // "box" is the safest for hard PII redaction
91
+ });
92
+ ```
93
+
80
94
  ## Embeddings
81
95
 
82
96
  Embed text into vectors with a local model (LM Studio), for customer-side RAG. The gateway processes the text transiently and stores nothing — you keep the vectors and documents in your own store (e.g. pgvector, sqlite-vec).
@@ -161,6 +175,10 @@ await oa.chat.completions.create({
161
175
  | `defaultTag` | — | attached to requests for usage attribution |
162
176
  | `poll` | — | default poll timing for queued ops |
163
177
 
178
+ ## Agent skill
179
+
180
+ `skills/canary-ai/` ships a Codex/Claude Code Agent Skill that drives the gateway (research, X search, chat, image generation, model discovery) from a single Bun script, no MCP server needed. See [docs.ai.canarycoders.es/agent-skill](https://docs.ai.canarycoders.es/agent-skill) for install/update/uninstall steps. It's a plain repo folder, not part of the published npm package.
181
+
164
182
  ## Keeping types in sync
165
183
 
166
184
  The gateway API is the source of truth. Regenerate types from its OpenAPI spec and diff them against the hand-written ones:
package/dist/index.cjs CHANGED
@@ -1588,6 +1588,27 @@ var VisionResource = class extends BaseResource {
1588
1588
  }
1589
1589
  };
1590
1590
 
1591
+ // src/resources/ocr.ts
1592
+ var OcrResource = class extends BaseResource {
1593
+ recognize(params, poll) {
1594
+ return this.runQueued("/api/ocr/recognize", params, "vision", poll);
1595
+ }
1596
+ recognizeJob(params, signal) {
1597
+ return this.submitQueued("/api/ocr/recognize", params, "vision", signal);
1598
+ }
1599
+ redact(params, poll) {
1600
+ return this.runQueued("/api/ocr/redact", params, "vision", poll);
1601
+ }
1602
+ redactJob(params, signal) {
1603
+ return this.submitQueued("/api/ocr/redact", params, "vision", signal);
1604
+ }
1605
+ async languages(signal) {
1606
+ return this.transport.json("GET", "/api/ocr/languages", {
1607
+ signal
1608
+ });
1609
+ }
1610
+ };
1611
+
1591
1612
  // src/client.ts
1592
1613
  var DEFAULT_BASE_URL = "https://api.ai.canarycoders.es";
1593
1614
  function readEnv(key) {
@@ -1602,6 +1623,7 @@ var CanaryCodersAI = class {
1602
1623
  audio;
1603
1624
  embeddings;
1604
1625
  vision;
1626
+ ocr;
1605
1627
  conversations;
1606
1628
  agents;
1607
1629
  realtime;
@@ -1634,6 +1656,7 @@ var CanaryCodersAI = class {
1634
1656
  this.audio = new AudioResource(this.transport, poll);
1635
1657
  this.embeddings = new EmbeddingsResource(this.transport, poll);
1636
1658
  this.vision = new VisionResource(this.transport, poll);
1659
+ this.ocr = new OcrResource(this.transport, poll);
1637
1660
  this.conversations = new ConversationsResource(this.transport, poll);
1638
1661
  this.agents = new AgentsResource(this.transport, poll);
1639
1662
  this.realtime = new RealtimeResource(this.transport, poll);