# cspotcode/flow.launcher.plugin.edgeworkspaces architecture

> Architecture diagram of the GitHub repository cspotcode/flow.launcher.plugin.edgeworkspaces, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cspotcode/flow.launcher.plugin.edgeworkspaces
- Repository: https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces

## Overview

This Flow Launcher plugin searches workspaces across installed Edge instances and profiles, returning fuzzy-matched results that users can open. The runtime discovers Edge installations, finds profiles, reads legacy cache or newer sync data, then decodes and aggregates workspace records before sending results through Flow Launcher’s JSON-RPC interface. Selecting a result launches Edge with the profile and workspace ID. The LevelDB and protobuf internals are shown because they implement the newer format; unsampled source relationships are omitted.

Main entry points: [`src/main.ts`](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/main.ts) (Plugin runtime), [`src/edge-workspaces.ts`](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-workspaces.ts) (Profile discovery), [`src/edge-instances.ts`](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-instances.ts) (Instance discovery), [`src/leveldb-reader.ts`](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/leveldb-reader.ts) (LevelDB reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launcher["Launcher workflow"]
  node_runtime["Plugin runtime<br/>[main.ts]"]
  node_flowapi["Flow JSON-RPC<br/>[flow-api.ts]"]
  node_fuse["Fuzzy matching"]
end

subgraph group_discovery["Edge discovery"]
  node_discovery["Instance discovery<br/>[edge-instances.ts]"]
  node_profiles["Profile discovery<br/>[edge-workspaces.ts]"]
end

subgraph group_parsing["Workspace parsing"]
  node_workspaceparse["Workspace parsing<br/>[edge-workspaces.ts]"]
end

subgraph group_internals["Data format internals"]
  node_leveldb["LevelDB reader<br/>[leveldb-reader.ts]"]
  node_binary["Binary readers<br/>[binary-readers.ts]"]
  node_protobuf["Protobuf decoder<br/>[protobuf.ts]"]
  node_generated["Generated entity types"]
  node_schema["Workspace schema"]
end

node_user(("User"))
node_flow["Flow Launcher"]
node_edge["Edge application"]
node_edgefiles[("Edge installation and profile data")]

node_user -->|"searches or selects"| node_flow
node_flow -->|"invokes plugin"| node_runtime
node_runtime -->|"reads requests; writes results"| node_flowapi
node_runtime -->|"discovers instances"| node_discovery
node_runtime -->|"lists profiles and workspaces"| node_profiles
node_runtime -->|"matches query"| node_fuse
node_runtime -->|"launches workspace"| node_edge
node_discovery -->|"checks installation paths"| node_edgefiles
node_profiles -->|"checks profile data"| node_edgefiles
node_profiles -->|"parses workspace data"| node_workspaceparse
node_workspaceparse -->|"reads sync database"| node_leveldb
node_workspaceparse -->|"decodes sync entities"| node_protobuf
node_leveldb -->|"reads binary fields"| node_binary
node_protobuf -->|"decodes with schema types"| node_generated
node_generated -->|"implements message definitions"| node_schema

click node_runtime "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/main.ts"
click node_flowapi "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/flow-api.ts"
click node_discovery "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-instances.ts"
click node_profiles "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-workspaces.ts"
click node_workspaceparse "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-workspaces.ts"
click node_leveldb "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/leveldb-reader.ts"
click node_binary "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/binary-readers.ts"
click node_protobuf "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/protobuf.ts"
click node_generated "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/gen/edge_workspaces_pb.ts"
click node_schema "https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/proto/edge_workspaces.proto"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runtime,node_flowapi,node_fuse,node_user toneBlue
class node_discovery,node_profiles,node_edgefiles toneAmber
class node_workspaceparse toneMint
class node_leveldb,node_binary,node_protobuf,node_generated,node_schema toneRose
class node_flow,node_edge toneIndigo
```

## Components

### Launcher workflow

- [Plugin runtime](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/main.ts): `src/main.ts`
- [Flow JSON-RPC](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/flow-api.ts): `src/flow-api.ts`
- **Fuzzy matching**

### Edge discovery

- [Instance discovery](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-instances.ts): `src/edge-instances.ts`
- [Profile discovery](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-workspaces.ts): `src/edge-workspaces.ts`

### Workspace parsing

- [Workspace parsing](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/edge-workspaces.ts): `src/edge-workspaces.ts`

### Data format internals

- [LevelDB reader](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/leveldb-reader.ts): `src/leveldb-reader.ts`
- [Binary readers](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/binary-readers.ts): `src/binary-readers.ts`
- [Protobuf decoder](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/protobuf.ts): `src/protobuf.ts`
- [Generated entity types](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/src/gen/edge_workspaces_pb.ts): `src/gen/edge_workspaces_pb.ts`
- [Workspace schema](https://github.com/cspotcode/flow.launcher.plugin.edgeworkspaces/blob/main/proto/edge_workspaces.proto): `proto/edge_workspaces.proto`

### Other components

- **User**
- **Flow Launcher**
- **Edge application**
- **Edge installation and profile data**

## Connections

- User → Flow Launcher: searches or selects (evidence: `README.md`)
- Flow Launcher → Plugin runtime: invokes plugin (evidence: `README.md`)
- Plugin runtime → Flow JSON-RPC: reads requests; writes results (evidence: `src/main.ts`)
- Plugin runtime → Instance discovery: discovers instances (evidence: `src/main.ts`)
- Plugin runtime → Profile discovery: lists profiles and workspaces (evidence: `src/main.ts`)
- Plugin runtime → Fuzzy matching: matches query (evidence: `src/main.ts`)
- Plugin runtime → Edge application: launches workspace (evidence: `src/main.ts`)
- Instance discovery → Edge installation and profile data: checks installation paths (evidence: `src/edge-instances.ts`)
- Profile discovery → Edge installation and profile data: checks profile data (evidence: `src/edge-workspaces.ts`)
- Profile discovery → Workspace parsing: parses workspace data (evidence: `src/edge-workspaces.ts`)
- Workspace parsing → LevelDB reader: reads sync database (evidence: `src/edge-workspaces.ts`)
- Workspace parsing → Protobuf decoder: decodes sync entities (evidence: `src/edge-workspaces.ts`)
- LevelDB reader → Binary readers: reads binary fields (evidence: `src/leveldb-reader.ts`)
- Protobuf decoder → Generated entity types: decodes with schema types (evidence: `src/protobuf.ts`)
- Generated entity types → Workspace schema: implements message definitions (evidence: `src/gen/edge_workspaces_pb.ts`)
