nova-personal-agent-server 0.4.0 → 1.0.2

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 (327) hide show
  1. package/LICENSE +674 -201
  2. package/README.md +12 -2
  3. package/bin/nova-space-host.mjs +4 -0
  4. package/node_modules/@nova-personal-agent/relay/dist/src/cli.js +71 -0
  5. package/node_modules/@nova-personal-agent/relay/dist/src/client.js +340 -0
  6. package/node_modules/@nova-personal-agent/relay/dist/src/crypto.js +167 -0
  7. package/node_modules/@nova-personal-agent/relay/dist/src/live.js +169 -0
  8. package/node_modules/@nova-personal-agent/relay/dist/src/mailbox.js +217 -0
  9. package/node_modules/@nova-personal-agent/relay/dist/src/media.js +320 -0
  10. package/node_modules/@nova-personal-agent/relay/dist/src/pairing.js +13 -0
  11. package/node_modules/@nova-personal-agent/relay/dist/src/protocol.js +50 -0
  12. package/node_modules/@nova-personal-agent/relay/dist/src/security.js +305 -0
  13. package/node_modules/@nova-personal-agent/relay/dist/src/server.js +477 -0
  14. package/node_modules/@nova-personal-agent/relay/dist/src/source-address.js +58 -0
  15. package/node_modules/@nova-personal-agent/relay/package.json +1 -0
  16. package/package.json +13 -6
  17. package/runtime/dist/src/cascaded-text-provider.js +8 -3
  18. package/runtime/dist/src/composition/assembly.js +133 -35
  19. package/runtime/dist/src/composition/cascaded-realtime-assembly.js +114 -59
  20. package/runtime/dist/src/composition/production-composition.js +57 -21
  21. package/runtime/dist/src/composition/realtime-assembly.js +160 -52
  22. package/runtime/dist/src/composition/soul-context.js +22 -0
  23. package/runtime/dist/src/config/capability-registry.js +48 -3
  24. package/runtime/dist/src/config/cascaded-realtime-config.js +23 -10
  25. package/runtime/dist/src/config/config.js +541 -128
  26. package/runtime/dist/src/config/credential-rotation.js +26 -0
  27. package/runtime/dist/src/config/data-root.js +764 -0
  28. package/runtime/dist/src/config/diagnostics.js +3 -1
  29. package/runtime/dist/src/config/environment-contract.js +190 -188
  30. package/runtime/dist/src/config/model-routes.js +140 -0
  31. package/runtime/dist/src/config/voice-credentials.js +55 -0
  32. package/runtime/dist/src/connectors/composio/index.js +9 -0
  33. package/runtime/dist/src/connectors/feishu/index.js +258 -44
  34. package/runtime/dist/src/connectors/macos/mail.js +7 -3
  35. package/runtime/dist/src/connectors/macos/reader.js +3 -1
  36. package/runtime/dist/src/conversation-voice-provider.js +5 -2
  37. package/runtime/dist/src/core/causal-runtime.js +38 -3
  38. package/runtime/dist/src/core/context-view.js +7 -0
  39. package/runtime/dist/src/core/guards.js +32 -0
  40. package/runtime/dist/src/core/runtime.js +3 -0
  41. package/runtime/dist/src/core/schedule-tools.js +2 -2
  42. package/runtime/dist/src/core/source-processing-instructions.js +2 -2
  43. package/runtime/dist/src/core/source-processing-tools.js +3 -1
  44. package/runtime/dist/src/core/tool-schema.js +42 -7
  45. package/runtime/dist/src/desktop/desktop-camera.js +3 -5
  46. package/runtime/dist/src/desktop/desktop-control.js +41 -8
  47. package/runtime/dist/src/desktop/desktop-session.js +90 -19
  48. package/runtime/dist/src/desktop/desktop-wire.js +5 -7
  49. package/runtime/dist/src/desktop/startup-error.js +18 -16
  50. package/runtime/dist/src/desktop/workbench-acceptance.js +52 -14
  51. package/runtime/dist/src/desktop-entry.js +6 -2
  52. package/runtime/dist/src/desktop.js +5 -1
  53. package/runtime/dist/src/device/attempt.js +65 -0
  54. package/runtime/dist/src/device/authority.js +159 -0
  55. package/runtime/dist/src/device/gateway.js +87 -0
  56. package/runtime/dist/src/device/ledger.js +91 -0
  57. package/runtime/dist/src/device/ownership.js +92 -0
  58. package/runtime/dist/src/device/port.js +2 -0
  59. package/runtime/dist/src/device/schedule-ownership.js +103 -0
  60. package/runtime/dist/src/executors/acp/transport.js +2 -0
  61. package/runtime/dist/src/executors/browser.js +4 -3
  62. package/runtime/dist/src/executors/codex/adapter-project.js +58 -12
  63. package/runtime/dist/src/executors/codex/app-server-schema.js +12 -21
  64. package/runtime/dist/src/executors/codex/app-server-transport.js +32 -18
  65. package/runtime/dist/src/executors/codex/common.js +1 -1
  66. package/runtime/dist/src/executors/codex/contract.js +12 -16
  67. package/runtime/dist/src/executors/codex/credential-snapshot.js +1 -9
  68. package/runtime/dist/src/executors/codex/factory.js +54 -32
  69. package/runtime/dist/src/executors/codex/host-config.js +69 -20
  70. package/runtime/dist/src/executors/codex/launch-profile.js +3 -2
  71. package/runtime/dist/src/executors/codex/local-provider-credential.js +39 -0
  72. package/runtime/dist/src/executors/codex/process-owner.js +4 -6
  73. package/runtime/dist/src/executors/codex/production-host.js +33 -34
  74. package/runtime/dist/src/executors/codex/protocol.js +9 -14
  75. package/runtime/dist/src/executors/codex/session-title.js +6 -8
  76. package/runtime/dist/src/executors/codex/spawn-env.js +27 -6
  77. package/runtime/dist/src/executors/codex/turn-projection.js +12 -17
  78. package/runtime/dist/src/executors/codex/windows-guardian.js +4 -6
  79. package/runtime/dist/src/executors/coding/intake.js +12 -7
  80. package/runtime/dist/src/executors/computer-backend.js +18 -10
  81. package/runtime/dist/src/executors/computer-config.js +32 -0
  82. package/runtime/dist/src/executors/computer-device.js +68 -16
  83. package/runtime/dist/src/executors/computer-worker.js +18 -6
  84. package/runtime/dist/src/executors/computer.js +29 -56
  85. package/runtime/dist/src/executors/device-lock.js +14 -5
  86. package/runtime/dist/src/executors/gui-execution.js +2 -0
  87. package/runtime/dist/src/executors/index.js +0 -1
  88. package/runtime/dist/src/executors/mobile.js +9 -8
  89. package/runtime/dist/src/executors/native-process.js +4 -0
  90. package/runtime/dist/src/executors/search.js +3 -5
  91. package/runtime/dist/src/executors/task-resources.js +21 -0
  92. package/runtime/dist/src/executors/watcher.js +2 -4
  93. package/runtime/dist/src/experience/host.js +179 -0
  94. package/runtime/dist/src/index.js +2 -0
  95. package/runtime/dist/src/knowledge/assembly.js +3 -4
  96. package/runtime/dist/src/knowledge/embeddings.js +50 -34
  97. package/runtime/dist/src/knowledge/service.js +1 -0
  98. package/runtime/dist/src/knowledge/store-client.js +1 -6
  99. package/runtime/dist/src/knowledge/store-worker.js +1 -3
  100. package/runtime/dist/src/mem0/resource.js +25 -0
  101. package/runtime/dist/src/mem0/store-worker.js +234 -21
  102. package/runtime/dist/src/memory/consumer.js +31 -0
  103. package/runtime/dist/src/memory/engine-worker.js +210 -0
  104. package/runtime/dist/src/memory/entry.js +8 -1
  105. package/runtime/dist/src/memory/explicit-memory.js +20 -0
  106. package/runtime/dist/src/memory/factory.js +30 -15
  107. package/runtime/dist/src/memory/grounded-voicemem.js +10 -0
  108. package/runtime/dist/src/memory/ledger-recall-engine.js +86 -0
  109. package/runtime/dist/src/memory/prerecall-port.js +27 -0
  110. package/runtime/dist/src/memory/prerecall.js +1 -1
  111. package/runtime/dist/src/memory/production-engine.js +151 -0
  112. package/runtime/dist/src/memory/provenance.js +1 -0
  113. package/runtime/dist/src/memory/remote-personal-memory.js +3 -1
  114. package/runtime/dist/src/memory/retrieval.js +107 -22
  115. package/runtime/dist/src/memory/sensitivity.js +6 -2
  116. package/runtime/dist/src/memory/source-retrieval.js +11 -0
  117. package/runtime/dist/src/memory/tool-capabilities.js +46 -0
  118. package/runtime/dist/src/memory/voicemem-sdk/LICENSE +202 -0
  119. package/runtime/dist/src/memory/voicemem-sdk/NOTICE.md +97 -0
  120. package/runtime/dist/src/memory/voicemem-sdk/PATCH-NOTICE.md +23 -0
  121. package/runtime/dist/src/memory/voicemem-sdk/archive.js +12 -0
  122. package/runtime/dist/src/memory/voicemem-sdk/audio.js +111 -0
  123. package/runtime/dist/src/memory/voicemem-sdk/barge-in.js +59 -0
  124. package/runtime/dist/src/memory/voicemem-sdk/checkpoint.js +56 -0
  125. package/runtime/dist/src/memory/voicemem-sdk/cleanup.js +139 -0
  126. package/runtime/dist/src/memory/voicemem-sdk/dashscope-asr.js +254 -0
  127. package/runtime/dist/src/memory/voicemem-sdk/dashscope-tts.js +247 -0
  128. package/runtime/dist/src/memory/voicemem-sdk/evaluation.js +330 -0
  129. package/runtime/dist/src/memory/voicemem-sdk/extraction.js +220 -0
  130. package/runtime/dist/src/memory/voicemem-sdk/finetune-data.js +115 -0
  131. package/runtime/dist/src/memory/voicemem-sdk/finetune.js +170 -0
  132. package/runtime/dist/src/memory/voicemem-sdk/grounded-reply-preferences.js +81 -0
  133. package/runtime/dist/src/memory/voicemem-sdk/index.js +22 -0
  134. package/runtime/dist/src/memory/voicemem-sdk/local-embedding.js +164 -0
  135. package/runtime/dist/src/memory/voicemem-sdk/local-runtime.js +53 -0
  136. package/runtime/dist/src/memory/voicemem-sdk/local-speaker.js +240 -0
  137. package/runtime/dist/src/memory/voicemem-sdk/memory.js +767 -0
  138. package/runtime/dist/src/memory/voicemem-sdk/model-json.js +14 -0
  139. package/runtime/dist/src/memory/voicemem-sdk/personamem.js +209 -0
  140. package/runtime/dist/src/memory/voicemem-sdk/prompts/addenda.js +215 -0
  141. package/runtime/dist/src/memory/voicemem-sdk/prompts/additive-extraction.js +478 -0
  142. package/runtime/dist/src/memory/voicemem-sdk/prompts/index.js +32 -0
  143. package/runtime/dist/src/memory/voicemem-sdk/prompts/update-memory.js +152 -0
  144. package/runtime/dist/src/memory/voicemem-sdk/providers.js +325 -0
  145. package/runtime/dist/src/memory/voicemem-sdk/ranking.js +65 -0
  146. package/runtime/dist/src/memory/voicemem-sdk/reaction.js +33 -0
  147. package/runtime/dist/src/memory/voicemem-sdk/realtime.js +215 -0
  148. package/runtime/dist/src/memory/voicemem-sdk/reply.js +68 -0
  149. package/runtime/dist/src/memory/voicemem-sdk/routing.js +209 -0
  150. package/runtime/dist/src/memory/voicemem-sdk/slots.js +61 -0
  151. package/runtime/dist/src/memory/voicemem-sdk/speaker-bindings.js +120 -0
  152. package/runtime/dist/src/memory/voicemem-sdk/speaker-profiles.js +327 -0
  153. package/runtime/dist/src/memory/voicemem-sdk/store.js +577 -0
  154. package/runtime/dist/src/memory/voicemem-sdk/stream.js +317 -0
  155. package/runtime/dist/src/memory/voicemem-sdk/subgraph.js +113 -0
  156. package/runtime/dist/src/memory/voicemem-sdk/summaries.js +56 -0
  157. package/runtime/dist/src/memory/voicemem-sdk/time.js +157 -0
  158. package/runtime/dist/src/memory/voicemem-sdk/types.js +2 -0
  159. package/runtime/dist/src/memory-ledger/store-client.js +235 -37
  160. package/runtime/dist/src/memory-ledger/store-worker.js +8 -5
  161. package/runtime/dist/src/memory-ledger/store.js +91 -1
  162. package/runtime/dist/src/memory-substrate/consolidation.js +23 -7
  163. package/runtime/dist/src/memory-substrate/diary.js +27 -0
  164. package/runtime/dist/src/memory-substrate/engine-outbox.js +107 -0
  165. package/runtime/dist/src/memory-substrate/explicit-memory.js +112 -0
  166. package/runtime/dist/src/memory-substrate/fact-fidelity.js +68 -0
  167. package/runtime/dist/src/memory-substrate/feishu-consent.js +41 -0
  168. package/runtime/dist/src/memory-substrate/file-authority.js +29 -6
  169. package/runtime/dist/src/memory-substrate/life-operations.js +35 -9
  170. package/runtime/dist/src/memory-substrate/markdown-repository.js +271 -65
  171. package/runtime/dist/src/memory-substrate/memory-documents.js +96 -0
  172. package/runtime/dist/src/memory-substrate/migration.js +2 -0
  173. package/runtime/dist/src/memory-substrate/purge.js +12 -2
  174. package/runtime/dist/src/memory-substrate/resource.js +514 -129
  175. package/runtime/dist/src/memory-substrate/retrieval.js +8 -5
  176. package/runtime/dist/src/memory-substrate/source-operations.js +9 -1
  177. package/runtime/dist/src/memory-substrate/source-processing.js +436 -40
  178. package/runtime/dist/src/memory-substrate/source-retrieval.js +28 -0
  179. package/runtime/dist/src/memory-substrate/source-state.js +8 -0
  180. package/runtime/dist/src/memory-substrate/space-source-input.js +90 -0
  181. package/runtime/dist/src/memory-substrate/store.js +125 -23
  182. package/runtime/dist/src/model/goal-checkin-writer.js +72 -0
  183. package/runtime/dist/src/model/goal-writer.js +80 -0
  184. package/runtime/dist/src/model/jev-client.js +24 -13
  185. package/runtime/dist/src/model/model-adapters.js +2 -3
  186. package/runtime/dist/src/model/model-catalog.js +80 -0
  187. package/runtime/dist/src/model/model-gateway.js +47 -18
  188. package/runtime/dist/src/model/model-purpose.js +3 -4
  189. package/runtime/dist/src/model/personal-writer.js +536 -44
  190. package/runtime/dist/src/model/proactivity.js +50 -6
  191. package/runtime/dist/src/model/responses-model-gateway.js +59 -0
  192. package/runtime/dist/src/model/task-verifier.js +3 -3
  193. package/runtime/dist/src/model/timeline-anchors.js +77 -0
  194. package/runtime/dist/src/model/timeline-perspective.js +13 -0
  195. package/runtime/dist/src/model/timeline-selection.js +182 -0
  196. package/runtime/dist/src/model/understanding-writer.js +27 -0
  197. package/runtime/dist/src/model/vision-capability.js +3 -1
  198. package/runtime/dist/src/model/workbench-writer.js +96 -0
  199. package/runtime/dist/src/news/feeds.js +6 -10
  200. package/runtime/dist/src/news/interests.js +23 -0
  201. package/runtime/dist/src/news/service.js +87 -31
  202. package/runtime/dist/src/news/sources.json +116 -0
  203. package/runtime/dist/src/notifications/adapters/space-relay.js +4 -0
  204. package/runtime/dist/src/notifications/content.js +41 -0
  205. package/runtime/dist/src/notifications/contracts.js +4 -2
  206. package/runtime/dist/src/notifications/feed.js +6 -2
  207. package/runtime/dist/src/notifications/service.js +27 -14
  208. package/runtime/dist/src/notifications/store.js +3 -1
  209. package/runtime/dist/src/personal-agent/app-context.js +39 -4
  210. package/runtime/dist/src/personal-agent/chat-failure.js +37 -0
  211. package/runtime/dist/src/personal-agent/computer-use/contract.js +42 -0
  212. package/runtime/dist/src/personal-agent/computer-use/session.js +280 -0
  213. package/runtime/dist/src/personal-agent/computer-use/skill.js +18 -0
  214. package/runtime/dist/src/personal-agent/computer-use/tools.js +15 -0
  215. package/runtime/dist/src/personal-agent/context-candidates.js +9 -13
  216. package/runtime/dist/src/personal-agent/context-dependencies.js +28 -0
  217. package/runtime/dist/src/personal-agent/contracts.js +24 -4
  218. package/runtime/dist/src/personal-agent/conversation-runtime.js +440 -42
  219. package/runtime/dist/src/personal-agent/conversation-tool-bridge.js +97 -0
  220. package/runtime/dist/src/personal-agent/conversation-tool-policy.js +22 -0
  221. package/runtime/dist/src/personal-agent/conversations.js +71 -15
  222. package/runtime/dist/src/personal-agent/daily-brief.js +5 -0
  223. package/runtime/dist/src/personal-agent/daily-workbench.js +558 -0
  224. package/runtime/dist/src/personal-agent/discovery-window.js +36 -0
  225. package/runtime/dist/src/personal-agent/goal-checkin.js +53 -0
  226. package/runtime/dist/src/personal-agent/host.js +2379 -223
  227. package/runtime/dist/src/personal-agent/identity-context.js +33 -0
  228. package/runtime/dist/src/personal-agent/life.js +129 -11
  229. package/runtime/dist/src/personal-agent/local-shell.js +181 -0
  230. package/runtime/dist/src/personal-agent/local-tools.js +234 -0
  231. package/runtime/dist/src/personal-agent/preferred-name-sync.js +35 -0
  232. package/runtime/dist/src/personal-agent/profile-warmup.js +100 -39
  233. package/runtime/dist/src/personal-agent/project-digests.js +7 -3
  234. package/runtime/dist/src/personal-agent/project-history.js +36 -0
  235. package/runtime/dist/src/personal-agent/reading-copies.js +183 -0
  236. package/runtime/dist/src/personal-agent/scheduled-tasks.js +50 -13
  237. package/runtime/dist/src/personal-agent/scheduled-tool-runtime.js +26 -10
  238. package/runtime/dist/src/personal-agent/source-processing-agent.js +239 -17
  239. package/runtime/dist/src/personal-agent/sources.js +9 -1
  240. package/runtime/dist/src/personal-agent/store.js +124 -14
  241. package/runtime/dist/src/personal-agent/task-loop.js +3 -0
  242. package/runtime/dist/src/personal-agent/tasks.js +16 -4
  243. package/runtime/dist/src/personal-agent/timeline-brief.js +462 -0
  244. package/runtime/dist/src/personal-agent/timeline-cache.js +191 -0
  245. package/runtime/dist/src/personal-agent/timeline-cluster.js +30 -0
  246. package/runtime/dist/src/personal-agent/timeline-inputs.js +47 -0
  247. package/runtime/dist/src/personal-agent/timeline-time.js +60 -0
  248. package/runtime/dist/src/personal-agent/understanding-products.js +49 -0
  249. package/runtime/dist/src/personal-agent/understanding.js +7 -22
  250. package/runtime/dist/src/personal-agent/workbench-context.js +17 -21
  251. package/runtime/dist/src/personal-agent/workbench-copy.js +124 -0
  252. package/runtime/dist/src/personal-agent/workbench-evidence.js +77 -0
  253. package/runtime/dist/src/personal-agent/workbench-instructions.js +21 -0
  254. package/runtime/dist/src/personal-agent/workbench-runtime.js +1006 -0
  255. package/runtime/dist/src/personal-agent/workbench-shell-class.js +304 -0
  256. package/runtime/dist/src/personal-agent/workbench-store.js +292 -0
  257. package/runtime/dist/src/personal-agent/workbench-temporal.js +66 -0
  258. package/runtime/dist/src/projects/project-native-resource.js +10 -8
  259. package/runtime/dist/src/projects/project-store.js +36 -4
  260. package/runtime/dist/src/realtime/bridge.js +77 -8
  261. package/runtime/dist/src/realtime/capabilities.js +19 -0
  262. package/runtime/dist/src/realtime/cascaded/adapter.js +180 -40
  263. package/runtime/dist/src/realtime/cascaded/ark-llm.js +150 -24
  264. package/runtime/dist/src/realtime/cascaded/chat-completions-llm.js +243 -83
  265. package/runtime/dist/src/realtime/cascaded/llm-stream-limits.js +18 -0
  266. package/runtime/dist/src/realtime/cascaded/llm.js +96 -0
  267. package/runtime/dist/src/realtime/cascaded/openai-compatible-speech.js +251 -0
  268. package/runtime/dist/src/realtime/cascaded/provider.js +8 -0
  269. package/runtime/dist/src/realtime/evidence.js +1 -1
  270. package/runtime/dist/src/realtime/frontend-instructions.js +76 -55
  271. package/runtime/dist/src/realtime/gemini.js +14 -3
  272. package/runtime/dist/src/realtime/host-delivery.js +37 -4
  273. package/runtime/dist/src/realtime/protocol.js +18 -3
  274. package/runtime/dist/src/realtime/provider-projection.js +4 -1
  275. package/runtime/dist/src/realtime/provider-session.js +73 -16
  276. package/runtime/dist/src/realtime/qwen-transport.js +35 -4
  277. package/runtime/dist/src/realtime/qwen.js +144 -9
  278. package/runtime/dist/src/realtime/service-state.js +0 -1
  279. package/runtime/dist/src/realtime/service.js +93 -7
  280. package/runtime/dist/src/realtime/session.js +39 -32
  281. package/runtime/dist/src/realtime/sglang-native.js +214 -0
  282. package/runtime/dist/src/realtime/system-prompts.en.js +14 -2
  283. package/runtime/dist/src/realtime/telemetry.js +6 -3
  284. package/runtime/dist/src/realtime/tool-continuations.js +84 -7
  285. package/runtime/dist/src/realtime/transport.js +17 -0
  286. package/runtime/dist/src/realtime/usage.js +33 -17
  287. package/runtime/dist/src/realtime/volcengine/ark.js +40 -15
  288. package/runtime/dist/src/realtime/volcengine/asr.js +2 -1
  289. package/runtime/dist/src/realtime/volcengine/silence-endpointing.js +1 -7
  290. package/runtime/dist/src/realtime/volcengine/tts.js +2 -1
  291. package/runtime/dist/src/server/aoq-chat-server.js +1 -1
  292. package/runtime/dist/src/server/client-server.js +21 -0
  293. package/runtime/dist/src/server-entry.js +3 -0
  294. package/runtime/dist/src/space-host/admin-socket.js +115 -0
  295. package/runtime/dist/src/space-host/audio-owner.js +44 -0
  296. package/runtime/dist/src/space-host/cli.js +195 -0
  297. package/runtime/dist/src/space-host/config.js +247 -0
  298. package/runtime/dist/src/space-host/context-input.js +12 -0
  299. package/runtime/dist/src/space-host/contracts.js +10 -0
  300. package/runtime/dist/src/space-host/host-admin.js +114 -0
  301. package/runtime/dist/src/space-host/key-delivery.js +28 -0
  302. package/runtime/dist/src/space-host/mobile-tools.js +9 -0
  303. package/runtime/dist/src/space-host/model-settings.js +213 -0
  304. package/runtime/dist/src/space-host/projection.js +37 -0
  305. package/runtime/dist/src/space-host/push.js +137 -0
  306. package/runtime/dist/src/space-host/relay-transport.js +55 -0
  307. package/runtime/dist/src/space-host/service.js +841 -0
  308. package/runtime/dist/src/space-host/voice-crypto.js +240 -0
  309. package/runtime/dist/src/space-host/voice.js +600 -0
  310. package/runtime/dist/src/space-host/windows-secret-key.js +82 -0
  311. package/runtime/dist/src/storage/private-database.js +7 -10
  312. package/runtime/dist/src/text/unicode-normalize.js +5 -1
  313. package/runtime/dist/src/understanding/candidates.js +8 -10
  314. package/runtime/dist/src/understanding/fixture.js +1 -1
  315. package/runtime/dist/src/understanding/pipeline.js +4 -4
  316. package/runtime/dist/src/usage/context.js +23 -0
  317. package/runtime/dist/src/usage/index.js +4 -0
  318. package/runtime/dist/src/usage/ledger-worker.js +90 -0
  319. package/runtime/dist/src/usage/ledger.js +74 -0
  320. package/runtime/dist/src/usage/model-call.js +63 -0
  321. package/runtime/dist/src/usage/pricing.js +68 -0
  322. package/runtime/dist/src/usage/summary.js +69 -0
  323. package/runtime/dist/src/voicemem/store-client.js +104 -21
  324. package/runtime/dist/src/voicemem/store-worker.js +5 -8
  325. package/runtime/dist/src/voicemem/versioned-memory.js +1 -1
  326. package/src/command.mjs +8 -1
  327. package/runtime/dist/src/executors/autoglm.js +0 -376
