Add a plugin-owned Linear importer that creates Fusion tasks from Linear issues. - Add the fusion-plugin-linear-import package with settings, Linear GraphQL client, import routes, tools, and dashboard UI. - Bundle and register the Linear import plugin in the CLI and dashboard plugin view registry. - Document bundled plugin authoring details and cover duplicate detection, routes, tools, UI, and packaging with tests. Files changed: .changeset/fn-7443-linear-import-plugin.md | 7 + docs/PLUGIN_AUTHORING.md | 7 + docs/task-management.md | 2 + packages/cli/src/__tests__/bundle-output.test.ts | 22 ++ .../__tests__/bundled-plugin-install.test.ts | 29 +++ packages/cli/src/plugins/bundled-plugin-install.ts | 1 + .../cli/src/plugins/staged-bundled-plugin-ids.ts | 1 + packages/cli/tsup.config.ts | 8 + .../__tests__/registerBundledPluginViews.test.tsx | 9 +- .../app/plugins/registerBundledPluginViews.ts | 18 ++ .../app/types/plugin-dashboard-views.d.ts | 9 + .../src/__tests__/routes-plugin-registry.test.ts | 5 + .../runtime-plugin-alias-regression.test.ts | 12 + packages/dashboard/src/registry-manifest.json | 10 + packages/dashboard/vite.config.ts | 8 + packages/dashboard/vitest.config.ts | 8 + plugins/fusion-plugin-linear-import/README.md | 75 ++++++ plugins/fusion-plugin-linear-import/manifest.json | 48 ++++ plugins/fusion-plugin-linear-import/package.json | 38 +++ .../scripts/copy-css.mjs | 11 + .../src/LinearImportView.css | 167 +++++++++++++ .../src/LinearImportView.tsx | 263 +++++++++++++++++++++ .../src/__tests__/LinearImportView.test.tsx | 124 ++++++++++ .../src/__tests__/import-linear.test.ts | 78 ++++++ .../src/__tests__/linear-client.test.ts | 81 +++++++ .../src/__tests__/routes.test.ts | 90 +++++++ .../src/__tests__/tools.test.ts | 79 +++++++ .../src/dashboard-interop.d.ts | 13 + .../src/dashboard-view.tsx | 10 + .../src/import-linear.ts | 154 ++++++++++++ plugins/fusion-plugin-linear-import/src/index.ts | 45 ++++ .../src/linear-client.ts | 247 +++++++++++++++++++ plugins/fusion-plugin-linear-import/src/routes.ts | 149 ++++++++++++ .../fusion-plugin-linear-import/src/settings.ts | 68 ++++++ plugins/fusion-plugin-linear-import/src/tools.ts | 138 +++++++++++ plugins/fusion-plugin-linear-import/tsconfig.json | 14 ++ .../fusion-plugin-linear-import/vitest.config.ts | 40 ++++ pnpm-lock.yaml | 40 ++++ pnpm-workspace.yaml | 1 + 39 files changed, 2128 insertions(+), 1 deletion(-) Fusion-Task-Id: FN-7443 Fusion-Task-Lineage: a016a9d4-84a4-4a0b-b9b6-b9a2886da49a Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
76 lines
3.7 KiB
Markdown
76 lines
3.7 KiB
Markdown
# Linear Import Plugin
|
||
|
||
`fusion-plugin-linear-import` is a bundled Fusion integration plugin that imports Linear issues into Fusion tasks. It is intentionally implemented through plugin settings, plugin routes, plugin tools, and a plugin dashboard view — not through core Linear settings or host-owned `/api/linear/*` routes.
|
||
|
||
## Setup
|
||
|
||
1. Install or enable **Linear Import** from Settings → Plugins / Plugin Manager.
|
||
2. Open the plugin settings and enter a Linear personal API key.
|
||
3. Optionally set a default team key/ID, issue state filter, and assignee ID.
|
||
4. Open the **Linear Import** plugin dashboard view to browse and import issues.
|
||
|
||
The API key is a plugin `password` setting. Fusion uses it only for HTTPS GraphQL requests to Linear and does not include it in route responses, tool results, task descriptions, task documents, or logs.
|
||
|
||
## Supported filters
|
||
|
||
The dashboard view, routes, and tools share the same filters:
|
||
|
||
- `query` — matches issue title, description, or identifier.
|
||
- `teamKey` / `teamId` — Linear team key or UUID.
|
||
- `state` — `active`, `backlog`, `started`, `unstarted`, `completed`, `canceled`, or `all`.
|
||
- `assigneeId` — Linear user UUID.
|
||
- `limit` — bounded to 1–100 issues.
|
||
- `after` — optional Linear pagination cursor for browse calls.
|
||
|
||
## Routes
|
||
|
||
All routes are plugin-scoped under `/api/plugins/fusion-plugin-linear-import/*`:
|
||
|
||
- `GET /status` — checks whether the plugin has a usable API key.
|
||
- `POST /issues` — lists/searches issues.
|
||
- `POST /issues/detail` — fetches one issue by UUID or identifier.
|
||
- `POST /issues/import` — imports one issue into `triage`.
|
||
- `POST /issues/import-batch` — imports up to 25 selected issues.
|
||
|
||
Dashboard requests include `projectId` when the host provides one so the plugin uses the project-scoped plugin settings and task store.
|
||
|
||
## Agent tools
|
||
|
||
The plugin registers plugin tools (not built-in `fn_*` tools):
|
||
|
||
- `linear_import_browse_issues`
|
||
- `linear_import_issue`
|
||
- `linear_import_issues`
|
||
|
||
Tool results summarize imported/skipped issues and include safe issue/task details only.
|
||
|
||
## Import behavior and duplicate handling
|
||
|
||
Imported tasks are created in `triage`. The task description contains the Linear issue body or `(no description)`, followed by `Source: <Linear URL>`, the Linear identifier, team, and state. Task provenance stores:
|
||
|
||
- `sourceIssue.provider: "linear"`
|
||
- stable Linear issue id as `sourceIssue.externalIssueId`
|
||
- source URL
|
||
- `source.sourceType: "api"`
|
||
- `source.sourceMetadata.provider: "linear"`
|
||
- Linear issue id, identifier, URL, team, state, assignee, and timestamps where available
|
||
|
||
Duplicate detection checks non-archived tasks by Linear issue id, Linear identifier, and source URL before creating a task. Duplicate route/tool responses identify the existing Fusion task id when available.
|
||
|
||
## Limitations and non-goals
|
||
|
||
- No Linear CLI or binary dependency is required or installed.
|
||
- No host-owned `/api/linear/*` routes or core Linear settings are added.
|
||
- Imports are read-only with respect to Linear; the plugin does not comment on, close, reopen, or update Linear issues.
|
||
- Linear workspace/team permissions are determined by the configured API key.
|
||
|
||
## External Integration Evidence
|
||
|
||
- Canonical upstream repo URL: `upstream-pending-verification` (Linear is consumed as a SaaS HTTP/GraphQL API; no official client repository is required)
|
||
- Docs / homepage URL: <https://developers.linear.app/>
|
||
- API docs URL: <https://developers.linear.app/docs/graphql/working-with-the-graphql-api>
|
||
- GraphQL API endpoint: <https://api.linear.app/graphql>
|
||
- Release / download URL: `upstream-pending-verification` (no downloadable binary is added)
|
||
- Binary / CLI name: `none` (HTTP/GraphQL API integration only)
|
||
- Checksum: `upstream-pending-verification` (no downloaded binary is added)
|