@aastrika/ai-elements 0.4.0 → 0.4.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +14 -68
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,29 @@ see at a glance what to expect when they upgrade.
6
6
  Versions follow semver: a **minor** adds something, a **patch** fixes something,
7
7
  and neither removes anything a host was using.
8
8
 
9
+ ## 0.4.1
10
+
11
+ **Fixed**
12
+ - This page now renders on npm. The architecture diagram was mermaid, which npm
13
+ shows as raw source, and the callouts used GitHub alert syntax. No code change
14
+
15
+ ## 0.4.0
16
+
17
+ **Changed**
18
+ - Generating a quiz now starts the work and polls for it, instead of waiting on
19
+ one long request. Nothing to change in your code — same tag, same inputs, same
20
+ `assessmentReady` firing once with the finished set
21
+
22
+ **Why it matters**
23
+ - No 60-second ceiling: gateways and proxies commonly close a request at one
24
+ minute, which capped how many languages could be asked for at once
25
+ - The progress shown is the server's own, not an estimate
26
+ - Closing the tab no longer loses the work
27
+
28
+ **Notes for integrators**
29
+ - Upgrade the service and the package together. A 0.3.0 element cannot read what
30
+ a 0.4.0 service answers, and the reverse leaves the element waiting
31
+
9
32
  ## 0.3.0
10
33
 
11
34
  **Added**
package/README.md CHANGED
@@ -56,7 +56,6 @@ same questions, same answer key, ready to download.
56
56
 
57
57
  </div>
58
58
 
59
- > [!IMPORTANT]
60
59
  > **You also need gateway access.** This package authenticates nobody — your
