@mitralab.io/platform-sdk 1.9.0-beta.2 → 1.9.0-beta.3
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 +15 -0
- package/README.md +3 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 1.9.0-beta.3
|
|
6
|
+
|
|
7
|
+
The turn state and the chat's own instructions, from `@mitralab.io/sdk-core@0.3.11`
|
|
8
|
+
(mitra-copilot#585 and #589).
|
|
9
|
+
|
|
10
|
+
- Depend on `@mitralab.io/sdk-core@0.3.11`. `client.agentTasks` now has `turnStates(ids)`, which
|
|
11
|
+
reads where the turn of several chats stands in one call (an id that is not a UUID is left out
|
|
12
|
+
before the request), and `setInstructions(id, instructions | null)`. `get` answers `turn` for a
|
|
13
|
+
chat on an agent box; `create` takes `instructions` and `folderKey`, and the task carries them
|
|
14
|
+
back. The session emits `contextCompacted`, and `turnEnd` and `sendAndWait` carry
|
|
15
|
+
`compactions`, always set and empty when the box sent none. The details are in the Core
|
|
16
|
+
changelog for 0.3.11.
|
|
17
|
+
- New exported types: `AgentTaskTurn`, `AgentTaskLastTurn`, `AgentTaskTurnStateEntry` and
|
|
18
|
+
`AgentTurnCompaction`.
|
|
19
|
+
|
|
5
20
|
## 1.9.0-beta.2
|
|
6
21
|
|
|
7
22
|
App files through `client.files`, and a single sign-in screen with every method the app has.
|
package/README.md
CHANGED
|
@@ -44,6 +44,9 @@ No app gerado pelo Code Studio, `VITE_MITRA_APP_ID` e `VITE_MITRA_API_URL` já v
|
|
|
44
44
|
- `agentTasks.session(...)`: chat com agente, com `send`, `sendAndWait`, `cancel` e eventos como `delta`, `turnEnd` e `error`.
|
|
45
45
|
`send` devolve o id da mensagem; com o browser offline a mensagem espera a rede e `send` devolve `undefined`.
|
|
46
46
|
`loadOlder()` traz a página anterior do histórico e põe antes de `history`; `hasOlder` diz se ainda há mais antiga.
|
|
47
|
+
O evento `contextCompacted` avisa quando o provedor compacta a conversa, e `turnEnd` e `sendAndWait` trazem `compactions`, a lista das compactações do turno (vazia quando não houve).
|
|
48
|
+
- `agentTasks.get(id)` traz `turn`, onde o turno do chat está (`RUNNING`, `QUEUED` ou `IDLE`) e como terminou o último, sem abrir sessão. `agentTasks.turnStates(ids)` faz o mesmo para vários chats numa chamada; id que não é UUID fica de fora.
|
|
49
|
+
- Instruções próprias do chat: `agentTasks.create({ ..., instructions, folderKey })` e `agentTasks.setInstructions(id, texto | null)`. Só aceita `setInstructions` o chat criado com instruções ou com `folderKey`; chats com a mesma `folderKey` dividem pasta e instruções. Detalhes no [README da sdk-core](https://github.com/mitralab-dev/mitra-core-sdk#readme) e no CHANGELOG dela, seção 0.3.11.
|
|
47
50
|
- `agentCredentials`: credenciais de provedor de IA e modelos disponíveis. `providers(agentId?)` devolve numa chamada só os provedores em que o próximo turno pode rodar, cada um com os modelos e a última leitura da assinatura.
|
|
48
51
|
- `aiProviders.get()`: consulta tipada de `GET /copilot/api/v1/ai-providers`, com o token da sessão e o `X-App-Id` do cliente. Retorna engine ativa, quota pessoal, provedores personalizados, conexão OpenCode e `managedAiProfile`. O módulo oferece somente leitura: não altera preferências, cria tarefas ou conecta provedores.
|
|
49
52
|
- `files`: arquivos do app, com `upload`, `get`, `getUrl`, `getUrls`, `download` e `delete`, mais os passos `requestUpload` e `confirmUpload` (ver [Arquivos do app](#arquivos-do-app)).
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, QueryParamValue, EntityTable, FunctionExecution, ListTemplateConfigsOptions, TemplateConfigPage, ProxyResult, ProxyInput, QueryResult, AgentCredentialOptions, CredentialStatus, AgentModel as AgentModel$1, AgentReadyProvider, CredentialUsage, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, PublicFunctionsModule, AgentTasksWithSessions, AiProvidersModule, FilesModule } from '@mitralab.io/sdk-core';
|
|
2
|
-
export { AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, AgentCredentialOptions, AgentCredentialScope, AgentProviderUsage, AgentQueueItem, AgentReadyProvider, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AgentTurnUsage, AgentTurnUsageRequest, AiProviders, AiProvidersModule, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FileCreator, FileDownloadOptions, FileKind, FileMetadata, FileReadUrl, FileReadUrlItem, FileReadUrlOptions, FileReadUrls, FileStatus, FileTransferError, FileTransferStep, FileUpload, FileUploadInput, FileUploadOptions, FileVisibility, FilesModule, FunctionExecution, IncludedAiQuota, IncludedAiQuotaWindow, ListTemplateConfigsOptions, ManagedAiProfile, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, OpencodeAiProvider, Page, PageOptions, ProxyInput, ProxyResult, PublicFunctionAsyncResult, PublicFunctionResult, PublicFunctionsModule, QueryResult, TemplateConfigPage } from '@mitralab.io/sdk-core';
|
|
2
|
+
export { AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, AgentCredentialOptions, AgentCredentialScope, AgentProviderUsage, AgentQueueItem, AgentReadyProvider, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskLastTurn, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTaskTurn, AgentTaskTurnStateEntry, AgentTurnCompaction, AgentTurnResult, AgentTurnUsage, AgentTurnUsageRequest, AiProviders, AiProvidersModule, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FileCreator, FileDownloadOptions, FileKind, FileMetadata, FileReadUrl, FileReadUrlItem, FileReadUrlOptions, FileReadUrls, FileStatus, FileTransferError, FileTransferStep, FileUpload, FileUploadInput, FileUploadOptions, FileVisibility, FilesModule, FunctionExecution, IncludedAiQuota, IncludedAiQuotaWindow, ListTemplateConfigsOptions, ManagedAiProfile, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, OpencodeAiProvider, Page, PageOptions, ProxyInput, ProxyResult, PublicFunctionAsyncResult, PublicFunctionResult, PublicFunctionsModule, QueryResult, TemplateConfigPage } from '@mitralab.io/sdk-core';
|
|
3
3
|
import * as LegacyTypes from 'mitra-interactions-sdk';
|
|
4
4
|
import { exchangeSsoCodeMitra as exchangeSsoCodeMitra$1, loginMitra as loginMitra$1, loginWithGoogleMitra as loginWithGoogleMitra$1, loginWithMicrosoftMitra as loginWithMicrosoftMitra$1 } from 'mitra-interactions-sdk';
|
|
5
5
|
export { callIntegrationMitra, configureSdkMitra, createMitraInstance, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentTaskMitra, getConfig, getPublicServerFunctionExecutionMitra, getRecordMitra, listIntegrationsMitra, listRecordsMitra, manageAgentChatMitra, manageAgentCredentialMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, stopServerFunctionExecutionMitra, updateRecordMitra } from 'mitra-interactions-sdk';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Transport, TransportRequestOptions, QueryParamValue, EntityTable, FunctionExecution, ListTemplateConfigsOptions, TemplateConfigPage, ProxyResult, ProxyInput, QueryResult, AgentCredentialOptions, CredentialStatus, AgentModel as AgentModel$1, AgentReadyProvider, CredentialUsage, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, PublicFunctionsModule, AgentTasksWithSessions, AiProvidersModule, FilesModule } from '@mitralab.io/sdk-core';
|
|
2
|
-
export { AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, AgentCredentialOptions, AgentCredentialScope, AgentProviderUsage, AgentQueueItem, AgentReadyProvider, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AgentTurnUsage, AgentTurnUsageRequest, AiProviders, AiProvidersModule, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FileCreator, FileDownloadOptions, FileKind, FileMetadata, FileReadUrl, FileReadUrlItem, FileReadUrlOptions, FileReadUrls, FileStatus, FileTransferError, FileTransferStep, FileUpload, FileUploadInput, FileUploadOptions, FileVisibility, FilesModule, FunctionExecution, IncludedAiQuota, IncludedAiQuotaWindow, ListTemplateConfigsOptions, ManagedAiProfile, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, OpencodeAiProvider, Page, PageOptions, ProxyInput, ProxyResult, PublicFunctionAsyncResult, PublicFunctionResult, PublicFunctionsModule, QueryResult, TemplateConfigPage } from '@mitralab.io/sdk-core';
|
|
2
|
+
export { AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, AgentCredentialOptions, AgentCredentialScope, AgentProviderUsage, AgentQueueItem, AgentReadyProvider, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskLastTurn, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTaskTurn, AgentTaskTurnStateEntry, AgentTurnCompaction, AgentTurnResult, AgentTurnUsage, AgentTurnUsageRequest, AiProviders, AiProvidersModule, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FileCreator, FileDownloadOptions, FileKind, FileMetadata, FileReadUrl, FileReadUrlItem, FileReadUrlOptions, FileReadUrls, FileStatus, FileTransferError, FileTransferStep, FileUpload, FileUploadInput, FileUploadOptions, FileVisibility, FilesModule, FunctionExecution, IncludedAiQuota, IncludedAiQuotaWindow, ListTemplateConfigsOptions, ManagedAiProfile, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, OpencodeAiProvider, Page, PageOptions, ProxyInput, ProxyResult, PublicFunctionAsyncResult, PublicFunctionResult, PublicFunctionsModule, QueryResult, TemplateConfigPage } from '@mitralab.io/sdk-core';
|
|
3
3
|
import * as LegacyTypes from 'mitra-interactions-sdk';
|
|
4
4
|
import { exchangeSsoCodeMitra as exchangeSsoCodeMitra$1, loginMitra as loginMitra$1, loginWithGoogleMitra as loginWithGoogleMitra$1, loginWithMicrosoftMitra as loginWithMicrosoftMitra$1 } from 'mitra-interactions-sdk';
|
|
5
5
|
export { callIntegrationMitra, configureSdkMitra, createMitraInstance, createRecordMitra, createRecordsBatchMitra, deleteRecordMitra, executePublicServerFunctionAsyncMitra, executePublicServerFunctionMitra, executeServerFunctionAsyncMitra, executeServerFunctionMitra, getAgentTaskMitra, getConfig, getPublicServerFunctionExecutionMitra, getRecordMitra, listIntegrationsMitra, listRecordsMitra, manageAgentChatMitra, manageAgentCredentialMitra, patchRecordMitra, refreshTokenSilently, resolveProjectId, stopServerFunctionExecutionMitra, updateRecordMitra } from 'mitra-interactions-sdk';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mitralab.io/platform-sdk",
|
|
3
|
-
"version": "1.9.0-beta.
|
|
3
|
+
"version": "1.9.0-beta.3",
|
|
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.3.
|
|
65
|
+
"@mitralab.io/sdk-core": "0.3.11",
|
|
66
66
|
"mitra-interactions-sdk": "1.0.60-beta.48"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|