@proposit/shared 0.1.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.
Files changed (311) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -0
  3. package/dist/api-client/argument/batch.d.ts +661 -0
  4. package/dist/api-client/argument/batch.d.ts.map +1 -0
  5. package/dist/api-client/argument/batch.js +14 -0
  6. package/dist/api-client/argument/batch.js.map +1 -0
  7. package/dist/api-client/argument/claims.d.ts +175 -0
  8. package/dist/api-client/argument/claims.d.ts.map +1 -0
  9. package/dist/api-client/argument/claims.js +20 -0
  10. package/dist/api-client/argument/claims.js.map +1 -0
  11. package/dist/api-client/argument/index.d.ts +1344 -0
  12. package/dist/api-client/argument/index.d.ts.map +1 -0
  13. package/dist/api-client/argument/index.js +62 -0
  14. package/dist/api-client/argument/index.js.map +1 -0
  15. package/dist/api-client/argument/logic/index.d.ts +861 -0
  16. package/dist/api-client/argument/logic/index.d.ts.map +1 -0
  17. package/dist/api-client/argument/logic/index.js +73 -0
  18. package/dist/api-client/argument/logic/index.js.map +1 -0
  19. package/dist/api-client/argument/logic/repair.d.ts +182 -0
  20. package/dist/api-client/argument/logic/repair.d.ts.map +1 -0
  21. package/dist/api-client/argument/logic/repair.js +9 -0
  22. package/dist/api-client/argument/logic/repair.js.map +1 -0
  23. package/dist/api-client/argument/reactions.d.ts +38 -0
  24. package/dist/api-client/argument/reactions.d.ts.map +1 -0
  25. package/dist/api-client/argument/reactions.js +9 -0
  26. package/dist/api-client/argument/reactions.js.map +1 -0
  27. package/dist/api-client/argument/reviews.d.ts +183 -0
  28. package/dist/api-client/argument/reviews.d.ts.map +1 -0
  29. package/dist/api-client/argument/reviews.js +21 -0
  30. package/dist/api-client/argument/reviews.js.map +1 -0
  31. package/dist/api-client/search.d.ts +64 -0
  32. package/dist/api-client/search.d.ts.map +1 -0
  33. package/dist/api-client/search.js +19 -0
  34. package/dist/api-client/search.js.map +1 -0
  35. package/dist/api-client/user/claims.d.ts +128 -0
  36. package/dist/api-client/user/claims.d.ts.map +1 -0
  37. package/dist/api-client/user/claims.js +10 -0
  38. package/dist/api-client/user/claims.js.map +1 -0
  39. package/dist/api-client/user/sources.d.ts +41 -0
  40. package/dist/api-client/user/sources.d.ts.map +1 -0
  41. package/dist/api-client/user/sources.js +7 -0
  42. package/dist/api-client/user/sources.js.map +1 -0
  43. package/dist/checksum.d.ts +2 -0
  44. package/dist/checksum.d.ts.map +1 -0
  45. package/dist/checksum.js +32 -0
  46. package/dist/checksum.js.map +1 -0
  47. package/dist/consts/argument.d.ts +9 -0
  48. package/dist/consts/argument.d.ts.map +1 -0
  49. package/dist/consts/argument.js +17 -0
  50. package/dist/consts/argument.js.map +1 -0
  51. package/dist/consts/identity.d.ts +3 -0
  52. package/dist/consts/identity.d.ts.map +1 -0
  53. package/dist/consts/identity.js +6 -0
  54. package/dist/consts/identity.js.map +1 -0
  55. package/dist/consts/index.d.ts +6 -0
  56. package/dist/consts/index.d.ts.map +1 -0
  57. package/dist/consts/index.js +6 -0
  58. package/dist/consts/index.js.map +1 -0
  59. package/dist/consts/roles.d.ts +27 -0
  60. package/dist/consts/roles.d.ts.map +1 -0
  61. package/dist/consts/roles.js +52 -0
  62. package/dist/consts/roles.js.map +1 -0
  63. package/dist/consts/task-status.d.ts +8 -0
  64. package/dist/consts/task-status.d.ts.map +1 -0
  65. package/dist/consts/task-status.js +14 -0
  66. package/dist/consts/task-status.js.map +1 -0
  67. package/dist/consts/user-tiers.d.ts +7 -0
  68. package/dist/consts/user-tiers.d.ts.map +1 -0
  69. package/dist/consts/user-tiers.js +60 -0
  70. package/dist/consts/user-tiers.js.map +1 -0
  71. package/dist/engine/engine.d.ts +94 -0
  72. package/dist/engine/engine.d.ts.map +1 -0
  73. package/dist/engine/engine.js +313 -0
  74. package/dist/engine/engine.js.map +1 -0
  75. package/dist/engine/library-adapters.d.ts +12 -0
  76. package/dist/engine/library-adapters.d.ts.map +1 -0
  77. package/dist/engine/library-adapters.js +11 -0
  78. package/dist/engine/library-adapters.js.map +1 -0
  79. package/dist/engine/mutations/claims.d.ts +10 -0
  80. package/dist/engine/mutations/claims.d.ts.map +1 -0
  81. package/dist/engine/mutations/claims.js +22 -0
  82. package/dist/engine/mutations/claims.js.map +1 -0
  83. package/dist/engine/mutations/expressions.d.ts +109 -0
  84. package/dist/engine/mutations/expressions.d.ts.map +1 -0
  85. package/dist/engine/mutations/expressions.js +277 -0
  86. package/dist/engine/mutations/expressions.js.map +1 -0
  87. package/dist/engine/mutations/index.d.ts +7 -0
  88. package/dist/engine/mutations/index.d.ts.map +1 -0
  89. package/dist/engine/mutations/index.js +6 -0
  90. package/dist/engine/mutations/index.js.map +1 -0
  91. package/dist/engine/mutations/premises.d.ts +25 -0
  92. package/dist/engine/mutations/premises.d.ts.map +1 -0
  93. package/dist/engine/mutations/premises.js +51 -0
  94. package/dist/engine/mutations/premises.js.map +1 -0
  95. package/dist/engine/mutations/types.d.ts +11 -0
  96. package/dist/engine/mutations/types.d.ts.map +1 -0
  97. package/dist/engine/mutations/types.js +2 -0
  98. package/dist/engine/mutations/types.js.map +1 -0
  99. package/dist/engine/mutations/variables.d.ts +27 -0
  100. package/dist/engine/mutations/variables.d.ts.map +1 -0
  101. package/dist/engine/mutations/variables.js +16 -0
  102. package/dist/engine/mutations/variables.js.map +1 -0
  103. package/dist/engine/optimistic/index.d.ts +4 -0
  104. package/dist/engine/optimistic/index.d.ts.map +1 -0
  105. package/dist/engine/optimistic/index.js +3 -0
  106. package/dist/engine/optimistic/index.js.map +1 -0
  107. package/dist/engine/optimistic/reconciliation.d.ts +32 -0
  108. package/dist/engine/optimistic/reconciliation.d.ts.map +1 -0
  109. package/dist/engine/optimistic/reconciliation.js +140 -0
  110. package/dist/engine/optimistic/reconciliation.js.map +1 -0
  111. package/dist/engine/optimistic/types.d.ts +25 -0
  112. package/dist/engine/optimistic/types.d.ts.map +1 -0
  113. package/dist/engine/optimistic/types.js +12 -0
  114. package/dist/engine/optimistic/types.js.map +1 -0
  115. package/dist/engine/optimistic/verification.d.ts +13 -0
  116. package/dist/engine/optimistic/verification.d.ts.map +1 -0
  117. package/dist/engine/optimistic/verification.js +71 -0
  118. package/dist/engine/optimistic/verification.js.map +1 -0
  119. package/dist/engine/review/evaluation.d.ts +27 -0
  120. package/dist/engine/review/evaluation.d.ts.map +1 -0
  121. package/dist/engine/review/evaluation.js +122 -0
  122. package/dist/engine/review/evaluation.js.map +1 -0
  123. package/dist/engine/review/fingerprint.d.ts +9 -0
  124. package/dist/engine/review/fingerprint.d.ts.map +1 -0
  125. package/dist/engine/review/fingerprint.js +27 -0
  126. package/dist/engine/review/fingerprint.js.map +1 -0
  127. package/dist/engine/review/overlay.d.ts +19 -0
  128. package/dist/engine/review/overlay.d.ts.map +1 -0
  129. package/dist/engine/review/overlay.js +81 -0
  130. package/dist/engine/review/overlay.js.map +1 -0
  131. package/dist/engine/review/reasons.d.ts +15 -0
  132. package/dist/engine/review/reasons.d.ts.map +1 -0
  133. package/dist/engine/review/reasons.js +211 -0
  134. package/dist/engine/review/reasons.js.map +1 -0
  135. package/dist/engine/review/review-engine.d.ts +134 -0
  136. package/dist/engine/review/review-engine.d.ts.map +1 -0
  137. package/dist/engine/review/review-engine.js +590 -0
  138. package/dist/engine/review/review-engine.js.map +1 -0
  139. package/dist/engine/review/review-store.d.ts +63 -0
  140. package/dist/engine/review/review-store.d.ts.map +1 -0
  141. package/dist/engine/review/review-store.js +174 -0
  142. package/dist/engine/review/review-store.js.map +1 -0
  143. package/dist/engine/review/step-queue.d.ts +27 -0
  144. package/dist/engine/review/step-queue.d.ts.map +1 -0
  145. package/dist/engine/review/step-queue.js +34 -0
  146. package/dist/engine/review/step-queue.js.map +1 -0
  147. package/dist/engine/review/types.d.ts +16 -0
  148. package/dist/engine/review/types.d.ts.map +1 -0
  149. package/dist/engine/review/types.js +2 -0
  150. package/dist/engine/review/types.js.map +1 -0
  151. package/dist/engine/review/wire.d.ts +8 -0
  152. package/dist/engine/review/wire.d.ts.map +1 -0
  153. package/dist/engine/review/wire.js +97 -0
  154. package/dist/engine/review/wire.js.map +1 -0
  155. package/dist/engine/text-tree.d.ts +35 -0
  156. package/dist/engine/text-tree.d.ts.map +1 -0
  157. package/dist/engine/text-tree.js +137 -0
  158. package/dist/engine/text-tree.js.map +1 -0
  159. package/dist/engine/types.d.ts +42 -0
  160. package/dist/engine/types.d.ts.map +1 -0
  161. package/dist/engine/types.js +2 -0
  162. package/dist/engine/types.js.map +1 -0
  163. package/dist/errors.d.ts +27 -0
  164. package/dist/errors.d.ts.map +1 -0
  165. package/dist/errors.js +61 -0
  166. package/dist/errors.js.map +1 -0
  167. package/dist/schemas/api/argument/batch/change-edge-operator.d.ts +281 -0
  168. package/dist/schemas/api/argument/batch/change-edge-operator.d.ts.map +1 -0
  169. package/dist/schemas/api/argument/batch/change-edge-operator.js +19 -0
  170. package/dist/schemas/api/argument/batch/change-edge-operator.js.map +1 -0
  171. package/dist/schemas/api/argument/batch/create-expression-with-operator.d.ts +280 -0
  172. package/dist/schemas/api/argument/batch/create-expression-with-operator.d.ts.map +1 -0
  173. package/dist/schemas/api/argument/batch/create-expression-with-operator.js +22 -0
  174. package/dist/schemas/api/argument/batch/create-expression-with-operator.js.map +1 -0
  175. package/dist/schemas/api/argument/batch/provision.d.ts +112 -0
  176. package/dist/schemas/api/argument/batch/provision.d.ts.map +1 -0
  177. package/dist/schemas/api/argument/batch/provision.js +10 -0
  178. package/dist/schemas/api/argument/batch/provision.js.map +1 -0
  179. package/dist/schemas/api/argument/build.d.ts +50 -0
  180. package/dist/schemas/api/argument/build.d.ts.map +1 -0
  181. package/dist/schemas/api/argument/build.js +41 -0
  182. package/dist/schemas/api/argument/build.js.map +1 -0
  183. package/dist/schemas/api/argument/claims.d.ts +151 -0
  184. package/dist/schemas/api/argument/claims.d.ts.map +1 -0
  185. package/dist/schemas/api/argument/claims.js +24 -0
  186. package/dist/schemas/api/argument/claims.js.map +1 -0
  187. package/dist/schemas/api/argument/index.d.ts +682 -0
  188. package/dist/schemas/api/argument/index.d.ts.map +1 -0
  189. package/dist/schemas/api/argument/index.js +51 -0
  190. package/dist/schemas/api/argument/index.js.map +1 -0
  191. package/dist/schemas/api/argument/logic.d.ts +205 -0
  192. package/dist/schemas/api/argument/logic.d.ts.map +1 -0
  193. package/dist/schemas/api/argument/logic.js +77 -0
  194. package/dist/schemas/api/argument/logic.js.map +1 -0
  195. package/dist/schemas/api/argument/repair.d.ts +195 -0
  196. package/dist/schemas/api/argument/repair.d.ts.map +1 -0
  197. package/dist/schemas/api/argument/repair.js +35 -0
  198. package/dist/schemas/api/argument/repair.js.map +1 -0
  199. package/dist/schemas/api/claims.d.ts +250 -0
  200. package/dist/schemas/api/claims.d.ts.map +1 -0
  201. package/dist/schemas/api/claims.js +20 -0
  202. package/dist/schemas/api/claims.js.map +1 -0
  203. package/dist/schemas/api/reaction/index.d.ts +46 -0
  204. package/dist/schemas/api/reaction/index.d.ts.map +1 -0
  205. package/dist/schemas/api/reaction/index.js +15 -0
  206. package/dist/schemas/api/reaction/index.js.map +1 -0
  207. package/dist/schemas/api/review/index.d.ts +164 -0
  208. package/dist/schemas/api/review/index.d.ts.map +1 -0
  209. package/dist/schemas/api/review/index.js +29 -0
  210. package/dist/schemas/api/review/index.js.map +1 -0
  211. package/dist/schemas/api/search.d.ts +109 -0
  212. package/dist/schemas/api/search.d.ts.map +1 -0
  213. package/dist/schemas/api/search.js +60 -0
  214. package/dist/schemas/api/search.js.map +1 -0
  215. package/dist/schemas/api/sources.d.ts +108 -0
  216. package/dist/schemas/api/sources.d.ts.map +1 -0
  217. package/dist/schemas/api/sources.js +28 -0
  218. package/dist/schemas/api/sources.js.map +1 -0
  219. package/dist/schemas/api/user/index.d.ts +16 -0
  220. package/dist/schemas/api/user/index.d.ts.map +1 -0
  221. package/dist/schemas/api/user/index.js +15 -0
  222. package/dist/schemas/api/user/index.js.map +1 -0
  223. package/dist/schemas/common.d.ts +50 -0
  224. package/dist/schemas/common.d.ts.map +1 -0
  225. package/dist/schemas/common.js +77 -0
  226. package/dist/schemas/common.js.map +1 -0
  227. package/dist/schemas/gpt.d.ts +10 -0
  228. package/dist/schemas/gpt.d.ts.map +1 -0
  229. package/dist/schemas/gpt.js +27 -0
  230. package/dist/schemas/gpt.js.map +1 -0
  231. package/dist/schemas/index.d.ts +8 -0
  232. package/dist/schemas/index.d.ts.map +1 -0
  233. package/dist/schemas/index.js +8 -0
  234. package/dist/schemas/index.js.map +1 -0
  235. package/dist/schemas/integrations/index.d.ts +159 -0
  236. package/dist/schemas/integrations/index.d.ts.map +1 -0
  237. package/dist/schemas/integrations/index.js +72 -0
  238. package/dist/schemas/integrations/index.js.map +1 -0
  239. package/dist/schemas/logic.d.ts +195 -0
  240. package/dist/schemas/logic.d.ts.map +1 -0
  241. package/dist/schemas/logic.js +77 -0
  242. package/dist/schemas/logic.js.map +1 -0
  243. package/dist/schemas/model/arguments.d.ts +457 -0
  244. package/dist/schemas/model/arguments.d.ts.map +1 -0
  245. package/dist/schemas/model/arguments.js +100 -0
  246. package/dist/schemas/model/arguments.js.map +1 -0
  247. package/dist/schemas/model/claims.d.ts +53 -0
  248. package/dist/schemas/model/claims.d.ts.map +1 -0
  249. package/dist/schemas/model/claims.js +40 -0
  250. package/dist/schemas/model/claims.js.map +1 -0
  251. package/dist/schemas/model/forks.d.ts +63 -0
  252. package/dist/schemas/model/forks.d.ts.map +1 -0
  253. package/dist/schemas/model/forks.js +63 -0
  254. package/dist/schemas/model/forks.js.map +1 -0
  255. package/dist/schemas/model/index.d.ts +6 -0
  256. package/dist/schemas/model/index.d.ts.map +1 -0
  257. package/dist/schemas/model/index.js +6 -0
  258. package/dist/schemas/model/index.js.map +1 -0
  259. package/dist/schemas/model/references.d.ts +49 -0
  260. package/dist/schemas/model/references.d.ts.map +1 -0
  261. package/dist/schemas/model/references.js +46 -0
  262. package/dist/schemas/model/references.js.map +1 -0
  263. package/dist/schemas/model/review.d.ts +56 -0
  264. package/dist/schemas/model/review.d.ts.map +1 -0
  265. package/dist/schemas/model/review.js +50 -0
  266. package/dist/schemas/model/review.js.map +1 -0
  267. package/dist/schemas/model/sources.d.ts +456 -0
  268. package/dist/schemas/model/sources.d.ts.map +1 -0
  269. package/dist/schemas/model/sources.js +27 -0
  270. package/dist/schemas/model/sources.js.map +1 -0
  271. package/dist/schemas/model/users.d.ts +150 -0
  272. package/dist/schemas/model/users.d.ts.map +1 -0
  273. package/dist/schemas/model/users.js +136 -0
  274. package/dist/schemas/model/users.js.map +1 -0
  275. package/dist/schemas/model.d.ts +2 -0
  276. package/dist/schemas/model.d.ts.map +1 -0
  277. package/dist/schemas/model.js +2 -0
  278. package/dist/schemas/model.js.map +1 -0
  279. package/dist/schemas/review.d.ts +1403 -0
  280. package/dist/schemas/review.d.ts.map +1 -0
  281. package/dist/schemas/review.js +232 -0
  282. package/dist/schemas/review.js.map +1 -0
  283. package/dist/schemas/snapshot.d.ts +165 -0
  284. package/dist/schemas/snapshot.d.ts.map +1 -0
  285. package/dist/schemas/snapshot.js +80 -0
  286. package/dist/schemas/snapshot.js.map +1 -0
  287. package/dist/schemas/tasks.d.ts +551 -0
  288. package/dist/schemas/tasks.d.ts.map +1 -0
  289. package/dist/schemas/tasks.js +113 -0
  290. package/dist/schemas/tasks.js.map +1 -0
  291. package/dist/utils/embedding-text.d.ts +15 -0
  292. package/dist/utils/embedding-text.d.ts.map +1 -0
  293. package/dist/utils/embedding-text.js +86 -0
  294. package/dist/utils/embedding-text.js.map +1 -0
  295. package/dist/utils/format-review-share.d.ts +7 -0
  296. package/dist/utils/format-review-share.d.ts.map +1 -0
  297. package/dist/utils/format-review-share.js +16 -0
  298. package/dist/utils/format-review-share.js.map +1 -0
  299. package/dist/utils/index.d.ts +4 -0
  300. package/dist/utils/index.d.ts.map +1 -0
  301. package/dist/utils/index.js +4 -0
  302. package/dist/utils/index.js.map +1 -0
  303. package/dist/utils/tasks/utils.d.ts +4 -0
  304. package/dist/utils/tasks/utils.d.ts.map +1 -0
  305. package/dist/utils/tasks/utils.js +12 -0
  306. package/dist/utils/tasks/utils.js.map +1 -0
  307. package/dist/utils/utils.d.ts +25 -0
  308. package/dist/utils/utils.d.ts.map +1 -0
  309. package/dist/utils/utils.js +115 -0
  310. package/dist/utils/utils.js.map +1 -0
  311. package/package.json +128 -0
