Skip to content

Commit 08e87a1

Browse files
committed
fixes
1 parent 8a8f041 commit 08e87a1

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

src/client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { Browser, BrowserCreateSessionResponse } from './resources/browser';
3232
import { readEnv } from './internal/utils/env';
3333
import { formatRequestDetails, loggerFor } from './internal/utils/log';
3434
import { isEmptyObj } from './internal/utils/values';
35-
import { KernelApp, appRegistry} from './core/app-framework';
35+
import { KernelApp, appRegistry } from './core/app-framework';
3636

3737
export interface ClientOptions {
3838
/**
@@ -685,8 +685,8 @@ export class Kernel {
685685
return new KernelApp(name);
686686
}
687687

688-
public static exportRegistry(entrypointRelpath: string): string {
689-
return appRegistry.exportJSON(entrypointRelpath);
688+
public static exportRegistry(): string {
689+
return appRegistry.exportJSON();
690690
}
691691

692692
static Kernel = this;
@@ -713,7 +713,7 @@ export class Kernel {
713713
}
714714
Kernel.Apps = Apps;
715715
Kernel.Browser = Browser;
716-
Kernel.exportRegistry = (entrypointRelpath: string) => appRegistry.exportJSON(entrypointRelpath);
716+
Kernel.exportRegistry = () => appRegistry.exportJSON();
717717
export declare namespace Kernel {
718718
export type RequestOptions = Opts.RequestOptions;
719719

src/core/app-framework.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
// Type definitions for browser
2-
export interface Browser {
3-
cdp_ws_url: string;
4-
}
5-
6-
// Context definition
71
export interface KernelContext {
82
invocationId: string;
93
}
104

11-
// Action definition
125
export interface KernelAction {
136
name: string;
147
handler: (context: KernelContext, input: any) => Promise<any>;
158
}
169

1710
export interface KernelJson {
18-
entrypoint: string;
1911
apps: KernelAppJson[];
2012
}
2113

@@ -28,7 +20,6 @@ export interface KernelActionJson {
2820
name: string;
2921
}
3022

31-
// App definition
3223
export class KernelApp {
3324
name: string;
3425
actions: Map<string, KernelAction> = new Map();
@@ -131,12 +122,14 @@ class KernelAppRegistry {
131122
return this.apps.get(name);
132123
}
133124

134-
/**
135-
* Export the registry as JSON
136-
*/
137-
exportJSON(entrypointRelpath: string): string {
138-
const apps = this.getApps().map((app) => app.toJSON());
139-
return JSON.stringify({ apps, entrypoint: entrypointRelpath } as KernelJson, null, 2);
125+
export(): KernelJson {
126+
return {
127+
apps: this.getApps().map((app) => app.toJSON()),
128+
};
129+
}
130+
131+
exportJSON(): string {
132+
return JSON.stringify(this.export(), null, 2);
140133
}
141134
}
142135

0 commit comments

Comments
 (0)