volute 0.5.0 → 0.6.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.
Files changed (58) hide show
  1. package/dist/{agent-Z2B6EFEQ.js → agent-X7GJLBLW.js} +13 -9
  2. package/dist/{agent-manager-PXBKA2GK.js → agent-manager-JDVXU3ON.js} +4 -4
  3. package/dist/channel-SMCNOIVQ.js +262 -0
  4. package/dist/{chunk-5X7HGB6L.js → chunk-AOKAQGO4.js} +1 -1
  5. package/dist/{chunk-MXUCNIBG.js → chunk-BX7KI4S3.js} +68 -3
  6. package/dist/{chunk-MW2KFO3B.js → chunk-G6ZNGLUX.js} +3 -3
  7. package/dist/{chunk-HE67X4T6.js → chunk-H7AMDUIA.js} +1 -1
  8. package/dist/{chunk-7L4AN5D4.js → chunk-JR4UXCTO.js} +1 -1
  9. package/dist/{chunk-UX25Z2ND.js → chunk-UWHWAPGO.js} +7 -0
  10. package/dist/{chunk-UAVD2AHX.js → chunk-W76KWE23.js} +1 -1
  11. package/dist/chunk-ZZOOTYXK.js +583 -0
  12. package/dist/cli.js +18 -21
  13. package/dist/{connector-LYEMXQEV.js → connector-Y7JPNROO.js} +3 -3
  14. package/dist/connectors/discord.js +31 -4
  15. package/dist/connectors/slack.js +22 -3
  16. package/dist/connectors/telegram.js +34 -4
  17. package/dist/{create-RVCZN6HE.js → create-G525LWEA.js} +2 -2
  18. package/dist/{daemon-client-ZY6UUN2M.js → daemon-client-442IV43D.js} +2 -2
  19. package/dist/daemon.js +962 -525
  20. package/dist/{delete-3QH7VYIN.js → delete-2PH2CGDY.js} +3 -3
  21. package/dist/{down-O7IFZLVJ.js → down-FXWAN66A.js} +1 -1
  22. package/dist/{env-4D4REPJF.js → env-7GLUJCWS.js} +2 -2
  23. package/dist/{history-OEONB53Z.js → history-H72ZUIBN.js} +2 -2
  24. package/dist/{import-MXJB2EII.js → import-AVKQJDYC.js} +2 -2
  25. package/dist/{logs-DF342W4M.js → logs-EDGK26AK.js} +1 -1
  26. package/dist/{message-ADHWFHSI.js → message-SCOQDR3P.js} +2 -2
  27. package/dist/{package-VQOE7JNH.js → package-4DP4Y4UO.js} +1 -1
  28. package/dist/restart-O4ETYLJF.js +29 -0
  29. package/dist/{schedule-NAG6F463.js → schedule-S6QVC5ON.js} +2 -2
  30. package/dist/send-G7PE4DOJ.js +72 -0
  31. package/dist/{setup-RPRRGG2F.js → setup-F4TCWVSP.js} +2 -2
  32. package/dist/{start-TUOXDSFL.js → start-VHQ7LNWM.js} +2 -2
  33. package/dist/{status-A36EHRO4.js → status-QAJWXKMZ.js} +2 -2
  34. package/dist/{stop-AOJZLQ5X.js → stop-CAGCT5NI.js} +2 -2
  35. package/dist/{up-7ILD7GU7.js → up-CSX3ZUIU.js} +15 -3
  36. package/dist/{update-LPSIAWQ2.js → update-XSIX3GGP.js} +2 -2
  37. package/dist/{update-check-Y33QDCFL.js → update-check-5ZADDHCK.js} +2 -2
  38. package/dist/{upgrade-FX2TKJ2S.js → upgrade-YXKPWDRU.js} +2 -2
  39. package/dist/{variant-LAB67OC2.js → variant-4Z6W3PP6.js} +2 -2
  40. package/dist/web-assets/assets/index-D5PzIndO.js +308 -0
  41. package/dist/web-assets/index.html +1 -1
  42. package/package.json +1 -1
  43. package/templates/_base/.init/.config/scripts/session-reader.ts +59 -0
  44. package/templates/_base/_skills/sessions/SKILL.md +49 -0
  45. package/templates/_base/_skills/volute-agent/SKILL.md +13 -9
  46. package/templates/_base/src/lib/format-prefix.ts +6 -0
  47. package/templates/_base/src/lib/router.ts +30 -3
  48. package/templates/_base/src/lib/session-monitor.ts +400 -0
  49. package/templates/_base/src/lib/types.ts +2 -0
  50. package/templates/agent-sdk/src/agent.ts +16 -0
  51. package/templates/agent-sdk/src/lib/hooks/session-context.ts +32 -0
  52. package/templates/pi/src/agent.ts +7 -1
  53. package/templates/pi/src/lib/session-context-extension.ts +33 -0
  54. package/dist/channel-MK5OK2SI.js +0 -113
  55. package/dist/chunk-SMISE4SV.js +0 -226
  56. package/dist/conversation-ERXEQZTY.js +0 -163
  57. package/dist/send-66QMKRUH.js +0 -75
  58. package/dist/web-assets/assets/index-BbRmoxoA.js +0 -308
