@anna-ai/app-runtime 0.27.0 → 0.28.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.
Files changed (3) hide show
  1. package/README.md +11 -10
  2. package/dist/index.js +29 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -47,8 +47,11 @@ anna.on("entry_payload", (p) => console.log(p));
47
47
  { kind: "req"|"res"|"event", id, ns, method, args | result | error }
48
48
  ```
49
49
 
50
- The host validates every call against the app's manifest ACL before
51
- forwarding to the backend.
50
+ Every method is available to an installed App — there is no manifest ACL.
51
+ Only `credentials.*` (declared provider ids), `share.*`
52
+ (`ui.host_api.share = true`), cross-boundary `storage.*`
53
+ scopes (`manifest.storage.scopes`) and host-kit agent tools
54
+ (`ui.host_api.agent.tools`) consult the manifest.
52
55
 
53
56
  ## RPC timeouts
54
57
 
@@ -71,6 +74,7 @@ const out = await anna.image.generate(
71
74
  | `upload.*` | 120 s | Large multipart / negotiate+confirm |
72
75
  | `agent.*` | 300 s | `session.run` loops model + tools many turns |
73
76
  | `llm.*` | 180 s | Long completions / large context |
77
+ | `share.*` | 120 s | `publish` server-side-copies up to 200 snapshot files |
74
78
  | everything else | 30 s | storage / chat / window / prefs / fs / tools / artifact |
75
79
 
76
80
  The timeout is a *client-side* deadline. The host bridge fetch has no
@@ -132,7 +136,7 @@ for await (const ev of sess.run({ content: prompt, maxTokens: 16384 })) {
132
136
 
133
137
  The dashboard tells every App which **theme** and **UI language** the user
134
138
  chose, so Apps no longer guess from `prefers-color-scheme` / `navigator.language`.
135
- No manifest grant is involved — these are one-way host→app broadcasts (like
139
+ These are one-way host→app broadcasts (like
136
140
  `auth.refresh`), never callable RPC methods.
137
141
 
138
142
  ```js
@@ -162,8 +166,8 @@ than this release send neither — the SDK falls back to `prefers-color-scheme`
162
166
 
163
167
  ## Media generation (v0.20.0)
164
168
 
165
- Async video jobs + sync audio, gated by the per-app `media_grant`
166
- (manifest must declare `ui.host_api.video` / `.audio`):
169
+ Async video jobs + sync audio — available to every installed App (CU quota is
170
+ the only gate):
167
171
 
168
172
  ```js
169
173
  // One-shot sugar: submit + media_job events + getJob polling fallback
@@ -191,8 +195,7 @@ const catalog = await anna.llm.catalog({ serviceType: "video_gen" });
191
195
  ### Music generation (v0.23.0)
192
196
 
193
197
  Async music jobs (`mjob_…`) with the exact same job API, `media_job` events and
194
- pre-hold → settle → refund billing as video. Requires `ui.host_api.music` +
195
- per-app `media_grant.music`.
198
+ pre-hold → settle → refund billing as video.
196
199
 
197
200
  ```js
198
201
  // Capability discovery first — models differ (lyrics vs prompt-embedded lyrics,
@@ -225,9 +228,7 @@ await anna.music.generate({ prompt: "ambient pad", model: "fal-ai/ace-step", dur
225
228
  2K/4K or `quality: "high"` renders (60–120 s) opt into the same async-job shape
226
229
  as video / music — `ijob_…` ids, `media_job` events, pre-hold → settle (on the
227
230
  actual number of images) → refund — and re-sign any already-paid artifact for
228
- 7 days instead of losing it after the 30-min URL TTL. Requires
229
- `ui.host_api.image` listing the new method names + the existing `image_grant`
230
- (`allowGenerate` / `allowEdit`; no new grant).
231
+ 7 days instead of losing it after the 30-min URL TTL.
231
232
 
232
233
  ```js
233
234
  // Same request body as image.generate, plus clientTag / idempotencyKey.
package/dist/index.js CHANGED
@@ -1,5 +1,12 @@
1
1
  /**
2
- * Anna App Runtime SDK — v0.27.0
2
+ * Anna App Runtime SDK — v0.28.0
3
+ *
4
+ * v0.28.0 — Public share links (design:
5
+ * docs/design/app-public-share-static-hosting.md; dispatcher 0.34.0,
6
+ * schema 0.34.0, anna-app-core 0.29.0). Additive:
7
+ * - `anna.share.publish/list/revoke/update` — publish rendered static
8
+ * snapshots (APS objects) to platform-hosted, long-lived, revocable
9
+ * public URLs. Requires manifest `ui.host_api.share = true`.
3
10
  *
4
11
  * v0.27.0 — Thinking / reasoning control (forum #454; design:
5
12
  * docs/design/llm-thinking-control.md; dispatcher 0.32.0, schema 0.32.0,
@@ -449,6 +456,10 @@
449
456
  // browser→R2 PUT itself is direct (not via this SDK), but the host
450
457
  // round-trip for finalize needs DB+R2 head ~ up to a few seconds.
451
458
  files: 60000,
459
+ // `share.publish` server-side CopyObjects up to 200 snapshot files to
460
+ // the public prefix before returning; list/revoke/update are quick but
461
+ // share the namespace default.
462
+ share: 120000,
452
463
  // `web.*` — search is usually <5s but fetch crawls up to 10 pages with
453
464
  // a 30s per-page budget under host-side concurrency limits. Apps doing
454
465
  // large fetch batches should pass { timeoutMs: 90000 } per call.
@@ -2151,6 +2162,23 @@ var AnnaVoiceClientCore = (function () {
2151
2162
  // user-enabled per-app credentials_grant.
2152
2163
  this.credentials = buildNamespace(this, "credentials");
2153
2164
 
2165
+ // ---- share namespace (v0.28.0; public share links) ----
2166
+ // anna.share.publish({paths, entry, title, description?,
2167
+ // thumbnail_path?, path_map?, expires_at?, pub_id?})
2168
+ // → {pub_id, url, version, entry, title, total_bytes, file_count,
2169
+ // status, expires_at, created_at}
2170
+ // Snapshots finalized APS objects (scope=app self) into a
2171
+ // platform-hosted, long-lived public URL. Passing `pub_id`
2172
+ // republishes (URL unchanged, version += 1).
2173
+ // anna.share.list({cursor?, limit?}) → {items, next_cursor}
2174
+ // anna.share.revoke({pub_id}) — tombstones the URL immediately
2175
+ // (CDN residue <= 5 min) and releases quota bytes.
2176
+ // anna.share.update({pub_id, title?, description?, expires_at?})
2177
+ // — metadata only; never touches the snapshot.
2178
+ // Requires manifest ui.host_api.share = true (second-principal
2179
+ // declaration; design app-public-share-static-hosting.md §5).
2180
+ this.share = buildNamespace(this, "share");
2181
+
2154
2182
  // ---- mobile namespace (v0.16.0; anna-mobile native bridge) ----
2155
2183
  // anna.mobile.share({title?, text?, url?, filename?, data_url?})
2156
2184
  // → {shared} (user cancel = {shared:false}, not an error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anna-ai/app-runtime",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "Anna App browser runtime SDK. Loaded by every Anna App iframe; provides typed proxy over the postMessage RPC bridge to the host (Anna dashboard / `anna-app dev` harness).",
5
5
  "license": "MIT",
6
6
  "type": "module",