@ashdev/codex-plugin-sdk 1.0.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/README.md +260 -0
- package/dist/errors.d.ts +53 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +72 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +36 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +77 -0
- package/dist/logger.js.map +1 -0
- package/dist/server.d.ts +103 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +306 -0
- package/dist/server.js.map +1 -0
- package/dist/types/capabilities.d.ts +89 -0
- package/dist/types/capabilities.d.ts.map +1 -0
- package/dist/types/capabilities.js +20 -0
- package/dist/types/capabilities.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/manifest.d.ts +88 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/dist/types/manifest.js +21 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types/protocol.d.ts +185 -0
- package/dist/types/protocol.d.ts.map +1 -0
- package/dist/types/protocol.js +10 -0
- package/dist/types/protocol.js.map +1 -0
- package/dist/types/rpc.d.ts +56 -0
- package/dist/types/rpc.d.ts.map +1 -0
- package/dist/types/rpc.js +34 -0
- package/dist/types/rpc.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin manifest types - describes plugin capabilities and requirements
|
|
3
|
+
*/
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// Type Guards for Manifest Validation
|
|
6
|
+
// =============================================================================
|
|
7
|
+
/**
|
|
8
|
+
* Type guard to check if manifest declares series metadata provider capability
|
|
9
|
+
*/
|
|
10
|
+
export function hasSeriesMetadataProvider(manifest) {
|
|
11
|
+
return (Array.isArray(manifest.capabilities.metadataProvider) &&
|
|
12
|
+
manifest.capabilities.metadataProvider.includes("series"));
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Type guard to check if manifest declares book metadata provider capability
|
|
16
|
+
*/
|
|
17
|
+
export function hasBookMetadataProvider(manifest) {
|
|
18
|
+
return (Array.isArray(manifest.capabilities.metadataProvider) &&
|
|
19
|
+
manifest.capabilities.metadataProvider.includes("book"));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/types/manifest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoEH,gFAAgF;AAChF,sCAAsC;AACtC,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAAwB;IAGhE,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAC;QACrD,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAwB;IAG9D,OAAO,CACL,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAC;QACrD,QAAQ,CAAC,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,CACxD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol types - these MUST match the Rust protocol exactly
|
|
3
|
+
*
|
|
4
|
+
* These types define the JSON-RPC protocol contract between plugins and Codex.
|
|
5
|
+
* Field names use camelCase to match JSON serialization.
|
|
6
|
+
*
|
|
7
|
+
* @see src/services/plugin/protocol.rs in the Codex backend
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Parameters for metadata/series/search method (and future metadata/book/search)
|
|
11
|
+
*/
|
|
12
|
+
export interface MetadataSearchParams {
|
|
13
|
+
/** Search query string */
|
|
14
|
+
query: string;
|
|
15
|
+
/** Maximum number of results to return */
|
|
16
|
+
limit?: number;
|
|
17
|
+
/** Pagination cursor from previous response */
|
|
18
|
+
cursor?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Response from metadata/series/search method (and future metadata/book/search)
|
|
22
|
+
*/
|
|
23
|
+
export interface MetadataSearchResponse {
|
|
24
|
+
/** Search results */
|
|
25
|
+
results: SearchResult[];
|
|
26
|
+
/** Cursor for next page (if more results available) */
|
|
27
|
+
nextCursor?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Individual search result
|
|
31
|
+
*/
|
|
32
|
+
export interface SearchResult {
|
|
33
|
+
/** External ID from the provider */
|
|
34
|
+
externalId: string;
|
|
35
|
+
/** Primary title */
|
|
36
|
+
title: string;
|
|
37
|
+
/** Alternative titles */
|
|
38
|
+
alternateTitles: string[];
|
|
39
|
+
/** Year of publication/release */
|
|
40
|
+
year?: number;
|
|
41
|
+
/** Cover image URL */
|
|
42
|
+
coverUrl?: string;
|
|
43
|
+
/** Relevance score (0.0-1.0, where 1.0 is perfect match) */
|
|
44
|
+
relevanceScore?: number;
|
|
45
|
+
/** Preview data for displaying in search results */
|
|
46
|
+
preview?: SearchResultPreview;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Preview data shown in search result list
|
|
50
|
+
*/
|
|
51
|
+
export interface SearchResultPreview {
|
|
52
|
+
/** Publication status */
|
|
53
|
+
status?: string;
|
|
54
|
+
/** Genres */
|
|
55
|
+
genres: string[];
|
|
56
|
+
/** Rating (normalized 0-10) */
|
|
57
|
+
rating?: number;
|
|
58
|
+
/** Short description */
|
|
59
|
+
description?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Parameters for metadata/series/get method (and future metadata/book/get)
|
|
63
|
+
*/
|
|
64
|
+
export interface MetadataGetParams {
|
|
65
|
+
/** External ID from the provider */
|
|
66
|
+
externalId: string;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Full series metadata from a provider
|
|
70
|
+
*/
|
|
71
|
+
export interface PluginSeriesMetadata {
|
|
72
|
+
/** External ID from the provider */
|
|
73
|
+
externalId: string;
|
|
74
|
+
/** URL to the series on the provider's website */
|
|
75
|
+
externalUrl: string;
|
|
76
|
+
/** Primary title */
|
|
77
|
+
title?: string;
|
|
78
|
+
/** Alternative titles with language info */
|
|
79
|
+
alternateTitles: AlternateTitle[];
|
|
80
|
+
/** Full description/summary */
|
|
81
|
+
summary?: string;
|
|
82
|
+
/** Publication status */
|
|
83
|
+
status?: SeriesStatus;
|
|
84
|
+
/** Year of first publication */
|
|
85
|
+
year?: number;
|
|
86
|
+
/** Expected total number of books in the series */
|
|
87
|
+
totalBookCount?: number;
|
|
88
|
+
/** BCP47 language code (e.g., "en", "ja", "ko") */
|
|
89
|
+
language?: string;
|
|
90
|
+
/** Age rating (e.g., 0, 13, 16, 18) */
|
|
91
|
+
ageRating?: number;
|
|
92
|
+
/** Reading direction: "ltr", "rtl", or "ttb" */
|
|
93
|
+
readingDirection?: ReadingDirection;
|
|
94
|
+
/** Genres (e.g., "Action", "Romance") */
|
|
95
|
+
genres: string[];
|
|
96
|
+
/** Tags/themes (e.g., "Time Travel", "School Life") */
|
|
97
|
+
tags: string[];
|
|
98
|
+
/** Authors/writers */
|
|
99
|
+
authors: string[];
|
|
100
|
+
/** Artists (if different from authors) */
|
|
101
|
+
artists: string[];
|
|
102
|
+
/** Publisher name */
|
|
103
|
+
publisher?: string;
|
|
104
|
+
/** Cover image URL */
|
|
105
|
+
coverUrl?: string;
|
|
106
|
+
/** Banner/background image URL */
|
|
107
|
+
bannerUrl?: string;
|
|
108
|
+
/** External rating information (primary rating) */
|
|
109
|
+
rating?: ExternalRating;
|
|
110
|
+
/** Multiple external ratings from different sources (e.g., AniList, MAL) */
|
|
111
|
+
externalRatings?: ExternalRating[];
|
|
112
|
+
/** Links to other sites */
|
|
113
|
+
externalLinks: ExternalLink[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Alternate title with language info
|
|
117
|
+
*/
|
|
118
|
+
export interface AlternateTitle {
|
|
119
|
+
/** The title text */
|
|
120
|
+
title: string;
|
|
121
|
+
/** ISO 639-1 language code (e.g., "en", "ja") */
|
|
122
|
+
language?: string;
|
|
123
|
+
/** Title type (e.g., "romaji", "native", "english") */
|
|
124
|
+
titleType?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Series publication status
|
|
128
|
+
*
|
|
129
|
+
* These values MUST match the backend's canonical SeriesStatus enum.
|
|
130
|
+
* @see src/db/entities/series_metadata.rs in the Codex backend
|
|
131
|
+
*/
|
|
132
|
+
export type SeriesStatus = "ongoing" | "ended" | "hiatus" | "abandoned" | "unknown";
|
|
133
|
+
/**
|
|
134
|
+
* Reading direction for content
|
|
135
|
+
*/
|
|
136
|
+
export type ReadingDirection = "ltr" | "rtl" | "ttb";
|
|
137
|
+
/**
|
|
138
|
+
* External rating from provider
|
|
139
|
+
*/
|
|
140
|
+
export interface ExternalRating {
|
|
141
|
+
/** Normalized score (0-100) */
|
|
142
|
+
score: number;
|
|
143
|
+
/** Number of votes */
|
|
144
|
+
voteCount?: number;
|
|
145
|
+
/** Source name (e.g., "mangaupdates") */
|
|
146
|
+
source: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* External link to other sites
|
|
150
|
+
*/
|
|
151
|
+
export interface ExternalLink {
|
|
152
|
+
/** URL */
|
|
153
|
+
url: string;
|
|
154
|
+
/** Display label */
|
|
155
|
+
label: string;
|
|
156
|
+
/** Link type */
|
|
157
|
+
linkType?: ExternalLinkType;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Type of external link
|
|
161
|
+
*/
|
|
162
|
+
export type ExternalLinkType = "provider" | "official" | "social" | "purchase" | "read" | "other";
|
|
163
|
+
/**
|
|
164
|
+
* Parameters for metadata/series/match method (and future metadata/book/match)
|
|
165
|
+
*/
|
|
166
|
+
export interface MetadataMatchParams {
|
|
167
|
+
/** Title to match against */
|
|
168
|
+
title: string;
|
|
169
|
+
/** Year hint for matching */
|
|
170
|
+
year?: number;
|
|
171
|
+
/** Author hint for matching */
|
|
172
|
+
author?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Response from metadata/series/match method (and future metadata/book/match)
|
|
176
|
+
*/
|
|
177
|
+
export interface MetadataMatchResponse {
|
|
178
|
+
/** Best match result, or null if no confident match */
|
|
179
|
+
match: SearchResult | null;
|
|
180
|
+
/** Confidence score (0.0-1.0) */
|
|
181
|
+
confidence: number;
|
|
182
|
+
/** Alternative matches if confidence is low */
|
|
183
|
+
alternatives?: SearchResult[];
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/types/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB;IACrB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;I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AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAMlG;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,uDAAuD;IACvD,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol types - these MUST match the Rust protocol exactly
|
|
3
|
+
*
|
|
4
|
+
* These types define the JSON-RPC protocol contract between plugins and Codex.
|
|
5
|
+
* Field names use camelCase to match JSON serialization.
|
|
6
|
+
*
|
|
7
|
+
* @see src/services/plugin/protocol.rs in the Codex backend
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/types/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-RPC 2.0 types for plugin communication
|
|
3
|
+
*/
|
|
4
|
+
export interface JsonRpcRequest {
|
|
5
|
+
jsonrpc: "2.0";
|
|
6
|
+
id: string | number | null;
|
|
7
|
+
method: string;
|
|
8
|
+
params?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface JsonRpcSuccessResponse {
|
|
11
|
+
jsonrpc: "2.0";
|
|
12
|
+
id: string | number | null;
|
|
13
|
+
result: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface JsonRpcErrorResponse {
|
|
16
|
+
jsonrpc: "2.0";
|
|
17
|
+
id: string | number | null;
|
|
18
|
+
error: JsonRpcError;
|
|
19
|
+
}
|
|
20
|
+
export interface JsonRpcError {
|
|
21
|
+
code: number;
|
|
22
|
+
message: string;
|
|
23
|
+
data?: unknown;
|
|
24
|
+
}
|
|
25
|
+
export type JsonRpcResponse = JsonRpcSuccessResponse | JsonRpcErrorResponse;
|
|
26
|
+
/**
|
|
27
|
+
* Standard JSON-RPC error codes
|
|
28
|
+
*/
|
|
29
|
+
export declare const JSON_RPC_ERROR_CODES: {
|
|
30
|
+
/** Invalid JSON was received */
|
|
31
|
+
readonly PARSE_ERROR: -32700;
|
|
32
|
+
/** The JSON sent is not a valid Request object */
|
|
33
|
+
readonly INVALID_REQUEST: -32600;
|
|
34
|
+
/** The method does not exist / is not available */
|
|
35
|
+
readonly METHOD_NOT_FOUND: -32601;
|
|
36
|
+
/** Invalid method parameter(s) */
|
|
37
|
+
readonly INVALID_PARAMS: -32602;
|
|
38
|
+
/** Internal JSON-RPC error */
|
|
39
|
+
readonly INTERNAL_ERROR: -32603;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Plugin-specific error codes (in the -32000 to -32099 range)
|
|
43
|
+
*/
|
|
44
|
+
export declare const PLUGIN_ERROR_CODES: {
|
|
45
|
+
/** Rate limited by external API */
|
|
46
|
+
readonly RATE_LIMITED: -32001;
|
|
47
|
+
/** Resource not found (e.g., series ID doesn't exist) */
|
|
48
|
+
readonly NOT_FOUND: -32002;
|
|
49
|
+
/** Authentication failed (invalid credentials) */
|
|
50
|
+
readonly AUTH_FAILED: -32003;
|
|
51
|
+
/** External API error */
|
|
52
|
+
readonly API_ERROR: -32004;
|
|
53
|
+
/** Plugin configuration error */
|
|
54
|
+
readonly CONFIG_ERROR: -32005;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=rpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/types/rpc.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,MAAM,eAAe,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,oBAAoB;IAC/B,gCAAgC;;IAEhC,kDAAkD;;IAElD,mDAAmD;;IAEnD,kCAAkC;;IAElC,8BAA8B;;CAEtB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC7B,mCAAmC;;IAEnC,yDAAyD;;IAEzD,kDAAkD;;IAElD,yBAAyB;;IAEzB,iCAAiC;;CAEzB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-RPC 2.0 types for plugin communication
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Standard JSON-RPC error codes
|
|
6
|
+
*/
|
|
7
|
+
export const JSON_RPC_ERROR_CODES = {
|
|
8
|
+
/** Invalid JSON was received */
|
|
9
|
+
PARSE_ERROR: -32700,
|
|
10
|
+
/** The JSON sent is not a valid Request object */
|
|
11
|
+
INVALID_REQUEST: -32600,
|
|
12
|
+
/** The method does not exist / is not available */
|
|
13
|
+
METHOD_NOT_FOUND: -32601,
|
|
14
|
+
/** Invalid method parameter(s) */
|
|
15
|
+
INVALID_PARAMS: -32602,
|
|
16
|
+
/** Internal JSON-RPC error */
|
|
17
|
+
INTERNAL_ERROR: -32603,
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Plugin-specific error codes (in the -32000 to -32099 range)
|
|
21
|
+
*/
|
|
22
|
+
export const PLUGIN_ERROR_CODES = {
|
|
23
|
+
/** Rate limited by external API */
|
|
24
|
+
RATE_LIMITED: -32001,
|
|
25
|
+
/** Resource not found (e.g., series ID doesn't exist) */
|
|
26
|
+
NOT_FOUND: -32002,
|
|
27
|
+
/** Authentication failed (invalid credentials) */
|
|
28
|
+
AUTH_FAILED: -32003,
|
|
29
|
+
/** External API error */
|
|
30
|
+
API_ERROR: -32004,
|
|
31
|
+
/** Plugin configuration error */
|
|
32
|
+
CONFIG_ERROR: -32005,
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../../src/types/rpc.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6BH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,gCAAgC;IAChC,WAAW,EAAE,CAAC,KAAK;IACnB,kDAAkD;IAClD,eAAe,EAAE,CAAC,KAAK;IACvB,mDAAmD;IACnD,gBAAgB,EAAE,CAAC,KAAK;IACxB,kCAAkC;IAClC,cAAc,EAAE,CAAC,KAAK;IACtB,8BAA8B;IAC9B,cAAc,EAAE,CAAC,KAAK;CACd,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,mCAAmC;IACnC,YAAY,EAAE,CAAC,KAAK;IACpB,yDAAyD;IACzD,SAAS,EAAE,CAAC,KAAK;IACjB,kDAAkD;IAClD,WAAW,EAAE,CAAC,KAAK;IACnB,yBAAyB;IACzB,SAAS,EAAE,CAAC,KAAK;IACjB,iCAAiC;IACjC,YAAY,EAAE,CAAC,KAAK;CACZ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ashdev/codex-plugin-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "SDK for building Codex plugins",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"clean": "rm -rf dist",
|
|
22
|
+
"prepublishOnly": "npm run lint && npm run build",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"test:watch": "vitest",
|
|
25
|
+
"lint": "biome check .",
|
|
26
|
+
"lint:fix": "biome check --write .",
|
|
27
|
+
"format": "biome format --write .",
|
|
28
|
+
"check": "biome check . && tsc --noEmit"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"codex",
|
|
32
|
+
"plugin",
|
|
33
|
+
"sdk",
|
|
34
|
+
"metadata"
|
|
35
|
+
],
|
|
36
|
+
"author": "Codex",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/AshDevFr/codex.git",
|
|
41
|
+
"directory": "plugins/sdk-typescript"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22.0.0"
|
|
45
|
+
},
|
|
46
|
+
"codex": {
|
|
47
|
+
"protocolVersion": "1.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@biomejs/biome": "^2.3.11",
|
|
51
|
+
"@types/node": "^22.0.0",
|
|
52
|
+
"typescript": "^5.7.0",
|
|
53
|
+
"vitest": "^3.0.0"
|
|
54
|
+
}
|
|
55
|
+
}
|