@mitralab.io/sdk-core 0.2.5-beta.0 → 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 +4 -0
- package/contracts/manifest.json +6 -1
- package/contracts/v0.2.6-beta.0/sdk-parity.json +2902 -0
- package/dist/index.cjs +51 -4
- package/dist/index.d.cts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +51 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -996,6 +996,7 @@ function expectAgentTask(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
996
996
|
if (!isNullableString(task[field])) invalidField(context, field, errors);
|
|
997
997
|
}
|
|
998
998
|
if ("scope" in task && !isNullableString(task.scope)) invalidField(context, "scope", errors);
|
|
999
|
+
if ("model" in task && !isNullableString(task.model)) invalidField(context, "model", errors);
|
|
999
1000
|
if (typeof task.agentType !== "string") invalidField(context, "agentType", errors);
|
|
1000
1001
|
if (typeof task.archived !== "boolean") invalidField(context, "archived", errors);
|
|
1001
1002
|
if (!isNullableString(task.createdAt)) invalidField(context, "createdAt", errors);
|
|
@@ -1015,6 +1016,9 @@ function expectAgentModel(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
1015
1016
|
if (typeof model[field] !== "string") invalidField(context, field, errors);
|
|
1016
1017
|
}
|
|
1017
1018
|
if (!isStringArray(model.reasoningOptions)) invalidField(context, "reasoningOptions", errors);
|
|
1019
|
+
if ("providerName" in model && !isNullableString(model.providerName)) {
|
|
1020
|
+
invalidField(context, "providerName", errors);
|
|
1021
|
+
}
|
|
1018
1022
|
return model;
|
|
1019
1023
|
}
|
|
1020
1024
|
function expectCredentialStatus(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
@@ -1054,6 +1058,14 @@ function expectProviderCredentialStatus(value, context, errors) {
|
|
|
1054
1058
|
if (!isNullableString(status.accountEmail)) invalidField(context, "accountEmail", errors);
|
|
1055
1059
|
return status;
|
|
1056
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
|
+
}
|
|
1057
1069
|
function expectAgentConnection(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
1058
1070
|
const connection = expectObject(value, context, errors);
|
|
1059
1071
|
if (typeof connection.id !== "string") invalidField(context, "id", errors);
|
|
@@ -1066,6 +1078,14 @@ function expectAgentConnection(value, context, errors = defaultSdkCoreErrorFacto
|
|
|
1066
1078
|
errors,
|
|
1067
1079
|
expectProviderCredentialStatus
|
|
1068
1080
|
);
|
|
1081
|
+
if ("customProviders" in connection) {
|
|
1082
|
+
expectObjectArray(
|
|
1083
|
+
connection.customProviders,
|
|
1084
|
+
`${context} customProviders`,
|
|
1085
|
+
errors,
|
|
1086
|
+
expectAgentConnectionCustomProvider
|
|
1087
|
+
);
|
|
1088
|
+
}
|
|
1069
1089
|
return connection;
|
|
1070
1090
|
}
|
|
1071
1091
|
function expectTableDefinition(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
@@ -1120,6 +1140,7 @@ function expectEmpty(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
1120
1140
|
|
|
1121
1141
|
// src/modules/agentConnections.ts
|
|
1122
1142
|
var MAX_CONNECTIONS = 100;
|
|
1143
|
+
var MAX_CUSTOM_PROVIDER_MODELS = 32;
|
|
1123
1144
|
function createAgentConnectionsModule(transport, errors = defaultSdkCoreErrorFactory) {
|
|
1124
1145
|
const path = (id) => `/api/v1/connections/${encodePathSegment(id, "connection id", errors)}`;
|
|
1125
1146
|
const providerPath = (id, provider) => `${path(id)}/providers/${encodePathSegment(provider, "provider", errors)}`;
|
|
@@ -1226,6 +1247,27 @@ function createAgentConnectionsModule(transport, errors = defaultSdkCoreErrorFac
|
|
|
1226
1247
|
"Connection device authorization poll response",
|
|
1227
1248
|
errors
|
|
1228
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
|
+
);
|
|
1229
1271
|
}
|
|
1230
1272
|
};
|
|
1231
1273
|
}
|
|
@@ -3200,7 +3242,8 @@ var CoreAgentTaskSession = class {
|
|
|
3200
3242
|
text: item.text,
|
|
3201
3243
|
createdAt: item.createdAt,
|
|
3202
3244
|
...item.agentType ? { agentType: item.agentType } : {},
|
|
3203
|
-
...item.reasoningEffort ? { reasoningEffort: item.reasoningEffort } : {}
|
|
3245
|
+
...item.reasoningEffort ? { reasoningEffort: item.reasoningEffort } : {},
|
|
3246
|
+
...item.model ? { model: item.model } : {}
|
|
3204
3247
|
}));
|
|
3205
3248
|
}
|
|
3206
3249
|
send(prompt, options = {}) {
|
|
@@ -3219,7 +3262,8 @@ var CoreAgentTaskSession = class {
|
|
|
3219
3262
|
if (waiter.settled) return waiter.promise;
|
|
3220
3263
|
const sendOptions = {
|
|
3221
3264
|
...options.agentType ? { agentType: options.agentType } : {},
|
|
3222
|
-
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {}
|
|
3265
|
+
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {},
|
|
3266
|
+
...options.model ? { model: options.model } : {}
|
|
3223
3267
|
};
|
|
3224
3268
|
if (this.isBusy()) {
|
|
3225
3269
|
const queueId = this.enqueue(prompt, sendOptions, waiter);
|
|
@@ -3356,7 +3400,8 @@ var CoreAgentTaskSession = class {
|
|
|
3356
3400
|
type: "message",
|
|
3357
3401
|
content: prompt,
|
|
3358
3402
|
...options.agentType ? { agentType: options.agentType } : {},
|
|
3359
|
-
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {}
|
|
3403
|
+
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {},
|
|
3404
|
+
...options.model ? { model: options.model } : {}
|
|
3360
3405
|
};
|
|
3361
3406
|
if (this.isClosed()) {
|
|
3362
3407
|
await this.sendInput(input).catch(() => void 0);
|
|
@@ -3386,6 +3431,7 @@ var CoreAgentTaskSession = class {
|
|
|
3386
3431
|
...createOptions.title ? { title: createOptions.title } : {},
|
|
3387
3432
|
...createOptions.agentId ? { agentId: createOptions.agentId } : {},
|
|
3388
3433
|
...createOptions.reasoningEffort ? { reasoningEffort: createOptions.reasoningEffort } : {},
|
|
3434
|
+
...createOptions.model ? { model: createOptions.model } : {},
|
|
3389
3435
|
...createOptions.userId ? { userId: createOptions.userId } : {},
|
|
3390
3436
|
...createOptions.runtime ? { runtime: createOptions.runtime } : {},
|
|
3391
3437
|
...createOptions.scope ? { scope: createOptions.scope } : {}
|
|
@@ -3652,7 +3698,8 @@ var CoreAgentTaskSession = class {
|
|
|
3652
3698
|
next.text,
|
|
3653
3699
|
{
|
|
3654
3700
|
...next.agentType ? { agentType: next.agentType } : {},
|
|
3655
|
-
...next.reasoningEffort ? { reasoningEffort: next.reasoningEffort } : {}
|
|
3701
|
+
...next.reasoningEffort ? { reasoningEffort: next.reasoningEffort } : {},
|
|
3702
|
+
...next.model ? { model: next.model } : {}
|
|
3656
3703
|
},
|
|
3657
3704
|
next.waiter
|
|
3658
3705
|
);
|
package/dist/index.d.cts
CHANGED
|
@@ -1033,6 +1033,8 @@ interface AgentTaskCreateInput {
|
|
|
1033
1033
|
agentId?: string;
|
|
1034
1034
|
/** Optional reasoning setting supported by the selected model. */
|
|
1035
1035
|
reasoningEffort?: string;
|
|
1036
|
+
/** Catalog model id, for example `custom/<providerId>/<model>`. Copilot requires it for CUSTOM_AI. */
|
|
1037
|
+
model?: string;
|
|
1036
1038
|
/** Optional runtime. Core never defaults it; the concrete SDK decides what to send. */
|
|
1037
1039
|
runtime?: AgentTaskRuntime;
|
|
1038
1040
|
/** Optional credential scope. Core never defaults it; the concrete SDK decides what to send. */
|
|
@@ -1055,6 +1057,8 @@ interface AgentTask {
|
|
|
1055
1057
|
reasoningEffort: string | null;
|
|
1056
1058
|
/** Absent on a Copilot that predates credential scopes; null on a task without one. */
|
|
1057
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;
|
|
1058
1062
|
archived: boolean;
|
|
1059
1063
|
createdAt: string | null;
|
|
1060
1064
|
updatedAt: string;
|
|
@@ -1074,6 +1078,8 @@ type AgentTaskInput = {
|
|
|
1074
1078
|
content: string;
|
|
1075
1079
|
agentType?: string;
|
|
1076
1080
|
reasoningEffort?: string;
|
|
1081
|
+
/** Catalog model id. */
|
|
1082
|
+
model?: string;
|
|
1077
1083
|
} | {
|
|
1078
1084
|
type: "interrupt";
|
|
1079
1085
|
} | {
|
|
@@ -1101,6 +1107,8 @@ interface AgentModel {
|
|
|
1101
1107
|
provider: CopilotProvider;
|
|
1102
1108
|
agentType: string;
|
|
1103
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;
|
|
1104
1112
|
}
|
|
1105
1113
|
interface CredentialStatus {
|
|
1106
1114
|
provider: CopilotProvider;
|
|
@@ -1143,12 +1151,31 @@ interface ProviderCredentialStatus {
|
|
|
1143
1151
|
credentialType: string | null;
|
|
1144
1152
|
accountEmail: string | null;
|
|
1145
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
|
+
}
|
|
1146
1171
|
interface AgentConnection {
|
|
1147
1172
|
id: string;
|
|
1148
1173
|
name: string;
|
|
1149
1174
|
createdAt: string;
|
|
1150
1175
|
updatedAt: string;
|
|
1151
1176
|
credentials: ProviderCredentialStatus[];
|
|
1177
|
+
/** Absent on a Copilot that predates custom providers. */
|
|
1178
|
+
customProviders?: AgentConnectionCustomProvider[];
|
|
1152
1179
|
}
|
|
1153
1180
|
interface MessageAccepted {
|
|
1154
1181
|
/** Identifier assigned by Messenger to the accepted notification. */
|
|
@@ -1191,6 +1218,12 @@ interface AgentConnectionsModule {
|
|
|
1191
1218
|
exchangeOAuth(id: string, provider: CopilotProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
1192
1219
|
startDeviceAuthorization(id: string, provider: CopilotProvider): Promise<DeviceAuthorization>;
|
|
1193
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>;
|
|
1194
1227
|
}
|
|
1195
1228
|
declare function createAgentConnectionsModule(transport: Transport, errors?: SdkCoreErrorFactory): AgentConnectionsModule;
|
|
1196
1229
|
|
|
@@ -1745,6 +1778,8 @@ interface NewAgentTaskSessionOptions {
|
|
|
1745
1778
|
title?: string;
|
|
1746
1779
|
agentId?: string;
|
|
1747
1780
|
reasoningEffort?: string;
|
|
1781
|
+
/** Catalog model id. */
|
|
1782
|
+
model?: string;
|
|
1748
1783
|
userId?: string;
|
|
1749
1784
|
/** Runtime the task is born on. Omitted means the Copilot server default. */
|
|
1750
1785
|
runtime?: AgentTaskRuntime;
|
|
@@ -1761,6 +1796,8 @@ type AgentTaskSessionOptions = NewAgentTaskSessionOptions | ExistingAgentTaskSes
|
|
|
1761
1796
|
interface AgentSendOptions {
|
|
1762
1797
|
agentType?: string;
|
|
1763
1798
|
reasoningEffort?: string;
|
|
1799
|
+
/** Catalog model id. */
|
|
1800
|
+
model?: string;
|
|
1764
1801
|
}
|
|
1765
1802
|
interface AgentSendAndWaitOptions extends AgentSendOptions {
|
|
1766
1803
|
signal?: AbortSignal;
|
|
@@ -1918,4 +1955,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
1918
1955
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
1919
1956
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
1920
1957
|
|
|
1921
|
-
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, 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 };
|
|
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
|
@@ -1033,6 +1033,8 @@ interface AgentTaskCreateInput {
|
|
|
1033
1033
|
agentId?: string;
|
|
1034
1034
|
/** Optional reasoning setting supported by the selected model. */
|
|
1035
1035
|
reasoningEffort?: string;
|
|
1036
|
+
/** Catalog model id, for example `custom/<providerId>/<model>`. Copilot requires it for CUSTOM_AI. */
|
|
1037
|
+
model?: string;
|
|
1036
1038
|
/** Optional runtime. Core never defaults it; the concrete SDK decides what to send. */
|
|
1037
1039
|
runtime?: AgentTaskRuntime;
|
|
1038
1040
|
/** Optional credential scope. Core never defaults it; the concrete SDK decides what to send. */
|
|
@@ -1055,6 +1057,8 @@ interface AgentTask {
|
|
|
1055
1057
|
reasoningEffort: string | null;
|
|
1056
1058
|
/** Absent on a Copilot that predates credential scopes; null on a task without one. */
|
|
1057
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;
|
|
1058
1062
|
archived: boolean;
|
|
1059
1063
|
createdAt: string | null;
|
|
1060
1064
|
updatedAt: string;
|
|
@@ -1074,6 +1078,8 @@ type AgentTaskInput = {
|
|
|
1074
1078
|
content: string;
|
|
1075
1079
|
agentType?: string;
|
|
1076
1080
|
reasoningEffort?: string;
|
|
1081
|
+
/** Catalog model id. */
|
|
1082
|
+
model?: string;
|
|
1077
1083
|
} | {
|
|
1078
1084
|
type: "interrupt";
|
|
1079
1085
|
} | {
|
|
@@ -1101,6 +1107,8 @@ interface AgentModel {
|
|
|
1101
1107
|
provider: CopilotProvider;
|
|
1102
1108
|
agentType: string;
|
|
1103
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;
|
|
1104
1112
|
}
|
|
1105
1113
|
interface CredentialStatus {
|
|
1106
1114
|
provider: CopilotProvider;
|
|
@@ -1143,12 +1151,31 @@ interface ProviderCredentialStatus {
|
|
|
1143
1151
|
credentialType: string | null;
|
|
1144
1152
|
accountEmail: string | null;
|
|
1145
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
|
+
}
|
|
1146
1171
|
interface AgentConnection {
|
|
1147
1172
|
id: string;
|
|
1148
1173
|
name: string;
|
|
1149
1174
|
createdAt: string;
|
|
1150
1175
|
updatedAt: string;
|
|
1151
1176
|
credentials: ProviderCredentialStatus[];
|
|
1177
|
+
/** Absent on a Copilot that predates custom providers. */
|
|
1178
|
+
customProviders?: AgentConnectionCustomProvider[];
|
|
1152
1179
|
}
|
|
1153
1180
|
interface MessageAccepted {
|
|
1154
1181
|
/** Identifier assigned by Messenger to the accepted notification. */
|
|
@@ -1191,6 +1218,12 @@ interface AgentConnectionsModule {
|
|
|
1191
1218
|
exchangeOAuth(id: string, provider: CopilotProvider, input: OAuthExchangeInput): Promise<AuthenticationResult>;
|
|
1192
1219
|
startDeviceAuthorization(id: string, provider: CopilotProvider): Promise<DeviceAuthorization>;
|
|
1193
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>;
|
|
1194
1227
|
}
|
|
1195
1228
|
declare function createAgentConnectionsModule(transport: Transport, errors?: SdkCoreErrorFactory): AgentConnectionsModule;
|
|
1196
1229
|
|
|
@@ -1745,6 +1778,8 @@ interface NewAgentTaskSessionOptions {
|
|
|
1745
1778
|
title?: string;
|
|
1746
1779
|
agentId?: string;
|
|
1747
1780
|
reasoningEffort?: string;
|
|
1781
|
+
/** Catalog model id. */
|
|
1782
|
+
model?: string;
|
|
1748
1783
|
userId?: string;
|
|
1749
1784
|
/** Runtime the task is born on. Omitted means the Copilot server default. */
|
|
1750
1785
|
runtime?: AgentTaskRuntime;
|
|
@@ -1761,6 +1796,8 @@ type AgentTaskSessionOptions = NewAgentTaskSessionOptions | ExistingAgentTaskSes
|
|
|
1761
1796
|
interface AgentSendOptions {
|
|
1762
1797
|
agentType?: string;
|
|
1763
1798
|
reasoningEffort?: string;
|
|
1799
|
+
/** Catalog model id. */
|
|
1800
|
+
model?: string;
|
|
1764
1801
|
}
|
|
1765
1802
|
interface AgentSendAndWaitOptions extends AgentSendOptions {
|
|
1766
1803
|
signal?: AbortSignal;
|
|
@@ -1918,4 +1955,4 @@ declare function expectPage<T extends object>(value: unknown, context: string, e
|
|
|
1918
1955
|
declare function expectLegacyPage<T extends object>(value: unknown, context: string, errors?: SdkCoreErrorFactory, validateItem?: (value: unknown, context: string, errors: SdkCoreErrorFactory) => T): LegacyPage<T>;
|
|
1919
1956
|
declare function expectEmpty(value: unknown, context: string, errors?: SdkCoreErrorFactory): void;
|
|
1920
1957
|
|
|
1921
|
-
export { API_KEY_EXCHANGE_PATH, type AgentBulkDeleteResult, type AgentConnection, type AgentConnectionCreateInput, 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 };
|
|
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.js
CHANGED
|
@@ -924,6 +924,7 @@ function expectAgentTask(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
924
924
|
if (!isNullableString(task[field])) invalidField(context, field, errors);
|
|
925
925
|
}
|
|
926
926
|
if ("scope" in task && !isNullableString(task.scope)) invalidField(context, "scope", errors);
|
|
927
|
+
if ("model" in task && !isNullableString(task.model)) invalidField(context, "model", errors);
|
|
927
928
|
if (typeof task.agentType !== "string") invalidField(context, "agentType", errors);
|
|
928
929
|
if (typeof task.archived !== "boolean") invalidField(context, "archived", errors);
|
|
929
930
|
if (!isNullableString(task.createdAt)) invalidField(context, "createdAt", errors);
|
|
@@ -943,6 +944,9 @@ function expectAgentModel(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
943
944
|
if (typeof model[field] !== "string") invalidField(context, field, errors);
|
|
944
945
|
}
|
|
945
946
|
if (!isStringArray(model.reasoningOptions)) invalidField(context, "reasoningOptions", errors);
|
|
947
|
+
if ("providerName" in model && !isNullableString(model.providerName)) {
|
|
948
|
+
invalidField(context, "providerName", errors);
|
|
949
|
+
}
|
|
946
950
|
return model;
|
|
947
951
|
}
|
|
948
952
|
function expectCredentialStatus(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
@@ -982,6 +986,14 @@ function expectProviderCredentialStatus(value, context, errors) {
|
|
|
982
986
|
if (!isNullableString(status.accountEmail)) invalidField(context, "accountEmail", errors);
|
|
983
987
|
return status;
|
|
984
988
|
}
|
|
989
|
+
function expectAgentConnectionCustomProvider(value, context, errors) {
|
|
990
|
+
const provider = expectObject(value, context, errors);
|
|
991
|
+
for (const field of ["id", "name", "baseUrl", "maskedApiKey"]) {
|
|
992
|
+
if (typeof provider[field] !== "string") invalidField(context, field, errors);
|
|
993
|
+
}
|
|
994
|
+
if (!isStringArray(provider.models)) invalidField(context, "models", errors);
|
|
995
|
+
return provider;
|
|
996
|
+
}
|
|
985
997
|
function expectAgentConnection(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
986
998
|
const connection = expectObject(value, context, errors);
|
|
987
999
|
if (typeof connection.id !== "string") invalidField(context, "id", errors);
|
|
@@ -994,6 +1006,14 @@ function expectAgentConnection(value, context, errors = defaultSdkCoreErrorFacto
|
|
|
994
1006
|
errors,
|
|
995
1007
|
expectProviderCredentialStatus
|
|
996
1008
|
);
|
|
1009
|
+
if ("customProviders" in connection) {
|
|
1010
|
+
expectObjectArray(
|
|
1011
|
+
connection.customProviders,
|
|
1012
|
+
`${context} customProviders`,
|
|
1013
|
+
errors,
|
|
1014
|
+
expectAgentConnectionCustomProvider
|
|
1015
|
+
);
|
|
1016
|
+
}
|
|
997
1017
|
return connection;
|
|
998
1018
|
}
|
|
999
1019
|
function expectTableDefinition(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
@@ -1048,6 +1068,7 @@ function expectEmpty(value, context, errors = defaultSdkCoreErrorFactory) {
|
|
|
1048
1068
|
|
|
1049
1069
|
// src/modules/agentConnections.ts
|
|
1050
1070
|
var MAX_CONNECTIONS = 100;
|
|
1071
|
+
var MAX_CUSTOM_PROVIDER_MODELS = 32;
|
|
1051
1072
|
function createAgentConnectionsModule(transport, errors = defaultSdkCoreErrorFactory) {
|
|
1052
1073
|
const path = (id) => `/api/v1/connections/${encodePathSegment(id, "connection id", errors)}`;
|
|
1053
1074
|
const providerPath = (id, provider) => `${path(id)}/providers/${encodePathSegment(provider, "provider", errors)}`;
|
|
@@ -1154,6 +1175,27 @@ function createAgentConnectionsModule(transport, errors = defaultSdkCoreErrorFac
|
|
|
1154
1175
|
"Connection device authorization poll response",
|
|
1155
1176
|
errors
|
|
1156
1177
|
);
|
|
1178
|
+
},
|
|
1179
|
+
async createCustomProvider(id, input) {
|
|
1180
|
+
requireBatchSize(input.models, "models", MAX_CUSTOM_PROVIDER_MODELS, errors);
|
|
1181
|
+
return expectAgentConnection(
|
|
1182
|
+
await transport.request(`${path(id)}/custom-providers`, {
|
|
1183
|
+
method: "POST",
|
|
1184
|
+
body: input
|
|
1185
|
+
}),
|
|
1186
|
+
"Create connection custom provider response",
|
|
1187
|
+
errors
|
|
1188
|
+
);
|
|
1189
|
+
},
|
|
1190
|
+
async deleteCustomProvider(id, providerId) {
|
|
1191
|
+
expectEmpty(
|
|
1192
|
+
await transport.request(
|
|
1193
|
+
`${path(id)}/custom-providers/${encodePathSegment(providerId, "custom provider id", errors)}`,
|
|
1194
|
+
{ method: "DELETE" }
|
|
1195
|
+
),
|
|
1196
|
+
"Delete connection custom provider response",
|
|
1197
|
+
errors
|
|
1198
|
+
);
|
|
1157
1199
|
}
|
|
1158
1200
|
};
|
|
1159
1201
|
}
|
|
@@ -3128,7 +3170,8 @@ var CoreAgentTaskSession = class {
|
|
|
3128
3170
|
text: item.text,
|
|
3129
3171
|
createdAt: item.createdAt,
|
|
3130
3172
|
...item.agentType ? { agentType: item.agentType } : {},
|
|
3131
|
-
...item.reasoningEffort ? { reasoningEffort: item.reasoningEffort } : {}
|
|
3173
|
+
...item.reasoningEffort ? { reasoningEffort: item.reasoningEffort } : {},
|
|
3174
|
+
...item.model ? { model: item.model } : {}
|
|
3132
3175
|
}));
|
|
3133
3176
|
}
|
|
3134
3177
|
send(prompt, options = {}) {
|
|
@@ -3147,7 +3190,8 @@ var CoreAgentTaskSession = class {
|
|
|
3147
3190
|
if (waiter.settled) return waiter.promise;
|
|
3148
3191
|
const sendOptions = {
|
|
3149
3192
|
...options.agentType ? { agentType: options.agentType } : {},
|
|
3150
|
-
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {}
|
|
3193
|
+
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {},
|
|
3194
|
+
...options.model ? { model: options.model } : {}
|
|
3151
3195
|
};
|
|
3152
3196
|
if (this.isBusy()) {
|
|
3153
3197
|
const queueId = this.enqueue(prompt, sendOptions, waiter);
|
|
@@ -3284,7 +3328,8 @@ var CoreAgentTaskSession = class {
|
|
|
3284
3328
|
type: "message",
|
|
3285
3329
|
content: prompt,
|
|
3286
3330
|
...options.agentType ? { agentType: options.agentType } : {},
|
|
3287
|
-
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {}
|
|
3331
|
+
...options.reasoningEffort ? { reasoningEffort: options.reasoningEffort } : {},
|
|
3332
|
+
...options.model ? { model: options.model } : {}
|
|
3288
3333
|
};
|
|
3289
3334
|
if (this.isClosed()) {
|
|
3290
3335
|
await this.sendInput(input).catch(() => void 0);
|
|
@@ -3314,6 +3359,7 @@ var CoreAgentTaskSession = class {
|
|
|
3314
3359
|
...createOptions.title ? { title: createOptions.title } : {},
|
|
3315
3360
|
...createOptions.agentId ? { agentId: createOptions.agentId } : {},
|
|
3316
3361
|
...createOptions.reasoningEffort ? { reasoningEffort: createOptions.reasoningEffort } : {},
|
|
3362
|
+
...createOptions.model ? { model: createOptions.model } : {},
|
|
3317
3363
|
...createOptions.userId ? { userId: createOptions.userId } : {},
|
|
3318
3364
|
...createOptions.runtime ? { runtime: createOptions.runtime } : {},
|
|
3319
3365
|
...createOptions.scope ? { scope: createOptions.scope } : {}
|
|
@@ -3580,7 +3626,8 @@ var CoreAgentTaskSession = class {
|
|
|
3580
3626
|
next.text,
|
|
3581
3627
|
{
|
|
3582
3628
|
...next.agentType ? { agentType: next.agentType } : {},
|
|
3583
|
-
...next.reasoningEffort ? { reasoningEffort: next.reasoningEffort } : {}
|
|
3629
|
+
...next.reasoningEffort ? { reasoningEffort: next.reasoningEffort } : {},
|
|
3630
|
+
...next.model ? { model: next.model } : {}
|
|
3584
3631
|
},
|
|
3585
3632
|
next.waiter
|
|
3586
3633
|
);
|