@mitralab.io/sdk-core 0.3.6 → 0.3.8

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/dist/index.js CHANGED
@@ -48,9 +48,6 @@ function isObject(value) {
48
48
  function isNullableString(value) {
49
49
  return value === null || typeof value === "string";
50
50
  }
51
- function isNonEmptyString(value) {
52
- return typeof value === "string" && value.length > 0;
53
- }
54
51
  function isNullableBoolean(value) {
55
52
  return value === null || typeof value === "boolean";
56
53
  }
@@ -439,9 +436,6 @@ function expectAppFields(app, context, errors) {
439
436
  if (!isNullableString(app.icon)) invalidField(context, "icon", errors);
440
437
  if (!isNullableString(app.template)) invalidField(context, "template", errors);
441
438
  if (typeof app.allowSignup !== "boolean") invalidField(context, "allowSignup", errors);
442
- for (const field of ["emailLoginEnabled", "passwordLoginEnabled"]) {
443
- if (field in app && typeof app[field] !== "boolean") invalidField(context, field, errors);
444
- }
445
439
  if (typeof app.externalAccessEnabled !== "boolean") {
446
440
  invalidField(context, "externalAccessEnabled", errors);
447
441
  }
@@ -684,83 +678,6 @@ function expectMessageAccepted(value, context, errors = defaultSdkCoreErrorFacto
684
678
  if (typeof response.messageId !== "string") invalidField(context, "messageId", errors);
685
679
  return response;
686
680
  }
687
- function expectEmailTemplate(value, context, errors = defaultSdkCoreErrorFactory) {
688
- const template = expectObject(value, context, errors);
689
- if (typeof template.id !== "string") invalidField(context, "id", errors);
690
- if (!isNonEmptyString(template.type)) invalidField(context, "type", errors);
691
- if (!isNullableString(template.senderIdentityId)) {
692
- invalidField(context, "senderIdentityId", errors);
693
- }
694
- if (typeof template.subject !== "string") invalidField(context, "subject", errors);
695
- if (typeof template.htmlBody !== "string") invalidField(context, "htmlBody", errors);
696
- if (!isNullableString(template.textBody)) invalidField(context, "textBody", errors);
697
- if (typeof template.platformDefault !== "boolean") {
698
- invalidField(context, "platformDefault", errors);
699
- }
700
- if (typeof template.createdAt !== "string") invalidField(context, "createdAt", errors);
701
- if (typeof template.updatedAt !== "string") invalidField(context, "updatedAt", errors);
702
- return template;
703
- }
704
- function expectEmailTemplateTypeCatalog(value, context, errors = defaultSdkCoreErrorFactory) {
705
- const catalog = expectObject(value, context, errors);
706
- if (!isNonEmptyString(catalog.type)) invalidField(context, "type", errors);
707
- expectObjectArray(catalog.variables, `${context} variables`, errors).forEach(
708
- (variable, position) => {
709
- const variableContext = `${context} variable ${position}`;
710
- if (typeof variable.name !== "string") invalidField(variableContext, "name", errors);
711
- if (typeof variable.required !== "boolean") {
712
- invalidField(variableContext, "required", errors);
713
- }
714
- if (!isNullableString(variable.description)) {
715
- invalidField(variableContext, "description", errors);
716
- }
717
- if (!isNullableString(variable.preview)) invalidField(variableContext, "preview", errors);
718
- }
719
- );
720
- return catalog;
721
- }
722
- function expectEmailTemplatePreview(value, context, errors = defaultSdkCoreErrorFactory) {
723
- const preview = expectObject(value, context, errors);
724
- if (typeof preview.subject !== "string") invalidField(context, "subject", errors);
725
- if (typeof preview.htmlBody !== "string") invalidField(context, "htmlBody", errors);
726
- if (!isNullableString(preview.textBody)) invalidField(context, "textBody", errors);
727
- return preview;
728
- }
729
- function expectEmailSender(value, context, errors = defaultSdkCoreErrorFactory) {
730
- const sender = expectObject(value, context, errors);
731
- if (typeof sender.id !== "string") invalidField(context, "id", errors);
732
- if (typeof sender.email !== "string") invalidField(context, "email", errors);
733
- if (typeof sender.displayName !== "string") invalidField(context, "displayName", errors);
734
- if (!isNonEmptyString(sender.status)) invalidField(context, "status", errors);
735
- if (typeof sender.sharedWithCurrentWorkspace !== "boolean") {
736
- invalidField(context, "sharedWithCurrentWorkspace", errors);
737
- }
738
- if (typeof sender.ownerConfirmationPending !== "boolean") {
739
- invalidField(context, "ownerConfirmationPending", errors);
740
- }
741
- if (typeof sender.createdAt !== "string") invalidField(context, "createdAt", errors);
742
- if (typeof sender.updatedAt !== "string") invalidField(context, "updatedAt", errors);
743
- return sender;
744
- }
745
- function expectEmailSettings(value, context, errors = defaultSdkCoreErrorFactory) {
746
- const settings = expectObject(value, context, errors);
747
- if (typeof settings.appId !== "string") invalidField(context, "appId", errors);
748
- if (!isNullableString(settings.senderIdentityId)) {
749
- invalidField(context, "senderIdentityId", errors);
750
- }
751
- if (!isNullableString(settings.displayName)) invalidField(context, "displayName", errors);
752
- if (!isNullableString(settings.replyTo)) invalidField(context, "replyTo", errors);
753
- if (typeof settings.ownTemplateSendsFromBrand !== "boolean") {
754
- invalidField(context, "ownTemplateSendsFromBrand", errors);
755
- }
756
- const senderContext = `${context} effectiveSender`;
757
- const sender = expectObject(settings.effectiveSender, senderContext, errors);
758
- if (typeof sender.email !== "string") invalidField(senderContext, "email", errors);
759
- if (!isNullableString(sender.displayName)) invalidField(senderContext, "displayName", errors);
760
- if (!isNonEmptyString(sender.source)) invalidField(senderContext, "source", errors);
761
- if (!isNullableString(sender.reason)) invalidField(senderContext, "reason", errors);
762
- return settings;
763
- }
764
681
  function expectAgentDefinition(value, context, errors = defaultSdkCoreErrorFactory) {
765
682
  const agent = expectObject(value, context, errors);
766
683
  if (typeof agent.id !== "string") invalidField(context, "id", errors);
@@ -1109,6 +1026,78 @@ function expectAgentModel(value, context, errors = defaultSdkCoreErrorFactory) {
1109
1026
  }
1110
1027
  return model;
1111
1028
  }
1029
+ function expectAiProviders(value, context, errors = defaultSdkCoreErrorFactory) {
1030
+ const providers = expectObject(value, context, errors);
1031
+ if (typeof providers.activeEngine !== "string") {
1032
+ invalidField(context, "activeEngine", errors);
1033
+ }
1034
+ if (typeof providers.includedAiAvailable !== "boolean") {
1035
+ invalidField(context, "includedAiAvailable", errors);
1036
+ }
1037
+ if (!isNullableString(providers.activeCustomProviderId)) {
1038
+ invalidField(context, "activeCustomProviderId", errors);
1039
+ }
1040
+ expectObjectArray(
1041
+ providers.customProviders,
1042
+ `${context} customProviders`,
1043
+ errors,
1044
+ expectAgentConnectionCustomProvider
1045
+ );
1046
+ if (providers.includedAiQuota !== null) {
1047
+ expectIncludedAiQuota(providers.includedAiQuota, `${context} includedAiQuota`, errors);
1048
+ }
1049
+ const opencode = expectObject(providers.opencode, `${context} opencode`, errors);
1050
+ if (typeof opencode.connected !== "boolean") invalidField(context, "opencode.connected", errors);
1051
+ for (const field of ["presetId", "presetName", "providerId", "baseUrl"]) {
1052
+ if (!isNullableString(opencode[field])) invalidField(context, `opencode.${field}`, errors);
1053
+ }
1054
+ if (!isNullableString(opencode.authMethod)) {
1055
+ invalidField(context, "opencode.authMethod", errors);
1056
+ }
1057
+ if (opencode.models !== null && !isStringArray(opencode.models)) {
1058
+ invalidField(context, "opencode.models", errors);
1059
+ }
1060
+ if (hasOwn(providers, "managedAiProfile") && providers.managedAiProfile !== null) {
1061
+ const profile = expectObject(
1062
+ providers.managedAiProfile,
1063
+ `${context} managedAiProfile`,
1064
+ errors
1065
+ );
1066
+ for (const field of [
1067
+ "profile",
1068
+ "agentType",
1069
+ "selectionMode",
1070
+ "model",
1071
+ "requiredScope"
1072
+ ]) {
1073
+ if (typeof profile[field] !== "string") {
1074
+ invalidField(context, `managedAiProfile.${field}`, errors);
1075
+ }
1076
+ }
1077
+ }
1078
+ return providers;
1079
+ }
1080
+ function expectIncludedAiQuota(value, context, errors) {
1081
+ const quota = expectObject(value, context, errors);
1082
+ if (typeof quota.planCode !== "string") invalidField(context, "planCode", errors);
1083
+ if (hasOwn(quota, "blockingWindow") && typeof quota.blockingWindow !== "string") {
1084
+ invalidField(context, "blockingWindow", errors);
1085
+ }
1086
+ if (hasOwn(quota, "remainingTokens") && !isInteger(quota.remainingTokens)) {
1087
+ invalidField(context, "remainingTokens", errors);
1088
+ }
1089
+ const windows = expectObject(quota.windows, `${context} windows`, errors);
1090
+ for (const kind of ["day", "month"]) {
1091
+ if (!hasOwn(windows, kind)) continue;
1092
+ const window = expectObject(windows[kind], `${context} windows.${kind}`, errors);
1093
+ for (const field of ["limit", "left", "leftCenticredits"]) {
1094
+ if (!isInteger(window[field])) invalidField(context, `windows.${kind}.${field}`, errors);
1095
+ }
1096
+ if (typeof window.resetsAt !== "string") {
1097
+ invalidField(context, `windows.${kind}.resetsAt`, errors);
1098
+ }
1099
+ }
1100
+ }
1112
1101
  function expectCredentialStatus(value, context, errors = defaultSdkCoreErrorFactory) {
1113
1102
  const status = expectObject(value, context, errors);
1114
1103
  if (typeof status.provider !== "string") invalidField(context, "provider", errors);
@@ -1719,6 +1708,7 @@ function createAgentTasksModule(transport, errors = defaultSdkCoreErrorFactory)
1719
1708
  size: options.size,
1720
1709
  sort: options.sort,
1721
1710
  kinds: options.kinds,
1711
+ include: options.include,
1722
1712
  before: options.before
1723
1713
  }
1724
1714
  }),