@@ -1,11 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ buildChannelSlug,
3
4
  fireAndForget,
4
5
  handleAgentMessage,
5
6
  loadEnv,
6
7
  loadFollowedChannels,
7
- splitMessage
8
- } from "../chunk-MXUCNIBG.js";
8
+ reportTyping,
9
+ slugify,
10
+ splitMessage,
11
+ writeChannelEntry
12
+ } from "../chunk-BX7KI4S3.js";
9
13
  import "../chunk-K3NQKI34.js";
10
14
 
11
15
  // src/connectors/discord.ts
@@ -32,7 +36,9 @@ var client = new Client({
32
36
  GatewayIntentBits.Guilds,
33
37
  GatewayIntentBits.GuildMessages,
34
38
  GatewayIntentBits.MessageContent,
35
- GatewayIntentBits.DirectMessages
39
+ GatewayIntentBits.DirectMessages,
40
+ GatewayIntentBits.GuildMessageTyping,
41
+ GatewayIntentBits.DirectMessageTyping
36
42
  ],
37
43
  partials: [Partials.Channel]
38
44
  });
@@ -88,8 +94,23 @@ client.on(Events.MessageCreate, async (message) => {
88
94
  }
89
95
  if (content.length === 0) return;
90
96
  const senderName = message.author.displayName || message.author.username;
91
- const channelKey = `discord:${message.channelId}`;
92
97
  const channelName = !isDM && "name" in message.channel ? message.channel.name : void 0;
98
+ const channelKey = isDM ? buildChannelSlug("discord", {
99
+ isDM: true,
100
+ recipients: [message.author.username]
101
+ }) : buildChannelSlug("discord", {
102
+ channelName: channelName ?? message.channelId,
103
+ serverName: message.guild?.name
104
+ });
105
+ if (env.agentDir) {
106
+ writeChannelEntry(env.agentDir, channelKey, {
107
+ platformId: message.channelId,
108
+ platform: "discord",
109
+ name: channelName ? `#${channelName}` : void 0,
110
+ server: message.guild?.name,
111
+ type: isDM ? "dm" : "channel"
112
+ });
113
+ }
93
114
  const participantCount = isDM ? 2 : message.guild?.memberCount;
94
115
  const payload = {
95
116
  content,
@@ -107,6 +128,12 @@ client.on(Events.MessageCreate, async (message) => {
107
128
  }
108
129
  await handleDiscordMessage(message, payload);
109
130
  });
131
+ client.on(Events.TypingStart, (typing) => {
132
+ if (typing.user.bot) return;
133
+ const sender = typing.member?.displayName ?? typing.user.username ?? typing.user.id ?? "unknown";
134
+ const typingChannel = typing.guild ? `discord:${slugify(typing.guild.name)}/${slugify("name" in typing.channel ? String(typing.channel.name) : typing.channel.id)}` : `discord:@${slugify(typing.user.username ?? typing.user.id)}`;
135
+ reportTyping(env, typingChannel, sender, true);
136
+ });
110
137
  async function handleDiscordMessage(message, payload) {
111
138
  const channel = message.channel;
112
139
  if (!("sendTyping" in channel)) return;
@@ -1,12 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ buildChannelSlug,
3
4
  fireAndForget,
4
5
  handleAgentMessage,
5
6
  loadEnv,
6
7
  loadFollowedChannels,
7
8
  onShutdown,
8
- splitMessage
9
- } from "../chunk-MXUCNIBG.js";
9
+ splitMessage,
10
+ writeChannelEntry
11
+ } from "../chunk-BX7KI4S3.js";
10
12
  import "../chunk-K3NQKI34.js";
11
13
 
12
14
  // src/connectors/slack.ts
@@ -79,15 +81,32 @@ app.message(async ({ message, say }) => {
79
81
  }
80
82
  }
81
83
  let senderName = message.user;
84
+ let senderUsername = message.user;
82
85
  try {
83
86
  const userInfo = await app.client.users.info({
84
87
  user: message.user
85
88
  });
86
89
  senderName = userInfo.user?.profile?.display_name || userInfo.user?.profile?.real_name || message.user;
90
+ senderUsername = userInfo.user?.name ?? message.user;
87
91
  } catch (err) {
88
92
  console.warn(`Failed to get user info: ${err}`);
89
93
  }
