feat: wire brain + agentic subsystems, update wails build artifacts
Add brain.NewDirect() and agentic.NewPrep() to MCP service. Update go.mod to core/mcp v0.2.0. Regenerated wails bindings. Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
d145612699
commit
a424c2d589
16 changed files with 365 additions and 35 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,3 +7,4 @@ build/linux/appimage/build
|
|||
build/windows/nsis/MicrosoftEdgeWebview2Setup.exeide
|
||||
.core/
|
||||
.idea/
|
||||
ide
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ tasks:
|
|||
deps:
|
||||
- task: install:frontend:deps
|
||||
cmds:
|
||||
- npm run dev -- --port {{.VITE_PORT}} --strictPort
|
||||
- npm run dev -- --port {{.VITE_PORT}}
|
||||
|
||||
update:build-assets:
|
||||
summary: Updates the build assets
|
||||
|
|
|
|||
BIN
build/darwin/Assets.car
Normal file
BIN
build/darwin/Assets.car
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -94,5 +94,8 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"analytics": false
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Call as $Call, CancellablePromise as $CancellablePromise } from "@wailsio/runtime";
|
||||
|
||||
export function Greet(name: string): $CancellablePromise<string> {
|
||||
return $Call.ByID(1411160069, name);
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import * as GreetService from "./greetservice.js";
|
||||
export {
|
||||
GreetService
|
||||
};
|
||||
FS
|
||||
} from "./models.js";
|
||||
35
frontend/bindings/embed/models.ts
Normal file
35
frontend/bindings/embed/models.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* An FS is a read-only collection of files, usually initialized with a //go:embed directive.
|
||||
* When declared without a //go:embed directive, an FS is an empty file system.
|
||||
*
|
||||
* An FS is a read-only value, so it is safe to use from multiple goroutines
|
||||
* simultaneously and also safe to assign values of type FS to each other.
|
||||
*
|
||||
* FS implements fs.FS, so it can be used with any package that understands
|
||||
* file system interfaces, including net/http, text/template, and html/template.
|
||||
*
|
||||
* See the package documentation for more details about initializing an FS.
|
||||
*/
|
||||
export class FS {
|
||||
|
||||
/** Creates a new FS instance. */
|
||||
constructor($$source: Partial<FS> = {}) {
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new FS instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): FS {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new FS($$parsedSource as Partial<FS>);
|
||||
}
|
||||
}
|
||||
164
frontend/bindings/forge.lthn.ai/core/go/pkg/core/core.ts
Normal file
164
frontend/bindings/forge.lthn.ai/core/go/pkg/core/core.ts
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
/**
|
||||
* Core is the central application object that manages services, assets, and communication.
|
||||
* @module
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as embed$0 from "../../../../../embed/models.js";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as $models from "./models.js";
|
||||
|
||||
/**
|
||||
* ACTION dispatches a message to all registered IPC handlers.
|
||||
* This is the primary mechanism for services to communicate with each other.
|
||||
*/
|
||||
export function ACTION(msg: $models.Message): $CancellablePromise<void> {
|
||||
return $Call.ByID(4292948361, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assets returns the embedded filesystem containing the application's assets.
|
||||
*/
|
||||
export function Assets(): $CancellablePromise<embed$0.FS> {
|
||||
return $Call.ByID(3418392250).then(($result: any) => {
|
||||
return $$createType0($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Config returns the registered Config service.
|
||||
*/
|
||||
export function Config(): $CancellablePromise<$models.Config> {
|
||||
return $Call.ByID(189298201);
|
||||
}
|
||||
|
||||
/**
|
||||
* Core returns self, implementing the CoreProvider interface.
|
||||
*/
|
||||
export function Core(): $CancellablePromise<$models.Core | null> {
|
||||
return $Call.ByID(1780022976).then(($result: any) => {
|
||||
return $$createType2($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Crypt returns the registered Crypt service.
|
||||
*/
|
||||
export function Crypt(): $CancellablePromise<$models.Crypt> {
|
||||
return $Call.ByID(2268164577);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display returns the registered Display service.
|
||||
*/
|
||||
export function Display(): $CancellablePromise<$models.Display> {
|
||||
return $Call.ByID(2677615899);
|
||||
}
|
||||
|
||||
/**
|
||||
* PERFORM dispatches a task to handlers until one executes it.
|
||||
* Returns (result, handled, error). If no handler responds, handled is false.
|
||||
*/
|
||||
export function PERFORM(t: $models.Task): $CancellablePromise<[any, boolean]> {
|
||||
return $Call.ByID(4123176972, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* PerformAsync dispatches a task to be executed in a background goroutine.
|
||||
* It returns a unique task ID that can be used to track the task's progress.
|
||||
* The result of the task will be broadcasted via an ActionTaskCompleted message.
|
||||
*/
|
||||
export function PerformAsync(t: $models.Task): $CancellablePromise<string> {
|
||||
return $Call.ByID(2093358608, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* Progress broadcasts a progress update for a background task.
|
||||
*/
|
||||
export function Progress(taskID: string, progress: number, message: string, t: $models.Task): $CancellablePromise<void> {
|
||||
return $Call.ByID(1583922996, taskID, progress, message, t);
|
||||
}
|
||||
|
||||
/**
|
||||
* QUERY dispatches a query to handlers until one responds.
|
||||
* Returns (result, handled, error). If no handler responds, handled is false.
|
||||
*/
|
||||
export function QUERY(q: $models.Query): $CancellablePromise<[any, boolean]> {
|
||||
return $Call.ByID(3538289785, q);
|
||||
}
|
||||
|
||||
/**
|
||||
* QUERYALL dispatches a query to all handlers and collects all responses.
|
||||
* Returns all results from handlers that responded.
|
||||
*/
|
||||
export function QUERYALL(q: $models.Query): $CancellablePromise<any[]> {
|
||||
return $Call.ByID(2503646560, q).then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* RegisterAction adds a new IPC handler to the Core.
|
||||
*/
|
||||
export function RegisterAction(handler: any): $CancellablePromise<void> {
|
||||
return $Call.ByID(4133311524, handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* RegisterActions adds multiple IPC handlers to the Core.
|
||||
*/
|
||||
export function RegisterActions(...handlers: any[]): $CancellablePromise<void> {
|
||||
return $Call.ByID(736871669, handlers);
|
||||
}
|
||||
|
||||
/**
|
||||
* RegisterQuery adds a query handler to the Core.
|
||||
*/
|
||||
export function RegisterQuery(handler: $models.QueryHandler): $CancellablePromise<void> {
|
||||
return $Call.ByID(3624744914, handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* RegisterService adds a new service to the Core.
|
||||
*/
|
||||
export function RegisterService(name: string, api: any): $CancellablePromise<void> {
|
||||
return $Call.ByID(984069509, name, api);
|
||||
}
|
||||
|
||||
/**
|
||||
* RegisterTask adds a task handler to the Core.
|
||||
*/
|
||||
export function RegisterTask(handler: $models.TaskHandler): $CancellablePromise<void> {
|
||||
return $Call.ByID(2729221523, handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Service retrieves a registered service by name.
|
||||
* It returns nil if the service is not found.
|
||||
*/
|
||||
export function Service(name: string): $CancellablePromise<any> {
|
||||
return $Call.ByID(3781502542, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Workspace returns the registered Workspace service.
|
||||
*/
|
||||
export function Workspace(): $CancellablePromise<$models.Workspace> {
|
||||
return $Call.ByID(3152134880);
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = embed$0.FS.createFrom;
|
||||
const $$createType1 = $models.Core.createFrom;
|
||||
const $$createType2 = $Create.Nullable($$createType1);
|
||||
const $$createType3 = $Create.Array($Create.Any);
|
||||
24
frontend/bindings/forge.lthn.ai/core/go/pkg/core/index.ts
Normal file
24
frontend/bindings/forge.lthn.ai/core/go/pkg/core/index.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import * as Core from "./core.js";
|
||||
export {
|
||||
Core
|
||||
};
|
||||
|
||||
export {
|
||||
Core,
|
||||
Features
|
||||
} from "./models.js";
|
||||
|
||||
export type {
|
||||
Config,
|
||||
Crypt,
|
||||
Display,
|
||||
Message,
|
||||
Query,
|
||||
QueryHandler,
|
||||
Task,
|
||||
TaskHandler,
|
||||
Workspace
|
||||
} from "./models.js";
|
||||
129
frontend/bindings/forge.lthn.ai/core/go/pkg/core/models.ts
Normal file
129
frontend/bindings/forge.lthn.ai/core/go/pkg/core/models.ts
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Create as $Create } from "@wailsio/runtime";
|
||||
|
||||
/**
|
||||
* Config provides access to application configuration.
|
||||
*/
|
||||
export type Config = any;
|
||||
|
||||
/**
|
||||
* Core is the central application object that manages services, assets, and communication.
|
||||
*/
|
||||
export class Core {
|
||||
/**
|
||||
* GUI runtime (e.g., Wails App) - set by WithApp option
|
||||
*/
|
||||
"App": any;
|
||||
"Features": Features | null;
|
||||
|
||||
/** Creates a new Core instance. */
|
||||
constructor($$source: Partial<Core> = {}) {
|
||||
if (!("App" in $$source)) {
|
||||
this["App"] = null;
|
||||
}
|
||||
if (!("Features" in $$source)) {
|
||||
this["Features"] = null;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Core instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): Core {
|
||||
const $$createField1_0 = $$createType1;
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
if ("Features" in $$parsedSource) {
|
||||
$$parsedSource["Features"] = $$createField1_0($$parsedSource["Features"]);
|
||||
}
|
||||
return new Core($$parsedSource as Partial<Core>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Crypt provides PGP-based encryption, signing, and key management.
|
||||
*/
|
||||
export type Crypt = any;
|
||||
|
||||
/**
|
||||
* Display provides access to windowing and visual elements.
|
||||
*/
|
||||
export type Display = any;
|
||||
|
||||
/**
|
||||
* Features provides a way to check if a feature is enabled.
|
||||
* This is used for feature flagging and conditional logic.
|
||||
*/
|
||||
export class Features {
|
||||
/**
|
||||
* Flags is a list of enabled feature flags.
|
||||
*/
|
||||
"Flags": string[];
|
||||
|
||||
/** Creates a new Features instance. */
|
||||
constructor($$source: Partial<Features> = {}) {
|
||||
if (!("Flags" in $$source)) {
|
||||
this["Flags"] = [];
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Features instance from a string or object.
|
||||
*/
|
||||
static createFrom($$source: any = {}): Features {
|
||||
const $$createField0_0 = $$createType2;
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
if ("Flags" in $$parsedSource) {
|
||||
$$parsedSource["Flags"] = $$createField0_0($$parsedSource["Flags"]);
|
||||
}
|
||||
return new Features($$parsedSource as Partial<Features>);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Message is the interface for all messages that can be sent through the Core's IPC system.
|
||||
* Any struct can be a message, allowing for structured data to be passed between services.
|
||||
* Used with ACTION for fire-and-forget broadcasts.
|
||||
*/
|
||||
export type Message = any;
|
||||
|
||||
/**
|
||||
* Query is the interface for read-only requests that return data.
|
||||
* Used with QUERY (first responder) or QUERYALL (all responders).
|
||||
*/
|
||||
export type Query = any;
|
||||
|
||||
/**
|
||||
* QueryHandler handles Query requests. Returns (result, handled, error).
|
||||
* If handled is false, the query will be passed to the next handler.
|
||||
*/
|
||||
export type QueryHandler = any;
|
||||
|
||||
/**
|
||||
* Task is the interface for requests that perform side effects.
|
||||
* Used with PERFORM (first responder executes).
|
||||
*/
|
||||
export type Task = any;
|
||||
|
||||
/**
|
||||
* TaskHandler handles Task requests. Returns (result, handled, error).
|
||||
* If handled is false, the task will be passed to the next handler.
|
||||
*/
|
||||
export type TaskHandler = any;
|
||||
|
||||
/**
|
||||
* Workspace provides management for encrypted user workspaces.
|
||||
*/
|
||||
export type Workspace = any;
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = Features.createFrom;
|
||||
const $$createType1 = $Create.Nullable($$createType0);
|
||||
const $$createType2 = $Create.Array($Create.Any);
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import { Call as $Call, CancellablePromise as $CancellablePromise } from "@wailsio/runtime";
|
||||
|
||||
export function Greet(name: string): $CancellablePromise<string> {
|
||||
return $Call.ByID(1411160069, name);
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
import * as GreetService from "./greetservice.js";
|
||||
export {
|
||||
GreetService
|
||||
};
|
||||
2
go.mod
2
go.mod
|
|
@ -10,7 +10,7 @@ require (
|
|||
forge.lthn.ai/core/go-scm v0.2.0
|
||||
forge.lthn.ai/core/go-ws v0.1.3
|
||||
forge.lthn.ai/core/gui v0.1.0
|
||||
forge.lthn.ai/core/mcp v0.1.3
|
||||
forge.lthn.ai/core/mcp v0.2.0
|
||||
github.com/wailsapp/wails/v3 v3.0.0-alpha.74
|
||||
)
|
||||
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -30,8 +30,8 @@ forge.lthn.ai/core/go-ws v0.1.3 h1:TzqFpEcDYcZUFFmrTznfEuVcVdnp2jsRNwAGHeTyXN0=
|
|||
forge.lthn.ai/core/go-ws v0.1.3/go.mod h1:iDbJuR1NT27czjtNIluxnEdLrnfsYQdEBIrsoZnpkCk=
|
||||
forge.lthn.ai/core/gui v0.1.0 h1:NQV7njhxP5U5zYYxjdAx7hbZWT7TnEgQNZnrmDVcG1Q=
|
||||
forge.lthn.ai/core/gui v0.1.0/go.mod h1:8ZLWAUxAkR3+ALEsNVAusXbLgdSx1YOY97imO6ETBL8=
|
||||
forge.lthn.ai/core/mcp v0.1.3 h1:j9RY5dHFpGy2huNVrZCPpNQSyZQw1r4zBPEn+7tI6Ms=
|
||||
forge.lthn.ai/core/mcp v0.1.3/go.mod h1:lJfca35jOwbLV/JnqasPPOp2UQaJXMj74B3k6c5mdko=
|
||||
forge.lthn.ai/core/mcp v0.2.0 h1:qugnm8TWyMg9gvswLAZ0/In7jyQQKtLa+YSyULnmhnU=
|
||||
forge.lthn.ai/core/mcp v0.2.0/go.mod h1:lJfca35jOwbLV/JnqasPPOp2UQaJXMj74B3k6c5mdko=
|
||||
github.com/99designs/gqlgen v0.17.87 h1:pSnCIMhBQezAE8bc1GNmfdLXFmnWtWl1GRDFEE/nHP8=
|
||||
github.com/99designs/gqlgen v0.17.87/go.mod h1:fK05f1RqSNfQpd4CfW5qk/810Tqi4/56Wf6Nem0khAg=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
|
||||
|
|
|
|||
4
main.go
4
main.go
|
|
@ -22,6 +22,7 @@ import (
|
|||
"forge.lthn.ai/core/gui/pkg/display"
|
||||
"forge.lthn.ai/core/ide/icons"
|
||||
"forge.lthn.ai/core/mcp/pkg/mcp"
|
||||
"forge.lthn.ai/core/mcp/pkg/mcp/agentic"
|
||||
"forge.lthn.ai/core/mcp/pkg/mcp/brain"
|
||||
"forge.lthn.ai/core/mcp/pkg/mcp/ide"
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
|
|
@ -95,7 +96,8 @@ func main() {
|
|||
return mcp.New(
|
||||
mcp.WithWorkspaceRoot(cwd),
|
||||
mcp.WithWSHub(hub),
|
||||
mcp.WithSubsystem(brain.New(bridge)),
|
||||
mcp.WithSubsystem(brain.NewDirect()),
|
||||
mcp.WithSubsystem(agentic.NewPrep()),
|
||||
mcp.WithSubsystem(guiMCP.New(c)),
|
||||
)
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue