@letta-ai/letta-code 0.30.8 → 0.30.9

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.
@@ -813,6 +813,9 @@ function uniqueSources(sources) {
813
813
  byKey.set(sourceKey(source), source);
814
814
  return [...byKey.values()];
815
815
  }
816
+ function channelTagsForSources(sources) {
817
+ return [...new Set(sources.map((source) => `channel:${source.channel}`))];
818
+ }
816
819
  function stopReasonFromDelta(message) {
817
820
  const delta = message.delta;
818
821
  return delta.message_type === "stop_reason" && "stop_reason" in delta && typeof delta.stop_reason === "string" ? delta.stop_reason : null;
@@ -1054,9 +1057,11 @@ class ChannelGateway {
1054
1057
  }
1055
1058
  async performRuntimeRegistration(state, delivery) {
1056
1059
  const tool = await this.hooks.buildExternalTool(delivery.runtime, delivery.sources);
1060
+ const conversationTags = channelTagsForSources(delivery.sources);
1057
1061
  const signature = JSON.stringify({
1058
1062
  mode: delivery.defaultPermissionMode ?? null,
1059
- tool
1063
+ tool,
1064
+ conversationTags
1060
1065
  });
1061
1066
  if (state.registrationSignature === signature && state.registration) {
1062
1067
  return state.registration;
@@ -1064,6 +1069,7 @@ class ChannelGateway {
1064
1069
  const registration = this.client.runtimeStart({
1065
1070
  agent_id: delivery.runtime.agent_id,
1066
1071
  conversation_id: delivery.runtime.conversation_id,
1072
+ ...conversationTags.length > 0 ? { conversation_source_tags: conversationTags } : {},
1067
1073
  ...delivery.defaultPermissionMode ? { mode: delivery.defaultPermissionMode } : {},
1068
1074
  recover_approvals: true,
1069
1075
  force_device_status: false,
@@ -2205,4 +2211,4 @@ export {
2205
2211
  ChannelGateway
2206
2212
  };
2207
2213
 
2208
- //# debugId=1A3C1825CA83009964756E2164756E21
2214
+ //# debugId=CF539D37E789E01964756E2164756E21