@mitralab.io/platform-sdk 1.1.4-beta.0 → 1.1.5-beta.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 +12 -0
- package/README.md +4 -0
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +14 -14
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 1.1.5-beta.0
|
|
6
|
+
|
|
7
|
+
- The eight `agentCredentials` methods take a trailing `{ scope: "ACCOUNT" }`, sent as the
|
|
8
|
+
`scope=ACCOUNT` query parameter, and `session({ create: true })` and `agentTasks.create()`
|
|
9
|
+
accept `scope: "ACCOUNT"` in the create body, so the credential and the chat resolve against
|
|
10
|
+
the person's own account instead of the app. Without `scope` nothing changes on the wire. The
|
|
11
|
+
Copilot honors `ACCOUNT` only for apps listed by flag and answers
|
|
12
|
+
`ACCOUNT_CREDENTIAL_NOT_ALLOWED` otherwise.
|
|
13
|
+
- Depend on `@mitralab.io/sdk-core@0.2.5-beta.0`, which carries the `scope` option through the
|
|
14
|
+
credential calls and into the create request and exports `AgentCredentialScope` and
|
|
15
|
+
`AgentCredentialOptions`.
|
|
16
|
+
|
|
5
17
|
## 1.1.4-beta.0
|
|
6
18
|
|
|
7
19
|
- On the direct channel the message and the interrupt are written on the box socket, as the
|
package/README.md
CHANGED
|
@@ -331,6 +331,8 @@ session.close()
|
|
|
331
331
|
|
|
332
332
|
A chat created with `create: true` over the `auto` or `websocket` transport is born on the T3 box (`runtime: "T3"` in the create request), so the first open does not wait for the box to adopt it; a chat created with `transport: "http"` stays on the Copilot runner. Pass `runtime: "RUNNER"` or `runtime: "T3"` to decide explicitly.
|
|
333
333
|
|
|
334
|
+
`session({ create: true, agentId, scope: "ACCOUNT" })` and `agentTasks.create({ agentType, agentId, scope: "ACCOUNT" })` send `scope` in the create body, so the chat runs on the credential the person connected to their own account, the one the IDE and the builder read, instead of the agent's connection. The Copilot honors `ACCOUNT` only for apps listed by flag and answers `ACCOUNT_CREDENTIAL_NOT_ALLOWED` otherwise; a turn without a credential on the account fails with `ACCOUNT_CREDENTIAL_MISSING`. Through `agentTasks.session(...)` those refusals reach the session `error` event with the message and code the Copilot sends; through `agentTasks.create()` and the `agentCredentials` methods they reject the promise with a `MitraApiError` carrying status and code. No platform session is involved: the app token is used as always. Without `scope` nothing changes.
|
|
335
|
+
|
|
334
336
|
Open an existing task with `session({ taskId })`. The default `auto` transport refreshes before connecting, asks the Copilot once where the chat is served, and opens whichever channel it names: the box that runs the agent when one is offered, `/copilot/ws/tasks/{taskId}` otherwise. The Copilot holds that request while the box boots and answers only once the box is ready or cannot be had; the SDK does not poll. The choice belongs to the server, never to application configuration, so a Copilot that stops offering the box leaves every application on the Copilot socket without a republish. Opening the box never asks it to replay, whether the conversation is new to the session or is being opened again after an idle close: what an idle conversation missed is history, which the application loads over REST. A box socket that drops in the middle of a turn is redialed by the SDK itself, with a bounded backoff (1, 2, 4, 8 and 16 seconds) and the replay from the last position seen on that socket, so the answer keeps streaming; a position taken on one box is forgotten when the Copilot points the conversation to another box; replayed `textChunk` frames reach the `delta` event like live text. While that happens the session emits `raw` events of type `channelReconnecting` (payload `attempt`, `maxAttempts`, `reason`) and `channelConnected` (payload `attempt`); the session `status` stays `streaming`, because Core has no reconnecting status. The disconnect reaches Core, and with it the `error` event, only when the attempts run out or the Copilot no longer offers the box. A drop with no turn in flight, a channel taken over by another tab (close code 4409), and any close of the Copilot socket the session did not ask for are reported at once, whatever the code, so the next send reopens the channel instead of waiting on a socket that is gone. Recovery through persisted history plus the HTTP/SSE channel is unchanged. Set `transport: "http"` when WebSockets are unavailable. Messages sent during a turn enter a FIFO queue with a maximum of 10 items; the session also exposes edit, remove, clear, approval, cancel, history, close, and typed events.
|
|
335
337
|
|
|
336
338
|
On the direct channel the message and the interrupt are written on the box socket itself, as the frames the box reads from a client: `{ "type": "message", "content", "agentType"?, "reasoningEffort"? }` and `{ "type": "interrupt" }`. The box asks the Copilot to admit the turn and the Copilot records the history; the admission, its refusal and the turn itself come back on that same socket as the events the session already handles, so a message the box refuses surfaces through the `error` event with the box's code. `POST /copilot/api/v1/tasks/{taskId}/inputs` is the path when there is no box socket: a chat served by the Copilot socket or by SSE, a box socket that is not open at the moment of the send (a drop being redialed included), and every approval answer. A frame written on a socket that closes before the box acknowledges it is not sent again over REST, because the box may already have admitted the turn; the redial replays the box log, as it does for a turn started over REST.
|
|
@@ -339,6 +341,8 @@ A prompt sent while the browser says it is offline (`navigator.onLine === false`
|
|
|
339
341
|
|
|
340
342
|
API keys and removal accept `ANTHROPIC` or `OPENAI`. OAuth accepts only `ANTHROPIC`; device authorization accepts only `OPENAI`. The facade enforces those producer-supported pairs in TypeScript and at runtime.
|
|
341
343
|
|
|
344
|
+
Every `agentCredentials` method takes a trailing `options` with `scope: "ACCOUNT"`, sent as the `scope` query parameter, so the credential is read from or written to the person's own account instead of the app: `startOAuth("ANTHROPIC", { scope: "ACCOUNT" })`, `exchangeOAuth("ANTHROPIC", input, { scope: "ACCOUNT" })`, `list({ scope: "ACCOUNT" })`. The Copilot honors `ACCOUNT` only for apps listed by flag and answers `ACCOUNT_CREDENTIAL_NOT_ALLOWED` otherwise. No platform session is involved: the app token is used as always. Without `options` the request is the same as before.
|
|
345
|
+
|
|
342
346
|
The browser token roles expose Agent tasks, credential status, and model discovery. Administrative business-Agent CRUD is intentionally not exposed by this adapter because the `USE` app role does not carry `AGENT_*` authority.
|
|
343
347
|
|
|
344
348
|
## Custom queries
|
package/dist/index.cjs
CHANGED
|
@@ -2365,31 +2365,31 @@ function requireProvider(provider, allowed, flow) {
|
|
|
2365
2365
|
function createBrowserAgentCredentialsModule(httpClient) {
|
|
2366
2366
|
const core = (0, import_sdk_core9.createAgentCredentialsModule)(httpClient, coreErrors);
|
|
2367
2367
|
return {
|
|
2368
|
-
list: () => core.list(),
|
|
2369
|
-
listModels: (agentId) => core.listModels(agentId),
|
|
2370
|
-
saveApiKey: (provider, apiKey) => {
|
|
2368
|
+
list: (options) => core.list(options),
|
|
2369
|
+
listModels: (agentId, options) => core.listModels(agentId, options),
|
|
2370
|
+
saveApiKey: (provider, apiKey, options) => {
|
|
2371
2371
|
requireProvider(provider, ["ANTHROPIC", "OPENAI"], "API key authentication");
|
|
2372
|
-
return core.saveApiKey(provider, apiKey);
|
|
2372
|
+
return core.saveApiKey(provider, apiKey, options);
|
|
2373
2373
|
},
|
|
2374
|
-
remove: (provider) => {
|
|
2374
|
+
remove: (provider, options) => {
|
|
2375
2375
|
requireProvider(provider, ["ANTHROPIC", "OPENAI"], "Credential removal");
|
|
2376
|
-
return core.remove(provider);
|
|
2376
|
+
return core.remove(provider, options);
|
|
2377
2377
|
},
|
|
2378
|
-
startOAuth: (provider) => {
|
|
2378
|
+
startOAuth: (provider, options) => {
|
|
2379
2379
|
requireProvider(provider, ["ANTHROPIC"], "OAuth");
|
|
2380
|
-
return core.startOAuth(provider);
|
|
2380
|
+
return core.startOAuth(provider, options);
|
|
2381
2381
|
},
|
|
2382
|
-
exchangeOAuth: (provider, input) => {
|
|
2382
|
+
exchangeOAuth: (provider, input, options) => {
|
|
2383
2383
|
requireProvider(provider, ["ANTHROPIC"], "OAuth");
|
|
2384
|
-
return core.exchangeOAuth(provider, input);
|
|
2384
|
+
return core.exchangeOAuth(provider, input, options);
|
|
2385
2385
|
},
|
|
2386
|
-
startDeviceAuthorization: (provider) => {
|
|
2386
|
+
startDeviceAuthorization: (provider, options) => {
|
|
2387
2387
|
requireProvider(provider, ["OPENAI"], "Device authorization");
|
|
2388
|
-
return core.startDeviceAuthorization(provider);
|
|
2388
|
+
return core.startDeviceAuthorization(provider, options);
|
|
2389
2389
|
},
|
|
2390
|
-
pollDeviceAuthorization: (provider, deviceAuthId) => {
|
|
2390
|
+
pollDeviceAuthorization: (provider, deviceAuthId, options) => {
|
|
2391
2391
|
requireProvider(provider, ["OPENAI"], "Device authorization");
|
|
2392
|
-
return core.pollDeviceAuthorization(provider, deviceAuthId);
|
|
2392
|
+
return core.pollDeviceAuthorization(provider, deviceAuthId, options);
|
|
2393
2393
|
}
|
|
2394
2394
|
};
|
|
2395
2395
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Transport, TransportRequestOptions, QueryParamValue, EntityTable, FunctionExecution, ListTemplateConfigsOptions, TemplateConfigPage, ProxyResult, ProxyInput, QueryResult, CredentialStatus, AgentModel as AgentModel$1, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, PublicFunctionsModule, AgentTasksWithSessions } from '@mitralab.io/sdk-core';
|
|
2
|
-
export { AgentQueueItem, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AuthenticationResult, CredentialStatus, 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, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, PublicFunctionsModule, AgentTasksWithSessions } from '@mitralab.io/sdk-core';
|
|
2
|
+
export { AgentCredentialOptions, AgentCredentialScope, AgentQueueItem, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AuthenticationResult, CredentialStatus, 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';
|
|
@@ -652,14 +652,14 @@ type AgentCredentialProvider = 'ANTHROPIC' | 'OPENAI';
|
|
|
652
652
|
type AgentOAuthProvider = 'ANTHROPIC';
|
|
653
653
|
type AgentDeviceProvider = 'OPENAI';
|
|
654
654
|
interface AgentCredentialsModule {
|
|
655
|
-
list(): Promise<CredentialStatus[]>;
|
|
656
|
-
listModels(agentId?: string): Promise<AgentModel$1[]>;
|
|
657
|
-
saveApiKey(provider: AgentCredentialProvider, apiKey: string): Promise<void>;
|
|
658
|
-
remove(provider: AgentCredentialProvider): Promise<void>;
|
|
659
|
-
startOAuth(provider: AgentOAuthProvider): Promise<OAuthStartResult>;
|
|
660
|
-
exchangeOAuth(provider: AgentOAuthProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
661
|
-
startDeviceAuthorization(provider: AgentDeviceProvider): Promise<DeviceAuthorization>;
|
|
662
|
-
pollDeviceAuthorization(provider: AgentDeviceProvider, deviceAuthId: string): Promise<AuthenticationResult>;
|
|
655
|
+
list(options?: AgentCredentialOptions): Promise<CredentialStatus[]>;
|
|
656
|
+
listModels(agentId?: string, options?: AgentCredentialOptions): Promise<AgentModel$1[]>;
|
|
657
|
+
saveApiKey(provider: AgentCredentialProvider, apiKey: string, options?: AgentCredentialOptions): Promise<void>;
|
|
658
|
+
remove(provider: AgentCredentialProvider, options?: AgentCredentialOptions): Promise<void>;
|
|
659
|
+
startOAuth(provider: AgentOAuthProvider, options?: AgentCredentialOptions): Promise<OAuthStartResult>;
|
|
660
|
+
exchangeOAuth(provider: AgentOAuthProvider, input: OAuthExchangeInput, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
661
|
+
startDeviceAuthorization(provider: AgentDeviceProvider, options?: AgentCredentialOptions): Promise<DeviceAuthorization>;
|
|
662
|
+
pollDeviceAuthorization(provider: AgentDeviceProvider, deviceAuthId: string, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
665
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Transport, TransportRequestOptions, QueryParamValue, EntityTable, FunctionExecution, ListTemplateConfigsOptions, TemplateConfigPage, ProxyResult, ProxyInput, QueryResult, CredentialStatus, AgentModel as AgentModel$1, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, PublicFunctionsModule, AgentTasksWithSessions } from '@mitralab.io/sdk-core';
|
|
2
|
-
export { AgentQueueItem, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AuthenticationResult, CredentialStatus, 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, OAuthStartResult, OAuthExchangeInput, AuthenticationResult, DeviceAuthorization, PublicFunctionsModule, AgentTasksWithSessions } from '@mitralab.io/sdk-core';
|
|
2
|
+
export { AgentCredentialOptions, AgentCredentialScope, AgentQueueItem, AgentSendAndWaitOptions, AgentSendOptions, AgentSessionTransport, AgentTask, AgentTaskCreateInput, AgentTaskInput, AgentTaskListOptions, AgentTaskRuntime, AgentTaskSessionEventMap, AgentTaskSessionOptions, AgentTaskSessionStatus, AgentTurnResult, AuthenticationResult, CredentialStatus, 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';
|
|
@@ -652,14 +652,14 @@ type AgentCredentialProvider = 'ANTHROPIC' | 'OPENAI';
|
|
|
652
652
|
type AgentOAuthProvider = 'ANTHROPIC';
|
|
653
653
|
type AgentDeviceProvider = 'OPENAI';
|
|
654
654
|
interface AgentCredentialsModule {
|
|
655
|
-
list(): Promise<CredentialStatus[]>;
|
|
656
|
-
listModels(agentId?: string): Promise<AgentModel$1[]>;
|
|
657
|
-
saveApiKey(provider: AgentCredentialProvider, apiKey: string): Promise<void>;
|
|
658
|
-
remove(provider: AgentCredentialProvider): Promise<void>;
|
|
659
|
-
startOAuth(provider: AgentOAuthProvider): Promise<OAuthStartResult>;
|
|
660
|
-
exchangeOAuth(provider: AgentOAuthProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
661
|
-
startDeviceAuthorization(provider: AgentDeviceProvider): Promise<DeviceAuthorization>;
|
|
662
|
-
pollDeviceAuthorization(provider: AgentDeviceProvider, deviceAuthId: string): Promise<AuthenticationResult>;
|
|
655
|
+
list(options?: AgentCredentialOptions): Promise<CredentialStatus[]>;
|
|
656
|
+
listModels(agentId?: string, options?: AgentCredentialOptions): Promise<AgentModel$1[]>;
|
|
657
|
+
saveApiKey(provider: AgentCredentialProvider, apiKey: string, options?: AgentCredentialOptions): Promise<void>;
|
|
658
|
+
remove(provider: AgentCredentialProvider, options?: AgentCredentialOptions): Promise<void>;
|
|
659
|
+
startOAuth(provider: AgentOAuthProvider, options?: AgentCredentialOptions): Promise<OAuthStartResult>;
|
|
660
|
+
exchangeOAuth(provider: AgentOAuthProvider, input: OAuthExchangeInput, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
661
|
+
startDeviceAuthorization(provider: AgentDeviceProvider, options?: AgentCredentialOptions): Promise<DeviceAuthorization>;
|
|
662
|
+
pollDeviceAuthorization(provider: AgentDeviceProvider, deviceAuthId: string, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
665
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2330,31 +2330,31 @@ function requireProvider(provider, allowed, flow) {
|
|
|
2330
2330
|
function createBrowserAgentCredentialsModule(httpClient) {
|
|
2331
2331
|
const core = createAgentCredentialsModule(httpClient, coreErrors);
|
|
2332
2332
|
return {
|
|
2333
|
-
list: () => core.list(),
|
|
2334
|
-
listModels: (agentId) => core.listModels(agentId),
|
|
2335
|
-
saveApiKey: (provider, apiKey) => {
|
|
2333
|
+
list: (options) => core.list(options),
|
|
2334
|
+
listModels: (agentId, options) => core.listModels(agentId, options),
|
|
2335
|
+
saveApiKey: (provider, apiKey, options) => {
|
|
2336
2336
|
requireProvider(provider, ["ANTHROPIC", "OPENAI"], "API key authentication");
|
|
2337
|
-
return core.saveApiKey(provider, apiKey);
|
|
2337
|
+
return core.saveApiKey(provider, apiKey, options);
|
|
2338
2338
|
},
|
|
2339
|
-
remove: (provider) => {
|
|
2339
|
+
remove: (provider, options) => {
|
|
2340
2340
|
requireProvider(provider, ["ANTHROPIC", "OPENAI"], "Credential removal");
|
|
2341
|
-
return core.remove(provider);
|
|
2341
|
+
return core.remove(provider, options);
|
|
2342
2342
|
},
|
|
2343
|
-
startOAuth: (provider) => {
|
|
2343
|
+
startOAuth: (provider, options) => {
|
|
2344
2344
|
requireProvider(provider, ["ANTHROPIC"], "OAuth");
|
|
2345
|
-
return core.startOAuth(provider);
|
|
2345
|
+
return core.startOAuth(provider, options);
|
|
2346
2346
|
},
|
|
2347
|
-
exchangeOAuth: (provider, input) => {
|
|
2347
|
+
exchangeOAuth: (provider, input, options) => {
|
|
2348
2348
|
requireProvider(provider, ["ANTHROPIC"], "OAuth");
|
|
2349
|
-
return core.exchangeOAuth(provider, input);
|
|
2349
|
+
return core.exchangeOAuth(provider, input, options);
|
|
2350
2350
|
},
|
|
2351
|
-
startDeviceAuthorization: (provider) => {
|
|
2351
|
+
startDeviceAuthorization: (provider, options) => {
|
|
2352
2352
|
requireProvider(provider, ["OPENAI"], "Device authorization");
|
|
2353
|
-
return core.startDeviceAuthorization(provider);
|
|
2353
|
+
return core.startDeviceAuthorization(provider, options);
|
|
2354
2354
|
},
|
|
2355
|
-
pollDeviceAuthorization: (provider, deviceAuthId) => {
|
|
2355
|
+
pollDeviceAuthorization: (provider, deviceAuthId, options) => {
|
|
2356
2356
|
requireProvider(provider, ["OPENAI"], "Device authorization");
|
|
2357
|
-
return core.pollDeviceAuthorization(provider, deviceAuthId);
|
|
2357
|
+
return core.pollDeviceAuthorization(provider, deviceAuthId, options);
|
|
2358
2358
|
}
|
|
2359
2359
|
};
|
|
2360
2360
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mitralab.io/platform-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-beta.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.
|
|
65
|
+
"@mitralab.io/sdk-core": "0.2.5-beta.0",
|
|
66
66
|
"mitra-interactions-sdk": "1.0.60-beta.48"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|