@mitralab.io/sdk-core 0.2.13 → 0.2.14
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 +19 -0
- package/README.md +3 -1
- package/contracts/README.md +5 -0
- package/contracts/manifest.json +6 -1
- package/contracts/v0.2.14/sdk-parity.json +2902 -0
- package/dist/index.cjs +25 -0
- package/dist/index.d.cts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.2.14
|
|
6
|
+
|
|
7
|
+
- `messenger.sendEmail({ to, subject, html, text?, cc?, bcc?, replyTo? })` sends an email through
|
|
8
|
+
Messenger's `POST /api/v1/messages/send` as a `RAW` payload on the `EMAIL` channel and resolves
|
|
9
|
+
with the `messageId` of the accepted message. There is no `from`: Messenger sends with the
|
|
10
|
+
sender of the app in the token, so only the app's backend sends (a token exchanged from an api
|
|
11
|
+
key or the Server Function token). `to`, `cc` and `bcc` are lists with one address per entry;
|
|
12
|
+
absent optional fields are left out of the body.
|
|
13
|
+
- Recipient limits, the app's daily quota and the token check stay on Messenger. Their errors
|
|
14
|
+
(`400` above Messenger's recipient cap, `429` with `Retry-After` above the quota, `403` for an
|
|
15
|
+
app end-user token) come from the transport unchanged.
|
|
16
|
+
- `apps.update()` takes `emailLoginEnabled` and `passwordLoginEnabled`, sent on Code Studio's
|
|
17
|
+
`PATCH /api/v1/apps/{id}` only when supplied, so omission keeps the current value. Code Studio
|
|
18
|
+
rejects `passwordLoginEnabled: true` while the app inherits the platform login, with a `400`
|
|
19
|
+
and `PASSWORD_LOGIN_REQUIRES_EXCLUSIVE_MODE`, which comes from the transport unchanged.
|
|
20
|
+
- `AppDefinition` and `AppSummary` carry both fields when Code Studio returns them. The response
|
|
21
|
+
validator accepts their absence, as a Code Studio that predates them sends, and rejects a value
|
|
22
|
+
that is not a boolean.
|
|
23
|
+
|
|
5
24
|
## 0.2.13
|
|
6
25
|
|
|
7
26
|
- `AgentTurnUsage` gains `contextTokens` and `contextWindow`. `contextTokens` is the number of
|
package/README.md
CHANGED
|
@@ -66,7 +66,8 @@ const { data: tasks, hasMore } = await core.entities.getTable("Task").list({ lim
|
|
|
66
66
|
- `functions`, `publicFunctions`, `functionsAdmin` e `workflows`: executar e administrar Server Functions e workflows.
|
|
67
67
|
- `integration`, `integrationAdmin`, `integrationResources` e `integrationTemplates`: chamadas a APIs externas e a configuração delas.
|
|
68
68
|
- `agentTasks`, com `createAgentTaskSessionManager` e `withAgentTaskSessions`: chats de agente com `send`, `sendAndWait`, `cancel` e eventos. O gerenciador recebe `tasks`, o `eventSource` do seu SDK e `directChannel`, com o `apiUrl` do gateway e, se quiser, `WebSocket` e `fetch`.
|
|
69
|
-
- `apps`, `context`, `agents`, `agentConnections`, `agentCredentials`, `members`, `
|
|
69
|
+
- `apps`, `context`, `agents`, `agentConnections`, `agentCredentials`, `members`, `imports`, `dataSources` e `auth`: o app em si, a configuração de agentes e os demais recursos.
|
|
70
|
+
- `messenger`: `notify` avisa o usuário autenticado e `sendEmail` manda e-mail com o remetente do app.
|
|
70
71
|
- `resolveApiKeyToken`, `readTokenAppId` e `tokenAuthorizesApp`: contrato da troca de API key por token, para o SDK que autentica por chave.
|
|
71
72
|
|
|
72
73
|
## Configuração
|
|
@@ -95,6 +96,7 @@ const { data: tasks, hasMore } = await core.entities.getTable("Task").list({ lim
|
|
|
95
96
|
- Fixe o app no adaptador: `getAppId` e o header `X-App-Id` vêm do valor configurado no seu SDK, nunca de um argumento de quem chama. Aplique as credenciais depois dos headers de `options`, como no exemplo, para que eles não as substituam.
|
|
96
97
|
- O Core não repete requisição nem renova token. Se o seu transporte repetir, repita só o que não grava.
|
|
97
98
|
- `publicFunctions` precisa de um transporte sem credencial. O Core não usa o transporte autenticado no lugar dele.
|
|
99
|
+
- `sendEmail({ to, subject, html, text?, cc?, bcc?, replyTo? })` não tem `from`: o Messenger usa o remetente do app do token. Por isso só o backend do app manda e-mail, com o token trocado pela API key ou o token da Server Function; token de usuário final do app recebe `403`. `to`, `cc` e `bcc` são listas com um endereço por item. Os limites ficam no Messenger e chegam como erro do seu `Transport`: `400` acima do limite de destinatários dele somando os três campos e `429` acima da cota diária do app, com o header `Retry-After` e `retry_after_seconds` no corpo.
|
|
98
100
|
- `sendAndWait` com `timeoutMs` ou `signal` só para de esperar; o turno continua no servidor. Para interromper, chame `cancel()`.
|
|
99
101
|
- `cancel()` chamado antes de a box aceitar o prompt espera esse aceite e só então manda o stop; a promise resolve depois disso. Se o prompt não chegar a virar turno, nada é enviado e o status não passa por `cancelled`.
|
|
100
102
|
- O `open()` do seu `eventSource` só deve resolver depois que o stream estiver conectado, para nenhum evento do turno se perder.
|
package/contracts/README.md
CHANGED
|
@@ -24,6 +24,11 @@ publishes.
|
|
|
24
24
|
|
|
25
25
|
## Versions
|
|
26
26
|
|
|
27
|
+
- `0.2.14` is the `0.2.13` parity surface republished with `messenger.sendEmail()` and the
|
|
28
|
+
`emailLoginEnabled` and `passwordLoginEnabled` fields of `apps.update()`, which the parity cases do
|
|
29
|
+
not cover. Same parity cases; the version exists so a consumer pinning the package can pin a corpus
|
|
30
|
+
with the same number.
|
|
31
|
+
|
|
27
32
|
- `0.2.13` is the `0.2.12` parity surface republished with the occupied context of the chat:
|
|
28
33
|
`contextTokens` and `contextWindow` on `AgentTurnUsage`, which the parity cases do not cover.
|
|
29
34
|
Same parity cases; the version exists so a consumer pinning the package can pin a corpus with
|
package/contracts/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract": "SDK-PARITY-001",
|
|
3
|
-
"current": "0.2.
|
|
3
|
+
"current": "0.2.14",
|
|
4
4
|
"versions": [
|
|
5
5
|
{
|
|
6
6
|
"version": "0.1.0",
|
|
@@ -120,6 +120,11 @@
|
|
|
120
120
|
"version": "0.2.13",
|
|
121
121
|
"path": "v0.2.13/sdk-parity.json",
|
|
122
122
|
"sha256": "36a1dd5b8d0ab604a8baa68ce19823c9b2f2745cdf57fad9000917b83c60be20"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"version": "0.2.14",
|
|
126
|
+
"path": "v0.2.14/sdk-parity.json",
|
|
127
|
+
"sha256": "112e7eb52bd4362737ef03efff2cad4f529e41d5ac8ccda442e57c09b2e3c459"
|
|
123
128
|
}
|
|
124
129
|
]
|
|
125
130
|
}
|