@donmai/plugin-linear

中文文档
0.10.0发布于 2026/10/28MITTypeScriptES Module构建来源已验证近 30 天下载 1.9万

Linear issue tracker integration for Donmai. Status transitions, agent sessions, work routing

原始使用文档
文档目录9 节
  1. Installation
  2. Quick Start
  3. Linear Client
  4. Agent Sessions
  5. Work Type Routing
  6. Default Prompt Templates
  7. Key Exports
  8. Related Packages
  9. License

@donmai/plugin-linear

Linear issue tracker integration for Donmai. Provides the Linear API client, agent sessions, status transitions, activity streaming, and work type routing.

Installation

npm install @donmai/plugin-linear

Quick Start

Linear Client

import { createLinearAgentClient } from '@donmai/plugin-linear'

const client = createLinearAgentClient({ apiKey: process.env.LINEAR_API_KEY! })

const issue = await client.getIssue('PROJ-123')
await client.updateIssueStatus('PROJ-123', 'Started')
await client.createComment(issue.id, 'Work in progress...')

Agent Sessions

Manage the lifecycle of an agent working on an issue:

import { createAgentSession } from '@donmai/plugin-linear'

const session = createAgentSession({
  client: linearClient,
  issueId: 'issue-uuid',
  autoTransition: true,
  workType: 'development',
})

await session.start()                              // Status -> Started
await session.emitThought('Analyzing requirements...')
await session.updatePlan([
  { title: 'Read code', state: 'completed' },
  { title: 'Implement feature', state: 'inProgress' },
  { title: 'Write tests', state: 'pending' },
])
await session.complete('Feature implemented')      // Status -> Finished

Work Type Routing

Issues are automatically routed to work types based on their Linear status:

StatusWork TypeAgent Role
BacklogdevelopmentImplement the feature/fix
StartedinflightContinue in-progress work
FinishedqaValidate implementation
DeliveredacceptanceFinal acceptance testing
RejectedrefinementAddress feedback

Default Prompt Templates

Sensible defaults for new projects — override per work type as needed:

import {
  defaultGeneratePrompt,
  defaultDetectWorkTypeFromPrompt,
  defaultGetPriority,
} from '@donmai/plugin-linear'

Key Exports

  • LinearAgentClient / createLinearAgentClient — Linear API client with retry logic
  • AgentSession / createAgentSession — agent lifecycle management
  • defaultGeneratePrompt — default prompt generation
  • defaultDetectWorkTypeFromPrompt — work type detection from free text
  • defaultGetPriority — priority mapping for work types
  • Work type constants, error types, webhook event types
PackageDescription
@donmai/coreCore orchestrator
@donmai/nextjsNext.js webhook server

License

MIT

版本与发布记录

@donmai/plugin-linear 共发布 18 个版本,首次发布于 2026/05/25;过去 12 个月发布了 18 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.10.0latest2026/10/2816 天前
0.9.152026/09/122 个月前
0.9.142026/08/252 个月前
0.9.132026/08/232 个月前
0.9.122026/08/232 个月前
0.9.112026/08/142 个月前

关于 @donmai/plugin-linear 的常见问题

@donmai/plugin-linear 是什么?

Linear issue tracker integration for Donmai. Status transitions, agent sessions, work routing

如何安装 @donmai/plugin-linear?

在项目目录运行 npm install @donmai/plugin-linear,或使用 pnpm add / yarn add / bun add。

@donmai/plugin-linear 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@donmai/plugin-linear 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@donmai/plugin-linear 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.23.4。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@donmai/plugin-linear 可以商用吗?

@donmai/plugin-linear 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@donmai/plugin-linear 的下载量有多少?

根据 npm 官方下载统计,@donmai/plugin-linear 在 2026/10/13 – 2026/11/11 这 30 天内被下载 19,207 次,日均约 640 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@donmai/plugin-linear 还在维护吗?

最新版本 0.10.0 发布于 2026/10/28(16 天前);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/05/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。