@kibadist/agentui-openai 0.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.
- package/LICENSE +21 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/run-agent.d.ts +30 -0
- package/dist/run-agent.d.ts.map +1 -0
- package/dist/run-agent.js +74 -0
- package/dist/run-agent.js.map +1 -0
- package/dist/tool.d.ts +79 -0
- package/dist/tool.d.ts.map +1 -0
- package/dist/tool.js +74 -0
- package/dist/tool.js.map +1 -0
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 agentui
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,YAAY,EAA4B,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type OpenAI from "openai";
|
|
2
|
+
import type { UIEvent } from "@kibadist/agentui-protocol";
|
|
3
|
+
export interface RunAgentLoopOptions {
|
|
4
|
+
openai: OpenAI;
|
|
5
|
+
model?: string;
|
|
6
|
+
/** System message (instructions for the agent) */
|
|
7
|
+
systemPrompt: string;
|
|
8
|
+
/** Current user message / action description */
|
|
9
|
+
userMessage: string;
|
|
10
|
+
/** Allowed component types from your registry */
|
|
11
|
+
allowedTypes: string[];
|
|
12
|
+
/** Session id injected into emitted events */
|
|
13
|
+
sessionId: string;
|
|
14
|
+
/** Called for each valid UI event produced by the model */
|
|
15
|
+
onUIEvent: (event: UIEvent) => void;
|
|
16
|
+
/** Optional: additional tools beyond the UI emitter */
|
|
17
|
+
extraTools?: OpenAI.Chat.Completions.ChatCompletionTool[];
|
|
18
|
+
/** Optional: handler for extra tool calls */
|
|
19
|
+
onToolCall?: (name: string, args: Record<string, unknown>) => Promise<string>;
|
|
20
|
+
/** Max tool-call rounds to prevent infinite loops (default 10) */
|
|
21
|
+
maxRounds?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Runs a multi-turn agent loop that calls OpenAI and streams
|
|
25
|
+
* UI events via the emit_ui_event tool.
|
|
26
|
+
*
|
|
27
|
+
* Returns the final assistant message content (if any).
|
|
28
|
+
*/
|
|
29
|
+
export declare function runAgentLoop(opts: RunAgentLoopOptions): Promise<string | null>;
|
|
30
|
+
//# sourceMappingURL=run-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-agent.d.ts","sourceRoot":"","sources":["../src/run-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAI1D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC;IAC1D,6CAA6C;IAC7C,UAAU,CAAC,EAAE,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoFpF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { safeParseUIEvent } from "@kibadist/agentui-validate";
|
|
2
|
+
import { createUIEmitterTool, UI_EMITTER_TOOL_NAME } from "./tool.js";
|
|
3
|
+
/**
|
|
4
|
+
* Runs a multi-turn agent loop that calls OpenAI and streams
|
|
5
|
+
* UI events via the emit_ui_event tool.
|
|
6
|
+
*
|
|
7
|
+
* Returns the final assistant message content (if any).
|
|
8
|
+
*/
|
|
9
|
+
export async function runAgentLoop(opts) {
|
|
10
|
+
const { openai, model = "gpt-4o", systemPrompt, userMessage, allowedTypes, sessionId, onUIEvent, extraTools = [], onToolCall, maxRounds = 10, } = opts;
|
|
11
|
+
const uiTool = createUIEmitterTool(allowedTypes);
|
|
12
|
+
const tools = [uiTool, ...extraTools];
|
|
13
|
+
const messages = [
|
|
14
|
+
{ role: "system", content: systemPrompt },
|
|
15
|
+
{ role: "user", content: userMessage },
|
|
16
|
+
];
|
|
17
|
+
for (let round = 0; round < maxRounds; round++) {
|
|
18
|
+
const response = await openai.chat.completions.create({
|
|
19
|
+
model,
|
|
20
|
+
messages,
|
|
21
|
+
tools,
|
|
22
|
+
});
|
|
23
|
+
const choice = response.choices[0];
|
|
24
|
+
if (!choice)
|
|
25
|
+
break;
|
|
26
|
+
const assistantMsg = choice.message;
|
|
27
|
+
messages.push(assistantMsg);
|
|
28
|
+
// No tool calls → done
|
|
29
|
+
if (!assistantMsg.tool_calls?.length) {
|
|
30
|
+
return assistantMsg.content ?? null;
|
|
31
|
+
}
|
|
32
|
+
// Process tool calls
|
|
33
|
+
for (const tc of assistantMsg.tool_calls) {
|
|
34
|
+
let result;
|
|
35
|
+
if (tc.function.name === UI_EMITTER_TOOL_NAME) {
|
|
36
|
+
const args = JSON.parse(tc.function.arguments);
|
|
37
|
+
// Hydrate into a full UIEvent
|
|
38
|
+
const event = {
|
|
39
|
+
...args,
|
|
40
|
+
v: 1,
|
|
41
|
+
id: crypto.randomUUID(),
|
|
42
|
+
ts: new Date().toISOString(),
|
|
43
|
+
sessionId,
|
|
44
|
+
};
|
|
45
|
+
const parsed = safeParseUIEvent(event);
|
|
46
|
+
if (parsed.ok) {
|
|
47
|
+
onUIEvent(parsed.value);
|
|
48
|
+
result = JSON.stringify({ ok: true, eventId: event.id });
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
result = JSON.stringify({ ok: false, error: parsed.error.message });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (onToolCall) {
|
|
55
|
+
const args = JSON.parse(tc.function.arguments);
|
|
56
|
+
result = await onToolCall(tc.function.name, args);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
result = JSON.stringify({ error: `Unknown tool: ${tc.function.name}` });
|
|
60
|
+
}
|
|
61
|
+
messages.push({
|
|
62
|
+
role: "tool",
|
|
63
|
+
tool_call_id: tc.id,
|
|
64
|
+
content: result,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// If the model signaled stop, we're done
|
|
68
|
+
if (choice.finish_reason === "stop") {
|
|
69
|
+
return assistantMsg.content ?? null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=run-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-agent.js","sourceRoot":"","sources":["../src/run-agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AA0BtE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAyB;IAC1D,MAAM,EACJ,MAAM,EACN,KAAK,GAAG,QAAQ,EAChB,YAAY,EAC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a,KAAK,MAAM,EAAE,CAAC;YACpC,OAAO,YAAY,CAAC,OAAO,IAAI,IAAI,CAAC;QACtC,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/tool.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const UI_EMITTER_TOOL_NAME = "emit_ui_event";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an OpenAI function-tool definition for emitting UI events.
|
|
4
|
+
*
|
|
5
|
+
* Pass the result into your `tools` array when calling chat completions.
|
|
6
|
+
* The `allowedTypes` param populates the enum so the model only emits
|
|
7
|
+
* known component types.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createUIEmitterTool(allowedTypes: string[]): {
|
|
10
|
+
type: "function";
|
|
11
|
+
function: {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
parameters: {
|
|
15
|
+
type: string;
|
|
16
|
+
required: string[];
|
|
17
|
+
properties: {
|
|
18
|
+
op: {
|
|
19
|
+
type: string;
|
|
20
|
+
enum: string[];
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
node: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
properties: {
|
|
27
|
+
key: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
type: {
|
|
32
|
+
type: string;
|
|
33
|
+
enum: string[];
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
props: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
40
|
+
slot: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
};
|
|
47
|
+
index: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
key: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
props: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
replace: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
level: {
|
|
64
|
+
type: string;
|
|
65
|
+
enum: string[];
|
|
66
|
+
};
|
|
67
|
+
message: {
|
|
68
|
+
type: string;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
href: {
|
|
72
|
+
type: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,kBAAkB,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiEzD"}
|
package/dist/tool.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export const UI_EMITTER_TOOL_NAME = "emit_ui_event";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an OpenAI function-tool definition for emitting UI events.
|
|
4
|
+
*
|
|
5
|
+
* Pass the result into your `tools` array when calling chat completions.
|
|
6
|
+
* The `allowedTypes` param populates the enum so the model only emits
|
|
7
|
+
* known component types.
|
|
8
|
+
*/
|
|
9
|
+
export function createUIEmitterTool(allowedTypes) {
|
|
10
|
+
return {
|
|
11
|
+
type: "function",
|
|
12
|
+
function: {
|
|
13
|
+
name: UI_EMITTER_TOOL_NAME,
|
|
14
|
+
description: "Emit a UI event to render, update, or remove a component on the user's screen. " +
|
|
15
|
+
"Each call produces exactly one patch operation.",
|
|
16
|
+
parameters: {
|
|
17
|
+
type: "object",
|
|
18
|
+
required: ["op"],
|
|
19
|
+
properties: {
|
|
20
|
+
op: {
|
|
21
|
+
type: "string",
|
|
22
|
+
enum: ["ui.append", "ui.replace", "ui.remove", "ui.toast", "ui.navigate"],
|
|
23
|
+
description: "The patch operation to perform.",
|
|
24
|
+
},
|
|
25
|
+
// ui.append fields
|
|
26
|
+
node: {
|
|
27
|
+
type: "object",
|
|
28
|
+
description: "The UI node to append (required for ui.append).",
|
|
29
|
+
properties: {
|
|
30
|
+
key: { type: "string", description: "Stable identity key." },
|
|
31
|
+
type: {
|
|
32
|
+
type: "string",
|
|
33
|
+
enum: allowedTypes,
|
|
34
|
+
description: "Component type from the registry.",
|
|
35
|
+
},
|
|
36
|
+
props: {
|
|
37
|
+
type: "object",
|
|
38
|
+
description: "Props forwarded to the component.",
|
|
39
|
+
},
|
|
40
|
+
slot: { type: "string", description: "Layout slot (optional)." },
|
|
41
|
+
},
|
|
42
|
+
required: ["key", "type", "props"],
|
|
43
|
+
},
|
|
44
|
+
index: {
|
|
45
|
+
type: "integer",
|
|
46
|
+
description: "Insertion index for ui.append (optional).",
|
|
47
|
+
},
|
|
48
|
+
// ui.replace / ui.remove fields
|
|
49
|
+
key: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Key of the node to replace or remove.",
|
|
52
|
+
},
|
|
53
|
+
props: {
|
|
54
|
+
type: "object",
|
|
55
|
+
description: "New props for ui.replace.",
|
|
56
|
+
},
|
|
57
|
+
replace: {
|
|
58
|
+
type: "boolean",
|
|
59
|
+
description: "If true, fully replace props instead of merging (ui.replace).",
|
|
60
|
+
},
|
|
61
|
+
// ui.toast fields
|
|
62
|
+
level: {
|
|
63
|
+
type: "string",
|
|
64
|
+
enum: ["info", "success", "warning", "error"],
|
|
65
|
+
},
|
|
66
|
+
message: { type: "string", description: "Toast message text." },
|
|
67
|
+
// ui.navigate fields
|
|
68
|
+
href: { type: "string", description: "URL for ui.navigate." },
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=tool.js.map
|
package/dist/tool.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,YAAsB;IACxD,OAAO;QACL,IAAI,EAAE,UAAmB;QACzB,QAAQ,EAAE;YACR,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EACT,iFAAiF;gBACjF,iDAAiD;YACnD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,CAAC,IAAI,CAAC;gBAChB,UAAU,EAAE;oBACV,EAAE,EAAE;wBACF,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC;wBACzE,WAAW,EAAE,iCAAiC;qBAC/C;oBACD,mBAAmB;oBACnB,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,iDAAiD;wBAC9D,UAAU,EAAE;4BACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;4BAC5D,IAAI,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,IAAI,EAAE,YAAY;gCAClB,WAAW,EAAE,mCAAmC;6BACjD;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,mCAAmC;6BACjD;4BACD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;yBACjE;wBACD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC;qBACnC;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,2CAA2C;qBACzD;oBACD,gCAAgC;oBAChC,GAAG,EAAE;wBACH,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,uCAAuC;qBACrD;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,2BAA2B;qBACzC;oBACD,OAAO,EAAE;wBACP,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,+DAA+D;qBAC7E;oBACD,kBAAkB;oBAClB,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;qBAC9C;oBACD,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;oBAC/D,qBAAqB;oBACrB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE;iBAC9D;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,MAAM,WAAW,QAAQ;IACvB,KAAK,IAAI,MAAM,EAAE,CAAC;CACnB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kibadist/agentui-openai",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AgentUI OpenAI integration",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/kibadist/agentui.git",
|
|
9
|
+
"directory": "packages/openai"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@kibadist/agentui-protocol": "0.1.0",
|
|
28
|
+
"@kibadist/agentui-validate": "0.1.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"openai": "^4.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"openai": "^4.85.4",
|
|
35
|
+
"typescript": "^5.7.3"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"clean": "rm -rf dist",
|
|
40
|
+
"typecheck": "tsc --noEmit"
|
|
41
|
+
}
|
|
42
|
+
}
|