Files
archived-orca/mobile/src/tasks/mobile-task-item-comment-operations.ts
Neil 19043a3d76 refactor(mobile): organize pairing, session, RPC and host owners (#39846)
* refactor(mobile): give relay and encryption concrete owners

* refactor(mobile): organize session and review feature owners

* refactor(mobile): organize RPC and host ownership

* test(mobile): point render fixtures at concrete owners

* refactor(mobile): use explicit type-only owner imports
2026-11-08 07:19:05 -08:00

83 lines
2.7 KiB
TypeScript

import { bindDeferredRpcOperation, defineRpcOperation } from '../transport/rpc/rpc-operation'
import { rpcResultVariant } from '../transport/rpc/rpc-operation-result-reader'
import {
linearCommentWrittenSchema,
reviewThreadResolvedSchema,
taskCommentWrittenSchema
} from './task-item-comment-reply-schema'
// Accepted comment envelopes may fail in-band; callers keep provider-specific fallback copy.
const taskCommentWrittenReader = rpcResultVariant('task-comment-written', taskCommentWrittenSchema)
export const githubIssueCommentWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'github.add-issue-comment',
method: 'github.addIssueComment',
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: taskCommentWrittenReader
})
)
export const githubReviewCommentWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'github.add-pr-review-comment',
method: 'github.addPRReviewComment',
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: taskCommentWrittenReader
})
)
export const githubReviewCommentReplyWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'github.add-pr-review-comment-reply',
method: 'github.addPRReviewCommentReply',
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: taskCommentWrittenReader
})
)
export const gitlabIssueCommentWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'gitlab.add-issue-comment',
method: 'gitlab.addIssueComment',
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: taskCommentWrittenReader
})
)
export const gitlabMergeRequestCommentWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'gitlab.add-mr-comment',
method: 'gitlab.addMRComment',
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: taskCommentWrittenReader
})
)
export const linearIssueCommentWrite = bindDeferredRpcOperation(
defineRpcOperation({
name: 'linear.add-issue-comment',
method: 'linear.addIssueComment',
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: rpcResultVariant('linear-comment-written', linearCommentWrittenSchema)
})
)
// Thread toggles acknowledge with true; any other reply means the write did not happen.
export const githubReviewThreadResolve = bindDeferredRpcOperation(
defineRpcOperation({
name: 'github.resolve-review-thread',
method: 'github.resolveReviewThread',
acceptance: 'require-result-or-throw-message',
barrier: 'after-caller-barrier',
read: rpcResultVariant('github-review-thread-resolved', reviewThreadResolvedSchema)
})
)