@aopslab/aops-server 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +6 -0
  3. package/README.md +21 -0
  4. package/aops-server-runtime.json +11 -0
  5. package/build/client/_app/immutable/chunks/2_TffmqH.js +1 -0
  6. package/build/client/_app/immutable/chunks/3DOfIKW0.js +1 -0
  7. package/build/client/_app/immutable/chunks/B2EkC-sy.js +1 -0
  8. package/build/client/_app/immutable/chunks/CMkIcmi1.js +2 -0
  9. package/build/client/_app/immutable/chunks/rqnVXeyB.js +1 -0
  10. package/build/client/_app/immutable/chunks/sZYZbj9W.js +1 -0
  11. package/build/client/_app/immutable/chunks/wbPk3Yxo.js +81 -0
  12. package/build/client/_app/immutable/entry/app.C7STLTX8.js +2 -0
  13. package/build/client/_app/immutable/entry/start.BC94hOaC.js +1 -0
  14. package/build/client/_app/immutable/nodes/0.BYBfjxZ5.js +1 -0
  15. package/build/client/_app/immutable/nodes/1.BNXFXajG.js +1 -0
  16. package/build/client/_app/version.json +1 -0
  17. package/build/env.js +70 -0
  18. package/build/env.js.map +1 -0
  19. package/build/handler.js +16 -0
  20. package/build/handler.js.map +1 -0
  21. package/build/index.js +139 -0
  22. package/build/index.js.map +1 -0
  23. package/build/server/chunks/0-RfB6m2nq.js +7 -0
  24. package/build/server/chunks/0-RfB6m2nq.js.map +1 -0
  25. package/build/server/chunks/1-_gg8Q0UT.js +9 -0
  26. package/build/server/chunks/1-_gg8Q0UT.js.map +1 -0
  27. package/build/server/chunks/_server.ts-6276EQIF.js +44 -0
  28. package/build/server/chunks/_server.ts-6276EQIF.js.map +1 -0
  29. package/build/server/chunks/_server.ts-B59WFQzX.js +174 -0
  30. package/build/server/chunks/_server.ts-B59WFQzX.js.map +1 -0
  31. package/build/server/chunks/_server.ts-BauJsLZI.js +40 -0
  32. package/build/server/chunks/_server.ts-BauJsLZI.js.map +1 -0
  33. package/build/server/chunks/_server.ts-BnGzJw2-.js +81 -0
  34. package/build/server/chunks/_server.ts-BnGzJw2-.js.map +1 -0
  35. package/build/server/chunks/_server.ts-CP7qM24V.js +34 -0
  36. package/build/server/chunks/_server.ts-CP7qM24V.js.map +1 -0
  37. package/build/server/chunks/_server.ts-Cbq_u99d.js +9 -0
  38. package/build/server/chunks/_server.ts-Cbq_u99d.js.map +1 -0
  39. package/build/server/chunks/_server.ts-Ch8fPT-o.js +92 -0
  40. package/build/server/chunks/_server.ts-Ch8fPT-o.js.map +1 -0
  41. package/build/server/chunks/_server.ts-Cv-yaXZI.js +7 -0
  42. package/build/server/chunks/_server.ts-Cv-yaXZI.js.map +1 -0
  43. package/build/server/chunks/_server.ts-D6lBwOON.js +34 -0
  44. package/build/server/chunks/_server.ts-D6lBwOON.js.map +1 -0
  45. package/build/server/chunks/_server.ts-D84K3pp9.js +11 -0
  46. package/build/server/chunks/_server.ts-D84K3pp9.js.map +1 -0
  47. package/build/server/chunks/_server.ts-DNzU1ToA.js +277 -0
  48. package/build/server/chunks/_server.ts-DNzU1ToA.js.map +1 -0
  49. package/build/server/chunks/_server.ts-DQQnw77t.js +17 -0
  50. package/build/server/chunks/_server.ts-DQQnw77t.js.map +1 -0
  51. package/build/server/chunks/_server.ts-DSxr5l15.js +18 -0
  52. package/build/server/chunks/_server.ts-DSxr5l15.js.map +1 -0
  53. package/build/server/chunks/_server.ts-DZYokvuR.js +80 -0
  54. package/build/server/chunks/_server.ts-DZYokvuR.js.map +1 -0
  55. package/build/server/chunks/_server.ts-Dcqwpz2t.js +144 -0
  56. package/build/server/chunks/_server.ts-Dcqwpz2t.js.map +1 -0
  57. package/build/server/chunks/_server.ts-Di9VJnF4.js +81 -0
  58. package/build/server/chunks/_server.ts-Di9VJnF4.js.map +1 -0
  59. package/build/server/chunks/_server.ts-FBEHFT8b.js +33 -0
  60. package/build/server/chunks/_server.ts-FBEHFT8b.js.map +1 -0
  61. package/build/server/chunks/_server.ts-gZytCuiJ.js +10 -0
  62. package/build/server/chunks/_server.ts-gZytCuiJ.js.map +1 -0
  63. package/build/server/chunks/_server.ts-tNULLyEO.js +261 -0
  64. package/build/server/chunks/_server.ts-tNULLyEO.js.map +1 -0
  65. package/build/server/chunks/agent-gateway-runtime-DTZ4SxaC.js +2598 -0
  66. package/build/server/chunks/agent-gateway-runtime-DTZ4SxaC.js.map +1 -0
  67. package/build/server/chunks/aops-runtime-config-wpVmg7T-.js +179 -0
  68. package/build/server/chunks/aops-runtime-config-wpVmg7T-.js.map +1 -0
  69. package/build/server/chunks/discovery-D9JnSgfu.js +894 -0
  70. package/build/server/chunks/discovery-D9JnSgfu.js.map +1 -0
  71. package/build/server/chunks/error.svelte-DgUOqi-L.js +45 -0
  72. package/build/server/chunks/error.svelte-DgUOqi-L.js.map +1 -0
  73. package/build/server/chunks/handler-BN3-p5rP.js +1733 -0
  74. package/build/server/chunks/handler-BN3-p5rP.js.map +1 -0
  75. package/build/server/chunks/hooks.server-C4wxiH5m.js +52 -0
  76. package/build/server/chunks/hooks.server-C4wxiH5m.js.map +1 -0
  77. package/build/server/chunks/index.js-nbqdVuWC.js +10698 -0
  78. package/build/server/chunks/index.js-nbqdVuWC.js.map +1 -0
  79. package/build/server/chunks/manifest.js-_Re-Wj-y.js +167 -0
  80. package/build/server/chunks/manifest.js-_Re-Wj-y.js.map +1 -0
  81. package/build/server/chunks/plugin-error-normalize-Bq14Qbz3.js +297 -0
  82. package/build/server/chunks/plugin-error-normalize-Bq14Qbz3.js.map +1 -0
  83. package/build/server/chunks/project-alias-DqE2v58Q.js +29 -0
  84. package/build/server/chunks/project-alias-DqE2v58Q.js.map +1 -0
  85. package/build/server/chunks/registry-5amIZito.js +289 -0
  86. package/build/server/chunks/registry-5amIZito.js.map +1 -0
  87. package/build/server/chunks/request-base-url-BDdrsaga.js +24 -0
  88. package/build/server/chunks/request-base-url-BDdrsaga.js.map +1 -0
  89. package/build/server/chunks/request-context-tNeFQjgb.js +422 -0
  90. package/build/server/chunks/request-context-tNeFQjgb.js.map +1 -0
  91. package/build/server/chunks/xf-result-BRDjvftr.js +17 -0
  92. package/build/server/chunks/xf-result-BRDjvftr.js.map +1 -0
  93. package/build/shims.js +33 -0
  94. package/build/shims.js.map +1 -0
  95. package/cockpit/.vite/manifest.json +198 -0
  96. package/cockpit/assets/dm-sans-latin-400-normal-BwCSEQnW.woff +0 -0
  97. package/cockpit/assets/dm-sans-latin-400-normal-CW0RaeGs.woff2 +0 -0
  98. package/cockpit/assets/dm-sans-latin-500-normal-B9HHJjqV.woff2 +0 -0
  99. package/cockpit/assets/dm-sans-latin-500-normal-Dr3UlScf.woff +0 -0
  100. package/cockpit/assets/dm-sans-latin-700-normal-CUSSCpQX.woff +0 -0
  101. package/cockpit/assets/dm-sans-latin-700-normal-DvUfVpUG.woff2 +0 -0
  102. package/cockpit/assets/dm-sans-latin-ext-400-normal-BjWJ59Pq.woff +0 -0
  103. package/cockpit/assets/dm-sans-latin-ext-400-normal-BtiwyxMk.woff2 +0 -0
  104. package/cockpit/assets/dm-sans-latin-ext-500-normal-BJfUCQsA.woff2 +0 -0
  105. package/cockpit/assets/dm-sans-latin-ext-500-normal-DR84L5F-.woff +0 -0
  106. package/cockpit/assets/dm-sans-latin-ext-700-normal-BLI3TTWz.woff +0 -0
  107. package/cockpit/assets/dm-sans-latin-ext-700-normal-CJIcxD6K.woff2 +0 -0
  108. package/cockpit/assets/index-DDswO4B1.css +1 -0
  109. package/cockpit/assets/index-bovtnZ98.js +18 -0
  110. package/cockpit/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
  111. package/cockpit/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
  112. package/cockpit/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
  113. package/cockpit/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
  114. package/cockpit/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
  115. package/cockpit/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
  116. package/cockpit/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
  117. package/cockpit/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
  118. package/cockpit/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
  119. package/cockpit/assets/outfit-latin-400-normal-BGsTXAXT.woff2 +0 -0
  120. package/cockpit/assets/outfit-latin-400-normal-DMwTpYkH.woff +0 -0
  121. package/cockpit/assets/outfit-latin-600-normal-B7SfZ07L.woff2 +0 -0
  122. package/cockpit/assets/outfit-latin-600-normal-BEfTtDA7.woff +0 -0
  123. package/cockpit/assets/outfit-latin-ext-400-normal-5tcqmc2S.woff2 +0 -0
  124. package/cockpit/assets/outfit-latin-ext-400-normal-DHm7mdGe.woff +0 -0
  125. package/cockpit/assets/outfit-latin-ext-600-normal-B85nYjL1.woff2 +0 -0
  126. package/cockpit/assets/outfit-latin-ext-600-normal-CWJcPgd7.woff +0 -0
  127. package/cockpit/assets/unbounded-cyrillic-600-normal-B-s5c2Kn.woff +0 -0
  128. package/cockpit/assets/unbounded-cyrillic-600-normal-DW6uzIMB.woff2 +0 -0
  129. package/cockpit/assets/unbounded-latin-600-normal-BPdB_PEv.woff +0 -0
  130. package/cockpit/assets/unbounded-latin-600-normal-oRSANpZr.woff2 +0 -0
  131. package/cockpit/assets/unbounded-latin-ext-600-normal-0iZLtTDV.woff2 +0 -0
  132. package/cockpit/assets/unbounded-latin-ext-600-normal-ClMPf-bu.woff +0 -0
  133. package/cockpit/assets/unbounded-vietnamese-600-normal-BzfrgZ_C.woff +0 -0
  134. package/cockpit/assets/unbounded-vietnamese-600-normal-Cx2bTSHN.woff2 +0 -0
  135. package/cockpit/community.module-inventory.json +2389 -0
  136. package/cockpit/index.html +14 -0
  137. package/community-postgres.json +13 -0
  138. package/migrations/agentspace/0000_thin_carlie_cooper.sql +764 -0
  139. package/migrations/agentspace/meta/0000_snapshot.json +6885 -0
  140. package/migrations/agentspace/meta/_journal.json +13 -0
  141. package/migrations/chatv3/0000_dry_ego.sql +218 -0
  142. package/migrations/chatv3/0001_nosy_obadiah_stane.sql +35 -0
  143. package/migrations/chatv3/0002_narrow_darkhawk.sql +4 -0
  144. package/migrations/chatv3/0003_damp_zarek.sql +2 -0
  145. package/migrations/chatv3/0004_nervous_martin_li.sql +60 -0
  146. package/migrations/chatv3/0005_chatv3_server_encrypted_mode.sql +1 -0
  147. package/migrations/chatv3/meta/0000_snapshot.json +1887 -0
  148. package/migrations/chatv3/meta/0001_snapshot.json +2175 -0
  149. package/migrations/chatv3/meta/0002_snapshot.json +2229 -0
  150. package/migrations/chatv3/meta/0003_snapshot.json +2241 -0
  151. package/migrations/chatv3/meta/0004_snapshot.json +2746 -0
  152. package/migrations/chatv3/meta/_journal.json +48 -0
  153. package/migrations/docman/0000_curvy_valeria_richards.sql +257 -0
  154. package/migrations/docman/0001_massive_risque.sql +2 -0
  155. package/migrations/docman/0002_simple_logan.sql +50 -0
  156. package/migrations/docman/0003_quick_index.sql +45 -0
  157. package/migrations/docman/0004_known_summary.sql +9 -0
  158. package/migrations/docman/0005_vector_signal.sql +9 -0
  159. package/migrations/docman/0006_document_version_current_invariant.sql +15 -0
  160. package/migrations/docman/meta/_journal.json +55 -0
  161. package/migrations/projectman/0000_smooth_klaw.sql +257 -0
  162. package/migrations/projectman/0001_worthless_zodiak.sql +9 -0
  163. package/migrations/projectman/0002_board_rename.sql +108 -0
  164. package/migrations/projectman/0003_review_request.sql +62 -0
  165. package/migrations/projectman/0004_review_request_idempotency.sql +3 -0
  166. package/migrations/projectman/0005_allow_multi_sprint_per_task.sql +1 -0
  167. package/migrations/projectman/meta/_journal.json +48 -0
  168. package/migrations/sys/0000_loose_praxagora.sql +31 -0
  169. package/migrations/sys/0001_awesome_ronan.sql +2 -0
  170. package/migrations/sys/0002_steady_maximus.sql +2 -0
  171. package/migrations/sys/0003_escalating_rate_limiter.sql +2 -0
  172. package/migrations/sys/0004_rate_limiter_timestamptz.sql +22 -0
  173. package/migrations/sys/0005_sys_counters.sql +21 -0
  174. package/migrations/sys/meta/_journal.json +48 -0
  175. package/npm-shrinkwrap.json +4375 -0
  176. package/package.json +62 -0
  177. package/runtime/agentspace-host-adapter.mjs +64 -0
  178. package/runtime/agentspace-tooling.mjs +389 -0
  179. package/runtime/docman-host-adapter.mjs +177 -0
  180. package/runtime/docman-policy.mjs +450 -0
  181. package/runtime/docman-tooling.mjs +20 -0
  182. package/runtime/projectman-host-adapter.mjs +597 -0
  183. package/runtime/scope-context.mjs +99 -0
  184. package/scripts/community-host.mjs +626 -0
  185. package/scripts/community-migration-policy-v1.json +296 -0