@@ -0,0 +1,14 @@
1
+ /** Accept plain JSON or one complete JSON fence; never scrape JSON out of prose. */
2
+ export function parseModelJson(raw) {
3
+ if (raw.length > 128_000)
4
+ throw new Error('Model JSON exceeds limit');
5
+ const text = raw.trim();
6
+ const fence = /^```(?:json)?\s*\r?\n([\s\S]*?)\r?\n```$/u.exec(text);
7
+ try {
8
+ return JSON.parse(fence?.[1] ?? text);
9
+ }
10
+ catch {
11
+ throw new Error('Invalid model JSON');
12
+ }
13
+ }
14
+ //# sourceMappingURL=model-json.js.map
@@ -0,0 +1,209 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ const REQUIRED_COLUMNS = ['persona_id', 'question_id', 'question_type', 'topic', 'user_question_or_message', 'correct_answer', 'all_options', 'shared_context_id', 'end_index_in_shared_context'];
5
+ const ROLES = new Set(['system', 'user', 'assistant']);
6
+ function record(value) { return typeof value === 'object' && value !== null && !Array.isArray(value); }
7
+ /** Strict RFC 4180 fields, including embedded commas, escaped quotes, and quoted newlines. */
8
+ function parseCsv(source) {
9
+ const rows = [];
10
+ let row = [];
11
+ let field = '';
12
+ let mode = 'field';
13
+ const endRow = () => { row.push(field); rows.push(row); row = []; field = ''; mode = 'field'; };
14
+ for (let index = 0; index < source.length; index++) {
15
+ const char = source[index];
16
+ if (mode === 'quoted') {
17
+ if (char === '"') {
18
+ if (source[index + 1] === '"') {
19
+ field += '"';
20
+ index++;
21
+ }
22
+ else
23
+ mode = 'afterQuote';
24
+ }
25
+ else
26
+ field += char;
27
+ continue;
28
+ }
29
+ if (mode === 'afterQuote') {
30
+ if (char === ',') {
31
+ row.push(field);
32
+ field = '';
33
+ mode = 'field';
34
+ }
35
+ else if (char === '\n')
36
+ endRow();
37
+ else if (char === '\r') {
38
+ if (source[index + 1] === '\n')
39
+ index++;
40
+ endRow();
41
+ }
42
+ else
43
+ throw new Error('CSV has data after a closing quote');
44
+ continue;
45
+ }
46
+ if (char === ',') {
47
+ row.push(field);
48
+ field = '';
49
+ }
50
+ else if (char === '\n')
51
+ endRow();
52
+ else if (char === '\r') {
53
+ if (source[index + 1] === '\n')
54
+ index++;
55
+ endRow();
56
+ }
57
+ else if (char === '"') {
58
+ if (field)
59
+ throw new Error('CSV quote must begin a field');
60
+ mode = 'quoted';
61
+ }
62
+ else
63
+ field += char;
64
+ }
65
+ if (mode === 'quoted')
66
+ throw new Error('CSV has an unterminated quoted field');
67
+ if (row.length || field || mode === 'afterQuote') {
68
+ row.push(field);
69
+ rows.push(row);
70
+ }
71
+ return rows;
72
+ }
73
+ function text(value, field, row) {
74
+ if (value === undefined || !value.trim())
75
+ throw new Error(`PersonaMem row ${row} has no ${field}`);
76
+ return value;
77
+ }
78
+ function parseContexts(source) {
79
+ const contexts = [];
80
+ const known = new Set();
81
+ for (const [index, raw] of source.split('\n').entries()) {
82
+ const line = raw.endsWith('\r') ? raw.slice(0, -1) : raw;
83
+ if (!line.trim())
84
+ continue;
85
+ let parsed;
86
+ try {
87
+ parsed = JSON.parse(line);
88
+ }
89
+ catch {
90
+ throw new Error(`PersonaMem context JSONL line ${index + 1} is invalid`);
91
+ }
92
+ if (!record(parsed))
93
+ throw new Error(`PersonaMem context JSONL line ${index + 1} must be an object`);
94
+ const entries = Object.entries(parsed);
95
+ if (entries.length !== 1)
96
+ throw new Error(`PersonaMem context JSONL line ${index + 1} must contain one context`);
97
+ const [id, rawMessages] = entries[0];
98
+ if (!id.trim())
99
+ throw new Error(`PersonaMem context JSONL line ${index + 1} has no context ID`);
100
+ if (known.has(id))
101
+ throw new Error(`Duplicate PersonaMem context ID ${id}`);
102
+ if (!Array.isArray(rawMessages))
103
+ throw new Error(`PersonaMem context ${id} must be an array`);
104
+ const messages = rawMessages.map((rawMessage, order) => {
105
+ if (!record(rawMessage) || !ROLES.has(rawMessage.role) || typeof rawMessage.content !== 'string')
106
+ throw new Error(`PersonaMem context ${id} message ${order} has invalid role or content`);
107
+ return { role: rawMessage.role, content: rawMessage.content, order };
108
+ });
109
+ known.add(id);
110
+ contexts.push({ id, messages });
111
+ }
112
+ return contexts;
113
+ }
114
+ function cutoff(value, length, row) {
115
+ if (!/^(?:0|[1-9][0-9]*)$/u.test(value))
116
+ throw new Error(`PersonaMem row ${row} has invalid exclusive cutoff`);
117
+ const parsed = Number(value);
118
+ if (!Number.isSafeInteger(parsed) || parsed < 0 || parsed > length)
119
+ throw new Error(`PersonaMem row ${row} has cutoff outside its context`);
120
+ return parsed;
121
+ }
122
+ export function parsePersonaMem(questionsCsv, contextsJsonl) {
123
+ const rows = parseCsv(questionsCsv);
124
+ const header = rows.shift();
125
+ if (!header?.length)
126
+ throw new Error('PersonaMem questions CSV has no header');
127
+ header[0] = header[0].replace(/^\uFEFF/u, '');
128
+ if (new Set(header).size !== header.length)
129
+ throw new Error('PersonaMem questions CSV has duplicate columns');
130
+ for (const column of REQUIRED_COLUMNS)
131
+ if (!header.includes(column))
132
+ throw new Error(`PersonaMem questions CSV is missing ${column}`);
133
+ const contexts = parseContexts(contextsJsonl);
134
+ const byId = new Map(contexts.map(context => [context.id, context]));
135
+ const questions = [];
136
+ const questionIds = new Set();
137
+ for (const [index, values] of rows.entries()) {
138
+ const row = index + 2;
139
+ if (values.length !== header.length)
140
+ throw new Error(`PersonaMem row ${row} has ${values.length} columns; expected ${header.length}`);
141
+ const fields = Object.fromEntries(header.map((name, column) => [name, values[column]]));
142
+ const contextId = text(fields.shared_context_id, 'shared_context_id', row);
143
+ const context = byId.get(contextId);
144
+ if (!context)
145
+ throw new Error(`PersonaMem row ${row} references missing context ${contextId}`);
146
+ const id = text(fields.question_id, 'question_id', row);
147
+ if (questionIds.has(id))
148
+ throw new Error(`Duplicate PersonaMem question ID ${id}`);
149
+ const gold = text(fields.correct_answer, 'correct_answer', row).trim();
150
+ if (!/^\([a-d]\)$/u.test(gold))
151
+ throw new Error(`PersonaMem row ${row} has invalid gold label`);
152
+ questionIds.add(id);
153
+ questions.push({
154
+ personaId: text(fields.persona_id, 'persona_id', row), id,
155
+ questionType: fields.question_type ?? '', topic: fields.topic ?? '', text: text(fields.user_question_or_message, 'user_question_or_message', row),
156
+ goldLabel: gold, allOptions: text(fields.all_options, 'all_options', row), contextId,
157
+ cutoff: cutoff(text(fields.end_index_in_shared_context, 'end_index_in_shared_context', row), context.messages.length, row),
158
+ });
159
+ }
160
+ const groups = new Map();
161
+ for (const question of questions) {
162
+ const key = JSON.stringify([question.contextId, question.cutoff]);
163
+ let group = groups.get(key);
164
+ if (!group) {
165
+ group = { context: byId.get(question.contextId), cutoff: question.cutoff, questions: [] };
166
+ groups.set(key, group);
167
+ }
168
+ group.questions.push(question);
169
+ }
170
+ return {
171
+ contexts, questions,
172
+ groups: [...groups.values()].map(group => ({ contextId: group.context.id, cutoff: group.cutoff, messages: group.context.messages.slice(0, group.cutoff), questions: group.questions })),
173
+ };
174
+ }
175
+ async function inspect() {
176
+ const args = process.argv.slice(2);
177
+ let questionsPath;
178
+ let contextsPath;
179
+ let inspectOnly = false;
180
+ for (let index = 0; index < args.length; index++) {
181
+ const arg = args[index];
182
+ if (arg === '--inspect')
183
+ inspectOnly = true;
184
+ else if (arg === '--questions' || arg === '--contexts') {
185
+ const value = args[++index];
186
+ if (!value)
187
+ throw new Error(`Missing path after ${arg}`);
188
+ if (arg === '--questions')
189
+ questionsPath = value;
190
+ else
191
+ contextsPath = value;
192
+ }
193
+ else
194
+ throw new Error(`Unknown argument ${arg}`);
195
+ }
196
+ if (!inspectOnly || !questionsPath || !contextsPath)
197
+ throw new Error('Usage: personamem --questions PATH --contexts PATH --inspect');
198
+ const dataset = parsePersonaMem(await readFile(questionsPath, 'utf8'), await readFile(contextsPath, 'utf8'));
199
+ const roles = { system: 0, user: 0, assistant: 0 };
200
+ for (const context of dataset.contexts)
201
+ for (const message of context.messages)
202
+ roles[message.role]++;
203
+ const cutoffs = dataset.groups.map(group => group.cutoff);
204
+ const cutoff = cutoffs.length ? { min: Math.min(...cutoffs), max: Math.max(...cutoffs) } : null;
205
+ console.log(JSON.stringify({ questions: dataset.questions.length, contexts: dataset.contexts.length, groups: dataset.groups.length, personas: new Set(dataset.questions.map(question => question.personaId)).size, roles, cutoff }));
206
+ }
207
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url))
208
+ void inspect().catch(error => { console.error(error instanceof Error ? error.message : String(error)); process.exitCode = 1; });
209
+ //# sourceMappingURL=personamem.js.map
@@ -0,0 +1,215 @@
1
+ // Generated by scripts/port-prompts.py from upstream VoiceMem a450911. Do not edit by hand.
2
+ /** extract_facts_openai.py: appended to the additive system prompt in this order. */
3
+ export const LANGUAGE_RULE = `
4
+
5
+ # LANGUAGE
6
+
7
+ Write each memory in the SAME language the user spoke it in. A Chinese utterance
8
+ becomes a Chinese memory, an English one an English memory. Never translate.
9
+
10
+ Retrieval is embedding-based: a Chinese question and an English memory about the
11
+ same thing are far apart in vector space, so a translated memory quietly becomes
12
+ unfindable. Keep proper nouns and product names as the user said them.
13
+ `;
14
+ export const ATTRIBUTE_ADDENDUM = `
15
+
16
+ # ADDITIONAL FIELD: attribute
17
+
18
+ For each memory object, ALSO output an "attribute" field (string):
19
+ - If the memory states a fact of the form "<subject>'s <attribute> is <value>" (a preference, status, or personal detail that could later change), set "attribute" to "<subject>'s <attribute>" WITHOUT the value. Examples:
20
+ - "User's favorite restaurant is Sushi Zen" -> "attribute": "User's favorite restaurant"
21
+ - "User works as a data analyst at Grab" -> "attribute": "User's job"
22
+ - "User lives in Clementi" -> "attribute": "User's residence"
23
+ - "User's sister Jiahui is in her final year of high school" -> "attribute": "Jiahui's school year"
24
+ - If the memory is an event, experience, or one-off narrative ("User went hiking last Sunday", "User had a fight with a coworker"), set "attribute" to "".
25
+ - Keep the subject name explicit ("User" for the account owner, the person's name otherwise). Keep it short (2-6 words). Write it in English regardless of the memory language.
26
+ `;
27
+ export const VOICE_ADDENDUM = `
28
+
29
+ # VOICE CONTEXT: what is NOT worth remembering
30
+
31
+ These transcripts come from live speech, so much of what is said is about the
32
+ conversation itself rather than about the user. Do NOT extract:
33
+ - Audibility and connection checks from either side ("can you hear me?", "能听到吗",
34
+ "在吗"), and the replies confirming audibility.
35
+ - Identity probes that carry no new information ("do you know who I am?",
36
+ "你记得我叫什么吗"). If the user actually states their name, extract the name —
37
+ but never the question itself.
38
+ - Remarks about the exchange rather than the user's life ("why aren't you replying",
39
+ "别打断我", "你回复得好快", "在跑吗").
40
+ - Fragments the ASR clearly garbled: isolated syllables, filler, or text with no
41
+ recoverable meaning ("lolo", "嗯那个", "呃", "清华分对").
42
+ - Anything whose only content is that something was said or asked. Never write a
43
+ memory of the form "User asked X" or "Assistant said X" unless X itself is a fact
44
+ about the user's world.
45
+ - The user's request for this turn. "User wants dinner suggestions", "User asked for
46
+ restaurant recommendations" — wanting something right now is not a lasting fact.
47
+ A standing preference is ("User only drinks pour-over coffee"); a one-off ask is not.
48
+ - Never write "Speaker 0" (or any "Speaker N") into a memory as if it were a name —
49
+ it means the voice has not been matched to a known person yet. In that case say
50
+ "用户" / "the user" instead, and do not assume they are anyone named elsewhere
51
+ in the conversation.
52
+ When the message DOES carry a real name ("Jiaqi: 我搬去杭州了"), keep that name as
53
+ the subject. Rewriting a named speaker to "用户" makes the memory unfindable by
54
+ questions that use the name ("Jiaqi 搬到哪个城市了?").
55
+ - The assistant's own answer: suggestions it made, options it listed, information it
56
+ looked up. Those are the assistant's output, not facts about the user. Extract from
57
+ an assistant turn only when the user CONFIRMED something about themselves in it.
58
+
59
+ These two are the most damaging kind of junk: they are worded like the current
60
+ conversation, so they score high on the very next query and push the real memories
61
+ out of top-k — the allergy stops being retrieved right when it matters.
62
+
63
+ The test: would this still be useful to know a week from now, in a different
64
+ conversation? If not, do not extract it. Extracting nothing from a turn is a valid
65
+ and common outcome — an empty result is better than a worthless memory.
66
+
67
+ `;
68
+ /** extract_facts_openai.py: appended to the mem0 update prompt for the conflict resolver. */
69
+ export const MULTI_PERSON_RULE = `
70
+
71
+ IMPORTANT — multi-person household rule (in addition to the rules above):
72
+ Memories in this system can be about DIFFERENT named people living in the same household (e.g. "Nancy's preferred charity is X" vs "Jennifer's preferred charity is Y" are about two different people, not the same fact).
73
+ Before choosing UPDATE or DELETE for any existing memory, check whether the named subject/person in the new fact is the SAME as the named subject/person in that existing memory:
74
+ - If the subjects are different named people, you MUST NOT use UPDATE or DELETE on that memory, even if the topic/category is identical — treat the new fact as ADD instead.
75
+ - Only use UPDATE/DELETE when the existing memory is unambiguously about the SAME person as the new fact (same name, or both clearly refer to the generic account owner "User").
76
+ - If a fact's subject is ambiguous or not named, prefer ADD over UPDATE — a duplicate is far cheaper to have than silently overwriting a different person's information.
77
+ `;
78
+ export const SINGLE_VALUED_RULE = `
79
+ IMPORTANT — single-valued attribute rule (in addition to the rules above):
80
+ Some facts describe a SINGLE-VALUED attribute of a person: something that has exactly one current value and gets replaced when it changes — favorite X (favorite food/restaurant/color/team/song...), current job/employer/role, residence/address, age, phone number, relationship status, current school/grade, the ONE pet's name, the date of a specific planned event.
81
+ - If a new fact and an existing memory are about the SAME person and the SAME single-valued attribute but state DIFFERENT values, the new fact SUPERSEDES the old one: choose UPDATE with the new value. This applies even when the new fact contains NO negation or explicit reference to the old value ("User's favorite restaurant is B" simply replaces "User's favorite restaurant is A"). The most recent statement wins.
82
+ - MULTI-VALUED attributes (hobbies, friends, foods the person likes in general, places visited, skills, allergies) accumulate: a new value is ADD, not UPDATE, unless it directly contradicts an existing one.
83
+ - Events, experiences, and one-off narratives ("went hiking on Sunday", "had dinner with Mom") are NEVER merged into unrelated preference memories and never replace each other: always ADD. Do not fold specific details of one event into another memory.
84
+ `;
85
+ export const OMIT_NONE_RULE = `
86
+
87
+ IMPORTANT — output size:
88
+ Return ONLY the memories whose event is ADD, UPDATE or DELETE.
89
+ OMIT every memory you would mark NONE — anything absent from your
90
+ output is treated as NONE. Most turns change nothing, so {"memory": []} is a normal and correct answer.`;
91
+ /** mem0_additive_prompt_build.py: the use_input_language block of the user message. */
92
+ export const LANGUAGE_REQUIREMENT = `## Language Requirement
93
+ CRITICAL: Respond in the SAME LANGUAGE and SCRIPT as the input messages.
94
+ 1. Match the language of the user's messages exactly — if they write in Korean, extract in Korean; Japanese in Japanese; etc.
95
+ 2. Preserve the exact script/alphabet of the input.
96
+ 3. Do NOT translate or transliterate into English unless the input is already in English.
97
+ 4. Maintain all quality standards (contextual richness, temporal grounding, etc.) regardless of language.
98
+ 5. Technical terms, proper nouns, and brand names should be preserved in their original form as used in the input.
99
+ 6. If the input mixes languages (e.g., Hinglish), preserve both the mixed language style AND the script.
100
+ 7. For Japanese: explicitly resolve omitted subjects using conversation context.
101
+ 8. For CJK languages: maintain appropriate formality level from the source text.`;
102
+ /** merged_extraction.py: Python str.format template; see mergedAddendum(). */
103
+ export const MERGED_ADDENDUM_TEMPLATE = `
104
+
105
+ Additionally, for EACH item in "memory", include these three fields:
106
+ - "slot": one of [{slots}]
107
+ - "entities": [{{"name": "...", "entity_type": "user|person|project|task|knowledge|preference|place|routine|asset|organization|event", "role": "subject|object|context|owner"}}]
108
+ - "relations": [{{"from": "...", "to": "...", "relation_type": "...", "confidence": 0.9}}]
109
+ Relation direction must match reality: a boss manages the user, not the reverse.
110
+
111
+ And add ONE top-level field "traits": subjective things this utterance reveals about
112
+ the speaker. Each item {{"slot": "...", "label": "<5-15 chars>"}}, slot is one of:
113
+
114
+ {traits_body}
115
+
116
+ Outside that case, only include a category the utterance clearly shows —
117
+ for a one-off event or a plain question, "traits": [] is the right answer.
118
+
119
+ Each label becomes the TITLE of a node on a graph, so write it as a short
120
+ pattern — roughly 5-15 characters (or 3-8 words), no subject, no full stop.
121
+
122
+ {label_rule}
123
+
124
+ Copy the SHAPE of these, never the wording:
125
+ {label_examples}
126
+
127
+ Also add ONE top-level field "emotion": how the speaker feels, as a SINGLE
128
+ word, in the speaker's own language (中文:愉悦/开心/平静/焦虑/难过/委屈/愤怒/
129
+ 惊讶/疲惫/失望…; English: glad/calm/anxious/sad/wronged/angry/tired/…).
130
+ **Judge from what they actually say.** "我喜欢草莓" is 愉悦, not 悲伤;
131
+ "我好生气啊" is 愤怒, not 焦虑. If the utterance carries no clear feeling
132
+ (a plain fact, a question), return "" — an empty string is the right answer
133
+ far more often than a guess. A wrong label is worse than none: it gets shown
134
+ to the user as 【label】 next to their own words.
135
+
136
+ Never invent entities, traits or feelings that are not in the text.
137
+
138
+ Keep one-off requests OUT of "memory": asking for a recommendation, asking what
139
+ you remember about them, asking you to do something right now. When the same
140
+ sentence ALSO states a lasting fact, write only the lasting half — never both in
141
+ one item. "我下周要考GRE,你有什么书推荐吗" gives exactly one memory,
142
+ 「用户下周要参加GRE考试」, and nothing about the book request.
143
+
144
+ OUTPUT SHAPE — your JSON object must have EXACTLY these three top-level keys:
145
+ {{"memory": [...], "emotion": "...", "traits": [...]}}
146
+ The prompt above describes only the "memory" key. "emotion" and "traits" are
147
+ REQUIRED as well; omitting them is an error. Use "" and [] when there is nothing.
148
+
149
+ ════════════════════════════════════════════════════════════════════════
150
+ LANGUAGE — this overrides every example above.
151
+ {label_rule}
152
+ It applies to EVERY string you output: the "memory" texts, every trait
153
+ "label", and "emotion". The only exception is "slot", which is an internal
154
+ key and must stay exactly as listed (情绪 / 应对方式 / 表达风格 / 思维模式 /
155
+ 喜好与厌恶). If the speaker wrote in English, every one of those strings must
156
+ be English — copying the Chinese wording from the examples is a mistake.
157
+ ════════════════════════════════════════════════════════════════════════`;
158
+ export const TRAITS_BODY = { zh: ` 情绪 WHEN they feel WHAT — the situation plus the feeling it triggers.
159
+ "评审前会紧张", "被打断就烦", "项目延期会焦虑"
160
+ 应对方式 what they DO about a feeling, or how they want to be treated.
161
+ "压力大时想被安抚", "难受时想一个人待着"
162
+ 表达风格 habits of speaking and communicating
163
+ 思维模式 how they think, weigh things, decide
164
+ 喜好与厌恶 what they like or dislike
165
+
166
+ 情绪 vs 应对方式 is the one people get wrong: "被打断就烦" is 情绪 (a feeling
167
+ appearing), "被打断了就先走开" is 应对方式 (an action taken). If the label has no
168
+ verb of doing or wanting in it, it is 情绪.
169
+
170
+ For "情绪" the label must read as **a pattern, not a bare feeling word**:
171
+ "评审前会紧张", "被打断就烦", "一个人待着会踏实" — NOT "焦虑" / "开心".
172
+ It becomes the title of a node on a graph; a bare word tells the user nothing.
173
+
174
+ When the utterance states a RECURRING tendency about the speaker — "一…就…",
175
+ "每次…都…", "总是", "从来不", "我这人…", or any habit/reaction that clearly
176
+ holds beyond this one moment — a trait is REQUIRED. "我一开长会就走神" is
177
+ 喜好与厌恶「不喜欢开长会」; "我每次汇报前都睡不着" is 情绪「汇报前会睡不着」.
178
+ Do not skip it just because the same content also went into "memory": "memory"
179
+ records WHAT HAPPENED, "traits" records WHAT THIS PERSON IS LIKE, and one
180
+ sentence very often carries both.
181
+
182
+ `, en: ` 情绪 WHEN they feel WHAT — the situation plus the feeling it triggers.
183
+ "tense before design reviews", "annoyed when interrupted",
184
+ "anxious when a project slips"
185
+ 应对方式 what they DO about a feeling, or how they want to be treated.
186
+ "wants comfort under stress", "needs to be alone when upset"
187
+ 表达风格 habits of speaking and communicating
188
+ 思维模式 how they think, weigh things, decide
189
+ 喜好与厌恶 what they like or dislike
190
+
191
+ 情绪 vs 应对方式 is the one people get wrong: "annoyed when interrupted" is 情绪
192
+ (a feeling appearing), "walks away when interrupted" is 应对方式 (an action
193
+ taken). If the label has no verb of doing or wanting in it, it is 情绪.
194
+
195
+ For "情绪" the label must read as **a pattern, not a bare feeling word**:
196
+ "tense before design reviews", "annoyed when interrupted", "calm when alone"
197
+ — NOT "anxious" / "happy". It becomes the title of a node on a graph; a bare
198
+ word tells the user nothing.
199
+
200
+ When the utterance states a RECURRING tendency about the speaker — "every time
201
+ …", "always", "never", "I'm the kind of person who…", or any habit/reaction
202
+ that clearly holds beyond this one moment — a trait is REQUIRED. "I zone out in
203
+ long meetings" is 喜好与厌恶 "dislikes long meetings"; "I can't sleep before a
204
+ demo" is 情绪 "can't sleep before a demo".
205
+ Do not skip it just because the same content also went into "memory": "memory"
206
+ records WHAT HAPPENED, "traits" records WHAT THIS PERSON IS LIKE, and one
207
+ sentence very often carries both.
208
+
209
+ ` };
210
+ export const LABEL_EXAMPLES = { zh: ` 好:讨厌被打断 / 压力大时想被安抚 / 先要结论再要解释
211
+ 差:用户倾向于详细规划和结构化思考。(带主语的整句)
212
+ 差:我是计算机专业(照抄原话/事实)`, en: ` good: hates being interrupted / wants comfort under stress / conclusion first
213
+ bad: The user tends to plan in detail. (a full sentence with a subject)
214
+ bad: I major in computer science (copying the utterance / a plain fact)` };
215
+ //# sourceMappingURL=addenda.js.map