@replaystage/cli 0.2.0 → 0.4.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/index.d.ts CHANGED
@@ -1,6 +1,28 @@
1
1
  import { Command } from 'commander';
2
2
  import { SupportedPlatform } from '@replaystage/shared';
3
3
 
4
+ interface ProjectConfig {
5
+ slug?: string;
6
+ manageToken?: string;
7
+ apiUrl?: string;
8
+ version?: string;
9
+ title?: string;
10
+ updatedAt?: string;
11
+ visibility?: "draft" | "unlisted" | "public" | string;
12
+ aspectRatio?: string;
13
+ supportedPlatforms?: string;
14
+ platforms?: string;
15
+ aiModel?: string | null;
16
+ aiTool?: string;
17
+ tags?: string[];
18
+ }
19
+ declare function resolveProjectDirectory(targetPath: string): string | null;
20
+ declare function getProjectConfigPath(targetDir: string): string | null;
21
+ declare function readProjectConfig(targetDir: string): ProjectConfig | null;
22
+ declare function writeProjectConfig(targetDir: string, config: ProjectConfig): void;
23
+ declare function incrementVersion(currentVersion?: string): string;
24
+ declare function promoteDraftVersion(currentVersion?: string): string;
25
+
4
26
  interface UserInfo {
5
27
  id: string;
6
28
  name?: string;
@@ -26,6 +48,16 @@ declare function resolveApiUrl(cliApiUrl?: string): string;
26
48
  declare function computeFingerprint(input: string | Buffer | Uint8Array): Promise<string>;
27
49
  declare function computeFileFingerprint(filePath: string): Promise<string>;
28
50
 
51
+ declare const COVER_PRECEDENCE_FILES: readonly ["cover.png", "cover.jpg", "cover.jpeg", "cover.webp", "cover.gif"];
52
+ interface DetectedCover {
53
+ source: "bundle" | "sibling";
54
+ fileName: string;
55
+ filePath?: string;
56
+ buffer: Buffer;
57
+ ext: "png" | "jpg" | "webp" | "gif";
58
+ mimeType: string;
59
+ }
60
+ declare function detectSiblingCover(targetPath: string): DetectedCover | null;
29
61
  interface PackagedBundle {
30
62
  format: "single-html" | "directory" | "zip";
31
63
  entryPoint: string;
@@ -39,12 +71,16 @@ interface PackagedBundle {
39
71
  extractedTitle?: string;
40
72
  extractedTagline?: string;
41
73
  extractedAspectRatio?: string;
74
+ extractedModel?: string | null;
75
+ extractedTags?: string[];
42
76
  }
43
77
  declare function extractHtmlMetadata(html: string): {
44
78
  title?: string;
45
79
  tagline?: string;
46
80
  aspectRatio?: string;
47
81
  rawAspectRatio?: string;
82
+ model?: string | null;
83
+ tags?: string[];
48
84
  };
49
85
  declare function computeSha256(buf: Buffer | Uint8Array): string;
50
86
  declare function createZipFromFiles(fileMap: Record<string, Buffer>): Buffer;
@@ -61,9 +97,11 @@ interface ValidationResult {
61
97
  fileHash?: string;
62
98
  files?: string[];
63
99
  aspectRatio?: string;
100
+ aiModel?: string | null;
64
101
  supportedPlatforms?: SupportedPlatform;
65
102
  platforms?: SupportedPlatform;
66
103
  hasPlatformMeta?: boolean;
104
+ tags?: string[];
67
105
  errors: string[];
68
106
  warnings: string[];
69
107
  }
@@ -79,8 +117,9 @@ interface UploadBundleOptions {
79
117
  title: string;
80
118
  tagline: string;
81
119
  description?: string;
82
- aiTool: string;
120
+ aiTool?: string;
83
121
  category?: string;
122
+ tags?: string[] | string;
84
123
  token?: string | null;
85
124
  fileHash?: string;
86
125
  extraHeaders?: Record<string, string>;
@@ -91,6 +130,9 @@ interface UploadBundleOptions {
91
130
  changelog?: string;
92
131
  aspectRatio?: string;
93
132
  supportedPlatforms?: string;
133
+ aiModel?: string | null;
134
+ coverBuffer?: Buffer;
135
+ coverFileName?: string;
94
136
  errorMsgFallback?: string;
95
137
  }
96
138
  interface UploadResponse {
@@ -113,6 +155,7 @@ interface UploadResponse {
113
155
  supportedPlatforms?: string;
114
156
  supported_platforms?: string;
115
157
  platforms?: string;
158
+ tags?: string[];
116
159
  error?: string;
117
160
  message?: string;
118
161
  data?: any;
@@ -128,6 +171,11 @@ interface UpdateBundleOptions {
128
171
  changelog?: string;
129
172
  aspectRatio?: string;
130
173
  supportedPlatforms?: string;
174
+ aiTool?: string;
175
+ aiModel?: string | null;
176
+ tags?: string[] | string;
177
+ coverBuffer?: Buffer;
178
+ coverFileName?: string;
131
179
  manageToken?: string;
132
180
  token?: string | null;
133
181
  errorMsgFallback?: string;
@@ -141,25 +189,6 @@ declare function updateGameBundle(slug: string, options: UpdateBundleOptions): P
141
189
  declare const updateGame: typeof updateGameBundle;
142
190
  declare function fetchWhoami(apiUrl: string, token: string): Promise<any>;
143
191
 
144
- interface ProjectConfig {
145
- slug?: string;
146
- manageToken?: string;
147
- apiUrl?: string;
148
- version?: string;
149
- title?: string;
150
- updatedAt?: string;
151
- visibility?: "draft" | "unlisted" | "public" | string;
152
- aspectRatio?: string;
153
- supportedPlatforms?: string;
154
- platforms?: string;
155
- }
156
- declare function resolveProjectDirectory(targetPath: string): string | null;
157
- declare function getProjectConfigPath(targetDir: string): string | null;
158
- declare function readProjectConfig(targetDir: string): ProjectConfig | null;
159
- declare function writeProjectConfig(targetDir: string, config: ProjectConfig): void;
160
- declare function incrementVersion(currentVersion?: string): string;
161
- declare function promoteDraftVersion(currentVersion?: string): string;
162
-
163
192
  declare function printJson(data: any): void;
164
193
  declare function printErrorJson(error: string, message: string, code?: number, extra?: Record<string, any>): void;
165
194
  declare function logInfo(message: string, isJsonMode?: boolean): void;
@@ -178,9 +207,10 @@ declare function printPublishSuccess(res: {
178
207
  aspectRatio?: string;
179
208
  supportedPlatforms?: string;
180
209
  platforms?: string;
210
+ tags?: string[];
181
211
  }): void;
182
212
 
183
213
  declare function createProgram(): Command;
184
214
  declare function runCli(argv?: string[]): Promise<void>;
185
215
 
186
- export { type CliConfig, type PackagedBundle, type ProjectConfig, type UpdateBundleOptions, type UpdateResponse, type UpdateResult, type UploadBundleOptions, type UploadResponse, type UploadResult, type UserInfo, type ValidationResult, checkHtmlDependencies, clearConfig, clearToken, computeFileFingerprint, computeFingerprint, computeSha256, createProgram, createZipFromFiles, extractHtmlMetadata, fetchWhoami, getConfigDir, getConfigPath, getProjectConfigPath, getToken, incrementVersion, logError, logInfo, logSuccess, logWarn, packageGame, printErrorJson, printJson, printPublishSuccess, promoteDraftVersion, readConfig, readProjectConfig, resolveApiUrl, resolveProjectDirectory, resolveToken, runCli, setToken, updateGame, updateGameBundle, uploadGame, uploadGameBundle, validateGamePackage, writeConfig, writeProjectConfig };
216
+ export { COVER_PRECEDENCE_FILES, type CliConfig, type DetectedCover, type PackagedBundle, type ProjectConfig, type UpdateBundleOptions, type UpdateResponse, type UpdateResult, type UploadBundleOptions, type UploadResponse, type UploadResult, type UserInfo, type ValidationResult, checkHtmlDependencies, clearConfig, clearToken, computeFileFingerprint, computeFingerprint, computeSha256, createProgram, createZipFromFiles, detectSiblingCover, extractHtmlMetadata, fetchWhoami, getConfigDir, getConfigPath, getProjectConfigPath, getToken, incrementVersion, logError, logInfo, logSuccess, logWarn, packageGame, printErrorJson, printJson, printPublishSuccess, promoteDraftVersion, readConfig, readProjectConfig, resolveApiUrl, resolveProjectDirectory, resolveToken, runCli, writeProjectConfig as saveProjectConfig, setToken, updateGame, updateGameBundle, uploadGame, uploadGameBundle, validateGamePackage, writeConfig, writeProjectConfig };