mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 08:03:13 +00:00
Add read-only orca linear CLI with trusted launch-prompt pointer (V1) (#5126)
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -21,6 +21,7 @@ import { GITHUB_METHODS } from './github'
|
||||
import { GITLAB_METHODS } from './gitlab'
|
||||
import { HOSTED_REVIEW_METHODS } from './hosted-review'
|
||||
import { LINEAR_METHODS } from './linear'
|
||||
import { LINEAR_AGENT_ACCESS_METHODS } from './linear-agent-access'
|
||||
import { JIRA_METHODS } from './jira'
|
||||
import { SSH_METHODS } from './ssh'
|
||||
import { SPEECH_METHODS } from './speech'
|
||||
@@ -58,6 +59,7 @@ export const ALL_RPC_METHODS: readonly RpcAnyMethod[] = [
|
||||
...GITLAB_METHODS,
|
||||
...HOSTED_REVIEW_METHODS,
|
||||
...LINEAR_METHODS,
|
||||
...LINEAR_AGENT_ACCESS_METHODS,
|
||||
...JIRA_METHODS,
|
||||
...SSH_METHODS,
|
||||
...SPEECH_METHODS,
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import { z } from 'zod'
|
||||
import { defineMethod, type RpcMethod } from '../core'
|
||||
import { OptionalFiniteNumber, OptionalString, requiredString } from '../schemas'
|
||||
|
||||
const AgentSearchIssues = z.object({
|
||||
query: requiredString('Missing query'),
|
||||
limit: OptionalFiniteNumber,
|
||||
workspaceId: z.union([z.string(), z.literal('all')]).optional()
|
||||
})
|
||||
|
||||
const LinearIncludeFlags = z.object({
|
||||
comments: z.boolean(),
|
||||
children: z.boolean(),
|
||||
attachments: z.boolean(),
|
||||
relations: z.boolean()
|
||||
})
|
||||
|
||||
const LinearCurrentContext = z
|
||||
.object({
|
||||
worktreeId: OptionalString,
|
||||
terminalHandle: OptionalString,
|
||||
cwd: OptionalString,
|
||||
remote: z.boolean().optional()
|
||||
})
|
||||
.optional()
|
||||
|
||||
const AgentIssueContext = z.object({
|
||||
input: OptionalString,
|
||||
current: z.boolean().optional(),
|
||||
workspaceId: OptionalString,
|
||||
include: LinearIncludeFlags,
|
||||
depth: z.number().int().min(0).max(5),
|
||||
context: LinearCurrentContext
|
||||
})
|
||||
|
||||
export const LINEAR_AGENT_ACCESS_METHODS: RpcMethod[] = [
|
||||
defineMethod({
|
||||
name: 'linear.agentSearchIssues',
|
||||
params: AgentSearchIssues,
|
||||
handler: async (params, { runtime }) =>
|
||||
runtime.linearSearchForAgents({
|
||||
query: params.query,
|
||||
limit: params.limit,
|
||||
workspaceId: params.workspaceId
|
||||
})
|
||||
}),
|
||||
defineMethod({
|
||||
name: 'linear.issueContext',
|
||||
params: AgentIssueContext,
|
||||
handler: async (params, { runtime }) => runtime.linearIssueContext(params)
|
||||
}),
|
||||
defineMethod({
|
||||
name: 'linear.resolveCurrentIssue',
|
||||
params: LinearCurrentContext,
|
||||
handler: async (params, { runtime }) => runtime.linearResolveCurrentIssue(params)
|
||||
})
|
||||
]
|
||||
@@ -59,6 +59,8 @@ export const WorktreeCreate = z
|
||||
linkedIssue: TriStateLinkedIssue,
|
||||
linkedPR: TriStateLinkedIssue,
|
||||
linkedLinearIssue: z.string().optional(),
|
||||
linkedLinearIssueWorkspaceId: z.union([z.string(), z.null()]).optional(),
|
||||
linkedLinearIssueOrganizationUrlKey: z.union([z.string(), z.null()]).optional(),
|
||||
linkedGitLabMR: TriStateLinkedIssue,
|
||||
linkedGitLabIssue: TriStateLinkedIssue,
|
||||
comment: OptionalString,
|
||||
|
||||
@@ -64,6 +64,8 @@ export const WORKTREE_METHODS: RpcMethod[] = [
|
||||
linkedIssue: params.linkedIssue,
|
||||
linkedPR: params.linkedPR,
|
||||
linkedLinearIssue: params.linkedLinearIssue,
|
||||
linkedLinearIssueWorkspaceId: params.linkedLinearIssueWorkspaceId,
|
||||
linkedLinearIssueOrganizationUrlKey: params.linkedLinearIssueOrganizationUrlKey,
|
||||
linkedGitLabMR: params.linkedGitLabMR,
|
||||
linkedGitLabIssue: params.linkedGitLabIssue,
|
||||
comment: params.comment,
|
||||
|
||||
Reference in New Issue
Block a user