@mitralab.io/sdk-core 0.2.4 → 0.2.6-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/contracts/README.md +8 -0
- package/contracts/manifest.json +11 -1
- package/contracts/v0.2.5-beta.0/sdk-parity.json +2902 -0
- package/contracts/v0.2.6-beta.0/sdk-parity.json +2902 -0
- package/dist/index.cjs +77 -21
- package/dist/index.d.cts +58 -9
- package/dist/index.d.ts +58 -9
- package/dist/index.js +77 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -995,6 +995,8 @@ function expectAgentTask(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
995
995
|
for (const field of ["appId", "agentId", "userId", "title", "reasoningEffort"]) {
|
|
996
996
|
if (!isNullableString(task[field])) invalidField(context, field, errors);
|
|
997
997
|
}
|
|
998
|
+
if ("scope" in task && !isNullableString(task.scope)) invalidField(context, "scope", errors);
|
|
999
|
+
if ("model" in task && !isNullableString(task.model)) invalidField(context, "model", errors);
|
|
998
1000
|
if (typeof task.agentType !== "string") invalidField(context, "agentType", errors);
|
|
999
1001
|
if (typeof task.archived !== "boolean") invalidField(context, "archived", errors);
|
|
1000
1002
|
if (!isNullableString(task.createdAt)) invalidField(context, "createdAt", errors);
|
|
@@ -1014,6 +1016,9 @@ function expectAgentModel(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
1014
1016
|
if (typeof model[field] !== "string") invalidField(context, field, errors);
|
|
1015
1017
|
}
|
|
1016
1018
|
if (!isStringArray(model.reasoningOptions)) invalidField(context, "reasoningOptions", errors);
|
|
1019
|
+
if ("providerName" in model && !isNullableString(model.providerName)) {
|
|
1020
|
+
invalidField(context, "providerName", errors);
|
|
1021
|
+
}
|
|
1017
1022
|
return model;
|
|
1018
1023
|
}
|
|
1019
1024
|
function expectCredentialStatus(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
@@ -1053,6 +1058,14 @@ function expectProviderCredentialStatus(value, context, errors) {
|
|
|
1053
1058
|
if (!isNullableString(status.accountEmail)) invalidField(context, "accountEmail", errors);
|
|
1054
1059
|
return status;
|
|
1055
1060
|
}
|
|
1061
|
+
function expectAgentConnectionCustomProvider(value, context, errors) {
|
|
1062
|
+
const provider = expectObject(value, context, errors);
|
|
1063
|
+
for (const field of ["id", "name", "baseUrl", "maskedApiKey"]) {
|
|
1064
|
+
if (typeof provider[field] !== "string") invalidField(context, field, errors);
|
|
1065
|
+
}
|
|
1066
|
+
if (!isStringArray(provider.models)) invalidField(context, "models", errors);
|
|
1067
|
+
return provider;
|
|
1068
|
+
}
|
|
1056
1069
|
function expectAgentConnection(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
1057
1070
|
const connection = expectObject(value, context, errors);
|
|
1058
1071
|
if (typeof connection.id !== "string") invalidField(context, "id", errors);
|
|
@@ -1065,6 +1078,14 @@ function expectAgentConnection(value, context, errors = defaultSdkCoreErrorFacto
|
|
|
1065
1078
|
errors,
|
|
1066
1079
|
expectProviderCredentialStatus
|
|
1067
1080
|
);
|
|
1081
|
+
if ("customProviders" in connection) {
|
|
1082
|
+
expectObjectArray(
|
|
1083
|
+
connection.customProviders,
|
|
1084
|
+
`${context} customProviders`,
|
|
1085
|
+
errors,
|
|
1086
|
+
expectAgentConnectionCustomProvider
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1068
1089
|
return connection;
|
|
1069
1090
|
}
|
|
1070
1091
|
function expectTableDefinition(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
@@ -1119,6 +1140,7 @@ function expectEmpty(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
1119
1140
|
|
|
1120
1141
|
// src/modules/agentConnections.ts
|
|
1121
1142
|
var MAX_CONNECTIONS = 100;
|
|
1143
|
+
var MAX_CUSTOM_PROVIDER_MODELS = 32;
|
|
1122
1144
|
function createAgentConnectionsModule(transport, errors = defaultSdkCoreErrorFactory) {
|
|
1123
1145
|
const path = (id) => `/api/v1/connections/${encodePathSegment(id, "connection id", errors)}`;
|
|
1124
1146
|
const providerPath = (id, provider) => `${path(id)}/providers/${encodePathSegment(provider, "provider", errors)}`;
|
|
@@ -1225,6 +1247,27 @@ function createAgentConnectionsModule(transport, errors = defaultSdkCoreErrorFac
|
|
|
1225
1247
|
"Connection device authorization poll response",
|
|
1226
1248
|
errors
|
|
1227
1249
|
);
|
|
1250
|
+
},
|
|
1251
|
+
async createCustomProvider(id, input) {
|
|
1252
|
+
requireBatchSize(input.models, "models", MAX_CUSTOM_PROVIDER_MODELS, errors);
|
|
1253
|
+
return expectAgentConnection(
|
|
1254
|
+
await transport.request(`${path(id)}/custom-providers`, {
|
|
1255
|
+
method: "POST",
|
|
1256
|
+
body: input
|
|
1257
|
+
}),
|
|
1258
|
+
"Create connection custom provider response",
|
|
1259
|
+
errors
|
|
1260
|
+
);
|
|
1261
|
+
},
|
|
1262
|
+
async deleteCustomProvider(id, providerId) {
|
|
1263
|
+
expectEmpty(
|
|
1264
|
+
await transport.request(
|
|
1265
|
+
`${path(id)}/custom-providers/${encodePathSegment(providerId, "custom provider id", errors)}`,
|
|
1266
|
+
{ method: "DELETE" }
|
|
1267
|
+
),
|
|
1268
|
+
"Delete connection custom provider response",
|
|
1269
|
+
errors
|
|
1270
|
+
);
|
|
1228
1271
|
}
|
|
1229
1272
|
};
|
|
1230
1273
|
}
|
|
@@ -1232,76 +1275,83 @@ function createAgentConnectionsModule(transport, errors = defaultSdkCoreErrorFac
|
|
|
1232
1275
|
// src/modules/agentCredentials.ts
|
|
1233
1276
|
function createAgentCredentialsModule(transport, errors = defaultSdkCoreErrorFactory) {
|
|
1234
1277
|
const providerSegment = (provider) => encodePathSegment(provider, "provider", errors);
|
|
1278
|
+
const scopeParams = (options) => options?.scope ? { params: { scope: options.scope } } : {};
|
|
1235
1279
|
return {
|
|
1236
|
-
async list() {
|
|
1280
|
+
async list(options) {
|
|
1237
1281
|
return expectObjectArray(
|
|
1238
|
-
await transport.request("/api/v1/credentials", {
|
|
1282
|
+
await transport.request("/api/v1/credentials", {
|
|
1283
|
+
method: "GET",
|
|
1284
|
+
...scopeParams(options)
|
|
1285
|
+
}),
|
|
1239
1286
|
"Credential status response",
|
|
1240
1287
|
errors,
|
|
1241
1288
|
expectCredentialStatus
|
|
1242
1289
|
);
|
|
1243
1290
|
},
|
|
1244
|
-
async listModels(agentId) {
|
|
1291
|
+
async listModels(agentId, options) {
|
|
1245
1292
|
return expectObjectArray(
|
|
1246
1293
|
await transport.request("/api/v1/models", {
|
|
1247
1294
|
method: "GET",
|
|
1248
|
-
params: { agentId }
|
|
1295
|
+
params: { agentId, ...scopeParams(options).params }
|
|
1249
1296
|
}),
|
|
1250
1297
|
"Agent model response",
|
|
1251
1298
|
errors,
|
|
1252
1299
|
expectAgentModel
|
|
1253
1300
|
);
|
|
1254
1301
|
},
|
|
1255
|
-
async saveApiKey(provider, apiKey) {
|
|
1302
|
+
async saveApiKey(provider, apiKey, options) {
|
|
1256
1303
|
expectEmpty(
|
|
1257
1304
|
await transport.request(
|
|
1258
1305
|
`/api/v1/credentials/${providerSegment(provider)}/api-key`,
|
|
1259
|
-
{ method: "PUT", body: { apiKey } }
|
|
1306
|
+
{ method: "PUT", body: { apiKey }, ...scopeParams(options) }
|
|
1260
1307
|
),
|
|
1261
1308
|
"Save API key response",
|
|
1262
1309
|
errors
|
|
1263
1310
|
);
|
|
1264
1311
|
},
|
|
1265
|
-
async remove(provider) {
|
|
1312
|
+
async remove(provider, options) {
|
|
1266
1313
|
expectEmpty(
|
|
1267
1314
|
await transport.request(`/api/v1/credentials/${providerSegment(provider)}`, {
|
|
1268
|
-
method: "DELETE"
|
|
1315
|
+
method: "DELETE",
|
|
1316
|
+
...scopeParams(options)
|
|
1269
1317
|
}),
|
|
1270
1318
|
"Remove credential response",
|
|
1271
1319
|
errors
|
|
1272
1320
|
);
|
|
1273
1321
|
},
|
|
1274
|
-
async startOAuth(provider) {
|
|
1322
|
+
async startOAuth(provider, options) {
|
|
1275
1323
|
return expectOAuthStartResult(
|
|
1276
1324
|
await transport.request("/api/v1/oauth/start", {
|
|
1277
1325
|
method: "POST",
|
|
1278
|
-
body: { provider }
|
|
1326
|
+
body: { provider },
|
|
1327
|
+
...scopeParams(options)
|
|
1279
1328
|
}),
|
|
1280
1329
|
"OAuth start response",
|
|
1281
1330
|
errors
|
|
1282
1331
|
);
|
|
1283
1332
|
},
|
|
1284
|
-
async exchangeOAuth(provider, input) {
|
|
1333
|
+
async exchangeOAuth(provider, input, options) {
|
|
1285
1334
|
return expectAuthenticationResult(
|
|
1286
1335
|
await transport.request("/api/v1/oauth/exchange", {
|
|
1287
1336
|
method: "POST",
|
|
1288
|
-
body: { provider, ...input }
|
|
1337
|
+
body: { provider, ...input },
|
|
1338
|
+
...scopeParams(options)
|
|
1289
1339
|
}),
|
|
1290
1340
|
"OAuth exchange response",
|
|
1291
1341
|
errors
|
|
1292
1342
|
);
|
|
1293
1343
|
},
|
|
1294
|
-
async startDeviceAuthorization(provider) {
|
|
1344
|
+
async startDeviceAuthorization(provider, options) {
|
|
1295
1345
|
return expectDeviceAuthorization(
|
|
1296
1346
|
await transport.request(
|
|
1297
1347
|
`/api/v1/credentials/${providerSegment(provider)}/device-authorizations`,
|
|
1298
|
-
{ method: "POST" }
|
|
1348
|
+
{ method: "POST", ...scopeParams(options) }
|
|
1299
1349
|
),
|
|
1300
1350
|
"Device authorization response",
|
|
1301
1351
|
errors
|
|
1302
1352
|
);
|
|
1303
1353
|
},
|
|
1304
|
-
async pollDeviceAuthorization(provider, deviceAuthId) {
|
|
1354
|
+
async pollDeviceAuthorization(provider, deviceAuthId, options) {
|
|
1305
1355
|
return expectAuthenticationResult(
|
|
1306
1356
|
await transport.request(
|
|
1307
1357
|
`/api/v1/credentials/${providerSegment(provider)}/device-authorizations/${encodePathSegment(
|
|
@@ -1309,7 +1359,7 @@ function createAgentCredentialsModule(transport, errors = defaultSdkCoreErrorFac
|
|
|
1309
1359
|
"device authorization id",
|
|
1310
1360
|
errors
|
|
1311
1361
|
)}/poll`,
|
|
1312
|
-
{ method: "POST" }
|
|
1362
|
+
{ method: "POST", ...scopeParams(options) }
|
|
1313
1363
|
),
|
|
1314
1364
|
"Device authorization poll response",
|
|
1315
1365
|
errors
|
|
@@ -3192,7 +3242,8 @@ var CoreAgentTaskSession = class {
|
|
|
3192
3242
|
text: item.text,
|
|
3193
3243
|
createdAt: item.createdAt,
|
|
3194
3244
|
...item.agentType ? { agentType: item.agentType } : {},
|
|
3195
|
-
...item.reasoningEffort ? { reasoningEffort: item.reasoningEffort } : {}
|
|
3245
|
+
...item.reasoningEffort ? { reasoningEffort: item.reasoningEffort } : {},
|
|
3246
|
+
...item.model ? { model: item.model } : {}
|
|
3196
3247
|
}));
|
|
3197
3248
|
}
|
|
3198
3249
|
send(prompt, options = {}) {
|
|
@@ -3211,7 +3262,8 @@ var CoreAgentTaskSession = class {
|
|
|
3211
3262
|
if (waiter.settled) return waiter.promise;
|
|
3212
3263
|
const sendOptions = {
|
|
3213
3264
|
...options.agentType ? { agentType: options.agentType } : {},
|
|
3214
|
-
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {}
|
|
3265
|
+
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {},
|
|
3266
|
+
...options.model ? { model: options.model } : {}
|
|
3215
3267
|
};
|
|
3216
3268
|
if (this.isBusy()) {
|
|
3217
3269
|
const queueId = this.enqueue(prompt, sendOptions, waiter);
|
|
@@ -3348,7 +3400,8 @@ var CoreAgentTaskSession = class {
|
|
|
3348
3400
|
type: "message",
|
|
3349
3401
|
content: prompt,
|
|
3350
3402
|
...options.agentType ? { agentType: options.agentType } : {},
|
|
3351
|
-
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {}
|
|
3403
|
+
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {},
|
|
3404
|
+
...options.model ? { model: options.model } : {}
|
|
3352
3405
|
};
|
|
3353
3406
|
if (this.isClosed()) {
|
|
3354
3407
|
await this.sendInput(input).catch(() => void 0);
|
|
@@ -3378,8 +3431,10 @@ var CoreAgentTaskSession = class {
|
|
|
3378
3431
|
...createOptions.title ? { title: createOptions.title } : {},
|
|
3379
3432
|
...createOptions.agentId ? { agentId: createOptions.agentId } : {},
|
|
3380
3433
|
...createOptions.reasoningEffort ? { reasoningEffort: createOptions.reasoningEffort } : {},
|
|
3434
|
+
...createOptions.model ? { model: createOptions.model } : {},
|
|
3381
3435
|
...createOptions.userId ? { userId: createOptions.userId } : {},
|
|
3382
|
-
...createOptions.runtime ? { runtime: createOptions.runtime } : {}
|
|
3436
|
+
...createOptions.runtime ? { runtime: createOptions.runtime } : {},
|
|
3437
|
+
...createOptions.scope ? { scope: createOptions.scope } : {}
|
|
3383
3438
|
});
|
|
3384
3439
|
this._task = task;
|
|
3385
3440
|
this._taskId = task.id;
|
|
@@ -3643,7 +3698,8 @@ var CoreAgentTaskSession = class {
|
|
|
3643
3698
|
next.text,
|
|
3644
3699
|
{
|
|
3645
3700
|
...next.agentType ? { agentType: next.agentType } : {},
|
|
3646
|
-
...next.reasoningEffort ? { reasoningEffort: next.reasoningEffort } : {}
|
|
3701
|
+
...next.reasoningEffort ? { reasoningEffort: next.reasoningEffort } : {},
|
|
3702
|
+
...next.model ? { model: next.model } : {}
|
|
3647
3703
|
},
|
|
3648
3704
|
next.waiter
|
|
3649
3705
|
);
|
package/dist/index.d.cts
CHANGED
|
@@ -1022,6 +1022,8 @@ interface IntegrationExecution {
|
|
|
1022
1022
|
type CopilotProvider = "ANTHROPIC" | "OPENAI" | (string & {});
|
|
1023
1023
|
/** Execution runtime a chat is born on. Absent means the Copilot server default. */
|
|
1024
1024
|
type AgentTaskRuntime = "T3" | "RUNNER";
|
|
1025
|
+
/** Credential scope a call or a chat resolves against. Absent means the Copilot server default. */
|
|
1026
|
+
type AgentCredentialScope = "ACCOUNT";
|
|
1025
1027
|
interface AgentTaskCreateInput {
|
|
1026
1028
|
/** Optional title, at most 255 characters. */
|
|
1027
1029
|
title?: string;
|
|
@@ -1031,8 +1033,12 @@ interface AgentTaskCreateInput {
|
|
|
1031
1033
|
agentId?: string;
|
|
1032
1034
|
/** Optional reasoning setting supported by the selected model. */
|
|
1033
1035
|
reasoningEffort?: string;
|
|
1036
|
+
/** Catalog model id, for example `custom/<providerId>/<model>`. Copilot requires it for CUSTOM_AI. */
|
|
1037
|
+
model?: string;
|
|
1034
1038
|
/** Optional runtime. Core never defaults it; the concrete SDK decides what to send. */
|
|
1035
1039
|
runtime?: AgentTaskRuntime;
|
|
1040
|
+
/** Optional credential scope. Core never defaults it; the concrete SDK decides what to send. */
|
|
1041
|
+
scope?: AgentCredentialScope;
|
|
1036
1042
|
/** Owner for an on-behalf chat. Requires AGENT_WRITE in the current app. */
|
|
1037
1043
|
userId?: string;
|
|
1038
1044
|
/**
|
|
@@ -1049,6 +1055,10 @@ interface AgentTask {
|
|
|
1049
1055
|
title: string | null;
|
|
1050
1056
|
agentType: string;
|
|
1051
1057
|
reasoningEffort: string | null;
|
|
1058
|
+
/** Absent on a Copilot that predates credential scopes; null on a task without one. */
|
|
1059
|
+
scope?: AgentCredentialScope | null;
|
|
1060
|
+
/** Absent on a Copilot that predates custom providers; null on a task without an explicit model. */
|
|
1061
|
+
model?: string | null;
|
|
1052
1062
|
archived: boolean;
|
|
1053
1063
|
createdAt: string | null;
|
|
1054
1064
|
updatedAt: string;
|
|
@@ -1068,6 +1078,8 @@ type AgentTaskInput = {
|
|
|
1068
1078
|
content: string;
|
|
1069
1079
|
agentType?: string;
|
|
1070
1080
|
reasoningEffort?: string;
|
|
1081
|
+
/** Catalog model id. */
|
|
1082
|
+
model?: string;
|
|
1071
1083
|
} | {
|
|
1072
1084
|
type: "interrupt";
|
|
1073
1085
|
} | {
|
|
@@ -1095,6 +1107,8 @@ interface AgentModel {
|
|
|
1095
1107
|
provider: CopilotProvider;
|
|
1096
1108
|
agentType: string;
|
|
1097
1109
|
reasoningOptions: string[];
|
|
1110
|
+
/** Name the person chose for a custom provider; null on built-in models. Absent on an older Copilot. */
|
|
1111
|
+
providerName?: string | null;
|
|
1098
1112
|
}
|
|
1099
1113
|
interface CredentialStatus {
|
|
1100
1114
|
provider: CopilotProvider;
|
|
@@ -1137,12 +1151,31 @@ interface ProviderCredentialStatus {
|
|
|
1137
1151
|
credentialType: string | null;
|
|
1138
1152
|
accountEmail: string | null;
|
|
1139
1153
|
}
|
|
1154
|
+
interface AgentConnectionCustomProviderInput {
|
|
1155
|
+
/** Name the person chooses for the provider, unique within the connection. */
|
|
1156
|
+
name: string;
|
|
1157
|
+
/** OpenAI-compatible endpoint, http or https without a query string. */
|
|
1158
|
+
baseUrl: string;
|
|
1159
|
+
/** Write-only key. Copilot never returns it. */
|
|
1160
|
+
apiKey: string;
|
|
1161
|
+
/** 1 to 32 unique model ids served by the endpoint. */
|
|
1162
|
+
models: string[];
|
|
1163
|
+
}
|
|
1164
|
+
interface AgentConnectionCustomProvider {
|
|
1165
|
+
id: string;
|
|
1166
|
+
name: string;
|
|
1167
|
+
baseUrl: string;
|
|
1168
|
+
maskedApiKey: string;
|
|
1169
|
+
models: string[];
|
|
1170
|
+
}
|
|
1140
1171
|
interface AgentConnection {
|
|
1141
1172
|
id: string;
|
|
1142
1173
|
name: string;
|
|
1143
1174
|
createdAt: string;
|
|
1144
1175
|
updatedAt: string;
|
|
1145
1176
|
credentials: ProviderCredentialStatus[];
|
|
1177
|
+
/** Absent on a Copilot that predates custom providers. */
|
|
1178
|
+
customProviders?: AgentConnectionCustomProvider[];
|
|
1146
1179
|
}
|
|
1147
1180
|
interface MessageAccepted {
|
|
1148
1181
|
/** Identifier assigned by Messenger to the accepted notification. */
|
|
@@ -1185,26 +1218,36 @@ interface AgentConnectionsModule {
|
|
|
1185
1218
|
exchangeOAuth(id: string, provider: CopilotProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
1186
1219
|
startDeviceAuthorization(id: string, provider: CopilotProvider): Promise<DeviceAuthorization>;
|
|
1187
1220
|
pollDeviceAuthorization(id: string, provider: CopilotProvider, deviceAuthId: string): Promise<AuthenticationResult>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Adds an OpenAI-compatible provider under a name the person chooses. Its models join the
|
|
1223
|
+
* agent catalog as `custom/<providerId>/<model>`; the API key is write-only.
|
|
1224
|
+
*/
|
|
1225
|
+
createCustomProvider(id: string, input: AgentConnectionCustomProviderInput): Promise<AgentConnection>;
|
|
1226
|
+
deleteCustomProvider(id: string, providerId: string): Promise<void>;
|
|
1188
1227
|
}
|
|
1189
1228
|
declare function createAgentConnectionsModule(transport: Transport, errors?: SdkCoreErrorFactory): AgentConnectionsModule;
|
|
1190
1229
|
|
|
1230
|
+
interface AgentCredentialOptions {
|
|
1231
|
+
/** Credential scope the call resolves against. Omitted means the Copilot server default. */
|
|
1232
|
+
scope?: AgentCredentialScope;
|
|
1233
|
+
}
|
|
1191
1234
|
interface AgentCredentialsModule {
|
|
1192
1235
|
/** Lists safe credential status. Raw credentials never leave Copilot. */
|
|
1193
|
-
list(): Promise<CredentialStatus[]>;
|
|
1236
|
+
list(options?: AgentCredentialOptions): Promise<CredentialStatus[]>;
|
|
1194
1237
|
/** Lists models backed by a usable credential, optionally through a business agent connection. */
|
|
1195
|
-
listModels(agentId?: string): Promise<AgentModel[]>;
|
|
1238
|
+
listModels(agentId?: string, options?: AgentCredentialOptions): Promise<AgentModel[]>;
|
|
1196
1239
|
/** Validates and stores a write-only API key. */
|
|
1197
|
-
saveApiKey(provider: CopilotProvider, apiKey: string): Promise<void>;
|
|
1240
|
+
saveApiKey(provider: CopilotProvider, apiKey: string, options?: AgentCredentialOptions): Promise<void>;
|
|
1198
1241
|
/** Permanently removes the current credential for a provider. */
|
|
1199
|
-
remove(provider: CopilotProvider): Promise<void>;
|
|
1242
|
+
remove(provider: CopilotProvider, options?: AgentCredentialOptions): Promise<void>;
|
|
1200
1243
|
/** Starts provider OAuth and returns an opaque state that must be preserved. */
|
|
1201
|
-
startOAuth(provider: CopilotProvider): Promise<OAuthStartResult>;
|
|
1244
|
+
startOAuth(provider: CopilotProvider, options?: AgentCredentialOptions): Promise<OAuthStartResult>;
|
|
1202
1245
|
/** Exchanges provider OAuth code and state, saving the resulting credential. */
|
|
1203
|
-
exchangeOAuth(provider: CopilotProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
1246
|
+
exchangeOAuth(provider: CopilotProvider, input: OAuthExchangeInput, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
1204
1247
|
/** Starts a provider device flow and returns its polling interval. */
|
|
1205
|
-
startDeviceAuthorization(provider: CopilotProvider): Promise<DeviceAuthorization>;
|
|
1248
|
+
startDeviceAuthorization(provider: CopilotProvider, options?: AgentCredentialOptions): Promise<DeviceAuthorization>;
|
|
1206
1249
|
/** Polls one device authorization. Respect the returned start interval between calls. */
|
|
1207
|
-
pollDeviceAuthorization(provider: CopilotProvider, deviceAuthId: string): Promise<AuthenticationResult>;
|
|
1250
|
+
pollDeviceAuthorization(provider: CopilotProvider, deviceAuthId: string, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
1208
1251
|
}
|
|
1209
1252
|
declare function createAgentCredentialsModule(transport: Transport, errors?: SdkCoreErrorFactory): AgentCredentialsModule;
|
|
1210
1253
|
|
|
@@ -1735,9 +1778,13 @@ interface NewAgentTaskSessionOptions {
|
|
|
1735
1778
|
title?: string;
|
|
1736
1779
|
agentId?: string;
|
|
1737
1780
|
reasoningEffort?: string;
|
|
1781
|
+
/** Catalog model id. */
|
|
1782
|
+
model?: string;
|
|
1738
1783
|
userId?: string;
|
|
1739
1784
|
/** Runtime the task is born on. Omitted means the Copilot server default. */
|
|
1740
1785
|
runtime?: AgentTaskRuntime;
|
|
1786
|
+
/** Credential scope the task resolves against. Omitted means the Copilot server default. */
|
|
1787
|
+
scope?: AgentCredentialScope;
|
|
1741
1788
|
/** Adapter preference. Server adapters support `http`; browser adapters may support all values. */
|
|
1742
1789
|
transport?: AgentSessionTransport;
|
|
1743
1790
|
}
|
|
@@ -1749,6 +1796,8 @@ type AgentTaskSessionOptions = NewAgentTaskSessionOptions | ExistingAgentTaskSes
|
|
|
1749
1796
|
interface AgentSendOptions {
|
|
1750
1797
|
agentType?: string;
|
|
1751
1798
|
reasoningEffort?: string;
|
|
1799
|
+
/** Catalog model id. */
|
|
1800
|
+
model?: string;
|
|
1752
1801
|
}
|
|
1753
1802
|
interface AgentSendAndWaitOptions extends AgentSendOptions {
|
|
1754
1803
|
signal?: AbortSignal;
|
|
@@ -1906,4 +1955,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
1906
1955
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
1907
1956
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
1908
1957
|
|
|
1909
|
-
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionsModule, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|
|
1958
|
+
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1022,6 +1022,8 @@ interface IntegrationExecution {
|
|
|
1022
1022
|
type CopilotProvider = "ANTHROPIC" | "OPENAI" | (string & {});
|
|
1023
1023
|
/** Execution runtime a chat is born on. Absent means the Copilot server default. */
|
|
1024
1024
|
type AgentTaskRuntime = "T3" | "RUNNER";
|
|
1025
|
+
/** Credential scope a call or a chat resolves against. Absent means the Copilot server default. */
|
|
1026
|
+
type AgentCredentialScope = "ACCOUNT";
|
|
1025
1027
|
interface AgentTaskCreateInput {
|
|
1026
1028
|
/** Optional title, at most 255 characters. */
|
|
1027
1029
|
title?: string;
|
|
@@ -1031,8 +1033,12 @@ interface AgentTaskCreateInput {
|
|
|
1031
1033
|
agentId?: string;
|
|
1032
1034
|
/** Optional reasoning setting supported by the selected model. */
|
|
1033
1035
|
reasoningEffort?: string;
|
|
1036
|
+
/** Catalog model id, for example `custom/<providerId>/<model>`. Copilot requires it for CUSTOM_AI. */
|
|
1037
|
+
model?: string;
|
|
1034
1038
|
/** Optional runtime. Core never defaults it; the concrete SDK decides what to send. */
|
|
1035
1039
|
runtime?: AgentTaskRuntime;
|
|
1040
|
+
/** Optional credential scope. Core never defaults it; the concrete SDK decides what to send. */
|
|
1041
|
+
scope?: AgentCredentialScope;
|
|
1036
1042
|
/** Owner for an on-behalf chat. Requires AGENT_WRITE in the current app. */
|
|
1037
1043
|
userId?: string;
|
|
1038
1044
|
/**
|
|
@@ -1049,6 +1055,10 @@ interface AgentTask {
|
|
|
1049
1055
|
title: string | null;
|
|
1050
1056
|
agentType: string;
|
|
1051
1057
|
reasoningEffort: string | null;
|
|
1058
|
+
/** Absent on a Copilot that predates credential scopes; null on a task without one. */
|
|
1059
|
+
scope?: AgentCredentialScope | null;
|
|
1060
|
+
/** Absent on a Copilot that predates custom providers; null on a task without an explicit model. */
|
|
1061
|
+
model?: string | null;
|
|
1052
1062
|
archived: boolean;
|
|
1053
1063
|
createdAt: string | null;
|
|
1054
1064
|
updatedAt: string;
|
|
@@ -1068,6 +1078,8 @@ type AgentTaskInput = {
|
|
|
1068
1078
|
content: string;
|
|
1069
1079
|
agentType?: string;
|
|
1070
1080
|
reasoningEffort?: string;
|
|
1081
|
+
/** Catalog model id. */
|
|
1082
|
+
model?: string;
|
|
1071
1083
|
} | {
|
|
1072
1084
|
type: "interrupt";
|
|
1073
1085
|
} | {
|
|
@@ -1095,6 +1107,8 @@ interface AgentModel {
|
|
|
1095
1107
|
provider: CopilotProvider;
|
|
1096
1108
|
agentType: string;
|
|
1097
1109
|
reasoningOptions: string[];
|
|
1110
|
+
/** Name the person chose for a custom provider; null on built-in models. Absent on an older Copilot. */
|
|
1111
|
+
providerName?: string | null;
|
|
1098
1112
|
}
|
|
1099
1113
|
interface CredentialStatus {
|
|
1100
1114
|
provider: CopilotProvider;
|
|
@@ -1137,12 +1151,31 @@ interface ProviderCredentialStatus {
|
|
|
1137
1151
|
credentialType: string | null;
|
|
1138
1152
|
accountEmail: string | null;
|
|
1139
1153
|
}
|
|
1154
|
+
interface AgentConnectionCustomProviderInput {
|
|
1155
|
+
/** Name the person chooses for the provider, unique within the connection. */
|
|
1156
|
+
name: string;
|
|
1157
|
+
/** OpenAI-compatible endpoint, http or https without a query string. */
|
|
1158
|
+
baseUrl: string;
|
|
1159
|
+
/** Write-only key. Copilot never returns it. */
|
|
1160
|
+
apiKey: string;
|
|
1161
|
+
/** 1 to 32 unique model ids served by the endpoint. */
|
|
1162
|
+
models: string[];
|
|
1163
|
+
}
|
|
1164
|
+
interface AgentConnectionCustomProvider {
|
|
1165
|
+
id: string;
|
|
1166
|
+
name: string;
|
|
1167
|
+
baseUrl: string;
|
|
1168
|
+
maskedApiKey: string;
|
|
1169
|
+
models: string[];
|
|
1170
|
+
}
|
|
1140
1171
|
interface AgentConnection {
|
|
1141
1172
|
id: string;
|
|
1142
1173
|
name: string;
|
|
1143
1174
|
createdAt: string;
|
|
1144
1175
|
updatedAt: string;
|
|
1145
1176
|
credentials: ProviderCredentialStatus[];
|
|
1177
|
+
/** Absent on a Copilot that predates custom providers. */
|
|
1178
|
+
customProviders?: AgentConnectionCustomProvider[];
|
|
1146
1179
|
}
|
|
1147
1180
|
interface MessageAccepted {
|
|
1148
1181
|
/** Identifier assigned by Messenger to the accepted notification. */
|
|
@@ -1185,26 +1218,36 @@ interface AgentConnectionsModule {
|
|
|
1185
1218
|
exchangeOAuth(id: string, provider: CopilotProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
1186
1219
|
startDeviceAuthorization(id: string, provider: CopilotProvider): Promise<DeviceAuthorization>;
|
|
1187
1220
|
pollDeviceAuthorization(id: string, provider: CopilotProvider, deviceAuthId: string): Promise<AuthenticationResult>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Adds an OpenAI-compatible provider under a name the person chooses. Its models join the
|
|
1223
|
+
* agent catalog as `custom/<providerId>/<model>`; the API key is write-only.
|
|
1224
|
+
*/
|
|
1225
|
+
createCustomProvider(id: string, input: AgentConnectionCustomProviderInput): Promise<AgentConnection>;
|
|
1226
|
+
deleteCustomProvider(id: string, providerId: string): Promise<void>;
|
|
1188
1227
|
}
|
|
1189
1228
|
declare function createAgentConnectionsModule(transport: Transport, errors?: SdkCoreErrorFactory): AgentConnectionsModule;
|
|
1190
1229
|
|
|
1230
|
+
interface AgentCredentialOptions {
|
|
1231
|
+
/** Credential scope the call resolves against. Omitted means the Copilot server default. */
|
|
1232
|
+
scope?: AgentCredentialScope;
|
|
1233
|
+
}
|
|
1191
1234
|
interface AgentCredentialsModule {
|
|
1192
1235
|
/** Lists safe credential status. Raw credentials never leave Copilot. */
|
|
1193
|
-
list(): Promise<CredentialStatus[]>;
|
|
1236
|
+
list(options?: AgentCredentialOptions): Promise<CredentialStatus[]>;
|
|
1194
1237
|
/** Lists models backed by a usable credential, optionally through a business agent connection. */
|
|
1195
|
-
listModels(agentId?: string): Promise<AgentModel[]>;
|
|
1238
|
+
listModels(agentId?: string, options?: AgentCredentialOptions): Promise<AgentModel[]>;
|
|
1196
1239
|
/** Validates and stores a write-only API key. */
|
|
1197
|
-
saveApiKey(provider: CopilotProvider, apiKey: string): Promise<void>;
|
|
1240
|
+
saveApiKey(provider: CopilotProvider, apiKey: string, options?: AgentCredentialOptions): Promise<void>;
|
|
1198
1241
|
/** Permanently removes the current credential for a provider. */
|
|
1199
|
-
remove(provider: CopilotProvider): Promise<void>;
|
|
1242
|
+
remove(provider: CopilotProvider, options?: AgentCredentialOptions): Promise<void>;
|
|
1200
1243
|
/** Starts provider OAuth and returns an opaque state that must be preserved. */
|
|
1201
|
-
startOAuth(provider: CopilotProvider): Promise<OAuthStartResult>;
|
|
1244
|
+
startOAuth(provider: CopilotProvider, options?: AgentCredentialOptions): Promise<OAuthStartResult>;
|
|
1202
1245
|
/** Exchanges provider OAuth code and state, saving the resulting credential. */
|
|
1203
|
-
exchangeOAuth(provider: CopilotProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
1246
|
+
exchangeOAuth(provider: CopilotProvider, input: OAuthExchangeInput, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
1204
1247
|
/** Starts a provider device flow and returns its polling interval. */
|
|
1205
|
-
startDeviceAuthorization(provider: CopilotProvider): Promise<DeviceAuthorization>;
|
|
1248
|
+
startDeviceAuthorization(provider: CopilotProvider, options?: AgentCredentialOptions): Promise<DeviceAuthorization>;
|
|
1206
1249
|
/** Polls one device authorization. Respect the returned start interval between calls. */
|
|
1207
|
-
pollDeviceAuthorization(provider: CopilotProvider, deviceAuthId: string): Promise<AuthenticationResult>;
|
|
1250
|
+
pollDeviceAuthorization(provider: CopilotProvider, deviceAuthId: string, options?: AgentCredentialOptions): Promise<AuthenticationResult>;
|
|
1208
1251
|
}
|
|
1209
1252
|
declare function createAgentCredentialsModule(transport: Transport, errors?: SdkCoreErrorFactory): AgentCredentialsModule;
|
|
1210
1253
|
|
|
@@ -1735,9 +1778,13 @@ interface NewAgentTaskSessionOptions {
|
|
|
1735
1778
|
title?: string;
|
|
1736
1779
|
agentId?: string;
|
|
1737
1780
|
reasoningEffort?: string;
|
|
1781
|
+
/** Catalog model id. */
|
|
1782
|
+
model?: string;
|
|
1738
1783
|
userId?: string;
|
|
1739
1784
|
/** Runtime the task is born on. Omitted means the Copilot server default. */
|
|
1740
1785
|
runtime?: AgentTaskRuntime;
|
|
1786
|
+
/** Credential scope the task resolves against. Omitted means the Copilot server default. */
|
|
1787
|
+
scope?: AgentCredentialScope;
|
|
1741
1788
|
/** Adapter preference. Server adapters support `http`; browser adapters may support all values. */
|
|
1742
1789
|
transport?: AgentSessionTransport;
|
|
1743
1790
|
}
|
|
@@ -1749,6 +1796,8 @@ type AgentTaskSessionOptions = NewAgentTaskSessionOptions | ExistingAgentTaskSes
|
|
|
1749
1796
|
interface AgentSendOptions {
|
|
1750
1797
|
agentType?: string;
|
|
1751
1798
|
reasoningEffort?: string;
|
|
1799
|
+
/** Catalog model id. */
|
|
1800
|
+
model?: string;
|
|
1752
1801
|
}
|
|
1753
1802
|
interface AgentSendAndWaitOptions extends AgentSendOptions {
|
|
1754
1803
|
signal?: AbortSignal;
|
|
@@ -1906,4 +1955,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
1906
1955
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
1907
1956
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
1908
1957
|
|
|
1909
|
-
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionsModule, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|
|
1958
|
+
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, type AgentConnectionCustomProvider, type AgentConnectionCustomProviderInput, type AgentConnectionsModule, type AgentCredentialOptions, type AgentCredentialScope, type AgentCredentialsModule, type AgentDefinition, type AgentInput, type AgentMessage, type AgentModel, type AgentQueueItem, type AgentSendAndWaitOptions, type AgentSendOptions, type AgentSessionTransport, type AgentTask, type AgentTaskCreateInput, type AgentTaskEvent, type AgentTaskEventConnection, type AgentTaskEventObserver, type AgentTaskEventSource, type AgentTaskInput, type AgentTaskListOptions, type AgentTaskRuntime, type AgentTaskSession, type AgentTaskSessionEventMap, type AgentTaskSessionManager, type AgentTaskSessionManagerOptions, type AgentTaskSessionOptions, type AgentTaskSessionStatus, AgentTaskTurnError, type AgentTasksModule, type AgentTasksWithSessions, type AgentTimelineItem, type AgentToolEvent, type AgentTurnResult, type AgentUpdateItem, type AgentsModule, type ApiKeyExchangeCaller, type AppColor, type AppContext, type AppCreateInput, type AppDefinition, type AppDeploy, type AppDomain, type AppFiles, type AppGetOptions, type AppListOptions, type AppMember, type AppPublishOptions, type AppSummary, type AppUpdateInput, type AppVersion, type AppVersionStatus, type AppsModule, type AuthModule, type AuthenticationResult, type BatchExecution, type BatchStatementResult, type BulkUnsubscribeResult, type ColumnInput, type ConnectionConfig, type ConnectionConfigResponse, type ConnectionTestResult, type ContextModule, type ContextModuleDependencies, type CopilotProvider, type CredentialStatus, type CustomQueriesModule, type CustomQueryDefinition, type CustomQueryInput, type CustomQuerySummary, type CustomQueryUpdateInput, type DataSourceBulkItemResult, type DataSourceBulkResult, type DataSourceCreateInput, type DataSourceDbType, type DataSourceDefinition, type DataSourceInstanceType, type DataSourceUpdateInput, type DataSourcesModule, type DdlStatement, type DeviceAuthorization, type DmlStatement, type EmptyFunctionInput, type EntitiesModule, type EntitiesProxy, type EntityListOptions, type EntityListResponse, type EntityTable, type ExistingAgentTaskSessionOptions, type FunctionBulkCreateInput, type FunctionBulkDeleteInput, type FunctionBulkDeleteResult, type FunctionBulkPatchInput, type FunctionBulkPatchItem, type FunctionBulkUpdateItem, type FunctionCreateInput, type FunctionDefinition, type FunctionExecution, type FunctionListOptions, type FunctionPatchInput, type FunctionRuntime, type FunctionSecrets, type FunctionSummary, type FunctionUpdateInput, type FunctionVersion, type FunctionVersionListOptions, type FunctionVisibility, type FunctionsAdminModule, type FunctionsModule, type FunctionsModuleOptions, type HttpMethod, type ImportColumnMapping, type ImportDefinition, type ImportExecution, type ImportExecutionListOptions, type ImportInput, type ImportProcessing, type ImportSchedule, type ImportSource, type ImportSourceResponse, type ImportTarget, type ImportsModule, type IntegrationAdminModule, type IntegrationConnectionStatus, type IntegrationCredentialRule, type IntegrationExecution, type IntegrationFieldSchema, type IntegrationFieldSchemaInput, type IntegrationLoginConfig, type IntegrationModule, type IntegrationProxyMode, type IntegrationRequestConfig, type IntegrationResource, type IntegrationResourceInput, type IntegrationResourceParam, type IntegrationResourceSummary, type IntegrationResourceUpdateInput, type IntegrationResourcesModule, type IntegrationTemplate, type IntegrationTemplateSummary, type IntegrationTemplateType, type IntegrationTemplatesModule, type IntegrationTokenExtraction, type InviteAppUserInput, type InvocationType, type JsonValue, type LegacyPage, type ListTablesOptions, type ListTemplateConfigsOptions, type MembersModule, type MessageAccepted, type MessengerModule, type NewAgentTaskSessionOptions, type OAuthExchangeInput, type OAuthStartResult, type Page, type PageOptions, type PlanPrice, type ProviderCredentialStatus, type ProxyInput, type ProxyResult, type PublicFunctionAsyncResult, type PublicFunctionResult, type PublicFunctionsModule, type QueriesModule, type QueryParamPrimitive, type QueryParamValue, type QueryResult, type SchemaModule, type SchemaScope, type SchemaTables, type SdkCore, SdkCoreConfigurationError, type SdkCoreErrorFactory, type SdkCoreOptions, SdkCoreResponseError, type SdkCoreTransports, type SqlModule, type TableColumn, type TableDefinition, type TableForeignKey, type TemplateConfig, type TemplateConfigBulkItemResult, type TemplateConfigBulkResult, type TemplateConfigCreateInput, type TemplateConfigPage, type TemplateConfigSummary, type TemplateConfigUpdateInput, type Tenant, type TestCredentialsInput, type Transport, type TransportRequestOptions, type User, type UserPlan, type WorkflowDefinition, type WorkflowExecution, type WorkflowInput, type WorkflowSummary, type WorkflowsModule, appAccessTokenPath, createAgentConnectionsModule, createAgentCredentialsModule, createAgentTaskSessionManager, createAgentTasksModule, createAgentsModule, createAppsModule, createAuthModule, createContextModule, createCustomQueriesModule, createDataSourcesModule, createEntitiesModule, createFunctionsAdminModule, createFunctionsModule, createImportsModule, createIntegrationAdminModule, createIntegrationModule, createIntegrationResourcesModule, createIntegrationTemplatesModule, createMembersModule, createMessengerModule, createPublicFunctionsModule, createQueriesModule, createSchemaModule, createSdkCore, createSqlModule, createWorkflowsModule, defaultSdkCoreErrorFactory, encodePathSegment, expectEmpty, expectLegacyPage, expectNullableObject, expectObject, expectObjectArray, expectPage, expectStringArray, isWorkspaceSession, readTokenAppId, readTokenExpiry, resolveApiKeyToken, toAgentTimelineItem, tokenAuthorizesApp, withAgentTaskSessions };
|