61
60
  > gateway decides. See [Access](#access) for the groups each feature needs.
62
61
 
@@ -67,7 +66,6 @@ same questions, same answer key, ready to download.
67
66
  | | |
68
67
  |---|---|
69
68
  | **[The three features](#the-three-features)** | What each element actually does |
70
- | **[Setup](#setup)** | Install · access · configure · mount |
71
69
  | **[Configuration](#configuration)** | The three values, and why two are functions |
72
70
  | **[Access](#access)** | Which gateway groups each feature needs |
73
71
  | **[Inputs and events](#inputs-and-events)** | Open the form set up, act on the result |
@@ -133,7 +131,6 @@ fixes wording in place; the correct option is shared, so it is set once.
133
131
  Totals for videos, assessments, people and estimated spend, split by tool, with
134
132
  a searchable table of creators.
135
133
 
136
- > [!WARNING]
137
134
  > **Needs `contentAdmin`, and most consumers should not have it.** Spend figures
138
135
  > are not for a partner's ordinary users. The service applies no role check of
139
136
  > its own — the gateway's ACL is the only thing keeping them apart.
@@ -142,20 +139,6 @@ a searchable table of creators.
142
139
 
143
140
  ---
144
141
 
145
- ## Setup
146
-
147
- The [Quick start](#ship-it-in-three-steps) above is the whole integration. What each step
148
- is actually doing:
149
-
150
- | | Step | Notes |
151
- |---|---|---|
152
- | **1** | `npm i @aastrika/ai-elements` | No peer dependencies, no framework to match. Any bundler, or none |
153
- | **2** | Get gateway access | The package authenticates nobody — your gateway decides. See [Access](#access), then ask the Aastrika platform team |
154
- | **3** | `configure({ ... })` | Once, before the first element renders. Two of the three values are **functions** — see [Configuration](#configuration) |
155
- | **4** | Write the tag | Registration happens on import, so there is no third step |
156
-
157
- ---
158
-
159
142
  <details>
160
143
  <summary><b>React · Angular · Vue · plain HTML</b></summary>
161
144
 
@@ -264,40 +247,19 @@ calling it, as above, prevents both.
264
247
 
265
248
  ## How it fits together
266
249
 
267
- ```mermaid
268
- flowchart LR
269
- subgraph host["Your application"]
270
- cfg["configure()"]
271
- tag["&lt;aastrika-content-studio&gt;"]
272
- end
273
-
274
- subgraph pkg["@aastrika/ai-elements"]
275
- el["Custom element"]
276
- int["Interceptor"]
277
- end
278
-
279
- subgraph svc["Aastrika"]
280
- gw["Gateway<br/>checks the token"]
281
- api["AI service"]
282
- end
283
-
284
- cfg -.->|apiBase · auth · creator| int
285
- tag --> el
286
- el --> int
287
- int -->|"Authorization<br/>creator in the body"| gw
288
- gw --> api
289
- api -.->|JSON| el
290
- el -.->|onError| cfg
291
-
292
- classDef a fill:#0F766E,stroke:none,color:#fff
293
- classDef b fill:#f1f5f4,stroke:#cbd5d3,color:#16181d
294
- class el,int a
295
- class cfg,tag,gw,api b
250
+ ```
251
+ Your application @aastrika/ai-elements Aastrika
252
+ ──────────────── ───────────────────── ────────
253
+ configure() ─────── apiBase ───▶ interceptor ─── Authorization ───▶ gateway
254
+ auth ▲ creator in body │
255
+ creator │ ▼
256
+ <aastrika-… > ────────────────▶ element ◀────────── JSON ──────── AI service
257
+ ▲ │
258
+ └──── onError ────┘
296
259
  ```
297
260
 
298
- **Your application supplies three values. The package does the rest** — builds
299
- every request from `apiBase`, calls your two functions on each one, and renders
300
- into your page, styled through CSS custom properties.
261
+ Your application supplies three values. The package builds every request from
262
+ `apiBase`, calls your two functions on each one, and renders into your page.
301
263
 
302
264
  ---
303
265
 
@@ -325,7 +287,6 @@ getAuthHeaders: async () => ({ Authorization: `Bearer ${await auth.token()}` }),
325
287
  The same goes for `creator`: a function lets you switch user without reloading
326
288
  the page.
327
289
 
328
- > [!NOTE]
329
290
  > **`creator` is attribution, not identity.** It is recorded against whatever
330
291
  > the call creates and the usage report groups by it. Nothing verifies it — the
331
292
  > gateway decides whether the call is allowed at all.
@@ -348,7 +309,6 @@ needs:
348
309
  Deleting anything needs `contentAdmin` as well. Without `contentUpdate` the
349
310
  features still work, but the revise step returns 403.
350
311
 
351
- > [!CAUTION]
352
312
  > **`generate-video` is the only call that spends real money**, and it sits on a
353
313
  > deliberately low rate limit. Users see a cost estimate before triggering it.
354
314
 
@@ -434,21 +394,7 @@ All are **starting values** the user can still change.
434
394
  </aastrika-content-studio>
435
395
  ```
436
396
 
437
- ### One quiz, several languages
438
-
439
- `default-translate-into` produces the **same** questions in other languages —
440
- same order, same options, same answer key — so one answer key marks every
441
- language and scores compare across them.
442
-
443
- ```html
444
- <aastrika-assessment default-language="hi" default-translate-into="en,mr">
445
- </aastrika-assessment>
446
- ```
447
-
448
- The reviewer gets a tab per language. Excel holds every language, one sheet
449
- each; CSV holds one language at a time.
450
-
451
- `assessmentReady` reports what came back:
397
+ ### Translations, in the event
452
398
 
453
399
  ```js
454
400
  el.addEventListener('assessmentReady', (e) => {
@@ -459,8 +405,8 @@ el.addEventListener('assessmentReady', (e) => {
459
405
 
460
406
  `languages` can be shorter than what was asked for. A translation is checked for
461
407
  question count, ids, answer key, clinical numbers and script; one that fails is
462
- dropped rather than stored wrong. What is **not** checked is whether the
463
- translation reads well — that still needs someone who speaks the language.
408
+ dropped rather than stored wrong. What is **not** checked is whether it reads
409
+ well — that still needs someone who speaks the language.
464
410
 
465
411
  ### Events
466
412
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aastrika/ai-elements",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "AI Content Studio, Assessment and Reports as custom elements. Works in React, Vue, Angular or plain HTML.",
5
5
  "type": "module",
6
6
  "main": "./aastrika-elements.js",