@wirecat/notion-cli 0.0.0-stage → 0.2.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 (262) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +204 -0
  3. package/README.md +42 -2
  4. package/contracts/wirecat.json +1964 -0
  5. package/dist/bin/notion.d.ts +3 -0
  6. package/dist/bin/notion.d.ts.map +1 -0
  7. package/dist/bin/notion.js +40 -0
  8. package/dist/bin/notion.js.map +1 -0
  9. package/dist/bundle/all-profiles-JGYLQZ5C.js +278 -0
  10. package/dist/bundle/anthropic-S2VSMIKQ.js +91 -0
  11. package/dist/bundle/app-server-SASYDBCA.js +240 -0
  12. package/dist/bundle/bun-LU5LP3JI.js +169 -0
  13. package/dist/bundle/bun-sqlite-JBSINB4O.js +76 -0
  14. package/dist/bundle/chunk-22QQUKWA.js +53 -0
  15. package/dist/bundle/chunk-2F4QQ7WB.js +73 -0
  16. package/dist/bundle/chunk-2F6VO5HA.js +73 -0
  17. package/dist/bundle/chunk-2LWO3PDX.js +726 -0
  18. package/dist/bundle/chunk-3AL7QUS3.js +2778 -0
  19. package/dist/bundle/chunk-3Z4YTSRY.js +731 -0
  20. package/dist/bundle/chunk-4HWJOU7N.js +38 -0
  21. package/dist/bundle/chunk-4IPURN72.js +1221 -0
  22. package/dist/bundle/chunk-4ZTVJHWU.js +206 -0
  23. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  24. package/dist/bundle/chunk-5IYKVRH2.js +44811 -0
  25. package/dist/bundle/chunk-5NFK5EM2.js +362 -0
  26. package/dist/bundle/chunk-5QIQEUOG.js +188 -0
  27. package/dist/bundle/chunk-5RDNBG7D.js +72 -0
  28. package/dist/bundle/chunk-5RSC54NA.js +1328 -0
  29. package/dist/bundle/chunk-6EVKHZKN.js +158 -0
  30. package/dist/bundle/chunk-6RA3EABS.js +4012 -0
  31. package/dist/bundle/chunk-AOCUKEAX.js +131 -0
  32. package/dist/bundle/chunk-B26TQZKZ.js +217 -0
  33. package/dist/bundle/chunk-B7ON6KPT.js +1197 -0
  34. package/dist/bundle/chunk-BNPTZ5ZB.js +161 -0
  35. package/dist/bundle/chunk-D72URWJE.js +532 -0
  36. package/dist/bundle/chunk-D7QSEEYW.js +274 -0
  37. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  38. package/dist/bundle/chunk-DH5PRHT4.js +392 -0
  39. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  40. package/dist/bundle/chunk-EUIVXFLJ.js +259 -0
  41. package/dist/bundle/chunk-FPY6EJ7B.js +9568 -0
  42. package/dist/bundle/chunk-FT3LN3HP.js +6848 -0
  43. package/dist/bundle/chunk-FWVBPRL4.js +4436 -0
  44. package/dist/bundle/chunk-FXEJY4OL.js +12538 -0
  45. package/dist/bundle/chunk-G3EZFRSS.js +1297 -0
  46. package/dist/bundle/chunk-GZOUFX3C.js +230 -0
  47. package/dist/bundle/chunk-HL52XXZX.js +78 -0
  48. package/dist/bundle/chunk-KCLOUUYF.js +100 -0
  49. package/dist/bundle/chunk-KFVDL2QS.js +146 -0
  50. package/dist/bundle/chunk-KGERXYTV.js +24 -0
  51. package/dist/bundle/chunk-KM6WHPHI.js +288 -0
  52. package/dist/bundle/chunk-LAYPFBOM.js +95 -0
  53. package/dist/bundle/chunk-LLG2POQ7.js +170 -0
  54. package/dist/bundle/chunk-M3KB25D3.js +1392 -0
  55. package/dist/bundle/chunk-M7S2NDWB.js +76 -0
  56. package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
  57. package/dist/bundle/chunk-MY742GAD.js +1977 -0
  58. package/dist/bundle/chunk-MZU2YFBZ.js +823 -0
  59. package/dist/bundle/chunk-NOQ7B5N7.js +58 -0
  60. package/dist/bundle/chunk-NQWV4WQO.js +300 -0
  61. package/dist/bundle/chunk-ODBZNSZ6.js +1028 -0
  62. package/dist/bundle/chunk-OTV53F34.js +370 -0
  63. package/dist/bundle/chunk-P7CUM5IB.js +18 -0
  64. package/dist/bundle/chunk-RV64YUQX.js +185 -0
  65. package/dist/bundle/chunk-SHJQ6JKG.js +106 -0
  66. package/dist/bundle/chunk-SWAOWNKW.js +52 -0
  67. package/dist/bundle/chunk-SZOVLP44.js +29 -0
  68. package/dist/bundle/chunk-TPX2M45D.js +385 -0
  69. package/dist/bundle/chunk-TSDBSIFM.js +66 -0
  70. package/dist/bundle/chunk-VBHETQVV.js +64146 -0
  71. package/dist/bundle/chunk-VCIALTEM.js +3139 -0
  72. package/dist/bundle/chunk-VKE77B3F.js +2 -0
  73. package/dist/bundle/chunk-WCSOH4JS.js +142 -0
  74. package/dist/bundle/chunk-WF4D56CA.js +54 -0
  75. package/dist/bundle/chunk-WJHZMR2W.js +335 -0
  76. package/dist/bundle/chunk-X4TIMMKJ.js +16 -0
  77. package/dist/bundle/chunk-XF26XKTS.js +82 -0
  78. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  79. package/dist/bundle/chunk-XQUUANA2.js +24600 -0
  80. package/dist/bundle/chunk-XYIT2XB3.js +1372 -0
  81. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  82. package/dist/bundle/chunk-YMYUBZWT.js +1068 -0
  83. package/dist/bundle/chunk-YNTLT3Z3.js +2310 -0
  84. package/dist/bundle/chunk-YVI5SQPY.js +46 -0
  85. package/dist/bundle/chunk-Z56QFOBR.js +63 -0
  86. package/dist/bundle/chunk-ZKAEZXUP.js +787 -0
  87. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  88. package/dist/bundle/chunk-ZZ32DXTH.js +23 -0
  89. package/dist/bundle/command-contract-JS5V27NX.js +38 -0
  90. package/dist/bundle/command-server-entry-UFSG7KRO.js +167 -0
  91. package/dist/bundle/decode-7LLWTSPT.js +297 -0
  92. package/dist/bundle/definitions-M3U4UYHN.js +45607 -0
  93. package/dist/bundle/dispatch-2GY6JIJH.js +411 -0
  94. package/dist/bundle/dist-ILNOLGYN.js +7577 -0
  95. package/dist/bundle/echarts-BXX4OQWC.js +42501 -0
  96. package/dist/bundle/embed-JXFNBTKH.js +38 -0
  97. package/dist/bundle/embedder-57YZ44KO.js +111 -0
  98. package/dist/bundle/failure-MYT4HPE3.js +25 -0
  99. package/dist/bundle/first-run-3PF7T74J.js +29 -0
  100. package/dist/bundle/first-screen-7BEROEQR.js +36 -0
  101. package/dist/bundle/instructions-2VECIDXF.js +11 -0
  102. package/dist/bundle/mcp-O6ACR2DX.js +167 -0
  103. package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
  104. package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
  105. package/dist/bundle/meeting-combined-PPUQ3KBR.js +24 -0
  106. package/dist/bundle/meeting-model-ZNMYKMCD.js +26 -0
  107. package/dist/bundle/meeting-semantic-ETN3A4BJ.js +22 -0
  108. package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
  109. package/dist/bundle/node-KM3CUABH.js +2340 -0
  110. package/dist/bundle/node-MPEQSFI3.js +176 -0
  111. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  112. package/dist/bundle/node-sqlite-WA32MYSJ.js +74 -0
  113. package/dist/bundle/notion.js +185 -0
  114. package/dist/bundle/oauth-IAFZG3IR.js +20 -0
  115. package/dist/bundle/open-M3JQUC5G.js +23 -0
  116. package/dist/bundle/openai-HXUEHUSD.js +240 -0
  117. package/dist/bundle/process-F6TKXWWA.js +91 -0
  118. package/dist/bundle/program-Y7JAB6TG.js +33219 -0
  119. package/dist/bundle/prompt-IMUQLZD2.js +17 -0
  120. package/dist/bundle/recognize-2MZAYHAA.js +26 -0
  121. package/dist/bundle/remote-OV4LB6VR.js +32 -0
  122. package/dist/bundle/rerank-ZIULUS34.js +52 -0
  123. package/dist/bundle/schemas-DIVZS6TU.js +12214 -0
  124. package/dist/bundle/serve-YU7QBP6L.js +199 -0
  125. package/dist/bundle/server-FKQET4ZO.js +71 -0
  126. package/dist/bundle/server-LGMNONSB.js +202 -0
  127. package/dist/bundle/services-5WY4DCPJ.js +581 -0
  128. package/dist/bundle/sqlite-runtime-5MXZDETH.js +20 -0
  129. package/dist/bundle/state-LWMZH2KI.js +36 -0
  130. package/dist/bundle/store-EPZYV4VW.js +168 -0
  131. package/dist/bundle/store-QE6FEIZD.js +286 -0
  132. package/dist/bundle/store-maintenance-command-ZUUUFCHL.js +62 -0
  133. package/dist/commands/api.d.ts +4 -0
  134. package/dist/commands/api.d.ts.map +1 -0
  135. package/dist/commands/api.js +140 -0
  136. package/dist/commands/api.js.map +1 -0
  137. package/dist/commands/databases.d.ts +3 -0
  138. package/dist/commands/databases.d.ts.map +1 -0
  139. package/dist/commands/databases.js +65 -0
  140. package/dist/commands/databases.js.map +1 -0
  141. package/dist/commands/documents.d.ts +4 -0
  142. package/dist/commands/documents.d.ts.map +1 -0
  143. package/dist/commands/documents.js +41 -0
  144. package/dist/commands/documents.js.map +1 -0
  145. package/dist/commands/library.d.ts +10 -0
  146. package/dist/commands/library.d.ts.map +1 -0
  147. package/dist/commands/library.js +468 -0
  148. package/dist/commands/library.js.map +1 -0
  149. package/dist/commands/session.d.ts +3 -0
  150. package/dist/commands/session.d.ts.map +1 -0
  151. package/dist/commands/session.js +105 -0
  152. package/dist/commands/session.js.map +1 -0
  153. package/dist/config.d.ts +5 -0
  154. package/dist/config.d.ts.map +1 -0
  155. package/dist/config.js +13 -0
  156. package/dist/config.js.map +1 -0
  157. package/dist/context.d.ts +51 -0
  158. package/dist/context.d.ts.map +1 -0
  159. package/dist/context.js +67 -0
  160. package/dist/context.js.map +1 -0
  161. package/dist/generated/definitions.d.ts +3 -0
  162. package/dist/generated/definitions.d.ts.map +1 -0
  163. package/dist/generated/definitions.js +45603 -0
  164. package/dist/generated/definitions.js.map +1 -0
  165. package/dist/generated/manifest.d.ts +3 -0
  166. package/dist/generated/manifest.d.ts.map +1 -0
  167. package/dist/generated/manifest.js +2089 -0
  168. package/dist/generated/manifest.js.map +1 -0
  169. package/dist/generated/metadata.d.ts +6 -0
  170. package/dist/generated/metadata.d.ts.map +1 -0
  171. package/dist/generated/metadata.js +24 -0
  172. package/dist/generated/metadata.js.map +1 -0
  173. package/dist/generated/schemas.d.ts +1223 -0
  174. package/dist/generated/schemas.d.ts.map +1 -0
  175. package/dist/generated/schemas.js +11557 -0
  176. package/dist/generated/schemas.js.map +1 -0
  177. package/dist/generated/types.d.ts +11120 -0
  178. package/dist/generated/types.d.ts.map +1 -0
  179. package/dist/generated/types.js +5 -0
  180. package/dist/generated/types.js.map +1 -0
  181. package/dist/identity.d.ts +7 -0
  182. package/dist/identity.d.ts.map +1 -0
  183. package/dist/identity.js +30 -0
  184. package/dist/identity.js.map +1 -0
  185. package/dist/index.d.ts +3 -0
  186. package/dist/index.d.ts.map +1 -0
  187. package/dist/index.js +3 -0
  188. package/dist/index.js.map +1 -0
  189. package/dist/knowledge.d.ts +27 -0
  190. package/dist/knowledge.d.ts.map +1 -0
  191. package/dist/knowledge.js +87 -0
  192. package/dist/knowledge.js.map +1 -0
  193. package/dist/library.d.ts +44 -0
  194. package/dist/library.d.ts.map +1 -0
  195. package/dist/library.js +149 -0
  196. package/dist/library.js.map +1 -0
  197. package/dist/notion/client.d.ts +45 -0
  198. package/dist/notion/client.d.ts.map +1 -0
  199. package/dist/notion/client.js +121 -0
  200. package/dist/notion/client.js.map +1 -0
  201. package/dist/notion/errors.d.ts +24 -0
  202. package/dist/notion/errors.d.ts.map +1 -0
  203. package/dist/notion/errors.js +127 -0
  204. package/dist/notion/errors.js.map +1 -0
  205. package/dist/notion/ids.d.ts +7 -0
  206. package/dist/notion/ids.d.ts.map +1 -0
  207. package/dist/notion/ids.js +37 -0
  208. package/dist/notion/ids.js.map +1 -0
  209. package/dist/notion/links.d.ts +6 -0
  210. package/dist/notion/links.d.ts.map +1 -0
  211. package/dist/notion/links.js +22 -0
  212. package/dist/notion/links.js.map +1 -0
  213. package/dist/notion/notion.d.ts +95 -0
  214. package/dist/notion/notion.d.ts.map +1 -0
  215. package/dist/notion/notion.js +269 -0
  216. package/dist/notion/notion.js.map +1 -0
  217. package/dist/notion/port.d.ts +13 -0
  218. package/dist/notion/port.d.ts.map +1 -0
  219. package/dist/notion/port.js +60 -0
  220. package/dist/notion/port.js.map +1 -0
  221. package/dist/notion/read-posts.d.ts +36 -0
  222. package/dist/notion/read-posts.d.ts.map +1 -0
  223. package/dist/notion/read-posts.js +24 -0
  224. package/dist/notion/read-posts.js.map +1 -0
  225. package/dist/notion/reads.d.ts +331 -0
  226. package/dist/notion/reads.d.ts.map +1 -0
  227. package/dist/notion/reads.js +18 -0
  228. package/dist/notion/reads.js.map +1 -0
  229. package/dist/program.d.ts +6 -0
  230. package/dist/program.d.ts.map +1 -0
  231. package/dist/program.js +62 -0
  232. package/dist/program.js.map +1 -0
  233. package/dist/sync/cursor.d.ts +135 -0
  234. package/dist/sync/cursor.d.ts.map +1 -0
  235. package/dist/sync/cursor.js +113 -0
  236. package/dist/sync/cursor.js.map +1 -0
  237. package/dist/sync/files.d.ts +77 -0
  238. package/dist/sync/files.d.ts.map +1 -0
  239. package/dist/sync/files.js +12 -0
  240. package/dist/sync/files.js.map +1 -0
  241. package/dist/sync/front-matter.d.ts +10 -0
  242. package/dist/sync/front-matter.d.ts.map +1 -0
  243. package/dist/sync/front-matter.js +114 -0
  244. package/dist/sync/front-matter.js.map +1 -0
  245. package/dist/sync/markdown.d.ts +11 -0
  246. package/dist/sync/markdown.d.ts.map +1 -0
  247. package/dist/sync/markdown.js +42 -0
  248. package/dist/sync/markdown.js.map +1 -0
  249. package/dist/sync/source.d.ts +11 -0
  250. package/dist/sync/source.d.ts.map +1 -0
  251. package/dist/sync/source.js +995 -0
  252. package/dist/sync/source.js.map +1 -0
  253. package/dist/version.d.ts +2 -0
  254. package/dist/version.d.ts.map +1 -0
  255. package/dist/version.js +2 -0
  256. package/dist/version.js.map +1 -0
  257. package/dist/wcat.d.ts +3 -0
  258. package/dist/wcat.d.ts.map +1 -0
  259. package/dist/wcat.js +4 -0
  260. package/dist/wcat.js.map +1 -0
  261. package/package.json +85 -4
  262. package/skills/notion-cli/SKILL.md +45 -0
