psytools 0.4.0 → 0.5.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 (216) hide show
  1. package/README.md +27 -4
  2. package/SOURCES.md +3 -1
  3. package/dist/cjs/errors.d.ts +1 -1
  4. package/dist/cjs/i18n.d.ts +21 -1
  5. package/dist/cjs/i18n.js +136 -0
  6. package/dist/cjs/index.d.ts +4 -2
  7. package/dist/cjs/index.js +19 -14
  8. package/dist/cjs/inventories/aq10.js +4 -64
  9. package/dist/cjs/inventories/asrs6.js +5 -49
  10. package/dist/cjs/inventories/audit.js +8 -116
  11. package/dist/cjs/inventories/common.js +0 -20
  12. package/dist/cjs/inventories/dass21.js +18 -130
  13. package/dist/cjs/inventories/gad7.js +4 -40
  14. package/dist/cjs/inventories/index.d.ts +11 -2
  15. package/dist/cjs/inventories/index.js +22 -3
  16. package/dist/cjs/inventories/mini-ipip.js +0 -132
  17. package/dist/cjs/inventories/phq9.js +5 -53
  18. package/dist/cjs/inventories/who5.js +4 -56
  19. package/dist/cjs/locales/de/aq10.d.ts +4 -0
  20. package/dist/cjs/locales/de/aq10.js +53 -0
  21. package/dist/cjs/locales/de/asrs6.d.ts +4 -0
  22. package/dist/cjs/locales/de/asrs6.js +42 -0
  23. package/dist/cjs/locales/de/audit.d.ts +4 -0
  24. package/dist/cjs/locales/de/audit.js +80 -0
  25. package/dist/cjs/locales/de/dass21.d.ts +4 -0
  26. package/dist/cjs/locales/de/dass21.js +114 -0
  27. package/dist/cjs/locales/de/gad7.d.ts +4 -0
  28. package/dist/cjs/locales/de/gad7.js +46 -0
  29. package/dist/cjs/locales/de/mini-ipip.d.ts +4 -0
  30. package/dist/cjs/locales/de/mini-ipip.js +97 -0
  31. package/dist/cjs/locales/de/phq9.d.ts +4 -0
  32. package/dist/cjs/locales/de/phq9.js +56 -0
  33. package/dist/cjs/locales/de/who5.d.ts +4 -0
  34. package/dist/cjs/locales/de/who5.js +41 -0
  35. package/dist/cjs/locales/es/aq10.d.ts +4 -0
  36. package/dist/cjs/locales/es/aq10.js +53 -0
  37. package/dist/cjs/locales/es/asrs6.d.ts +4 -0
  38. package/dist/cjs/locales/es/asrs6.js +42 -0
  39. package/dist/cjs/locales/es/audit.d.ts +4 -0
  40. package/dist/cjs/locales/es/audit.js +80 -0
  41. package/dist/cjs/locales/es/dass21.d.ts +4 -0
  42. package/dist/cjs/locales/es/dass21.js +114 -0
  43. package/dist/cjs/locales/es/gad7.d.ts +4 -0
  44. package/dist/cjs/locales/es/gad7.js +46 -0
  45. package/dist/cjs/locales/es/mini-ipip.d.ts +4 -0
  46. package/dist/cjs/locales/es/mini-ipip.js +97 -0
  47. package/dist/cjs/locales/es/phq9.d.ts +4 -0
  48. package/dist/cjs/locales/es/phq9.js +56 -0
  49. package/dist/cjs/locales/es/who5.d.ts +4 -0
  50. package/dist/cjs/locales/es/who5.js +41 -0
  51. package/dist/cjs/locales/index.d.ts +12 -0
  52. package/dist/cjs/locales/index.js +63 -0
  53. package/dist/cjs/locales/tr/aq10.d.ts +4 -0
  54. package/dist/cjs/locales/tr/aq10.js +53 -0
  55. package/dist/cjs/locales/tr/asrs6.d.ts +4 -0
  56. package/dist/cjs/locales/tr/asrs6.js +42 -0
  57. package/dist/cjs/locales/tr/audit.d.ts +4 -0
  58. package/dist/cjs/locales/tr/audit.js +80 -0
  59. package/dist/cjs/locales/tr/dass21.d.ts +4 -0
  60. package/dist/cjs/locales/tr/dass21.js +114 -0
  61. package/dist/cjs/locales/tr/gad7.d.ts +4 -0
  62. package/dist/cjs/locales/tr/gad7.js +46 -0
  63. package/dist/cjs/locales/tr/mini-ipip.d.ts +4 -0
  64. package/dist/cjs/locales/tr/mini-ipip.js +97 -0
  65. package/dist/cjs/locales/tr/phq9.d.ts +4 -0
  66. package/dist/cjs/locales/tr/phq9.js +56 -0
  67. package/dist/cjs/locales/tr/who5.d.ts +4 -0
  68. package/dist/cjs/locales/tr/who5.js +41 -0
  69. package/dist/cjs/locales/zh/aq10.d.ts +4 -0
  70. package/dist/cjs/locales/zh/aq10.js +53 -0
  71. package/dist/cjs/locales/zh/asrs6.d.ts +4 -0
  72. package/dist/cjs/locales/zh/asrs6.js +42 -0
  73. package/dist/cjs/locales/zh/audit.d.ts +4 -0
  74. package/dist/cjs/locales/zh/audit.js +80 -0
  75. package/dist/cjs/locales/zh/dass21.d.ts +4 -0
  76. package/dist/cjs/locales/zh/dass21.js +114 -0
  77. package/dist/cjs/locales/zh/gad7.d.ts +4 -0
  78. package/dist/cjs/locales/zh/gad7.js +46 -0
  79. package/dist/cjs/locales/zh/mini-ipip.d.ts +4 -0
  80. package/dist/cjs/locales/zh/mini-ipip.js +97 -0
  81. package/dist/cjs/locales/zh/phq9.d.ts +4 -0
  82. package/dist/cjs/locales/zh/phq9.js +56 -0
  83. package/dist/cjs/locales/zh/who5.d.ts +4 -0
  84. package/dist/cjs/locales/zh/who5.js +41 -0
  85. package/dist/cjs/types.d.ts +30 -0
  86. package/dist/esm/errors.d.ts +1 -1
  87. package/dist/esm/i18n.d.ts +21 -1
  88. package/dist/esm/i18n.js +134 -0
  89. package/dist/esm/index.d.ts +4 -2
  90. package/dist/esm/index.js +2 -1
  91. package/dist/esm/inventories/aq10.js +4 -64
  92. package/dist/esm/inventories/asrs6.js +5 -49
  93. package/dist/esm/inventories/audit.js +8 -116
  94. package/dist/esm/inventories/common.js +0 -20
  95. package/dist/esm/inventories/dass21.js +18 -130
  96. package/dist/esm/inventories/gad7.js +4 -40
  97. package/dist/esm/inventories/index.d.ts +11 -2
  98. package/dist/esm/inventories/index.js +22 -3
  99. package/dist/esm/inventories/mini-ipip.js +0 -132
  100. package/dist/esm/inventories/phq9.js +5 -53
  101. package/dist/esm/inventories/who5.js +4 -56
  102. package/dist/esm/locales/de/aq10.d.ts +4 -0
  103. package/dist/esm/locales/de/aq10.js +51 -0
  104. package/dist/esm/locales/de/asrs6.d.ts +4 -0
  105. package/dist/esm/locales/de/asrs6.js +40 -0
  106. package/dist/esm/locales/de/audit.d.ts +4 -0
  107. package/dist/esm/locales/de/audit.js +78 -0
  108. package/dist/esm/locales/de/dass21.d.ts +4 -0
  109. package/dist/esm/locales/de/dass21.js +112 -0
  110. package/dist/esm/locales/de/gad7.d.ts +4 -0
  111. package/dist/esm/locales/de/gad7.js +44 -0
  112. package/dist/esm/locales/de/mini-ipip.d.ts +4 -0
  113. package/dist/esm/locales/de/mini-ipip.js +95 -0
  114. package/dist/esm/locales/de/phq9.d.ts +4 -0
  115. package/dist/esm/locales/de/phq9.js +54 -0
  116. package/dist/esm/locales/de/who5.d.ts +4 -0
  117. package/dist/esm/locales/de/who5.js +39 -0
  118. package/dist/esm/locales/es/aq10.d.ts +4 -0
  119. package/dist/esm/locales/es/aq10.js +51 -0
  120. package/dist/esm/locales/es/asrs6.d.ts +4 -0
  121. package/dist/esm/locales/es/asrs6.js +40 -0
  122. package/dist/esm/locales/es/audit.d.ts +4 -0
  123. package/dist/esm/locales/es/audit.js +78 -0
  124. package/dist/esm/locales/es/dass21.d.ts +4 -0
  125. package/dist/esm/locales/es/dass21.js +112 -0
  126. package/dist/esm/locales/es/gad7.d.ts +4 -0
  127. package/dist/esm/locales/es/gad7.js +44 -0
  128. package/dist/esm/locales/es/mini-ipip.d.ts +4 -0
  129. package/dist/esm/locales/es/mini-ipip.js +95 -0
  130. package/dist/esm/locales/es/phq9.d.ts +4 -0
  131. package/dist/esm/locales/es/phq9.js +54 -0
  132. package/dist/esm/locales/es/who5.d.ts +4 -0
  133. package/dist/esm/locales/es/who5.js +39 -0
  134. package/dist/esm/locales/index.d.ts +12 -0
  135. package/dist/esm/locales/index.js +59 -0
  136. package/dist/esm/locales/tr/aq10.d.ts +4 -0
  137. package/dist/esm/locales/tr/aq10.js +51 -0
  138. package/dist/esm/locales/tr/asrs6.d.ts +4 -0
  139. package/dist/esm/locales/tr/asrs6.js +40 -0
  140. package/dist/esm/locales/tr/audit.d.ts +4 -0
  141. package/dist/esm/locales/tr/audit.js +78 -0
  142. package/dist/esm/locales/tr/dass21.d.ts +4 -0
  143. package/dist/esm/locales/tr/dass21.js +112 -0
  144. package/dist/esm/locales/tr/gad7.d.ts +4 -0
  145. package/dist/esm/locales/tr/gad7.js +44 -0
  146. package/dist/esm/locales/tr/mini-ipip.d.ts +4 -0
  147. package/dist/esm/locales/tr/mini-ipip.js +95 -0
  148. package/dist/esm/locales/tr/phq9.d.ts +4 -0
  149. package/dist/esm/locales/tr/phq9.js +54 -0
  150. package/dist/esm/locales/tr/who5.d.ts +4 -0
  151. package/dist/esm/locales/tr/who5.js +39 -0
  152. package/dist/esm/locales/zh/aq10.d.ts +4 -0
  153. package/dist/esm/locales/zh/aq10.js +51 -0
  154. package/dist/esm/locales/zh/asrs6.d.ts +4 -0
  155. package/dist/esm/locales/zh/asrs6.js +40 -0
  156. package/dist/esm/locales/zh/audit.d.ts +4 -0
  157. package/dist/esm/locales/zh/audit.js +78 -0
  158. package/dist/esm/locales/zh/dass21.d.ts +4 -0
  159. package/dist/esm/locales/zh/dass21.js +112 -0
  160. package/dist/esm/locales/zh/gad7.d.ts +4 -0
  161. package/dist/esm/locales/zh/gad7.js +44 -0
  162. package/dist/esm/locales/zh/mini-ipip.d.ts +4 -0
  163. package/dist/esm/locales/zh/mini-ipip.js +95 -0
  164. package/dist/esm/locales/zh/phq9.d.ts +4 -0
  165. package/dist/esm/locales/zh/phq9.js +54 -0
  166. package/dist/esm/locales/zh/who5.d.ts +4 -0
  167. package/dist/esm/locales/zh/who5.js +39 -0
  168. package/dist/esm/types.d.ts +30 -0
  169. package/package.json +21 -1
  170. package/src/errors.ts +1 -0
  171. package/src/i18n.ts +176 -1
  172. package/src/index.ts +4 -1
  173. package/src/inventories/aq10.ts +4 -64
  174. package/src/inventories/asrs6.ts +5 -49
  175. package/src/inventories/audit.ts +8 -116
  176. package/src/inventories/common.ts +0 -20
  177. package/src/inventories/dass21.ts +18 -130
  178. package/src/inventories/gad7.ts +4 -40
  179. package/src/inventories/index.ts +27 -3
  180. package/src/inventories/mini-ipip.ts +0 -132
  181. package/src/inventories/phq9.ts +5 -53
  182. package/src/inventories/who5.ts +4 -56
  183. package/src/locales/de/aq10.ts +54 -0
  184. package/src/locales/de/asrs6.ts +43 -0
  185. package/src/locales/de/audit.ts +81 -0
  186. package/src/locales/de/dass21.ts +115 -0
  187. package/src/locales/de/gad7.ts +47 -0
  188. package/src/locales/de/mini-ipip.ts +98 -0
  189. package/src/locales/de/phq9.ts +57 -0
  190. package/src/locales/de/who5.ts +42 -0
  191. package/src/locales/es/aq10.ts +54 -0
  192. package/src/locales/es/asrs6.ts +43 -0
  193. package/src/locales/es/audit.ts +81 -0
  194. package/src/locales/es/dass21.ts +115 -0
  195. package/src/locales/es/gad7.ts +47 -0
  196. package/src/locales/es/mini-ipip.ts +98 -0
  197. package/src/locales/es/phq9.ts +57 -0
  198. package/src/locales/es/who5.ts +42 -0
  199. package/src/locales/index.ts +64 -0
  200. package/src/locales/tr/aq10.ts +54 -0
  201. package/src/locales/tr/asrs6.ts +43 -0
  202. package/src/locales/tr/audit.ts +81 -0
  203. package/src/locales/tr/dass21.ts +115 -0
  204. package/src/locales/tr/gad7.ts +47 -0
  205. package/src/locales/tr/mini-ipip.ts +98 -0
  206. package/src/locales/tr/phq9.ts +57 -0
  207. package/src/locales/tr/who5.ts +42 -0
  208. package/src/locales/zh/aq10.ts +54 -0
  209. package/src/locales/zh/asrs6.ts +43 -0
  210. package/src/locales/zh/audit.ts +81 -0
  211. package/src/locales/zh/dass21.ts +115 -0
  212. package/src/locales/zh/gad7.ts +47 -0
  213. package/src/locales/zh/mini-ipip.ts +98 -0
  214. package/src/locales/zh/phq9.ts +57 -0
  215. package/src/locales/zh/who5.ts +42 -0
  216. package/src/types.ts +25 -0
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** Simplified Chinese locale pack for audit. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
4
+ const pack = {
5
+ "id": "audit",
6
+ "locale": "zh",
7
+ "title": "酒精使用障碍筛查量表(AUDIT)",
8
+ "description": "世界卫生组织开发的10项筛查工具,用于筛查危险和有害的饮酒行为以及可能的酒精依赖。",
9
+ "instructions": "请回答以下关于您在过去12个月内饮用含酒精饮料情况的问题。一杯指一杯标准饮酒量(例如一杯啤酒或葡萄酒,或一份烈酒)。",
10
+ "options": [
11
+ "从不",
12
+ "每月不到一次",
13
+ "每月一次",
14
+ "每周一次",
15
+ "每天或几乎每天"
16
+ ],
17
+ "questions": {
18
+ "audit-1": {
19
+ "text": "您多久喝一次含酒精的饮料?",
20
+ "options": [
21
+ "从不",
22
+ "每月一次或更少",
23
+ "每月2到4次",
24
+ "每周2到3次",
25
+ "每周4次或更多"
26
+ ]
27
+ },
28
+ "audit-2": {
29
+ "text": "在您饮酒的日子里,通常一天喝多少杯含酒精的饮料?",
30
+ "options": [
31
+ "1或2杯",
32
+ "3或4杯",
33
+ "5或6杯",
34
+ "7到9杯",
35
+ "10杯或更多"
36
+ ]
37
+ },
38
+ "audit-3": {
39
+ "text": "您多久有一次在同一场合喝下六杯或更多?"
40
+ },
41
+ "audit-4": {
42
+ "text": "在过去一年中,您多久有一次发现自己一旦开始喝酒就停不下来?"
43
+ },
44
+ "audit-5": {
45
+ "text": "在过去一年中,您多久有一次因为饮酒而未能完成通常应做的事情?"
46
+ },
47
+ "audit-6": {
48
+ "text": "在过去一年中,您多久有一次在大量饮酒后的早晨需要先喝一杯才能让自己振作起来?"
49
+ },
50
+ "audit-7": {
51
+ "text": "在过去一年中,您多久有一次在饮酒后感到内疚或后悔?"
52
+ },
53
+ "audit-8": {
54
+ "text": "在过去一年中,您多久有一次因为饮酒而想不起前一晚发生的事情?"
55
+ },
56
+ "audit-9": {
57
+ "text": "您或其他人是否曾因您饮酒而受伤?",
58
+ "options": [
59
+ "否",
60
+ "是,但不是在过去一年内",
61
+ "是,在过去一年内"
62
+ ]
63
+ },
64
+ "audit-10": {
65
+ "text": "是否有亲友、医生或其他医务人员对您的饮酒表示担忧,或建议您减少饮酒?",
66
+ "options": [
67
+ "否",
68
+ "是,但不是在过去一年内",
69
+ "是,在过去一年内"
70
+ ]
71
+ }
72
+ },
73
+ "bands": {
74
+ "zone-1": "一区:低风险——酒精健康教育",
75
+ "zone-2": "二区:危险饮酒——建议给予简单指导",
76
+ "zone-3": "三区:有害饮酒——简短咨询并持续监测",
77
+ "zone-4": "四区:可能存在依赖——转诊进行诊断评估"
78
+ }
79
+ };
80
+ exports.default = pack;
@@ -0,0 +1,4 @@
1
+ import type { InventoryLocalePack } from "../../types.ts";
2
+ /** Simplified Chinese locale pack for dass21. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
3
+ declare const pack: InventoryLocalePack;
4
+ export default pack;
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** Simplified Chinese locale pack for dass21. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
4
+ const pack = {
5
+ "id": "dass21",
6
+ "locale": "zh",
7
+ "title": "抑郁-焦虑-压力量表(DASS-21)",
8
+ "description": "一份包含21个条目的自评问卷,用于测量过去一周的抑郁、焦虑和压力水平。",
9
+ "instructions": "请阅读每一条陈述,并选择最能表明过去一周该陈述在多大程度上适用于您的选项。答案没有对错之分。请不要在任何一条陈述上花费太多时间。",
10
+ "options": [
11
+ "完全不适用于我",
12
+ "在某种程度上适用于我,或有时适用",
13
+ "在相当程度上适用于我,或大部分时间适用",
14
+ "非常适用于我,或绝大部分时间适用"
15
+ ],
16
+ "questions": {
17
+ "dass21-1": {
18
+ "text": "我发现自己很难平静下来"
19
+ },
20
+ "dass21-2": {
21
+ "text": "我注意到自己口干"
22
+ },
23
+ "dass21-3": {
24
+ "text": "我似乎完全无法体验到任何积极的感受"
25
+ },
26
+ "dass21-4": {
27
+ "text": "我感到呼吸困难(例如呼吸过快,或没有体力活动时也感到喘不过气)"
28
+ },
29
+ "dass21-5": {
30
+ "text": "我发现自己很难主动去做事情"
31
+ },
32
+ "dass21-6": {
33
+ "text": "我容易对事情反应过度"
34
+ },
35
+ "dass21-7": {
36
+ "text": "我出现过颤抖(例如手抖)"
37
+ },
38
+ "dass21-8": {
39
+ "text": "我觉得自己消耗了很多精神能量"
40
+ },
41
+ "dass21-9": {
42
+ "text": "我担心自己会在某些场合惊慌失措、出丑"
43
+ },
44
+ "dass21-10": {
45
+ "text": "我觉得自己没有什么可期待的"
46
+ },
47
+ "dass21-11": {
48
+ "text": "我发现自己变得焦躁不安"
49
+ },
50
+ "dass21-12": {
51
+ "text": "我发现自己很难放松"
52
+ },
53
+ "dass21-13": {
54
+ "text": "我感到情绪低落、忧郁"
55
+ },
56
+ "dass21-14": {
57
+ "text": "我无法容忍任何妨碍我继续做事的事情"
58
+ },
59
+ "dass21-15": {
60
+ "text": "我感到自己快要惊慌失措了"
61
+ },
62
+ "dass21-16": {
63
+ "text": "我对任何事情都提不起热情"
64
+ },
65
+ "dass21-17": {
66
+ "text": "我觉得自己作为一个人没有多大价值"
67
+ },
68
+ "dass21-18": {
69
+ "text": "我觉得自己相当敏感、易被触怒"
70
+ },
71
+ "dass21-19": {
72
+ "text": "在没有体力活动的情况下,我能察觉到自己的心跳(例如感到心率加快或心跳漏跳)"
73
+ },
74
+ "dass21-20": {
75
+ "text": "我无缘无故地感到害怕"
76
+ },
77
+ "dass21-21": {
78
+ "text": "我觉得生活毫无意义"
79
+ }
80
+ },
81
+ "subscales": {
82
+ "depression": {
83
+ "label": "抑郁",
84
+ "bands": {
85
+ "normal": "正常",
86
+ "mild": "轻度",
87
+ "moderate": "中度",
88
+ "severe": "重度",
89
+ "extremely-severe": "极重度"
90
+ }
91
+ },
92
+ "anxiety": {
93
+ "label": "焦虑",
94
+ "bands": {
95
+ "normal": "正常",
96
+ "mild": "轻度",
97
+ "moderate": "中度",
98
+ "severe": "重度",
99
+ "extremely-severe": "极重度"
100
+ }
101
+ },
102
+ "stress": {
103
+ "label": "压力",
104
+ "bands": {
105
+ "normal": "正常",
106
+ "mild": "轻度",
107
+ "moderate": "中度",
108
+ "severe": "重度",
109
+ "extremely-severe": "极重度"
110
+ }
111
+ }
112
+ }
113
+ };
114
+ exports.default = pack;
@@ -0,0 +1,4 @@
1
+ import type { InventoryLocalePack } from "../../types.ts";
2
+ /** Simplified Chinese locale pack for gad7. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
3
+ declare const pack: InventoryLocalePack;
4
+ export default pack;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** Simplified Chinese locale pack for gad7. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
4
+ const pack = {
5
+ "id": "gad7",
6
+ "locale": "zh",
7
+ "title": "广泛性焦虑障碍量表(GAD-7)",
8
+ "description": "一份包含7个条目的自评问卷,用于筛查广泛性焦虑并测量其严重程度。",
9
+ "instructions": "在过去的2周里,您被以下任何一个问题困扰的频率如何?",
10
+ "options": [
11
+ "完全没有",
12
+ "有几天",
13
+ "一半以上的天数",
14
+ "几乎每天"
15
+ ],
16
+ "questions": {
17
+ "gad7-1": {
18
+ "text": "感到紧张、焦虑或心情烦躁"
19
+ },
20
+ "gad7-2": {
21
+ "text": "无法停止或控制担忧"
22
+ },
23
+ "gad7-3": {
24
+ "text": "对各种各样的事情担忧过多"
25
+ },
26
+ "gad7-4": {
27
+ "text": "难以放松"
28
+ },
29
+ "gad7-5": {
30
+ "text": "坐立不安,难以安静地坐着"
31
+ },
32
+ "gad7-6": {
33
+ "text": "容易恼怒或易被激怒"
34
+ },
35
+ "gad7-7": {
36
+ "text": "感到害怕,好像会有可怕的事情发生"
37
+ }
38
+ },
39
+ "bands": {
40
+ "minimal": "极轻度焦虑",
41
+ "mild": "轻度焦虑",
42
+ "moderate": "中度焦虑",
43
+ "severe": "重度焦虑"
44
+ }
45
+ };
46
+ exports.default = pack;
@@ -0,0 +1,4 @@
1
+ import type { InventoryLocalePack } from "../../types.ts";
2
+ /** Simplified Chinese locale pack for mini-ipip. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
3
+ declare const pack: InventoryLocalePack;
4
+ export default pack;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** Simplified Chinese locale pack for mini-ipip. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
4
+ const pack = {
5
+ "id": "mini-ipip",
6
+ "locale": "zh",
7
+ "title": "Mini-IPIP 大五人格量表",
8
+ "description": "一个源自国际人格条目库(IPIP)的20项公共领域量表,用于测量大五人格特质(外向性、宜人性、尽责性、神经质、开放性)。",
9
+ "instructions": "请按照您现在通常的样子来描述自己,而不是您希望将来成为的样子。请指出每个陈述对您的描述有多准确。",
10
+ "options": [
11
+ "非常不符合",
12
+ "比较不符合",
13
+ "既非符合也非不符合",
14
+ "比较符合",
15
+ "非常符合"
16
+ ],
17
+ "questions": {
18
+ "mini-ipip-1": {
19
+ "text": "我是聚会中的活跃人物"
20
+ },
21
+ "mini-ipip-2": {
22
+ "text": "我能体会别人的感受"
23
+ },
24
+ "mini-ipip-3": {
25
+ "text": "我会立刻把日常事务做完"
26
+ },
27
+ "mini-ipip-4": {
28
+ "text": "我的情绪经常波动"
29
+ },
30
+ "mini-ipip-5": {
31
+ "text": "我有丰富的想象力"
32
+ },
33
+ "mini-ipip-6": {
34
+ "text": "我话不多"
35
+ },
36
+ "mini-ipip-7": {
37
+ "text": "我对别人的问题不感兴趣"
38
+ },
39
+ "mini-ipip-8": {
40
+ "text": "我经常忘记把东西放回原处"
41
+ },
42
+ "mini-ipip-9": {
43
+ "text": "我大部分时间都很放松"
44
+ },
45
+ "mini-ipip-10": {
46
+ "text": "我对抽象的观念不感兴趣"
47
+ },
48
+ "mini-ipip-11": {
49
+ "text": "在聚会上我会和很多不同的人交谈"
50
+ },
51
+ "mini-ipip-12": {
52
+ "text": "我能感受到别人的情绪"
53
+ },
54
+ "mini-ipip-13": {
55
+ "text": "我喜欢井井有条"
56
+ },
57
+ "mini-ipip-14": {
58
+ "text": "我容易心烦意乱"
59
+ },
60
+ "mini-ipip-15": {
61
+ "text": "我难以理解抽象的观念"
62
+ },
63
+ "mini-ipip-16": {
64
+ "text": "我习惯待在幕后"
65
+ },
66
+ "mini-ipip-17": {
67
+ "text": "我对别人并不真正感兴趣"
68
+ },
69
+ "mini-ipip-18": {
70
+ "text": "我常把事情弄得一团糟"
71
+ },
72
+ "mini-ipip-19": {
73
+ "text": "我很少感到忧郁"
74
+ },
75
+ "mini-ipip-20": {
76
+ "text": "我的想象力不佳"
77
+ }
78
+ },
79
+ "subscales": {
80
+ "extraversion": {
81
+ "label": "外向性"
82
+ },
83
+ "agreeableness": {
84
+ "label": "宜人性"
85
+ },
86
+ "conscientiousness": {
87
+ "label": "尽责性"
88
+ },
89
+ "neuroticism": {
90
+ "label": "神经质"
91
+ },
92
+ "openness": {
93
+ "label": "开放性(智力/想象力)"
94
+ }
95
+ }
96
+ };
97
+ exports.default = pack;
@@ -0,0 +1,4 @@
1
+ import type { InventoryLocalePack } from "../../types.ts";
2
+ /** Simplified Chinese locale pack for phq9. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
3
+ declare const pack: InventoryLocalePack;
4
+ export default pack;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** Simplified Chinese locale pack for phq9. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
4
+ const pack = {
5
+ "id": "phq9",
6
+ "locale": "zh",
7
+ "title": "患者健康问卷(PHQ-9)",
8
+ "description": "一份包含9个条目的自评问卷,用于筛查抑郁并测量其严重程度。",
9
+ "instructions": "在过去的2周里,您被以下任何一个问题困扰的频率如何?",
10
+ "options": [
11
+ "完全没有",
12
+ "有几天",
13
+ "一半以上的天数",
14
+ "几乎每天"
15
+ ],
16
+ "questions": {
17
+ "phq9-1": {
18
+ "text": "做事时提不起兴趣或没有乐趣"
19
+ },
20
+ "phq9-2": {
21
+ "text": "感到心情低落、沮丧或绝望"
22
+ },
23
+ "phq9-3": {
24
+ "text": "入睡困难、睡不安稳或睡眠过多"
25
+ },
26
+ "phq9-4": {
27
+ "text": "感觉疲倦或没有活力"
28
+ },
29
+ "phq9-5": {
30
+ "text": "食欲不振或吃得过多"
31
+ },
32
+ "phq9-6": {
33
+ "text": "觉得自己很糟糕——或觉得自己很失败,或让自己或家人失望"
34
+ },
35
+ "phq9-7": {
36
+ "text": "难以集中注意力做事,例如看报纸或看电视"
37
+ },
38
+ "phq9-8": {
39
+ "text": "动作或说话缓慢到别人可能已经察觉?或者正好相反——烦躁或坐立不安,动来动去的情况比平时多得多"
40
+ },
41
+ "phq9-9": {
42
+ "text": "有不如死掉或以某种方式伤害自己的念头"
43
+ }
44
+ },
45
+ "bands": {
46
+ "minimal": "极轻度抑郁",
47
+ "mild": "轻度抑郁",
48
+ "moderate": "中度抑郁",
49
+ "moderately-severe": "中重度抑郁",
50
+ "severe": "重度抑郁"
51
+ },
52
+ "flags": {
53
+ "suicidality": "报告了自我伤害或自杀意念(第9项)——需要临床关注"
54
+ }
55
+ };
56
+ exports.default = pack;
@@ -0,0 +1,4 @@
1
+ import type { InventoryLocalePack } from "../../types.ts";
2
+ /** Simplified Chinese locale pack for who5. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
3
+ declare const pack: InventoryLocalePack;
4
+ export default pack;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /** Simplified Chinese locale pack for who5. AI translation (Anthropic Claude, claude-fable-5), unverified — see SOURCES.md. */
4
+ const pack = {
5
+ "id": "who5",
6
+ "locale": "zh",
7
+ "title": "世界卫生组织五项身心健康指标(WHO-5)",
8
+ "description": "一份包含5个条目的自评量表,用于测量过去两周的主观心理幸福感。得分越高,表示身心健康状况越好。",
9
+ "instructions": "请针对以下五条陈述,逐条选出最接近您在过去两周内感受的选项。",
10
+ "options": [
11
+ "任何时候都没有",
12
+ "有些时候",
13
+ "少于一半的时间",
14
+ "多于一半的时间",
15
+ "大部分时间",
16
+ "所有时间"
17
+ ],
18
+ "questions": {
19
+ "who5-1": {
20
+ "text": "我感到愉快、心情舒畅"
21
+ },
22
+ "who5-2": {
23
+ "text": "我感到平静和放松"
24
+ },
25
+ "who5-3": {
26
+ "text": "我感到精力充沛、充满活力"
27
+ },
28
+ "who5-4": {
29
+ "text": "我醒来时感到清爽、休息充分"
30
+ },
31
+ "who5-5": {
32
+ "text": "我的日常生活充满了让我感兴趣的事物"
33
+ }
34
+ },
35
+ "bands": {
36
+ "low": "幸福感低——提示可能存在抑郁,建议进行评估",
37
+ "reduced": "幸福感降低——建议进行抑郁筛查",
38
+ "good": "幸福感良好"
39
+ }
40
+ };
41
+ exports.default = pack;
@@ -157,6 +157,36 @@ export interface AssessmentDefinition {
157
157
  /** Free-form metadata (source, license, citation, timeframe, ...). */
158
158
  meta?: Record<string, unknown>;
159
159
  }
