skybridge 0.0.0-dev.6b57ab9 → 0.0.0-dev.6b6417d

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 (67) hide show
  1. package/README.md +58 -10
  2. package/dist/src/server/index.d.ts +1 -1
  3. package/dist/src/server/inferUtilityTypes.d.ts +13 -5
  4. package/dist/src/server/server.d.ts +36 -25
  5. package/dist/src/server/server.js.map +1 -1
  6. package/dist/src/test/utils.d.ts +21 -1
  7. package/dist/src/test/utils.js +28 -0
  8. package/dist/src/test/utils.js.map +1 -1
  9. package/dist/src/web/data-llm.d.ts +13 -0
  10. package/dist/src/web/data-llm.js +67 -0
  11. package/dist/src/web/data-llm.js.map +1 -0
  12. package/dist/src/web/data-llm.test.js +76 -0
  13. package/dist/src/web/data-llm.test.js.map +1 -0
  14. package/dist/src/web/{typed-hooks.d.ts → generate-helpers.d.ts} +22 -16
  15. package/dist/src/web/{typed-hooks.js → generate-helpers.js} +10 -12
  16. package/dist/src/web/generate-helpers.js.map +1 -0
  17. package/dist/src/web/generate-helpers.test-d.js +153 -0
  18. package/dist/src/web/generate-helpers.test-d.js.map +1 -0
  19. package/dist/src/web/generate-helpers.test.d.ts +1 -0
  20. package/dist/src/web/{typed-hooks.test.js → generate-helpers.test.js} +5 -5
  21. package/dist/src/web/generate-helpers.test.js.map +1 -0
  22. package/dist/src/web/hooks/index.d.ts +1 -3
  23. package/dist/src/web/hooks/index.js +1 -3
  24. package/dist/src/web/hooks/index.js.map +1 -1
  25. package/dist/src/web/hooks/use-call-tool.d.ts +57 -19
  26. package/dist/src/web/hooks/use-call-tool.js +7 -15
  27. package/dist/src/web/hooks/use-call-tool.js.map +1 -1
  28. package/dist/src/web/hooks/use-call-tool.test-d.d.ts +1 -0
  29. package/dist/src/web/hooks/use-call-tool.test-d.js +104 -0
  30. package/dist/src/web/hooks/use-call-tool.test-d.js.map +1 -0
  31. package/dist/src/web/hooks/use-call-tool.test.js +17 -9
  32. package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
  33. package/dist/src/web/hooks/use-tool-info.d.ts +1 -1
  34. package/dist/src/web/hooks/use-widget-state.js +30 -6
  35. package/dist/src/web/hooks/use-widget-state.js.map +1 -1
  36. package/dist/src/web/index.d.ts +3 -2
  37. package/dist/src/web/index.js +3 -2
  38. package/dist/src/web/index.js.map +1 -1
  39. package/dist/src/web/plugin/data-llm.test.d.ts +1 -0
  40. package/dist/src/web/plugin/data-llm.test.js +81 -0
  41. package/dist/src/web/plugin/data-llm.test.js.map +1 -0
  42. package/dist/src/web/{plugin.js → plugin/plugin.js} +5 -0
  43. package/dist/src/web/plugin/plugin.js.map +1 -0
  44. package/dist/src/web/plugin/transform-data-llm.d.ts +12 -0
  45. package/dist/src/web/plugin/transform-data-llm.js +93 -0
  46. package/dist/src/web/plugin/transform-data-llm.js.map +1 -0
  47. package/dist/src/web/plugin/transform-data-llm.test.d.ts +1 -0
  48. package/dist/src/web/plugin/transform-data-llm.test.js +81 -0
  49. package/dist/src/web/plugin/transform-data-llm.test.js.map +1 -0
  50. package/dist/src/web/types.d.ts +14 -0
  51. package/dist/src/web/types.js +1 -0
  52. package/dist/src/web/types.js.map +1 -1
  53. package/package.json +4 -2
  54. package/dist/src/web/hooks/use-tool-output.d.ts +0 -4
  55. package/dist/src/web/hooks/use-tool-output.js +0 -9
  56. package/dist/src/web/hooks/use-tool-output.js.map +0 -1
  57. package/dist/src/web/hooks/use-tool-response-metadata.d.ts +0 -4
  58. package/dist/src/web/hooks/use-tool-response-metadata.js +0 -8
  59. package/dist/src/web/hooks/use-tool-response-metadata.js.map +0 -1
  60. package/dist/src/web/plugin.js.map +0 -1
  61. package/dist/src/web/typed-hooks.js.map +0 -1
  62. package/dist/src/web/typed-hooks.test-d.js +0 -87
  63. package/dist/src/web/typed-hooks.test-d.js.map +0 -1
  64. package/dist/src/web/typed-hooks.test.js.map +0 -1
  65. /package/dist/src/web/{typed-hooks.test-d.d.ts → data-llm.test.d.ts} +0 -0
  66. /package/dist/src/web/{typed-hooks.test.d.ts → generate-helpers.test-d.d.ts} +0 -0
  67. /package/dist/src/web/{plugin.d.ts → plugin/plugin.d.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"typed-hooks.js","sourceRoot":"","sources":["../../../src/web/typed-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAgCvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,UAAU,gBAAgB;IAI9B,OAAO;QACL;;;;;;;;;;;;;;;;;;WAkBG;QACH,WAAW,EAAE,CACX,IAAO,EAIP,EAAE;YACF,wEAAwE;YACxE,0FAA0F;YAC1F,OAAO,WAAW,CAGhB,IAAI,CAGL,CAAC;QACJ,CAAC;QACD;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QACH,WAAW,EAAE,GAIX,EAAE;YACF,wEAAwE;YACxE,0FAA0F;YAC1F,OAAO,WAAW,EAQjB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,87 +0,0 @@
1
- import { expectTypeOf, test } from "vitest";
2
- import { createTypedHooks } from "./typed-hooks.js";
3
- import { createTestServer } from "../test/utils.js";
4
- const server = createTestServer();
5
- test("InferTools extracts the tool registry type (widgets + registerTool)", () => {
6
- expectTypeOf().toHaveProperty("search-voyage");
7
- expectTypeOf().toHaveProperty("get-trip-details");
8
- expectTypeOf().toHaveProperty("no-input-widget");
9
- expectTypeOf().toHaveProperty("calculate-price");
10
- });
11
- test("ToolNames returns a union of tool name literals (widgets + registerTool)", () => {
12
- expectTypeOf().toEqualTypeOf();
13
- });
14
- test("ToolInput extracts the correct input type from Zod schema", () => {
15
- expectTypeOf().toEqualTypeOf();
16
- expectTypeOf().toEqualTypeOf();
17
- expectTypeOf().toEqualTypeOf();
18
- });
19
- test("ToolOutput extracts the correct output type from Zod schema", () => {
20
- expectTypeOf().toEqualTypeOf();
21
- expectTypeOf().toEqualTypeOf();
22
- expectTypeOf().toEqualTypeOf();
23
- });
24
- test("createTypedHooks provides autocomplete for tool names (widgets + registerTool)", () => {
25
- const { useCallTool } = createTypedHooks();
26
- useCallTool("search-voyage");
27
- useCallTool("get-trip-details");
28
- useCallTool("no-input-widget");
29
- useCallTool("calculate-price");
30
- // @ts-expect-error - "invalid-name" is not a valid tool name
31
- useCallTool("invalid-name");
32
- });
33
- test("useCallTool returns correctly typed callTool function", () => {
34
- const { useCallTool } = createTypedHooks();
35
- const { callTool } = useCallTool("search-voyage");
36
- callTool({ destination: "Spain" });
37
- callTool({ destination: "France", departureDate: "2024-06-01" });
38
- callTool({ destination: "Italy", maxPrice: 1000 });
39
- const { callTool: calculateTool } = useCallTool("calculate-price");
40
- calculateTool({ tripId: "123", passengers: 2 });
41
- });
42
- test("useCallTool returns correctly typed data", () => {
43
- const { useCallTool } = createTypedHooks();
44
- const { data } = useCallTool("search-voyage");
45
- if (data) {
46
- expectTypeOf(data.structuredContent).toExtend();
47
- expectTypeOf(data.structuredContent.results).toBeArray();
48
- expectTypeOf(data.structuredContent.totalCount).toBeNumber();
49
- }
50
- });
51
- test("tools with no outputSchema have empty object output type", () => {
52
- expectTypeOf().toEqualTypeOf();
53
- });
54
- test("createTypedHooks provides autocomplete for tool names in useToolInfo (widgets + registerTool)", () => {
55
- const { useToolInfo } = createTypedHooks();
56
- useToolInfo();
57
- useToolInfo();
58
- useToolInfo();
59
- useToolInfo();
60
- // @ts-expect-error - "invalid-name" is not a valid tool name
61
- useToolInfo();
62
- });
63
- test("useToolInfo infers input types from ToolInput utility", () => {
64
- const { useToolInfo } = createTypedHooks();
65
- const toolInfo = useToolInfo();
66
- expectTypeOf(toolInfo.input).toExtend();
67
- const detailsInfo = useToolInfo();
68
- expectTypeOf(detailsInfo.input).toExtend();
69
- const calculateInfo = useToolInfo();
70
- expectTypeOf(calculateInfo.input).toExtend();
71
- });
72
- test("useToolInfo infers output types from ToolOutput utility", () => {
73
- const { useToolInfo } = createTypedHooks();
74
- const toolInfo = useToolInfo();
75
- if (toolInfo.status === "success") {
76
- expectTypeOf(toolInfo.output).toExtend();
77
- }
78
- const detailsInfo = useToolInfo();
79
- if (detailsInfo.status === "success") {
80
- expectTypeOf(detailsInfo.output).toExtend();
81
- }
82
- const calculateInfo = useToolInfo();
83
- if (calculateInfo.status === "success") {
84
- expectTypeOf(calculateInfo.output).toExtend();
85
- }
86
- });
87
- //# sourceMappingURL=typed-hooks.test-d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typed-hooks.test-d.js","sourceRoot":"","sources":["../../../src/web/typed-hooks.test-d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;AAGlC,IAAI,CAAC,qEAAqE,EAAE,GAAG,EAAE;IAG/E,YAAY,EAAS,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IACtD,YAAY,EAAS,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;IACzD,YAAY,EAAS,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IACxD,YAAY,EAAS,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;AAC1D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,0EAA0E,EAAE,GAAG,EAAE;IAGpF,YAAY,EAAS,CAAC,aAAa,EAEhC,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2DAA2D,EAAE,GAAG,EAAE;IAGrE,YAAY,EAAe,CAAC,aAAa,EAIrC,CAAC;IAIL,YAAY,EAAgB,CAAC,aAAa,EAE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