@@ -0,0 +1,52 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ readSharedSection,
5
+ writeSharedSection
6
+ } from "./chunk-B7ON6KPT.js";
7
+ import {
8
+ CliError
9
+ } from "./chunk-5RDNBG7D.js";
10
+ import {
11
+ __name
12
+ } from "./chunk-ZVVMGPBJ.js";
13
+
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/cli/setup-answers.js
15
+ var PERMISSION_ANSWERS = ["readonly", "allow"];
16
+ var QUESTIONS = ["languages", "tools", "permissions"];
17
+ var SECTION = "setup";
18
+ var readSetupAnswers = /* @__PURE__ */ __name((path) => {
19
+ const section = readSharedSection(path, SECTION);
20
+ if (section === void 0)
21
+ return {};
22
+ const answers = section;
23
+ if (section === null || typeof section !== "object" || Array.isArray(section) || answers.languages !== void 0 && answers.languages !== true || answers.tools !== void 0 && answers.tools !== true || answers.permissions !== void 0 && !PERMISSION_ANSWERS.includes(answers.permissions))
24
+ throw new CliError("configuration_error", `${path}: ${SECTION} holds what setup asked \u2014 languages: true, tools: true, permissions: ${PERMISSION_ANSWERS.join(" | ")}`);
25
+ return answers;
26
+ }, "readSetupAnswers");
27
+ var unanswered = /* @__PURE__ */ __name((answers) => QUESTIONS.filter((question) => answers[question] === void 0), "unanswered");
28
+ var writeSetupAnswers = /* @__PURE__ */ __name((path, answers) => {
29
+ let kept = {};
30
+ try {
31
+ kept = readSetupAnswers(path);
32
+ } catch (error) {
33
+ if (!(error instanceof CliError) || !error.message.includes(`${SECTION} holds`))
34
+ throw error;
35
+ }
36
+ writeSharedSection(path, SECTION, { ...kept, ...answers });
37
+ }, "writeSetupAnswers");
38
+ var permissionCeiling = /* @__PURE__ */ __name((path) => {
39
+ try {
40
+ return readSetupAnswers(path).permissions === "readonly" ? "readonly" : void 0;
41
+ } catch {
42
+ return void 0;
43
+ }
44
+ }, "permissionCeiling");
45
+
46
+ export {
47
+ QUESTIONS,
48
+ readSetupAnswers,
49
+ unanswered,
50
+ writeSetupAnswers,
51
+ permissionCeiling
52
+ };
@@ -0,0 +1,29 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError,
5
+ singleLine
6
+ } from "./chunk-5RDNBG7D.js";
7
+ import {
8
+ __name
9
+ } from "./chunk-ZVVMGPBJ.js";
10
+
11
+ // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/domain/tags.js
12
+ var TAG_TYPES = ["chat", "contact", "message", "task"];
13
+ var TAG = /^[a-z0-9-]{1,32}$/;
14
+ var tagOf = /* @__PURE__ */ __name((value) => {
15
+ const tag = value.trim().toLowerCase();
16
+ return TAG.test(tag) ? tag : void 0;
17
+ }, "tagOf");
18
+ var normalizeTag = /* @__PURE__ */ __name((value) => {
19
+ const tag = tagOf(value);
20
+ if (tag === void 0)
21
+ throw new CliError("validation_error", `"${singleLine(value)}" is not a tag \u2014 use 1\u201332 letters a\u2013z, digits and hyphens`, { reason: "tag.invalid" });
22
+ return tag;
23
+ }, "normalizeTag");
24
+
25
+ export {
26
+ TAG_TYPES,
27
+ tagOf,
28
+ normalizeTag
29
+ };
@@ -0,0 +1,385 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ validateVector
5
+ } from "./chunk-LLG2POQ7.js";
6
+ import {
7
+ meaningFloor
8
+ } from "./chunk-WJHZMR2W.js";
9
+ import {
10
+ MESSAGE_PARSING,
11
+ RRF_K,
12
+ plainQuery
13
+ } from "./chunk-MZU2YFBZ.js";
14
+ import {
15
+ normalize
16
+ } from "./chunk-X4TIMMKJ.js";
17
+ import {
18
+ MEETING_FIELD_NAMES,
19
+ formatMeetingReference,
20
+ implicitTextTerms,
21
+ liftMeetingFields,
22
+ parseLucene,
23
+ parseMeetingReference,
24
+ walkQuery
25
+ } from "./chunk-FWVBPRL4.js";
26
+ import {
27
+ CliError
28
+ } from "./chunk-5RDNBG7D.js";
29
+ import {
30
+ __name
31
+ } from "./chunk-ZVVMGPBJ.js";
32
+
33
+ // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
34
+ import { createHash } from "node:crypto";
35
+
36
+ // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/search/question-plan.js
37
+ var words = /* @__PURE__ */ __name((text) => normalize(text).match(/[\p{L}\p{N}]+/gu) ?? [], "words");
38
+ var joinedHyphens = /* @__PURE__ */ __name((text) => (normalize(text).match(new RegExp("(?<![:\\p{L}\\p{N}-])\\p{L}[\\p{L}\\p{N}]*(?:-\\p{L}[\\p{L}\\p{N}]*)+", "gu")) ?? []).map((word) => word.replaceAll("-", "")), "joinedHyphens");
39
+ var scaffolding = new Set(words("what which how many much who where when is are was were do does did can could should we the a an for of to under from in on at has have \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u043E\u0435 \u043A\u0442\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u0447\u0442\u043E \u0432\u043E \u043F\u043E \u043D\u0430 \u0432 \u043A \u0441 \u0443 \u0447\u0435\u0440\u0435\u0437 \u043B\u0438 \u0434\u043E\u043B\u0436\u0435\u043D \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0443\u0436\u043D\u043E \u0438\u0434\u0451\u0442 \u0438\u0434\u0435\u0442 \u043C\u043E\u0436\u043D\u043E \u043C\u043E\u0436\u0435\u0442 \u043C\u043E\u0433\u0443\u0442"));
40
+ var questionWord = /\b(?:what|which|how|who|where|when|can|could|should)\b|(?:^|\s)(?:сколько|какой|какая|какие|какое|кто|кому|кем|где|когда|как|что|можно|может|могут|ли)(?:\s|$)/iu;
41
+ var QUESTION_STARTS = new Set(words("what which how who whom whose where when why can could should would did do does is are was were will \u0447\u0442\u043E \u043A\u0442\u043E \u043A\u043E\u0433\u043E \u043A\u043E\u043C\u0443 \u043A\u0435\u043C \u0433\u0434\u0435 \u043A\u043E\u0433\u0434\u0430 \u043A\u0430\u043A \u043A\u0430\u043A\u043E\u0439 \u043A\u0430\u043A\u0430\u044F \u043A\u0430\u043A\u043E\u0435 \u043A\u0430\u043A\u0438\u0435 \u043A\u0430\u043A\u0443\u044E \u043A\u0430\u043A\u0438\u043C \u043A\u0430\u043A\u043E\u0433\u043E \u043A\u0430\u043A\u0438\u0445 \u043F\u043E\u0447\u0435\u043C\u0443 \u0437\u0430\u0447\u0435\u043C \u043E\u0442\u043A\u0443\u0434\u0430 \u043A\u0443\u0434\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043B\u0438 \u043C\u043E\u0436\u043D\u043E \u0440\u0430\u0437\u0432\u0435 \u0447\u0435\u0439 \u0447\u044C\u044F \u0447\u044C\u0451 \u0447\u044C\u0438"));
42
+ var QUESTION_FILLER = new Set(words("about any did does why whom whose would will \u044D\u0442\u043E \u043C\u044B \u0432\u044B \u044F \u043E\u043D\u0438 \u043E\u043D \u043E\u043D\u0430 \u043E \u043E\u0431 \u043F\u0440\u043E \u043B\u0438"));
43
+ var LINKING = new Set(words("and or but not nor with without this that these those there their they them you your our its his her all any and for into onto over then than also just and \u043F\u0440\u0438 \u0434\u043B\u044F \u0431\u0435\u0437 \u043D\u0430\u0434 \u043F\u043E\u0434 \u0438\u043B\u0438 \u043B\u0438\u0431\u043E \u0435\u0433\u043E \u0435\u0451 \u0438\u0445 \u0432\u0441\u0435 \u0432\u0441\u0451 \u0443\u0436\u0435 \u0435\u0449\u0451 \u0442\u0430\u043A \u0442\u043E\u0436\u0435 \u0442\u0430\u043A\u0436\u0435 \u0431\u044B\u043B \u0431\u044B\u043B\u0430 \u0431\u044B\u043B\u0438 \u0431\u044B\u043B\u043E \u0431\u0443\u0434\u0435\u0442 \u044D\u0442\u043E \u044D\u0442\u0430 \u044D\u0442\u043E\u0442 \u044D\u0442\u0438 \u0442\u0430\u043C \u0442\u0443\u0442"));
44
+ var isFunctionWord = /* @__PURE__ */ __name((word) => scaffolding.has(word) || QUESTION_STARTS.has(word) || QUESTION_FILLER.has(word) || LINKING.has(word), "isFunctionWord");
45
+ var questionTerms = /* @__PURE__ */ __name((text) => /\?\s*$/u.test(text) || QUESTION_STARTS.has(words(text)[0] ?? "") ? words(text).filter((word) => !scaffolding.has(word) && !QUESTION_STARTS.has(word) && !QUESTION_FILLER.has(word)) : null, "questionTerms");
46
+ function planQuestion(text, strict = false) {
47
+ if (strict)
48
+ return {
49
+ changed: false,
50
+ natural: false,
51
+ queries: [text],
52
+ scope: "",
53
+ terms: words(text),
54
+ rankingTerms: words(text),
55
+ removed: [],
56
+ aliases: []
57
+ };
58
+ const inputAst = parseLucene(text, MESSAGE_PARSING);
59
+ const rawTextual = walkQuery(inputAst.root).filter((node) => node.field === "text" || node.field === "exact");
60
+ const body = rawTextual.map((node) => node.value).join(" ");
61
+ const prefix = words(body).slice(0, 2);
62
+ const questionPrefix = [
63
+ "what",
64
+ "which",
65
+ "how",
66
+ "who",
67
+ "where",
68
+ "when",
69
+ "can",
70
+ "could",
71
+ "should",
72
+ "\u0441\u043A\u043E\u043B\u044C\u043A\u043E",
73
+ "\u043A\u0430\u043A\u043E\u0438",
74
+ "\u043A\u0430\u043A\u0430\u044F",
75
+ "\u043A\u0430\u043A\u0438\u0435",
76
+ "\u043A\u0430\u043A\u043E\u0435",
77
+ "\u043A\u0442\u043E",
78
+ "\u043A\u043E\u043C\u0443",
79
+ "\u043A\u0435\u043C",
80
+ "\u0433\u0434\u0435",
81
+ "\u043A\u043E\u0433\u0434\u0430",
82
+ "\u043A\u0430\u043A",
83
+ "\u0447\u0442\u043E",
84
+ "\u043C\u043E\u0436\u043D\u043E",
85
+ "\u043C\u043E\u0436\u0435\u0442",
86
+ "\u043C\u043E\u0433\u0443\u0442"
87
+ ].includes(prefix[0] ?? "") || ["\u043A", "\u0432\u043E"].includes(prefix[0] ?? "") && ["\u043A\u043E\u043C\u0443", "\u0441\u043A\u043E\u043B\u044C\u043A\u043E"].includes(prefix[1] ?? "");
88
+ const natural = questionWord.test(body) && (/\?/u.test(body) || questionPrefix);
89
+ let cleaned = text;
90
+ if (natural && !text.includes("\\")) {
91
+ const last = rawTextual.at(-1);
92
+ const mark = (last?.span.end ?? 0) - 1;
93
+ if (last?.operator === "wildcard" && text[mark] === "?")
94
+ cleaned = text.slice(0, mark) + text.slice(mark + 1);
95
+ }
96
+ const ast = cleaned === text ? inputAst : parseLucene(cleaned, MESSAGE_PARSING);
97
+ const predicates = walkQuery(ast.root);
98
+ const textual = predicates.filter((p) => p.field === "text" || p.field === "exact");
99
+ const fields = predicates.filter((p) => p.field !== "text" && p.field !== "exact");
100
+ const scope = fields.map((p) => {
101
+ const raw = cleaned.slice(p.span.start, p.span.end);
102
+ return new RegExp(`^${p.field}[:=<>]`, "u").test(raw) ? raw : `${p.field}:${raw}`;
103
+ }).join(" ");
104
+ const bypass = strict || !natural || implicitTextTerms(cleaned).size === 0 || // A quoted single word is how `plainQuery` keeps `10:30` or `HH:MM` literal; it is no phrase the asker wrote.
105
+ textual.some((p) => !(p.operator === "term" || p.operator === "phrase" && !/\s/u.test(p.value)) || p.field === "exact");
106
+ if (bypass)
107
+ return {
108
+ changed: false,
109
+ natural: false,
110
+ queries: [text],
111
+ scope,
112
+ terms: textual.flatMap((p) => words(p.value)),
113
+ rankingTerms: textual.flatMap((p) => words(p.value)),
114
+ removed: [],
115
+ aliases: []
116
+ };
117
+ const original = textual.flatMap((p) => words(p.value));
118
+ const removed = original.filter((w) => scaffolding.has(w));
119
+ const terms = [...new Set(original.filter((w) => !scaffolding.has(w)))];
120
+ if (!terms.length)
121
+ return {
122
+ changed: false,
123
+ natural: true,
124
+ queries: [text],
125
+ scope,
126
+ terms,
127
+ rankingTerms: original,
128
+ removed,
129
+ aliases: []
130
+ };
131
+ const alias = [...terms];
132
+ const changes = [];
133
+ const replace = /* @__PURE__ */ __name((from, to) => {
134
+ for (let i = 0; i < alias.length; i++)
135
+ if (from.includes(alias[i] ?? "")) {
136
+ changes.push(`${alias[i]} -> ${to}`);
137
+ alias[i] = to;
138
+ }
139
+ }, "replace");
140
+ if (terms.some((w) => ["refund", "euros", "euro", "money", "\u0432\u043E\u0437\u0432\u0440\u0430\u0442\u0430", "\u0432\u043E\u0437\u0432\u0440\u0430\u0442", "\u0435\u0432\u0440\u043E"].includes(w))) {
141
+ replace(["returned", "refunded", "received"], "refund");
142
+ replace(["\u0432\u0435\u0440\u043D\u0443\u043B\u0438", "\u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0435\u043D\u043E", "\u043F\u0435\u0440\u0435\u0447\u0438\u0441\u043B\u0435\u043D\u043E"], "\u0432\u043E\u0437\u0432\u0440\u0430\u0442");
143
+ }
144
+ if (terms.some((w) => ["log", "logs", "retention", "backup", "\u043B\u043E\u0433\u043E\u0432", "\u043B\u043E\u0433\u0438", "\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435", "\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F"].includes(w))) {
145
+ replace(["lifetime", "kept", "keep"], "retention");
146
+ replace(["\u0445\u0440\u0430\u043D\u044F\u0442\u0441\u044F", "\u0445\u0440\u0430\u043D\u044F\u0442", "\u0445\u0440\u0430\u043D\u0438\u0442\u044C", "\u0441\u0440\u043E\u043A"], "\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435");
147
+ }
148
+ if (terms.includes("service") || terms.includes("build"))
149
+ replace(["currently", "now"], "current");
150
+ const render = /* @__PURE__ */ __name((ws) => [...new Set(ws)].join(" ") + (scope ? ` ${scope}` : ""), "render");
151
+ const queries = [.../* @__PURE__ */ new Set([render(terms), render(alias)])].slice(0, 2);
152
+ return { changed: true, natural: true, queries, scope, terms, rankingTerms: original, removed, aliases: changes };
153
+ }
154
+ __name(planQuestion, "planQuestion");
155
+ var questionText = /* @__PURE__ */ __name((text) => text.replace(new RegExp("(?<=\\p{L})\\?(?=\\s|$)", "gu"), "").replace(/"(?:[^"\\]|\\.)*"|(?<=\d):(?=\d)/gu, (found) => found === ":" ? " " : found), "questionText");
156
+ var lookupTerms = /* @__PURE__ */ __name((plan) => [
157
+ ...new Set(plan.terms.concat(plan.aliases.flatMap((alias) => words(alias.split(" -> ")[1] ?? ""))))
158
+ ], "lookupTerms");
159
+ var anyOfTerms = /* @__PURE__ */ __name((terms, scope) => `(${terms.join(" OR ")})${scope ? ` ${scope}` : ""}`, "anyOfTerms");
160
+ var questionLookup = /* @__PURE__ */ __name((text) => {
161
+ let plan;
162
+ try {
163
+ plan = planQuestion(questionText(text));
164
+ } catch (error) {
165
+ if (error instanceof CliError)
166
+ return void 0;
167
+ throw error;
168
+ }
169
+ const terms = plan.changed ? lookupTerms(plan) : [];
170
+ return terms.length ? anyOfTerms(terms, plan.scope) : void 0;
171
+ }, "questionLookup");
172
+
173
+ // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/services/meeting-hit-search.js
174
+ var refreshMeetingIndex = /* @__PURE__ */ __name(async (meetings, accountId, signal) => {
175
+ let before = Number.POSITIVE_INFINITY;
176
+ for (; ; ) {
177
+ signal?.throwIfAborted();
178
+ const { indexed, remaining } = await meetings.indexSearch({
179
+ accountId,
180
+ limit: 1e3,
181
+ maxReadBytes: 64 * 1024 ** 2,
182
+ signal
183
+ });
184
+ if (remaining === 0 || indexed === 0 || remaining >= before)
185
+ return;
186
+ before = remaining;
187
+ }
188
+ }, "refreshMeetingIndex");
189
+ var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
190
+ const { project, tag, topic, ...input } = request;
191
+ input.signal?.throwIfAborted();
192
+ if (project !== void 0 && input.projectId !== void 0 || [tag, topic].filter((value) => value !== void 0).length + Number(input.tagId !== void 0) > 1)
193
+ throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
194
+ const selection = [];
195
+ const knowledge = store.knowledge;
196
+ if (!knowledge && [project, tag, topic].some((value) => value !== void 0))
197
+ throw new CliError("configuration_error", "this store cannot resolve project, tag or topic names");
198
+ for (const [kind, name] of [
199
+ ["project", project],
200
+ ["tag", tag],
201
+ ["topic", topic]
202
+ ]) {
203
+ if (name === void 0)
204
+ continue;
205
+ if (!knowledge)
206
+ continue;
207
+ const found = await knowledge.resolveVocabulary(name, { kind, signal: input.signal });
208
+ input.signal?.throwIfAborted();
209
+ if (found.ambiguous || found.matches.length !== 1)
210
+ throw new CliError(found.matches.length ? "validation_error" : "not_found", `the ${kind} name needs one canonical record`, {
211
+ candidates: found.matches.map((entry2) => ({ kind: entry2.kind, id: entry2.id, name: entry2.name }))
212
+ });
213
+ const entry = found.matches[0];
214
+ const id = Number(entry?.id);
215
+ if (!entry || entry.kind !== kind || !Number.isSafeInteger(id) || id < 1)
216
+ throw new CliError("invalid_response", "vocabulary resolution returned an invalid canonical record");
217
+ if (kind === "project")
218
+ input.projectId = id;
219
+ else
220
+ input.tagId = id;
221
+ selection.push({ kind, id, name: entry.name, by: "explicit-link" });
222
+ }
223
+ return { input, selection };
224
+ }, "resolveMeetingSelection");
225
+ var searchMeetingHits = /* @__PURE__ */ __name(async (store, query, request, options = {}) => {
226
+ const lifted = liftMeetingFields(plainQuery(query, MEETING_FIELD_NAMES), request);
227
+ const { input, selection } = await resolveMeetingSelection(store, lifted.request);
228
+ if (options.refreshIndex !== false)
229
+ await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
230
+ const result = await store.meetings.searchHits(lifted.query, input);
231
+ input.signal?.throwIfAborted();
232
+ return { ...result, selection };
233
+ }, "searchMeetingHits");
234
+
235
+ // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/services/meeting-combined.js
236
+ var DEPTH = 200;
237
+ var cursorOf = /* @__PURE__ */ __name((value, key) => {
238
+ if (value === void 0)
239
+ return 0;
240
+ let cursor;
241
+ try {
242
+ cursor = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
243
+ } catch {
244
+ throw new CliError("validation_error", "the cursor is not from a combined meeting search; search again");
245
+ }
246
+ if (cursor?.version !== 1 || cursor.key !== key || !Number.isSafeInteger(cursor.offset) || cursor.offset < 0)
247
+ throw new CliError("validation_error", "the cursor belongs to another query, filter or model; search again");
248
+ return cursor.offset;
249
+ }, "cursorOf");
250
+ var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, typed, request) => {
251
+ const { maxChunks, maxRows, maxTextBytes, ...chosen } = request;
252
+ const { query, request: words2 } = liftMeetingFields(typed, chosen);
253
+ const { input, selection } = await resolveMeetingSelection(store, words2);
254
+ const { after, limit = 20, maxReadBytes, ...filters } = input;
255
+ const terms = questionTerms(query);
256
+ const wordQuery = terms === null ? query : terms.join(" ");
257
+ const key = createHash("sha256").update(JSON.stringify([query, embedder.key, Object.entries(filters).filter(([name]) => name !== "signal")])).digest("base64url");
258
+ const offset = cursorOf(after, key);
259
+ let byWords = [];
260
+ let indexing = "ready";
261
+ let refused;
262
+ if (wordQuery.trim()) {
263
+ await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
264
+ try {
265
+ const page = await store.meetings.searchHits(wordQuery, { ...filters, limit: DEPTH, maxReadBytes });
266
+ byWords = page.items;
267
+ indexing = page.coverage.indexing;
268
+ } catch (error) {
269
+ if (!(error instanceof CliError) || error.code !== "validation_error")
270
+ throw error;
271
+ refused = error.message;
272
+ }
273
+ }
274
+ input.signal?.throwIfAborted();
275
+ const vectors = await embedder.embed([query], "query");
276
+ if (vectors.length !== 1)
277
+ throw new CliError("invalid_response", "Meeting query model returned another vector count");
278
+ const vector = vectors[0];
279
+ const ranked = await store.meetingVectors.ranked(embedder.key, validateVector(vector, embedder.dims), {
280
+ ...filters,
281
+ limit: DEPTH,
282
+ ...maxChunks === void 0 ? {} : { maxChunks },
283
+ ...maxRows === void 0 ? {} : { maxRows },
284
+ ...maxTextBytes === void 0 ? {} : { maxTextBytes }
285
+ });
286
+ const floor = meaningFloor(embedder.key);
287
+ const byMeaning = ranked.items.filter(({ score }) => score > floor);
288
+ const merged = /* @__PURE__ */ new Map();
289
+ byMeaning.forEach((hit, rank) => {
290
+ const reference = { type: "meeting", accountId: input.accountId, meetingId: hit.meetingId };
291
+ const first = formatMeetingReference({
292
+ ...reference,
293
+ transcriptId: hit.transcriptId,
294
+ cuePosition: hit.firstPosition
295
+ });
296
+ merged.set(`${hit.transcriptId}:${hit.firstPosition}`, {
297
+ ref: first,
298
+ meetingId: hit.meetingId,
299
+ scope: "transcript",
300
+ text: hit.text,
301
+ startMs: null,
302
+ source: { title: hit.title, startedAt: hit.startedAt, url: null },
303
+ by: ["meaning"],
304
+ score: hit.score,
305
+ passage: {
306
+ first,
307
+ last: formatMeetingReference({ ...reference, transcriptId: hit.transcriptId, cuePosition: hit.lastPosition })
308
+ },
309
+ fused: 1 / (RRF_K + rank + 1)
310
+ });
311
+ });
312
+ byWords.forEach((hit, rank) => {
313
+ const share = 1 / (RRF_K + rank + 1);
314
+ const cue = hit.scope === "transcript" ? parseMeetingReference(hit.ref) : void 0;
315
+ const within = cue?.cuePosition === void 0 ? void 0 : byMeaning.find((passage) => passage.transcriptId === cue.transcriptId && passage.firstPosition <= cue.cuePosition && cue.cuePosition <= passage.lastPosition);
316
+ const held = within && merged.get(`${within.transcriptId}:${within.firstPosition}`);
317
+ const found = {
318
+ ref: hit.ref,
319
+ text: hit.text,
320
+ startMs: hit.startMs,
321
+ ...hit.match === void 0 ? {} : { match: hit.match },
322
+ ...hit.corrections === void 0 ? {} : { corrections: hit.corrections }
323
+ };
324
+ if (held && !held.by.includes("words")) {
325
+ Object.assign(held, found, { by: ["words", "meaning"], fused: held.fused + share });
326
+ if (hit.source?.url)
327
+ held.source.url = hit.source.url;
328
+ } else if (held)
329
+ held.fused += share;
330
+ else
331
+ merged.set(`w:${hit.ref}:${hit.scope}:${hit.id}`, {
332
+ ...found,
333
+ meetingId: hit.meetingId,
334
+ scope: hit.scope,
335
+ source: {
336
+ title: hit.source?.title ?? null,
337
+ startedAt: hit.source?.startedAt ?? null,
338
+ url: hit.source?.url ?? null
339
+ },
340
+ by: ["words"],
341
+ score: null,
342
+ fused: share
343
+ });
344
+ });
345
+ const ordered = [...merged.values()].sort((a, b) => b.fused - a.fused || Number(b.by.includes("words")) - Number(a.by.includes("words")) || (b.score ?? -2) - (a.score ?? -2));
346
+ const items = ordered.slice(offset, offset + limit).map(({ fused: _, ...hit }) => hit);
347
+ const hasMore = ordered.length > offset + limit;
348
+ return {
349
+ items,
350
+ hasMore,
351
+ nextCursor: hasMore ? Buffer.from(JSON.stringify({ version: 1, key, offset: offset + limit })).toString("base64url") : null,
352
+ selection,
353
+ words: {
354
+ query: wordQuery,
355
+ ...terms === null ? {} : { from: "question" },
356
+ ...refused === void 0 ? {} : { refused }
357
+ },
358
+ model: { key: embedder.key, model: embedder.model, kind: embedder.kind, dims: embedder.dims },
359
+ coverage: {
360
+ archiveCompleteness: "unknown",
361
+ indexCompleteness: "unknown",
362
+ indexing,
363
+ /** Every vector of the selection was compared; false when `maxChunks` stopped the scan. */
364
+ meaningScanComplete: ranked.complete,
365
+ scanned: ranked.scanned,
366
+ /** Each side ranks this many at most; pages past them hold nothing more. */
367
+ depth: DEPTH
368
+ }
369
+ };
370
+ }, "searchMeetingsCombined");
371
+
372
+ export {
373
+ words,
374
+ joinedHyphens,
375
+ isFunctionWord,
376
+ planQuestion,
377
+ questionText,
378
+ lookupTerms,
379
+ anyOfTerms,
380
+ questionLookup,
381
+ refreshMeetingIndex,
382
+ resolveMeetingSelection,
383
+ searchMeetingHits,
384
+ searchMeetingsCombined
385
+ };
@@ -0,0 +1,66 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ count,
5
+ id,
6
+ text,
7
+ time
8
+ } from "./chunk-MY742GAD.js";
9
+ import {
10
+ reference
11
+ } from "./chunk-4IPURN72.js";
12
+ import {
13
+ array,
14
+ nullable,
15
+ optional,
16
+ picklist,
17
+ record,
18
+ strictObject,
19
+ string,
20
+ unknown
21
+ } from "./chunk-XYIT2XB3.js";
22
+
23
+ // node_modules/.pnpm/@wirecat+cli-core@0.673.0_@wirecat+cli-base@0.102.1_commander@15.0.0_esbuild@0.28.2_typ_d24fa0f4f3b37e009a0e8224eb6a2687/node_modules/@wirecat/cli-core/dist/entities/note.js
24
+ var link = {
25
+ target_text: nullable(text),
26
+ kind: text,
27
+ anchor: nullable(text)
28
+ };
29
+ var note = strictObject({
30
+ ref: reference,
31
+ kind: optional(picklist(["note", "document"])),
32
+ provider: optional(text),
33
+ account: optional(text),
34
+ url: optional(text),
35
+ id,
36
+ source: picklist(["file", "internal"]),
37
+ folder_id: nullable(id),
38
+ path: nullable(text),
39
+ title: nullable(text),
40
+ text,
41
+ /** Raises on every edit; `notes edit --revision` takes it, so an edit made meanwhile is refused, not lost. */
42
+ revision: count,
43
+ /** A file's front matter as parsed, keys as the file writes them; null for a note without it. */
44
+ front_matter: nullable(record(string(), unknown())),
45
+ /** The hash of a file's bytes when last imported; null for a note written here. */
46
+ content_hash: nullable(text),
47
+ /** The file the note was exported to, where that is known; null otherwise. */
48
+ export_path: nullable(text),
49
+ created_at: time,
50
+ /** When the store's copy last changed. */
51
+ updated_at: time,
52
+ deleted_at: optional(nullable(time)),
53
+ tags: optional(array(text)),
54
+ /** The first line holding a word of a search. */
55
+ excerpt: optional(text),
56
+ /** Which halves of a search found it. */
57
+ found_by: optional(array(picklist(["title", "words", "meaning"]))),
58
+ /** What the note links to; `to` is null while the name written matches nothing stored. */
59
+ links: optional(array(strictObject({ to: nullable(reference), ...link }))),
60
+ /** The notes and messages that link to it. */
61
+ backlinks: optional(array(strictObject({ from: reference, ...link })))
62
+ });
63
+
64
+ export {
65
+ note
66
+ };