@@ -1742,6 +1732,19 @@ function createAgentTasksModule(transport, errors = defaultSdkCoreErrorFactory)
1742
1732
  };
1743
1733
  }
1744
1734
 
1735
+ // src/modules/aiProviders.ts
1736
+ function createAiProvidersModule(transport, errors = defaultSdkCoreErrorFactory) {
1737
+ return {
1738
+ async get() {
1739
+ return expectAiProviders(
1740
+ await transport.request("/api/v1/ai-providers", { method: "GET" }),
1741
+ "AI providers response",
1742
+ errors
1743
+ );
1744
+ }
1745
+ };
1746
+ }
1747
+
1745
1748
  // src/modules/apps.ts
1746
1749
  function createAppsModule(transport, errors = defaultSdkCoreErrorFactory) {
1747
1750
  const appPath = (appId) => `/api/v1/apps/${encodePathSegment(appId, "app id", errors)}`;
@@ -2958,23 +2961,7 @@ function createMembersModule(transport, errors = defaultSdkCoreErrorFactory) {
2958
2961
  }
2959
2962
 
2960
2963
  // src/modules/messenger.ts
2961
- function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory, getAppId) {
2962
- const templatePath = (type) => `/api/v1/email/templates/${encodePathSegment(type, "email template type", errors)}`;
2963
- const senderPath = (senderId) => `/api/v1/email/identities/${encodePathSegment(senderId, "email sender id", errors)}`;
2964
- const currentAppId = () => {
2965
- const appId = getAppId?.();
2966
- if (!appId) configurationError("An appId is required for app email calls", errors);
2967
- return appId;
2968
- };
2969
- const settingsPath = () => `/api/v1/email/apps/${encodePathSegment(currentAppId(), "app id", errors)}/settings`;
2970
- const preview = async (type, appId) => expectEmailTemplatePreview(
2971
- await transport.request(`${templatePath(type)}/preview`, {
2972
- method: "GET",
2973
- params: { appId }
2974
- }),
2975
- "Email template preview response",
2976
- errors
2977
- );
2964
+ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory) {
2978
2965
  return {
2979
2966
  async notify(content) {
2980
2967
  return expectMessageAccepted(
@@ -2995,120 +2982,6 @@ function createMessengerModule(transport, errors = defaultSdkCoreErrorFactory, g
2995
2982
  "Send email response",
2996
2983
  errors
2997
2984
  );
2998
- },
2999
- async listEmailTemplates() {
3000
- return expectObjectArray(
3001
- await transport.request("/api/v1/email/templates", {
3002
- method: "GET",
3003
- params: { appId: currentAppId() }
3004
- }),
3005
- "Email template list response",
3006
- errors,
3007
- expectEmailTemplate
3008
- );
3009
- },
3010
- async getEmailTemplateType(type) {
3011
- return expectEmailTemplateTypeCatalog(
3012
- await transport.request(
3013
- `/api/v1/email/template-types/${encodePathSegment(type, "email template type", errors)}`,
3014
- { method: "GET" }
3015
- ),
3016
- "Email template type response",
3017
- errors
3018
- );
3019
- },
3020
- async getEmailTemplate(type) {
3021
- return expectEmailTemplate(
3022
- await transport.request(templatePath(type), {
3023
- method: "GET",
3024
- params: { appId: currentAppId() }
3025
- }),
3026
- "Email template response",
3027
- errors
3028
- );
3029
- },
3030
- async upsertEmailTemplate(type, input) {
3031
- const appId = currentAppId();
3032
- const template = expectEmailTemplate(
3033
- await transport.request(templatePath(type), {
3034
- method: "PUT",
3035
- body: templateBody(appId, input)
3036
- }),
3037
- "Upsert email template response",
3038
- errors
3039
- );
3040
- try {
3041
- return { template, preview: await preview(type, appId) };
3042
- } catch (previewError) {
3043
- return { template, preview: null, previewError };
3044
- }
3045
- },
3046
- async previewEmailTemplate(type) {
3047
- return preview(type, currentAppId());
3048
- },
3049
- async deleteEmailTemplate(type) {
3050
- expectEmpty(
3051
- await transport.request(templatePath(type), {
3052
- method: "DELETE",
3053
- params: { appId: currentAppId() }
3054
- }),
3055
- "Delete email template response",
3056
- errors
3057
- );
3058
- },
3059
- async listEmailSenders() {
3060
- return expectObjectArray(
3061
- await transport.request("/api/v1/email/identities/workspace", { method: "GET" }),
3062
- "Email sender list response",
3063
- errors,
3064
- expectEmailSender
3065
- );
3066
- },
3067
- async registerEmailSender(input) {
3068
- return expectEmailSender(
3069
- await transport.request("/api/v1/email/identities", {
3070
- method: "POST",
3071
- body: { email: input.email, displayName: input.displayName }
3072
- }),
3073
- "Register email sender response",
3074
- errors
3075
- );
3076
- },
3077
- async resendEmailSenderVerification(senderId) {
3078
- return expectEmailSender(
3079
- await transport.request(`${senderPath(senderId)}/resend-verification`, {
3080
- method: "POST"
3081
- }),
3082
- "Resend email sender verification response",
3083
- errors
3084
- );
3085
- },
3086
- async confirmEmailSender(senderId, code) {
3087
- return expectEmailSender(
3088
- await transport.request(`${senderPath(senderId)}/confirm`, {
3089
- method: "POST",
3090
- body: { code }
3091
- }),
3092
- "Confirm email sender response",
3093
- errors
3094
- );
3095
- },
3096
- async getEmailSettings() {
3097
- return expectEmailSettings(
3098
- await transport.request(settingsPath(), { method: "GET" }),
3099
- "Email settings response",
3100
- errors
3101
- );
3102
- },
3103
- async updateEmailSettings(input) {
3104
- return expectEmailSettings(
3105
- await transport.request(settingsPath(), {
3106
- method: "PUT",
3107
- body: settingsBody(input)
3108
- }),
3109
- "Update email settings response",
3110
- errors
3111
- );
3112
2985
  }
3113
2986
  };
3114
2987
  }
@@ -3124,21 +2997,6 @@ function rawEmailPayload(input) {
3124
2997
  ...input.text === void 0 ? {} : { text: input.text }
3125
2998
  };
3126
2999
  }
