mirror of
https://github.com/lmstudio-ai/lms.git
synced 2025-09-25 17:04:09 +08:00
Add lms dev notification
This commit is contained in:
@ -35,11 +35,21 @@ class PluginProcess {
|
|||||||
private currentProcess: ChildProcessWithoutNullStreams | null = null;
|
private currentProcess: ChildProcessWithoutNullStreams | null = null;
|
||||||
private status: PluginProcessStatus = "stopped";
|
private status: PluginProcessStatus = "stopped";
|
||||||
private unregister: (() => Promise<void>) | null = null;
|
private unregister: (() => Promise<void>) | null = null;
|
||||||
|
private firstTime = true;
|
||||||
|
|
||||||
private async startProcess() {
|
private async startProcess() {
|
||||||
this.status = "starting";
|
this.status = "starting";
|
||||||
const { unregister, clientIdentifier, clientPasskey } =
|
const { unregister, clientIdentifier, clientPasskey } =
|
||||||
await this.client.plugins.registerDevelopmentPlugin(this.registerDevelopmentPluginOpts);
|
await this.client.plugins.registerDevelopmentPlugin(this.registerDevelopmentPluginOpts);
|
||||||
|
if (this.firstTime) {
|
||||||
|
const manifest = this.registerDevelopmentPluginOpts.manifest;
|
||||||
|
const identifier = `${manifest.owner}/${manifest.name}`;
|
||||||
|
await this.client.system.notify({
|
||||||
|
title: `Plugin "${identifier}" started`,
|
||||||
|
description: "This plugin is run by lms CLI development server.",
|
||||||
|
});
|
||||||
|
this.firstTime = false;
|
||||||
|
}
|
||||||
this.unregister = unregister;
|
this.unregister = unregister;
|
||||||
this.currentProcess = this.node.spawn(this.args, {
|
this.currentProcess = this.node.spawn(this.args, {
|
||||||
env: {
|
env: {
|
||||||
|
Reference in New Issue
Block a user