Linear Integration
Relevant source files
The following files were used as context for generating this wiki page:The Linear integration allows the Quix AI agent to connect with the Linear project management tool. Once configured, users can interact with their Linear projects directly from Slack, enabling them to manage and search for tasks and issues using natural language queries. This integration is part of the suite of supported business tools that Quix can leverage to streamline workflows.
The integration is identified by the SUPPORTED_INTEGRATIONS.LINEAR enum value. It is configured via an API token rather than an OAuth flow, simplifying the setup process for administrators.
Sources: src/lib/constants.ts:13, 194-205
Configuration and Setup
The Linear integration is set up and managed through the Quix App Home in Slack. The process involves providing a Linear API token, which the system then validates and stores securely.
Sources: src/integrations/integrations-install.service.ts:503-558
Installation Flow
The installation is initiated by a user from the Slack UI. The backend IntegrationsInstallService handles the logic for validating the token and persisting the configuration.
The diagram below illustrates the sequence of events during the Linear integration setup.
The linear method in IntegrationsInstallService orchestrates this process:
- It parses the submitted API token from the Slack view submission payload.
- It sends a GraphQL query to the Linear API (
https://api.linear.app/graphql) to fetch theorganizationdetails (idandname). This acts as a validation step for the provided token. - If the API call is successful, it uses
linearConfigModel.upsertto save the configuration, including the workspace name, organization ID, and the encrypted API token, to the database. - An
EVENT_NAMES.LINEAR_CONNECTEDevent is emitted to notify other parts of the system about the successful connection.
Sources: src/integrations/integrations-install.service.ts:503-558
Data Model (LinearConfig)
The configuration for the Linear integration is stored in the linear_configs table, which is represented by the LinearConfig model. This model has a HasOne relationship with the SlackWorkspace model, linking each Linear configuration to a specific Slack workspace via the team_id.
Sources: src/database/models/linear-config.model.ts, src/database/models/slack-workspace.model.ts:252-255
The following diagram shows the relationship between the slack_workspaces and linear_configs tables.
The table below details the fields in the LinearConfig model.
| Field | Type | Constraints | Description |
|---|---|---|---|
id | CreationOptional<string> | PRIMARY KEY, UUID, DEFAULT: UUIDV4 | Unique identifier for the configuration record. |
team_id | string | NOT NULL, FOREIGN KEY | The Slack workspace team_id this configuration belongs to. |
workspace_name | string | NOT NULL | The name of the Linear workspace/organization, fetched from the Linear API. |
linear_org_id | string | NOT NULL | The unique ID of the Linear organization. |
access_token | string (encrypted) | NOT NULL | The encrypted Linear API token provided by the user. The get and set methods handle encryption and decryption. |
default_prompt | string | NULLABLE | A custom default prompt for the Linear agent, configured during setup. |
created_at | CreationOptional<Date> | NOT NULL | Timestamp of when the record was created. |
updated_at | CreationOptional<Date> | NOT NULL | Timestamp of the last update. |
Sources: src/database/models/linear-config.model.ts:13-53
Slack UI Integration
The Quix App Home in Slack provides the user interface for managing integrations. The app_home.ts view logic dynamically renders the connection status and available actions for each integration, including Linear.
Connection Status
The getIntegrationInfo and getConnectionInfo functions are responsible for displaying the state of the Linear integration.
- If not connected: A "Connect" button is displayed with the help text: "Connect Linear to interact with your projects."
- If connected: The view shows the message "Connected to {workspace_name}" (e.g., "Connected to Quix-Org"). An overflow menu with "Edit" and "Disconnect" options is also rendered.
Sources: src/slack/views/app_home.ts:333-335, 388-409
Agent Capabilities
The core purpose of the integration is to empower the AI agent with tools to interact with Linear.
Prompts and Tool Selection
The integration provides specific prompts to guide the LLM in using Linear tools effectively.
- One-Line Summary: "Manage and search tasks or issues in Linear"
- Suggested Prompt: "Show me all high priority issues assigned to me"
- Tool Selection Prompt: The agent is instructed that Linear is a project management tool for tasks, issues, and milestones.
- Response Generation Prompt: The agent is guided to include project/issue IDs and format important details clearly in its responses.
Sources: src/lib/constants.ts:194-205, 321-331
While the specific tool implementations (e.g., create_issue, find_issue) are defined within the agent-packages/packages/linear package, the provided source files do not contain its contents. However, based on the defined prompts, the agent is expected to handle actions related to creating, searching, and managing Linear issues.