runline 0.28.1 → 0.29.0
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.
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
2
|
import { assertCommentInScope, assertIssueInScope, COMMENT_FIELDS, gql, key, requireUnscoped, } from "./shared.js";
|
|
3
3
|
export function registerCommentActions(rl) {
|
|
4
|
-
rl.registerAction("
|
|
4
|
+
rl.registerAction("comment.create", {
|
|
5
5
|
access: "write",
|
|
6
|
-
description: "
|
|
6
|
+
description: "Create a comment on an issue. Pass parentId to nest as a reply.",
|
|
7
7
|
inputSchema: t.Object({
|
|
8
8
|
issueId: t.String({
|
|
9
9
|
description: "The issue to associate the comment with. UUID or issue identifier (e.g., 'LIN-123')",
|
|
@@ -14,7 +14,7 @@ import { registerViewActions } from "./views.js";
|
|
|
14
14
|
import { registerWebhookActions } from "./webhooks.js";
|
|
15
15
|
export default function linear(rl) {
|
|
16
16
|
rl.setName("linear");
|
|
17
|
-
rl.setVersion("0.
|
|
17
|
+
rl.setVersion("0.5.0");
|
|
18
18
|
rl.setConnectionSchema(t.Object({
|
|
19
19
|
apiKey: t.String({
|
|
20
20
|
description: "Linear API key (https://linear.app/settings/account/security)",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "typebox";
|
|
2
|
-
import { assertIssueInScope, buildConnArgs,
|
|
2
|
+
import { assertIssueInScope, buildConnArgs, ensureScopeLabelsOnCreateOrReplace, forbidScopeLabelRemoval, gql, ISSUE_FIELDS, ISSUE_LITE, issueHasScope, key, LIST_INPUT_SCHEMA, mergeIssueScopeFilter, } from "./shared.js";
|
|
3
3
|
/**
|
|
4
4
|
* Linear's IssueUpdateInput accepts explicit null for clearable relations
|
|
5
5
|
* (e.g. cycleId: null removes the issue from its cycle). Omitted = leave
|
|
@@ -342,20 +342,4 @@ export function registerIssueActions(rl) {
|
|
|
342
342
|
return data.issueRelationCreate;
|
|
343
343
|
},
|
|
344
344
|
});
|
|
345
|
-
rl.registerAction("issue.listComments", {
|
|
346
|
-
access: "read",
|
|
347
|
-
description: "List comments on an issue.",
|
|
348
|
-
inputSchema: t.Object({
|
|
349
|
-
issueId: t.String(),
|
|
350
|
-
limit: t.Optional(t.Number()),
|
|
351
|
-
}),
|
|
352
|
-
async execute(input, ctx) {
|
|
353
|
-
const { issueId, limit } = input;
|
|
354
|
-
await assertIssueInScope(ctx, issueId);
|
|
355
|
-
const data = await gql(key(ctx), `query($id: String!, $first: Int) {
|
|
356
|
-
issue(id: $id) { comments(first: $first) { nodes { ${COMMENT_FIELDS} } } }
|
|
357
|
-
}`, { id: issueId, first: limit ?? 50 });
|
|
358
|
-
return data.issue?.comments?.nodes;
|
|
359
|
-
},
|
|
360
|
-
});
|
|
361
345
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenAI image generation for runline.
|
|
3
3
|
*
|
|
4
|
-
* Wraps the GPT Image / DALL-E line
|
|
4
|
+
* Wraps the GPT Image / DALL-E line: `image.create` at
|
|
5
|
+
* /v1/images/generations, `image.edit` at /v1/images/edits. Generated
|
|
5
6
|
* images are written to disk and the action returns their file `path`s
|
|
6
7
|
* (plus the optional revised prompt) — never raw base64, which bloats the
|
|
7
8
|
* agent context and is stripped before delivery. Hand each `path` to the
|
|
@@ -19,6 +20,14 @@ const ENDPOINT = "https://api.openai.com/v1/images/generations";
|
|
|
19
20
|
const EDIT_ENDPOINT = "https://api.openai.com/v1/images/edits";
|
|
20
21
|
/** Newest GPT Image model; override per call or via the connection. */
|
|
21
22
|
const DEFAULT_MODEL = "gpt-image-2";
|
|
23
|
+
/**
|
|
24
|
+
* Model precedence, shared by create and edit: the call wins, then the
|
|
25
|
+
* connection's `defaultModel` (or OPENAI_IMAGE_MODEL), then the newest
|
|
26
|
+
* model.
|
|
27
|
+
*/
|
|
28
|
+
function resolveModel(explicit, config) {
|
|
29
|
+
return (explicit ?? config.defaultModel ?? DEFAULT_MODEL);
|
|
30
|
+
}
|
|
22
31
|
export default function openai(rl) {
|
|
23
32
|
rl.setName("openai");
|
|
24
33
|
rl.setVersion("0.1.0");
|
|
@@ -32,7 +41,7 @@ export default function openai(rl) {
|
|
|
32
41
|
defaultModel: {
|
|
33
42
|
type: "string",
|
|
34
43
|
required: false,
|
|
35
|
-
description: "Default image model when a call omits `model`
|
|
44
|
+
description: "Default image model when a call omits `model` — e.g. gpt-image-1 to pin the older line. Defaults to gpt-image-2.",
|
|
36
45
|
env: "OPENAI_IMAGE_MODEL",
|
|
37
46
|
},
|
|
38
47
|
});
|
|
@@ -82,9 +91,7 @@ export default function openai(rl) {
|
|
|
82
91
|
throw new Error("openai: prompt is required");
|
|
83
92
|
}
|
|
84
93
|
const apiKey = ctx.connection.config.apiKey;
|
|
85
|
-
const model = p.model
|
|
86
|
-
ctx.connection.config.defaultModel ??
|
|
87
|
-
DEFAULT_MODEL;
|
|
94
|
+
const model = resolveModel(p.model, ctx.connection.config);
|
|
88
95
|
const body = {
|
|
89
96
|
model,
|
|
90
97
|
prompt: p.prompt,
|
|
@@ -189,9 +196,7 @@ export default function openai(rl) {
|
|
|
189
196
|
throw new Error("openai: imagePath (or imagePaths) is required");
|
|
190
197
|
}
|
|
191
198
|
const apiKey = ctx.connection.config.apiKey;
|
|
192
|
-
const model = p.model
|
|
193
|
-
ctx.connection.config.defaultModel ??
|
|
194
|
-
DEFAULT_MODEL;
|
|
199
|
+
const model = resolveModel(p.model, ctx.connection.config);
|
|
195
200
|
const form = new FormData();
|
|
196
201
|
form.append("model", model);
|
|
197
202
|
form.append("prompt", p.prompt);
|