@mitralab.io/platform-sdk 1.7.0-beta.2 → 1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## 1.7.0
6
+
7
+ Stable release of the 1.7.0-beta line, with `@mitralab.io/sdk-core@0.3.0`.
8
+
9
+ - Depend on `@mitralab.io/sdk-core@0.3.0`, the agent session that follows T3. A message sent while
10
+ a reply runs no longer waits in a local queue of the SDK: it goes to the box at once, with no mode
11
+ by default, and T3 decides, steering it into the running turn or queueing it.
12
+ `send(prompt, { mode: "queue" | "steer" })` asks on purpose. `session.history` is the live
13
+ conversation in the box's order (asked with `kinds=all`), with a tool's call and result as two
14
+ items, as in 0.2.13, the question as the person wrote it, and T3's approvals and mid-turn
15
+ questions where they came. `queue` mirrors T3's queue, with `steerQueueItem`, `resumeQueue` and
16
+ `backgroundTasks`. The history keeps the 0.2.13 format; against an old box the new functions show
17
+ nothing.
18
+ - `agentTasks.session(...).send` returns the id of the message the core sends (its
19
+ `clientMessageId`); a prompt held while the browser is offline returns `undefined`.
20
+ - Includes `auth.allTokens.backoffice` and `auth.ensureFreshBackofficeToken()` from 1.7.0-beta.0.
21
+
5
22
  ## 1.7.0-beta.0
6
23
 
7
24
  - `auth.allTokens` gains a fourth family, `backoffice`: the access token of the person's own
package/README.md CHANGED
@@ -42,6 +42,7 @@ No app gerado pelo Code Studio, `VITE_MITRA_APP_ID` e `VITE_MITRA_API_URL` já v
42
42
  - `functions`: `execute` espera o resultado da Server Function; `executeAsync` devolve a execução para acompanhar com `getExecution` ou parar com `cancelExecution`. `publicFunctions` chama as Functions publicadas como públicas, sem login.
43
43
  - `integration.executeByAlias(alias, request)`: chama uma API externa configurada no app. A credencial do provedor fica na Mitra e não passa pelo browser.
44
44
  - `agentTasks.session(...)`: chat com agente, com `send`, `sendAndWait`, `cancel` e eventos como `delta`, `turnEnd` e `error`.
45
+ `send` devolve o id da mensagem; com o browser offline a mensagem espera a rede e `send` devolve `undefined`.
45
46
  - `agentCredentials`: credenciais de provedor de IA e modelos disponíveis.
46
47
 
47
48
  Login por código no e-mail, para quem monta a própria tela:
package/dist/index.cjs CHANGED
@@ -2349,11 +2349,9 @@ function holdSendsWhileOffline(session, outbox) {
2349
2349
  };
2350
2350
  },
2351
2351
  send: (prompt, options) => {
2352
- if (passThrough(prompt)) {
2353
- session.send(prompt, options);
2354
- return;
2355
- }
2352
+ if (passThrough(prompt)) return session.send(prompt, options);
2356
2353
  void outbox.holdUntilOnline(session, session.taskId, () => session.send(prompt, options)).catch(() => void 0);
2354
+ return void 0;
2357
2355
  },
2358
2356
  sendAndWait: (prompt, options) => {
2359
2357
  if (passThrough(prompt)) return session.sendAndWait(prompt, options);
package/dist/index.js CHANGED
@@ -2312,11 +2312,9 @@ function holdSendsWhileOffline(session, outbox) {
2312
2312
  };
2313
2313
  },
2314
2314
  send: (prompt, options) => {
2315
- if (passThrough(prompt)) {
2316
- session.send(prompt, options);
2317
- return;
2318
- }
2315
+ if (passThrough(prompt)) return session.send(prompt, options);
2319
2316
  void outbox.holdUntilOnline(session, session.taskId, () => session.send(prompt, options)).catch(() => void 0);
2317
+ return void 0;
2320
2318
  },
2321
2319
  sendAndWait: (prompt, options) => {
2322
2320
  if (passThrough(prompt)) return session.sendAndWait(prompt, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mitralab.io/platform-sdk",
3
- "version": "1.7.0-beta.2",
3
+ "version": "1.7.0",
4
4
  "description": "JavaScript/TypeScript SDK for building apps on the Mitra Platform",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -62,7 +62,7 @@
62
62
  "url": "https://github.com/mitralab-dev/mitra-platform-sdk/issues"
63
63
  },
64
64
  "dependencies": {
65
- "@mitralab.io/sdk-core": "0.2.13",
65
+ "@mitralab.io/sdk-core": "0.3.0",
66
66
  "mitra-interactions-sdk": "1.0.60-beta.48"
67
67
  },
68
68
  "devDependencies": {