-
Notifications
You must be signed in to change notification settings - Fork 0
add tasks source linear #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
ai/memories/changelogs/202603311620-docs-linear-task-plugin-integration-design.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ## 2026-03-31 16:20: docs: add Linear task plugin integration design | ||
|
|
||
| **What changed:** | ||
| - Added a new product/technical design document for Linear task integration as an independent plugin. | ||
| - Defined scope for OAuth connection, bidirectional task sync, and connection status management in Settings. | ||
| - Documented architecture decisions aligned with current plugin runtime, including required plugin permissions and SDK task wrapper extension. | ||
| - Added phased implementation plan, sync/conflict strategy, risks, and acceptance mapping. | ||
|
|
||
| **Why:** | ||
| - Provide a concrete implementation blueprint before coding the Linear integration. | ||
| - Ensure requirements are explicit: plugin install-gated behavior, two-way sync, and visible connection state. | ||
|
|
||
| **Files affected:** | ||
| - `docs/plans/2026-03-31-linear-task-plugin-integration-design.md` | ||
| - `ai/memories/changelogs/202603311620-docs-linear-task-plugin-integration-design.md` |
20 changes: 20 additions & 0 deletions
20
ai/memories/changelogs/202603311644-feat-linear-api-key-auth.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ## 2026-03-31 16:44: feat: switch Linear integration auth from OAuth to API key | ||
|
|
||
| **What changed:** | ||
| - Reworked `plugins/linear` authentication flow from OAuth to API key secret storage (`linear-api-key`). | ||
| - Replaced panel connect UX with API key input/save flow, keeping disconnect and manual sync actions. | ||
| - Updated plugin manifest tools to `linear_set_api_key` and removed OAuth-specific permissions/tool surface. | ||
| - Updated integration design and manual QA docs to align with API key onboarding, validation, and failure paths. | ||
| - Rebuilt and installed latest plugin artifact to `~/.peekoo/plugins/linear` for immediate local validation. | ||
|
|
||
| **Why:** | ||
| - Match product requirement update to use Linear personal/team API keys. | ||
| - Simplify desktop setup by avoiding browser callback/OAuth token lifecycle handling. | ||
|
|
||
| **Files affected:** | ||
| - `plugins/linear/peekoo-plugin.toml` | ||
| - `plugins/linear/src/lib.rs` | ||
| - `plugins/linear/ui/panel.html` | ||
| - `plugins/linear/ui/panel.js` | ||
| - `docs/plans/2026-03-31-linear-task-plugin-integration-design.md` | ||
| - `docs/plans/2026-03-31-linear-integration-manual-qa.md` |
26 changes: 26 additions & 0 deletions
26
ai/memories/changelogs/202603311740-feat-linear-plugin-foundation.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| ## 2026-03-31 17:40: feat: add Linear plugin foundation with task sync and settings status | ||
|
|
||
| **What changed:** | ||
| - Added a new first-party plugin at `plugins/linear` with OAuth connect/disconnect, panel snapshot provider, manual sync trigger, periodic scheduler sync, and two-way task sync scaffolding against Linear GraphQL. | ||
| - Added a new `tasks` module in `crates/peekoo-plugin-sdk` and wired raw host function bindings so plugins can create/list/update/delete/toggle/assign Peekoo tasks safely. | ||
| - Added a new settings hook and UI section to show Linear integration status in Settings, including install/enable/connected/sync/error surfaces. | ||
| - Updated `justfile` to include `linear` in `plugin-build-all`. | ||
|
|
||
| **Why:** | ||
| - Implement the approved design direction for Linear as an install-gated independent plugin. | ||
| - Enable plugin-side background synchronization without coupling Linear logic into core app crates. | ||
| - Satisfy acceptance criteria that connection status is visible in Settings. | ||
|
|
||
| **Files affected:** | ||
| - `plugins/linear/Cargo.toml` | ||
| - `plugins/linear/peekoo-plugin.toml` | ||
| - `plugins/linear/src/lib.rs` | ||
| - `plugins/linear/ui/panel.html` | ||
| - `plugins/linear/ui/panel.css` | ||
| - `plugins/linear/ui/panel.js` | ||
| - `crates/peekoo-plugin-sdk/src/host_fns.rs` | ||
| - `crates/peekoo-plugin-sdk/src/tasks.rs` | ||
| - `crates/peekoo-plugin-sdk/src/lib.rs` | ||
| - `apps/desktop-ui/src/features/settings/useLinearIntegrationStatus.ts` | ||
| - `apps/desktop-ui/src/features/settings/SettingsPanel.tsx` | ||
| - `justfile` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
apps/desktop-ui/src/features/settings/useLinearIntegrationStatus.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| import { useCallback, useEffect, useState } from "react"; | ||
| import { invoke } from "@tauri-apps/api/core"; | ||
|
|
||
| const POLL_INTERVAL_MS = 15000; | ||
|
|
||
| type UiStatus = | ||
| | "uninstalled" | ||
| | "disabled" | ||
| | "disconnected" | ||
| | "connecting" | ||
| | "connected" | ||
| | "syncing" | ||
| | "error" | ||
| | "unknown"; | ||
|
|
||
| interface PluginSummary { | ||
| pluginKey: string; | ||
| enabled: boolean; | ||
| } | ||
|
|
||
| interface PluginConnectionStatus { | ||
| connected?: boolean; | ||
| status?: string; | ||
| workspaceName?: string | null; | ||
| userName?: string | null; | ||
| userEmail?: string | null; | ||
| lastSyncAt?: string | null; | ||
| lastError?: string | null; | ||
| } | ||
|
|
||
| export interface LinearIntegrationStatus { | ||
| uiStatus: UiStatus; | ||
| installed: boolean; | ||
| enabled: boolean; | ||
| connected: boolean; | ||
| workspaceName: string | null; | ||
| userName: string | null; | ||
| userEmail: string | null; | ||
| lastSyncAt: string | null; | ||
| lastError: string | null; | ||
| } | ||
|
|
||
| const DEFAULT_STATUS: LinearIntegrationStatus = { | ||
| uiStatus: "uninstalled", | ||
| installed: false, | ||
| enabled: false, | ||
| connected: false, | ||
| workspaceName: null, | ||
| userName: null, | ||
| userEmail: null, | ||
| lastSyncAt: null, | ||
| lastError: null, | ||
| }; | ||
|
|
||
| function mapPluginStatus(status: string | undefined, connected: boolean): UiStatus { | ||
| switch (status) { | ||
| case "connected": | ||
| return connected ? "connected" : "disconnected"; | ||
| case "connecting": | ||
| return "connecting"; | ||
| case "syncing": | ||
| return "syncing"; | ||
| case "error": | ||
| return "error"; | ||
| case "disconnected": | ||
| return "disconnected"; | ||
| default: | ||
| return connected ? "connected" : "unknown"; | ||
| } | ||
| } | ||
|
|
||
| export function useLinearIntegrationStatus() { | ||
| const [status, setStatus] = useState<LinearIntegrationStatus>(DEFAULT_STATUS); | ||
| const [isLoading, setIsLoading] = useState(true); | ||
| const [error, setError] = useState<string | null>(null); | ||
|
|
||
| const refresh = useCallback(async () => { | ||
| try { | ||
| setError(null); | ||
|
|
||
| const plugins = await invoke<PluginSummary[]>("plugins_list"); | ||
| const linear = plugins.find((plugin) => plugin.pluginKey === "linear"); | ||
|
|
||
| if (!linear) { | ||
| setStatus(DEFAULT_STATUS); | ||
| setIsLoading(false); | ||
| return; | ||
| } | ||
|
|
||
| if (!linear.enabled) { | ||
| setStatus({ | ||
| ...DEFAULT_STATUS, | ||
| uiStatus: "disabled", | ||
| installed: true, | ||
| enabled: false, | ||
| }); | ||
| setIsLoading(false); | ||
| return; | ||
| } | ||
|
|
||
| const raw = await invoke<string>("plugin_query_data", { | ||
| pluginKey: "linear", | ||
| providerName: "connection_status", | ||
| }); | ||
|
|
||
| const parsed = JSON.parse(raw) as PluginConnectionStatus; | ||
| const connected = Boolean(parsed.connected); | ||
|
|
||
| setStatus({ | ||
| uiStatus: mapPluginStatus(parsed.status, connected), | ||
| installed: true, | ||
| enabled: true, | ||
| connected, | ||
| workspaceName: parsed.workspaceName ?? null, | ||
| userName: parsed.userName ?? null, | ||
| userEmail: parsed.userEmail ?? null, | ||
| lastSyncAt: parsed.lastSyncAt ?? null, | ||
| lastError: parsed.lastError ?? null, | ||
| }); | ||
| } catch (err) { | ||
| setError(String(err)); | ||
| setStatus((prev) => ({ | ||
| ...prev, | ||
| uiStatus: prev.installed ? "error" : "unknown", | ||
| })); | ||
| } finally { | ||
| setIsLoading(false); | ||
| } | ||
| }, []); | ||
|
|
||
| useEffect(() => { | ||
| void refresh(); | ||
| const interval = window.setInterval(() => { | ||
| void refresh(); | ||
| }, POLL_INTERVAL_MS); | ||
|
|
||
| return () => { | ||
| window.clearInterval(interval); | ||
| }; | ||
| }, [refresh]); | ||
|
|
||
| return { | ||
| status, | ||
| isLoading, | ||
| error, | ||
| refresh, | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.