@agentscript-ai/linear

This package allows you to integrate your agents with Linear.

API Reference

LinearClient(options)

Creates a client for communicating with the Linear API.

Options

  • apiKey (string, required): The API key for Linear

Example

import { LinearClient } from 'agentscript-ai/linear';
 
const linear = LinearClient({
    apiKey: process.env.LINEAR_API_KEY,
});

searchIssues Tool

The searchIssues tool is used to search for issues in Linear.

Options

  • llm (LanguageModel, required): The configured language model to use
  • linear (LinearClient, required): Linear client for making requests

Input

  • query (unknown, required): Descriptive query in object format

Output

Array of Issue objects

Example

import { AnthropicModel } from 'agentscript-ai/anthropic';
import { LinearClient, searchIssues } from 'agentscript-ai/linear';
import { defineTool, inferAgent, executeAgent } from 'agentscript-ai/core';
import * as s from 'agentscript-ai/schema';
 
const linear = LinearClient({
  apiKey: process.env.LINEAR_API_KEY,
});
 
const llm = AnthropicModel({
    model: 'claude-3-5-sonnet-latest',
    apiKey: process.env.ANTHROPIC_API_KEY,
});
 
const tools = {
    linear: {
      searchIssues: searchIssues({ llm, linear }),
    },
};
 
const prompt = 'Find all tasks created in last 3 days';
const output = s.array(s.object({props: {
    id: s.string(),
    url: s.string(),
    title: s.string(),
    description: s.string({ optional: true }),
    status: s.string(),
    createdAt: s.date(),
    updatedAt: s.date()}}));
 
const agent = await inferAgent({
    tools,
    output,
    llm,
    prompt,
});
 
await executeAgent({agent})
console.log(agent.state?.output)

Types

Issue

The type of output from the searchIssues tool.

  • id (string, required): Linear identifier
  • url (string, required): URL to Linear issue
  • title (string, required): Title of the issue
  • description (string, optional): Description of the issue
  • status (string, required): Status of the issue, as displayed on the Linear app
  • createdAt (Date, required): Timestamp when the issue was created
  • updatedAt (Date, required): Timestamp when the issue was last updated