160
+ /**
161
+ * One language for one inventory, shipped as a separate lazily-loadable
162
+ * module so that only requested locales are bundled and held in memory.
163
+ * Merge into a base definition with `applyLocale`.
164
+ */
165
+ export interface InventoryLocalePack {
166
+ /** Id of the inventory this pack translates. */
167
+ id: string;
168
+ /** BCP-47 language tag of the pack, e.g. `"tr"`. */
169
+ locale: string;
170
+ title: string;
171
+ description?: string;
172
+ instructions?: string;
173
+ /** Labels of the assessment-level option scale, by option index. */
174
+ options: string[];
175
+ /** Per-question texts (and option labels for question-level scales), by question id. */
176
+ questions: Record<string, {
177
+ text: string;
178
+ options?: string[];
179
+ }>;
180
+ /** Band labels by band id (sum and count scoring). */
181
+ bands?: Record<string, string>;
182
+ /** Flag labels by flag id. */
183
+ flags?: Record<string, string>;
184
+ /** Subscale labels and band labels, by subscale id. */
185
+ subscales?: Record<string, {
186
+ label: string;
187
+ bands?: Record<string, string>;
188
+ }>;
189
+ }
160
190
  /** Answers keyed by question id. */
161
191
  export type AnswerMap = Record<string, number>;