@@ -0,0 +1,48 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1781289992504,
9
+ "tag": "0000_dry_ego",
10
+ "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "7",
15
+ "when": 1781294691809,
16
+ "tag": "0001_nosy_obadiah_stane",
17
+ "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "7",
22
+ "when": 1781358598953,
23
+ "tag": "0002_narrow_darkhawk",
24
+ "breakpoints": true
25
+ },
26
+ {
27
+ "idx": 3,
28
+ "version": "7",
29
+ "when": 1781442152184,
30
+ "tag": "0003_damp_zarek",
31
+ "breakpoints": true
32
+ },
33
+ {
34
+ "idx": 4,
35
+ "version": "7",
36
+ "when": 1783033656476,
37
+ "tag": "0004_nervous_martin_li",
38
+ "breakpoints": true
39
+ },
40
+ {
41
+ "idx": 5,
42
+ "version": "7",
43
+ "when": 1783152000000,
44
+ "tag": "0005_chatv3_server_encrypted_mode",
45
+ "breakpoints": true
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,257 @@
1
+ CREATE TABLE "docman_documents" (
2
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
+ "tenantId" text NOT NULL,
4
+ "scopeId" uuid NOT NULL,
5
+ "documentUid" text NOT NULL,
6
+ "groupId" uuid,
7
+ "groupUid" text,
8
+ "slug" text,
9
+ "title" text NOT NULL,
10
+ "titleMl" jsonb,
11
+ "summary" text,
12
+ "summaryMl" jsonb,
13
+ "description" text,
14
+ "descriptionMl" jsonb,
15
+ "status" text NOT NULL,
16
+ "visibility" text NOT NULL,
17
+ "tags" jsonb,
18
+ "pageSize" text,
19
+ "meta" jsonb,
20
+ "createdBy" text,
21
+ "updatedBy" text,
22
+ "createdAt" timestamp with time zone DEFAULT now(),
23
+ "updatedAt" timestamp with time zone DEFAULT now()
24
+ );
25
+ --> statement-breakpoint
26
+ CREATE TABLE "docman_document_groups" (
27
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
28
+ "tenantId" text NOT NULL,
29
+ "scopeId" uuid NOT NULL,
30
+ "groupUid" text NOT NULL,
31
+ "parentGroupId" uuid,
32
+ "parentGroupUid" text,
33
+ "title" text NOT NULL,
34
+ "description" text,
35
+ "meta" jsonb,
36
+ "createdBy" text,
37
+ "updatedBy" text,
38
+ "createdAt" timestamp with time zone DEFAULT now(),
39
+ "updatedAt" timestamp with time zone DEFAULT now()
40
+ );
41
+ --> statement-breakpoint
42
+ CREATE TABLE "docman_document_versions" (
43
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
44
+ "tenantId" text NOT NULL,
45
+ "documentId" uuid NOT NULL,
46
+ "version" integer NOT NULL,
47
+ "label" text,
48
+ "status" text NOT NULL,
49
+ "title" text,
50
+ "summary" text,
51
+ "releaseNotes" text,
52
+ "releaseNotesMl" jsonb,
53
+ "isCurrent" boolean DEFAULT false NOT NULL,
54
+ "basedOnVersionId" uuid,
55
+ "publishedAt" timestamp with time zone,
56
+ "createdBy" text,
57
+ "updatedBy" text,
58
+ "createdAt" timestamp with time zone DEFAULT now(),
59
+ "updatedAt" timestamp with time zone DEFAULT now()
60
+ );
61
+ --> statement-breakpoint
62
+ CREATE TABLE "docman_sections" (
63
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
64
+ "tenantId" text NOT NULL,
65
+ "scopeId" uuid NOT NULL,
66
+ "sectionUid" text NOT NULL,
67
+ "title" text NOT NULL,
68
+ "titleMl" jsonb,
69
+ "description" text,
70
+ "descriptionMl" jsonb,
71
+ "kind" text,
72
+ "slug" text,
73
+ "createdBy" text,
74
+ "updatedBy" text,
75
+ "createdAt" timestamp with time zone DEFAULT now(),
76
+ "updatedAt" timestamp with time zone DEFAULT now()
77
+ );
78
+ --> statement-breakpoint
79
+ CREATE TABLE "docman_pages" (
80
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
81
+ "tenantId" text NOT NULL,
82
+ "scopeId" uuid NOT NULL,
83
+ "pageUid" text NOT NULL,
84
+ "title" text NOT NULL,
85
+ "titleMl" jsonb,
86
+ "kind" text,
87
+ "meta" jsonb,
88
+ "createdBy" text,
89
+ "updatedBy" text,
90
+ "createdAt" timestamp with time zone DEFAULT now(),
91
+ "updatedAt" timestamp with time zone DEFAULT now()
92
+ );
93
+ --> statement-breakpoint
94
+ CREATE TABLE "docman_page_versions" (
95
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
96
+ "tenantId" text NOT NULL,
97
+ "pageId" uuid NOT NULL,
98
+ "version" integer NOT NULL,
99
+ "title" text,
100
+ "format" text NOT NULL,
101
+ "content" text,
102
+ "contentMl" jsonb,
103
+ "contentData" jsonb,
104
+ "directives" jsonb,
105
+ "status" text NOT NULL,
106
+ "createdBy" text,
107
+ "updatedBy" text,
108
+ "createdAt" timestamp with time zone DEFAULT now(),
109
+ "updatedAt" timestamp with time zone DEFAULT now()
110
+ );
111
+ --> statement-breakpoint
112
+ CREATE TABLE "docman_document_section_links" (
113
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
114
+ "tenantId" text NOT NULL,
115
+ "documentVersionId" uuid NOT NULL,
116
+ "kind" text NOT NULL,
117
+ "sectionId" uuid,
118
+ "pageVersionId" uuid,
119
+ "parentLinkId" uuid,
120
+ "position" integer NOT NULL,
121
+ "depth" integer,
122
+ "titleOverride" text,
123
+ "titleVisible" boolean DEFAULT true NOT NULL,
124
+ "numbering" text,
125
+ "pageBreakBefore" boolean DEFAULT false NOT NULL,
126
+ "pageBreakAfter" boolean DEFAULT false NOT NULL,
127
+ "directives" jsonb,
128
+ "createdBy" text,
129
+ "updatedBy" text,
130
+ "createdAt" timestamp with time zone DEFAULT now(),
131
+ "updatedAt" timestamp with time zone DEFAULT now()
132
+ );
133
+ --> statement-breakpoint
134
+ CREATE TABLE "docman_section_page_links" (
135
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
136
+ "tenantId" text NOT NULL,
137
+ "sectionId" uuid NOT NULL,
138
+ "pageVersionId" uuid NOT NULL,
139
+ "position" integer NOT NULL,
140
+ "numbering" text,
141
+ "titleOverride" text,
142
+ "titleVisible" boolean DEFAULT true NOT NULL,
143
+ "pageBreakBefore" boolean DEFAULT false NOT NULL,
144
+ "pageBreakAfter" boolean DEFAULT false NOT NULL,
145
+ "createdBy" text,
146
+ "updatedBy" text,
147
+ "createdAt" timestamp with time zone DEFAULT now(),
148
+ "updatedAt" timestamp with time zone DEFAULT now()
149
+ );
150
+ --> statement-breakpoint
151
+ CREATE TABLE "docman_snippets" (
152
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
153
+ "tenantId" text NOT NULL,
154
+ "scopeId" uuid NOT NULL,
155
+ "snippetUid" text NOT NULL,
156
+ "title" text,
157
+ "language" text NOT NULL,
158
+ "code" text NOT NULL,
159
+ "description" text,
160
+ "meta" jsonb,
161
+ "createdBy" text,
162
+ "updatedBy" text,
163
+ "createdAt" timestamp with time zone DEFAULT now(),
164
+ "updatedAt" timestamp with time zone DEFAULT now()
165
+ );
166
+ --> statement-breakpoint
167
+ CREATE TABLE "docman_page_snippet_links" (
168
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
169
+ "tenantId" text NOT NULL,
170
+ "pageVersionId" uuid NOT NULL,
171
+ "snippetId" uuid NOT NULL,
172
+ "position" integer NOT NULL,
173
+ "caption" text,
174
+ "showLineNumbers" boolean,
175
+ "createdBy" text,
176
+ "updatedBy" text,
177
+ "createdAt" timestamp with time zone DEFAULT now(),
178
+ "updatedAt" timestamp with time zone DEFAULT now()
179
+ );
180
+ --> statement-breakpoint
181
+ CREATE TABLE "docman_embeds" (
182
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
183
+ "tenantId" text NOT NULL,
184
+ "scopeId" uuid NOT NULL,
185
+ "embedUid" text NOT NULL,
186
+ "type" text NOT NULL,
187
+ "title" text,
188
+ "content" text,
189
+ "url" text,
190
+ "path" text,
191
+ "mime" text,
192
+ "meta" jsonb,
193
+ "createdBy" text,
194
+ "updatedBy" text,
195
+ "createdAt" timestamp with time zone DEFAULT now(),
196
+ "updatedAt" timestamp with time zone DEFAULT now()
197
+ );
198
+ --> statement-breakpoint
199
+ CREATE TABLE "docman_page_embed_links" (
200
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
201
+ "tenantId" text NOT NULL,
202
+ "pageVersionId" uuid NOT NULL,
203
+ "embedId" uuid NOT NULL,
204
+ "position" integer NOT NULL,
205
+ "caption" text,
206
+ "createdBy" text,
207
+ "updatedBy" text,
208
+ "createdAt" timestamp with time zone DEFAULT now(),
209
+ "updatedAt" timestamp with time zone DEFAULT now()
210
+ );
211
+ --> statement-breakpoint
212
+ CREATE UNIQUE INDEX "document_uid_unique" ON "docman_documents" USING btree ("tenantId","scopeId","documentUid");--> statement-breakpoint
213
+ CREATE INDEX "document_idx_tenant" ON "docman_documents" USING btree ("tenantId");--> statement-breakpoint
214
+ CREATE INDEX "document_idx_scope" ON "docman_documents" USING btree ("tenantId","scopeId");--> statement-breakpoint
215
+ CREATE INDEX "document_idx_status" ON "docman_documents" USING btree ("tenantId","status");--> statement-breakpoint
216
+ CREATE INDEX "document_idx_scope_slug" ON "docman_documents" USING btree ("tenantId","scopeId","slug");--> statement-breakpoint
217
+ CREATE INDEX "document_idx_scope_group_id" ON "docman_documents" USING btree ("tenantId","scopeId","groupId");--> statement-breakpoint
218
+ CREATE INDEX "document_idx_scope_group_uid" ON "docman_documents" USING btree ("tenantId","scopeId","groupUid");--> statement-breakpoint
219
+ CREATE UNIQUE INDEX "document_group_uid_unique" ON "docman_document_groups" USING btree ("tenantId","scopeId","groupUid");--> statement-breakpoint
220
+ CREATE INDEX "document_group_idx_tenant" ON "docman_document_groups" USING btree ("tenantId");--> statement-breakpoint
221
+ CREATE INDEX "document_group_idx_scope" ON "docman_document_groups" USING btree ("tenantId","scopeId");--> statement-breakpoint
222
+ CREATE INDEX "document_group_idx_parent" ON "docman_document_groups" USING btree ("tenantId","parentGroupId");--> statement-breakpoint
223
+ CREATE UNIQUE INDEX "document_version_unique" ON "docman_document_versions" USING btree ("tenantId","documentId","version");--> statement-breakpoint
224
+ CREATE INDEX "document_version_idx_doc" ON "docman_document_versions" USING btree ("tenantId","documentId");--> statement-breakpoint
225
+ CREATE INDEX "document_version_idx_status" ON "docman_document_versions" USING btree ("tenantId","status");--> statement-breakpoint
226
+ CREATE INDEX "document_version_idx_current" ON "docman_document_versions" USING btree ("tenantId","documentId","isCurrent");--> statement-breakpoint
227
+ CREATE UNIQUE INDEX "section_uid_unique" ON "docman_sections" USING btree ("tenantId","scopeId","sectionUid");--> statement-breakpoint
228
+ CREATE INDEX "section_idx_tenant" ON "docman_sections" USING btree ("tenantId");--> statement-breakpoint
229
+ CREATE INDEX "section_idx_scope" ON "docman_sections" USING btree ("tenantId","scopeId");--> statement-breakpoint
230
+ CREATE UNIQUE INDEX "page_uid_unique" ON "docman_pages" USING btree ("tenantId","scopeId","pageUid");--> statement-breakpoint
231
+ CREATE INDEX "page_idx_tenant" ON "docman_pages" USING btree ("tenantId");--> statement-breakpoint
232
+ CREATE INDEX "page_idx_scope" ON "docman_pages" USING btree ("tenantId","scopeId");--> statement-breakpoint
233
+ CREATE UNIQUE INDEX "page_version_unique" ON "docman_page_versions" USING btree ("tenantId","pageId","version");--> statement-breakpoint
234
+ CREATE INDEX "page_version_idx_page" ON "docman_page_versions" USING btree ("tenantId","pageId");--> statement-breakpoint
235
+ CREATE INDEX "page_version_idx_status" ON "docman_page_versions" USING btree ("tenantId","status");--> statement-breakpoint
236
+ CREATE UNIQUE INDEX "doc_section_pos_unique" ON "docman_document_section_links" USING btree ("tenantId","documentVersionId","parentLinkId","position");--> statement-breakpoint
237
+ CREATE INDEX "doc_section_idx_doc_version" ON "docman_document_section_links" USING btree ("tenantId","documentVersionId");--> statement-breakpoint
238
+ CREATE INDEX "doc_section_idx_section" ON "docman_document_section_links" USING btree ("tenantId","sectionId");--> statement-breakpoint
239
+ CREATE INDEX "doc_section_idx_page_version" ON "docman_document_section_links" USING btree ("tenantId","pageVersionId");--> statement-breakpoint
240
+ CREATE INDEX "doc_section_idx_parent" ON "docman_document_section_links" USING btree ("tenantId","parentLinkId");--> statement-breakpoint
241
+ CREATE UNIQUE INDEX "section_page_pos_unique" ON "docman_section_page_links" USING btree ("tenantId","sectionId","position");--> statement-breakpoint
242
+ CREATE INDEX "section_page_idx_section" ON "docman_section_page_links" USING btree ("tenantId","sectionId");--> statement-breakpoint
243
+ CREATE INDEX "section_page_idx_page_version" ON "docman_section_page_links" USING btree ("tenantId","pageVersionId");--> statement-breakpoint
244
+ CREATE UNIQUE INDEX "snippet_uid_unique" ON "docman_snippets" USING btree ("tenantId","scopeId","snippetUid");--> statement-breakpoint
245
+ CREATE INDEX "snippet_idx_tenant" ON "docman_snippets" USING btree ("tenantId");--> statement-breakpoint
246
+ CREATE INDEX "snippet_idx_scope" ON "docman_snippets" USING btree ("tenantId","scopeId");--> statement-breakpoint
247
+ CREATE INDEX "snippet_idx_scope_language" ON "docman_snippets" USING btree ("tenantId","scopeId","language");--> statement-breakpoint
248
+ CREATE UNIQUE INDEX "page_snippet_pos_unique" ON "docman_page_snippet_links" USING btree ("tenantId","pageVersionId","position");--> statement-breakpoint
249
+ CREATE INDEX "page_snippet_idx_page_version" ON "docman_page_snippet_links" USING btree ("tenantId","pageVersionId");--> statement-breakpoint
250
+ CREATE INDEX "page_snippet_idx_snippet" ON "docman_page_snippet_links" USING btree ("tenantId","snippetId");--> statement-breakpoint
251
+ CREATE UNIQUE INDEX "embed_uid_unique" ON "docman_embeds" USING btree ("tenantId","scopeId","embedUid");--> statement-breakpoint
252
+ CREATE INDEX "embed_idx_tenant" ON "docman_embeds" USING btree ("tenantId");--> statement-breakpoint
253
+ CREATE INDEX "embed_idx_scope" ON "docman_embeds" USING btree ("tenantId","scopeId");--> statement-breakpoint
254
+ CREATE INDEX "embed_idx_scope_type" ON "docman_embeds" USING btree ("tenantId","scopeId","type");--> statement-breakpoint
255
+ CREATE UNIQUE INDEX "page_embed_pos_unique" ON "docman_page_embed_links" USING btree ("tenantId","pageVersionId","position");--> statement-breakpoint
256
+ CREATE INDEX "page_embed_idx_page_version" ON "docman_page_embed_links" USING btree ("tenantId","pageVersionId");--> statement-breakpoint
257
+ CREATE INDEX "page_embed_idx_embed" ON "docman_page_embed_links" USING btree ("tenantId","embedId");
@@ -0,0 +1,2 @@
1
+ ALTER TABLE "docman_sections" DROP COLUMN "description";--> statement-breakpoint
2
+ ALTER TABLE "docman_sections" DROP COLUMN "descriptionMl";
@@ -0,0 +1,50 @@
1
+ CREATE TABLE "docman_assets" (
2
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
+ "tenantId" text NOT NULL,
4
+ "scopeId" uuid NOT NULL,
5
+ "assetUid" text NOT NULL,
6
+ "kind" text NOT NULL,
7
+ "title" text,
8
+ "slug" text,
9
+ "altText" text,
10
+ "currentVersionId" uuid,
11
+ "meta" jsonb,
12
+ "createdBy" text,
13
+ "updatedBy" text,
14
+ "createdAt" timestamp with time zone DEFAULT now(),
15
+ "updatedAt" timestamp with time zone DEFAULT now()
16
+ );
17
+ --> statement-breakpoint
18
+ CREATE TABLE "docman_asset_versions" (
19
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
20
+ "tenantId" text NOT NULL,
21
+ "assetId" uuid NOT NULL,
22
+ "version" integer NOT NULL,
23
+ "label" text,
24
+ "status" text NOT NULL,
25
+ "storageKey" text,
26
+ "sourcePath" text,
27
+ "sourceUrl" text,
28
+ "filename" text,
29
+ "mime" text NOT NULL,
30
+ "contentHash" text NOT NULL,
31
+ "byteSize" integer,
32
+ "width" integer,
33
+ "height" integer,
34
+ "variants" jsonb,
35
+ "meta" jsonb,
36
+ "createdBy" text,
37
+ "updatedBy" text,
38
+ "createdAt" timestamp with time zone DEFAULT now(),
39
+ "updatedAt" timestamp with time zone DEFAULT now()
40
+ );
41
+ --> statement-breakpoint
42
+ CREATE UNIQUE INDEX "asset_uid_unique" ON "docman_assets" USING btree ("tenantId","scopeId","assetUid");--> statement-breakpoint
43
+ CREATE INDEX "asset_idx_tenant" ON "docman_assets" USING btree ("tenantId");--> statement-breakpoint
44
+ CREATE INDEX "asset_idx_scope" ON "docman_assets" USING btree ("tenantId","scopeId");--> statement-breakpoint
45
+ CREATE INDEX "asset_idx_scope_kind" ON "docman_assets" USING btree ("tenantId","scopeId","kind");--> statement-breakpoint
46
+ CREATE INDEX "asset_idx_scope_current_version" ON "docman_assets" USING btree ("tenantId","scopeId","currentVersionId");--> statement-breakpoint
47
+ CREATE UNIQUE INDEX "asset_version_unique" ON "docman_asset_versions" USING btree ("tenantId","assetId","version");--> statement-breakpoint
48
+ CREATE INDEX "asset_version_idx_asset" ON "docman_asset_versions" USING btree ("tenantId","assetId");--> statement-breakpoint
49
+ CREATE INDEX "asset_version_idx_status" ON "docman_asset_versions" USING btree ("tenantId","status");--> statement-breakpoint
50
+ CREATE INDEX "asset_version_idx_hash" ON "docman_asset_versions" USING btree ("tenantId","contentHash");
@@ -0,0 +1,45 @@
1
+ CREATE TABLE "docman_document_index_entries" (
2
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3
+ "tenantId" text NOT NULL,
4
+ "documentVersionId" uuid NOT NULL,
5
+ "documentId" uuid NOT NULL,
6
+ "locale" text DEFAULT '' NOT NULL,
7
+ "fallbackLocale" text DEFAULT '' NOT NULL,
8
+ "itemKind" text NOT NULL,
9
+ "sortOrder" integer NOT NULL,
10
+ "buildFingerprint" text NOT NULL,
11
+ "linkId" uuid,
12
+ "parentLinkId" uuid,
13
+ "anchor" text NOT NULL,
14
+ "parentAnchor" text,
15
+ "number" text,
16
+ "depth" integer NOT NULL,
17
+ "position" integer NOT NULL,
18
+ "title" text NOT NULL,
19
+ "breadcrumb" text NOT NULL,
20
+ "titleVisible" boolean DEFAULT true NOT NULL,
21
+ "pageBreakBefore" boolean DEFAULT false NOT NULL,
22
+ "pageBreakAfter" boolean DEFAULT false NOT NULL,
23
+ "sectionId" uuid,
24
+ "sectionUid" text,
25
+ "sectionSlug" text,
26
+ "pageId" uuid,
27
+ "pageUid" text,
28
+ "pageVersionId" uuid,
29
+ "format" text,
30
+ "pageNumberStart" integer,
31
+ "pageNumberEnd" integer,
32
+ "bodyText" text,
33
+ "searchText" text NOT NULL,
34
+ "createdBy" text,
35
+ "updatedBy" text,
36
+ "createdAt" timestamp with time zone DEFAULT now(),
37
+ "updatedAt" timestamp with time zone DEFAULT now()
38
+ );
39
+ --> statement-breakpoint
40
+ CREATE UNIQUE INDEX "doc_index_entry_sort_unique" ON "docman_document_index_entries" USING btree ("tenantId","documentVersionId","locale","fallbackLocale","sortOrder");--> statement-breakpoint
41
+ CREATE UNIQUE INDEX "doc_index_entry_anchor_unique" ON "docman_document_index_entries" USING btree ("tenantId","documentVersionId","locale","fallbackLocale","anchor");--> statement-breakpoint
42
+ CREATE INDEX "doc_index_entry_idx_doc_version" ON "docman_document_index_entries" USING btree ("tenantId","documentVersionId","locale","fallbackLocale");--> statement-breakpoint
43
+ CREATE INDEX "doc_index_entry_idx_link" ON "docman_document_index_entries" USING btree ("tenantId","linkId");--> statement-breakpoint
44
+ CREATE INDEX "doc_index_entry_idx_page_version" ON "docman_document_index_entries" USING btree ("tenantId","pageVersionId");--> statement-breakpoint
45
+ CREATE INDEX "doc_index_entry_idx_section" ON "docman_document_index_entries" USING btree ("tenantId","sectionId");
@@ -0,0 +1,9 @@
1
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "summaryText" text;
2
+ --> statement-breakpoint
3
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "sourceCharCount" integer DEFAULT 0 NOT NULL;
4
+ --> statement-breakpoint
5
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "sourceWordCount" integer DEFAULT 0 NOT NULL;
6
+ --> statement-breakpoint
7
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "summaryCharCount" integer DEFAULT 0 NOT NULL;
8
+ --> statement-breakpoint
9
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "summaryWordCount" integer DEFAULT 0 NOT NULL;
@@ -0,0 +1,9 @@
1
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "embeddingProvider" text;
2
+ --> statement-breakpoint
3
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "embeddingModel" text;
4
+ --> statement-breakpoint
5
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "embeddingHash" text;
6
+ --> statement-breakpoint
7
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "embeddingDimensions" integer;
8
+ --> statement-breakpoint
9
+ ALTER TABLE "docman_document_index_entries" ADD COLUMN "embeddingVector" text;
@@ -0,0 +1,15 @@
1
+ -- Step 8 of docman set-current-version slice (consensus topic
2
+ -- aops-cli-doc-set-current-version-sugar-2026-05-18).
3
+ --
4
+ -- Enforces "at most one isCurrent=true row per (tenantId, documentId)" at the
5
+ -- database level. The new docman.document-version.set-current service op
6
+ -- already maintains this invariant inside its transaction, but a partial
7
+ -- unique index makes the invariant robust against future migrations, manual
8
+ -- SQL, or concurrent writers that might bypass the service path.
9
+ --
10
+ -- PostgreSQL supports partial unique indexes natively. SQLite supports the
11
+ -- same syntax, so the drizzle SQLite mirror can carry the same index.
12
+
13
+ CREATE UNIQUE INDEX IF NOT EXISTS "document_version_unique_current"
14
+ ON "docman_document_versions" ("tenantId", "documentId")
15
+ WHERE "isCurrent" = true;
@@ -0,0 +1,55 @@
1
+ {
2
+ "version": "7",
3
+ "dialect": "postgresql",
4
+ "entries": [
5
+ {
6
+ "idx": 0,
7
+ "version": "7",
8
+ "when": 1772831979646,
9
+ "tag": "0000_curvy_valeria_richards",
10
+ "breakpoints": true
11
+ },
12
+ {
13
+ "idx": 1,
14
+ "version": "7",
15
+ "when": 1772833453900,
16
+ "tag": "0001_massive_risque",
17
+ "breakpoints": true
18
+ },
19
+ {
20
+ "idx": 2,
21
+ "version": "7",
22
+ "when": 1773831701245,
23
+ "tag": "0002_simple_logan",
24
+ "breakpoints": true
25
+ },
26
+ {
27
+ "idx": 3,
28
+ "version": "7",
29
+ "when": 1773837600000,
30
+ "tag": "0003_quick_index",
31
+ "breakpoints": true
32
+ },
33
+ {
34
+ "idx": 4,
35
+ "version": "7",
36
+ "when": 1773839700000,
37
+ "tag": "0004_known_summary",
38
+ "breakpoints": true
39
+ },
40
+ {
41
+ "idx": 5,
42
+ "version": "7",
43
+ "when": 1773842400000,
44
+ "tag": "0005_vector_signal",
45
+ "breakpoints": true
46
+ },
47
+ {
48
+ "idx": 6,
49
+ "version": "7",
50
+ "when": 1779113693327,
51
+ "tag": "0006_document_version_current_invariant",
52
+ "breakpoints": true
53
+ }
54
+ ]
55
+ }