diff --git a/.gitignore b/.gitignore index 47c4b70..1b0a459 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ build/linux/appimage/build build/windows/nsis/MicrosoftEdgeWebview2Setup.exeide .core/ .idea/ +ide diff --git a/build/Taskfile.yml b/build/Taskfile.yml index 202b709..205be8c 100644 --- a/build/Taskfile.yml +++ b/build/Taskfile.yml @@ -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 diff --git a/build/darwin/Assets.car b/build/darwin/Assets.car new file mode 100644 index 0000000..864e742 Binary files /dev/null and b/build/darwin/Assets.car differ diff --git a/build/darwin/icons.icns b/build/darwin/icons.icns index 1b5bd4c..d156933 100644 Binary files a/build/darwin/icons.icns and b/build/darwin/icons.icns differ diff --git a/frontend/angular.json b/frontend/angular.json index cbf7b58..164b153 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -94,5 +94,8 @@ } } } + }, + "cli": { + "analytics": false } } diff --git a/frontend/bindings/changeme/greetservice.ts b/frontend/bindings/changeme/greetservice.ts deleted file mode 100644 index 760195a..0000000 --- a/frontend/bindings/changeme/greetservice.ts +++ /dev/null @@ -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 { - return $Call.ByID(1411160069, name); -} diff --git a/frontend/bindings/changeme/index.ts b/frontend/bindings/embed/index.ts similarity index 63% rename from frontend/bindings/changeme/index.ts rename to frontend/bindings/embed/index.ts index 50e3f04..8a1384c 100644 --- a/frontend/bindings/changeme/index.ts +++ b/frontend/bindings/embed/index.ts @@ -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"; diff --git a/frontend/bindings/embed/models.ts b/frontend/bindings/embed/models.ts new file mode 100644 index 0000000..95c5db1 --- /dev/null +++ b/frontend/bindings/embed/models.ts @@ -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 = {}) { + + 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); + } +} diff --git a/frontend/bindings/forge.lthn.ai/core/go/pkg/core/core.ts b/frontend/bindings/forge.lthn.ai/core/go/pkg/core/core.ts new file mode 100644 index 0000000..81f0cf9 --- /dev/null +++ b/frontend/bindings/forge.lthn.ai/core/go/pkg/core/core.ts @@ -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 { + return $Call.ByID(4292948361, msg); +} + +/** + * Assets returns the embedded filesystem containing the application's assets. + */ +export function Assets(): $CancellablePromise { + 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 { + 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 { + 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 { + 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 { + return $Call.ByID(4133311524, handler); +} + +/** + * RegisterActions adds multiple IPC handlers to the Core. + */ +export function RegisterActions(...handlers: any[]): $CancellablePromise { + return $Call.ByID(736871669, handlers); +} + +/** + * RegisterQuery adds a query handler to the Core. + */ +export function RegisterQuery(handler: $models.QueryHandler): $CancellablePromise { + return $Call.ByID(3624744914, handler); +} + +/** + * RegisterService adds a new service to the Core. + */ +export function RegisterService(name: string, api: any): $CancellablePromise { + return $Call.ByID(984069509, name, api); +} + +/** + * RegisterTask adds a task handler to the Core. + */ +export function RegisterTask(handler: $models.TaskHandler): $CancellablePromise { + 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 { + 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); diff --git a/frontend/bindings/forge.lthn.ai/core/go/pkg/core/index.ts b/frontend/bindings/forge.lthn.ai/core/go/pkg/core/index.ts new file mode 100644 index 0000000..ac18d4a --- /dev/null +++ b/frontend/bindings/forge.lthn.ai/core/go/pkg/core/index.ts @@ -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"; diff --git a/frontend/bindings/forge.lthn.ai/core/go/pkg/core/models.ts b/frontend/bindings/forge.lthn.ai/core/go/pkg/core/models.ts new file mode 100644 index 0000000..80cd351 --- /dev/null +++ b/frontend/bindings/forge.lthn.ai/core/go/pkg/core/models.ts @@ -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 = {}) { + 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); + } +} + +/** + * 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 = {}) { + 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); + } +} + +/** + * 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); diff --git a/frontend/bindings/github.com/host-uk/core/internal/core-ide/greetservice.ts b/frontend/bindings/github.com/host-uk/core/internal/core-ide/greetservice.ts deleted file mode 100644 index 760195a..0000000 --- a/frontend/bindings/github.com/host-uk/core/internal/core-ide/greetservice.ts +++ /dev/null @@ -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 { - return $Call.ByID(1411160069, name); -} diff --git a/frontend/bindings/github.com/host-uk/core/internal/core-ide/index.ts b/frontend/bindings/github.com/host-uk/core/internal/core-ide/index.ts deleted file mode 100644 index 50e3f04..0000000 --- a/frontend/bindings/github.com/host-uk/core/internal/core-ide/index.ts +++ /dev/null @@ -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 -}; diff --git a/go.mod b/go.mod index ed78604..ca17c82 100644 --- a/go.mod +++ b/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 ) diff --git a/go.sum b/go.sum index cabfcc1..ee6ab73 100644 --- a/go.sum +++ b/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= diff --git a/main.go b/main.go index 9b91244..7637e6b 100644 --- a/main.go +++ b/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)), ) }),