3127
- function templateBody(appId, input) {
3128
- return {
3129
- appId,
3130
- subject: input.subject,
3131
- htmlBody: input.htmlBody,
3132
- ...input.textBody === void 0 ? {} : { textBody: input.textBody }
3133
- };
3134
- }
3135
- function settingsBody(input) {
3136
- return {
3137
- ...input.senderIdentityId === void 0 ? {} : { senderIdentityId: input.senderIdentityId },
3138
- ...input.displayName === void 0 ? {} : { displayName: input.displayName },
3139
- ...input.replyTo === void 0 ? {} : { replyTo: input.replyTo }
3140
- };
3141
- }
3142
3000
 
3143
3001
  // src/modules/publicFunctions.ts
3144
3002
  function createPublicFunctionsModule(transport, errors = defaultSdkCoreErrorFactory) {
@@ -3431,6 +3289,7 @@ function createSdkCore(options) {
3431
3289
  agentCredentials: createAgentCredentialsModule(copilot, errors),
3432
3290
  agents,
3433
3291
  agentTasks: createAgentTasksModule(copilot, errors),
3292
+ aiProviders: createAiProvidersModule(copilot, errors),
3434
3293
  apps,
3435
3294
  auth: createAuthModule(options.transports.auth, errors),
3436
3295
  context: createContextModule(
@@ -3456,7 +3315,7 @@ function createSdkCore(options) {
3456
3315
  integrationResources: createIntegrationResourcesModule(options.transports.integration, errors),
3457
3316
  integrationTemplates: createIntegrationTemplatesModule(options.transports.integration, errors),
3458
3317
  members,
3459
- messenger: createMessengerModule(messengerTransport, errors, options.getAppId),
3318
+ messenger: createMessengerModule(messengerTransport, errors),
3460
3319
  publicFunctions: createPublicFunctionsModule(options.transports.publicFunctions, errors),
3461
3320
  queries: createQueriesModule(options.transports.dataManager, errors),
3462
3321
  sql: createSqlModule(options.transports.dataManager, errors),
@@ -4428,12 +4287,22 @@ function isChatRow(message) {
4428
4287
  var REQUEST_ROW_KINDS = {
4429
4288
  APPROVAL: "approval",
4430
4289
  USER_INPUT_REQUEST: "userInputRequest",
4431
- NOTIFICATION: "notification"
4290
+ NOTIFICATION: "notification",
4291
+ PLAN: "plan"
4432
4292
  };
4433
4293
  function notificationFieldsOf(payload) {
4434
4294
  const { source, outcome, summary, detail } = payload;
4435
4295
  return { source, outcome, summary, ...detail !== void 0 ? { detail } : {} };
4436
4296
  }
4297
+ function planFieldsOf(payload) {
4298
+ const { planId, steps, explanation, status } = payload;
4299
+ return {
4300
+ planId: planId ?? null,
4301
+ steps: Array.isArray(steps) ? steps : [],
4302
+ ...explanation !== void 0 ? { explanation } : {},
4303
+ status: status ?? null
4304
+ };
4305
+ }
4437
4306
  function parseJson(text) {
4438
4307
  try {
4439
4308
  return JSON.parse(text);
@@ -4463,7 +4332,10 @@ function toAgentTimelineItem(message) {
4463
4332
  ...timelineIdentityOf(message),
4464
4333
  ...parentToolIdOf(message.parentToolId)
4465
4334
  };
4466
- return requestKind === "notification" ? { ...item, kind: requestKind, ...notificationFieldsOf(payload) } : { ...item, kind: requestKind };
4335
+ if (requestKind === "notification") {
4336
+ return { ...item, kind: requestKind, ...notificationFieldsOf(payload) };
4337
+ }
4338
+ return requestKind === "plan" ? { ...item, kind: requestKind, ...planFieldsOf(payload) } : { ...item, kind: requestKind };
4467
4339
  }
4468
4340
  }
4469
4341
  if (message.type === "TOOL_USE") {
@@ -4712,7 +4584,8 @@ var CoreAgentTaskSession = class {
4712
4584
  const page = await this.dependencies.tasks.listMessages(this._taskId, {
4713
4585
  ...options.limit !== void 0 ? { size: options.limit } : {},
4714
4586
  sort: "createdAt,desc",
4715
- kinds: "all"
4587
+ kinds: "all",
4588
+ include: "plan"
4716
4589
  });
4717
4590
  this.historyLimit = options.limit;
4718
4591
  this.replaceHistory(page);
@@ -4742,7 +4615,8 @@ var CoreAgentTaskSession = class {
4742
4615
  before: oldest.id,
4743
4616
  ...this.historyLimit !== void 0 ? { size: this.historyLimit } : {},
4744
4617
  sort: "createdAt,desc",
4745
- kinds: "all"
4618
+ kinds: "all",
4619
+ include: "plan"
4746
4620
  });
4747
4621
  } catch (error) {
4748
4622
  if (generation !== this.historyGeneration || this.isClosed()) return [];
@@ -5175,7 +5049,8 @@ var CoreAgentTaskSession = class {
5175
5049
  const page = await this.dependencies.tasks.listMessages(this._taskId, {
5176
5050
  size: 100,
5177
5051
  sort: "createdAt,desc",
5178
- kinds: "all"
5052
+ kinds: "all",
5053
+ include: "plan"
5179
5054
  });
5180
5055
  this.turnBaselineIds = new Set(page.content.map((message) => message.id));
5181
5056
  }
@@ -5184,7 +5059,8 @@ var CoreAgentTaskSession = class {
5184
5059
  const page = await this.dependencies.tasks.listMessages(this._taskId, {
5185
5060
  size: 100,
5186
5061
  sort: "createdAt,desc",
5187
- kinds: "all"
5062
+ kinds: "all",
5063
+ include: "plan"
5188
5064
  });
5189
5065
  this.replaceHistory(page);
5190
5066
  this.emit("historyLoaded", { history: this.history });
@@ -5435,6 +5311,15 @@ var CoreAgentTaskSession = class {
5435
5311
  });
5436
5312
  }
5437
5313
  break;
5314
+ case "plan":
5315
+ if (payload && this.livePlan(event, payload)) {
5316
+ this.emit("plan", {
5317
+ ...payload,
5318
+ ...planFieldsOf(payload),
5319
+ ...pieceIdentityOf(event, payload)
5320
+ });
5321
+ }
5322
+ break;
5438
5323
  default:
5439
5324
  break;
5440
5325
  }
@@ -5712,6 +5597,44 @@ var CoreAgentTaskSession = class {
5712
5597
  (item) => item
5713
5598
  );
5714
5599
  }
5600
+ // T3 sends the list whole on each update: the item takes the last one where it first came, as
5601
+ // the Copilot's row does. An update the item already holds (a replay after the history) leaves
5602
+ // it as it is and answers false.
5603
+ livePlan(event, payload) {
5604
+ const itemId = typeof payload.itemId === "string" ? payload.itemId : void 0;
5605
+ const sequence = typeof event.sequence === "number" ? event.sequence : void 0;
5606
+ if (itemId === void 0 && sequence === void 0) return true;
5607
+ let applied = true;
5608
+ this.livePiece(
5609
+ (item) => item.kind === "plan" && (itemId !== void 0 ? item.itemId === itemId : item.sequence === sequence),
5610
+ () => ({
5611
+ id: `live:plan:${itemId ?? sequence}`,
5612
+ kind: "plan",
5613
+ payload,
5614
+ ...planFieldsOf(payload),
5615
+ at: liveAtOf(event),
5616
+ ...sequence === void 0 ? {} : { sequence },
5617
+ ...itemId === void 0 ? {} : { itemId }
5618
+ }),
5619
+ (item) => {
5620
+ const held = item.lastSequence ?? item.sequence;
5621
+ if (sequence !== void 0 && held !== void 0 && sequence <= held) {
5622
+ applied = false;
5623
+ return item;
5624
+ }
5625
+ const fields = planFieldsOf(payload);
5626
+ const next = {
5627
+ ...item,
5628
+ payload,
5629
+ ...fields,
5630
+ ...sequence === void 0 ? {} : { lastSequence: sequence }
5631
+ };
5632
+ if (fields.explanation === void 0) delete next.explanation;
5633
+ return next;
5634
+ }
5635
+ );
5636
+ return applied;
5637
+ }
5715
5638
  // A child thread's frames are the subagent's conversation: they open no turn and settle no
5716
5639
  // message. Its text and tools still reach `delta`, `content` and `tool` as they did in 0.2.13,
5717
5640
  // which knew no subagents, so an app that only bumps the version sees what it saw before.
@@ -5995,6 +5918,7 @@ export {
5995
5918
  createAgentTaskSessionManager,
5996
5919
  createAgentTasksModule,
5997
5920
  createAgentsModule,
5921
+ createAiProvidersModule,
5998
5922
  createAppsModule,
5999
5923
  createAuthModule,
6000
5924
  createContextModule,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mitralab.io/sdk-core",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Environment-neutral contracts and modules shared by Mitra JavaScript SDKs",
5
5
  "type": "module",
6
6
  "sideEffects": false,