@meetopenbot/linear 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.js CHANGED
@@ -11,7 +11,9 @@ export function readLinearConfig(config) {
11
11
  apiKey: typeof config.apiKey === "string" && config.apiKey.trim()
12
12
  ? config.apiKey.trim()
13
13
  : undefined,
14
- authMode: resolveAuthMode(config),
14
+ authMode: config.authMode === "byok" || config.authMode === "credits"
15
+ ? config.authMode
16
+ : undefined,
15
17
  model: typeof config.model === "string" && config.model.trim()
16
18
  ? config.model.trim()
17
19
  : undefined,
@@ -35,7 +37,7 @@ export function formatMissingCredentials(missing, authMode) {
35
37
  return lines.join("\n");
36
38
  }
37
39
  export async function resolveLinearCredentials(config, storage) {
38
- const authMode = config.authMode ?? resolveAuthMode({});
40
+ const authMode = resolveAuthMode({ authMode: config.authMode });
39
41
  const useCredits = shouldUseCreditsAuth({ authMode });
40
42
  const variables = (await storage.getVariables().catch(() => ({})));
41
43
  const resolve = (configKey, envKey) => {
@@ -57,7 +59,7 @@ export async function resolveLinearCredentials(config, storage) {
57
59
  if (!useCredits && !openaiApiKey)
58
60
  missing.push("openaiApiKey");
59
61
  if (missing.length > 0) {
60
- return { ok: false, missing };
62
+ return { ok: false, missing, authMode };
61
63
  }
62
64
  return {
63
65
  ok: true,
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ const linearPluginConfigSchema = {
25
25
  },
26
26
  apiKey: {
27
27
  type: "string",
28
- description: "Linear personal API key (Settings → Account → Security & Access → Personal API keys)",
28
+ description: "Linear personal API key — create one at [Settings → Account → Security & Access](https://linear.app/settings/account/security)",
29
29
  format: "password",
30
30
  },
31
31
  },
@@ -35,8 +35,7 @@ export default definePlugin({
35
35
  description: "Linear MCP-backed specialist agent for issues, projects, and comments",
36
36
  configSchema: linearPluginConfigSchema,
37
37
  factory: (pluginContext) => (builder) => {
38
- const { agentId, config, storage } = pluginContext;
39
- const linearConfig = readLinearConfig(config);
38
+ const { agentId, storage } = pluginContext;
40
39
  builder.on("agent:invoke", async function* (event, ctx) {
41
40
  if (!shouldHandleInvoke(event, agentId))
42
41
  return;
@@ -47,11 +46,12 @@ export default definePlugin({
47
46
  const userMessage = (event.data.content ?? "").trim();
48
47
  if (!userMessage || !threadId)
49
48
  return;
49
+ const linearConfig = readLinearConfig(pluginContext.config);
50
50
  const auth = await resolveLinearCredentials(linearConfig, storage);
51
51
  if (!auth.ok) {
52
52
  yield agentOutput({
53
53
  agentId,
54
- content: formatMissingCredentials(auth.missing, linearConfig.authMode),
54
+ content: formatMissingCredentials(auth.missing, auth.authMode),
55
55
  threadId,
56
56
  meta: event.meta,
57
57
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetopenbot/linear",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Linear MCP-backed specialist agent for OpenBot",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",