@mitralab.io/platform-sdk 1.8.0-beta.1 → 1.8.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,26 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## 1.8.0
6
+
7
+ Stable release of the 1.8.0-beta line, with `@mitralab.io/sdk-core@0.3.1`.
8
+
9
+ - Includes the password sign-in of 1.8.0-beta.0 (#171/#172) and 1.8.0-beta.1 (#173/#174), both
10
+ detailed below: `signInWithPassword()`, `signUpWithPassword()`, `changePassword()` and
11
+ `requestPasswordReset()` on the Mitra auth page, `signOut()` ending an exclusive app session on
12
+ the server, `mitra.passwordLoginEnabled`, and the app's own form with
13
+ `signInWithPasswordForm()`, `startPasswordSignUp()`, `completePasswordSignUp()`,
14
+ `changePasswordForm()`, `readPasswordResetToken()` and `confirmPasswordReset()`.
15
+ - Depend on `@mitralab.io/sdk-core@0.3.1`. Both additions need the Copilot with
16
+ mitra-copilot#549.
17
+ - `agentCredentials.providers(agentId?, options?)`: the providers the next turn can run on, in one
18
+ call to the Copilot's `GET /api/v1/models/providers`, each with `provider`, `providerName`,
19
+ `models` and `usage` (null on an API key, a custom provider, before a turn reported a window and
20
+ when the Copilot could not read it). Export `AgentReadyProvider`.
21
+ - `agentTasks.session(...).loadOlder()` reads the page before the oldest row `history` holds and
22
+ puts it before `history`; `hasOlder` says whether the last page read had more. Both come from the
23
+ core session, which the offline gate passes through.
24
+
5
25
  ## 1.8.0-beta.1
6
26
 
7
27
  Password login from the app's own form, for apps whose owner turns that mode on (the Mitra auth
package/README.md CHANGED
@@ -43,7 +43,8 @@ No app gerado pelo Code Studio, `VITE_MITRA_APP_ID` e `VITE_MITRA_API_URL` já v
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
45
  `send` devolve o id da mensagem; com o browser offline a mensagem espera a rede e `send` devolve `undefined`.
46
- - `agentCredentials`: credenciais de provedor de IA e modelos disponíveis.
46
+ `loadOlder()` traz a página anterior do histórico e põe antes de `history`; `hasOlder` diz se ainda há mais antiga.
47
+ - `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.
47
48
 
48
49
  Login por código no e-mail, para quem monta a própria tela:
49
50
 
package/dist/index.cjs CHANGED
@@ -3242,6 +3242,7 @@ function createBrowserAgentCredentialsModule(httpClient) {
3242
3242
  return {
3243
3243
  list: (options) => core.list(options),
3244
3244
  listModels: (agentId, options) => core.listModels(agentId, options),
3245
+ providers: (agentId, options) => core.providers(agentId, options),
3245
3246
  usage: (provider, options) => {
3246
3247
  requireProvider(provider, ["ANTHROPIC", "OPENAI"], "Subscription usage");
3247
3248
  return core.usage(provider, options);
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { Transport, TransportRequestOptions, QueryParamValue, EntityTable, FunctionExecution, ListTemplateConfigsOptions, TemplateConfigPage, ProxyResult, ProxyInput, QueryResult, AgentCredentialOptions, CredentialStatus, AgentModel as AgentModel$1, CredentialUsage, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, PublicFunctionsModule, AgentTasksWithSessions } from '@mitralab.io/sdk-core';
2
- export { AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, AgentCredentialOptions, AgentCredentialScope, AgentProviderUsage, AgentQueueItem, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AgentTurnUsage, AgentTurnUsageRequest, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FunctionExecution, ListTemplateConfigsOptions, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, Page, PageOptions, ProxyInput, ProxyResult, PublicFunctionAsyncResult, PublicFunctionResult, PublicFunctionsModule, QueryResult, TemplateConfigPage } from '@mitralab.io/sdk-core';
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 } 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, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FunctionExecution, ListTemplateConfigsOptions, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, 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';
@@ -1186,6 +1186,11 @@ type AgentDeviceProvider = 'OPENAI';
1186
1186
  interface AgentCredentialsModule {
1187
1187
  list(options?: AgentCredentialOptions): Promise<CredentialStatus[]>;
1188
1188
  listModels(agentId?: string, options?: AgentCredentialOptions): Promise<AgentModel$1[]>;
1189
+ /**
1190
+ * The providers the next turn can run on, in one call to the Copilot: each with its models and,
1191
+ * for the built-in ones, the reading `usage(provider)` answers, or null when there is none.
1192
+ */
1193
+ providers(agentId?: string, options?: AgentCredentialOptions): Promise<AgentReadyProvider[]>;
1189
1194
  /**
1190
1195
  * The last subscription window a chat on this credential reported, readable with no chat open.
1191
1196
  * `null` until a turn on the provider's subscription login has reported one.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Transport, TransportRequestOptions, QueryParamValue, EntityTable, FunctionExecution, ListTemplateConfigsOptions, TemplateConfigPage, ProxyResult, ProxyInput, QueryResult, AgentCredentialOptions, CredentialStatus, AgentModel as AgentModel$1, CredentialUsage, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, PublicFunctionsModule, AgentTasksWithSessions } from '@mitralab.io/sdk-core';
2
- export { AgentConnectionCustomProvider, AgentConnectionCustomProviderInput, AgentCredentialOptions, AgentCredentialScope, AgentProviderUsage, AgentQueueItem, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AgentTurnUsage, AgentTurnUsageRequest, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FunctionExecution, ListTemplateConfigsOptions, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, Page, PageOptions, ProxyInput, ProxyResult, PublicFunctionAsyncResult, PublicFunctionResult, PublicFunctionsModule, QueryResult, TemplateConfigPage } from '@mitralab.io/sdk-core';
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 } 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, AuthenticationResult, CredentialStatus, CredentialUsage, CredentialUsageWindow, DeviceAuthorization, EntityListOptions, EntityTable, ExistingAgentTaskSessionOptions, FunctionExecution, ListTemplateConfigsOptions, AgentMessage as NativeAgentMessage, AgentModel as NativeAgentModel, AgentTaskSession as NativeAgentTaskSession, AgentTimelineItem as NativeAgentTimelineItem, AgentToolEvent as NativeAgentToolEvent, NewAgentTaskSessionOptions, OAuthExchangeInput, OAuthStartResult, 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';
@@ -1186,6 +1186,11 @@ type AgentDeviceProvider = 'OPENAI';
1186
1186
  interface AgentCredentialsModule {
1187
1187
  list(options?: AgentCredentialOptions): Promise<CredentialStatus[]>;
1188
1188
  listModels(agentId?: string, options?: AgentCredentialOptions): Promise<AgentModel$1[]>;
1189
+ /**
1190
+ * The providers the next turn can run on, in one call to the Copilot: each with its models and,
1191
+ * for the built-in ones, the reading `usage(provider)` answers, or null when there is none.
1192
+ */
1193
+ providers(agentId?: string, options?: AgentCredentialOptions): Promise<AgentReadyProvider[]>;
1189
1194
  /**
1190
1195
  * The last subscription window a chat on this credential reported, readable with no chat open.
1191
1196
  * `null` until a turn on the provider's subscription login has reported one.
package/dist/index.js CHANGED
@@ -3207,6 +3207,7 @@ function createBrowserAgentCredentialsModule(httpClient) {
3207
3207
  return {
3208
3208
  list: (options) => core.list(options),
3209
3209
  listModels: (agentId, options) => core.listModels(agentId, options),
3210
+ providers: (agentId, options) => core.providers(agentId, options),
3210
3211
  usage: (provider, options) => {
3211
3212
  requireProvider(provider, ["ANTHROPIC", "OPENAI"], "Subscription usage");
3212
3213
  return core.usage(provider, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mitralab.io/platform-sdk",
3
- "version": "1.8.0-beta.1",
3
+ "version": "1.8.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.3.0",
65
+ "@mitralab.io/sdk-core": "0.3.1",
66
66
  "mitra-interactions-sdk": "1.0.60-beta.48"
67
67
  },
68
68
  "devDependencies": {