@yannelli/paseo-linear-plugin 1.1.0-beta.2 → 1.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/OVERVIEW.md +6 -2
- package/README.md +20 -6
- package/client/live-graph.tsx +6 -3
- package/client/live-header.tsx +26 -2
- package/client/live-map.tsx +7 -1
- package/client/live-panel.tsx +9 -2
- package/client/live-timeline.ts +36 -5
- package/client/project-init.tsx +28 -4
- package/client/project-knowledge.tsx +87 -0
- package/client/settings-projects.tsx +16 -5
- package/index.server.ts +5 -2
- package/package.json +1 -1
- package/server/init.ts +31 -7
- package/server/inspect.ts +392 -0
- package/server/knowledge.ts +157 -0
- package/server/live.ts +21 -3
- package/server/stores.ts +1 -1
- package/shared/knowledge.ts +255 -0
- package/shared/live.ts +19 -3
- package/shared/map-model.ts +50 -2
- package/shared/project-setup.ts +3 -2
package/OVERVIEW.md
CHANGED
|
@@ -39,9 +39,13 @@ In **Settings → Plugins → Linear → Icon**, choose an SVG file or paste SVG
|
|
|
39
39
|
|
|
40
40
|
Turn on **Update Linear from agent todos** in the Live settings. After each turn, a todo that starts with a sub-issue key, such as `ENG-124: add the queue`, moves that sub-issue to In Progress, and then to Done when all its todos are done. The parent moves to In Review when every sub-issue is done, never to Done. Statuses only move forward.
|
|
41
41
|
|
|
42
|
+
## Project knowledge
|
|
43
|
+
|
|
44
|
+
The daemon keeps a map of each project's files without an agent: its folders, services, packages, languages, commands, and guide files. Explore and setup agents start from it. Ticket-text maps use it to match short paths to real files and to put a named service on the map. When an agent works off the map, Linear Live shows the service or folder it is in. See it, or inspect again, under **Project knowledge** in **Projects**.
|
|
45
|
+
|
|
42
46
|
## Set up project prompts
|
|
43
47
|
|
|
44
|
-
In **Projects**, select **Start** under **Set up with an agent**. An agent reads the repository's guidelines, scripts, and CI files and proposes project instructions, steps, and prompt additions. You accept each change before it is saved.
|
|
48
|
+
In **Projects**, select **Start** under **Set up with an agent**. An agent reads the repository's guidelines, scripts, and CI files and proposes project instructions, steps, and prompt additions. You accept each change before it is saved. **Open agent** shows the agent while it works, and the lines it writes about the project and its areas go into the project knowledge.
|
|
45
49
|
|
|
46
50
|
## Choose projects
|
|
47
51
|
|
|
@@ -53,4 +57,4 @@ Choose **Attach Linear issue** in the composer attachment menu. The agent gets t
|
|
|
53
57
|
|
|
54
58
|
## Data and permissions
|
|
55
59
|
|
|
56
|
-
Only the daemon sends requests to `https://api.linear.app/graphql`. The daemon never sends a key back to the app. Paseo sends the prompt, with the issue snapshot, to the agent provider. Explore and setup agents read project files and send them to your agent provider. The daemon saves explore maps, and agents that wait for a map, beside the key file, and Linear Live lists and reads files only inside the agent's folder. For Claude agents, the daemon also reads the subagent transcripts Claude saves for the session, to show what each subagent does. With agent guidance on, it writes Claude Code hooks with the issue keys and titles beside the key file, and it serves the Linear tools on 127.0.0.1 with a token for each agent. Each token reaches only its issue and that issue's sub-issues. With todo sync on, the daemon changes issue statuses in Linear. The daemon keeps recent Linear responses in memory for up to 24 hours, and the list shows them with **Showing saved results. Updating…** while it gets new data.
|
|
60
|
+
Only the daemon sends requests to `https://api.linear.app/graphql`. The daemon never sends a key back to the app. Paseo sends the prompt, with the issue snapshot, to the agent provider. Explore and setup agents read project files and send them to your agent provider. The daemon saves explore maps, project knowledge, and agents that wait for a map, beside the key file, and Linear Live lists and reads files only inside the agent's folder. For Claude agents, the daemon also reads the subagent transcripts Claude saves for the session, to show what each subagent does. With agent guidance on, it writes Claude Code hooks with the issue keys and titles beside the key file, and it serves the Linear tools on 127.0.0.1 with a token for each agent. Each token reaches only its issue and that issue's sub-issues. With todo sync on, the daemon changes issue statuses in Linear. The daemon keeps recent Linear responses in memory for up to 24 hours, and the list shows them with **Showing saved results. Updating…** while it gets new data.
|
package/README.md
CHANGED
|
@@ -156,16 +156,16 @@ The **Linear** screen in the sidebar is not tied to a project, so it stays avail
|
|
|
156
156
|
Linear Live is an agent panel. Open it from the Linear pill, or with **Linear: Open Linear Live** in the command center while an agent is open. It works for agents started from an issue, with Claude, Codex, and other providers.
|
|
157
157
|
|
|
158
158
|
- **Sub-issues:** each sub-issue shows its Linear status and the agent's todo progress. The todos of the current sub-issue show under it. Select a sub-issue to show only its files on the map. Hide the issues column with the button on the **Issue** card to give the map or the graph the full width. The column becomes a strip with the status of each issue. Select an issue there to show only its files.
|
|
159
|
-
- **Map:** files are grouped by folder. The map marks the files the agent read, edited, or created, and the file it is on now. Files the agent touched but the map did not predict have a dashed border. A folder the agent listed or searched gets a solid border, and its header shows how many of its files the agent touched. Reads through the shell count too: `cat`, `sed -n`, `head`, `grep`, `rg`, `ls`, `find`, `git show`, and redirects to files.
|
|
160
|
-
- **Graph:** the files and the links between them. A line joins two files when one imports the other, a Markdown or style file links to the other, `package.json` names it, or the text of one names the path of the other. This works for TypeScript and JavaScript (with `tsconfig` paths and workspace packages), Python, Go, Rust, Ruby, CSS and Sass, Markdown, HTML, and config files. Files of one folder sit together under the folder name and take the color of their sub-issue. The issue is in the center, with its sub-issues joined to the files the map gives them. The agent hovers over what it works on: the file it reads or edits, or the sub-issue whose todo it just started. When the work moves, it glides along the links to the next node, and the lines at that node take its color. New files join without moving the rest. Agents that this agent started get their own cursor when they work in the same folder or in a worktree of the same project. An agent with no file activity yet hovers over the sub-issue whose key starts its title. Running subagents circle the agent that started them. Select a sub-issue to show only its files. Select any node to see what it is
|
|
159
|
+
- **Map:** files are grouped by folder. The map marks the files the agent read, edited, or created, and the file it is on now. Files the agent touched but the map did not predict have a dashed border. A folder the agent listed or searched gets a solid border, and its header shows how many of its files the agent touched. The header also names the service, package, or main folder the folder is in, from the [project knowledge](#project-knowledge). When the agent touches files the map did not predict, the line under the map tells where they are, such as `Off the map: billing-api · service (2), docs (1)`, and the **Now** line in the header shows **Off the map** with the place of the current file. Reads through the shell count too: `cat`, `sed -n`, `head`, `grep`, `rg`, `ls`, `find`, `git show`, and redirects to files.
|
|
160
|
+
- **Graph:** the files and the links between them. A line joins two files when one imports the other, a Markdown or style file links to the other, `package.json` names it, or the text of one names the path of the other. This works for TypeScript and JavaScript (with `tsconfig` paths and workspace packages), Python, Go, Rust, Ruby, CSS and Sass, Markdown, HTML, and config files. Files of one folder sit together under the folder name and take the color of their sub-issue. The issue is in the center, with its sub-issues joined to the files the map gives them. The agent hovers over what it works on: the file it reads or edits, or the sub-issue whose todo it just started. When the work moves, it glides along the links to the next node, and the lines at that node take its color. New files join without moving the rest. Agents that this agent started get their own cursor when they work in the same folder or in a worktree of the same project. An agent with no file activity yet hovers over the sub-issue whose key starts its title. Running subagents circle the agent that started them. Select a sub-issue to show only its files. Select any node to see what it is, how many files it links to, and for an off-map file, the service or folder it is in. Switch between **Map** and **Graph** on the card, or set the default in **Show files as** in the Live settings.
|
|
161
161
|
- **Graph view:** the icon buttons at the top right of the graph move the view. **Follow the running agents** zooms to the nodes the running agents work on and the files next to them, and moves with the agents. **Show the whole graph** zooms out. **Zoom out** and **Zoom in** change the zoom in steps. Scroll to zoom at the pointer, drag to move when zoomed in, or pinch on a touch screen. Each of these stops following. The lock button lets the wheel and drags scroll the page instead. Nodes, lines, and labels keep their size when you zoom, and more file names show when there is room. The graph keeps your follow and lock choices.
|
|
162
162
|
- **Agents:** the agents that work under this agent. Paseo agents that this agent started show their status, their files, and their own markers on the map when they work in the same folder or in a worktree of the same project. Select one to open it. Subagents that run inside the provider, such as Claude's Agent tool, show their type, description, and status. For Claude, the daemon reads each subagent's transcript, also for subagents that run in the background, so a subagent shows what it does now, gets its own cursor, and adds its files to the map. Other providers do not send subagent file reads, so the map shows only the files named in the subagent's prompt.
|
|
163
163
|
- **Activity:** the latest reads, edits, searches, and commands, with line counts and exit codes.
|
|
164
164
|
|
|
165
165
|
The map comes from one of two sources. Choose it in **Settings → Plugins → Linear → Live**:
|
|
166
166
|
|
|
167
|
-
- **Ticket text** (the default) finds file and folder paths in the issue title, description, and sub-issue titles. It costs nothing, but it finds only paths the issue names. Linear sends sub-issue titles but not their descriptions.
|
|
168
|
-
- **Explore agent** maps the files first when you start an implement agent. It reads the repository and lists the files for each sub-issue. The implement agent starts when the map is ready, or with the ticket-text map if exploring fails. A saved map is used again, so each issue is explored once. The plugin archives the explore agent when it finishes. Choose its model and effort in the Live settings. A faster, cheaper model, such as Haiku, is usually enough. It lists up to 150 files.
|
|
167
|
+
- **Ticket text** (the default) finds file and folder paths in the issue title, description, and sub-issue titles. It costs nothing, but it finds only paths the issue names. Linear sends sub-issue titles but not their descriptions. With project knowledge, a short path such as `queries.ts` becomes the one project file that ends with it, and a service or package that the text names, such as `billing-api` or "the billing service", puts its folder on the map. A plain folder counts only when the text calls it a folder, such as "the docs folder".
|
|
168
|
+
- **Explore agent** maps the files first when you start an implement agent. It starts from the project map in the project knowledge, reads the repository, and lists the files for each sub-issue. The implement agent starts when the map is ready, or with the ticket-text map if exploring fails. A saved map is used again, so each issue is explored once. The plugin archives the explore agent when it finishes. Choose its model and effort in the Live settings. A faster, cheaper model, such as Haiku, is usually enough. It lists up to 150 files.
|
|
169
169
|
|
|
170
170
|
The buttons on the map card control the saved map. **Read files and links again** reloads the map, the folder lists, and the links. **Build** or **Rebuild the map with the explore agent** starts an explore run now and replaces the saved map when it finishes. **Clear the saved map** deletes it, so the map uses the ticket text until the next explore run. You cannot clear a map while an explore run makes it.
|
|
171
171
|
|
|
@@ -199,9 +199,20 @@ Turn on **Update Linear from agent todos** in the Live settings. After each turn
|
|
|
199
199
|
|
|
200
200
|
The daemon reads the issue from Linear before each sync, so a status you changed by hand counts. **Sync now** in the pill runs the same check at once.
|
|
201
201
|
|
|
202
|
+
### Project knowledge
|
|
203
|
+
|
|
204
|
+
The daemon keeps a map of each project's files, so explore and setup agents, ticket-text maps, and Linear Live know the project before an agent reads it. No agent runs for it, and it costs no provider usage. The daemon makes it the first time a project needs it: when you open the project in **Settings → Plugins → Linear → Projects**, open Linear Live for one of its agents, or start an explore or setup run. It makes it again when it is 6 hours old, and **Inspect again** under **Project knowledge** makes it at once.
|
|
205
|
+
|
|
206
|
+
- **Files:** the files git tracks or would track, without ignored files. Outside a git repository, the daemon walks the folder and skips folders such as `node_modules`, `dist`, and `.git`. It keeps up to 20,000 paths, the shallow ones first.
|
|
207
|
+
- **Areas:** services, packages, and main folders. A folder with a manifest such as `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`, or a `.csproj` file is a package, named by the manifest. A folder with a `Dockerfile`, `Procfile`, `fly.toml`, or a similar file, a folder that a compose file builds, and a package under a folder such as `apps/` or `services/` is a service. Each top folder is an area too, and so is each subfolder of a top folder that holds 40% or more of the files. Folder names give a role, such as backend, frontend, tests, or docs. Manifests in fixture, example, and template folders do not count.
|
|
208
|
+
- **Languages, commands, and guides:** file counts by language, the root package scripts and Makefile targets, and files that guide agents, such as `AGENTS.md`, `CLAUDE.md`, the README, CONTRIBUTING, and CI workflows.
|
|
209
|
+
- **Summaries:** the setup agent adds one line about the project and one line about each area. They stay when the daemon makes the map again.
|
|
210
|
+
|
|
211
|
+
The **Project knowledge** section in the Projects settings shows what the daemon found.
|
|
212
|
+
|
|
202
213
|
### Set up project prompts with an agent
|
|
203
214
|
|
|
204
|
-
In **Settings → Plugins → Linear → Projects**, select **Start** under **Set up with an agent**.
|
|
215
|
+
In **Settings → Plugins → Linear → Projects**, select **Start** under **Set up with an agent**. The daemon makes the project knowledge again first, and the agent starts from that project map. While it runs, **Open agent** opens the setup agent so you can watch it. The agent reads the project's AGENTS.md, CLAUDE.md, CONTRIBUTING, README, scripts, and CI files. It then proposes project instructions, steps, and text to add to the Implement and Review prompts. Each change shows the current and proposed text. Turn off the ones you do not want, select **Use accepted changes**, and then save. Nothing changes until you save. The agent also describes the project and each area, and the daemon saves those lines to the project knowledge at once.
|
|
205
216
|
|
|
206
217
|
## Data and permissions
|
|
207
218
|
|
|
@@ -209,6 +220,7 @@ In **Settings → Plugins → Linear → Projects**, select **Start** under **Se
|
|
|
209
220
|
- **Data sent to Linear:** queries for issues, teams, users, and comments, and the changes you make. When you start an agent with the options on, the plugin moves the issue to In Progress and assigns it to you.
|
|
210
221
|
- **Data sent to the agent provider:** the prompt. It holds the template text and an issue snapshot: identifier, title, URL, team, status, priority, assignee, project, labels, parent, description, sub-issues, and links. It holds comments only when **Include comments in the prompt** is on. It also holds the project instructions and steps from the Projects settings. An attached issue sends the identifier, title, URL, status, priority, assignee, project, labels, and description.
|
|
211
222
|
- **Linear Live and setup agents:** the explore agent gets the issue snapshot without comments, and both agents read files in the project. Your agent provider gets what they read. The map of an explore run is saved in `live-maps.json` beside the key file, for up to 200 issues. An agent that waits for a map is saved in `pending-launches.json` there until it starts. Linear Live lists files only in the folders it shows, and reads the files on the graph to find their links, inside the agent's own folder. It does not follow links that lead outside that folder. For a Claude agent with subagents, the daemon reads the tool calls in the subagent transcripts that Claude saves for that session. It sends the app only the tool names, file paths, and commands, never file text.
|
|
223
|
+
- **Project knowledge:** the daemon lists the files of a Paseo project with `git ls-files`, or by walking the folder, and reads small manifest files (up to 256 KB) inside the project folder. It does not follow links that lead outside the folder. It saves file paths, manifest names, script names, and summaries in `knowledge/` beside the key file, one file per project. The app gets the areas, counts, commands, and guides, never the file list. Explore and setup prompts hold the project map: folder names with file counts, areas, commands, and guide file names. Your agent provider gets that text.
|
|
212
224
|
- **Linear tools for agents:** the daemon runs the `linear` MCP server on `127.0.0.1` only, and only after an agent gets it. Each agent gets its own random token, and its tools reach only its issue and that issue's sub-issues. Edits use the Linear key of the project that loaded the issue. Requests from a web page are refused. `agent-tools.json` beside the key file keeps the port and a hash of each token, so agents keep their tools after a restart. The token itself is in the agent's Paseo config.
|
|
213
225
|
- **Claude hooks:** when an **Agent guidance** switch is on for a Claude agent, the daemon writes a Claude Code plugin to `claude-hooks/` beside the key file, one folder for each issue and set of hooks. It holds the issue key and title and the sub-issue keys and titles. The agent starts with `--plugin-dir` set to that folder. The hooks print that text and run no other command. The daemon does not write hooks on Windows hosts.
|
|
214
226
|
- **Todo sync:** when it is on, the daemon changes issue statuses in Linear with the key of the project that loaded the issue.
|
|
@@ -240,7 +252,7 @@ Linear errors, such as a rejected key or a rate limit, show in the panel or as a
|
|
|
240
252
|
| `client/live-map.tsx`, `client/live-graph.tsx`, `client/graph-labels.ts`, `client/graph-camera.tsx`, `client/live-cursor.tsx`, `client/live-agents.tsx` | App | File map, file graph with its labels and camera, agent cursors, and the agents list |
|
|
241
253
|
| `client/tool-buttons.tsx`, `client/web.ts` | App | Icon buttons for the map and graph, and the wheel listener and file picker on the web |
|
|
242
254
|
| `client/pill.tsx` | App | Linear pill in each agent's composer |
|
|
243
|
-
| `client/project-init.tsx` | App | Project setup proposal in the Projects settings |
|
|
255
|
+
| `client/project-init.tsx`, `client/project-knowledge.tsx` | App | Project setup proposal and the Project knowledge section in the Projects settings |
|
|
244
256
|
| `shared/linear.ts` | Both | RPC contracts and issue schemas |
|
|
245
257
|
| `shared/issues.ts` | Both | The `issues.search` RPC and the composer attachment source |
|
|
246
258
|
| `shared/settings.ts` | Both | Settings schema: templates, agent defaults, and project settings |
|
|
@@ -252,6 +264,7 @@ Linear errors, such as a rejected key or a rate limit, show in the panel or as a
|
|
|
252
264
|
| `shared/agent-hooks.ts`, `server/agent-hooks.ts` | Both, Daemon | Claude Code hooks for agent guidance, and the plugin folder the daemon writes |
|
|
253
265
|
| `shared/agent-tools.ts`, `server/agent-tools.ts`, `server/mcp-http.ts` | Both, Daemon | The `linear` MCP server: its tools, tokens, and HTTP transport |
|
|
254
266
|
| `shared/todo-sync.ts`, `shared/project-setup.ts` | Both | Todo keys, status moves, and setup proposals |
|
|
267
|
+
| `shared/knowledge.ts` | Both | Project knowledge contracts, areas and their labels, the project map for prompts, and ticket path matching |
|
|
255
268
|
| `server/handlers.ts` | Daemon | RPC handlers, key lookup, and cache use |
|
|
256
269
|
| `server/credentials.ts` | Daemon | Key file and key order |
|
|
257
270
|
| `server/cache.ts` | Daemon | Response cache in memory |
|
|
@@ -259,6 +272,7 @@ Linear errors, such as a rejected key or a rate limit, show in the panel or as a
|
|
|
259
272
|
| `server/linear.ts` | Daemon | Search and snapshot text for the composer attachment |
|
|
260
273
|
| `server/live.ts`, `server/links.ts`, `server/subagent-logs.ts`, `server/agent-runs.ts` | Daemon | File listing, links between files, subagent transcripts, explore runs, and the saved maps |
|
|
261
274
|
| `server/sync.ts`, `server/init.ts` | Daemon | Todo sync after each turn, and project setup runs |
|
|
275
|
+
| `server/inspect.ts`, `server/knowledge.ts` | Daemon | Project inspection without an agent, and the saved project knowledge |
|
|
262
276
|
|
|
263
277
|
The client bundle holds no credentials and makes no calls to Linear.
|
|
264
278
|
|
package/client/live-graph.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Animated, type LayoutChangeEvent, Pressable, StyleSheet, Text, View } f
|
|
|
3
3
|
import { focusBox, project, unproject } from "../shared/graph-camera";
|
|
4
4
|
import type { Placed, Point } from "../shared/graph-geometry";
|
|
5
5
|
import { focusNode, type Graph, type GraphEdge, type GraphNode, graphKey, layoutGraph } from "../shared/graph-model";
|
|
6
|
+
import { type AreaRef, whereLabel } from "../shared/knowledge";
|
|
6
7
|
import type { IssueDetail, WorkflowState } from "../shared/linear";
|
|
7
8
|
import type { GraphCamera } from "../shared/settings";
|
|
8
9
|
import { CameraButtons, useGraphCamera } from "./graph-camera";
|
|
@@ -29,6 +30,8 @@ export interface GraphViewProps {
|
|
|
29
30
|
progress: IssueProgress;
|
|
30
31
|
owners: OwnerColors;
|
|
31
32
|
agents: readonly CursorAgent[];
|
|
33
|
+
/** Areas of the project, to say where an off-map file is. */
|
|
34
|
+
areas: readonly AreaRef[];
|
|
32
35
|
focus: string | null;
|
|
33
36
|
onFocus(key: string): void;
|
|
34
37
|
/** Saved camera mode: follow the running agents, or show the whole graph. */
|
|
@@ -223,7 +226,7 @@ const GraphNodeView = memo(function GraphNodeView(props: NodeProps) {
|
|
|
223
226
|
);
|
|
224
227
|
}, sameNode);
|
|
225
228
|
|
|
226
|
-
function caption(node: GraphNode, issue: IssueDetail, graph: Graph): string {
|
|
229
|
+
function caption(node: GraphNode, issue: IssueDetail, graph: Graph, areas: readonly AreaRef[]): string {
|
|
227
230
|
if (node.kind === "issue") return `${issue.identifier} · ${issue.title}`;
|
|
228
231
|
if (node.kind === "subissue") {
|
|
229
232
|
const child = issue.children.find((entry) => entry.identifier.toUpperCase() === node.label);
|
|
@@ -231,7 +234,7 @@ function caption(node: GraphNode, issue: IssueDetail, graph: Graph): string {
|
|
|
231
234
|
return `${node.label} · ${child?.state.name ?? ""} · ${child?.title ?? ""}${folded}`;
|
|
232
235
|
}
|
|
233
236
|
const tile = node.tile;
|
|
234
|
-
const where = tile?.onMap ? `on the map for ${node.owner}` :
|
|
237
|
+
const where = tile?.onMap ? `on the map for ${node.owner}` : `not on the map, in ${whereLabel(node.path ?? "", areas)}`;
|
|
235
238
|
const touch = !tile || tile.touch === "none" ? "not touched yet" : tile.touch;
|
|
236
239
|
const lines = tile && (tile.added > 0 || tile.removed > 0) ? ` · +${tile.added} -${tile.removed}` : "";
|
|
237
240
|
const linked = graph.edges.filter((edge) => edge.kind !== "owns" && (edge.from === node.id || edge.to === node.id)).length;
|
|
@@ -507,7 +510,7 @@ export function LiveGraph(props: GraphViewProps) {
|
|
|
507
510
|
<View style={styles.caption}>
|
|
508
511
|
{selectedNode ? (
|
|
509
512
|
<Text numberOfLines={2} style={styles.captionText}>
|
|
510
|
-
{caption(selectedNode, issue, graph)}
|
|
513
|
+
{caption(selectedNode, issue, graph, props.areas)}
|
|
511
514
|
</Text>
|
|
512
515
|
) : (
|
|
513
516
|
<Text style={styles.hint}>Select a node to see its file or issue.</Text>
|
package/client/live-header.tsx
CHANGED
|
@@ -79,7 +79,7 @@ function StatusChip(props: { theme: Theme; status: AgentStatus; provider: string
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
function NowLine(props: { theme: Theme; event: ActivityEvent; live: boolean }) {
|
|
82
|
+
function NowLine(props: { theme: Theme; event: ActivityEvent; live: boolean; offMap: string | null }) {
|
|
83
83
|
const { theme, event } = props;
|
|
84
84
|
const { colors } = theme;
|
|
85
85
|
const tone = eventTone(theme, event);
|
|
@@ -106,6 +106,18 @@ function NowLine(props: { theme: Theme; event: ActivityEvent; live: boolean }) {
|
|
|
106
106
|
tint: { ...StyleSheet.absoluteFillObject, borderRadius: 6, backgroundColor: tone, opacity: 0.14 },
|
|
107
107
|
text: { color: props.live ? colors.foreground : colors.foregroundMuted, fontSize: 13 },
|
|
108
108
|
detail: { flex: 1, color: colors.foregroundMuted, fontFamily: MONO, fontSize: 11 },
|
|
109
|
+
off: {
|
|
110
|
+
flexShrink: 0,
|
|
111
|
+
maxWidth: 220,
|
|
112
|
+
paddingHorizontal: 7,
|
|
113
|
+
paddingVertical: 2,
|
|
114
|
+
borderRadius: 6,
|
|
115
|
+
borderWidth: 1,
|
|
116
|
+
borderStyle: "dashed",
|
|
117
|
+
borderColor: colors.statusWarning,
|
|
118
|
+
color: colors.statusWarning,
|
|
119
|
+
fontSize: 11,
|
|
120
|
+
},
|
|
109
121
|
}) as const,
|
|
110
122
|
[colors, tone, props.live],
|
|
111
123
|
);
|
|
@@ -124,6 +136,11 @@ function NowLine(props: { theme: Theme; event: ActivityEvent; live: boolean }) {
|
|
|
124
136
|
{event.detail}
|
|
125
137
|
</Text>
|
|
126
138
|
) : null}
|
|
139
|
+
{props.offMap ? (
|
|
140
|
+
<Text numberOfLines={1} style={styles.off} accessibilityLabel={`Off the map, in ${props.offMap}`}>
|
|
141
|
+
{`Off the map · ${props.offMap}`}
|
|
142
|
+
</Text>
|
|
143
|
+
) : null}
|
|
127
144
|
</View>
|
|
128
145
|
);
|
|
129
146
|
}
|
|
@@ -136,6 +153,8 @@ export function LiveHeader(props: {
|
|
|
136
153
|
status: AgentStatus;
|
|
137
154
|
provider: string;
|
|
138
155
|
current: ActivityEvent | null;
|
|
156
|
+
/** Where the current file is when the agent works off the map. */
|
|
157
|
+
offMap: string | null;
|
|
139
158
|
reduceMotion: boolean;
|
|
140
159
|
}) {
|
|
141
160
|
const { theme, issue, progress, owners } = props;
|
|
@@ -204,7 +223,12 @@ export function LiveHeader(props: {
|
|
|
204
223
|
</View>
|
|
205
224
|
{counts.length > 0 ? <Text style={styles.counts}>{counts.join(" · ")}</Text> : null}
|
|
206
225
|
{props.current ? (
|
|
207
|
-
<NowLine
|
|
226
|
+
<NowLine
|
|
227
|
+
theme={theme}
|
|
228
|
+
event={props.current}
|
|
229
|
+
live={props.status === "running"}
|
|
230
|
+
offMap={props.offMap}
|
|
231
|
+
/>
|
|
208
232
|
) : null}
|
|
209
233
|
</View>
|
|
210
234
|
);
|
package/client/live-map.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type MapZone,
|
|
9
9
|
masonry,
|
|
10
10
|
ZONE_GAP,
|
|
11
|
+
zoneAreaLabel,
|
|
11
12
|
} from "../shared/map-model";
|
|
12
13
|
import { NATIVE_DRIVER, type OwnerColors } from "./live-timeline";
|
|
13
14
|
import type { AgentMarker } from "./live-agents";
|
|
@@ -197,7 +198,8 @@ function Zone(props: RepoMapProps & { zone: MapZone }) {
|
|
|
197
198
|
opacity: 0.35,
|
|
198
199
|
},
|
|
199
200
|
header: { flexDirection: "row", alignItems: "center", gap: 6 },
|
|
200
|
-
dir: {
|
|
201
|
+
dir: { flexShrink: 1, color: colors.foregroundMuted, fontFamily: MONO, fontSize: 11 },
|
|
202
|
+
area: { flex: 1, color: colors.foregroundMuted, fontSize: 11, opacity: 0.8 },
|
|
201
203
|
count: { color: hot ? colors.foreground : colors.foregroundMuted, fontSize: 11 },
|
|
202
204
|
tiles: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
|
|
203
205
|
}) as const,
|
|
@@ -207,6 +209,7 @@ function Zone(props: RepoMapProps & { zone: MapZone }) {
|
|
|
207
209
|
let count: string | null = null;
|
|
208
210
|
if (zone.predicted > 0) count = `${zone.hits}/${zone.predicted}${off > 0 ? ` +${off} off` : ""}`;
|
|
209
211
|
else if (off > 0) count = `${off} off the map`;
|
|
212
|
+
const area = zoneAreaLabel(zone);
|
|
210
213
|
return (
|
|
211
214
|
<View style={styles.zone}>
|
|
212
215
|
{hot ? <View pointerEvents="none" style={styles.ring} /> : null}
|
|
@@ -219,6 +222,9 @@ function Zone(props: RepoMapProps & { zone: MapZone }) {
|
|
|
219
222
|
<Text numberOfLines={1} style={styles.dir}>
|
|
220
223
|
{zone.dir || "./"}
|
|
221
224
|
</Text>
|
|
225
|
+
<Text numberOfLines={1} style={styles.area}>
|
|
226
|
+
{area ?? ""}
|
|
227
|
+
</Text>
|
|
222
228
|
{count ? <Text style={styles.count}>{count}</Text> : null}
|
|
223
229
|
</View>
|
|
224
230
|
<View style={styles.tiles}>
|
package/client/live-panel.tsx
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
useMapModel,
|
|
24
24
|
useReduceMotion,
|
|
25
25
|
} from "./live-timeline";
|
|
26
|
-
import { hitRateLine } from "../shared/map-model";
|
|
26
|
+
import { hitRateLine, offMapLine, offMapWhere } from "../shared/map-model";
|
|
27
27
|
import { useIssue } from "./queries";
|
|
28
28
|
import { Button, EmptyState, errorMessage, IconButton, type Theme } from "./ui";
|
|
29
29
|
|
|
@@ -219,7 +219,10 @@ function LiveView(props: BodyProps & { issue: IssueDetail }) {
|
|
|
219
219
|
provider: agent.provider,
|
|
220
220
|
activity,
|
|
221
221
|
});
|
|
222
|
-
const model = useMapModel(agentId, liveMap.map.files, agents.files, agents.dirs);
|
|
222
|
+
const model = useMapModel(agentId, liveMap.map.files, agents.files, agents.dirs, liveMap.areas);
|
|
223
|
+
const offMap = offMapLine(model);
|
|
224
|
+
const currentPath = activity.current?.path ?? null;
|
|
225
|
+
const where = useMemo(() => offMapWhere(model, currentPath, liveMap.areas), [model, currentPath, liveMap.areas]);
|
|
223
226
|
// Hold the map until its first full data, so it does not draw once and then swap.
|
|
224
227
|
const mapShown = useRef(false);
|
|
225
228
|
if (liveMap.ready && model.ready) mapShown.current = true;
|
|
@@ -300,6 +303,7 @@ function LiveView(props: BodyProps & { issue: IssueDetail }) {
|
|
|
300
303
|
main: { flex: 1, minWidth: 0 },
|
|
301
304
|
mainContent: { gap: 16, paddingBottom: 32 },
|
|
302
305
|
hit: { color: colors.foregroundMuted, fontSize: 12 },
|
|
306
|
+
off: { color: colors.statusWarning, fontSize: 12 },
|
|
303
307
|
tools: { flexDirection: "row", alignItems: "center", gap: 12 },
|
|
304
308
|
mapHead: { gap: 8 },
|
|
305
309
|
mapWait: { minHeight: 240, alignItems: "center", justifyContent: "center" },
|
|
@@ -316,6 +320,7 @@ function LiveView(props: BodyProps & { issue: IssueDetail }) {
|
|
|
316
320
|
status={agent.status}
|
|
317
321
|
provider={agent.provider}
|
|
318
322
|
current={activity.current}
|
|
323
|
+
offMap={where}
|
|
319
324
|
reduceMotion={reduceMotion}
|
|
320
325
|
/>
|
|
321
326
|
);
|
|
@@ -351,6 +356,7 @@ function LiveView(props: BodyProps & { issue: IssueDetail }) {
|
|
|
351
356
|
) : (
|
|
352
357
|
<View style={styles.mapHead}>
|
|
353
358
|
<Text style={styles.hit}>{hitRateLine(model)}</Text>
|
|
359
|
+
{offMap ? <Text style={styles.off}>{offMap}</Text> : null}
|
|
354
360
|
{graph ? (
|
|
355
361
|
<LiveGraph
|
|
356
362
|
theme={theme}
|
|
@@ -362,6 +368,7 @@ function LiveView(props: BodyProps & { issue: IssueDetail }) {
|
|
|
362
368
|
progress={progress}
|
|
363
369
|
owners={owners}
|
|
364
370
|
agents={cursors}
|
|
371
|
+
areas={liveMap.areas}
|
|
365
372
|
focus={focus}
|
|
366
373
|
onFocus={toggleFocus}
|
|
367
374
|
camera={props.graphCamera}
|
package/client/live-timeline.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { keepPreviousData, useMutation, useQuery, useQueryClient } from "@tansta
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { AccessibilityInfo, Platform } from "react-native";
|
|
5
5
|
import type { DirTouch, FileTouch, TimelineItemLike } from "../shared/activity";
|
|
6
|
+
import { type AreaRef, liveProjectRpc, MAX_RESOLVE_PATHS } from "../shared/knowledge";
|
|
6
7
|
import type { IssueDetail } from "../shared/linear";
|
|
7
8
|
import type { FileLink } from "../shared/links";
|
|
8
9
|
import {
|
|
@@ -240,6 +241,8 @@ export function ownerColors(issue: IssueDetail, accent: string): OwnerColors {
|
|
|
240
241
|
// runs, and slowly while there is no map, since a launch can start a job after this mounts.
|
|
241
242
|
export interface LiveMap {
|
|
242
243
|
map: IssueMap;
|
|
244
|
+
/** Services, packages, and main folders of the agent's project, from its saved knowledge. */
|
|
245
|
+
areas: readonly AreaRef[];
|
|
243
246
|
stored: boolean;
|
|
244
247
|
/** The stored map has been read once, so the map no longer swaps from the fallback. */
|
|
245
248
|
ready: boolean;
|
|
@@ -282,13 +285,14 @@ export function useLiveMap(
|
|
|
282
285
|
const refresh = useCallback(() => void queries.invalidateQueries({ queryKey: ["linear", "live"] }), [queries]);
|
|
283
286
|
const clearMap = useRpc(clearMapRpc);
|
|
284
287
|
const clear = useMutation({ mutationFn: () => clearMap({ agentId }), onSettled: refresh });
|
|
285
|
-
const
|
|
288
|
+
const project = useProjectKnowledge(agentId, issue);
|
|
286
289
|
const stored = query.data?.map ?? null;
|
|
287
290
|
const failure = explore.error ?? clear.error ?? query.error;
|
|
288
291
|
return {
|
|
289
|
-
map: stored ?? fallback,
|
|
292
|
+
map: stored ?? project.fallback,
|
|
293
|
+
areas: project.areas,
|
|
290
294
|
stored: stored !== null,
|
|
291
|
-
ready: query.data !== undefined || query.isError,
|
|
295
|
+
ready: (query.data !== undefined || query.isError) && project.ready,
|
|
292
296
|
job: query.data?.job ?? null,
|
|
293
297
|
starting: explore.isPending,
|
|
294
298
|
error: failure ? errorMessage(failure) : null,
|
|
@@ -299,6 +303,32 @@ export function useLiveMap(
|
|
|
299
303
|
};
|
|
300
304
|
}
|
|
301
305
|
|
|
306
|
+
const NO_AREAS: readonly AreaRef[] = [];
|
|
307
|
+
|
|
308
|
+
/** The project's areas, and the ticket-text map with its paths matched to real files. */
|
|
309
|
+
function useProjectKnowledge(agentId: string, issue: IssueDetail) {
|
|
310
|
+
const read = useRpc(liveProjectRpc);
|
|
311
|
+
const base = useMemo(() => semanticMap(issue), [issue]);
|
|
312
|
+
const paths = useMemo(
|
|
313
|
+
() => base.files.map((file) => file.path).slice(0, MAX_RESOLVE_PATHS).sort(),
|
|
314
|
+
[base],
|
|
315
|
+
);
|
|
316
|
+
const query = useQuery({
|
|
317
|
+
queryKey: ["linear", "live", "project", agentId, paths],
|
|
318
|
+
queryFn: () => read({ agentId, paths }),
|
|
319
|
+
staleTime: 5 * 60_000,
|
|
320
|
+
// Without knowledge the map still works, so a failure shows it at once.
|
|
321
|
+
retry: false,
|
|
322
|
+
});
|
|
323
|
+
const { data } = query;
|
|
324
|
+
const fallback = useMemo(() => {
|
|
325
|
+
if (!data) return base;
|
|
326
|
+
const resolved = new Map(data.resolved.map((entry) => [entry.from, entry.to]));
|
|
327
|
+
return semanticMap(issue, new Date(base.createdAt), { resolved, areas: data.areas });
|
|
328
|
+
}, [issue, base, data]);
|
|
329
|
+
return { fallback, areas: data?.areas ?? NO_AREAS, ready: data !== undefined || query.isError };
|
|
330
|
+
}
|
|
331
|
+
|
|
302
332
|
const NO_LISTING: ReadonlyMap<string, readonly string[]> = new Map();
|
|
303
333
|
|
|
304
334
|
export function useMapModel(
|
|
@@ -306,6 +336,7 @@ export function useMapModel(
|
|
|
306
336
|
files: readonly MapFile[],
|
|
307
337
|
touches: readonly FileTouch[],
|
|
308
338
|
explored: readonly DirTouch[],
|
|
339
|
+
areas: readonly AreaRef[] = NO_AREAS,
|
|
309
340
|
): MapModel & { ready: boolean } {
|
|
310
341
|
const list = useRpc(listFilesRpc);
|
|
311
342
|
const dirs = useMemo(
|
|
@@ -325,8 +356,8 @@ export function useMapModel(
|
|
|
325
356
|
}, [listing.data]);
|
|
326
357
|
const ready = dirs.length === 0 || listing.data !== undefined || listing.isError;
|
|
327
358
|
return useMemo(
|
|
328
|
-
() => ({ ...buildMapModel(files, touches, byDir, explored), ready }),
|
|
329
|
-
[files, touches, byDir, explored, ready],
|
|
359
|
+
() => ({ ...buildMapModel(files, touches, byDir, explored, areas), ready }),
|
|
360
|
+
[files, touches, byDir, explored, areas, ready],
|
|
330
361
|
);
|
|
331
362
|
}
|
|
332
363
|
|
package/client/project-init.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
SettingsSection,
|
|
7
7
|
SettingsSwitch,
|
|
8
8
|
} from "@getpaseo/plugin/client/ui";
|
|
9
|
-
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
9
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
10
10
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
11
11
|
import { Text, View } from "react-native";
|
|
12
12
|
import { initStartRpc, initStatusRpc } from "../shared/live";
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
proposalDiffs,
|
|
18
18
|
} from "../shared/project-setup";
|
|
19
19
|
import type { ProjectConfig } from "../shared/settings";
|
|
20
|
+
import { knowledgeKey } from "./project-knowledge";
|
|
20
21
|
import { Button, errorMessage, type Theme } from "./ui";
|
|
21
22
|
|
|
22
23
|
// Setup runs on the daemon. Remember the job per project so leaving the screen keeps it.
|
|
@@ -26,8 +27,10 @@ export function ProjectSetup(props: {
|
|
|
26
27
|
theme: Theme;
|
|
27
28
|
config: ProjectConfig;
|
|
28
29
|
change(patch: Partial<ProjectConfig>): void;
|
|
30
|
+
/** Opens the setup agent while it runs; absent on hosts without navigation. */
|
|
31
|
+
openAgent?: (agentId: string) => void;
|
|
29
32
|
}) {
|
|
30
|
-
const { theme, config, change } = props;
|
|
33
|
+
const { theme, config, change, openAgent } = props;
|
|
31
34
|
const start = useRpc(initStartRpc);
|
|
32
35
|
const status = useRpc(initStatusRpc);
|
|
33
36
|
const [jobId, setJobId] = useState(() => jobsByProject.get(config.projectId) ?? null);
|
|
@@ -47,6 +50,12 @@ export function ProjectSetup(props: {
|
|
|
47
50
|
});
|
|
48
51
|
const state = job.data?.job ?? null;
|
|
49
52
|
const proposal = job.data?.proposal ?? null;
|
|
53
|
+
// The daemon saved the agent's area summaries; show them in Project knowledge.
|
|
54
|
+
const queries = useQueryClient();
|
|
55
|
+
const finished = state?.status === "done";
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (finished) void queries.invalidateQueries({ queryKey: knowledgeKey(config.projectId) });
|
|
58
|
+
}, [finished, queries, config.projectId]);
|
|
50
59
|
const diffs = useMemo(
|
|
51
60
|
() => (proposal ? proposalDiffs(config, proposal) : []),
|
|
52
61
|
[config, proposal],
|
|
@@ -76,12 +85,27 @@ export function ProjectSetup(props: {
|
|
|
76
85
|
<SettingsCard>
|
|
77
86
|
<SettingsAction
|
|
78
87
|
label="Read this repository's guidelines"
|
|
79
|
-
hint="
|
|
88
|
+
hint="The daemon inspects the project first, and the agent starts from that project map. The agent reads AGENTS.md, CONTRIBUTING, scripts, and CI, then proposes instructions and steps, and describes each area for Project knowledge. It is told not to edit. You review each prompt change before it is used."
|
|
80
89
|
actionLabel={running ? "Reading…" : proposal ? "Run again" : "Start"}
|
|
81
90
|
disabled={running || !config.rootPath}
|
|
82
91
|
onPress={() => begin.mutate()}
|
|
83
92
|
/>
|
|
84
|
-
{running ?
|
|
93
|
+
{running ? (
|
|
94
|
+
<SettingsRow
|
|
95
|
+
label={state?.agentId ? "The setup agent is reading the repository." : "Inspecting the project…"}
|
|
96
|
+
>
|
|
97
|
+
{state?.agentId && openAgent ? (
|
|
98
|
+
<View style={ACTIONS_STYLE}>
|
|
99
|
+
<Button
|
|
100
|
+
theme={theme}
|
|
101
|
+
icon="Bot"
|
|
102
|
+
label="Open agent"
|
|
103
|
+
onPress={() => openAgent(state.agentId ?? "")}
|
|
104
|
+
/>
|
|
105
|
+
</View>
|
|
106
|
+
) : null}
|
|
107
|
+
</SettingsRow>
|
|
108
|
+
) : null}
|
|
85
109
|
{failure ? <SettingsRow label="Setup did not finish" error={failure} /> : null}
|
|
86
110
|
{state?.status === "done" && diffs.length === 0 ? (
|
|
87
111
|
<SettingsAction
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useRpc } from "@getpaseo/plugin/client";
|
|
2
|
+
import {
|
|
3
|
+
SettingsAction,
|
|
4
|
+
SettingsCard,
|
|
5
|
+
SettingsRow,
|
|
6
|
+
SettingsSection,
|
|
7
|
+
} from "@getpaseo/plugin/client/ui";
|
|
8
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
9
|
+
import {
|
|
10
|
+
areaLabel,
|
|
11
|
+
knowledgeGetRpc,
|
|
12
|
+
knowledgeInspectRpc,
|
|
13
|
+
MAX_KNOWLEDGE_FILES,
|
|
14
|
+
type ProjectBrief,
|
|
15
|
+
} from "../shared/knowledge";
|
|
16
|
+
import { errorMessage, relativeTime } from "./ui";
|
|
17
|
+
|
|
18
|
+
const AREAS_SHOWN = 24;
|
|
19
|
+
|
|
20
|
+
export const knowledgeKey = (projectId: string) => ["linear", "knowledge", projectId] as const;
|
|
21
|
+
|
|
22
|
+
function countText(entries: readonly { name: string; files: number }[]): string {
|
|
23
|
+
return entries.map((entry) => `${entry.name} ${entry.files}`).join(", ");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function overview(brief: ProjectBrief): string {
|
|
27
|
+
const source = brief.source === "git" ? "files git tracks" : "files found in the folder";
|
|
28
|
+
const truncated = brief.truncated ? `; the first ${MAX_KNOWLEDGE_FILES.toLocaleString()} are kept` : "";
|
|
29
|
+
return `${brief.fileCount} ${source}${truncated}. Inspected ${relativeTime(brief.inspectedAt)}.`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** What the daemon knows about the project's files, and a button to inspect it again. */
|
|
33
|
+
export function ProjectKnowledgeSection(props: { projectId: string }) {
|
|
34
|
+
const { projectId } = props;
|
|
35
|
+
const get = useRpc(knowledgeGetRpc);
|
|
36
|
+
const inspect = useRpc(knowledgeInspectRpc);
|
|
37
|
+
const queries = useQueryClient();
|
|
38
|
+
const query = useQuery({
|
|
39
|
+
queryKey: knowledgeKey(projectId),
|
|
40
|
+
queryFn: () => get({ projectId }),
|
|
41
|
+
staleTime: 60_000,
|
|
42
|
+
retry: false,
|
|
43
|
+
});
|
|
44
|
+
const again = useMutation({
|
|
45
|
+
mutationFn: () => inspect({ projectId }),
|
|
46
|
+
onSuccess: (data) => queries.setQueryData(knowledgeKey(projectId), data),
|
|
47
|
+
});
|
|
48
|
+
const brief = query.data?.knowledge ?? null;
|
|
49
|
+
const busy = query.isPending || again.isPending;
|
|
50
|
+
const failure = again.error ?? query.error;
|
|
51
|
+
const areas = brief?.areas.filter((area) => area.path !== "") ?? [];
|
|
52
|
+
return (
|
|
53
|
+
<SettingsSection title="Project knowledge">
|
|
54
|
+
<SettingsCard>
|
|
55
|
+
<SettingsAction
|
|
56
|
+
label="Inspect the project"
|
|
57
|
+
hint="The daemon lists the project's files and reads its manifests to find its services, packages, and main folders. No agent runs. Explore and setup agents, ticket-text maps, and Linear Live use what it finds. It inspects again when the knowledge is 6 hours old."
|
|
58
|
+
actionLabel={busy ? "Inspecting…" : "Inspect again"}
|
|
59
|
+
disabled={busy}
|
|
60
|
+
onPress={() => again.mutate()}
|
|
61
|
+
/>
|
|
62
|
+
{failure ? <SettingsRow label="Inspection did not finish" error={errorMessage(failure)} /> : null}
|
|
63
|
+
{brief ? (
|
|
64
|
+
<>
|
|
65
|
+
<SettingsRow label="Files" hint={overview(brief)} />
|
|
66
|
+
{brief.summary ? <SettingsRow label="Project" hint={brief.summary} /> : null}
|
|
67
|
+
{brief.languages.length > 0 ? (
|
|
68
|
+
<SettingsRow label="Languages" hint={countText(brief.languages)} />
|
|
69
|
+
) : null}
|
|
70
|
+
{brief.commands.length > 0 ? (
|
|
71
|
+
<SettingsRow label="Commands" hint={brief.commands.join(", ")} />
|
|
72
|
+
) : null}
|
|
73
|
+
{brief.guides.length > 0 ? <SettingsRow label="Guides" hint={brief.guides.join(", ")} /> : null}
|
|
74
|
+
{areas.slice(0, AREAS_SHOWN).map((area) => {
|
|
75
|
+
const files = `${area.files} ${area.files === 1 ? "file" : "files"}`;
|
|
76
|
+
const parts = [areaLabel(area), files, area.languages.join("/"), area.summary];
|
|
77
|
+
return <SettingsRow key={area.path} label={area.path} hint={parts.filter(Boolean).join(" · ")} />;
|
|
78
|
+
})}
|
|
79
|
+
{areas.length > AREAS_SHOWN ? (
|
|
80
|
+
<SettingsRow label={`${areas.length - AREAS_SHOWN} more areas`} />
|
|
81
|
+
) : null}
|
|
82
|
+
</>
|
|
83
|
+
) : null}
|
|
84
|
+
</SettingsCard>
|
|
85
|
+
</SettingsSection>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
} from "../shared/settings";
|
|
23
23
|
import { effectiveKeyScope, KeyScopeProvider } from "./key-scope";
|
|
24
24
|
import { ProjectSetup } from "./project-init";
|
|
25
|
+
import { ProjectKnowledgeSection } from "./project-knowledge";
|
|
25
26
|
import { AccessSection } from "./settings-access";
|
|
26
27
|
import { type PaseoProjectOption, useAuthStatus, useCatalog, useProjects } from "./queries";
|
|
27
28
|
import {
|
|
@@ -42,11 +43,15 @@ const STEPS_PLACEHOLDER = "Run the type checker\nUpdate the changelog\nOpen a dr
|
|
|
42
43
|
|
|
43
44
|
type Change = (patch: Partial<ProjectConfig>) => void;
|
|
44
45
|
|
|
45
|
-
export function ProjectSettings({ theme }: PluginSurfaceProps) {
|
|
46
|
+
export function ProjectSettings({ theme, navigation }: PluginSurfaceProps) {
|
|
46
47
|
const settings = useSettings(linearSettings);
|
|
48
|
+
const openAgent = useMemo(
|
|
49
|
+
() => (navigation ? (agentId: string) => navigation.openAgent({ agentId }) : undefined),
|
|
50
|
+
[navigation],
|
|
51
|
+
);
|
|
47
52
|
const render = useCallback(
|
|
48
|
-
(ready: ReadySettings) => <ProjectEditor theme={theme} settings={ready} />,
|
|
49
|
-
[theme],
|
|
53
|
+
(ready: ReadySettings) => <ProjectEditor theme={theme} settings={ready} openAgent={openAgent} />,
|
|
54
|
+
[theme, openAgent],
|
|
50
55
|
);
|
|
51
56
|
return (
|
|
52
57
|
<SettingsGate theme={theme} title="Projects" settings={settings}>
|
|
@@ -72,7 +77,12 @@ function projectOptions(
|
|
|
72
77
|
return [...known, ...missing];
|
|
73
78
|
}
|
|
74
79
|
|
|
75
|
-
function ProjectEditor(
|
|
80
|
+
function ProjectEditor(props: {
|
|
81
|
+
theme: Theme;
|
|
82
|
+
settings: ReadySettings;
|
|
83
|
+
openAgent?: (agentId: string) => void;
|
|
84
|
+
}) {
|
|
85
|
+
const { theme, settings } = props;
|
|
76
86
|
const { values, dirty, edit, save, discard } = useSettingsDraft(settings);
|
|
77
87
|
const projects = useProjects();
|
|
78
88
|
const [selectedId, setSelectedId] = useState<string | null>(null);
|
|
@@ -140,7 +150,8 @@ function ProjectEditor({ theme, settings }: { theme: Theme; settings: ReadySetti
|
|
|
140
150
|
</SettingsCard>
|
|
141
151
|
</SettingsSection>
|
|
142
152
|
<TeamsSection config={config} change={change} />
|
|
143
|
-
<
|
|
153
|
+
{paseoProject ? <ProjectKnowledgeSection projectId={paseoProject.projectId} /> : null}
|
|
154
|
+
<ProjectSetup theme={theme} config={config} change={change} openAgent={props.openAgent} />
|
|
144
155
|
<InstructionsSection theme={theme} config={config} change={change} />
|
|
145
156
|
{AGENT_ACTIONS.map((action) => (
|
|
146
157
|
<ActionSection key={action} theme={theme} action={action} config={config} change={change} />
|
package/index.server.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { registerAgentTools } from "./server/agent-tools";
|
|
|
5
5
|
import { createCredentialStore, defaultCredentialPath } from "./server/credentials";
|
|
6
6
|
import { registerHandlers } from "./server/handlers";
|
|
7
7
|
import { registerInit } from "./server/init";
|
|
8
|
+
import { createKnowledge, registerKnowledge } from "./server/knowledge";
|
|
8
9
|
import { registerLive } from "./server/live";
|
|
9
10
|
import { createLaunchQueue, createMapStore } from "./server/stores";
|
|
10
11
|
import { registerSync } from "./server/sync";
|
|
@@ -23,9 +24,11 @@ export default function contribute(server: PluginServerContext) {
|
|
|
23
24
|
const dataDirectory = path.dirname(credentialPath);
|
|
24
25
|
const maps = createMapStore(path.join(dataDirectory, "live-maps.json"));
|
|
25
26
|
const launches = createLaunchQueue(path.join(dataDirectory, "pending-launches.json"));
|
|
26
|
-
|
|
27
|
+
const knowledge = createKnowledge(path.join(dataDirectory, "knowledge"));
|
|
28
|
+
registerKnowledge(server, knowledge);
|
|
29
|
+
registerLive(server, { access, maps, launches, knowledge, readSettings });
|
|
27
30
|
registerSync(server, { access, readSettings });
|
|
28
|
-
registerInit(server, { readSettings });
|
|
31
|
+
registerInit(server, { readSettings, knowledge });
|
|
29
32
|
registerAgentHooks(server, dataDirectory);
|
|
30
33
|
const closeTools = registerAgentTools(server, { access, dataDirectory });
|
|
31
34
|
server.handle(accessRpc, async () => {
|