@dotcraft/plugin 0.5.9
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 +201 -0
- package/README.md +25 -0
- package/dist/contracts.d.ts +240 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-runtime.d.ts +4 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +6 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/react-dom.d.ts +2 -0
- package/dist/react-dom.d.ts.map +1 -0
- package/dist/react-dom.js +4 -0
- package/dist/react-dom.js.map +1 -0
- package/dist/react.d.ts +52 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +45 -0
- package/dist/react.js.map +1 -0
- package/dist/runtime.d.ts +13 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +15 -0
- package/dist/runtime.js.map +1 -0
- package/dist/ui.d.ts +154 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -0
- package/package.json +62 -0
- package/scripts/build-plugin.mjs +156 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @dotcraft/plugin
|
|
2
|
+
|
|
3
|
+
`@dotcraft/plugin` provides the public contracts, shared React runtime bindings, and build command for DotCraft Desktop Plugins.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install --save-dev @dotcraft/plugin
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Build
|
|
12
|
+
|
|
13
|
+
The `$plugin-creator` scaffold supplies the source layout and build script. From its `desktop/` directory, run:
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
npm run build
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The build writes the plugin module and imported assets to `dist/` for DotCraft to load.
|
|
20
|
+
|
|
21
|
+
## Links
|
|
22
|
+
|
|
23
|
+
- [Source repository](https://github.com/DotHarness/dotcraft)
|
|
24
|
+
- [Issues](https://github.com/DotHarness/dotcraft/issues)
|
|
25
|
+
- [License](./LICENSE)
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import type { AppConnectionStartResult, AppConnectionStatusResult, ClientRequestMethods, ServerNotificationMethods } from "@dotcraft/sdk/contracts";
|
|
2
|
+
import type { ComponentType, CSSProperties, ExoticComponent } from "react";
|
|
3
|
+
export type DesktopPluginDispose = () => void;
|
|
4
|
+
export interface DesktopPluginMetadata {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly version: string;
|
|
7
|
+
readonly displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DesktopPluginEnvironment {
|
|
10
|
+
readonly locale: string;
|
|
11
|
+
readonly theme: "light" | "dark";
|
|
12
|
+
}
|
|
13
|
+
export interface DesktopPluginNavigation {
|
|
14
|
+
openMainView(contributionId: string): void;
|
|
15
|
+
openSettingsPage(contributionId: string): void;
|
|
16
|
+
openThread(threadId: string, workspacePath?: string): Promise<void>;
|
|
17
|
+
onOpenUrl(listener: (url: string) => boolean): DesktopPluginDispose;
|
|
18
|
+
}
|
|
19
|
+
export interface DesktopPluginToastOptions {
|
|
20
|
+
readonly message: string;
|
|
21
|
+
readonly tone?: "neutral" | "success" | "warning" | "error";
|
|
22
|
+
readonly durationMs?: number;
|
|
23
|
+
readonly action?: {
|
|
24
|
+
readonly label: string;
|
|
25
|
+
readonly run: () => void;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface DesktopPluginUi {
|
|
29
|
+
showToast(options: DesktopPluginToastOptions): DesktopPluginDispose;
|
|
30
|
+
confirm(options: DesktopPluginConfirmOptions): Promise<boolean>;
|
|
31
|
+
}
|
|
32
|
+
export interface DesktopPluginConfirmOptions {
|
|
33
|
+
readonly title: string;
|
|
34
|
+
readonly message: string;
|
|
35
|
+
readonly confirmLabel?: string;
|
|
36
|
+
readonly cancelLabel?: string;
|
|
37
|
+
readonly danger?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface DesktopPluginAppServer {
|
|
40
|
+
request<M extends keyof ClientRequestMethods>(method: M, params: ClientRequestMethods[M]["params"], timeoutMs?: number): Promise<ClientRequestMethods[M]["result"]>;
|
|
41
|
+
onNotification<M extends keyof ServerNotificationMethods>(method: M, listener: (params: ServerNotificationMethods[M]["params"]) => void): DesktopPluginDispose;
|
|
42
|
+
}
|
|
43
|
+
export interface DesktopPluginAppBindings {
|
|
44
|
+
getConnectionStatus(appId: string): Promise<AppConnectionStatusResult>;
|
|
45
|
+
startConnection(appId: string): Promise<AppConnectionStartResult>;
|
|
46
|
+
openNativeApp(appId: string, url: string): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
export interface DesktopPluginAppSurfaces {
|
|
49
|
+
getJson<T = unknown>(appId: string, surfaceId: string, relativePath: string, timeoutMs?: number): Promise<T>;
|
|
50
|
+
postJson<T = unknown>(appId: string, surfaceId: string, relativePath: string, body: unknown, timeoutMs?: number): Promise<T>;
|
|
51
|
+
}
|
|
52
|
+
export interface DesktopPluginLocalProject {
|
|
53
|
+
readonly path: string;
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly active: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface DesktopPluginWorkspaceReader {
|
|
58
|
+
listLocalProjects(): Promise<readonly DesktopPluginLocalProject[]>;
|
|
59
|
+
}
|
|
60
|
+
export interface DesktopPluginOratorioContext {
|
|
61
|
+
readonly provider: "local" | "remote";
|
|
62
|
+
readonly workspacePath: string | null;
|
|
63
|
+
readonly connected: boolean;
|
|
64
|
+
readonly revision: number;
|
|
65
|
+
}
|
|
66
|
+
export interface DesktopPluginOratorioRequest {
|
|
67
|
+
readonly method: "GET" | "POST" | "PUT" | "PATCH";
|
|
68
|
+
readonly path: string;
|
|
69
|
+
readonly body?: Readonly<Record<string, unknown>>;
|
|
70
|
+
}
|
|
71
|
+
export interface DesktopPluginOratorioResponse<T = unknown> {
|
|
72
|
+
readonly status: number;
|
|
73
|
+
readonly data: T;
|
|
74
|
+
}
|
|
75
|
+
export interface DesktopPluginOratorioHandoffRequest {
|
|
76
|
+
readonly requestId: string;
|
|
77
|
+
readonly operation: "connect" | "bind";
|
|
78
|
+
readonly appId: string;
|
|
79
|
+
readonly workspacePath: string;
|
|
80
|
+
readonly summary: string;
|
|
81
|
+
}
|
|
82
|
+
export interface DesktopPluginOratorioBoardEvent {
|
|
83
|
+
readonly type: string;
|
|
84
|
+
readonly taskId?: string;
|
|
85
|
+
readonly shortId?: string;
|
|
86
|
+
readonly runId?: string;
|
|
87
|
+
readonly taskStatus?: string;
|
|
88
|
+
readonly microStatus?: string;
|
|
89
|
+
readonly boardSortOrder?: number;
|
|
90
|
+
readonly ts?: string;
|
|
91
|
+
readonly payload?: Readonly<{
|
|
92
|
+
type?: string;
|
|
93
|
+
status?: string;
|
|
94
|
+
text?: string;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
export interface DesktopPluginOratorioEvent {
|
|
98
|
+
readonly type: "context-changed" | "data-changed" | "board-event" | "handoff-requested";
|
|
99
|
+
readonly revision: number;
|
|
100
|
+
readonly event?: DesktopPluginOratorioBoardEvent;
|
|
101
|
+
readonly handoff?: DesktopPluginOratorioHandoffRequest;
|
|
102
|
+
}
|
|
103
|
+
export interface DesktopPluginOratorio {
|
|
104
|
+
getContext(): Promise<DesktopPluginOratorioContext>;
|
|
105
|
+
request<T = unknown>(request: DesktopPluginOratorioRequest): Promise<DesktopPluginOratorioResponse<T>>;
|
|
106
|
+
retry(): Promise<DesktopPluginOratorioContext>;
|
|
107
|
+
getPendingHandoff(): Promise<DesktopPluginOratorioHandoffRequest | null>;
|
|
108
|
+
resolveHandoff(requestId: string, approved: boolean): Promise<void>;
|
|
109
|
+
focusRun(runId: string | null): Promise<void>;
|
|
110
|
+
onEvent(listener: (event: DesktopPluginOratorioEvent) => void): DesktopPluginDispose;
|
|
111
|
+
}
|
|
112
|
+
export interface DesktopPluginHost {
|
|
113
|
+
readonly plugin: DesktopPluginMetadata;
|
|
114
|
+
readonly environment: DesktopPluginEnvironment;
|
|
115
|
+
readonly navigation: DesktopPluginNavigation;
|
|
116
|
+
readonly ui: DesktopPluginUi;
|
|
117
|
+
readonly appServer: DesktopPluginAppServer;
|
|
118
|
+
readonly appBindings: DesktopPluginAppBindings;
|
|
119
|
+
readonly appSurfaces: DesktopPluginAppSurfaces;
|
|
120
|
+
readonly workspaces: DesktopPluginWorkspaceReader;
|
|
121
|
+
readonly oratorio: DesktopPluginOratorio;
|
|
122
|
+
}
|
|
123
|
+
export interface DesktopLocalizedText {
|
|
124
|
+
readonly default: string;
|
|
125
|
+
readonly translations?: Readonly<Record<string, string>>;
|
|
126
|
+
}
|
|
127
|
+
export interface DesktopPluginIconProps {
|
|
128
|
+
readonly size?: number | string;
|
|
129
|
+
readonly strokeWidth?: number | string;
|
|
130
|
+
readonly "aria-hidden"?: boolean | "true" | "false";
|
|
131
|
+
readonly style?: CSSProperties;
|
|
132
|
+
}
|
|
133
|
+
export type DesktopPluginIconComponent = ComponentType<DesktopPluginIconProps> | ExoticComponent<DesktopPluginIconProps>;
|
|
134
|
+
export type DesktopPluginContributionIcon = string | DesktopPluginIconComponent;
|
|
135
|
+
export interface DesktopPluginViewProps {
|
|
136
|
+
readonly host: DesktopPluginHost;
|
|
137
|
+
readonly contributionId: string;
|
|
138
|
+
}
|
|
139
|
+
export interface DesktopPluginConversationViewProps extends DesktopPluginViewProps {
|
|
140
|
+
readonly threadId: string;
|
|
141
|
+
}
|
|
142
|
+
export interface DesktopPluginCommandContext {
|
|
143
|
+
readonly workspacePath: string | null;
|
|
144
|
+
readonly threadId: string | null;
|
|
145
|
+
readonly viewId: string;
|
|
146
|
+
}
|
|
147
|
+
export interface DesktopPluginComposerActionContext {
|
|
148
|
+
readonly workspacePath: string | null;
|
|
149
|
+
readonly threadId: string;
|
|
150
|
+
readonly mode: "agent" | "plan";
|
|
151
|
+
readonly busy: boolean;
|
|
152
|
+
readonly awaitingApproval: boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface DesktopPluginComposerActionProps extends DesktopPluginViewProps {
|
|
155
|
+
readonly context: DesktopPluginComposerActionContext;
|
|
156
|
+
}
|
|
157
|
+
export interface DesktopPluginAssistantMessageModel {
|
|
158
|
+
readonly id: string;
|
|
159
|
+
readonly threadId: string;
|
|
160
|
+
readonly turnId: string;
|
|
161
|
+
readonly text: string;
|
|
162
|
+
readonly createdAt?: string;
|
|
163
|
+
}
|
|
164
|
+
export interface DesktopPluginToolPresentationModel {
|
|
165
|
+
readonly id: string;
|
|
166
|
+
readonly threadId: string | null;
|
|
167
|
+
readonly turnId: string;
|
|
168
|
+
readonly presentationId: string;
|
|
169
|
+
readonly options: Readonly<Record<string, unknown>>;
|
|
170
|
+
readonly toolName: string;
|
|
171
|
+
readonly status: "running" | "completed";
|
|
172
|
+
readonly arguments?: Readonly<Record<string, unknown>>;
|
|
173
|
+
readonly result?: string;
|
|
174
|
+
readonly success?: boolean;
|
|
175
|
+
readonly createdAt: string;
|
|
176
|
+
readonly completedAt?: string;
|
|
177
|
+
}
|
|
178
|
+
export interface DesktopPluginToolRendererProps extends DesktopPluginViewProps {
|
|
179
|
+
readonly presentation: DesktopPluginToolPresentationModel;
|
|
180
|
+
}
|
|
181
|
+
interface DesktopPluginViewContribution {
|
|
182
|
+
readonly id: string;
|
|
183
|
+
readonly label: DesktopLocalizedText;
|
|
184
|
+
readonly icon?: DesktopPluginContributionIcon;
|
|
185
|
+
readonly order?: number;
|
|
186
|
+
readonly component: ComponentType<DesktopPluginViewProps>;
|
|
187
|
+
}
|
|
188
|
+
export type DesktopPluginMainViewContribution = DesktopPluginViewContribution;
|
|
189
|
+
export type DesktopPluginSettingsPageContribution = DesktopPluginViewContribution;
|
|
190
|
+
export interface DesktopPluginConversationViewContribution {
|
|
191
|
+
readonly id: string;
|
|
192
|
+
readonly label: DesktopLocalizedText;
|
|
193
|
+
readonly icon?: DesktopPluginContributionIcon;
|
|
194
|
+
readonly order?: number;
|
|
195
|
+
readonly component: ComponentType<DesktopPluginConversationViewProps>;
|
|
196
|
+
}
|
|
197
|
+
export interface DesktopPluginCommandContribution {
|
|
198
|
+
readonly id: string;
|
|
199
|
+
readonly label: DesktopLocalizedText;
|
|
200
|
+
readonly description?: DesktopLocalizedText;
|
|
201
|
+
readonly icon?: DesktopPluginContributionIcon;
|
|
202
|
+
readonly order?: number;
|
|
203
|
+
readonly isAvailable?: (context: DesktopPluginCommandContext) => boolean;
|
|
204
|
+
readonly execute: (context: DesktopPluginCommandContext, host: DesktopPluginHost) => void | Promise<void>;
|
|
205
|
+
}
|
|
206
|
+
export interface DesktopPluginToolRendererContribution {
|
|
207
|
+
readonly id: string;
|
|
208
|
+
readonly presentationId: string;
|
|
209
|
+
readonly priority?: number;
|
|
210
|
+
readonly component: ComponentType<DesktopPluginToolRendererProps>;
|
|
211
|
+
}
|
|
212
|
+
export interface DesktopPluginComposerActionContribution {
|
|
213
|
+
readonly id: string;
|
|
214
|
+
readonly label: DesktopLocalizedText;
|
|
215
|
+
readonly icon?: DesktopPluginContributionIcon;
|
|
216
|
+
readonly order?: number;
|
|
217
|
+
readonly isAvailable?: (context: DesktopPluginComposerActionContext) => boolean;
|
|
218
|
+
readonly component: ComponentType<DesktopPluginComposerActionProps>;
|
|
219
|
+
}
|
|
220
|
+
export interface DesktopPluginMessageActionContribution {
|
|
221
|
+
readonly id: string;
|
|
222
|
+
readonly label: DesktopLocalizedText;
|
|
223
|
+
readonly icon?: DesktopPluginContributionIcon;
|
|
224
|
+
readonly order?: number;
|
|
225
|
+
readonly isAvailable?: (message: DesktopPluginAssistantMessageModel) => boolean;
|
|
226
|
+
readonly execute: (message: DesktopPluginAssistantMessageModel, host: DesktopPluginHost) => void | Promise<void>;
|
|
227
|
+
}
|
|
228
|
+
export interface DesktopPluginActivation {
|
|
229
|
+
readonly mainViews?: readonly DesktopPluginMainViewContribution[];
|
|
230
|
+
readonly settingsPages?: readonly DesktopPluginSettingsPageContribution[];
|
|
231
|
+
readonly conversationViews?: readonly DesktopPluginConversationViewContribution[];
|
|
232
|
+
readonly commands?: readonly DesktopPluginCommandContribution[];
|
|
233
|
+
readonly toolRenderers?: readonly DesktopPluginToolRendererContribution[];
|
|
234
|
+
readonly composerActions?: readonly DesktopPluginComposerActionContribution[];
|
|
235
|
+
readonly messageActions?: readonly DesktopPluginMessageActionContribution[];
|
|
236
|
+
readonly dispose?: () => void | Promise<void>;
|
|
237
|
+
}
|
|
238
|
+
export type DesktopPluginActivate = (host: DesktopPluginHost) => DesktopPluginActivation | Promise<DesktopPluginActivation>;
|
|
239
|
+
export {};
|
|
240
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../src/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAE3E,MAAM,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC;AAE9C,MAAM,WAAW,qBAA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alizedText, DesktopPluginActivate, DesktopPluginActivation, DesktopPluginAppBindings, DesktopPluginAppServer, DesktopPluginAppSurfaces, DesktopPluginAssistantMessageModel, DesktopPluginCommandContext, DesktopPluginCommandContribution, DesktopPluginConfirmOptions, DesktopPluginComposerActionContext, DesktopPluginComposerActionContribution, DesktopPluginComposerActionProps, DesktopPluginConversationViewContribution, DesktopPluginConversationViewProps, DesktopPluginDispose, DesktopPluginEnvironment, DesktopPluginHost, DesktopPluginContributionIcon, DesktopPluginIconComponent, DesktopPluginIconProps, DesktopPluginLocalProject, DesktopPluginMetadata, DesktopPluginMainViewContribution, DesktopPluginNavigation, DesktopPluginOratorio, DesktopPluginOratorioBoardEvent, DesktopPluginOratorioContext, DesktopPluginOratorioEvent, DesktopPluginOratorioHandoffRequest, DesktopPluginOratorioRequest, DesktopPluginOratorioResponse, DesktopPluginSettingsPageContribution, DesktopPluginMessageActionContribution, DesktopPluginToolPresentationModel, DesktopPluginToolRendererContribution, DesktopPluginToolRendererProps, DesktopPluginToastOptions, DesktopPluginUi, DesktopPluginViewProps, DesktopPluginWorkspaceReader, } from "./contracts.js";
|
|
2
|
+
export type { ActionTooltipProps, ButtonProps, ButtonSize, ButtonVariant, CheckboxProps, ComboboxOption, ComboboxProps, DesktopPluginUiComponents, DesktopSelectComponent, FieldSize, IconButtonProps, InlineDiffProps, InputProps, ModalHeaderProps, PillSwitchProps, SelectOption, SelectProps, SkeletonProps, SpinnerProps, SettingsBreadcrumbProps, SettingsGroupProps, SettingsPanelShellProps, SettingsRowProps, TextareaProps, } from "./ui.js";
|
|
3
|
+
export declare const Button: import("react").ComponentType<import("./ui.js").ButtonProps>;
|
|
4
|
+
export declare const IconButton: import("react").ComponentType<import("./ui.js").IconButtonProps>;
|
|
5
|
+
export declare const Input: import("react").ComponentType<import("./ui.js").InputProps>;
|
|
6
|
+
export declare const Textarea: import("react").ComponentType<import("./ui.js").TextareaProps>;
|
|
7
|
+
export declare const Select: import("./ui.js").DesktopSelectComponent;
|
|
8
|
+
export declare const Checkbox: import("react").ComponentType<import("./ui.js").CheckboxProps>;
|
|
9
|
+
export declare const Spinner: import("react").ComponentType<import("./ui.js").SpinnerProps>;
|
|
10
|
+
export declare const Skeleton: import("react").ComponentType<import("./ui.js").SkeletonProps>;
|
|
11
|
+
export declare const ActionTooltip: import("react").ComponentType<import("./ui.js").ActionTooltipProps>;
|
|
12
|
+
export declare const Combobox: import("react").ComponentType<import("./ui.js").ComboboxProps>;
|
|
13
|
+
export declare const ModalHeader: import("react").ComponentType<import("./ui.js").ModalHeaderProps>;
|
|
14
|
+
export declare const PillSwitch: import("react").ComponentType<import("./ui.js").PillSwitchProps>;
|
|
15
|
+
export declare const SettingsPanelShell: import("react").ComponentType<import("./ui.js").SettingsPanelShellProps>;
|
|
16
|
+
export declare const SettingsBreadcrumb: import("react").ComponentType<import("./ui.js").SettingsBreadcrumbProps>;
|
|
17
|
+
export declare const SettingsGroup: import("react").ComponentType<import("./ui.js").SettingsGroupProps>;
|
|
18
|
+
export declare const SettingsRow: import("react").ComponentType<import("./ui.js").SettingsRowProps>;
|
|
19
|
+
export declare const InlineDiff: import("react").ComponentType<import("./ui.js").InlineDiffProps>;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,kCAAkC,EAClC,2BAA2B,EAC3B,gCAAgC,EAChC,2BAA2B,EAC3B,kCAAkC,EAClC,uCAAuC,EACvC,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,iCAAiC,EAC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AO,MAAM,UAAU,kEAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readDesktopPluginRuntime } from "./runtime.js";
|
|
2
|
+
const ui = readDesktopPluginRuntime().ui;
|
|
3
|
+
export const Button = ui.Button;
|
|
4
|
+
export const IconButton = ui.IconButton;
|
|
5
|
+
export const Input = ui.Input;
|
|
6
|
+
export const Textarea = ui.Textarea;
|
|
7
|
+
export const Select = ui.Select;
|
|
8
|
+
export const Checkbox = ui.Checkbox;
|
|
9
|
+
export const Spinner = ui.Spinner;
|
|
10
|
+
export const Skeleton = ui.Skeleton;
|
|
11
|
+
export const ActionTooltip = ui.ActionTooltip;
|
|
12
|
+
export const Combobox = ui.Combobox;
|
|
13
|
+
export const ModalHeader = ui.ModalHeader;
|
|
14
|
+
export const PillSwitch = ui.PillSwitch;
|
|
15
|
+
export const SettingsPanelShell = ui.SettingsPanelShell;
|
|
16
|
+
export const SettingsBreadcrumb = ui.SettingsBreadcrumb;
|
|
17
|
+
export const SettingsGroup = ui.SettingsGroup;
|
|
18
|
+
export const SettingsRow = ui.SettingsRow;
|
|
19
|
+
export const InlineDiff = ui.InlineDiff;
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,EAAE,GAAG,wBAAwB,EAAE,CAAC,EAAE,CAAC;AAEzC,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;AAChC,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AACxC,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;AAC9B,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AACpC,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;AAChC,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AACpC,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC;AAClC,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AACpC,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC,aAAa,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AACxC,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAC,kBAAkB,CAAC;AACxD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC,aAAa,CAAC;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC;AAC1C,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const Fragment: import("react").ExoticComponent<import("react").FragmentProps>;
|
|
2
|
+
export declare const jsx: typeof import("react/jsx-runtime").jsx;
|
|
3
|
+
export declare const jsxs: typeof import("react/jsx-runtime").jsxs;
|
|
4
|
+
//# sourceMappingURL=jsx-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,gEAAmB,CAAC;AACzC,eAAO,MAAM,GAAG,wCAAc,CAAC;AAC/B,eAAO,MAAM,IAAI,yCAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,OAAO,GAAG,wBAAwB,EAAE,CAAC,UAAU,CAAC;AAEtD,MAAM,CAAC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AACzC,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AAC/B,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom.d.ts","sourceRoot":"","sources":["../src/react-dom.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,yCAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-dom.js","sourceRoot":"","sources":["../src/react-dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,OAAO,GAAG,wBAAwB,EAAE,CAAC,QAAQ,CAAC;AAEpD,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC"}
|
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
declare const React: typeof import("react");
|
|
2
|
+
export default React;
|
|
3
|
+
export declare const Activity: import("react").ExoticComponent<import("react").ActivityProps>;
|
|
4
|
+
export declare const Children: {
|
|
5
|
+
map<T, C>(children: C | readonly C[], fn: (child: C, index: number) => T): C extends null | undefined ? C : Array<Exclude<T, boolean | null | undefined>>;
|
|
6
|
+
forEach<C>(children: C | readonly C[], fn: (child: C, index: number) => void): void;
|
|
7
|
+
count(children: any): number;
|
|
8
|
+
only<C>(children: C): C extends any[] ? never : C;
|
|
9
|
+
toArray(children: import("react").ReactNode | import("react").ReactNode[]): Array<Exclude<import("react").ReactNode, boolean | null | undefined>>;
|
|
10
|
+
};
|
|
11
|
+
export declare const Component: typeof import("react").Component;
|
|
12
|
+
export declare const Fragment: import("react").ExoticComponent<import("react").FragmentProps>;
|
|
13
|
+
export declare const Profiler: import("react").ExoticComponent<import("react").ProfilerProps>;
|
|
14
|
+
export declare const PureComponent: typeof import("react").PureComponent;
|
|
15
|
+
export declare const StrictMode: import("react").ExoticComponent<{
|
|
16
|
+
children?: import("react").ReactNode | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const Suspense: import("react").ExoticComponent<import("react").SuspenseProps>;
|
|
19
|
+
export declare const act: typeof import("react").act;
|
|
20
|
+
export declare const cache: typeof import("react").cache;
|
|
21
|
+
export declare const cacheSignal: typeof import("react").cacheSignal;
|
|
22
|
+
export declare const captureOwnerStack: typeof import("react").captureOwnerStack;
|
|
23
|
+
export declare const cloneElement: typeof import("react").cloneElement;
|
|
24
|
+
export declare const createContext: typeof import("react").createContext;
|
|
25
|
+
export declare const createElement: typeof import("react").createElement;
|
|
26
|
+
export declare const createRef: typeof import("react").createRef;
|
|
27
|
+
export declare const forwardRef: typeof import("react").forwardRef;
|
|
28
|
+
export declare const isValidElement: typeof import("react").isValidElement;
|
|
29
|
+
export declare const lazy: typeof import("react").lazy;
|
|
30
|
+
export declare const memo: typeof import("react").memo;
|
|
31
|
+
export declare const startTransition: typeof import("react").startTransition;
|
|
32
|
+
export declare const use: typeof import("react").use;
|
|
33
|
+
export declare const useActionState: typeof import("react").useActionState;
|
|
34
|
+
export declare const useCallback: typeof import("react").useCallback;
|
|
35
|
+
export declare const useContext: typeof import("react").useContext;
|
|
36
|
+
export declare const useDebugValue: typeof import("react").useDebugValue;
|
|
37
|
+
export declare const useDeferredValue: typeof import("react").useDeferredValue;
|
|
38
|
+
export declare const useEffect: typeof import("react").useEffect;
|
|
39
|
+
export declare const useEffectEvent: typeof import("react").useEffectEvent;
|
|
40
|
+
export declare const useId: typeof import("react").useId;
|
|
41
|
+
export declare const useImperativeHandle: typeof import("react").useImperativeHandle;
|
|
42
|
+
export declare const useInsertionEffect: typeof import("react").useInsertionEffect;
|
|
43
|
+
export declare const useLayoutEffect: typeof import("react").useLayoutEffect;
|
|
44
|
+
export declare const useMemo: typeof import("react").useMemo;
|
|
45
|
+
export declare const useOptimistic: typeof import("react").useOptimistic;
|
|
46
|
+
export declare const useReducer: typeof import("react").useReducer;
|
|
47
|
+
export declare const useRef: typeof import("react").useRef;
|
|
48
|
+
export declare const useState: typeof import("react").useState;
|
|
49
|
+
export declare const useSyncExternalStore: typeof import("react").useSyncExternalStore;
|
|
50
|
+
export declare const useTransition: typeof import("react").useTransition;
|
|
51
|
+
export declare const version: string;
|
|
52
|
+
//# sourceMappingURL=react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,KAAK,wBAAmC,CAAC;AAE/C,eAAe,KAAK,CAAC;AACrB,eAAO,MAAM,QAAQ,gEAAiB,CAAC;AACvC,eAAO,MAAM,QAAQ;;;;;;CAAiB,CAAC;AACvC,eAAO,MAAM,SAAS,kCAAkB,CAAC;AACzC,eAAO,MAAM,QAAQ,gEAAiB,CAAC;AACvC,eAAO,MAAM,QAAQ,gEAAiB,CAAC;AACvC,eAAO,MAAM,aAAa,sCAAsB,CAAC;AACjD,eAAO,MAAM,UAAU;;EAAmB,CAAC;AAC3C,eAAO,MAAM,QAAQ,gEAAiB,CAAC;AACvC,eAAO,MAAM,GAAG,4BAAY,CAAC;AAC7B,eAAO,MAAM,KAAK,8BAAc,CAAC;AACjC,eAAO,MAAM,WAAW,oCAAoB,CAAC;AAC7C,eAAO,MAAM,iBAAiB,0CAA0B,CAAC;AACzD,eAAO,MAAM,YAAY,qCAAqB,CAAC;AAC/C,eAAO,MAAM,aAAa,sCAAsB,CAAC;AACjD,eAAO,MAAM,aAAa,sCAAsB,CAAC;AACjD,eAAO,MAAM,SAAS,kCAAkB,CAAC;AACzC,eAAO,MAAM,UAAU,mCAAmB,CAAC;AAC3C,eAAO,MAAM,cAAc,uCAAuB,CAAC;AACnD,eAAO,MAAM,IAAI,6BAAa,CAAC;AAC/B,eAAO,MAAM,IAAI,6BAAa,CAAC;AAC/B,eAAO,MAAM,eAAe,wCAAwB,CAAC;AACrD,eAAO,MAAM,GAAG,4BAAY,CAAC;AAC7B,eAAO,MAAM,cAAc,uCAAuB,CAAC;AACnD,eAAO,MAAM,WAAW,oCAAoB,CAAC;AAC7C,eAAO,MAAM,UAAU,mCAAmB,CAAC;AAC3C,eAAO,MAAM,aAAa,sCAAsB,CAAC;AACjD,eAAO,MAAM,gBAAgB,yCAAyB,CAAC;AACvD,eAAO,MAAM,SAAS,kCAAkB,CAAC;AACzC,eAAO,MAAM,cAAc,uCAAuB,CAAC;AACnD,eAAO,MAAM,KAAK,8BAAc,CAAC;AACjC,eAAO,MAAM,mBAAmB,4CAA4B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,2CAA2B,CAAC;AAC3D,eAAO,MAAM,eAAe,wCAAwB,CAAC;AACrD,eAAO,MAAM,OAAO,gCAAgB,CAAC;AACrC,eAAO,MAAM,aAAa,sCAAsB,CAAC;AACjD,eAAO,MAAM,UAAU,mCAAmB,CAAC;AAC3C,eAAO,MAAM,MAAM,+BAAe,CAAC;AACnC,eAAO,MAAM,QAAQ,iCAAiB,CAAC;AACvC,eAAO,MAAM,oBAAoB,6CAA6B,CAAC;AAC/D,eAAO,MAAM,aAAa,sCAAsB,CAAC;AACjD,eAAO,MAAM,OAAO,QAAgB,CAAC"}
|
package/dist/react.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { readDesktopPluginRuntime } from "./runtime.js";
|
|
2
|
+
const React = readDesktopPluginRuntime().react;
|
|
3
|
+
export default React;
|
|
4
|
+
export const Activity = React.Activity;
|
|
5
|
+
export const Children = React.Children;
|
|
6
|
+
export const Component = React.Component;
|
|
7
|
+
export const Fragment = React.Fragment;
|
|
8
|
+
export const Profiler = React.Profiler;
|
|
9
|
+
export const PureComponent = React.PureComponent;
|
|
10
|
+
export const StrictMode = React.StrictMode;
|
|
11
|
+
export const Suspense = React.Suspense;
|
|
12
|
+
export const act = React.act;
|
|
13
|
+
export const cache = React.cache;
|
|
14
|
+
export const cacheSignal = React.cacheSignal;
|
|
15
|
+
export const captureOwnerStack = React.captureOwnerStack;
|
|
16
|
+
export const cloneElement = React.cloneElement;
|
|
17
|
+
export const createContext = React.createContext;
|
|
18
|
+
export const createElement = React.createElement;
|
|
19
|
+
export const createRef = React.createRef;
|
|
20
|
+
export const forwardRef = React.forwardRef;
|
|
21
|
+
export const isValidElement = React.isValidElement;
|
|
22
|
+
export const lazy = React.lazy;
|
|
23
|
+
export const memo = React.memo;
|
|
24
|
+
export const startTransition = React.startTransition;
|
|
25
|
+
export const use = React.use;
|
|
26
|
+
export const useActionState = React.useActionState;
|
|
27
|
+
export const useCallback = React.useCallback;
|
|
28
|
+
export const useContext = React.useContext;
|
|
29
|
+
export const useDebugValue = React.useDebugValue;
|
|
30
|
+
export const useDeferredValue = React.useDeferredValue;
|
|
31
|
+
export const useEffect = React.useEffect;
|
|
32
|
+
export const useEffectEvent = React.useEffectEvent;
|
|
33
|
+
export const useId = React.useId;
|
|
34
|
+
export const useImperativeHandle = React.useImperativeHandle;
|
|
35
|
+
export const useInsertionEffect = React.useInsertionEffect;
|
|
36
|
+
export const useLayoutEffect = React.useLayoutEffect;
|
|
37
|
+
export const useMemo = React.useMemo;
|
|
38
|
+
export const useOptimistic = React.useOptimistic;
|
|
39
|
+
export const useReducer = React.useReducer;
|
|
40
|
+
export const useRef = React.useRef;
|
|
41
|
+
export const useState = React.useState;
|
|
42
|
+
export const useSyncExternalStore = React.useSyncExternalStore;
|
|
43
|
+
export const useTransition = React.useTransition;
|
|
44
|
+
export const version = React.version;
|
|
45
|
+
//# sourceMappingURL=react.js.map
|
|
@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AG,KAAK,CAAC,MAAM,CAAC;AACnC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC,oBAAoB,CAAC;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import type * as ReactDom from "react-dom";
|
|
3
|
+
import type * as JsxRuntime from "react/jsx-runtime";
|
|
4
|
+
import type { DesktopPluginUiComponents } from "./ui.js";
|
|
5
|
+
export interface DesktopPluginRuntime {
|
|
6
|
+
readonly react: typeof React;
|
|
7
|
+
readonly jsxRuntime: typeof JsxRuntime;
|
|
8
|
+
readonly reactDom: Pick<typeof ReactDom, "createPortal">;
|
|
9
|
+
readonly ui: DesktopPluginUiComponents;
|
|
10
|
+
}
|
|
11
|
+
export declare function installDesktopPluginRuntime(runtime: DesktopPluginRuntime): void;
|
|
12
|
+
export declare function readDesktopPluginRuntime(): DesktopPluginRuntime;
|
|
13
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,QAAQ,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,KAAK,UAAU,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAIzD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,OAAO,UAAU,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,QAAQ,EAAE,cAAc,CAAC,CAAC;IACzD,QAAQ,CAAC,EAAE,EAAE,yBAAyB,CAAC;CACxC;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAE/E;AAED,wBAAgB,wBAAwB,IAAI,oBAAoB,CAM/D"}
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const runtimeKey = Symbol.for("dotcraft.desktop-plugin.runtime");
|
|
2
|
+
export function installDesktopPluginRuntime(runtime) {
|
|
3
|
+
runtimeGlobal()[runtimeKey] = runtime;
|
|
4
|
+
}
|
|
5
|
+
export function readDesktopPluginRuntime() {
|
|
6
|
+
const runtime = runtimeGlobal()[runtimeKey];
|
|
7
|
+
if (!runtime) {
|
|
8
|
+
throw new Error("DotCraft Desktop Plugin runtime is not installed.");
|
|
9
|
+
}
|
|
10
|
+
return runtime;
|
|
11
|
+
}
|
|
12
|
+
function runtimeGlobal() {
|
|
13
|
+
return globalThis;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AASjE,MAAM,UAAU,2BAA2B,CAAC,OAA6B;IACvE,aAAa,EAAE,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC,UAAU,CAAC,CAAC;IAC5C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,aAAa;IACpB,OAAO,UAAkF,CAAC;AAC5F,CAAC"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ComponentType, CSSProperties, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from "react";
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "accent" | "outline";
|
|
3
|
+
export type ButtonSize = "default" | "sm" | "icon" | "iconSm" | "prominent" | "toolbar";
|
|
4
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
readonly variant?: ButtonVariant;
|
|
6
|
+
readonly size?: ButtonSize;
|
|
7
|
+
readonly iconLeft?: ReactNode;
|
|
8
|
+
readonly loading?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
11
|
+
readonly icon: ReactNode;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly size?: number;
|
|
14
|
+
readonly active?: boolean;
|
|
15
|
+
readonly tone?: "neutral" | "danger";
|
|
16
|
+
readonly bordered?: boolean;
|
|
17
|
+
readonly tooltipLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
export type FieldSize = "default" | "toolbar";
|
|
20
|
+
interface SharedFieldProps {
|
|
21
|
+
readonly size?: FieldSize;
|
|
22
|
+
readonly frameless?: boolean;
|
|
23
|
+
readonly bare?: boolean;
|
|
24
|
+
readonly invalid?: boolean;
|
|
25
|
+
readonly mono?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, SharedFieldProps {
|
|
28
|
+
}
|
|
29
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, SharedFieldProps {
|
|
30
|
+
}
|
|
31
|
+
export interface SelectOption<T extends string = string> {
|
|
32
|
+
readonly value: T;
|
|
33
|
+
readonly label: ReactNode;
|
|
34
|
+
readonly description?: ReactNode;
|
|
35
|
+
readonly icon?: ReactNode;
|
|
36
|
+
readonly disabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface SelectProps<T extends string = string> {
|
|
39
|
+
readonly id?: string;
|
|
40
|
+
readonly value: T;
|
|
41
|
+
readonly options: readonly SelectOption<T>[];
|
|
42
|
+
readonly onValueChange: (value: T) => void | boolean | Promise<void | boolean>;
|
|
43
|
+
readonly ariaLabel?: string;
|
|
44
|
+
readonly disabled?: boolean;
|
|
45
|
+
readonly style?: CSSProperties;
|
|
46
|
+
readonly appearance?: "field" | "frameless";
|
|
47
|
+
readonly adaptiveWidth?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface CheckboxProps {
|
|
50
|
+
readonly id?: string;
|
|
51
|
+
readonly checked: boolean;
|
|
52
|
+
readonly onChange: (checked: boolean) => void;
|
|
53
|
+
readonly disabled?: boolean;
|
|
54
|
+
readonly label?: ReactNode;
|
|
55
|
+
readonly ariaLabel?: string;
|
|
56
|
+
readonly style?: CSSProperties;
|
|
57
|
+
}
|
|
58
|
+
export interface SpinnerProps {
|
|
59
|
+
readonly size?: number;
|
|
60
|
+
readonly label?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SkeletonProps {
|
|
63
|
+
readonly width?: number | string;
|
|
64
|
+
readonly height?: number | string;
|
|
65
|
+
readonly radius?: number | string;
|
|
66
|
+
readonly circle?: boolean;
|
|
67
|
+
readonly style?: CSSProperties;
|
|
68
|
+
}
|
|
69
|
+
export interface ActionTooltipProps {
|
|
70
|
+
readonly label: string;
|
|
71
|
+
readonly multiline?: boolean;
|
|
72
|
+
readonly children: ReactNode;
|
|
73
|
+
}
|
|
74
|
+
export interface ComboboxOption {
|
|
75
|
+
readonly value: string;
|
|
76
|
+
readonly label: string;
|
|
77
|
+
}
|
|
78
|
+
export interface ComboboxProps {
|
|
79
|
+
readonly value: string;
|
|
80
|
+
readonly options: readonly ComboboxOption[];
|
|
81
|
+
readonly onValueChange: (value: string) => void;
|
|
82
|
+
readonly ariaLabel?: string;
|
|
83
|
+
readonly placeholder?: string;
|
|
84
|
+
readonly disabled?: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface ModalHeaderProps {
|
|
87
|
+
readonly icon: ReactNode;
|
|
88
|
+
readonly title: string;
|
|
89
|
+
readonly titleId?: string;
|
|
90
|
+
readonly description?: ReactNode;
|
|
91
|
+
readonly onClose?: () => void;
|
|
92
|
+
readonly closeLabel?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface PillSwitchProps {
|
|
95
|
+
readonly checked: boolean;
|
|
96
|
+
readonly onChange: (checked: boolean) => void;
|
|
97
|
+
readonly disabled?: boolean;
|
|
98
|
+
readonly "aria-label"?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface SettingsPanelShellProps {
|
|
101
|
+
readonly title: ReactNode;
|
|
102
|
+
readonly description?: ReactNode;
|
|
103
|
+
readonly action?: ReactNode;
|
|
104
|
+
readonly breadcrumb?: ReactNode;
|
|
105
|
+
readonly children: ReactNode;
|
|
106
|
+
}
|
|
107
|
+
export interface SettingsBreadcrumbProps {
|
|
108
|
+
readonly parentLabel: string;
|
|
109
|
+
readonly currentLabel: string;
|
|
110
|
+
readonly onBack: () => void;
|
|
111
|
+
}
|
|
112
|
+
export interface SettingsGroupProps {
|
|
113
|
+
readonly title?: string;
|
|
114
|
+
readonly description?: ReactNode;
|
|
115
|
+
readonly headerAction?: ReactNode;
|
|
116
|
+
readonly children: ReactNode;
|
|
117
|
+
}
|
|
118
|
+
export interface SettingsRowProps {
|
|
119
|
+
readonly label?: ReactNode;
|
|
120
|
+
readonly description?: ReactNode;
|
|
121
|
+
readonly control?: ReactNode;
|
|
122
|
+
readonly controlMinWidth?: number | string;
|
|
123
|
+
readonly children?: ReactNode;
|
|
124
|
+
}
|
|
125
|
+
export interface InlineDiffProps {
|
|
126
|
+
readonly filePath: string;
|
|
127
|
+
readonly line: number;
|
|
128
|
+
readonly before: string;
|
|
129
|
+
readonly after: string;
|
|
130
|
+
}
|
|
131
|
+
export interface DesktopSelectComponent {
|
|
132
|
+
<T extends string = string>(props: SelectProps<T>): ReactNode;
|
|
133
|
+
}
|
|
134
|
+
export interface DesktopPluginUiComponents {
|
|
135
|
+
readonly Button: ComponentType<ButtonProps>;
|
|
136
|
+
readonly IconButton: ComponentType<IconButtonProps>;
|
|
137
|
+
readonly Input: ComponentType<InputProps>;
|
|
138
|
+
readonly Textarea: ComponentType<TextareaProps>;
|
|
139
|
+
readonly Select: DesktopSelectComponent;
|
|
140
|
+
readonly Checkbox: ComponentType<CheckboxProps>;
|
|
141
|
+
readonly Spinner: ComponentType<SpinnerProps>;
|
|
142
|
+
readonly Skeleton: ComponentType<SkeletonProps>;
|
|
143
|
+
readonly ActionTooltip: ComponentType<ActionTooltipProps>;
|
|
144
|
+
readonly Combobox: ComponentType<ComboboxProps>;
|
|
145
|
+
readonly ModalHeader: ComponentType<ModalHeaderProps>;
|
|
146
|
+
readonly PillSwitch: ComponentType<PillSwitchProps>;
|
|
147
|
+
readonly SettingsPanelShell: ComponentType<SettingsPanelShellProps>;
|
|
148
|
+
readonly SettingsBreadcrumb: ComponentType<SettingsBreadcrumbProps>;
|
|
149
|
+
readonly SettingsGroup: ComponentType<SettingsGroupProps>;
|
|
150
|
+
readonly SettingsRow: ComponentType<SettingsRowProps>;
|
|
151
|
+
readonly InlineDiff: ComponentType<InlineDiffProps>;
|
|
152
|
+
}
|
|
153
|
+
export {};
|
|
154
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,sBAAsB,EACvB,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAA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a,CAAC,aAAa,CAAC,CAAC;IAChD,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC1D,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAChD,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACpD,QAAQ,CAAC,kBAAkB,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IACpE,QAAQ,CAAC,kBAAkB,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IACpE,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC1D,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACtD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACrD"}
|
package/dist/ui.js
ADDED
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dotcraft/plugin",
|
|
3
|
+
"version": "0.5.9",
|
|
4
|
+
"description": "TypeScript and React authoring tools for DotCraft Plugin desktop modules",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/DotHarness/dotcraft.git",
|
|
8
|
+
"directory": "sdk/typescript/packages/plugin"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/DotHarness/dotcraft/tree/main/sdk/typescript/packages/plugin",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/DotHarness/dotcraft/issues"
|
|
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
|
+
"./runtime": {
|
|
23
|
+
"types": "./dist/runtime.d.ts",
|
|
24
|
+
"import": "./dist/runtime.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"bin": {
|
|
28
|
+
"dotcraft-plugin": "scripts/build-plugin.mjs"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"scripts/build-plugin.mjs"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "node ../../scripts/clean-dist.mjs . && tsc -p tsconfig.json",
|
|
36
|
+
"build:plugin": "node scripts/build-plugin.mjs build",
|
|
37
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
38
|
+
"test": "npm run build && node --test scripts/runtime.test.mjs && node scripts/build-plugin.test.mjs"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@dotcraft/sdk": "0.5.9",
|
|
42
|
+
"esbuild": "^0.25.11"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"react": "^19.0.0",
|
|
46
|
+
"react-dom": "^19.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^22.10.0",
|
|
50
|
+
"@types/react": "^19.0.0",
|
|
51
|
+
"@types/react-dom": "^19.0.0",
|
|
52
|
+
"typescript": "^5.7.0"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=20"
|
|
56
|
+
},
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public",
|
|
59
|
+
"registry": "https://registry.npmjs.org"
|
|
60
|
+
},
|
|
61
|
+
"license": "Apache-2.0"
|
|
62
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync } from "node:fs";
|
|
4
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { build } from "esbuild";
|
|
7
|
+
|
|
8
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
9
|
+
const proxyEntries = new Map([
|
|
10
|
+
["@dotcraft/plugin", join(packageRoot, "dist", "index.js")],
|
|
11
|
+
["react", join(packageRoot, "dist", "react.js")],
|
|
12
|
+
["react/jsx-runtime", join(packageRoot, "dist", "jsx-runtime.js")],
|
|
13
|
+
["react-dom", join(packageRoot, "dist", "react-dom.js")],
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
async function buildDesktopPlugin(projectRoot = process.cwd()) {
|
|
17
|
+
const root = resolve(projectRoot);
|
|
18
|
+
const entry = join(root, "src", "index.tsx");
|
|
19
|
+
const outdir = join(root, "dist");
|
|
20
|
+
if (!existsSync(entry)) {
|
|
21
|
+
throw new Error("Desktop Plugin entry not found: src/index.tsx");
|
|
22
|
+
}
|
|
23
|
+
for (const proxy of proxyEntries.values()) {
|
|
24
|
+
if (!existsSync(proxy)) {
|
|
25
|
+
throw new Error("Build @dotcraft/plugin before building a Desktop Plugin.");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const staging = mkdtempSync(join(root, ".desktop-plugin-dist-"));
|
|
30
|
+
try {
|
|
31
|
+
const result = await build({
|
|
32
|
+
absWorkingDir: root,
|
|
33
|
+
entryPoints: [entry],
|
|
34
|
+
outdir: staging,
|
|
35
|
+
entryNames: "index",
|
|
36
|
+
chunkNames: "chunks/[name]-[hash]",
|
|
37
|
+
assetNames: "assets/[name]-[hash]",
|
|
38
|
+
outExtension: { ".js": ".mjs" },
|
|
39
|
+
bundle: true,
|
|
40
|
+
splitting: true,
|
|
41
|
+
format: "esm",
|
|
42
|
+
platform: "browser",
|
|
43
|
+
target: "es2022",
|
|
44
|
+
jsx: "automatic",
|
|
45
|
+
minify: true,
|
|
46
|
+
metafile: true,
|
|
47
|
+
logLevel: "silent",
|
|
48
|
+
loader: {
|
|
49
|
+
".gif": "file",
|
|
50
|
+
".jpg": "file",
|
|
51
|
+
".jpeg": "file",
|
|
52
|
+
".png": "file",
|
|
53
|
+
".svg": "file",
|
|
54
|
+
".webp": "file",
|
|
55
|
+
},
|
|
56
|
+
plugins: [runtimeProxyPlugin()],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const bundledReact = Object.keys(result.metafile.inputs).find((input) =>
|
|
60
|
+
/(?:^|[/\\])node_modules[/\\]react(?:-dom)?[/\\]/.test(input),
|
|
61
|
+
);
|
|
62
|
+
if (bundledReact) {
|
|
63
|
+
throw new Error("Desktop Plugin output contains a private React runtime.");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
for (const output of walkFiles(staging)) {
|
|
67
|
+
if (!output.endsWith(".mjs")) continue;
|
|
68
|
+
const source = readFileSync(output, "utf8");
|
|
69
|
+
if (/\b(?:from|import)\s*\(?\s*["']react(?:-dom)?(?:\/[^"']*)?["']/.test(source)) {
|
|
70
|
+
throw new Error(`Desktop Plugin output contains a bare React import: ${relativeSourcePath(staging, output)}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
rmSync(outdir, { recursive: true, force: true });
|
|
75
|
+
renameSync(staging, outdir);
|
|
76
|
+
} finally {
|
|
77
|
+
rmSync(staging, { recursive: true, force: true });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function runtimeProxyPlugin() {
|
|
82
|
+
return {
|
|
83
|
+
name: "dotcraft-plugin-runtime",
|
|
84
|
+
setup(buildContext) {
|
|
85
|
+
for (const [specifier, proxy] of proxyEntries) {
|
|
86
|
+
buildContext.onResolve({ filter: new RegExp(`^${escapeRegExp(specifier)}$`) }, () => ({ path: proxy }));
|
|
87
|
+
}
|
|
88
|
+
buildContext.onResolve({ filter: /^react(?:\/.*)?$|^react-dom(?:\/.*)?$/ }, (args) => ({
|
|
89
|
+
errors: [{ text: `Unsupported React entry point '${args.path}' in a Desktop Plugin.` }],
|
|
90
|
+
}));
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function walkFiles(root) {
|
|
96
|
+
const files = [];
|
|
97
|
+
for (const entry of readdirSync(root, { withFileTypes: true })) {
|
|
98
|
+
const path = join(root, entry.name);
|
|
99
|
+
if (entry.isDirectory()) files.push(...walkFiles(path));
|
|
100
|
+
else files.push(path);
|
|
101
|
+
}
|
|
102
|
+
return files;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function escapeRegExp(value) {
|
|
106
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function formatBuildFailure(error, projectRoot) {
|
|
110
|
+
if (error && typeof error === "object" && Array.isArray(error.errors) && error.errors.length > 0) {
|
|
111
|
+
return error.errors.map((diagnostic) => {
|
|
112
|
+
const location = diagnostic.location;
|
|
113
|
+
const prefix = location
|
|
114
|
+
? `${relativeSourcePath(projectRoot, location.file)}:${location.line}:${location.column + 1}: `
|
|
115
|
+
: "";
|
|
116
|
+
return `${prefix}${sanitizeMessage(diagnostic.text, projectRoot)}`;
|
|
117
|
+
}).join("\n");
|
|
118
|
+
}
|
|
119
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
120
|
+
return sanitizeMessage(message, projectRoot);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function relativeSourcePath(projectRoot, file) {
|
|
124
|
+
const absolute = isAbsolute(file) ? file : resolve(projectRoot, file);
|
|
125
|
+
const projectRelative = relative(projectRoot, absolute);
|
|
126
|
+
if (projectRelative && !projectRelative.startsWith(`..${sep}`) && projectRelative !== "..") {
|
|
127
|
+
return projectRelative.replaceAll("\\", "/");
|
|
128
|
+
}
|
|
129
|
+
const packageRelative = relative(packageRoot, absolute);
|
|
130
|
+
if (packageRelative && !packageRelative.startsWith(`..${sep}`) && packageRelative !== "..") {
|
|
131
|
+
return `@dotcraft/plugin/${packageRelative.replaceAll("\\", "/")}`;
|
|
132
|
+
}
|
|
133
|
+
return "source";
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function sanitizeMessage(message, projectRoot) {
|
|
137
|
+
let result = message;
|
|
138
|
+
for (const [path, replacement] of [[resolve(projectRoot), "."], [packageRoot, "@dotcraft/plugin"]]) {
|
|
139
|
+
result = result.replaceAll(path, replacement).replaceAll(path.replaceAll("\\", "/"), replacement);
|
|
140
|
+
}
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const args = process.argv.slice(2);
|
|
145
|
+
if (args[0] !== "build" || args.length > 2) {
|
|
146
|
+
console.error("Usage: dotcraft-plugin build [project-root]");
|
|
147
|
+
process.exitCode = 1;
|
|
148
|
+
} else {
|
|
149
|
+
const projectRoot = resolve(args[1] ?? process.cwd());
|
|
150
|
+
try {
|
|
151
|
+
await buildDesktopPlugin(projectRoot);
|
|
152
|
+
} catch (error) {
|
|
153
|
+
console.error(formatBuildFailure(error, projectRoot));
|
|
154
|
+
process.exitCode = 1;
|
|
155
|
+
}
|
|
156
|
+
}
|