90
- const channelKey = `slack:${message.channel}`;
94
+ const channelKey = isDM ? buildChannelSlug("slack", {
95
+ isDM: true,
96
+ senderName: senderUsername
97
+ }) : buildChannelSlug("slack", {
98
+ channelName: channelName ?? message.channel,
99
+ serverName
100
+ });
101
+ if (env.agentDir) {
102
+ writeChannelEntry(env.agentDir, channelKey, {
103
+ platformId: message.channel,
104
+ platform: "slack",
105
+ name: channelName ? `#${channelName}` : void 0,
106
+ server: serverName,
107
+ type: isDM ? "dm" : "channel"
108
+ });
109
+ }
91
110
  const participantCount = message.channel_type === "im" ? 2 : numMembers;
92
111
  const payload = {
93
112
  content,
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ buildChannelSlug,
3
4
  fireAndForget,
4
5
  handleAgentMessage,
5
6
  loadEnv,
6
7
  loadFollowedChannels,
7
- splitMessage
8
- } from "../chunk-MXUCNIBG.js";
8
+ splitMessage,
9
+ writeChannelEntry
10
+ } from "../chunk-BX7KI4S3.js";
9
11
  import "../chunk-K3NQKI34.js";
10
12
 
11
13
  // src/connectors/telegram.ts
@@ -48,9 +50,23 @@ bot.on(message("text"), async (ctx) => {
48
50
  console.warn(`Failed to get member count for chat ${ctx.chat.id}: ${err}`);
49
51
  }
50
52
  }
53
+ const channelSlug = isDM ? buildChannelSlug("telegram", {
54
+ isDM: true,
55
+ senderName: ctx.message.from.username ?? ctx.message.from.first_name
56
+ }) : buildChannelSlug("telegram", {
57
+ channelName: chatTitle ?? String(ctx.chat.id)
58
+ });
59
+ if (env.agentDir) {
60
+ writeChannelEntry(env.agentDir, channelSlug, {
61
+ platformId: String(ctx.chat.id),
62
+ platform: "telegram",
63
+ name: chatTitle,
64
+ type: isDM ? "dm" : "channel"
65
+ });
66
+ }
51
67
  const payload = {
52
68
  content,
53
- channel: `telegram:${ctx.chat.id}`,
69
+ channel: channelSlug,
54
70
  sender: senderName,
55
71
  platform: "Telegram",
56
72
  ...isDM ? { isDM: true } : {},
@@ -105,9 +121,23 @@ bot.on(message("photo"), async (ctx) => {
105
121
  console.warn(`Failed to get member count for chat ${ctx.chat.id}: ${err}`);
106
122
  }
107
123
  }
124
+ const channelSlug = isDM ? buildChannelSlug("telegram", {
125
+ isDM: true,
126
+ senderName: ctx.message.from.username ?? ctx.message.from.first_name
127
+ }) : buildChannelSlug("telegram", {
128
+ channelName: chatTitle ?? String(ctx.chat.id)
129
+ });
130
+ if (env.agentDir) {
131
+ writeChannelEntry(env.agentDir, channelSlug, {
132
+ platformId: String(ctx.chat.id),
133
+ platform: "telegram",
134
+ name: chatTitle,
135
+ type: isDM ? "dm" : "channel"
136
+ });
137
+ }
108
138
  const payload = {
109
139
  content,
110
- channel: `telegram:${ctx.chat.id}`,
140
+ channel: channelSlug,
111
141
  sender: senderName,
112
142
  platform: "Telegram",
113
143
  ...isDM ? { isDM: true } : {},
@@ -13,7 +13,7 @@ import {
13
13
  chownAgentDir,
14
14
  createAgentUser,
15
15
  ensureVoluteGroup
16
- } from "./chunk-UAVD2AHX.js";
16
+ } from "./chunk-W76KWE23.js";
17
17
  import {
18
18
  exec,
19
19
  execInherit
@@ -23,7 +23,7 @@ import {
23
23
  agentDir,
24
24
  ensureVoluteHome,
25
25
  nextPort
26
- } from "./chunk-UX25Z2ND.js";
26
+ } from "./chunk-UWHWAPGO.js";
27
27
  import "./chunk-K3NQKI34.js";
28
28
 
29
29
  // src/commands/create.ts
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  daemonFetch
4
- } from "./chunk-7L4AN5D4.js";
5
- import "./chunk-UX25Z2ND.js";
4
+ } from "./chunk-JR4UXCTO.js";
5
+ import "./chunk-UWHWAPGO.js";
6
6
  import "./chunk-K3NQKI34.js";
7
7
  export {
8
8
  daemonFetch