@sidecar-ai/openai 0.1.0-alpha.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/dist/components.d.ts +30 -0
- package/dist/components.js +35 -0
- package/dist/components.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.js +172 -0
- package/dist/index.js.map +1 -0
- package/dist/official.d.ts +30 -0
- package/dist/official.js +94 -0
- package/dist/official.js.map +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from '@openai/apps-sdk-ui/components/Alert';
|
|
2
|
+
export * from '@openai/apps-sdk-ui/components/AppsSDKUIProvider';
|
|
3
|
+
export * from '@openai/apps-sdk-ui/components/Avatar';
|
|
4
|
+
export * from '@openai/apps-sdk-ui/components/Badge';
|
|
5
|
+
export * from '@openai/apps-sdk-ui/components/Button';
|
|
6
|
+
export * from '@openai/apps-sdk-ui/components/Checkbox';
|
|
7
|
+
export * from '@openai/apps-sdk-ui/components/CodeBlock';
|
|
8
|
+
export * from '@openai/apps-sdk-ui/components/DatePicker';
|
|
9
|
+
export * from '@openai/apps-sdk-ui/components/DateRangePicker';
|
|
10
|
+
export * from '@openai/apps-sdk-ui/components/EmptyMessage';
|
|
11
|
+
import * as Icon from '@openai/apps-sdk-ui/components/Icon';
|
|
12
|
+
export { Icon as Icons };
|
|
13
|
+
export * from '@openai/apps-sdk-ui/components/Image';
|
|
14
|
+
export * from '@openai/apps-sdk-ui/components/Indicator';
|
|
15
|
+
export * from '@openai/apps-sdk-ui/components/Input';
|
|
16
|
+
export * from '@openai/apps-sdk-ui/components/Markdown';
|
|
17
|
+
export * from '@openai/apps-sdk-ui/components/Menu';
|
|
18
|
+
export * from '@openai/apps-sdk-ui/components/Popover';
|
|
19
|
+
export * from '@openai/apps-sdk-ui/components/RadioGroup';
|
|
20
|
+
export * from '@openai/apps-sdk-ui/components/SegmentedControl';
|
|
21
|
+
export * from '@openai/apps-sdk-ui/components/Select';
|
|
22
|
+
export * from '@openai/apps-sdk-ui/components/SelectControl';
|
|
23
|
+
export * from '@openai/apps-sdk-ui/components/ShimmerText';
|
|
24
|
+
export * from '@openai/apps-sdk-ui/components/Slider';
|
|
25
|
+
export * from '@openai/apps-sdk-ui/components/Switch';
|
|
26
|
+
export * from '@openai/apps-sdk-ui/components/TagInput';
|
|
27
|
+
export * from '@openai/apps-sdk-ui/components/Textarea';
|
|
28
|
+
export * from '@openai/apps-sdk-ui/components/TextLink';
|
|
29
|
+
export * from '@openai/apps-sdk-ui/components/Tooltip';
|
|
30
|
+
export * from '@openai/apps-sdk-ui/components/Transition';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// packages/openai/src/components.tsx
|
|
2
|
+
import "@openai/apps-sdk-ui/css";
|
|
3
|
+
export * from "@openai/apps-sdk-ui/components/Alert";
|
|
4
|
+
export * from "@openai/apps-sdk-ui/components/AppsSDKUIProvider";
|
|
5
|
+
export * from "@openai/apps-sdk-ui/components/Avatar";
|
|
6
|
+
export * from "@openai/apps-sdk-ui/components/Badge";
|
|
7
|
+
export * from "@openai/apps-sdk-ui/components/Button";
|
|
8
|
+
export * from "@openai/apps-sdk-ui/components/Checkbox";
|
|
9
|
+
export * from "@openai/apps-sdk-ui/components/CodeBlock";
|
|
10
|
+
export * from "@openai/apps-sdk-ui/components/DatePicker";
|
|
11
|
+
export * from "@openai/apps-sdk-ui/components/DateRangePicker";
|
|
12
|
+
export * from "@openai/apps-sdk-ui/components/EmptyMessage";
|
|
13
|
+
import * as Icons from "@openai/apps-sdk-ui/components/Icon";
|
|
14
|
+
export * from "@openai/apps-sdk-ui/components/Image";
|
|
15
|
+
export * from "@openai/apps-sdk-ui/components/Indicator";
|
|
16
|
+
export * from "@openai/apps-sdk-ui/components/Input";
|
|
17
|
+
export * from "@openai/apps-sdk-ui/components/Markdown";
|
|
18
|
+
export * from "@openai/apps-sdk-ui/components/Menu";
|
|
19
|
+
export * from "@openai/apps-sdk-ui/components/Popover";
|
|
20
|
+
export * from "@openai/apps-sdk-ui/components/RadioGroup";
|
|
21
|
+
export * from "@openai/apps-sdk-ui/components/SegmentedControl";
|
|
22
|
+
export * from "@openai/apps-sdk-ui/components/Select";
|
|
23
|
+
export * from "@openai/apps-sdk-ui/components/SelectControl";
|
|
24
|
+
export * from "@openai/apps-sdk-ui/components/ShimmerText";
|
|
25
|
+
export * from "@openai/apps-sdk-ui/components/Slider";
|
|
26
|
+
export * from "@openai/apps-sdk-ui/components/Switch";
|
|
27
|
+
export * from "@openai/apps-sdk-ui/components/TagInput";
|
|
28
|
+
export * from "@openai/apps-sdk-ui/components/Textarea";
|
|
29
|
+
export * from "@openai/apps-sdk-ui/components/TextLink";
|
|
30
|
+
export * from "@openai/apps-sdk-ui/components/Tooltip";
|
|
31
|
+
export * from "@openai/apps-sdk-ui/components/Transition";
|
|
32
|
+
export {
|
|
33
|
+
Icons
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/openai/src/components.tsx"],"sourcesContent":["/**\n * Official ChatGPT Apps SDK UI components.\n *\n * This subpath intentionally re-exports OpenAI's MIT-licensed Apps SDK UI\n * package instead of reconstructing it. Use `@sidecar-ai/native` when code needs\n * portable host-adaptive primitives.\n */\nimport \"@openai/apps-sdk-ui/css\";\n\nexport * from \"@openai/apps-sdk-ui/components/Alert\";\nexport * from \"@openai/apps-sdk-ui/components/AppsSDKUIProvider\";\nexport * from \"@openai/apps-sdk-ui/components/Avatar\";\nexport * from \"@openai/apps-sdk-ui/components/Badge\";\nexport * from \"@openai/apps-sdk-ui/components/Button\";\nexport * from \"@openai/apps-sdk-ui/components/Checkbox\";\nexport * from \"@openai/apps-sdk-ui/components/CodeBlock\";\nexport * from \"@openai/apps-sdk-ui/components/DatePicker\";\nexport * from \"@openai/apps-sdk-ui/components/DateRangePicker\";\nexport * from \"@openai/apps-sdk-ui/components/EmptyMessage\";\nexport * as Icons from \"@openai/apps-sdk-ui/components/Icon\";\nexport * from \"@openai/apps-sdk-ui/components/Image\";\nexport * from \"@openai/apps-sdk-ui/components/Indicator\";\nexport * from \"@openai/apps-sdk-ui/components/Input\";\nexport * from \"@openai/apps-sdk-ui/components/Markdown\";\nexport * from \"@openai/apps-sdk-ui/components/Menu\";\nexport * from \"@openai/apps-sdk-ui/components/Popover\";\nexport * from \"@openai/apps-sdk-ui/components/RadioGroup\";\nexport * from \"@openai/apps-sdk-ui/components/SegmentedControl\";\nexport * from \"@openai/apps-sdk-ui/components/Select\";\nexport * from \"@openai/apps-sdk-ui/components/SelectControl\";\nexport * from \"@openai/apps-sdk-ui/components/ShimmerText\";\nexport * from \"@openai/apps-sdk-ui/components/Slider\";\nexport * from \"@openai/apps-sdk-ui/components/Switch\";\nexport * from \"@openai/apps-sdk-ui/components/TagInput\";\nexport * from \"@openai/apps-sdk-ui/components/Textarea\";\nexport * from \"@openai/apps-sdk-ui/components/TextLink\";\nexport * from \"@openai/apps-sdk-ui/components/Tooltip\";\nexport * from \"@openai/apps-sdk-ui/components/Transition\";\n"],"mappings":";AAOA,OAAO;AAEP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,YAAY,WAAW;AACvB,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ChatGptToolOptions } from '@sidecar-ai/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Typed ChatGPT compatibility helpers.
|
|
5
|
+
*
|
|
6
|
+
* Sidecar emits standard MCP Apps metadata first. This package exists for the
|
|
7
|
+
* optional ChatGPT fields and runtime globals that still need OpenAI-specific
|
|
8
|
+
* names on the wire.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** CSP domains supported by ChatGPT widget metadata. */
|
|
12
|
+
type ChatGptWidgetCsp = {
|
|
13
|
+
/** Domains the widget may contact with fetch/XHR. */
|
|
14
|
+
connectDomains?: readonly string[];
|
|
15
|
+
/** Domains the widget may use for images, fonts, scripts, and styles. */
|
|
16
|
+
resourceDomains?: readonly string[];
|
|
17
|
+
/** Origins allowed for iframe embeds. Omit unless the widget needs subframes. */
|
|
18
|
+
frameDomains?: readonly string[];
|
|
19
|
+
/** Redirect targets for ChatGPT `openExternal` links. */
|
|
20
|
+
redirectDomains?: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
/** Resource-level ChatGPT widget metadata. */
|
|
23
|
+
type ChatGptWidgetOptions = {
|
|
24
|
+
/** Short host-facing summary of what the rendered widget shows. */
|
|
25
|
+
description?: string;
|
|
26
|
+
/** Preferred dedicated widget origin for broad distribution. */
|
|
27
|
+
domain?: string;
|
|
28
|
+
/** Whether the widget prefers a host-provided border. */
|
|
29
|
+
prefersBorder?: boolean;
|
|
30
|
+
/** CSP allowlists for network, static assets, iframes, and external links. */
|
|
31
|
+
csp?: ChatGptWidgetCsp;
|
|
32
|
+
};
|
|
33
|
+
/** Standard result shape for ChatGPT-only host features. */
|
|
34
|
+
type ChatGptFeatureResult<T = void> = {
|
|
35
|
+
ok: true;
|
|
36
|
+
value: T;
|
|
37
|
+
} | {
|
|
38
|
+
ok: false;
|
|
39
|
+
reason: "unsupported" | "denied" | "cancelled" | "failed";
|
|
40
|
+
message?: string;
|
|
41
|
+
};
|
|
42
|
+
/** Display modes exposed by ChatGPT's host bridge. */
|
|
43
|
+
type ChatGptDisplayMode = "inline" | "fullscreen" | "pip";
|
|
44
|
+
/** File picker options accepted by ChatGPT's host bridge. */
|
|
45
|
+
type ChatGptFileSelectOptions = {
|
|
46
|
+
accept?: string[];
|
|
47
|
+
multiple?: boolean;
|
|
48
|
+
};
|
|
49
|
+
/** Widget result state exposed by ChatGPT's host bridge. */
|
|
50
|
+
type ChatGptToolResult<Structured = unknown, Meta = Record<string, unknown>> = {
|
|
51
|
+
structuredContent: Structured | undefined;
|
|
52
|
+
content: unknown[];
|
|
53
|
+
meta: Meta;
|
|
54
|
+
_meta?: Meta;
|
|
55
|
+
};
|
|
56
|
+
/** ChatGPT-only `window.openai` bridge shape used by this package. */
|
|
57
|
+
type ChatGptBridge = {
|
|
58
|
+
callTool?: (name: string, params: Record<string, unknown>) => Promise<unknown>;
|
|
59
|
+
sendFollowUpMessage?: (message: {
|
|
60
|
+
text: string;
|
|
61
|
+
}) => Promise<void>;
|
|
62
|
+
setWidgetState?: (context: Record<string, unknown>) => Promise<void>;
|
|
63
|
+
requestDisplayMode?: (request: {
|
|
64
|
+
mode: ChatGptDisplayMode;
|
|
65
|
+
}) => Promise<void>;
|
|
66
|
+
openExternal?: (request: {
|
|
67
|
+
href: string;
|
|
68
|
+
}) => Promise<void>;
|
|
69
|
+
selectFiles?: (options: ChatGptFileSelectOptions) => Promise<File[]>;
|
|
70
|
+
toolOutput?: unknown;
|
|
71
|
+
toolResponseMetadata?: Record<string, unknown>;
|
|
72
|
+
};
|
|
73
|
+
/** Namespace matching the user-facing platform name. */
|
|
74
|
+
declare const chatgpt: {
|
|
75
|
+
/** Returns typed tool options for `tool({ hosts: { chatgpt: ... } })`. */
|
|
76
|
+
tool(options: ChatGptToolOptions): ChatGptToolOptions;
|
|
77
|
+
/** Returns resource metadata for custom resource emitters. */
|
|
78
|
+
widget(options: ChatGptWidgetOptions): Record<string, unknown>;
|
|
79
|
+
/** ChatGPT-only runtime capabilities backed by `window.openai`. */
|
|
80
|
+
runtime: {
|
|
81
|
+
/** Returns true when ChatGPT's host-specific bridge is present. */
|
|
82
|
+
available(): boolean;
|
|
83
|
+
/** Calls a tool through ChatGPT's host-specific bridge. Prefer standard MCP Apps calls when portable. */
|
|
84
|
+
callTool<TParams extends Record<string, unknown>, Structured = unknown>(name: string, params: TParams): Promise<ChatGptFeatureResult<Structured>>;
|
|
85
|
+
/** Reads the initial tool result values ChatGPT exposes to widgets. */
|
|
86
|
+
toolResult<Structured, Meta = Record<string, unknown>>(): ChatGptToolResult<Structured, Meta>;
|
|
87
|
+
/** Sends a follow-up user message through ChatGPT's host-specific bridge. */
|
|
88
|
+
sendFollowUpMessage(text: string): Promise<ChatGptFeatureResult>;
|
|
89
|
+
/** Stores widget state through ChatGPT's host-specific bridge. */
|
|
90
|
+
setWidgetState(context: Record<string, unknown>): Promise<ChatGptFeatureResult>;
|
|
91
|
+
/** Requests an OpenAI-supported widget display mode. */
|
|
92
|
+
requestDisplayMode(mode: ChatGptDisplayMode): Promise<ChatGptFeatureResult>;
|
|
93
|
+
/** Opens an external URL through ChatGPT's host-specific bridge. */
|
|
94
|
+
openExternal(url: string): Promise<ChatGptFeatureResult>;
|
|
95
|
+
/** Opens ChatGPT's native file picker. */
|
|
96
|
+
selectFiles(options?: ChatGptFileSelectOptions): Promise<ChatGptFeatureResult<File[]>>;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
/** Reads ChatGPT's host-specific bridge. Generic Sidecar packages intentionally do not call this. */
|
|
100
|
+
declare function readChatGptBridge(): ChatGptBridge | undefined;
|
|
101
|
+
/** Converts typed widget options into standard and ChatGPT compatibility metadata. */
|
|
102
|
+
declare function chatGptWidgetMeta(options: ChatGptWidgetOptions): Record<string, unknown>;
|
|
103
|
+
|
|
104
|
+
export { type ChatGptBridge, type ChatGptDisplayMode, type ChatGptFeatureResult, type ChatGptFileSelectOptions, ChatGptToolOptions, type ChatGptToolResult, type ChatGptWidgetCsp, type ChatGptWidgetOptions, chatGptWidgetMeta, chatgpt, readChatGptBridge };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
// packages/openai/src/index.ts
|
|
2
|
+
var chatgpt = {
|
|
3
|
+
/** Returns typed tool options for `tool({ hosts: { chatgpt: ... } })`. */
|
|
4
|
+
tool(options) {
|
|
5
|
+
return options;
|
|
6
|
+
},
|
|
7
|
+
/** Returns resource metadata for custom resource emitters. */
|
|
8
|
+
widget(options) {
|
|
9
|
+
return chatGptWidgetMeta(options);
|
|
10
|
+
},
|
|
11
|
+
/** ChatGPT-only runtime capabilities backed by `window.openai`. */
|
|
12
|
+
runtime: {
|
|
13
|
+
/** Returns true when ChatGPT's host-specific bridge is present. */
|
|
14
|
+
available() {
|
|
15
|
+
return Boolean(readChatGptBridge());
|
|
16
|
+
},
|
|
17
|
+
/** Calls a tool through ChatGPT's host-specific bridge. Prefer standard MCP Apps calls when portable. */
|
|
18
|
+
async callTool(name, params) {
|
|
19
|
+
const bridge = readChatGptBridge();
|
|
20
|
+
if (!bridge?.callTool) {
|
|
21
|
+
return unsupported();
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
return { ok: true, value: await bridge.callTool(name, params) };
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return normalizeHostError(error);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
/** Reads the initial tool result values ChatGPT exposes to widgets. */
|
|
30
|
+
toolResult() {
|
|
31
|
+
const bridge = readChatGptBridge();
|
|
32
|
+
const meta = bridge?.toolResponseMetadata ?? {};
|
|
33
|
+
return {
|
|
34
|
+
structuredContent: bridge?.toolOutput,
|
|
35
|
+
content: [],
|
|
36
|
+
meta,
|
|
37
|
+
_meta: meta
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
/** Sends a follow-up user message through ChatGPT's host-specific bridge. */
|
|
41
|
+
async sendFollowUpMessage(text) {
|
|
42
|
+
const bridge = readChatGptBridge();
|
|
43
|
+
if (!bridge?.sendFollowUpMessage) {
|
|
44
|
+
return unsupported();
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
await bridge.sendFollowUpMessage({ text });
|
|
48
|
+
return { ok: true, value: void 0 };
|
|
49
|
+
} catch (error) {
|
|
50
|
+
return normalizeHostError(error);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
/** Stores widget state through ChatGPT's host-specific bridge. */
|
|
54
|
+
async setWidgetState(context) {
|
|
55
|
+
const bridge = readChatGptBridge();
|
|
56
|
+
if (!bridge?.setWidgetState) {
|
|
57
|
+
return unsupported();
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
await bridge.setWidgetState(context);
|
|
61
|
+
return { ok: true, value: void 0 };
|
|
62
|
+
} catch (error) {
|
|
63
|
+
return normalizeHostError(error);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
/** Requests an OpenAI-supported widget display mode. */
|
|
67
|
+
async requestDisplayMode(mode) {
|
|
68
|
+
const bridge = readChatGptBridge();
|
|
69
|
+
if (!bridge?.requestDisplayMode) {
|
|
70
|
+
return unsupported();
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
await bridge.requestDisplayMode({ mode });
|
|
74
|
+
return { ok: true, value: void 0 };
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return normalizeHostError(error);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
/** Opens an external URL through ChatGPT's host-specific bridge. */
|
|
80
|
+
async openExternal(url) {
|
|
81
|
+
if (!isAllowedExternalUrl(url)) {
|
|
82
|
+
return {
|
|
83
|
+
ok: false,
|
|
84
|
+
reason: "denied",
|
|
85
|
+
message: "Only http, https, and mailto URLs can be opened externally."
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const bridge = readChatGptBridge();
|
|
89
|
+
if (!bridge?.openExternal) {
|
|
90
|
+
return unsupported();
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
await bridge.openExternal({ href: url });
|
|
94
|
+
return { ok: true, value: void 0 };
|
|
95
|
+
} catch (error) {
|
|
96
|
+
return normalizeHostError(error);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
/** Opens ChatGPT's native file picker. */
|
|
100
|
+
async selectFiles(options = {}) {
|
|
101
|
+
const bridge = readChatGptBridge();
|
|
102
|
+
if (!bridge?.selectFiles) {
|
|
103
|
+
return unsupported();
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
return { ok: true, value: await bridge.selectFiles(options) };
|
|
107
|
+
} catch (error) {
|
|
108
|
+
return normalizeHostError(error);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
function readChatGptBridge() {
|
|
114
|
+
if (typeof window === "undefined") {
|
|
115
|
+
return void 0;
|
|
116
|
+
}
|
|
117
|
+
return window.openai;
|
|
118
|
+
}
|
|
119
|
+
function chatGptWidgetMeta(options) {
|
|
120
|
+
return stripUndefined({
|
|
121
|
+
ui: stripUndefined({
|
|
122
|
+
prefersBorder: options.prefersBorder,
|
|
123
|
+
csp: options.csp ? stripUndefined({
|
|
124
|
+
connectDomains: options.csp.connectDomains ? [...options.csp.connectDomains] : void 0,
|
|
125
|
+
resourceDomains: options.csp.resourceDomains ? [...options.csp.resourceDomains] : void 0,
|
|
126
|
+
frameDomains: options.csp.frameDomains ? [...options.csp.frameDomains] : void 0
|
|
127
|
+
}) : void 0
|
|
128
|
+
}),
|
|
129
|
+
"openai/widgetDescription": options.description,
|
|
130
|
+
"openai/widgetDomain": options.domain,
|
|
131
|
+
"openai/widgetCSP": options.csp ? stripUndefined({
|
|
132
|
+
connect_domains: options.csp.connectDomains ? [...options.csp.connectDomains] : void 0,
|
|
133
|
+
resource_domains: options.csp.resourceDomains ? [...options.csp.resourceDomains] : void 0,
|
|
134
|
+
frame_domains: options.csp.frameDomains ? [...options.csp.frameDomains] : void 0,
|
|
135
|
+
redirect_domains: options.csp.redirectDomains ? [...options.csp.redirectDomains] : void 0
|
|
136
|
+
}) : void 0
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function stripUndefined(value) {
|
|
140
|
+
return Object.fromEntries(
|
|
141
|
+
Object.entries(value).filter(([, entry]) => entry !== void 0)
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
function unsupported() {
|
|
145
|
+
return { ok: false, reason: "unsupported" };
|
|
146
|
+
}
|
|
147
|
+
function normalizeHostError(error) {
|
|
148
|
+
if (isAbortError(error)) {
|
|
149
|
+
return { ok: false, reason: "cancelled" };
|
|
150
|
+
}
|
|
151
|
+
if (error instanceof Error) {
|
|
152
|
+
return { ok: false, reason: "failed", message: error.message };
|
|
153
|
+
}
|
|
154
|
+
return { ok: false, reason: "failed" };
|
|
155
|
+
}
|
|
156
|
+
function isAbortError(error) {
|
|
157
|
+
return error instanceof DOMException && error.name === "AbortError";
|
|
158
|
+
}
|
|
159
|
+
function isAllowedExternalUrl(value) {
|
|
160
|
+
try {
|
|
161
|
+
const url = new URL(value);
|
|
162
|
+
return url.protocol === "https:" || url.protocol === "http:" || url.protocol === "mailto:";
|
|
163
|
+
} catch {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
export {
|
|
168
|
+
chatGptWidgetMeta,
|
|
169
|
+
chatgpt,
|
|
170
|
+
readChatGptBridge
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/openai/src/index.ts"],"sourcesContent":["/**\n * Typed ChatGPT compatibility helpers.\n *\n * Sidecar emits standard MCP Apps metadata first. This package exists for the\n * optional ChatGPT fields and runtime globals that still need OpenAI-specific\n * names on the wire.\n */\nimport type { ChatGptToolOptions } from \"@sidecar-ai/core\";\n\n/** CSP domains supported by ChatGPT widget metadata. */\nexport type ChatGptWidgetCsp = {\n /** Domains the widget may contact with fetch/XHR. */\n connectDomains?: readonly string[];\n /** Domains the widget may use for images, fonts, scripts, and styles. */\n resourceDomains?: readonly string[];\n /** Origins allowed for iframe embeds. Omit unless the widget needs subframes. */\n frameDomains?: readonly string[];\n /** Redirect targets for ChatGPT `openExternal` links. */\n redirectDomains?: readonly string[];\n};\n\n/** Resource-level ChatGPT widget metadata. */\nexport type ChatGptWidgetOptions = {\n /** Short host-facing summary of what the rendered widget shows. */\n description?: string;\n /** Preferred dedicated widget origin for broad distribution. */\n domain?: string;\n /** Whether the widget prefers a host-provided border. */\n prefersBorder?: boolean;\n /** CSP allowlists for network, static assets, iframes, and external links. */\n csp?: ChatGptWidgetCsp;\n};\n\n/** Standard result shape for ChatGPT-only host features. */\nexport type ChatGptFeatureResult<T = void> =\n | { ok: true; value: T }\n | { ok: false; reason: \"unsupported\" | \"denied\" | \"cancelled\" | \"failed\"; message?: string };\n\n/** Display modes exposed by ChatGPT's host bridge. */\nexport type ChatGptDisplayMode = \"inline\" | \"fullscreen\" | \"pip\";\n\n/** File picker options accepted by ChatGPT's host bridge. */\nexport type ChatGptFileSelectOptions = {\n accept?: string[];\n multiple?: boolean;\n};\n\n/** Widget result state exposed by ChatGPT's host bridge. */\nexport type ChatGptToolResult<\n Structured = unknown,\n Meta = Record<string, unknown>,\n> = {\n structuredContent: Structured | undefined;\n content: unknown[];\n meta: Meta;\n _meta?: Meta;\n};\n\n/** ChatGPT-only `window.openai` bridge shape used by this package. */\nexport type ChatGptBridge = {\n callTool?: (name: string, params: Record<string, unknown>) => Promise<unknown>;\n sendFollowUpMessage?: (message: { text: string }) => Promise<void>;\n setWidgetState?: (context: Record<string, unknown>) => Promise<void>;\n requestDisplayMode?: (request: { mode: ChatGptDisplayMode }) => Promise<void>;\n openExternal?: (request: { href: string }) => Promise<void>;\n selectFiles?: (options: ChatGptFileSelectOptions) => Promise<File[]>;\n toolOutput?: unknown;\n toolResponseMetadata?: Record<string, unknown>;\n};\n\n/** Namespace matching the user-facing platform name. */\nexport const chatgpt = {\n /** Returns typed tool options for `tool({ hosts: { chatgpt: ... } })`. */\n tool(options: ChatGptToolOptions): ChatGptToolOptions {\n return options;\n },\n\n /** Returns resource metadata for custom resource emitters. */\n widget(options: ChatGptWidgetOptions): Record<string, unknown> {\n return chatGptWidgetMeta(options);\n },\n\n /** ChatGPT-only runtime capabilities backed by `window.openai`. */\n runtime: {\n /** Returns true when ChatGPT's host-specific bridge is present. */\n available(): boolean {\n return Boolean(readChatGptBridge());\n },\n\n /** Calls a tool through ChatGPT's host-specific bridge. Prefer standard MCP Apps calls when portable. */\n async callTool<TParams extends Record<string, unknown>, Structured = unknown>(\n name: string,\n params: TParams,\n ): Promise<ChatGptFeatureResult<Structured>> {\n const bridge = readChatGptBridge();\n if (!bridge?.callTool) {\n return unsupported();\n }\n\n try {\n return { ok: true, value: await bridge.callTool(name, params) as Structured };\n } catch (error) {\n return normalizeHostError<Structured>(error);\n }\n },\n\n /** Reads the initial tool result values ChatGPT exposes to widgets. */\n toolResult<Structured, Meta = Record<string, unknown>>(): ChatGptToolResult<Structured, Meta> {\n const bridge = readChatGptBridge();\n const meta = (bridge?.toolResponseMetadata ?? {}) as Meta;\n return {\n structuredContent: bridge?.toolOutput as Structured | undefined,\n content: [],\n meta,\n _meta: meta,\n };\n },\n\n /** Sends a follow-up user message through ChatGPT's host-specific bridge. */\n async sendFollowUpMessage(text: string): Promise<ChatGptFeatureResult> {\n const bridge = readChatGptBridge();\n if (!bridge?.sendFollowUpMessage) {\n return unsupported();\n }\n\n try {\n await bridge.sendFollowUpMessage({ text });\n return { ok: true, value: undefined };\n } catch (error) {\n return normalizeHostError(error);\n }\n },\n\n /** Stores widget state through ChatGPT's host-specific bridge. */\n async setWidgetState(context: Record<string, unknown>): Promise<ChatGptFeatureResult> {\n const bridge = readChatGptBridge();\n if (!bridge?.setWidgetState) {\n return unsupported();\n }\n\n try {\n await bridge.setWidgetState(context);\n return { ok: true, value: undefined };\n } catch (error) {\n return normalizeHostError(error);\n }\n },\n\n /** Requests an OpenAI-supported widget display mode. */\n async requestDisplayMode(mode: ChatGptDisplayMode): Promise<ChatGptFeatureResult> {\n const bridge = readChatGptBridge();\n if (!bridge?.requestDisplayMode) {\n return unsupported();\n }\n\n try {\n await bridge.requestDisplayMode({ mode });\n return { ok: true, value: undefined };\n } catch (error) {\n return normalizeHostError(error);\n }\n },\n\n /** Opens an external URL through ChatGPT's host-specific bridge. */\n async openExternal(url: string): Promise<ChatGptFeatureResult> {\n if (!isAllowedExternalUrl(url)) {\n return {\n ok: false,\n reason: \"denied\",\n message: \"Only http, https, and mailto URLs can be opened externally.\",\n };\n }\n\n const bridge = readChatGptBridge();\n if (!bridge?.openExternal) {\n return unsupported();\n }\n\n try {\n await bridge.openExternal({ href: url });\n return { ok: true, value: undefined };\n } catch (error) {\n return normalizeHostError(error);\n }\n },\n\n /** Opens ChatGPT's native file picker. */\n async selectFiles(options: ChatGptFileSelectOptions = {}): Promise<ChatGptFeatureResult<File[]>> {\n const bridge = readChatGptBridge();\n if (!bridge?.selectFiles) {\n return unsupported();\n }\n\n try {\n return { ok: true, value: await bridge.selectFiles(options) };\n } catch (error) {\n return normalizeHostError<File[]>(error);\n }\n },\n },\n};\n\n/** Reads ChatGPT's host-specific bridge. Generic Sidecar packages intentionally do not call this. */\nexport function readChatGptBridge(): ChatGptBridge | undefined {\n if (typeof window === \"undefined\") {\n return undefined;\n }\n\n return (window as unknown as { openai?: ChatGptBridge }).openai;\n}\n\n/** Converts typed widget options into standard and ChatGPT compatibility metadata. */\nexport function chatGptWidgetMeta(options: ChatGptWidgetOptions): Record<string, unknown> {\n return stripUndefined({\n ui: stripUndefined({\n prefersBorder: options.prefersBorder,\n csp: options.csp\n ? stripUndefined({\n connectDomains: options.csp.connectDomains ? [...options.csp.connectDomains] : undefined,\n resourceDomains: options.csp.resourceDomains ? [...options.csp.resourceDomains] : undefined,\n frameDomains: options.csp.frameDomains ? [...options.csp.frameDomains] : undefined,\n })\n : undefined,\n }),\n \"openai/widgetDescription\": options.description,\n \"openai/widgetDomain\": options.domain,\n \"openai/widgetCSP\": options.csp\n ? stripUndefined({\n connect_domains: options.csp.connectDomains ? [...options.csp.connectDomains] : undefined,\n resource_domains: options.csp.resourceDomains ? [...options.csp.resourceDomains] : undefined,\n frame_domains: options.csp.frameDomains ? [...options.csp.frameDomains] : undefined,\n redirect_domains: options.csp.redirectDomains ? [...options.csp.redirectDomains] : undefined,\n })\n : undefined,\n });\n}\n\n/** Drops undefined metadata keys before JSON serialization. */\nfunction stripUndefined<T extends Record<string, unknown>>(value: T): T {\n return Object.fromEntries(\n Object.entries(value).filter(([, entry]) => entry !== undefined),\n ) as T;\n}\n\n/** Returns a stable unsupported result for absent ChatGPT-only host APIs. */\nfunction unsupported<T = void>(): ChatGptFeatureResult<T> {\n return { ok: false, reason: \"unsupported\" };\n}\n\n/** Converts host exceptions into stable capability results. */\nfunction normalizeHostError<T = void>(error: unknown): ChatGptFeatureResult<T> {\n if (isAbortError(error)) {\n return { ok: false, reason: \"cancelled\" };\n }\n if (error instanceof Error) {\n return { ok: false, reason: \"failed\", message: error.message };\n }\n return { ok: false, reason: \"failed\" };\n}\n\n/** Returns true for browser cancellation errors. */\nfunction isAbortError(error: unknown): boolean {\n return error instanceof DOMException && error.name === \"AbortError\";\n}\n\n/** Allows only URL schemes that are safe for external navigation helpers. */\nfunction isAllowedExternalUrl(value: string): boolean {\n try {\n const url = new URL(value);\n return url.protocol === \"https:\" || url.protocol === \"http:\" || url.protocol === \"mailto:\";\n } catch {\n return false;\n }\n}\n\nexport type { ChatGptToolOptions };\n"],"mappings":";AAuEO,IAAM,UAAU;AAAA;AAAA,EAErB,KAAK,SAAiD;AACpD,WAAO;AAAA,EACT;AAAA;AAAA,EAGA,OAAO,SAAwD;AAC7D,WAAO,kBAAkB,OAAO;AAAA,EAClC;AAAA;AAAA,EAGA,SAAS;AAAA;AAAA,IAEP,YAAqB;AACnB,aAAO,QAAQ,kBAAkB,CAAC;AAAA,IACpC;AAAA;AAAA,IAGA,MAAM,SACJ,MACA,QAC2C;AAC3C,YAAM,SAAS,kBAAkB;AACjC,UAAI,CAAC,QAAQ,UAAU;AACrB,eAAO,YAAY;AAAA,MACrB;AAEA,UAAI;AACF,eAAO,EAAE,IAAI,MAAM,OAAO,MAAM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/Alert';
|
|
2
|
+
export * from '@openai/apps-sdk-ui/components/AppsSDKUIProvider';
|
|
3
|
+
export * from '@openai/apps-sdk-ui/components/Avatar';
|
|
4
|
+
export * from '@openai/apps-sdk-ui/components/Badge';
|
|
5
|
+
export * from '@openai/apps-sdk-ui/components/Button';
|
|
6
|
+
export * from '@openai/apps-sdk-ui/components/Checkbox';
|
|
7
|
+
export * from '@openai/apps-sdk-ui/components/CodeBlock';
|
|
8
|
+
export * from '@openai/apps-sdk-ui/components/DatePicker';
|
|
9
|
+
export * from '@openai/apps-sdk-ui/components/DateRangePicker';
|
|
10
|
+
export * from '@openai/apps-sdk-ui/components/EmptyMessage';
|
|
11
|
+
import * as Icon from '@openai/apps-sdk-ui/components/Icon';
|
|
12
|
+
export { Icon as Icons };
|
|
13
|
+
export * from '@openai/apps-sdk-ui/components/Image';
|
|
14
|
+
export * from '@openai/apps-sdk-ui/components/Indicator';
|
|
15
|
+
export * from '@openai/apps-sdk-ui/components/Input';
|
|
16
|
+
export * from '@openai/apps-sdk-ui/components/Markdown';
|
|
17
|
+
export * from '@openai/apps-sdk-ui/components/Menu';
|
|
18
|
+
export * from '@openai/apps-sdk-ui/components/Popover';
|
|
19
|
+
export * from '@openai/apps-sdk-ui/components/RadioGroup';
|
|
20
|
+
export * from '@openai/apps-sdk-ui/components/SegmentedControl';
|
|
21
|
+
export * from '@openai/apps-sdk-ui/components/Select';
|
|
22
|
+
export * from '@openai/apps-sdk-ui/components/SelectControl';
|
|
23
|
+
export * from '@openai/apps-sdk-ui/components/ShimmerText';
|
|
24
|
+
export * from '@openai/apps-sdk-ui/components/Slider';
|
|
25
|
+
export * from '@openai/apps-sdk-ui/components/Switch';
|
|
26
|
+
export * from '@openai/apps-sdk-ui/components/TagInput';
|
|
27
|
+
export * from '@openai/apps-sdk-ui/components/Textarea';
|
|
28
|
+
export * from '@openai/apps-sdk-ui/components/TextLink';
|
|
29
|
+
export * from '@openai/apps-sdk-ui/components/Tooltip';
|
|
30
|
+
export * from '@openai/apps-sdk-ui/components/Transition';
|
package/dist/official.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
|
|
19
|
+
// packages/openai/src/official.ts
|
|
20
|
+
var official_exports = {};
|
|
21
|
+
__export(official_exports, {
|
|
22
|
+
Icons: () => Icons
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// packages/openai/src/components.tsx
|
|
26
|
+
var components_exports = {};
|
|
27
|
+
__export(components_exports, {
|
|
28
|
+
Icons: () => Icons
|
|
29
|
+
});
|
|
30
|
+
__reExport(components_exports, Alert_star);
|
|
31
|
+
__reExport(components_exports, AppsSDKUIProvider_star);
|
|
32
|
+
__reExport(components_exports, Avatar_star);
|
|
33
|
+
__reExport(components_exports, Badge_star);
|
|
34
|
+
__reExport(components_exports, Button_star);
|
|
35
|
+
__reExport(components_exports, Checkbox_star);
|
|
36
|
+
__reExport(components_exports, CodeBlock_star);
|
|
37
|
+
__reExport(components_exports, DatePicker_star);
|
|
38
|
+
__reExport(components_exports, DateRangePicker_star);
|
|
39
|
+
__reExport(components_exports, EmptyMessage_star);
|
|
40
|
+
__reExport(components_exports, Image_star);
|
|
41
|
+
__reExport(components_exports, Indicator_star);
|
|
42
|
+
__reExport(components_exports, Input_star);
|
|
43
|
+
__reExport(components_exports, Markdown_star);
|
|
44
|
+
__reExport(components_exports, Menu_star);
|
|
45
|
+
__reExport(components_exports, Popover_star);
|
|
46
|
+
__reExport(components_exports, RadioGroup_star);
|
|
47
|
+
__reExport(components_exports, SegmentedControl_star);
|
|
48
|
+
__reExport(components_exports, Select_star);
|
|
49
|
+
__reExport(components_exports, SelectControl_star);
|
|
50
|
+
__reExport(components_exports, ShimmerText_star);
|
|
51
|
+
__reExport(components_exports, Slider_star);
|
|
52
|
+
__reExport(components_exports, Switch_star);
|
|
53
|
+
__reExport(components_exports, TagInput_star);
|
|
54
|
+
__reExport(components_exports, Textarea_star);
|
|
55
|
+
__reExport(components_exports, TextLink_star);
|
|
56
|
+
__reExport(components_exports, Tooltip_star);
|
|
57
|
+
__reExport(components_exports, Transition_star);
|
|
58
|
+
import "@openai/apps-sdk-ui/css";
|
|
59
|
+
import * as Alert_star from "@openai/apps-sdk-ui/components/Alert";
|
|
60
|
+
import * as AppsSDKUIProvider_star from "@openai/apps-sdk-ui/components/AppsSDKUIProvider";
|
|
61
|
+
import * as Avatar_star from "@openai/apps-sdk-ui/components/Avatar";
|
|
62
|
+
import * as Badge_star from "@openai/apps-sdk-ui/components/Badge";
|
|
63
|
+
import * as Button_star from "@openai/apps-sdk-ui/components/Button";
|
|
64
|
+
import * as Checkbox_star from "@openai/apps-sdk-ui/components/Checkbox";
|
|
65
|
+
import * as CodeBlock_star from "@openai/apps-sdk-ui/components/CodeBlock";
|
|
66
|
+
import * as DatePicker_star from "@openai/apps-sdk-ui/components/DatePicker";
|
|
67
|
+
import * as DateRangePicker_star from "@openai/apps-sdk-ui/components/DateRangePicker";
|
|
68
|
+
import * as EmptyMessage_star from "@openai/apps-sdk-ui/components/EmptyMessage";
|
|
69
|
+
import * as Icons from "@openai/apps-sdk-ui/components/Icon";
|
|
70
|
+
import * as Image_star from "@openai/apps-sdk-ui/components/Image";
|
|
71
|
+
import * as Indicator_star from "@openai/apps-sdk-ui/components/Indicator";
|
|
72
|
+
import * as Input_star from "@openai/apps-sdk-ui/components/Input";
|
|
73
|
+
import * as Markdown_star from "@openai/apps-sdk-ui/components/Markdown";
|
|
74
|
+
import * as Menu_star from "@openai/apps-sdk-ui/components/Menu";
|
|
75
|
+
import * as Popover_star from "@openai/apps-sdk-ui/components/Popover";
|
|
76
|
+
import * as RadioGroup_star from "@openai/apps-sdk-ui/components/RadioGroup";
|
|
77
|
+
import * as SegmentedControl_star from "@openai/apps-sdk-ui/components/SegmentedControl";
|
|
78
|
+
import * as Select_star from "@openai/apps-sdk-ui/components/Select";
|
|
79
|
+
import * as SelectControl_star from "@openai/apps-sdk-ui/components/SelectControl";
|
|
80
|
+
import * as ShimmerText_star from "@openai/apps-sdk-ui/components/ShimmerText";
|
|
81
|
+
import * as Slider_star from "@openai/apps-sdk-ui/components/Slider";
|
|
82
|
+
import * as Switch_star from "@openai/apps-sdk-ui/components/Switch";
|
|
83
|
+
import * as TagInput_star from "@openai/apps-sdk-ui/components/TagInput";
|
|
84
|
+
import * as Textarea_star from "@openai/apps-sdk-ui/components/Textarea";
|
|
85
|
+
import * as TextLink_star from "@openai/apps-sdk-ui/components/TextLink";
|
|
86
|
+
import * as Tooltip_star from "@openai/apps-sdk-ui/components/Tooltip";
|
|
87
|
+
import * as Transition_star from "@openai/apps-sdk-ui/components/Transition";
|
|
88
|
+
|
|
89
|
+
// packages/openai/src/official.ts
|
|
90
|
+
__reExport(official_exports, components_exports);
|
|
91
|
+
export {
|
|
92
|
+
Icons
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=official.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../packages/openai/src/official.ts","../../packages/openai/src/components.tsx"],"sourcesContent":["/** Backward-compatible alias for `@sidecar-ai/openai/components`. */\nexport * from \"./components.js\";\n","/**\n * Official ChatGPT Apps SDK UI components.\n *\n * This subpath intentionally re-exports OpenAI's MIT-licensed Apps SDK UI\n * package instead of reconstructing it. Use `@sidecar-ai/native` when code needs\n * portable host-adaptive primitives.\n */\nimport \"@openai/apps-sdk-ui/css\";\n\nexport * from \"@openai/apps-sdk-ui/components/Alert\";\nexport * from \"@openai/apps-sdk-ui/components/AppsSDKUIProvider\";\nexport * from \"@openai/apps-sdk-ui/components/Avatar\";\nexport * from \"@openai/apps-sdk-ui/components/Badge\";\nexport * from \"@openai/apps-sdk-ui/components/Button\";\nexport * from \"@openai/apps-sdk-ui/components/Checkbox\";\nexport * from \"@openai/apps-sdk-ui/components/CodeBlock\";\nexport * from \"@openai/apps-sdk-ui/components/DatePicker\";\nexport * from \"@openai/apps-sdk-ui/components/DateRangePicker\";\nexport * from \"@openai/apps-sdk-ui/components/EmptyMessage\";\nexport * as Icons from \"@openai/apps-sdk-ui/components/Icon\";\nexport * from \"@openai/apps-sdk-ui/components/Image\";\nexport * from \"@openai/apps-sdk-ui/components/Indicator\";\nexport * from \"@openai/apps-sdk-ui/components/Input\";\nexport * from \"@openai/apps-sdk-ui/components/Markdown\";\nexport * from \"@openai/apps-sdk-ui/components/Menu\";\nexport * from \"@openai/apps-sdk-ui/components/Popover\";\nexport * from \"@openai/apps-sdk-ui/components/RadioGroup\";\nexport * from \"@openai/apps-sdk-ui/components/SegmentedControl\";\nexport * from \"@openai/apps-sdk-ui/components/Select\";\nexport * from \"@openai/apps-sdk-ui/components/SelectControl\";\nexport * from \"@openai/apps-sdk-ui/components/ShimmerText\";\nexport * from \"@openai/apps-sdk-ui/components/Slider\";\nexport * from \"@openai/apps-sdk-ui/components/Switch\";\nexport * from \"@openai/apps-sdk-ui/components/TagInput\";\nexport * from \"@openai/apps-sdk-ui/components/Textarea\";\nexport * from \"@openai/apps-sdk-ui/components/TextLink\";\nexport * from \"@openai/apps-sdk-ui/components/Tooltip\";\nexport * from \"@openai/apps-sdk-ui/components/Transition\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA9BA,OAAO;AAEP,4BAAc;AACd,wCAAc;AACd,6BAAc;AACd,4BAAc;AACd,6BAAc;AACd,+BAAc;AACd,gCAAc;AACd,iCAAc;AACd,sCAAc;AACd,mCAAc;AACd,YAAY,WAAW;AACvB,4BAAc;AACd,gCAAc;AACd,4BAAc;AACd,+BAAc;AACd,2BAAc;AACd,8BAAc;AACd,iCAAc;AACd,uCAAc;AACd,6BAAc;AACd,oCAAc;AACd,kCAAc;AACd,6BAAc;AACd,6BAAc;AACd,+BAAc;AACd,+BAAc;AACd,+BAAc;AACd,8BAAc;AACd,iCAAc;;;ADpCd,6BAAc;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sidecar-ai/openai",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./components": {
|
|
14
|
+
"types": "./dist/components.d.ts",
|
|
15
|
+
"default": "./dist/components.js"
|
|
16
|
+
},
|
|
17
|
+
"./official": {
|
|
18
|
+
"types": "./dist/official.d.ts",
|
|
19
|
+
"default": "./dist/official.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@sidecar-ai/core": "0.1.0-alpha.0",
|
|
25
|
+
"@sidecar-ai/native": "0.1.0-alpha.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@openai/apps-sdk-ui": "^0.2.2",
|
|
29
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
30
|
+
"tailwindcss": "^4.0.10"
|
|
31
|
+
},
|
|
32
|
+
"peerDependenciesMeta": {
|
|
33
|
+
"@openai/apps-sdk-ui": {
|
|
34
|
+
"optional": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
}
|
|
40
|
+
}
|