162
192
  /**
@@ -1,5 +1,5 @@
1
1
  /** Every error code psytools can throw, for exhaustive handling. */
2
- export type PsytoolsErrorCode = "malformed" | "duplicate_question" | "invalid_definition" | "unknown_question" | "invalid_value" | "missing_answer" | "already_submitted" | "invalid_response" | "incomplete_response" | "assessment_mismatch" | "no_scoring" | "invalid_json" | "unknown_inventory" | "invalid_argument";
2
+ export type PsytoolsErrorCode = "malformed" | "duplicate_question" | "invalid_definition" | "unknown_question" | "invalid_value" | "missing_answer" | "already_submitted" | "invalid_response" | "incomplete_response" | "assessment_mismatch" | "no_scoring" | "invalid_json" | "unknown_inventory" | "unknown_locale" | "invalid_argument";
3
3
  /** Error thrown by psytools, carrying a stable machine-readable code. */
4
4
  export declare class PsytoolsError extends Error {
5
5
  readonly code: PsytoolsErrorCode;
@@ -1,4 +1,4 @@
1
- import type { LocalizedText } from "./types.ts";
1
+ import type { AssessmentDefinition, InventoryLocalePack, LocalizedText } from "./types.ts";
2
2
  /**
3
3
  * Resolves a `LocalizedText` to a string for the given locale.
4
4
  *
@@ -6,5 +6,25 @@ import type { LocalizedText } from "./types.ts";
6
6
  * (`"de-AT"` -> `"de"`) -> `fallbackLocale` -> first available entry.
7
7
  */
8
8
  export declare function localizeText(text: LocalizedText, locale: string, fallbackLocale?: string): string;
9
+ /**
10
+ * Merges a locale pack into a definition, returning a new definition that
11
+ * additionally carries the pack's language in every localized text. The
12
+ * original definition and the pack are not modified.
13
+ *
14
+ * Packs may be partial (untranslated entries keep their existing locales),
15
+ * but entries referencing unknown question/band/flag/subscale ids or
16
+ * mismatched option counts throw `invalid_argument`.
17
+ */
18
+ export declare function applyLocale(definition: AssessmentDefinition, pack: InventoryLocalePack): AssessmentDefinition;
19
+ /**
20
+ * Returns a copy of a definition containing only the given locales in every
21
+ * localized text (questions, options, bands, flags, subscales). The
22
+ * definition's `defaultLocale` is always kept as the fallback.
23
+ *
24
+ * Use this at the server boundary to avoid shipping unused languages to a
25
+ * client: `res.json(pickLocales(phq9, [userLocale]))`. The original
26
+ * definition is not modified.
27
+ */
28
+ export declare function pickLocales(definition: AssessmentDefinition, locales: string[]): AssessmentDefinition;
9
29
  /** Collects the union of locales present in a set of localized texts. */
10
30
  export declare function collectLocales(texts: Array<LocalizedText | undefined>): string[];