@@ -0,0 +1,551 @@
1
+ import { Type, type Static } from "typebox";
2
+ export declare const Roles: {
3
+ readonly User: "user";
4
+ readonly Assistant: "assistant";
5
+ readonly Developer: "developer";
6
+ };
7
+ export declare const ChatUserRole: Type.TLiteral<"user">;
8
+ export declare const ChatAssistantRole: Type.TLiteral<"assistant">;
9
+ export declare const ChatDeveloperRole: Type.TLiteral<"developer">;
10
+ export declare const ChatAnyRole: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
11
+ export declare const ChatEntrySchema: Type.TObject<{
12
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
13
+ content: Type.TString;
14
+ }>;
15
+ export type TChatEntry = Static<typeof ChatEntrySchema>;
16
+ export declare function isTaskProgressDelta(obj: unknown): obj is TTaskProgressDelta;
17
+ export declare const ArgumentCreateTask: Type.TObject<{
18
+ id: Type.TString;
19
+ userId: Type.TString;
20
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
21
+ type: Type.TLiteral<"argument_create">;
22
+ data: Type.TObject<{
23
+ argumentId: Type.TString;
24
+ version: Type.TNumber;
25
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
26
+ }>;
27
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
28
+ resultData: Type.TUnion<[Type.TObject<{
29
+ tokensUsed: Type.TNumber;
30
+ }>, Type.TNull]>;
31
+ createdOn: import("./common.js").TDateType;
32
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
33
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
34
+ status: Type.TNumber;
35
+ }>;
36
+ export type TArgumentCreateTask = Static<typeof ArgumentCreateTask>;
37
+ export declare const ArgumentBuildReviewTask: Type.TObject<{
38
+ id: Type.TString;
39
+ userId: Type.TString;
40
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
41
+ type: Type.TLiteral<"argument_build_review">;
42
+ data: Type.TObject<{
43
+ argumentId: Type.TString;
44
+ version: Type.TNumber;
45
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
46
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
47
+ newPrompts: Type.TArray<Type.TObject<{
48
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
49
+ content: Type.TString;
50
+ }>>;
51
+ }>;
52
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
53
+ resultData: Type.TUnion<[Type.TObject<{
54
+ tokensUsed: Type.TNumber;
55
+ output: Type.TObject<{
56
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
57
+ content: Type.TString;
58
+ }>;
59
+ }>, Type.TNull]>;
60
+ createdOn: import("./common.js").TDateType;
61
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
62
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
63
+ status: Type.TNumber;
64
+ }>;
65
+ export type TArgumentBuildReviewTask = Static<typeof ArgumentBuildReviewTask>;
66
+ export declare const ArgumentBuildFinalizeTask: Type.TObject<{
67
+ id: Type.TString;
68
+ userId: Type.TString;
69
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
70
+ type: Type.TLiteral<"argument_build_finalize">;
71
+ data: Type.TObject<{
72
+ argumentId: Type.TString;
73
+ version: Type.TNumber;
74
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
75
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
76
+ newPrompts: Type.TArray<Type.TObject<{
77
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
78
+ content: Type.TString;
79
+ }>>;
80
+ }>;
81
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
82
+ resultData: Type.TUnion<[Type.TObject<{
83
+ tokensUsed: Type.TNumber;
84
+ output: Type.TObject<{
85
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
86
+ content: Type.TString;
87
+ }>;
88
+ }>, Type.TNull]>;
89
+ createdOn: import("./common.js").TDateType;
90
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
91
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
92
+ status: Type.TNumber;
93
+ }>;
94
+ export type TArgumentBuildFinalizeTask = Static<typeof ArgumentBuildFinalizeTask>;
95
+ export declare const ArgumentBuildSimulateUserTask: Type.TObject<{
96
+ id: Type.TString;
97
+ userId: Type.TString;
98
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
99
+ type: Type.TLiteral<"argument_build_simulate_user">;
100
+ data: Type.TObject<{
101
+ argumentId: Type.TString;
102
+ version: Type.TNumber;
103
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
104
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
105
+ newPrompts: Type.TArray<Type.TObject<{
106
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
107
+ content: Type.TString;
108
+ }>>;
109
+ }>;
110
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
111
+ resultData: Type.TUnion<[Type.TObject<{
112
+ tokensUsed: Type.TNumber;
113
+ output: Type.TObject<{
114
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
115
+ content: Type.TString;
116
+ }>;
117
+ }>, Type.TNull]>;
118
+ createdOn: import("./common.js").TDateType;
119
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
120
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
121
+ status: Type.TNumber;
122
+ }>;
123
+ export type TArgumentBuildSimulateUserTask = Static<typeof ArgumentBuildSimulateUserTask>;
124
+ export declare const TaskSchemaMap: {
125
+ readonly argument_create: Type.TObject<{
126
+ id: Type.TString;
127
+ userId: Type.TString;
128
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
129
+ type: Type.TLiteral<"argument_create">;
130
+ data: Type.TObject<{
131
+ argumentId: Type.TString;
132
+ version: Type.TNumber;
133
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
134
+ }>;
135
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
136
+ resultData: Type.TUnion<[Type.TObject<{
137
+ tokensUsed: Type.TNumber;
138
+ }>, Type.TNull]>;
139
+ createdOn: import("./common.js").TDateType;
140
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
141
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
142
+ status: Type.TNumber;
143
+ }>;
144
+ readonly argument_build_review: Type.TObject<{
145
+ id: Type.TString;
146
+ userId: Type.TString;
147
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
148
+ type: Type.TLiteral<"argument_build_review">;
149
+ data: Type.TObject<{
150
+ argumentId: Type.TString;
151
+ version: Type.TNumber;
152
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
153
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
154
+ newPrompts: Type.TArray<Type.TObject<{
155
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
156
+ content: Type.TString;
157
+ }>>;
158
+ }>;
159
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
160
+ resultData: Type.TUnion<[Type.TObject<{
161
+ tokensUsed: Type.TNumber;
162
+ output: Type.TObject<{
163
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
164
+ content: Type.TString;
165
+ }>;
166
+ }>, Type.TNull]>;
167
+ createdOn: import("./common.js").TDateType;
168
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
169
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
170
+ status: Type.TNumber;
171
+ }>;
172
+ readonly argument_build_finalize: Type.TObject<{
173
+ id: Type.TString;
174
+ userId: Type.TString;
175
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
176
+ type: Type.TLiteral<"argument_build_finalize">;
177
+ data: Type.TObject<{
178
+ argumentId: Type.TString;
179
+ version: Type.TNumber;
180
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
181
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
182
+ newPrompts: Type.TArray<Type.TObject<{
183
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
184
+ content: Type.TString;
185
+ }>>;
186
+ }>;
187
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
188
+ resultData: Type.TUnion<[Type.TObject<{
189
+ tokensUsed: Type.TNumber;
190
+ output: Type.TObject<{
191
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
192
+ content: Type.TString;
193
+ }>;
194
+ }>, Type.TNull]>;
195
+ createdOn: import("./common.js").TDateType;
196
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
197
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
198
+ status: Type.TNumber;
199
+ }>;
200
+ readonly argument_build_simulate_user: Type.TObject<{
201
+ id: Type.TString;
202
+ userId: Type.TString;
203
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
204
+ type: Type.TLiteral<"argument_build_simulate_user">;
205
+ data: Type.TObject<{
206
+ argumentId: Type.TString;
207
+ version: Type.TNumber;
208
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
209
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
210
+ newPrompts: Type.TArray<Type.TObject<{
211
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
212
+ content: Type.TString;
213
+ }>>;
214
+ }>;
215
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
216
+ resultData: Type.TUnion<[Type.TObject<{
217
+ tokensUsed: Type.TNumber;
218
+ output: Type.TObject<{
219
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
220
+ content: Type.TString;
221
+ }>;
222
+ }>, Type.TNull]>;
223
+ createdOn: import("./common.js").TDateType;
224
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
225
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
226
+ status: Type.TNumber;
227
+ }>;
228
+ };
229
+ declare const TaskMapSchema: Type.TObject<{
230
+ argument_create: Type.TObject<{
231
+ id: Type.TString;
232
+ userId: Type.TString;
233
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
234
+ type: Type.TLiteral<"argument_create">;
235
+ data: Type.TObject<{
236
+ argumentId: Type.TString;
237
+ version: Type.TNumber;
238
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
239
+ }>;
240
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
241
+ resultData: Type.TUnion<[Type.TObject<{
242
+ tokensUsed: Type.TNumber;
243
+ }>, Type.TNull]>;
244
+ createdOn: import("./common.js").TDateType;
245
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
246
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
247
+ status: Type.TNumber;
248
+ }>;
249
+ argument_build_review: Type.TObject<{
250
+ id: Type.TString;
251
+ userId: Type.TString;
252
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
253
+ type: Type.TLiteral<"argument_build_review">;
254
+ data: Type.TObject<{
255
+ argumentId: Type.TString;
256
+ version: Type.TNumber;
257
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
258
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
259
+ newPrompts: Type.TArray<Type.TObject<{
260
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
261
+ content: Type.TString;
262
+ }>>;
263
+ }>;
264
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
265
+ resultData: Type.TUnion<[Type.TObject<{
266
+ tokensUsed: Type.TNumber;
267
+ output: Type.TObject<{
268
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
269
+ content: Type.TString;
270
+ }>;
271
+ }>, Type.TNull]>;
272
+ createdOn: import("./common.js").TDateType;
273
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
274
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
275
+ status: Type.TNumber;
276
+ }>;
277
+ argument_build_finalize: Type.TObject<{
278
+ id: Type.TString;
279
+ userId: Type.TString;
280
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
281
+ type: Type.TLiteral<"argument_build_finalize">;
282
+ data: Type.TObject<{
283
+ argumentId: Type.TString;
284
+ version: Type.TNumber;
285
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
286
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
287
+ newPrompts: Type.TArray<Type.TObject<{
288
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
289
+ content: Type.TString;
290
+ }>>;
291
+ }>;
292
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
293
+ resultData: Type.TUnion<[Type.TObject<{
294
+ tokensUsed: Type.TNumber;
295
+ output: Type.TObject<{
296
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
297
+ content: Type.TString;
298
+ }>;
299
+ }>, Type.TNull]>;
300
+ createdOn: import("./common.js").TDateType;
301
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
302
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
303
+ status: Type.TNumber;
304
+ }>;
305
+ argument_build_simulate_user: Type.TObject<{
306
+ id: Type.TString;
307
+ userId: Type.TString;
308
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
309
+ type: Type.TLiteral<"argument_build_simulate_user">;
310
+ data: Type.TObject<{
311
+ argumentId: Type.TString;
312
+ version: Type.TNumber;
313
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
314
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
315
+ newPrompts: Type.TArray<Type.TObject<{
316
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
317
+ content: Type.TString;
318
+ }>>;
319
+ }>;
320
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
321
+ resultData: Type.TUnion<[Type.TObject<{
322
+ tokensUsed: Type.TNumber;
323
+ output: Type.TObject<{
324
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
325
+ content: Type.TString;
326
+ }>;
327
+ }>, Type.TNull]>;
328
+ createdOn: import("./common.js").TDateType;
329
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
330
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
331
+ status: Type.TNumber;
332
+ }>;
333
+ }>;
334
+ type _TTaskMap = Static<typeof TaskMapSchema>;
335
+ export declare const TaskSchema: Type.TUnion<[Type.TObject<{
336
+ id: Type.TString;
337
+ userId: Type.TString;
338
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
339
+ type: Type.TLiteral<"argument_create">;
340
+ data: Type.TObject<{
341
+ argumentId: Type.TString;
342
+ version: Type.TNumber;
343
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
344
+ }>;
345
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
346
+ resultData: Type.TUnion<[Type.TObject<{
347
+ tokensUsed: Type.TNumber;
348
+ }>, Type.TNull]>;
349
+ createdOn: import("./common.js").TDateType;
350
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
351
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
352
+ status: Type.TNumber;
353
+ }>, Type.TObject<{
354
+ id: Type.TString;
355
+ userId: Type.TString;
356
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
357
+ type: Type.TLiteral<"argument_build_review">;
358
+ data: Type.TObject<{
359
+ argumentId: Type.TString;
360
+ version: Type.TNumber;
361
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
362
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
363
+ newPrompts: Type.TArray<Type.TObject<{
364
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
365
+ content: Type.TString;
366
+ }>>;
367
+ }>;
368
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
369
+ resultData: Type.TUnion<[Type.TObject<{
370
+ tokensUsed: Type.TNumber;
371
+ output: Type.TObject<{
372
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
373
+ content: Type.TString;
374
+ }>;
375
+ }>, Type.TNull]>;
376
+ createdOn: import("./common.js").TDateType;
377
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
378
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
379
+ status: Type.TNumber;
380
+ }>, Type.TObject<{
381
+ id: Type.TString;
382
+ userId: Type.TString;
383
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
384
+ type: Type.TLiteral<"argument_build_finalize">;
385
+ data: Type.TObject<{
386
+ argumentId: Type.TString;
387
+ version: Type.TNumber;
388
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
389
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
390
+ newPrompts: Type.TArray<Type.TObject<{
391
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
392
+ content: Type.TString;
393
+ }>>;
394
+ }>;
395
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
396
+ resultData: Type.TUnion<[Type.TObject<{
397
+ tokensUsed: Type.TNumber;
398
+ output: Type.TObject<{
399
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
400
+ content: Type.TString;
401
+ }>;
402
+ }>, Type.TNull]>;
403
+ createdOn: import("./common.js").TDateType;
404
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
405
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
406
+ status: Type.TNumber;
407
+ }>, Type.TObject<{
408
+ id: Type.TString;
409
+ userId: Type.TString;
410
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
411
+ type: Type.TLiteral<"argument_build_simulate_user">;
412
+ data: Type.TObject<{
413
+ argumentId: Type.TString;
414
+ version: Type.TNumber;
415
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
416
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
417
+ newPrompts: Type.TArray<Type.TObject<{
418
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
419
+ content: Type.TString;
420
+ }>>;
421
+ }>;
422
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
423
+ resultData: Type.TUnion<[Type.TObject<{
424
+ tokensUsed: Type.TNumber;
425
+ output: Type.TObject<{
426
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
427
+ content: Type.TString;
428
+ }>;
429
+ }>, Type.TNull]>;
430
+ createdOn: import("./common.js").TDateType;
431
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
432
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
433
+ status: Type.TNumber;
434
+ }>]>;
435
+ export declare const TaskTypeSchema: Type.TUnion<[Type.TLiteral<"argument_create">, Type.TLiteral<"argument_build_review">, Type.TLiteral<"argument_build_finalize">, Type.TLiteral<"argument_build_simulate_user">]>;
436
+ export declare const TaskProgressDeltaSchema: Type.TObject<{
437
+ id: Type.TString;
438
+ type: Type.TUnion<[Type.TLiteral<"argument_create">, Type.TLiteral<"argument_build_review">, Type.TLiteral<"argument_build_finalize">, Type.TLiteral<"argument_build_simulate_user">]>;
439
+ delta: Type.TString;
440
+ }>;
441
+ export type TTaskProgressDelta = Static<typeof TaskProgressDeltaSchema>;
442
+ export declare function isTask(obj: unknown): obj is TTask;
443
+ export type TTaskType = Static<typeof TaskTypeSchema>;
444
+ export type TTask<T extends TTaskType = TTaskType> = _TTaskMap[T];
445
+ export declare const TaskOrDeltaSchema: Type.TUnion<[Type.TUnion<[Type.TObject<{
446
+ id: Type.TString;
447
+ userId: Type.TString;
448
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
449
+ type: Type.TLiteral<"argument_create">;
450
+ data: Type.TObject<{
451
+ argumentId: Type.TString;
452
+ version: Type.TNumber;
453
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
454
+ }>;
455
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
456
+ resultData: Type.TUnion<[Type.TObject<{
457
+ tokensUsed: Type.TNumber;
458
+ }>, Type.TNull]>;
459
+ createdOn: import("./common.js").TDateType;
460
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
461
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
462
+ status: Type.TNumber;
463
+ }>, Type.TObject<{
464
+ id: Type.TString;
465
+ userId: Type.TString;
466
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
467
+ type: Type.TLiteral<"argument_build_review">;
468
+ data: Type.TObject<{
469
+ argumentId: Type.TString;
470
+ version: Type.TNumber;
471
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
472
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
473
+ newPrompts: Type.TArray<Type.TObject<{
474
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
475
+ content: Type.TString;
476
+ }>>;
477
+ }>;
478
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
479
+ resultData: Type.TUnion<[Type.TObject<{
480
+ tokensUsed: Type.TNumber;
481
+ output: Type.TObject<{
482
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
483
+ content: Type.TString;
484
+ }>;
485
+ }>, Type.TNull]>;
486
+ createdOn: import("./common.js").TDateType;
487
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
488
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
489
+ status: Type.TNumber;
490
+ }>, Type.TObject<{
491
+ id: Type.TString;
492
+ userId: Type.TString;
493
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
494
+ type: Type.TLiteral<"argument_build_finalize">;
495
+ data: Type.TObject<{
496
+ argumentId: Type.TString;
497
+ version: Type.TNumber;
498
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
499
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
500
+ newPrompts: Type.TArray<Type.TObject<{
501
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
502
+ content: Type.TString;
503
+ }>>;
504
+ }>;
505
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
506
+ resultData: Type.TUnion<[Type.TObject<{
507
+ tokensUsed: Type.TNumber;
508
+ output: Type.TObject<{
509
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
510
+ content: Type.TString;
511
+ }>;
512
+ }>, Type.TNull]>;
513
+ createdOn: import("./common.js").TDateType;
514
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
515
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
516
+ status: Type.TNumber;
517
+ }>, Type.TObject<{
518
+ id: Type.TString;
519
+ userId: Type.TString;
520
+ previousId: Type.TUnion<[Type.TString, Type.TNull]>;
521
+ type: Type.TLiteral<"argument_build_simulate_user">;
522
+ data: Type.TObject<{
523
+ argumentId: Type.TString;
524
+ version: Type.TNumber;
525
+ conversationResponseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
526
+ responseId: Type.TOptional<Type.TUnion<[Type.TString, Type.TNull]>>;
527
+ newPrompts: Type.TArray<Type.TObject<{
528
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
529
+ content: Type.TString;
530
+ }>>;
531
+ }>;
532
+ errorData: Type.TUnion<[Type.TRecord<"^.*$", Type.TAny>, Type.TNull]>;
533
+ resultData: Type.TUnion<[Type.TObject<{
534
+ tokensUsed: Type.TNumber;
535
+ output: Type.TObject<{
536
+ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">, Type.TLiteral<"developer">]>;
537
+ content: Type.TString;
538
+ }>;
539
+ }>, Type.TNull]>;
540
+ createdOn: import("./common.js").TDateType;
541
+ startedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
542
+ completedOn: Type.TUnion<[import("./common.js").TDateType, Type.TNull]>;
543
+ status: Type.TNumber;
544
+ }>]>, Type.TObject<{
545
+ id: Type.TString;
546
+ type: Type.TUnion<[Type.TLiteral<"argument_create">, Type.TLiteral<"argument_build_review">, Type.TLiteral<"argument_build_finalize">, Type.TLiteral<"argument_build_simulate_user">]>;
547
+ delta: Type.TString;
548
+ }>]>;
549
+ export type TTaskOrDelta<T extends TTaskType> = TTask<T> | TTaskProgressDelta;
550
+ export {};
551
+ //# sourceMappingURL=tasks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/schemas/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAM3C,eAAO,MAAM,KAAK;;;;CAIR,CAAA;AAEV,eAAO,MAAM,YAAY,uBAA2B,CAAA;AACpD,eAAO,MAAM,iBAAiB,4BAAgC,CAAA;AAC9D,eAAO,MAAM,iBAAiB,4BAAgC,CAAA;AAC9D,eAAO,MAAM,WAAW,8FAItB,CAAA;AAEF,eAAO,MAAM,eAAe;;;EAG1B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAA;AA0BvD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,kBAAkB,CAE3E;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAkB7B,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA;AA0BnE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIlC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAE7E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpC,CAAA;AACF,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAC3C,OAAO,yBAAyB,CACnC,CAAA;AAED,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIxC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAC/C,OAAO,6BAA6B,CACvC,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKhB,CAAA;AAEV,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjB,CAAA;AAEF,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAA;AAE7C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKrB,CAAA;AAEF,eAAO,MAAM,cAAc,kLAA4B,CAAA;AAEvD,eAAO,MAAM,uBAAuB;;;;EASnC,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE,wBAAgB,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,KAAK,CAEjD;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AACrD,MAAM,MAAM,KAAK,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,IAAI,SAAS,CAAC,CAAC,CAAC,CAAA;AAEjE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG5B,CAAA;AACF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,kBAAkB,CAAA"}
@@ -0,0 +1,113 @@
1
+ import { Type } from "typebox";
2
+ import { UUID } from "./common.js";
3
+ import { Nullable } from "./common.js";
4
+ import { EncodableDate } from "./common.js";
5
+ import Value from "typebox/value";
6
+ export const Roles = {
7
+ User: "user",
8
+ Assistant: "assistant",
9
+ Developer: "developer",
10
+ };
11
+ export const ChatUserRole = Type.Literal(Roles.User);
12
+ export const ChatAssistantRole = Type.Literal(Roles.Assistant);
13
+ export const ChatDeveloperRole = Type.Literal(Roles.Developer);
14
+ export const ChatAnyRole = Type.Union([
15
+ ChatUserRole,
16
+ ChatAssistantRole,
17
+ ChatDeveloperRole,
18
+ ]);
19
+ export const ChatEntrySchema = Type.Object({
20
+ role: ChatAnyRole,
21
+ content: Type.String(),
22
+ });
23
+ const BaseTaskSchema = Type.Interface([], {
24
+ id: UUID,
25
+ userId: UUID,
26
+ previousId: Nullable(Type.String({
27
+ description: "ID of the previous task in the lineage, if any. Typically, this is set if the task is a retry of a previously failed task.",
28
+ })),
29
+ type: Type.String(),
30
+ // This data is set when the task is created
31
+ data: Type.Null(),
32
+ // This data is set when task fails
33
+ errorData: Nullable(Type.Record(Type.String(), Type.Any())),
34
+ // This data is set when task completes successfully
35
+ resultData: Type.Null(),
36
+ createdOn: EncodableDate,
37
+ startedOn: Nullable(EncodableDate),
38
+ completedOn: Nullable(EncodableDate),
39
+ status: Type.Number(),
40
+ });
41
+ export function isTaskProgressDelta(obj) {
42
+ return Value.Check(TaskProgressDeltaSchema, obj);
43
+ }
44
+ export const ArgumentCreateTask = Type.Interface([BaseTaskSchema], {
45
+ type: Type.Literal("argument_create"),
46
+ data: Type.Object({
47
+ argumentId: Type.String({ format: "uuid" }),
48
+ version: Type.Number(),
49
+ responseId: Type.Optional(Nullable(Type.String())),
50
+ }, { additionalProperties: false }),
51
+ resultData: Nullable(Type.Object({
52
+ tokensUsed: Type.Number(),
53
+ }, { additionalProperties: false })),
54
+ });
55
+ const ArgumentBuilderCommonData = Type.Object({
56
+ argumentId: Type.String({ format: "uuid" }),
57
+ version: Type.Number(),
58
+ conversationResponseId: Type.Optional(Nullable(Type.String())),
59
+ responseId: Type.Optional(Nullable(Type.String())),
60
+ newPrompts: Type.Array(ChatEntrySchema, {
61
+ description: "An array of new messages from the user to include in the conversation",
62
+ }),
63
+ }, { additionalProperties: false });
64
+ const ArgumentBuilderCommonResultData = Nullable(Type.Object({
65
+ tokensUsed: Type.Number(),
66
+ output: ChatEntrySchema,
67
+ }, { additionalProperties: false }));
68
+ export const ArgumentBuildReviewTask = Type.Interface([BaseTaskSchema], {
69
+ type: Type.Literal("argument_build_review"),
70
+ data: ArgumentBuilderCommonData,
71
+ resultData: ArgumentBuilderCommonResultData,
72
+ });
73
+ export const ArgumentBuildFinalizeTask = Type.Interface([BaseTaskSchema], {
74
+ type: Type.Literal("argument_build_finalize"),
75
+ data: ArgumentBuilderCommonData,
76
+ resultData: ArgumentBuilderCommonResultData,
77
+ });
78
+ export const ArgumentBuildSimulateUserTask = Type.Interface([BaseTaskSchema], {
79
+ type: Type.Literal("argument_build_simulate_user"),
80
+ data: ArgumentBuilderCommonData,
81
+ resultData: ArgumentBuilderCommonResultData,
82
+ });
83
+ export const TaskSchemaMap = {
84
+ argument_create: ArgumentCreateTask,
85
+ argument_build_review: ArgumentBuildReviewTask,
86
+ argument_build_finalize: ArgumentBuildFinalizeTask,
87
+ argument_build_simulate_user: ArgumentBuildSimulateUserTask,
88
+ };
89
+ const TaskMapSchema = Type.Object({
90
+ ...TaskSchemaMap,
91
+ });
92
+ export const TaskSchema = Type.Union([
93
+ ArgumentCreateTask,
94
+ ArgumentBuildReviewTask,
95
+ ArgumentBuildFinalizeTask,
96
+ ArgumentBuildSimulateUserTask,
97
+ ]);
98
+ export const TaskTypeSchema = Type.KeyOf(TaskMapSchema);
99
+ export const TaskProgressDeltaSchema = Type.Object({
100
+ id: UUID,
101
+ type: TaskTypeSchema,
102
+ delta: Type.String(),
103
+ }, {
104
+ additionalProperties: false,
105
+ });
106
+ export function isTask(obj) {
107
+ return Value.Check(TaskSchema, obj);
108
+ }
109
+ export const TaskOrDeltaSchema = Type.Union([
110
+ TaskSchema,
111
+ TaskProgressDeltaSchema,
112
+ ]);
113
+ //# sourceMappingURL=tasks.js.map