skybridge 0.0.0-dev.d8b52a9 → 0.0.0-dev.dc4ed16
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/README.md +102 -10
- package/dist/src/server/index.d.ts +2 -2
- package/dist/src/server/inferUtilityTypes.d.ts +28 -18
- package/dist/src/server/server.d.ts +38 -9
- package/dist/src/server/server.js +4 -0
- package/dist/src/server/server.js.map +1 -1
- package/dist/src/test/utils.d.ts +61 -0
- package/dist/src/test/utils.js +121 -0
- package/dist/src/test/utils.js.map +1 -1
- package/dist/src/web/create-store.d.ts +3 -0
- package/dist/src/web/create-store.js +25 -0
- package/dist/src/web/create-store.js.map +1 -0
- package/dist/src/web/data-llm.d.ts +14 -0
- package/dist/src/web/data-llm.js +68 -0
- package/dist/src/web/data-llm.js.map +1 -0
- package/dist/src/web/data-llm.test.js +76 -0
- package/dist/src/web/data-llm.test.js.map +1 -0
- package/dist/src/web/{typed-hooks.d.ts → generate-helpers.d.ts} +22 -16
- package/dist/src/web/{typed-hooks.js → generate-helpers.js} +10 -12
- package/dist/src/web/generate-helpers.js.map +1 -0
- package/dist/src/web/generate-helpers.test-d.js +153 -0
- package/dist/src/web/generate-helpers.test-d.js.map +1 -0
- package/dist/src/web/generate-helpers.test.d.ts +1 -0
- package/dist/src/web/generate-helpers.test.js +17 -0
- package/dist/src/web/generate-helpers.test.js.map +1 -0
- package/dist/src/web/helpers/state.d.ts +7 -0
- package/dist/src/web/helpers/state.js +40 -0
- package/dist/src/web/helpers/state.js.map +1 -0
- package/dist/src/web/helpers/state.test.d.ts +1 -0
- package/dist/src/web/helpers/state.test.js +46 -0
- package/dist/src/web/helpers/state.test.js.map +1 -0
- package/dist/src/web/hooks/index.d.ts +1 -3
- package/dist/src/web/hooks/index.js +1 -3
- package/dist/src/web/hooks/index.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.d.ts +57 -19
- package/dist/src/web/hooks/use-call-tool.js +7 -15
- package/dist/src/web/hooks/use-call-tool.js.map +1 -1
- package/dist/src/web/hooks/use-call-tool.test-d.d.ts +1 -0
- package/dist/src/web/hooks/use-call-tool.test-d.js +104 -0
- package/dist/src/web/hooks/use-call-tool.test-d.js.map +1 -0
- package/dist/src/web/hooks/use-call-tool.test.js +17 -9
- package/dist/src/web/hooks/use-call-tool.test.js.map +1 -1
- package/dist/src/web/hooks/use-tool-info.d.ts +1 -1
- package/dist/src/web/hooks/use-widget-state.js +8 -6
- package/dist/src/web/hooks/use-widget-state.js.map +1 -1
- package/dist/src/web/index.d.ts +4 -2
- package/dist/src/web/index.js +4 -2
- package/dist/src/web/index.js.map +1 -1
- package/dist/src/web/plugin/data-llm.test.d.ts +1 -0
- package/dist/src/web/plugin/data-llm.test.js +81 -0
- package/dist/src/web/plugin/data-llm.test.js.map +1 -0
- package/dist/src/web/{plugin.js → plugin/plugin.js} +5 -0
- package/dist/src/web/plugin/plugin.js.map +1 -0
- package/dist/src/web/plugin/transform-data-llm.d.ts +12 -0
- package/dist/src/web/plugin/transform-data-llm.js +93 -0
- package/dist/src/web/plugin/transform-data-llm.js.map +1 -0
- package/dist/src/web/plugin/transform-data-llm.test.d.ts +1 -0
- package/dist/src/web/plugin/transform-data-llm.test.js +81 -0
- package/dist/src/web/plugin/transform-data-llm.test.js.map +1 -0
- package/dist/src/web/types.d.ts +14 -0
- package/dist/src/web/types.js +1 -0
- package/dist/src/web/types.js.map +1 -1
- package/package.json +7 -3
- package/dist/src/web/hooks/use-tool-output.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-output.js +0 -9
- package/dist/src/web/hooks/use-tool-output.js.map +0 -1
- package/dist/src/web/hooks/use-tool-response-metadata.d.ts +0 -4
- package/dist/src/web/hooks/use-tool-response-metadata.js +0 -8
- package/dist/src/web/hooks/use-tool-response-metadata.js.map +0 -1
- package/dist/src/web/plugin.js.map +0 -1
- package/dist/src/web/typed-hooks.js.map +0 -1
- package/dist/src/web/typed-hooks.test-d.js +0 -72
- package/dist/src/web/typed-hooks.test-d.js.map +0 -1
- package/dist/src/web/typed-hooks.test.js +0 -10
- package/dist/src/web/typed-hooks.test.js.map +0 -1
- /package/dist/src/web/{typed-hooks.test-d.d.ts → data-llm.test.d.ts} +0 -0
- /package/dist/src/web/{typed-hooks.test.d.ts → generate-helpers.test-d.d.ts} +0 -0
- /package/dist/src/web/{plugin.d.ts → plugin/plugin.d.ts} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const LLM_IMPORT_SOURCE = "skybridge/web";
|
|
2
|
+
function createBabelPlugin(t) {
|
|
3
|
+
return {
|
|
4
|
+
name: "data-llm-babel",
|
|
5
|
+
visitor: {
|
|
6
|
+
Program: {
|
|
7
|
+
enter(path, state) {
|
|
8
|
+
state.hasDataLLMImport = false;
|
|
9
|
+
state.needsDataLLMImport = false;
|
|
10
|
+
for (const node of path.node.body) {
|
|
11
|
+
if (!t.isImportDeclaration(node))
|
|
12
|
+
continue;
|
|
13
|
+
if (node.source.value !== LLM_IMPORT_SOURCE)
|
|
14
|
+
continue;
|
|
15
|
+
const hasSpecifier = node.specifiers.some((s) => t.isImportSpecifier(s) &&
|
|
16
|
+
t.isIdentifier(s.imported, { name: "DataLLM" }));
|
|
17
|
+
if (hasSpecifier) {
|
|
18
|
+
state.hasDataLLMImport = true;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
exit(path, state) {
|
|
24
|
+
if (state.needsDataLLMImport && !state.hasDataLLMImport) {
|
|
25
|
+
const importDecl = t.importDeclaration([
|
|
26
|
+
t.importSpecifier(t.identifier("DataLLM"), t.identifier("DataLLM")),
|
|
27
|
+
], t.stringLiteral(LLM_IMPORT_SOURCE));
|
|
28
|
+
path.node.body.unshift(importDecl);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
JSXElement(path, state) {
|
|
33
|
+
const opening = path.node.openingElement;
|
|
34
|
+
const attributes = opening.attributes;
|
|
35
|
+
const llmAttributeIndex = attributes.findIndex((attribute) => t.isJSXAttribute(attribute) &&
|
|
36
|
+
t.isJSXIdentifier(attribute.name, { name: "data-llm" }));
|
|
37
|
+
if (llmAttributeIndex === -1)
|
|
38
|
+
return;
|
|
39
|
+
const llmAttribute = attributes[llmAttributeIndex];
|
|
40
|
+
let contentExpression;
|
|
41
|
+
if (t.isStringLiteral(llmAttribute.value)) {
|
|
42
|
+
contentExpression = llmAttribute.value;
|
|
43
|
+
}
|
|
44
|
+
else if (t.isJSXExpressionContainer(llmAttribute.value)) {
|
|
45
|
+
contentExpression = llmAttribute.value.expression;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const contentAttr = t.jsxAttribute(t.jsxIdentifier("content"), t.isStringLiteral(contentExpression)
|
|
51
|
+
? contentExpression
|
|
52
|
+
: t.jsxExpressionContainer(contentExpression));
|
|
53
|
+
const filteredAttributes = attributes.filter((_, index) => index !== llmAttributeIndex);
|
|
54
|
+
const newOpening = t.jsxOpeningElement(opening.name, filteredAttributes, opening.selfClosing);
|
|
55
|
+
const elementWithoutLlm = t.jsxElement(newOpening, path.node.closingElement, path.node.children, path.node.selfClosing);
|
|
56
|
+
const llmOpening = t.jsxOpeningElement(t.jsxIdentifier("DataLLM"), [
|
|
57
|
+
contentAttr,
|
|
58
|
+
]);
|
|
59
|
+
const llmClosing = t.jsxClosingElement(t.jsxIdentifier("DataLLM"));
|
|
60
|
+
const wrapped = t.jsxElement(llmOpening, llmClosing, [elementWithoutLlm], false);
|
|
61
|
+
state.needsDataLLMImport = true;
|
|
62
|
+
path.replaceWith(wrapped);
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export const transform = async (code, id) => {
|
|
68
|
+
if (!/\.(jsx|tsx)$/.test(id)) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
if (id.includes("node_modules")) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
// Dynamic import to ensure @babel/core is only loaded in Node.js context
|
|
75
|
+
const { types: t, transformSync } = await import("@babel/core");
|
|
76
|
+
const babelOptions = {
|
|
77
|
+
plugins: [createBabelPlugin(t)],
|
|
78
|
+
parserOpts: {
|
|
79
|
+
plugins: ["jsx", "typescript"],
|
|
80
|
+
},
|
|
81
|
+
filename: id,
|
|
82
|
+
sourceFileName: id,
|
|
83
|
+
};
|
|
84
|
+
const result = transformSync(code, babelOptions);
|
|
85
|
+
if (!result || !result.code) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
code: result.code,
|
|
90
|
+
map: result.map || null,
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=transform-data-llm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-data-llm.js","sourceRoot":"","sources":["../../../../src/web/plugin/transform-data-llm.ts"],"names":[],"mappings":"AAEA,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAO1C,SAAS,iBAAiB,CAAC,CAAe;IACxC,OAAO;QACL,IAAI,EAAE,gBAAgB;QAEtB,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,KAAK,CAAC,IAAI,EAAE,KAAK;oBACf,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC;oBAC/B,KAAK,CAAC,kBAAkB,GAAG,KAAK,CAAC;oBAEjC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;wBAClC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC;4BAAE,SAAS;wBAC3C,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,iBAAiB;4BAAE,SAAS;wBAEtD,MAAM,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CACvC,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,iBAAiB,CAAC,C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("data-llm plugin", () => {
|
|
4
|
+
it("should transform JSX element with data-llm string attribute", async () => {
|
|
5
|
+
const code = `
|
|
6
|
+
function Component() {
|
|
7
|
+
return <div data-llm="Test description">Content</div>;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
const result = await transform(code, "test.tsx");
|
|
11
|
+
expect(result).not.toBeNull();
|
|
12
|
+
expect(result?.code).toContain("DataLLM");
|
|
13
|
+
expect(result?.code).toContain('content="Test description"');
|
|
14
|
+
expect(result?.code).not.toContain("data-llm");
|
|
15
|
+
});
|
|
16
|
+
it("should transform JSX element with data-llm expression attribute", async () => {
|
|
17
|
+
const code = `
|
|
18
|
+
function Component() {
|
|
19
|
+
const desc = "Dynamic description";
|
|
20
|
+
return <div data-llm={desc}>Content</div>;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
const result = await transform(code, "test.tsx");
|
|
24
|
+
expect(result).not.toBeNull();
|
|
25
|
+
expect(result?.code).toContain("DataLLM");
|
|
26
|
+
expect(result?.code).toContain("content={desc}");
|
|
27
|
+
expect(result?.code).not.toContain("data-llm");
|
|
28
|
+
});
|
|
29
|
+
it("should add import for DataLLM when not present", async () => {
|
|
30
|
+
const code = `
|
|
31
|
+
function Component() {
|
|
32
|
+
return <div data-llm="Test">Content</div>;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const result = await transform(code, "test.tsx");
|
|
36
|
+
expect(result).not.toBeNull();
|
|
37
|
+
expect(result?.code).toContain('import { DataLLM } from "skybridge/web"');
|
|
38
|
+
});
|
|
39
|
+
it("should handle DataLLM imports correctly", async () => {
|
|
40
|
+
// No duplicate import
|
|
41
|
+
const codeWithImport = `
|
|
42
|
+
import { DataLLM } from "skybridge/web";
|
|
43
|
+
function Component() {
|
|
44
|
+
return <div data-llm="Test">Content</div>;
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
const result1 = await transform(codeWithImport, "test.tsx");
|
|
48
|
+
expect(result1?.code.match(/import.*DataLLM.*from.*skybridge\/web/g)).toHaveLength(1);
|
|
49
|
+
// Preserve other imports and add missing DataLLM
|
|
50
|
+
const codeWithOthers = `
|
|
51
|
+
import React from "react";
|
|
52
|
+
import { useState } from "react";
|
|
53
|
+
function Component() {
|
|
54
|
+
return <div data-llm="Test">Content</div>;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
const result2 = await transform(codeWithOthers, "test.tsx");
|
|
58
|
+
expect(result2?.code).toContain('import React from "react"');
|
|
59
|
+
expect(result2?.code).toContain('import { useState } from "react"');
|
|
60
|
+
expect(result2?.code).toContain('import { DataLLM } from "skybridge/web"');
|
|
61
|
+
});
|
|
62
|
+
it("should handle complex JSX with multiple data-llm attributes", async () => {
|
|
63
|
+
const code = `
|
|
64
|
+
function Component() {
|
|
65
|
+
return (
|
|
66
|
+
<div>
|
|
67
|
+
<section data-llm="Section 1">
|
|
68
|
+
<p>Content 1</p>
|
|
69
|
+
</section>
|
|
70
|
+
<section data-llm="Section 2">
|
|
71
|
+
<p>Content 2</p>
|
|
72
|
+
</section>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
const result = await transform(code, "test.tsx");
|
|
78
|
+
expect(result).toMatchSnapshot();
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=transform-data-llm.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-data-llm.test.js","sourceRoot":"","sources":["../../../../src/web/plugin/transform-data-llm.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC3E,MAAM,IAAI,GAAG;;;;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AC,yCAAyC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,sBAAsB;QACtB,MAAM,cAAc,GAAG;;;;;KAKtB,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QAC5D,MAAM,CACJ,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAC9D,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAElB,iDAAiD;QACjD,MAAM,cAAc,GAAG;;;;;;KAMtB,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QAC5D,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC;QACpE,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,SAAS,CAAC,yCAAyC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC3E,MAAM,IAAI,GAAG;;;;;;;;;;;;;KAaZ,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAEjD,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/web/types.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
declare module "react" {
|
|
3
|
+
interface HTMLAttributes<T extends Element = HTMLElement> {
|
|
4
|
+
"data-llm"?: string;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
1
7
|
export type UnknownObject = Record<string, unknown>;
|
|
8
|
+
export type Prettify<T> = {
|
|
9
|
+
[K in keyof T]: T[K];
|
|
10
|
+
} & {};
|
|
11
|
+
export type Objectify<T> = T & UnknownObject;
|
|
12
|
+
type RequiredKeys<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? never : K;
|
|
14
|
+
}[keyof T];
|
|
15
|
+
export type HasRequiredKeys<T> = RequiredKeys<T> extends never ? false : true;
|
|
2
16
|
type WidgetState = UnknownObject;
|
|
3
17
|
type FileMetadata = {
|
|
4
18
|
fileId: string;
|
package/dist/src/web/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/web/types.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,CAAC;AAuBf,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,OAAO,iBAAkB,SAAQ,WAErC;IACkB,IAAI,GAAG,wBAAwB,CAAC;CACnD;AA8FD,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,OAAO,eAAgB,SAAQ,WAEnC;IACkB,IAAI,GAAG,sBAAsB,CAAC;CACjD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.dc4ed16",
|
|
4
4
|
"description": "Skybridge is a framework for building ChatGPT apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"build": "tsc && pnpm run build:templates",
|
|
21
21
|
"build:templates": "cp -r src/server/templates dist/src/server/",
|
|
22
22
|
"test": "pnpm run test:unit && pnpm run test:type",
|
|
23
|
-
"test:unit": "vitest run
|
|
23
|
+
"test:unit": "vitest run",
|
|
24
24
|
"test:type": "tsc --noEmit",
|
|
25
25
|
"docs:dev": "pnpm --filter @skybridge/docs start",
|
|
26
26
|
"docs:build": "pnpm --filter @skybridge/docs build",
|
|
@@ -39,17 +39,21 @@
|
|
|
39
39
|
"react-dom": ">=18.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
+
"@babel/core": "^7.28.5",
|
|
42
43
|
"@modelcontextprotocol/sdk": "^1.20.0",
|
|
43
44
|
"cors": "^2.8.5",
|
|
44
45
|
"express": "^5.1.0",
|
|
45
46
|
"handlebars": "^4.7.8",
|
|
47
|
+
"superjson": "^2.2.6",
|
|
46
48
|
"vite": "^7.1.11",
|
|
47
|
-
"zod": "^3.25.51"
|
|
49
|
+
"zod": "^3.25.51",
|
|
50
|
+
"zustand": "^5.0.9"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
53
|
"@testing-library/dom": "^10.4.1",
|
|
51
54
|
"@testing-library/react": "^16.3.0",
|
|
52
55
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
56
|
+
"@types/babel__core": "^7.20.5",
|
|
53
57
|
"@types/cors": "^2.8.19",
|
|
54
58
|
"@types/express": "^5.0.3",
|
|
55
59
|
"@types/jsdom": "^21.1.6",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { useToolInfo } from "./use-tool-info.js";
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated This hook is deprecated. Use `useToolInfo()` instead and access the `output` property.
|
|
4
|
-
*/
|
|
5
|
-
export function useToolOutput() {
|
|
6
|
-
const { output } = useToolInfo();
|
|
7
|
-
return output;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=use-tool-output.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-tool-output.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-tool-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEjC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useOpenAiGlobal } from "./use-openai-global.js";
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated This hook is deprecated. Use `useToolInfo()` instead and access the `responseMetadata` property.
|
|
4
|
-
*/
|
|
5
|
-
export function useToolResponseMetadata() {
|
|
6
|
-
return useOpenAiGlobal("toolResponseMetadata");
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=use-tool-response-metadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-tool-response-metadata.js","sourceRoot":"","sources":["../../../../src/web/hooks/use-tool-response-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/web/plugin.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,SAAS;IACvB,OAAO;QACL,IAAI,EAAE,WAAW;QAEjB,KAAK,CAAC,MAAM,CAAC,MAAM;YACjB,4EAA4E;YAC5E,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;YAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;YAE9C,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YACjD,MAAM,cAAc,GAAG,OAAO,CAC5B,WAAW,EACX,oCAAoC,CACrC,CAAC;YAEF,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAC9B,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACrC,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC3C,IAAI;aACL,CAAC,CACH,CAAC;YAEF,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE;oBACL,QAAQ,EAAE,IAAI;oBACd,MAAM,EAAE,IAAI;oBACZ,YAAY,EAAE,KAAK;oBACnB,aAAa,EAAE;wBACb,KAAK;qBACN;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -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,72 +0,0 @@
|
|
|
1
|
-
import { expectTypeOf, test } from "vitest";
|
|
2
|
-
import { createTypedHooks } from "./typed-hooks.js";
|
|
3
|
-
test("InferWidgets extracts the widget registry type", () => {
|
|
4
|
-
expectTypeOf().toHaveProperty("search-voyage");
|
|
5
|
-
expectTypeOf().toHaveProperty("get-trip-details");
|
|
6
|
-
expectTypeOf().toHaveProperty("no-input-widget");
|
|
7
|
-
});
|
|
8
|
-
test("WidgetNames returns a union of widget name literals", () => {
|
|
9
|
-
expectTypeOf().toEqualTypeOf();
|
|
10
|
-
});
|
|
11
|
-
test("WidgetInput extracts the correct input type from Zod schema", () => {
|
|
12
|
-
expectTypeOf().toEqualTypeOf();
|
|
13
|
-
expectTypeOf().toEqualTypeOf();
|
|
14
|
-
});
|
|
15
|
-
test("WidgetOutput extracts the correct output type from Zod schema", () => {
|
|
16
|
-
expectTypeOf().toEqualTypeOf();
|
|
17
|
-
expectTypeOf().toEqualTypeOf();
|
|
18
|
-
});
|
|
19
|
-
test("createTypedHooks provides autocomplete for widget names", () => {
|
|
20
|
-
const { useCallTool } = createTypedHooks();
|
|
21
|
-
useCallTool("search-voyage");
|
|
22
|
-
useCallTool("get-trip-details");
|
|
23
|
-
useCallTool("no-input-widget");
|
|
24
|
-
// @ts-expect-error - "invalid-name" is not a valid widget name
|
|
25
|
-
useCallTool("invalid-name");
|
|
26
|
-
});
|
|
27
|
-
test("useCallTool returns correctly typed callTool function", () => {
|
|
28
|
-
const { useCallTool } = createTypedHooks();
|
|
29
|
-
const { callTool } = useCallTool("search-voyage");
|
|
30
|
-
callTool({ destination: "Spain" });
|
|
31
|
-
callTool({ destination: "France", departureDate: "2024-06-01" });
|
|
32
|
-
callTool({ destination: "Italy", maxPrice: 1000 });
|
|
33
|
-
});
|
|
34
|
-
test("useCallTool returns correctly typed data", () => {
|
|
35
|
-
const { useCallTool } = createTypedHooks();
|
|
36
|
-
const { data } = useCallTool("search-voyage");
|
|
37
|
-
if (data) {
|
|
38
|
-
expectTypeOf(data.structuredContent).toExtend();
|
|
39
|
-
expectTypeOf(data.structuredContent.results).toBeArray();
|
|
40
|
-
expectTypeOf(data.structuredContent.totalCount).toBeNumber();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
test("widgets with no outputSchema have empty object output type", () => {
|
|
44
|
-
expectTypeOf().toEqualTypeOf();
|
|
45
|
-
});
|
|
46
|
-
test("createTypedHooks provides autocomplete for widget names in useToolInfo", () => {
|
|
47
|
-
const { useToolInfo } = createTypedHooks();
|
|
48
|
-
useToolInfo();
|
|
49
|
-
useToolInfo();
|
|
50
|
-
useToolInfo();
|
|
51
|
-
// @ts-expect-error - "invalid-name" is not a valid widget name
|
|
52
|
-
useToolInfo();
|
|
53
|
-
});
|
|
54
|
-
test("useToolInfo infers input types from WidgetInput utility", () => {
|
|
55
|
-
const { useToolInfo } = createTypedHooks();
|
|
56
|
-
const toolInfo = useToolInfo();
|
|
57
|
-
expectTypeOf(toolInfo.input).toExtend();
|
|
58
|
-
const detailsInfo = useToolInfo();
|
|
59
|
-
expectTypeOf(detailsInfo.input).toExtend();
|
|
60
|
-
});
|
|
61
|
-
test("useToolInfo infers output types from WidgetOutput utility", () => {
|
|
62
|
-
const { useToolInfo } = createTypedHooks();
|
|
63
|
-
const toolInfo = useToolInfo();
|
|
64
|
-
if (toolInfo.status === "success") {
|
|
65
|
-
expectTypeOf(toolInfo.output).toExtend();
|
|
66
|
-
}
|
|
67
|
-
const detailsInfo = useToolInfo();
|
|
68
|
-
if (detailsInfo.status === "success") {
|
|
69
|
-
expectTypeOf(detailsInfo.output).toExtend();
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
//# 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;AAuCpD,IAAI,CAAC,gDAAgD,EAAE,GAAG,EAAE;IA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AAC,CAAC,QAAQ,EAAwB,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2DAA2D,EAAE,GAAG,EAAE;IACrE,MAAM,EAAE,WAAW,EAAE,GAAG,gBAAgB,EAAc,CAAC;IACvD,MAAM,QAAQ,GAAG,WAAW,EAAmB,CAAC;IAGhD,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAClC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAkB,CAAC;IAC3D,CAAC;IAED,MAAM,WAAW,GAAG,WAAW,EAAsB,CAAC;IAEtD,IAAI,WAAW,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACrC,YAAY,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAyB,CAAC;IACrE,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { createTypedHooks } from "./typed-hooks.js";
|
|
3
|
-
describe("createTypedHooks", () => {
|
|
4
|
-
it("should return an object with useCallTool hook", () => {
|
|
5
|
-
const hooks = createTypedHooks();
|
|
6
|
-
expect(hooks).toHaveProperty("useCallTool");
|
|
7
|
-
expect(typeof hooks.useCallTool).toBe("function");
|
|
8
|
-
});
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=typed-hooks.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typed-hooks.test.js","sourceRoot":"","sources":["../../../src/web/typed-hooks.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAYpD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,KAAK,GAAG,gBAAgB,EAAc,CAAC;QAC7C,MAAM,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC5C,MAAM,CAAC,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|