local.ts 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761
  1. /**
  2. * Data model shared by local CLI/TUI. This module defines no routes, clients, accounts, or RPC
  3. * envelopes. Applications validate inputs; timestamps use Unix milliseconds. Numeric enums preserve
  4. * compatibility when reading saved sessions.
  5. */
  6. export const SessionResultSyncState = {
  7. Unknown: 0,
  8. Ready: 1,
  9. Approved: 2,
  10. Completed: 3,
  11. Failed: 4,
  12. } as const;
  13. export type SessionResultSyncState =
  14. (typeof SessionResultSyncState)[keyof typeof SessionResultSyncState];
  15. export const TurnContinuationState = {
  16. Unavailable: 0,
  17. Available: 1,
  18. Running: 2,
  19. WaitingForUser: 3,
  20. } as const;
  21. export type TurnContinuationState =
  22. (typeof TurnContinuationState)[keyof typeof TurnContinuationState];
  23. export const SessionTypeView = {
  24. Branch: 0,
  25. Root: 1,
  26. } as const;
  27. export type SessionTypeView =
  28. (typeof SessionTypeView)[keyof typeof SessionTypeView];
  29. export const SessionStatusView = {
  30. Idle: 0,
  31. Started: 1,
  32. Error: 2,
  33. Abort: 3,
  34. } as const;
  35. export type SessionStatusView =
  36. (typeof SessionStatusView)[keyof typeof SessionStatusView];
  37. export const SessionInteractionModeView = {
  38. Default: 0,
  39. Plan: 1,
  40. Goal: 2,
  41. } as const;
  42. export type SessionInteractionModeView =
  43. (typeof SessionInteractionModeView)[keyof typeof SessionInteractionModeView];
  44. export const SessionKind = {
  45. Unknown: 0,
  46. Conversation: 1,
  47. Task: 2,
  48. Peek: 3,
  49. Channel: 4,
  50. Cron: 5,
  51. } as const;
  52. export type SessionKind = (typeof SessionKind)[keyof typeof SessionKind];
  53. export const SessionCollaborationKind = {
  54. LocalCloudHandoff: 1,
  55. } as const;
  56. export type SessionCollaborationKind =
  57. (typeof SessionCollaborationKind)[keyof typeof SessionCollaborationKind];
  58. export const DriveNodeType = {
  59. Folder: 1,
  60. File: 2,
  61. } as const;
  62. export type DriveNodeType = (typeof DriveNodeType)[keyof typeof DriveNodeType];
  63. export const DriveNodeSource = {
  64. UserUpload: 1,
  65. AgentDeliverable: 2,
  66. SystemGenerated: 3,
  67. } as const;
  68. export type DriveNodeSource =
  69. (typeof DriveNodeSource)[keyof typeof DriveNodeSource];
  70. export const PluginInstallationPolicy = {
  71. USER_MANAGED: 1,
  72. DEFAULT_INSTALLED_UNREMOVABLE: 2,
  73. } as const;
  74. export type PluginInstallationPolicy =
  75. (typeof PluginInstallationPolicy)[keyof typeof PluginInstallationPolicy];
  76. export const InstalledPluginSource = {
  77. OFFICIAL: 1,
  78. LOCAL: 2,
  79. } as const;
  80. export type InstalledPluginSource =
  81. (typeof InstalledPluginSource)[keyof typeof InstalledPluginSource];
  82. export const PluginCapabilityType = {
  83. APP: 1,
  84. MCP: 2,
  85. SKILL: 3,
  86. } as const;
  87. export type PluginCapabilityType =
  88. (typeof PluginCapabilityType)[keyof typeof PluginCapabilityType];
  89. export const SkillScope = {
  90. AGENT: 1,
  91. GLOBAL: 2,
  92. } as const;
  93. export type SkillScope = (typeof SkillScope)[keyof typeof SkillScope];
  94. export const SkillSourceType = {
  95. MINIMAX_OFFICIAL: 1,
  96. USER_CONTRIBUTION: 2,
  97. } as const;
  98. export type SkillSourceType =
  99. (typeof SkillSourceType)[keyof typeof SkillSourceType];
  100. export const SkillSortType = {
  101. USE_COUNT: 1,
  102. CREATE_TIME_ASC: 2,
  103. CREATE_TIME_DESC: 3,
  104. } as const;
  105. export type SkillSortType = (typeof SkillSortType)[keyof typeof SkillSortType];
  106. export const MarketplaceCategory = {
  107. OTHER: 0,
  108. OFFICE: 1,
  109. STUDIO: 2,
  110. DESIGN_AND_SITES: 3,
  111. CODE: 4,
  112. BUSINESS: 5,
  113. SALES: 6,
  114. PRODUCTIVITY: 7,
  115. TOOLS: 8,
  116. SCIENCE_AND_HEALTHCARE: 9,
  117. EDUCATION: 10,
  118. } as const;
  119. export type MarketplaceCategory =
  120. (typeof MarketplaceCategory)[keyof typeof MarketplaceCategory];
  121. export const AgentCreationSource = {
  122. UnknownCreationSource: 0,
  123. Manual: 1,
  124. Auto: 2,
  125. Builtin: 3,
  126. } as const;
  127. export type AgentCreationSource =
  128. (typeof AgentCreationSource)[keyof typeof AgentCreationSource];
  129. export const ScheduleKind = {
  130. Recurring: 0,
  131. Once: 1,
  132. } as const;
  133. export type ScheduleKind = (typeof ScheduleKind)[keyof typeof ScheduleKind];
  134. export const PermissionReply = {
  135. AllowOnce: 0,
  136. AllowAlways: 1,
  137. Deny: 2,
  138. } as const;
  139. export type PermissionReply =
  140. (typeof PermissionReply)[keyof typeof PermissionReply];
  141. export const QuestionnaireSelectionMode = {
  142. Single: 0,
  143. Multiple: 1,
  144. } as const;
  145. export type QuestionnaireSelectionMode =
  146. (typeof QuestionnaireSelectionMode)[keyof typeof QuestionnaireSelectionMode];
  147. export const QuestionnairePurpose = {
  148. General: 0,
  149. Goal: 1,
  150. } as const;
  151. export type QuestionnairePurpose =
  152. (typeof QuestionnairePurpose)[keyof typeof QuestionnairePurpose];
  153. export const QuestionnaireStatus = {
  154. Pending: 0,
  155. Answered: 1,
  156. Expired: 2,
  157. Superseded: 3,
  158. Dismissed: 4,
  159. } as const;
  160. export type QuestionnaireStatus =
  161. (typeof QuestionnaireStatus)[keyof typeof QuestionnaireStatus];
  162. export interface AttachmentMeta {
  163. attachmentType?: string;
  164. fileName?: string;
  165. mimeType?: string;
  166. sizeBytes?: number;
  167. }
  168. export interface LocalAttachmentRef {
  169. assetId?: string;
  170. filePath?: string;
  171. dataUrl?: string;
  172. desktopPath?: string;
  173. }
  174. export interface RemoteAttachmentRef {
  175. url?: string;
  176. dataUrl?: string;
  177. }
  178. export interface AttachmentInput {
  179. meta?: AttachmentMeta;
  180. local?: LocalAttachmentRef;
  181. cloud?: RemoteAttachmentRef;
  182. }
  183. export interface ModelThinkingBudgetsInput {
  184. minimal?: number;
  185. low?: number;
  186. medium?: number;
  187. high?: number;
  188. }
  189. export interface ModelThinkingInput {
  190. effort?: string;
  191. offBehavior?: string;
  192. budgets?: ModelThinkingBudgetsInput;
  193. }
  194. export interface ModelSelectionInput {
  195. providerId?: string;
  196. modelId?: string;
  197. variant?: string;
  198. reasoning?: boolean;
  199. thinking?: ModelThinkingInput;
  200. contextLimit?: number;
  201. contextWindow?: number;
  202. maxOutputTokens?: number;
  203. }
  204. export interface AttachmentView {
  205. meta?: AttachmentMeta;
  206. local?: LocalAttachmentRef;
  207. cloud?: RemoteAttachmentRef;
  208. previewUrl?: string;
  209. status?: string;
  210. }
  211. export interface SessionToolCallView {
  212. toolName: string;
  213. toolCallId: string;
  214. toolCallStatus?: number;
  215. toolCallArgs?: string;
  216. toolCallResultData?: string;
  217. pluginProvenances?: PluginCapabilityProvenance[];
  218. }
  219. export interface SessionMessageUsageView {
  220. totalTokens?: number;
  221. contextWindow?: number;
  222. inputTokens?: number;
  223. outputTokens?: number;
  224. cacheRead?: number;
  225. cacheWrite?: number;
  226. }
  227. export interface SessionMessageActionCapabilities {
  228. fork?: boolean;
  229. rewind?: boolean;
  230. }
  231. export interface SessionMessageActionDeltaView {
  232. messageId: string;
  233. actions: SessionMessageActionCapabilities;
  234. }
  235. export interface SessionResultChangeView {
  236. relativePath: string;
  237. kind: string;
  238. previousPath?: string;
  239. baseSha256?: string;
  240. cloudSha256?: string;
  241. sizeBytes?: number;
  242. sensitive: boolean;
  243. preview?: FileDiffInfoView;
  244. }
  245. export interface SessionResultSyncView {
  246. state: SessionResultSyncState;
  247. syncRequestId?: string;
  248. selectedPaths?: string[];
  249. failedPaths?: string[];
  250. failureMessage?: string;
  251. updatedAt: number;
  252. }
  253. export interface SessionTurnResultView {
  254. resultId: string;
  255. turnId: string;
  256. baseRevisionId: string;
  257. cloudRevisionId: string;
  258. fileChanges?: SessionResultChangeView[];
  259. artifacts?: AttachmentView[];
  260. sync: SessionResultSyncView;
  261. expiresAt: number;
  262. }
  263. export interface SessionConversationCapabilities {
  264. fork: boolean;
  265. rewind: boolean;
  266. }
  267. export interface SessionForkOriginView {
  268. sourceSessionId: string;
  269. sourceMessageId: string;
  270. sourceTitle: string;
  271. }
  272. export interface MemoryReferenceView {
  273. kind: string;
  274. displayName: string;
  275. path: string;
  276. }
  277. export interface SessionMessageView {
  278. msgId: string;
  279. parentMsgId?: string;
  280. timestamp?: number;
  281. msgContent?: string;
  282. msgType?: number;
  283. role?: string;
  284. thinkingContent?: string;
  285. thinkingDurationMs?: number;
  286. finishReason?: string;
  287. toolCalls?: SessionToolCallView[];
  288. attachments?: AttachmentView[];
  289. usage?: SessionMessageUsageView;
  290. source?: string;
  291. kind?: string;
  292. originJson?: string;
  293. communicationInfosJson?: string;
  294. rawJson?: string;
  295. sourceMessageId?: string;
  296. turnId?: string;
  297. queryKey?: string;
  298. actions?: SessionMessageActionCapabilities;
  299. forkOrigin?: SessionForkOriginView;
  300. memoryReferences?: MemoryReferenceView[];
  301. }
  302. export interface QueryCollapseView {
  303. queryKey: string;
  304. currentTurnId: string;
  305. forceExpanded: boolean;
  306. processingStartedAtMs: number;
  307. processingFinishedAtMs?: number;
  308. }
  309. export interface SessionStreamFrameView {
  310. cursor?: string;
  311. eventJson?: string;
  312. dataJson?: string;
  313. messageActionDeltas?: SessionMessageActionDeltaView[];
  314. }
  315. export interface SessionStreamErrorBody {
  316. sseErrorCode: number;
  317. code: number;
  318. key: string;
  319. message: string;
  320. detail?: string;
  321. }
  322. export interface GetMessagesInput {
  323. id: string;
  324. limit?: number;
  325. before?: string;
  326. includeAttachmentReadUrls?: boolean;
  327. }
  328. export interface GetMessagesResult {
  329. messages?: SessionMessageView[];
  330. nextCursor?: string;
  331. lastMsgId?: string;
  332. hasMore?: boolean;
  333. todosJson?: string;
  334. queryCollapseViews?: QueryCollapseView[];
  335. turnResults?: SessionTurnResultView[];
  336. }
  337. export interface GetSessionForkOptionsInput {
  338. id: string;
  339. assistantMessageId?: string;
  340. }
  341. export interface GetSessionForkOptionsResult {
  342. canFork: boolean;
  343. unavailableReason?: string;
  344. suggestedTitle?: string;
  345. nextForkOrdinal?: number;
  346. sourceTitle?: string;
  347. worktreeVisible: boolean;
  348. worktreeEligible: boolean;
  349. worktreeUnavailableReason?: string;
  350. }
  351. export interface ForkSessionInput {
  352. id: string;
  353. assistantMessageId?: string;
  354. clientRequestId: string;
  355. title?: string;
  356. useSuggestedTitle: boolean;
  357. createIsolatedWorktree: boolean;
  358. }
  359. export interface ForkSessionResult {
  360. session?: SessionInfoView;
  361. forkOriginMessageId?: string;
  362. sourceDisplayMessageId?: string;
  363. displayRevision?: string;
  364. historyRevision?: string;
  365. }
  366. export interface GetSessionRewindPreviewInput {
  367. id: string;
  368. userMessageId: string;
  369. }
  370. export interface TurnDiffRewindPreviewFile {
  371. filePath: string;
  372. action: string;
  373. skipped: boolean;
  374. }
  375. export interface TurnDiffRewindPreviewTurn {
  376. turnId: string;
  377. files: TurnDiffRewindPreviewFile[];
  378. }
  379. export interface GetSessionRewindPreviewResult {
  380. turns: TurnDiffRewindPreviewTurn[];
  381. }
  382. export interface RewindSessionInput {
  383. id: string;
  384. userMessageId: string;
  385. clientRequestId: string;
  386. rewindTurnDiff?: boolean;
  387. }
  388. export interface TurnDiffRewindOutcome {
  389. status: string;
  390. revertedTurnIds?: string[];
  391. errorCode?: string;
  392. }
  393. export interface RewindSessionResult {
  394. rewound: boolean;
  395. displayRevision?: string;
  396. historyRevision?: string;
  397. deletedMessageIds?: string[];
  398. turnDiffRewind?: TurnDiffRewindOutcome;
  399. }
  400. export interface EditSessionMessageInput {
  401. id: string;
  402. userMessageId: string;
  403. clientRequestId: string;
  404. content: string;
  405. attachments?: AttachmentInput[];
  406. rewindTurnDiff?: boolean;
  407. }
  408. export interface EditSessionMessageResult {
  409. rewound: boolean;
  410. turnId?: string;
  411. userMessageId?: string;
  412. displayRevision?: string;
  413. historyRevision?: string;
  414. deletedMessageIds?: string[];
  415. }
  416. export interface SessionMessageHeadView {
  417. msgId: string;
  418. contentHead?: string;
  419. timestamp: number;
  420. }
  421. export interface SessionInputSummaryView {
  422. userInput: SessionMessageHeadView;
  423. assistantResponse?: SessionMessageHeadView;
  424. artifacts?: DriveNode[];
  425. fileChangeCount: number;
  426. }
  427. export interface ListSessionInputSummariesInput {
  428. id: string;
  429. limit?: number;
  430. before?: string;
  431. }
  432. export interface ListSessionInputSummariesResult {
  433. summaries?: SessionInputSummaryView[];
  434. total?: number;
  435. nextCursor?: string;
  436. hasMore?: boolean;
  437. }
  438. export interface SessionSourceRecordView {
  439. sourceId: string;
  440. resourceType: string;
  441. resourceDataJson: string;
  442. resourceDataVersion: number;
  443. msgId: string;
  444. toolCallId: string;
  445. resourceOrdinal: number;
  446. createdAt: number;
  447. }
  448. export interface SessionSourceTurnView {
  449. turnId: string;
  450. sourceStartedAt: number;
  451. sources: SessionSourceRecordView[];
  452. }
  453. export interface ListSessionSourceHistoryInput {
  454. id: string;
  455. limit?: number;
  456. before?: string;
  457. }
  458. export interface ListSessionSourceHistoryResult {
  459. sourcedTurnCount: number;
  460. sourceCount: number;
  461. recentSources: SessionSourceRecordView[];
  462. turns: SessionSourceTurnView[];
  463. nextCursor?: string;
  464. hasMore?: boolean;
  465. }
  466. export interface GetSessionSourceDetailInput {
  467. id: string;
  468. msgId: string;
  469. toolCallId: string;
  470. }
  471. export interface SessionSourceDetailView {
  472. msgId: string;
  473. toolCall: SessionToolCallView;
  474. }
  475. export interface GetSessionSourceDetailResult {
  476. detail?: SessionSourceDetailView;
  477. }
  478. export interface SendMessageInput {
  479. id: string;
  480. content?: string;
  481. model?: ModelSelectionInput;
  482. attachments?: AttachmentInput[];
  483. turnId?: string;
  484. clientIntent?: string;
  485. enableTeam?: boolean;
  486. reviewRequest?: ReviewRequest;
  487. }
  488. export interface ResumeSessionInput {
  489. id: string;
  490. afterMsgId?: string;
  491. afterCursor?: string;
  492. drainQueued?: boolean;
  493. continuePausedQueue?: boolean;
  494. includeAttachmentReadUrls?: boolean;
  495. }
  496. export interface InspectTurnContinuationInput {
  497. id: string;
  498. }
  499. export interface InspectTurnContinuationResult {
  500. state: TurnContinuationState;
  501. }
  502. export interface ContinueTurnInput {
  503. id: string;
  504. }
  505. export interface AbortSessionInput {
  506. id: string;
  507. turnId?: string;
  508. reason?: string;
  509. }
  510. export interface AbortSessionResult {
  511. success?: boolean;
  512. }
  513. export interface SteerSessionInput {
  514. id: string;
  515. queueItemId?: string;
  516. }
  517. export interface SteerSessionResult {
  518. success: boolean;
  519. queueItemId?: string;
  520. turnId?: string;
  521. }
  522. export interface SessionTokenUsageSummaryView {
  523. inputTokens?: number;
  524. outputTokens?: number;
  525. reasoningTokens?: number;
  526. cacheReadTokens?: number;
  527. cacheWriteTokens?: number;
  528. totalTokens?: number;
  529. costUsd?: number;
  530. turns?: number;
  531. }
  532. export interface SessionTokenUsageRowView {
  533. id?: number;
  534. sessionId?: string;
  535. agentName?: string;
  536. frameworkType?: string;
  537. turnId?: string;
  538. model?: string;
  539. ts?: number;
  540. inputTokens?: number;
  541. outputTokens?: number;
  542. reasoningTokens?: number;
  543. cacheReadTokens?: number;
  544. cacheWriteTokens?: number;
  545. costUsd?: number;
  546. rawJson?: string;
  547. }
  548. export interface ModelThinkingConfigView {
  549. mode?: string;
  550. defaultValue?: string;
  551. }
  552. export interface ModelInfoView {
  553. providerId?: string;
  554. modelId?: string;
  555. variant?: string;
  556. displayName?: string;
  557. contextLimit?: number;
  558. supportedVariants?: string[];
  559. thinkingConfig?: ModelThinkingConfigView;
  560. reasoning?: boolean;
  561. thinking?: ModelThinkingInput;
  562. }
  563. export interface SessionStatusInfoView {
  564. statusType?: SessionStatusView;
  565. message?: string;
  566. errorCode?: number;
  567. errorSource?: string;
  568. errorDetail?: string;
  569. errorProviderId?: string;
  570. }
  571. export interface RunLocationView {
  572. mode?: string;
  573. resolvedDir?: string;
  574. resolvedBranch?: string;
  575. parentRepoDir?: string;
  576. createdAt?: number;
  577. }
  578. export interface RunLocationInput {
  579. mode?: string;
  580. worktreeDir?: string;
  581. branch?: string;
  582. newWorktreeBranch?: string;
  583. newWorktreeBase?: string;
  584. }
  585. export interface SessionMemoryPolicyInput {
  586. recallEnabled?: boolean;
  587. writeEnabled?: boolean;
  588. }
  589. export interface SessionMemoryPolicyView {
  590. recallEnabled: boolean;
  591. writeEnabled: boolean;
  592. recallLocked: boolean;
  593. recallLockedAtMs?: number;
  594. }
  595. export interface SessionCollaborationView {
  596. kind: SessionCollaborationKind;
  597. dispatchId: string;
  598. canDownloadResult?: boolean;
  599. canOverwriteWorkspace?: boolean;
  600. canBrowseCloudWorkspace?: boolean;
  601. }
  602. export interface SessionInfoView {
  603. sessionId?: string;
  604. agentName?: string;
  605. sessionType?: SessionTypeView;
  606. title?: string;
  607. parentSessionId?: string;
  608. archived?: boolean;
  609. status?: SessionStatusInfoView;
  610. createdAt?: number;
  611. updatedAt?: number;
  612. model?: ModelInfoView;
  613. teamMode?: boolean;
  614. workspaceDir?: string;
  615. frameworkType?: string;
  616. isDefaultWorkspace?: boolean;
  617. visibility?: string;
  618. purpose?: string;
  619. effectiveModel?: string;
  620. effectiveModelVariant?: string;
  621. lastActiveAt?: number;
  622. runLocation?: RunLocationView;
  623. sessionKind?: SessionKind;
  624. interactionMode?: SessionInteractionModeView;
  625. conversationCapabilities?: SessionConversationCapabilities;
  626. memoryPolicy?: SessionMemoryPolicyView;
  627. collaboration?: SessionCollaborationView;
  628. }
  629. export interface SessionTreeChildView {
  630. sessionId?: string;
  631. agentName?: string;
  632. frameworkType?: string;
  633. title?: string;
  634. createdAt?: number;
  635. updatedAt?: number;
  636. archived?: boolean;
  637. compressed?: boolean;
  638. status?: SessionStatusInfoView;
  639. sessionKind?: SessionKind;
  640. }
  641. export interface QueuedMessageItemView {
  642. itemId: string;
  643. sessionId: string;
  644. status: string;
  645. source?: string;
  646. content?: string;
  647. attachments?: AttachmentView[];
  648. modelInfo?: ModelInfoView;
  649. createdAt?: number;
  650. expiresAt?: number;
  651. startedAt?: number;
  652. finishedAt?: number;
  653. failedReason?: string;
  654. reviewRequest?: ReviewRequest;
  655. }
  656. export interface FileDiffHunkView {
  657. oldStart: number;
  658. oldLines: number;
  659. newStart: number;
  660. newLines: number;
  661. lines?: string[];
  662. }
  663. export interface FileDiffInfoPatchView {
  664. oldFileName: string;
  665. newFileName: string;
  666. hunks?: FileDiffHunkView[];
  667. }
  668. export interface FileDiffInfoView {
  669. file: string;
  670. additions: number;
  671. deletions: number;
  672. status?: string;
  673. diff?: string;
  674. patch?: FileDiffInfoPatchView;
  675. previewState?: string;
  676. external?: boolean;
  677. }
  678. export interface TurnDiffView {
  679. fileChanges?: FileDiffInfoView[];
  680. sourceMessageId?: string;
  681. changeSetId?: string;
  682. status?: string;
  683. revertedAt?: number;
  684. undoable?: boolean;
  685. canUndo?: boolean;
  686. canReapply?: boolean;
  687. }
  688. export interface GetRootSessionInput {
  689. name: string;
  690. }
  691. export interface GetRootSessionResult {
  692. session?: SessionInfoView;
  693. }
  694. export interface ReplaceRootSessionInput {
  695. name: string;
  696. sessionId: string;
  697. }
  698. export interface ReplaceRootSessionResult {
  699. ok?: boolean;
  700. }
  701. export interface CreateSessionInput {
  702. name: string;
  703. workspaceDir?: string;
  704. parentSessionId?: string;
  705. title?: string;
  706. visibility?: string;
  707. purpose?: string;
  708. teamModeOff?: boolean;
  709. model?: ModelSelectionInput;
  710. runLocation?: RunLocationInput;
  711. appMode?: string;
  712. projectId?: number;
  713. sessionKind?: SessionKind;
  714. expectedAgentInstanceId?: string;
  715. }
  716. export interface CreateSessionResult {
  717. agentName?: string;
  718. sessionId?: string;
  719. session?: SessionInfoView;
  720. }
  721. export interface UpdateSessionInput {
  722. id: string;
  723. title?: string;
  724. memoryPolicy?: SessionMemoryPolicyInput;
  725. projectId?: number;
  726. }
  727. export interface UpdateSessionResult {
  728. session?: SessionInfoView;
  729. }
  730. export interface GetSessionUsageInput {
  731. id: string;
  732. fromMs?: number;
  733. toMs?: number;
  734. }
  735. export interface GetSessionUsageResult {
  736. summary?: SessionTokenUsageSummaryView;
  737. rows?: SessionTokenUsageRowView[];
  738. }
  739. export interface GetPeekContextInput {
  740. id: string;
  741. }
  742. export interface GetPeekContextResult {
  743. context?: string;
  744. }
  745. export interface GetSessionDiffInput {
  746. id: string;
  747. messageId?: string;
  748. }
  749. export interface GetSessionDiffResult {
  750. diffs?: FileDiffInfoView[];
  751. changeSetId?: string;
  752. }
  753. export interface DeleteSessionInput {
  754. id: string;
  755. }
  756. export interface DeleteSessionResult {
  757. success?: boolean;
  758. }
  759. export interface ArchiveSessionInput {
  760. id: string;
  761. archived?: boolean;
  762. }
  763. export interface ArchiveSessionResult {
  764. success?: boolean;
  765. }
  766. export interface CompressSessionInput {
  767. id: string;
  768. archived?: boolean;
  769. }
  770. export interface CompressSessionResult {
  771. success?: boolean;
  772. }
  773. export interface ListQueueMessagesInput {
  774. id: string;
  775. }
  776. export interface ListQueueMessagesResult {
  777. items?: QueuedMessageItemView[];
  778. paused?: boolean;
  779. pendingCount?: number;
  780. }
  781. export interface GetQueueItemInput {
  782. id: string;
  783. itemId: string;
  784. }
  785. export interface GetQueueItemResult {
  786. item?: QueuedMessageItemView;
  787. }
  788. export interface EnqueueMessageInput {
  789. id: string;
  790. content?: string;
  791. model?: ModelSelectionInput;
  792. attachments?: AttachmentInput[];
  793. clientRequestId?: string;
  794. expiresAt?: number;
  795. reviewRequest?: ReviewRequest;
  796. clientIntent?: string;
  797. }
  798. export interface EnqueueMessageResult {
  799. itemId?: string;
  800. status?: string;
  801. position?: number;
  802. }
  803. export interface UpdateQueueItemInput {
  804. id: string;
  805. itemId: string;
  806. content?: string;
  807. model?: ModelSelectionInput;
  808. attachments?: AttachmentInput[];
  809. expiresAt?: number;
  810. }
  811. export interface UpdateQueueItemResult {
  812. item?: QueuedMessageItemView;
  813. }
  814. export interface ReorderQueueInput {
  815. id: string;
  816. itemIds: string[];
  817. }
  818. export interface ReorderQueueResult {
  819. items?: QueuedMessageItemView[];
  820. }
  821. export interface DeleteQueueItemInput {
  822. id: string;
  823. itemId: string;
  824. }
  825. export interface DeleteQueueItemResult {
  826. item?: QueuedMessageItemView;
  827. }
  828. export interface GetTurnDiffInput {
  829. id: string;
  830. assistantMessageId?: string;
  831. }
  832. export interface GetTurnDiffResult {
  833. fileChanges?: FileDiffInfoView[];
  834. sourceMessageId?: string;
  835. changeSetId?: string;
  836. status?: string;
  837. revertedAt?: number;
  838. undoable?: boolean;
  839. canUndo?: boolean;
  840. canReapply?: boolean;
  841. }
  842. export interface RequestCompactionInput {
  843. name: string;
  844. id: string;
  845. reason?: string;
  846. customInstructions?: string;
  847. }
  848. export interface RequestCompactionResult {
  849. success: boolean;
  850. sessionId?: string;
  851. compactionId?: string;
  852. messagesBefore?: number;
  853. messagesAfter?: number;
  854. tokensBefore?: number;
  855. tokensAfter?: number;
  856. error?: string;
  857. code?: string;
  858. }
  859. export interface RevertTurnDiffInput {
  860. id: string;
  861. changeSetId?: string;
  862. assistantMessageId?: string;
  863. }
  864. export interface RevertTurnDiffResult {
  865. success?: boolean;
  866. error?: string;
  867. turnDiff?: TurnDiffView;
  868. }
  869. export interface ReapplyTurnDiffInput {
  870. id: string;
  871. changeSetId?: string;
  872. assistantMessageId?: string;
  873. turnId?: string;
  874. }
  875. export interface ReapplyTurnDiffResult {
  876. success: boolean;
  877. error?: string;
  878. fileChanges?: FileDiffInfoView[];
  879. sourceMessageId?: string;
  880. changeSetId?: string;
  881. status?: string;
  882. revertedAt?: number;
  883. undoable?: boolean;
  884. canUndo?: boolean;
  885. canReapply?: boolean;
  886. }
  887. export interface ListSessionFilesInput {
  888. id: string;
  889. limit?: number;
  890. cursor?: string;
  891. }
  892. export interface ListSessionFilesResult {
  893. nodes?: DriveNode[];
  894. nextCursor?: string;
  895. hasMore?: boolean;
  896. }
  897. export interface DriveNode {
  898. nodeId?: string;
  899. nodeType?: DriveNodeType;
  900. parentId?: string;
  901. name?: string;
  902. fileExt?: string;
  903. category?: string;
  904. mimeType?: string;
  905. sizeBytes?: number;
  906. cdnUrl?: string;
  907. source?: DriveNodeSource;
  908. sessionId?: string;
  909. childCount?: number;
  910. createdAt?: number;
  911. updatedAt?: number;
  912. isFavorited?: boolean;
  913. frontPageScreenshot?: string;
  914. path?: string;
  915. }
  916. export interface ConnectorActionState {
  917. canConnect?: boolean;
  918. canDisconnect?: boolean;
  919. connectButtonText?: string;
  920. disabledReason?: string;
  921. }
  922. export interface ConnectorConnectionView {
  923. status?: string;
  924. connectedAtMs?: number;
  925. expiresAtMs?: number;
  926. lastUsedAtMs?: number;
  927. statusReason?: string;
  928. }
  929. export interface ReviewRequest {
  930. scope: string;
  931. }
  932. export interface PluginPackageVersion {
  933. name: string;
  934. version: string;
  935. archiveSha256: string;
  936. contentDigest: string;
  937. }
  938. export interface PluginCapabilitySummary {
  939. appCount: number;
  940. mcpServerCount: number;
  941. skillCount: number;
  942. hookCount?: number;
  943. }
  944. export interface PluginAppInfo {
  945. provider: string;
  946. displayName?: string;
  947. logoUrl?: string;
  948. status?: string;
  949. connection?: ConnectorConnectionView;
  950. actions?: ConnectorActionState;
  951. darkLogoUrl?: string;
  952. }
  953. export interface PluginMcpServerInfo {
  954. name: string;
  955. transport: string;
  956. description?: string;
  957. configJson: string;
  958. }
  959. export interface PluginSkillInfo {
  960. name: string;
  961. displayName?: string;
  962. description?: string;
  963. content: string;
  964. }
  965. export interface PluginMarketplaceSummary {
  966. name: string;
  967. version?: string;
  968. displayName?: string;
  969. description?: string;
  970. author?: string;
  971. iconUrl?: string;
  972. capabilities: PluginCapabilitySummary;
  973. installExists: boolean;
  974. enabled: boolean;
  975. category?: MarketplaceCategory;
  976. darkIconUrl?: string;
  977. installationPolicy?: PluginInstallationPolicy;
  978. }
  979. export interface PluginMarketplaceDetail {
  980. summary: PluginMarketplaceSummary;
  981. apps: PluginAppInfo[];
  982. mcpServers: PluginMcpServerInfo[];
  983. skills: PluginSkillInfo[];
  984. exampleQueries?: string[];
  985. }
  986. export interface GithubPluginSource {
  987. repositoryUrl: string;
  988. commitSha: string;
  989. subPath?: string;
  990. }
  991. export interface PluginImportDiagnostic {
  992. code: string;
  993. capability?: string;
  994. name?: string;
  995. }
  996. export interface PreviewGithubPluginInput {
  997. url: string;
  998. }
  999. export interface GithubPluginPreview {
  1000. summary: PluginMarketplaceSummary;
  1001. skillCount: number;
  1002. mcpServerCount: number;
  1003. hasStdioMcp: boolean;
  1004. }
  1005. export interface PreviewGithubPluginResult {
  1006. source: GithubPluginSource;
  1007. plugin: GithubPluginPreview;
  1008. diagnostics: PluginImportDiagnostic[];
  1009. packageSizeBytes: number;
  1010. canImport: boolean;
  1011. }
  1012. export interface ImportGithubPluginInput {
  1013. source: GithubPluginSource;
  1014. }
  1015. export interface ImportGithubPluginResult {
  1016. plugin: PluginMarketplaceSummary;
  1017. }
  1018. export interface PluginCapabilityProvenance {
  1019. pluginName: string;
  1020. pluginVersion?: string;
  1021. source: InstalledPluginSource;
  1022. capabilityType: PluginCapabilityType;
  1023. capabilityName: string;
  1024. iconUrl?: string;
  1025. darkIconUrl?: string;
  1026. }
  1027. export interface InstalledPluginSummary {
  1028. name: string;
  1029. version?: string;
  1030. displayName?: string;
  1031. description?: string;
  1032. author?: string;
  1033. iconUrl?: string;
  1034. capabilities: PluginCapabilitySummary;
  1035. source: InstalledPluginSource;
  1036. enabled: boolean;
  1037. category?: MarketplaceCategory;
  1038. darkIconUrl?: string;
  1039. installationPolicy?: PluginInstallationPolicy;
  1040. }
  1041. export interface ListMarketplacePluginsInput {
  1042. cursor?: string;
  1043. limit?: number;
  1044. keyword?: string;
  1045. category?: MarketplaceCategory;
  1046. skillCursor?: string;
  1047. skillLimit?: number;
  1048. source?: InstalledPluginSource;
  1049. skillSourceType?: SkillSourceType;
  1050. skillSortType?: SkillSortType;
  1051. }
  1052. export interface ListMarketplacePluginsResult {
  1053. plugins: PluginMarketplaceSummary[];
  1054. nextCursor?: string;
  1055. hasMore?: boolean;
  1056. marketplaceSkills?: SkillHubItem[];
  1057. skillNextCursor?: string;
  1058. skillHasMore?: boolean;
  1059. pluginTotal?: number;
  1060. cursorResetRequired?: boolean;
  1061. }
  1062. export interface GetMarketplacePluginInput {
  1063. pluginName: string;
  1064. source?: InstalledPluginSource;
  1065. }
  1066. export interface GetMarketplacePluginResult {
  1067. plugin?: PluginMarketplaceDetail;
  1068. }
  1069. export interface ListInstalledPluginsInput {
  1070. cursor?: string;
  1071. limit?: number;
  1072. keyword?: string;
  1073. }
  1074. export interface ListInstalledPluginsResult {
  1075. plugins: InstalledPluginSummary[];
  1076. nextCursor?: string;
  1077. hasMore: boolean;
  1078. }
  1079. export interface EnabledPluginSummary {
  1080. name: string;
  1081. displayName?: string;
  1082. iconUrl?: string;
  1083. darkIconUrl?: string;
  1084. }
  1085. export interface ListEnabledPluginsInput {}
  1086. export interface ListEnabledPluginsResult {
  1087. plugins: EnabledPluginSummary[];
  1088. }
  1089. export interface MutatePluginInput {
  1090. pluginName: string;
  1091. source?: InstalledPluginSource;
  1092. }
  1093. export interface MutatePluginResult {
  1094. source: InstalledPluginSource;
  1095. installExists: boolean;
  1096. enabled: boolean;
  1097. package?: PluginPackageVersion;
  1098. installationPolicy?: PluginInstallationPolicy;
  1099. }
  1100. export interface CreatorInfo {
  1101. userId?: string;
  1102. userName?: string;
  1103. avatarUrl?: string;
  1104. }
  1105. export interface SkillInfo {
  1106. name: string;
  1107. displayName?: string;
  1108. description?: string;
  1109. displayDescription?: string;
  1110. scope?: SkillScope;
  1111. sourceType?: SkillSourceType;
  1112. agentName?: string;
  1113. url?: string;
  1114. id?: number;
  1115. createdAt?: number;
  1116. updatedAt?: number;
  1117. creatorInfo?: CreatorInfo;
  1118. locationUri?: string;
  1119. displayNames?: Record<string, string>;
  1120. descriptions?: Record<string, string>;
  1121. sourceKind?: string;
  1122. enabled?: boolean;
  1123. publisherSourceType?: SkillSourceType;
  1124. }
  1125. export interface SkillHubItem {
  1126. id: number;
  1127. name: string;
  1128. displayName?: string;
  1129. description?: string;
  1130. displayDescription?: string;
  1131. content?: string;
  1132. sourceUrl?: string;
  1133. sourceType?: SkillSourceType;
  1134. creatorInfo?: CreatorInfo;
  1135. useCount?: number;
  1136. added?: boolean;
  1137. createdAt?: number;
  1138. updatedAt?: number;
  1139. category?: MarketplaceCategory;
  1140. }
  1141. export interface SkillFileInfo {
  1142. name: string;
  1143. path: string;
  1144. isDir?: boolean;
  1145. }
  1146. export interface ListRuntimeSkillsInput {
  1147. agentName?: string;
  1148. sessionId?: string;
  1149. workspaceDir?: string;
  1150. includePluginSkills?: boolean;
  1151. }
  1152. export interface ListRuntimeSkillsResult {
  1153. skills?: SkillInfo[];
  1154. refreshedAt?: number;
  1155. }
  1156. export interface AgentDetail {
  1157. name?: string;
  1158. displayName?: string;
  1159. agentRole?: string;
  1160. rootSessionId?: string;
  1161. agentConfigDir?: string;
  1162. createdAt?: number;
  1163. updatedAt?: number;
  1164. defaultWorkspaceDir?: string;
  1165. userDefaultWorkspaceDir?: string;
  1166. creationSource?: AgentCreationSource;
  1167. avatar?: string;
  1168. description?: string;
  1169. persona?: string;
  1170. systemPrompt?: string;
  1171. }
  1172. export interface ListAgentsInput {
  1173. limit?: number;
  1174. offset?: number;
  1175. search?: string;
  1176. include?: string;
  1177. excludePrimary?: boolean;
  1178. }
  1179. export interface ListAgentsResult {
  1180. agents?: AgentDetail[];
  1181. }
  1182. export interface CreateAgentInput {
  1183. name?: string;
  1184. displayName?: string;
  1185. persona?: string;
  1186. systemPrompt?: string;
  1187. description?: string;
  1188. avatar?: string;
  1189. defaultWorkspaceDir?: string;
  1190. avatarObjectKey?: string;
  1191. definitionOnly?: boolean;
  1192. initialDefinition?: AgentConfiguredDefinition;
  1193. }
  1194. export interface CreateAgentResult {
  1195. name?: string;
  1196. rootSessionId?: string;
  1197. }
  1198. export interface GetAgentInput {
  1199. name: string;
  1200. include?: string;
  1201. }
  1202. export interface GetAgentResult {
  1203. agent?: AgentDetail;
  1204. }
  1205. export interface UpdateAgentInput {
  1206. name: string;
  1207. displayName?: string;
  1208. persona?: string;
  1209. systemPrompt?: string;
  1210. description?: string;
  1211. avatar?: string;
  1212. avatarObjectKey?: string;
  1213. }
  1214. export interface UpdateAgentResult {
  1215. success?: boolean;
  1216. agent?: AgentDetail;
  1217. }
  1218. export interface DeleteAgentInput {
  1219. name: string;
  1220. }
  1221. export interface DeleteAgentResult {
  1222. success?: boolean;
  1223. }
  1224. export interface AgentConfiguredMavisFields {
  1225. displayName?: string;
  1226. avatar?: string;
  1227. contextWindow?: number;
  1228. maxOutputTokens?: number;
  1229. defaultWorkspaceDir?: string;
  1230. extensionSkills?: string[];
  1231. }
  1232. export interface AgentConfiguredDefinition {
  1233. name: string;
  1234. description: string;
  1235. model?: string;
  1236. effort?: string;
  1237. tools?: string[];
  1238. disallowedTools?: string[];
  1239. mcpServers?: string[];
  1240. skills?: string[];
  1241. mavis?: AgentConfiguredMavisFields;
  1242. systemPrompt: string;
  1243. }
  1244. export interface CronSessionConfig {
  1245. mode?: string;
  1246. sessionId?: string;
  1247. keepSessions?: number;
  1248. }
  1249. export interface ActiveHours {
  1250. start?: string;
  1251. end?: string;
  1252. }
  1253. export interface CronTask {
  1254. cronId?: string;
  1255. cronName?: string;
  1256. agentName?: string;
  1257. schedule?: string;
  1258. timezone?: string;
  1259. enabled?: boolean;
  1260. prompt?: string;
  1261. session?: CronSessionConfig;
  1262. activeHours?: ActiveHours;
  1263. status?: string;
  1264. lastRun?: number;
  1265. lastResult?: string;
  1266. lastError?: string;
  1267. nextRun?: number;
  1268. projectId?: number;
  1269. model?: ModelSelectionInput;
  1270. scheduleKind?: ScheduleKind;
  1271. runAt?: number;
  1272. runCount?: number;
  1273. }
  1274. export interface CreateCronInput {
  1275. name: string;
  1276. cronName: string;
  1277. schedule?: string;
  1278. prompt?: string;
  1279. timezone?: string;
  1280. activeHours?: ActiveHours;
  1281. session?: CronSessionConfig;
  1282. enabled?: boolean;
  1283. projectId?: number;
  1284. model?: ModelSelectionInput;
  1285. scheduleKind?: ScheduleKind;
  1286. runAt?: number;
  1287. runCount?: number;
  1288. }
  1289. export interface UpdateCronInput {
  1290. cronId: string;
  1291. enabled?: boolean;
  1292. schedule?: string;
  1293. timezone?: string;
  1294. activeHours?: ActiveHours;
  1295. prompt?: string;
  1296. session?: CronSessionConfig;
  1297. projectId?: number;
  1298. model?: ModelSelectionInput;
  1299. scheduleKind?: ScheduleKind;
  1300. runAt?: number;
  1301. runCount?: number;
  1302. }
  1303. export interface CronDeliveryRequest {
  1304. cronId: string;
  1305. runId: string;
  1306. sessionId: string;
  1307. text: string;
  1308. }
  1309. export interface CronDeliveryResult {
  1310. delivered: boolean;
  1311. errorCode?: string;
  1312. error?: string;
  1313. }
  1314. export interface GoalVerificationSummary {
  1315. backend?: string;
  1316. verdict?: string;
  1317. reason?: string;
  1318. missing?: string[];
  1319. notMetStreak?: number;
  1320. at?: number;
  1321. }
  1322. export interface GoalExecutionState {
  1323. waitReason?: string;
  1324. waitSince?: number;
  1325. }
  1326. export interface GoalState {
  1327. goalId?: string;
  1328. sessionId?: string;
  1329. objective?: string;
  1330. status?: string;
  1331. createdAt?: number;
  1332. updatedAt?: number;
  1333. tokensUsed?: number;
  1334. timeUsedSeconds?: number;
  1335. tokenBudget?: number;
  1336. hasKickoffAttachments?: boolean;
  1337. turnsUsed?: number;
  1338. statusReason?: string;
  1339. lastVerification?: GoalVerificationSummary;
  1340. execution?: GoalExecutionState;
  1341. objectiveResources?: AttachmentInput[];
  1342. }
  1343. export interface CreateGoalInput {
  1344. sessionId: string;
  1345. objective?: string;
  1346. tokenBudget?: number;
  1347. attachments?: AttachmentInput[];
  1348. objectiveResources?: AttachmentInput[];
  1349. }
  1350. export interface PatchGoalInput {
  1351. sessionId: string;
  1352. status?: string;
  1353. objective?: string;
  1354. tokenBudget?: number;
  1355. objectiveResources?: AttachmentInput[];
  1356. expectedGoalId?: string;
  1357. expectedUpdatedAt?: number;
  1358. }
  1359. export interface PendingPermissionItem {
  1360. requestId?: string;
  1361. toolName?: string;
  1362. ruleContents?: string[];
  1363. toolInput?: string;
  1364. toolDescription?: string;
  1365. reason?: string;
  1366. sessionId?: string;
  1367. agentName?: string;
  1368. allowAlwaysSupported?: boolean;
  1369. createdAt?: number;
  1370. }
  1371. export interface ReplyPermissionInput {
  1372. name: string;
  1373. requestId: string;
  1374. reply: PermissionReply;
  1375. message?: string;
  1376. }
  1377. export interface ReplyPermissionResult {
  1378. success?: boolean;
  1379. }
  1380. export interface ListPendingPermissionsInput {}
  1381. export interface ListPendingPermissionsResult {
  1382. requests?: PendingPermissionItem[];
  1383. }
  1384. export interface QuestionnaireImage {
  1385. src: string;
  1386. alt?: string;
  1387. caption?: string;
  1388. width?: number;
  1389. height?: number;
  1390. }
  1391. export interface QuestionnaireOption {
  1392. id: string;
  1393. label: string;
  1394. description?: string;
  1395. image?: QuestionnaireImage;
  1396. recommended?: boolean;
  1397. }
  1398. export interface QuestionnaireStep {
  1399. id: string;
  1400. header?: string;
  1401. question: string;
  1402. description?: string;
  1403. image?: QuestionnaireImage;
  1404. selectionMode: QuestionnaireSelectionMode;
  1405. options?: QuestionnaireOption[];
  1406. allowOther: boolean;
  1407. otherPlaceholder: string;
  1408. required: boolean;
  1409. }
  1410. export interface QuestionnaireToolCall {
  1411. messageId: string;
  1412. callId: string;
  1413. }
  1414. export interface QuestionnaireRequester {
  1415. sessionId: string;
  1416. runId?: string;
  1417. toolCallId?: string;
  1418. agentName?: string;
  1419. }
  1420. export interface QuestionnairePresentation {
  1421. replaceComposer: boolean;
  1422. showProgress: boolean;
  1423. allowBackNavigation: boolean;
  1424. }
  1425. export interface QuestionnairePlanReviewView {
  1426. markdown: string;
  1427. path: string;
  1428. }
  1429. export interface QuestionnaireModePayload {
  1430. featureKey?: string;
  1431. planReview?: QuestionnairePlanReviewView;
  1432. }
  1433. export interface QuestionnaireRequestView {
  1434. schemaVersion: number;
  1435. id: string;
  1436. title?: string;
  1437. tool?: QuestionnaireToolCall;
  1438. requester?: QuestionnaireRequester;
  1439. presentation: QuestionnairePresentation;
  1440. steps: QuestionnaireStep[];
  1441. expiresAt?: number;
  1442. status?: QuestionnaireStatus;
  1443. createdAt?: number;
  1444. mode?: string;
  1445. modePayload?: QuestionnaireModePayload;
  1446. purpose?: QuestionnairePurpose;
  1447. }
  1448. export interface QuestionnaireReplyAnswer {
  1449. stepId: string;
  1450. selectedOptionIds?: string[];
  1451. selectedOther?: boolean;
  1452. otherText?: string;
  1453. skipped?: boolean;
  1454. }
  1455. export interface ReplyQuestionnaireInput {
  1456. name: string;
  1457. requestId: string;
  1458. schemaVersion: number;
  1459. answers: QuestionnaireReplyAnswer[];
  1460. submittedAt?: number;
  1461. }
  1462. export interface ReplyQuestionnaireResult {
  1463. ok: boolean;
  1464. requestId: string;
  1465. sessionId: string;
  1466. agentName?: string;
  1467. answeredAt: number;
  1468. }
  1469. export interface DismissQuestionnaireInput {
  1470. name: string;
  1471. requestId: string;
  1472. }
  1473. export interface DismissQuestionnaireResult {
  1474. ok: boolean;
  1475. requestId: string;
  1476. sessionId: string;
  1477. agentName?: string;
  1478. dismissedAt: number;
  1479. }
  1480. export interface GetPendingQuestionnaireInput {
  1481. name: string;
  1482. sessionId: string;
  1483. }
  1484. export interface GetPendingQuestionnaireResult {
  1485. request?: QuestionnaireRequestView;
  1486. }
  1487. export interface GetLatestPlanReviewInput {
  1488. name: string;
  1489. sessionId: string;
  1490. }
  1491. export interface GetQuestionnaireResult {
  1492. request?: QuestionnaireRequestView;
  1493. status?: QuestionnaireStatus;
  1494. sessionId?: string;
  1495. agentName?: string;
  1496. createdAt?: number;
  1497. answeredAt?: number;
  1498. dismissedAt?: number;
  1499. }
  1500. export interface LocalMcpServerSummary {
  1501. name: string;
  1502. enabled: boolean;
  1503. transport?: string;
  1504. description?: string;
  1505. configJson: string;
  1506. endpoint?: string;
  1507. }
  1508. export interface ListLocalMcpServersInput {
  1509. keyword?: string;
  1510. }
  1511. export interface ListLocalMcpServersResult {
  1512. servers: LocalMcpServerSummary[];
  1513. }