skystream-cli 1.2.9 → 1.3.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.js +11 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const program = new Command();
|
|
|
9
9
|
program
|
|
10
10
|
.name('skystream')
|
|
11
11
|
.description('SkyStream Plugin Development Kit CLI (Sky Gen 2)')
|
|
12
|
-
.version('1.
|
|
12
|
+
.version('1.3.0');
|
|
13
13
|
// Schemas
|
|
14
14
|
const pluginSchema = z.object({
|
|
15
15
|
packageName: z.string().min(5).regex(/^[a-z0-9._-]+$/),
|
|
@@ -479,7 +479,16 @@ program.command('test')
|
|
|
479
479
|
globalThis.Episode = Episode;
|
|
480
480
|
globalThis.StreamResult = StreamResult;
|
|
481
481
|
`;
|
|
482
|
-
|
|
482
|
+
// Wrap the plugin code and classes in a combined block to ensure scope visibility
|
|
483
|
+
const combinedScript = `
|
|
484
|
+
${entityDefs}
|
|
485
|
+
try {
|
|
486
|
+
${jsContent}
|
|
487
|
+
} catch (e) {
|
|
488
|
+
console.error("Critical Runtime Error: " + e.stack);
|
|
489
|
+
}
|
|
490
|
+
`;
|
|
491
|
+
const runtime = new Function('manifest', 'console', 'http_get', 'http_post', '_fetch', 'fetch', 'btoa', 'atob', 'globalThis', combinedScript);
|
|
483
492
|
runtime(context.manifest, context.console, context.http_get, context.http_post, context._fetch, context.fetch, context.btoa, context.atob, context.globalThis);
|
|
484
493
|
const fn = context.globalThis[options.function];
|
|
485
494
|
if (typeof fn !== 'function') {
|