spectrum-ts 2.0.0 → 3.1.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 (32) hide show
  1. package/dist/{attachment-B4nSrKVd.d.ts → attachment-CEpGtZLm.d.ts} +1 -1
  2. package/dist/{authoring-BjE5BvlO.d.ts → authoring-CP3vRza8.d.ts} +61 -26
  3. package/dist/authoring.d.ts +3 -3
  4. package/dist/authoring.js +5 -5
  5. package/dist/{chunk-NNY6LMSC.js → chunk-77U6SH5A.js} +1 -1
  6. package/dist/{chunk-WXY5QP3M.js → chunk-7ON5XHC2.js} +27 -21
  7. package/dist/{chunk-6BI4PFTP.js → chunk-CHY5YLLV.js} +1 -1
  8. package/dist/{chunk-Q537JPTG.js → chunk-FA7VA4XN.js} +10 -10
  9. package/dist/{chunk-NGC4DJIX.js → chunk-L3NUESOW.js} +425 -137
  10. package/dist/{chunk-2ILTJC35.js → chunk-LQMDV75O.js} +205 -11
  11. package/dist/{chunk-3B4QH4JG.js → chunk-MHGCPC2V.js} +1 -1
  12. package/dist/{chunk-U7AWXDH6.js → chunk-NZ5WCMTY.js} +1 -1
  13. package/dist/{chunk-5LT5J3NR.js → chunk-PSSWQBOH.js} +262 -30
  14. package/dist/{chunk-U3LXXT3W.js → chunk-Q44CIGG6.js} +20 -8
  15. package/dist/{chunk-ATNAE7OR.js → chunk-WMG36LHW.js} +676 -159
  16. package/dist/index.d.ts +107 -56
  17. package/dist/index.js +29 -182
  18. package/dist/providers/imessage/index.d.ts +7 -14
  19. package/dist/providers/imessage/index.js +6 -6
  20. package/dist/providers/index.d.ts +3 -3
  21. package/dist/providers/index.js +11 -11
  22. package/dist/providers/slack/index.d.ts +1 -2
  23. package/dist/providers/slack/index.js +3 -3
  24. package/dist/providers/telegram/index.d.ts +3 -5
  25. package/dist/providers/telegram/index.js +5 -5
  26. package/dist/providers/terminal/index.d.ts +2 -4
  27. package/dist/providers/terminal/index.js +5 -5
  28. package/dist/providers/whatsapp-business/index.d.ts +1 -1
  29. package/dist/providers/whatsapp-business/index.js +4 -4
  30. package/dist/{types-Bje8aq1k.d.ts → types-Be0T6E0e.d.ts} +172 -23
  31. package/dist/{types-BD0-kKyv.d.ts → types-CDYXH2R7.d.ts} +1 -1
  32. package/package.json +2 -1
@@ -1,10 +1,10 @@
1
1
  import { createRequire as __spectrumCreateRequire } from "node:module"; const require = __spectrumCreateRequire(import.meta.url);
2
2
  import {
3
3
  asVoice
4
- } from "./chunk-NNY6LMSC.js";
4
+ } from "./chunk-77U6SH5A.js";
5
5
  import {
6
6
  asContact
7
- } from "./chunk-U7AWXDH6.js";
7
+ } from "./chunk-NZ5WCMTY.js";
8
8
  import {
9
9
  stream
10
10
  } from "./chunk-5XEFJBN2.js";
@@ -15,12 +15,12 @@ import {
15
15
  import {
16
16
  UnsupportedError,
17
17
  definePlatform
18
- } from "./chunk-NGC4DJIX.js";
18
+ } from "./chunk-L3NUESOW.js";
19
19
  import {
20
20
  asAttachment,
21
21
  asCustom,
22
22
  reactionSchema
23
- } from "./chunk-2ILTJC35.js";
23
+ } from "./chunk-LQMDV75O.js";
24
24
 
25
25
  // src/providers/terminal/index.ts
26
26
  import { spawn } from "child_process";
@@ -781,12 +781,18 @@ var terminal = definePlatform("Terminal", {
781
781
  })
782
782
  },
783
783
  space: {
784
- params: z.object({ id: z.string().optional() }),
785
- resolve: async ({ client, input }) => {
786
- const id = input.params?.id ?? generateChatId(client);
784
+ create: async ({ client }) => {
785
+ const id = generateChatId(client);
787
786
  client.knownChats.add(id);
788
787
  await client.session.request("ensureSpace", { id });
789
788
  return { id };
789
+ },
790
+ // Explicit (not the framework default) so targeting a known id still
791
+ // materializes the chat in the TUI via `ensureSpace`.
792
+ get: async ({ client, input }) => {
793
+ client.knownChats.add(input.id);
794
+ await client.session.request("ensureSpace", { id: input.id });
795
+ return { id: input.id };
790
796
  }
791
797
  },
792
798
  // Return a ManagedStream (not a native async generator): a native generator
@@ -857,7 +863,13 @@ var terminal = definePlatform("Terminal", {
857
863
  messageId: content.target.id,
858
864
  reaction: content.emoji
859
865
  });
860
- return;
866
+ const timestamp = /* @__PURE__ */ new Date();
867
+ return {
868
+ id: `reaction:${content.target.id}:${content.emoji}:${timestamp.toISOString()}`,
869
+ content,
870
+ space: { id: space.id },
871
+ timestamp
872
+ };
861
873
  }
862
874
  if (content.type === "typing") {
863
875
  const method = content.state === "start" ? "startTyping" : "stopTyping";