@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,167 @@
1
+ const manifest = (() => {
2
+ function __memo(fn) {
3
+ let value;
4
+ return () => value ??= (value = fn());
5
+ }
6
+
7
+ return {
8
+ appDir: "_app",
9
+ appPath: "_app",
10
+ assets: new Set([]),
11
+ mimeTypes: {},
12
+ _: {
13
+ client: {start:"_app/immutable/entry/start.BC94hOaC.js",app:"_app/immutable/entry/app.C7STLTX8.js",imports:["_app/immutable/entry/start.BC94hOaC.js","_app/immutable/chunks/sZYZbj9W.js","_app/immutable/chunks/2_TffmqH.js","_app/immutable/chunks/B2EkC-sy.js","_app/immutable/entry/app.C7STLTX8.js","_app/immutable/chunks/2_TffmqH.js","_app/immutable/chunks/CMkIcmi1.js","_app/immutable/chunks/rqnVXeyB.js","_app/immutable/chunks/B2EkC-sy.js","_app/immutable/chunks/3DOfIKW0.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
14
+ nodes: [
15
+ __memo(() => import('./0-RfB6m2nq.js')),
16
+ __memo(() => import('./1-_gg8Q0UT.js'))
17
+ ],
18
+ remotes: {
19
+
20
+ },
21
+ routes: [
22
+ {
23
+ id: "/api-info.json",
24
+ pattern: /^\/api-info\.json\/?$/,
25
+ params: [],
26
+ page: null,
27
+ endpoint: __memo(() => import('./_server.ts-D6lBwOON.js'))
28
+ },
29
+ {
30
+ id: "/api-info",
31
+ pattern: /^\/api-info\/?$/,
32
+ params: [],
33
+ page: null,
34
+ endpoint: __memo(() => import('./_server.ts-Cv-yaXZI.js'))
35
+ },
36
+ {
37
+ id: "/api/agent/discovery.json",
38
+ pattern: /^\/api\/agent\/discovery\.json\/?$/,
39
+ params: [],
40
+ page: null,
41
+ endpoint: __memo(() => import('./_server.ts-CP7qM24V.js'))
42
+ },
43
+ {
44
+ id: "/api/agent/openapi.json",
45
+ pattern: /^\/api\/agent\/openapi\.json\/?$/,
46
+ params: [],
47
+ page: null,
48
+ endpoint: __memo(() => import('./_server.ts-Di9VJnF4.js'))
49
+ },
50
+ {
51
+ id: "/api/agent/tools",
52
+ pattern: /^\/api\/agent\/tools\/?$/,
53
+ params: [],
54
+ page: null,
55
+ endpoint: __memo(() => import('./_server.ts-Ch8fPT-o.js'))
56
+ },
57
+ {
58
+ id: "/api/agent/tools/[toolId]",
59
+ pattern: /^\/api\/agent\/tools\/([^/]+?)\/?$/,
60
+ params: [{"name":"toolId","optional":false,"rest":false,"chained":false}],
61
+ page: null,
62
+ endpoint: __memo(() => import('./_server.ts-BauJsLZI.js'))
63
+ },
64
+ {
65
+ id: "/api/agent/tools/[toolId]/invoke",
66
+ pattern: /^\/api\/agent\/tools\/([^/]+?)\/invoke\/?$/,
67
+ params: [{"name":"toolId","optional":false,"rest":false,"chained":false}],
68
+ page: null,
69
+ endpoint: __memo(() => import('./_server.ts-B59WFQzX.js'))
70
+ },
71
+ {
72
+ id: "/api/aops/docman/flows",
73
+ pattern: /^\/api\/aops\/docman\/flows\/?$/,
74
+ params: [],
75
+ page: null,
76
+ endpoint: __memo(() => import('./_server.ts-tNULLyEO.js'))
77
+ },
78
+ {
79
+ id: "/api/aops/projectman/flows",
80
+ pattern: /^\/api\/aops\/projectman\/flows\/?$/,
81
+ params: [],
82
+ page: null,
83
+ endpoint: __memo(() => import('./_server.ts-DNzU1ToA.js'))
84
+ },
85
+ {
86
+ id: "/api/aops/settings/database/status",
87
+ pattern: /^\/api\/aops\/settings\/database\/status\/?$/,
88
+ params: [],
89
+ page: null,
90
+ endpoint: __memo(() => import('./_server.ts-6276EQIF.js'))
91
+ },
92
+ {
93
+ id: "/api/auth/me",
94
+ pattern: /^\/api\/auth\/me\/?$/,
95
+ params: [],
96
+ page: null,
97
+ endpoint: __memo(() => import('./_server.ts-DQQnw77t.js'))
98
+ },
99
+ {
100
+ id: "/api/chatv3/v1/rooms/[roomId]/stream",
101
+ pattern: /^\/api\/chatv3\/v1\/rooms\/([^/]+?)\/stream\/?$/,
102
+ params: [{"name":"roomId","optional":false,"rest":false,"chained":false}],
103
+ page: null,
104
+ endpoint: __memo(() => import('./_server.ts-Cbq_u99d.js'))
105
+ },
106
+ {
107
+ id: "/api/health",
108
+ pattern: /^\/api\/health\/?$/,
109
+ params: [],
110
+ page: null,
111
+ endpoint: __memo(() => import('./_server.ts-FBEHFT8b.js'))
112
+ },
113
+ {
114
+ id: "/api/hello",
115
+ pattern: /^\/api\/hello\/?$/,
116
+ params: [],
117
+ page: null,
118
+ endpoint: __memo(() => import('./_server.ts-gZytCuiJ.js'))
119
+ },
120
+ {
121
+ id: "/api/host-admin/plugins",
122
+ pattern: /^\/api\/host-admin\/plugins\/?$/,
123
+ params: [],
124
+ page: null,
125
+ endpoint: __memo(() => import('./_server.ts-DZYokvuR.js'))
126
+ },
127
+ {
128
+ id: "/api/host-admin/runtime-config",
129
+ pattern: /^\/api\/host-admin\/runtime-config\/?$/,
130
+ params: [],
131
+ page: null,
132
+ endpoint: __memo(() => import('./_server.ts-D84K3pp9.js'))
133
+ },
134
+ {
135
+ id: "/api/host-admin/runtime-config/test",
136
+ pattern: /^\/api\/host-admin\/runtime-config\/test\/?$/,
137
+ params: [],
138
+ page: null,
139
+ endpoint: __memo(() => import('./_server.ts-DSxr5l15.js'))
140
+ },
141
+ {
142
+ id: "/api/[domain]/[...path]",
143
+ pattern: /^\/api\/([^/]+?)(?:\/([^]*))?\/?$/,
144
+ params: [{"name":"domain","optional":false,"rest":false,"chained":false},{"name":"path","optional":false,"rest":true,"chained":true}],
145
+ page: null,
146
+ endpoint: __memo(() => import('./_server.ts-Dcqwpz2t.js'))
147
+ },
148
+ {
149
+ id: "/openapi.json",
150
+ pattern: /^\/openapi\.json\/?$/,
151
+ params: [],
152
+ page: null,
153
+ endpoint: __memo(() => import('./_server.ts-BnGzJw2-.js'))
154
+ }
155
+ ],
156
+ prerendered_routes: new Set([]),
157
+ matchers: async () => {
158
+
159
+ return { };
160
+ },
161
+ server_assets: {}
162
+ }
163
+ }
164
+ })();
165
+
166
+ export { manifest as m };
167
+ //# sourceMappingURL=manifest.js-_Re-Wj-y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js-_Re-Wj-y.js","sources":["../../../.svelte-kit/output/server/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([]),\n\tmimeTypes: {},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.BC94hOaC.js\",app:\"_app/immutable/entry/app.C7STLTX8.js\",imports:[\"_app/immutable/entry/start.BC94hOaC.js\",\"_app/immutable/chunks/sZYZbj9W.js\",\"_app/immutable/chunks/2_TffmqH.js\",\"_app/immutable/chunks/B2EkC-sy.js\",\"_app/immutable/entry/app.C7STLTX8.js\",\"_app/immutable/chunks/2_TffmqH.js\",\"_app/immutable/chunks/CMkIcmi1.js\",\"_app/immutable/chunks/rqnVXeyB.js\",\"_app/immutable/chunks/B2EkC-sy.js\",\"_app/immutable/chunks/3DOfIKW0.js\"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js'))\n\t\t],\n\t\tremotes: {\n\t\t\t\n\t\t},\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/api-info.json\",\n\t\t\t\tpattern: /^\\/api-info\\.json\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api-info.json/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api-info\",\n\t\t\t\tpattern: /^\\/api-info\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api-info/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/agent/discovery.json\",\n\t\t\t\tpattern: /^\\/api\\/agent\\/discovery\\.json\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/agent/discovery.json/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/agent/openapi.json\",\n\t\t\t\tpattern: /^\\/api\\/agent\\/openapi\\.json\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/agent/openapi.json/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/agent/tools\",\n\t\t\t\tpattern: /^\\/api\\/agent\\/tools\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/agent/tools/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/agent/tools/[toolId]\",\n\t\t\t\tpattern: /^\\/api\\/agent\\/tools\\/([^/]+?)\\/?$/,\n\t\t\t\tparams: [{\"name\":\"toolId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/agent/tools/_toolId_/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/agent/tools/[toolId]/invoke\",\n\t\t\t\tpattern: /^\\/api\\/agent\\/tools\\/([^/]+?)\\/invoke\\/?$/,\n\t\t\t\tparams: [{\"name\":\"toolId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/agent/tools/_toolId_/invoke/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/aops/docman/flows\",\n\t\t\t\tpattern: /^\\/api\\/aops\\/docman\\/flows\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/aops/docman/flows/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/aops/projectman/flows\",\n\t\t\t\tpattern: /^\\/api\\/aops\\/projectman\\/flows\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/aops/projectman/flows/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/aops/settings/database/status\",\n\t\t\t\tpattern: /^\\/api\\/aops\\/settings\\/database\\/status\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/aops/settings/database/status/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/auth/me\",\n\t\t\t\tpattern: /^\\/api\\/auth\\/me\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/auth/me/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/chatv3/v1/rooms/[roomId]/stream\",\n\t\t\t\tpattern: /^\\/api\\/chatv3\\/v1\\/rooms\\/([^/]+?)\\/stream\\/?$/,\n\t\t\t\tparams: [{\"name\":\"roomId\",\"optional\":false,\"rest\":false,\"chained\":false}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/chatv3/v1/rooms/_roomId_/stream/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/health\",\n\t\t\t\tpattern: /^\\/api\\/health\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/health/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/hello\",\n\t\t\t\tpattern: /^\\/api\\/hello\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/hello/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/host-admin/plugins\",\n\t\t\t\tpattern: /^\\/api\\/host-admin\\/plugins\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/host-admin/plugins/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/host-admin/runtime-config\",\n\t\t\t\tpattern: /^\\/api\\/host-admin\\/runtime-config\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/host-admin/runtime-config/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/host-admin/runtime-config/test\",\n\t\t\t\tpattern: /^\\/api\\/host-admin\\/runtime-config\\/test\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/host-admin/runtime-config/test/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/api/[domain]/[...path]\",\n\t\t\t\tpattern: /^\\/api\\/([^/]+?)(?:\\/([^]*))?\\/?$/,\n\t\t\t\tparams: [{\"name\":\"domain\",\"optional\":false,\"rest\":false,\"chained\":false},{\"name\":\"path\",\"optional\":false,\"rest\":true,\"chained\":true}],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/api/_domain_/_...path_/_server.ts.js'))\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/openapi.json\",\n\t\t\t\tpattern: /^\\/openapi\\.json\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: null,\n\t\t\t\tendpoint: __memo(() => import('./entries/endpoints/openapi.json/_server.ts.js'))\n\t\t\t}\n\t\t],\n\t\tprerendered_routes: new Set([]),\n\t\tmatchers: async () => {\n\t\t\t\n\t\t\treturn { };\n\t\t},\n\t\tserver_assets: {}\n\t}\n}\n})();\n"],"names":[],"mappings":"AAAY,MAAC,QAAQ,GAAG,CAAC,MAAM;AAC/B,SAAS,MAAM,CAAC,EAAE,EAAE;AACpB,CAAC,IAAI,KAAK;AACV,CAAC,OAAO,MAAM,KAAK,MAAM,KAAK,GAAG,EAAE,EAAE,CAAC;AACtC;;AAEA,OAAO;AACP,CAAC,MAAM,EAAE,MAAM;AACf,CAAC,OAAO,EAAE,MAAM;AAChB,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;AACpB,CAAC,SAAS,EAAE,EAAE;AACd,CAAC,CAAC,EAAE;AACJ,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,wCAAwC,CAAC,GAAG,CAAC,sCAAsC,CAAC,OAAO,CAAC,CAAC,wCAAwC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,sCAAsC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC;AACrhB,EAAE,KAAK,EAAE;AACT,GAAG,MAAM,CAAC,MAAM,OA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
2
+ const KNOWN_ERROR_CODES = Object.freeze({
3
+ TOOL_NOT_FOUND: "tool_not_found",
4
+ PROJECT_CONTEXT_REQUIRED: "project_context_required",
5
+ APPLY_REQUIRED: "apply_required",
6
+ CONFIRMATION_REQUIRED: "confirmation_required",
7
+ TOOL_INPUT_SCHEMA_INVALID: "tool_input_schema_invalid",
8
+ INVALID_INPUT: "invalid_input",
9
+ UNAUTHORIZED: "unauthorized",
10
+ FORBIDDEN: "forbidden",
11
+ TOOL_INVOKE_FAILED: "tool_invoke_failed"
12
+ });
13
+ const PROJECT_CONTEXT_ERROR_HINTS = Object.freeze([
14
+ "project_required",
15
+ "project_context_required",
16
+ "project_scope_required",
17
+ "missing_project_context"
18
+ ]);
19
+ const TOOL_NOT_FOUND_HINTS = Object.freeze([
20
+ "tool_not_found",
21
+ "tool_not_resolved:",
22
+ "tool_source_not_found:",
23
+ "tool_source_unavailable:",
24
+ "operation_route_not_found:"
25
+ ]);
26
+ const APPLY_REQUIRED_HINTS = Object.freeze([
27
+ "apply_required",
28
+ "apply_required:"
29
+ ]);
30
+ const CONFIRMATION_REQUIRED_HINTS = Object.freeze([
31
+ "confirmation_required",
32
+ "confirmation_required:"
33
+ ]);
34
+ const INVALID_INPUT_PREFIX_HINTS = Object.freeze([
35
+ "missing_required_arg:",
36
+ "unknown_input_arg:",
37
+ "tool_input_schema_invalid:"
38
+ ]);
39
+ const INVALID_INPUT_GENERIC_HINTS = Object.freeze([
40
+ "validation_failed",
41
+ "invalid_input"
42
+ ]);
43
+ const normalizeErrorMessage = (message) => toText$1(message).toLowerCase();
44
+ const includesAnyHint = (normalizedMessage, hints) => hints.some((hint) => normalizedMessage.includes(String(hint ?? "").toLowerCase()));
45
+ const resolveKnownErrorCodeFromMessage = (message) => {
46
+ const normalizedMessage = normalizeErrorMessage(message);
47
+ if (!normalizedMessage) return "";
48
+ if (includesAnyHint(normalizedMessage, TOOL_NOT_FOUND_HINTS)) {
49
+ return KNOWN_ERROR_CODES.TOOL_NOT_FOUND;
50
+ }
51
+ if (includesAnyHint(normalizedMessage, PROJECT_CONTEXT_ERROR_HINTS)) {
52
+ return KNOWN_ERROR_CODES.PROJECT_CONTEXT_REQUIRED;
53
+ }
54
+ if (includesAnyHint(normalizedMessage, APPLY_REQUIRED_HINTS)) {
55
+ return KNOWN_ERROR_CODES.APPLY_REQUIRED;
56
+ }
57
+ if (includesAnyHint(normalizedMessage, CONFIRMATION_REQUIRED_HINTS)) {
58
+ return KNOWN_ERROR_CODES.CONFIRMATION_REQUIRED;
59
+ }
60
+ if (normalizedMessage.startsWith("tool_input_schema_invalid:")) {
61
+ return KNOWN_ERROR_CODES.TOOL_INPUT_SCHEMA_INVALID;
62
+ }
63
+ if (INVALID_INPUT_PREFIX_HINTS.some((prefix) => normalizedMessage.startsWith(prefix))) {
64
+ return KNOWN_ERROR_CODES.INVALID_INPUT;
65
+ }
66
+ if (includesAnyHint(normalizedMessage, INVALID_INPUT_GENERIC_HINTS)) {
67
+ return KNOWN_ERROR_CODES.INVALID_INPUT;
68
+ }
69
+ if (normalizedMessage === KNOWN_ERROR_CODES.UNAUTHORIZED) {
70
+ return KNOWN_ERROR_CODES.UNAUTHORIZED;
71
+ }
72
+ if (normalizedMessage === KNOWN_ERROR_CODES.FORBIDDEN) {
73
+ return KNOWN_ERROR_CODES.FORBIDDEN;
74
+ }
75
+ return "";
76
+ };
77
+ const classifyInvokeFailureMessage$1 = (message) => {
78
+ const errorCode = resolveKnownErrorCodeFromMessage(message);
79
+ if (errorCode === KNOWN_ERROR_CODES.TOOL_NOT_FOUND) {
80
+ return { status: 404, error: KNOWN_ERROR_CODES.TOOL_NOT_FOUND };
81
+ }
82
+ if (errorCode === KNOWN_ERROR_CODES.PROJECT_CONTEXT_REQUIRED) {
83
+ return { status: 409, error: KNOWN_ERROR_CODES.PROJECT_CONTEXT_REQUIRED };
84
+ }
85
+ if (errorCode === KNOWN_ERROR_CODES.APPLY_REQUIRED) {
86
+ return { status: 409, error: KNOWN_ERROR_CODES.APPLY_REQUIRED };
87
+ }
88
+ if (errorCode === KNOWN_ERROR_CODES.CONFIRMATION_REQUIRED) {
89
+ return { status: 409, error: KNOWN_ERROR_CODES.CONFIRMATION_REQUIRED };
90
+ }
91
+ if (errorCode === KNOWN_ERROR_CODES.INVALID_INPUT || errorCode === KNOWN_ERROR_CODES.TOOL_INPUT_SCHEMA_INVALID) {
92
+ return { status: 400, error: KNOWN_ERROR_CODES.INVALID_INPUT };
93
+ }
94
+ if (errorCode === KNOWN_ERROR_CODES.UNAUTHORIZED) {
95
+ return { status: 401, error: KNOWN_ERROR_CODES.UNAUTHORIZED };
96
+ }
97
+ if (errorCode === KNOWN_ERROR_CODES.FORBIDDEN) {
98
+ return { status: 403, error: KNOWN_ERROR_CODES.FORBIDDEN };
99
+ }
100
+ return { status: 500, error: KNOWN_ERROR_CODES.TOOL_INVOKE_FAILED };
101
+ };
102
+ function isRecord(value) {
103
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
104
+ }
105
+ function toText(value) {
106
+ return String(value ?? "").trim();
107
+ }
108
+ function normalizeErrorMessageValue(message) {
109
+ return toText(message).toLowerCase();
110
+ }
111
+ const INPUT_FAILURE_CODE_PREFIXES = [
112
+ "plugin_execution_failed.missing_",
113
+ "plugin_execution_failed.missing_required_",
114
+ "plugin_execution_failed.invalid_",
115
+ "plugin_execution_failed.tool_input_schema_invalid",
116
+ "plugin_execution_failed.unknown_input_",
117
+ "plugin_execution_failed.invalid_input",
118
+ "plugin_execution_failed.validation"
119
+ ];
120
+ const INPUT_FAILURE_MESSAGE_PATTERNS = [
121
+ /missing_required_arg:/i,
122
+ /\bmissing_[a-z0-9_]+/i,
123
+ /unknown_input_arg:/i,
124
+ /tool_input_schema_invalid:/i,
125
+ /\binvalid input\b/i,
126
+ /\bvalidation\b/i,
127
+ /pages cannot be nested under another page/i,
128
+ /sections can only be nested under other sections/i,
129
+ /selected parent section could not be resolved/i,
130
+ /document structure link id is required/i
131
+ ];
132
+ const NOT_FOUND_MESSAGE_PATTERN = /record not found|not[_\s-]?found/i;
133
+ const UNSAFE_RUNTIME_MESSAGE_PATTERNS = [
134
+ /failed query:/i,
135
+ /\bparams:\s*\[/i,
136
+ /\binsert into\b/i,
137
+ /\bupdate\b.+\bset\b/i,
138
+ /\bdelete from\b/i,
139
+ /\bselect\b.+\bfrom\b/i,
140
+ /\bsqlite/i,
141
+ /\bpostgres/i,
142
+ /\bdrizzle/i,
143
+ // repository/runtime internals that must not reach clients (e.g. typed
144
+ // not-found errors arriving as "Unexpected error in findById: ...").
145
+ /\bfind_?by[a-z]*\b/i,
146
+ /\bunexpected error\b/i,
147
+ /\brepository\b/i
148
+ ];
149
+ const CONFLICT_MESSAGE_PATTERNS = [
150
+ /conflict/i,
151
+ /already exists/i,
152
+ /duplicate/i,
153
+ /unique/i,
154
+ /expectedPreviousVersionId mismatch/i
155
+ ];
156
+ function isPluginExecutionFailure(payload) {
157
+ const errorCode = toText(payload.errorCode).toLowerCase();
158
+ const error = toText(payload.error).toLowerCase();
159
+ return errorCode.startsWith("plugin_execution_failed") || error === "plugin_execution_failed";
160
+ }
161
+ function isInputFailure(errorCode, message) {
162
+ if (INPUT_FAILURE_CODE_PREFIXES.some((prefix) => errorCode.startsWith(prefix))) return true;
163
+ return INPUT_FAILURE_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));
164
+ }
165
+ function classifyInvokeFailureMessage(message) {
166
+ const classification = classifyInvokeFailureMessage$1(message);
167
+ return {
168
+ status: classification.status,
169
+ error: classification.error
170
+ };
171
+ }
172
+ function isNotFoundFailure(errorCode, message) {
173
+ if (errorCode.endsWith(".not_found")) return true;
174
+ return NOT_FOUND_MESSAGE_PATTERN.test(message);
175
+ }
176
+ function isUnauthorizedFailure(errorCode, message) {
177
+ if (errorCode.endsWith(".unauthorized")) return true;
178
+ return message.toLowerCase() === "unauthorized";
179
+ }
180
+ function isForbiddenFailure(errorCode, message) {
181
+ if (errorCode.endsWith(".forbidden")) return true;
182
+ return message.toLowerCase() === "forbidden";
183
+ }
184
+ function isConflictFailure(errorCode, message) {
185
+ if (errorCode.endsWith(".conflict")) return true;
186
+ return CONFLICT_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));
187
+ }
188
+ function isUnsafeRuntimeMessage(message) {
189
+ return UNSAFE_RUNTIME_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));
190
+ }
191
+ function canonicalizePluginErrorCode(errorCode, message) {
192
+ if (!errorCode.startsWith("plugin_execution_failed")) return errorCode;
193
+ if (errorCode.endsWith(".conflict")) return errorCode;
194
+ if (isConflictFailure(errorCode, message)) return "plugin_execution_failed.conflict";
195
+ if (errorCode.endsWith(".not_found")) return errorCode;
196
+ if (isNotFoundFailure(errorCode, message)) return "plugin_execution_failed.not_found";
197
+ if (errorCode.endsWith(".validation") || errorCode.endsWith(".invalid_input")) return errorCode;
198
+ if (isInputFailure(errorCode, message)) return "plugin_execution_failed.invalid_input";
199
+ if (errorCode.endsWith(".unauthorized")) return errorCode;
200
+ if (isUnauthorizedFailure(errorCode, message)) return "plugin_execution_failed.unauthorized";
201
+ if (errorCode.endsWith(".forbidden")) return errorCode;
202
+ if (isForbiddenFailure(errorCode, message)) return "plugin_execution_failed.forbidden";
203
+ return errorCode;
204
+ }
205
+ function resolveKnownFailure(payload, message) {
206
+ const domain = toText(payload.domain).toLowerCase();
207
+ const operation = toText(payload.operation).toLowerCase();
208
+ if (domain === "projectman" && operation === "kanban-board.create") {
209
+ const hasBoardInsertSql = /\binsert into\s+"projectman_kanban_boards"/i.test(message);
210
+ const hasLikelyInputFailure = /invalid input syntax|foreign key|not-null|null value|check constraint/i.test(
211
+ message
212
+ );
213
+ if (hasBoardInsertSql && !hasLikelyInputFailure) {
214
+ return {
215
+ status: 409,
216
+ errorCode: "plugin_execution_failed.conflict",
217
+ message: "Kanban board already exists in this project (same name or position)."
218
+ };
219
+ }
220
+ }
221
+ return null;
222
+ }
223
+ function resolveSafePluginMessage(errorCode, message) {
224
+ const unsafe = isUnsafeRuntimeMessage(message);
225
+ if (isUnauthorizedFailure(errorCode, message)) return unsafe ? "Unauthorized" : message || "Unauthorized";
226
+ if (isForbiddenFailure(errorCode, message)) return unsafe ? "Forbidden" : message || "Forbidden";
227
+ if (isNotFoundFailure(errorCode, message)) return unsafe ? "Record not found" : message || "Record not found";
228
+ if (isConflictFailure(errorCode, message)) return unsafe ? "Conflict" : message || "Conflict";
229
+ if (isInputFailure(errorCode, message)) return unsafe ? "Invalid input" : message || "Invalid input";
230
+ if (!message) return "Runtime operation failed. Check server logs for details.";
231
+ if (errorCode.startsWith("plugin_execution_failed.runtime") || unsafe) {
232
+ return "Runtime operation failed. Check server logs for details.";
233
+ }
234
+ return message;
235
+ }
236
+ function inferFailureStatusFromPayload(payload, fallbackStatus) {
237
+ if (!isRecord(payload) || payload.ok !== false) return fallbackStatus;
238
+ const errorCode = toText(payload.errorCode).toLowerCase();
239
+ const message = normalizeErrorMessageValue(toText(payload.message));
240
+ if (errorCode.endsWith(".not_found") || /record not found/i.test(message) || /not[_\s-]?found/i.test(message)) {
241
+ return 404;
242
+ }
243
+ if (errorCode.endsWith(".unauthorized") || message === "unauthorized") return 401;
244
+ if (errorCode.endsWith(".forbidden") || message === "forbidden") return 403;
245
+ if (errorCode.endsWith(".conflict") || /conflict|already exists|duplicate|unique/i.test(message)) return 409;
246
+ if (errorCode.endsWith(".rate_limit") || /rate limit|too many requests|too many attempts/i.test(message)) return 429;
247
+ if (errorCode.endsWith(".service_unavailable")) return 503;
248
+ if (errorCode.endsWith(".invalid_input") || errorCode.endsWith(".validation") || isInputFailure(errorCode, message)) {
249
+ return 400;
250
+ }
251
+ return fallbackStatus < 400 ? 500 : fallbackStatus;
252
+ }
253
+ function normalizePluginFailure(status, payload) {
254
+ if (!isRecord(payload) || !isPluginExecutionFailure(payload)) {
255
+ return { status, payload, sanitized: false };
256
+ }
257
+ const errorCode = toText(payload.errorCode).toLowerCase();
258
+ const message = toText(payload.message);
259
+ const knownFailure = resolveKnownFailure(payload, message);
260
+ let mappedStatus = knownFailure?.status ?? status;
261
+ const effectiveErrorCode = canonicalizePluginErrorCode(
262
+ knownFailure?.errorCode ?? errorCode,
263
+ knownFailure?.message ?? message
264
+ );
265
+ const effectiveMessage = knownFailure?.message ?? message;
266
+ if (status === 500) {
267
+ if (isNotFoundFailure(effectiveErrorCode, effectiveMessage)) {
268
+ mappedStatus = 404;
269
+ } else if (isConflictFailure(effectiveErrorCode, effectiveMessage)) {
270
+ mappedStatus = 409;
271
+ } else if (isInputFailure(effectiveErrorCode, effectiveMessage)) {
272
+ mappedStatus = 400;
273
+ } else if (isUnauthorizedFailure(effectiveErrorCode, effectiveMessage)) {
274
+ mappedStatus = 401;
275
+ } else if (isForbiddenFailure(effectiveErrorCode, effectiveMessage)) {
276
+ mappedStatus = 403;
277
+ }
278
+ }
279
+ const safeMessage = resolveSafePluginMessage(effectiveErrorCode, effectiveMessage);
280
+ const shouldSetErrorCode = toText(payload.errorCode) !== effectiveErrorCode;
281
+ const sanitized = safeMessage !== message || shouldSetErrorCode;
282
+ const nextPayload = sanitized ? {
283
+ ...payload,
284
+ errorCode: effectiveErrorCode,
285
+ message: safeMessage
286
+ } : payload;
287
+ return {
288
+ status: mappedStatus,
289
+ payload: nextPayload,
290
+ sanitized,
291
+ originalMessage: message || void 0,
292
+ safeMessage: safeMessage || void 0
293
+ };
294
+ }
295
+
296
+ export { classifyInvokeFailureMessage as c, inferFailureStatusFromPayload as i, normalizePluginFailure as n };
297
+ //# sourceMappingURL=plugin-error-normalize-Bq14Qbz3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-error-normalize-Bq14Qbz3.js","sources":["../../../.svelte-kit/output/server/chunks/plugin-error-normalize.js"],"sourcesContent":["const toText$1 = (value) => String(value ?? \"\").trim();\nconst KNOWN_ERROR_CODES = Object.freeze({\n TOOL_NOT_FOUND: \"tool_not_found\",\n PROJECT_CONTEXT_REQUIRED: \"project_context_required\",\n APPLY_REQUIRED: \"apply_required\",\n CONFIRMATION_REQUIRED: \"confirmation_required\",\n TOOL_INPUT_SCHEMA_INVALID: \"tool_input_schema_invalid\",\n INVALID_INPUT: \"invalid_input\",\n UNAUTHORIZED: \"unauthorized\",\n FORBIDDEN: \"forbidden\",\n TOOL_INVOKE_FAILED: \"tool_invoke_failed\"\n});\nconst PROJECT_CONTEXT_ERROR_HINTS = Object.freeze([\n \"project_required\",\n \"project_context_required\",\n \"project_scope_required\",\n \"missing_project_context\"\n]);\nconst TOOL_NOT_FOUND_HINTS = Object.freeze([\n \"tool_not_found\",\n \"tool_not_resolved:\",\n \"tool_source_not_found:\",\n \"tool_source_unavailable:\",\n \"operation_route_not_found:\"\n]);\nconst APPLY_REQUIRED_HINTS = Object.freeze([\n \"apply_required\",\n \"apply_required:\"\n]);\nconst CONFIRMATION_REQUIRED_HINTS = Object.freeze([\n \"confirmation_required\",\n \"confirmation_required:\"\n]);\nconst INVALID_INPUT_PREFIX_HINTS = Object.freeze([\n \"missing_required_arg:\",\n \"unknown_input_arg:\",\n \"tool_input_schema_invalid:\"\n]);\nconst INVALID_INPUT_GENERIC_HINTS = Object.freeze([\n \"validation_failed\",\n \"invalid_input\"\n]);\nconst normalizeErrorMessage = (message) => toText$1(message).toLowerCase();\nconst includesAnyHint = (normalizedMessage, hints) => hints.some((hint) => normalizedMessage.includes(String(hint ?? \"\").toLowerCase()));\nconst resolveKnownErrorCodeFromMessage = (message) => {\n const normalizedMessage = normalizeErrorMessage(message);\n if (!normalizedMessage) return \"\";\n if (includesAnyHint(normalizedMessage, TOOL_NOT_FOUND_HINTS)) {\n return KNOWN_ERROR_CODES.TOOL_NOT_FOUND;\n }\n if (includesAnyHint(normalizedMessage, PROJECT_CONTEXT_ERROR_HINTS)) {\n return KNOWN_ERROR_CODES.PROJECT_CONTEXT_REQUIRED;\n }\n if (includesAnyHint(normalizedMessage, APPLY_REQUIRED_HINTS)) {\n return KNOWN_ERROR_CODES.APPLY_REQUIRED;\n }\n if (includesAnyHint(normalizedMessage, CONFIRMATION_REQUIRED_HINTS)) {\n return KNOWN_ERROR_CODES.CONFIRMATION_REQUIRED;\n }\n if (normalizedMessage.startsWith(\"tool_input_schema_invalid:\")) {\n return KNOWN_ERROR_CODES.TOOL_INPUT_SCHEMA_INVALID;\n }\n if (INVALID_INPUT_PREFIX_HINTS.some((prefix) => normalizedMessage.startsWith(prefix))) {\n return KNOWN_ERROR_CODES.INVALID_INPUT;\n }\n if (includesAnyHint(normalizedMessage, INVALID_INPUT_GENERIC_HINTS)) {\n return KNOWN_ERROR_CODES.INVALID_INPUT;\n }\n if (normalizedMessage === KNOWN_ERROR_CODES.UNAUTHORIZED) {\n return KNOWN_ERROR_CODES.UNAUTHORIZED;\n }\n if (normalizedMessage === KNOWN_ERROR_CODES.FORBIDDEN) {\n return KNOWN_ERROR_CODES.FORBIDDEN;\n }\n return \"\";\n};\nconst classifyInvokeFailureMessage$1 = (message) => {\n const errorCode = resolveKnownErrorCodeFromMessage(message);\n if (errorCode === KNOWN_ERROR_CODES.TOOL_NOT_FOUND) {\n return { status: 404, error: KNOWN_ERROR_CODES.TOOL_NOT_FOUND };\n }\n if (errorCode === KNOWN_ERROR_CODES.PROJECT_CONTEXT_REQUIRED) {\n return { status: 409, error: KNOWN_ERROR_CODES.PROJECT_CONTEXT_REQUIRED };\n }\n if (errorCode === KNOWN_ERROR_CODES.APPLY_REQUIRED) {\n return { status: 409, error: KNOWN_ERROR_CODES.APPLY_REQUIRED };\n }\n if (errorCode === KNOWN_ERROR_CODES.CONFIRMATION_REQUIRED) {\n return { status: 409, error: KNOWN_ERROR_CODES.CONFIRMATION_REQUIRED };\n }\n if (errorCode === KNOWN_ERROR_CODES.INVALID_INPUT || errorCode === KNOWN_ERROR_CODES.TOOL_INPUT_SCHEMA_INVALID) {\n return { status: 400, error: KNOWN_ERROR_CODES.INVALID_INPUT };\n }\n if (errorCode === KNOWN_ERROR_CODES.UNAUTHORIZED) {\n return { status: 401, error: KNOWN_ERROR_CODES.UNAUTHORIZED };\n }\n if (errorCode === KNOWN_ERROR_CODES.FORBIDDEN) {\n return { status: 403, error: KNOWN_ERROR_CODES.FORBIDDEN };\n }\n return { status: 500, error: KNOWN_ERROR_CODES.TOOL_INVOKE_FAILED };\n};\nfunction isRecord(value) {\n return Boolean(value) && typeof value === \"object\" && !Array.isArray(value);\n}\nfunction toText(value) {\n return String(value ?? \"\").trim();\n}\nfunction normalizeErrorMessageValue(message) {\n return toText(message).toLowerCase();\n}\nconst INPUT_FAILURE_CODE_PREFIXES = [\n \"plugin_execution_failed.missing_\",\n \"plugin_execution_failed.missing_required_\",\n \"plugin_execution_failed.invalid_\",\n \"plugin_execution_failed.tool_input_schema_invalid\",\n \"plugin_execution_failed.unknown_input_\",\n \"plugin_execution_failed.invalid_input\",\n \"plugin_execution_failed.validation\"\n];\nconst INPUT_FAILURE_MESSAGE_PATTERNS = [\n /missing_required_arg:/i,\n /\\bmissing_[a-z0-9_]+/i,\n /unknown_input_arg:/i,\n /tool_input_schema_invalid:/i,\n /\\binvalid input\\b/i,\n /\\bvalidation\\b/i,\n /pages cannot be nested under another page/i,\n /sections can only be nested under other sections/i,\n /selected parent section could not be resolved/i,\n /document structure link id is required/i\n];\nconst NOT_FOUND_MESSAGE_PATTERN = /record not found|not[_\\s-]?found/i;\nconst UNSAFE_RUNTIME_MESSAGE_PATTERNS = [\n /failed query:/i,\n /\\bparams:\\s*\\[/i,\n /\\binsert into\\b/i,\n /\\bupdate\\b.+\\bset\\b/i,\n /\\bdelete from\\b/i,\n /\\bselect\\b.+\\bfrom\\b/i,\n /\\bsqlite/i,\n /\\bpostgres/i,\n /\\bdrizzle/i,\n // repository/runtime internals that must not reach clients (e.g. typed\n // not-found errors arriving as \"Unexpected error in findById: ...\").\n /\\bfind_?by[a-z]*\\b/i,\n /\\bunexpected error\\b/i,\n /\\brepository\\b/i\n];\nconst CONFLICT_MESSAGE_PATTERNS = [\n /conflict/i,\n /already exists/i,\n /duplicate/i,\n /unique/i,\n /expectedPreviousVersionId mismatch/i\n];\nfunction isPluginExecutionFailure(payload) {\n const errorCode = toText(payload.errorCode).toLowerCase();\n const error = toText(payload.error).toLowerCase();\n return errorCode.startsWith(\"plugin_execution_failed\") || error === \"plugin_execution_failed\";\n}\nfunction isInputFailure(errorCode, message) {\n if (INPUT_FAILURE_CODE_PREFIXES.some((prefix) => errorCode.startsWith(prefix))) return true;\n return INPUT_FAILURE_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));\n}\nfunction classifyInvokeFailureMessage(message) {\n const classification = classifyInvokeFailureMessage$1(message);\n return {\n status: classification.status,\n error: classification.error\n };\n}\nfunction isNotFoundFailure(errorCode, message) {\n if (errorCode.endsWith(\".not_found\")) return true;\n return NOT_FOUND_MESSAGE_PATTERN.test(message);\n}\nfunction isUnauthorizedFailure(errorCode, message) {\n if (errorCode.endsWith(\".unauthorized\")) return true;\n return message.toLowerCase() === \"unauthorized\";\n}\nfunction isForbiddenFailure(errorCode, message) {\n if (errorCode.endsWith(\".forbidden\")) return true;\n return message.toLowerCase() === \"forbidden\";\n}\nfunction isConflictFailure(errorCode, message) {\n if (errorCode.endsWith(\".conflict\")) return true;\n return CONFLICT_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));\n}\nfunction isUnsafeRuntimeMessage(message) {\n return UNSAFE_RUNTIME_MESSAGE_PATTERNS.some((pattern) => pattern.test(message));\n}\nfunction canonicalizePluginErrorCode(errorCode, message) {\n if (!errorCode.startsWith(\"plugin_execution_failed\")) return errorCode;\n if (errorCode.endsWith(\".conflict\")) return errorCode;\n if (isConflictFailure(errorCode, message)) return \"plugin_execution_failed.conflict\";\n if (errorCode.endsWith(\".not_found\")) return errorCode;\n if (isNotFoundFailure(errorCode, message)) return \"plugin_execution_failed.not_found\";\n if (errorCode.endsWith(\".validation\") || errorCode.endsWith(\".invalid_input\")) return errorCode;\n if (isInputFailure(errorCode, message)) return \"plugin_execution_failed.invalid_input\";\n if (errorCode.endsWith(\".unauthorized\")) return errorCode;\n if (isUnauthorizedFailure(errorCode, message)) return \"plugin_execution_failed.unauthorized\";\n if (errorCode.endsWith(\".forbidden\")) return errorCode;\n if (isForbiddenFailure(errorCode, message)) return \"plugin_execution_failed.forbidden\";\n return errorCode;\n}\nfunction resolveKnownFailure(payload, message) {\n const domain = toText(payload.domain).toLowerCase();\n const operation = toText(payload.operation).toLowerCase();\n if (domain === \"projectman\" && operation === \"kanban-board.create\") {\n const hasBoardInsertSql = /\\binsert into\\s+\"projectman_kanban_boards\"/i.test(message);\n const hasLikelyInputFailure = /invalid input syntax|foreign key|not-null|null value|check constraint/i.test(\n message\n );\n if (hasBoardInsertSql && !hasLikelyInputFailure) {\n return {\n status: 409,\n errorCode: \"plugin_execution_failed.conflict\",\n message: \"Kanban board already exists in this project (same name or position).\"\n };\n }\n }\n return null;\n}\nfunction resolveSafePluginMessage(errorCode, message) {\n const unsafe = isUnsafeRuntimeMessage(message);\n if (isUnauthorizedFailure(errorCode, message)) return unsafe ? \"Unauthorized\" : message || \"Unauthorized\";\n if (isForbiddenFailure(errorCode, message)) return unsafe ? \"Forbidden\" : message || \"Forbidden\";\n if (isNotFoundFailure(errorCode, message)) return unsafe ? \"Record not found\" : message || \"Record not found\";\n if (isConflictFailure(errorCode, message)) return unsafe ? \"Conflict\" : message || \"Conflict\";\n if (isInputFailure(errorCode, message)) return unsafe ? \"Invalid input\" : message || \"Invalid input\";\n if (!message) return \"Runtime operation failed. Check server logs for details.\";\n if (errorCode.startsWith(\"plugin_execution_failed.runtime\") || unsafe) {\n return \"Runtime operation failed. Check server logs for details.\";\n }\n return message;\n}\nfunction inferFailureStatusFromPayload(payload, fallbackStatus) {\n if (!isRecord(payload) || payload.ok !== false) return fallbackStatus;\n const errorCode = toText(payload.errorCode).toLowerCase();\n const message = normalizeErrorMessageValue(toText(payload.message));\n if (errorCode.endsWith(\".not_found\") || /record not found/i.test(message) || /not[_\\s-]?found/i.test(message)) {\n return 404;\n }\n if (errorCode.endsWith(\".unauthorized\") || message === \"unauthorized\") return 401;\n if (errorCode.endsWith(\".forbidden\") || message === \"forbidden\") return 403;\n if (errorCode.endsWith(\".conflict\") || /conflict|already exists|duplicate|unique/i.test(message)) return 409;\n if (errorCode.endsWith(\".rate_limit\") || /rate limit|too many requests|too many attempts/i.test(message)) return 429;\n if (errorCode.endsWith(\".service_unavailable\")) return 503;\n if (errorCode.endsWith(\".invalid_input\") || errorCode.endsWith(\".validation\") || isInputFailure(errorCode, message)) {\n return 400;\n }\n return fallbackStatus < 400 ? 500 : fallbackStatus;\n}\nfunction normalizePluginFailure(status, payload) {\n if (!isRecord(payload) || !isPluginExecutionFailure(payload)) {\n return { status, payload, sanitized: false };\n }\n const errorCode = toText(payload.errorCode).toLowerCase();\n const message = toText(payload.message);\n const knownFailure = resolveKnownFailure(payload, message);\n let mappedStatus = knownFailure?.status ?? status;\n const effectiveErrorCode = canonicalizePluginErrorCode(\n knownFailure?.errorCode ?? errorCode,\n knownFailure?.message ?? message\n );\n const effectiveMessage = knownFailure?.message ?? message;\n if (status === 500) {\n if (isNotFoundFailure(effectiveErrorCode, effectiveMessage)) {\n mappedStatus = 404;\n } else if (isConflictFailure(effectiveErrorCode, effectiveMessage)) {\n mappedStatus = 409;\n } else if (isInputFailure(effectiveErrorCode, effectiveMessage)) {\n mappedStatus = 400;\n } else if (isUnauthorizedFailure(effectiveErrorCode, effectiveMessage)) {\n mappedStatus = 401;\n } else if (isForbiddenFailure(effectiveErrorCode, effectiveMessage)) {\n mappedStatus = 403;\n }\n }\n const safeMessage = resolveSafePluginMessage(effectiveErrorCode, effectiveMessage);\n const shouldSetErrorCode = toText(payload.errorCode) !== effectiveErrorCode;\n const sanitized = safeMessage !== message || shouldSetErrorCode;\n const nextPayload = sanitized ? {\n ...payload,\n errorCode: effectiveErrorCode,\n message: safeMessage\n } : payload;\n return {\n status: mappedStatus,\n payload: nextPayload,\n sanitized,\n originalMessage: message || void 0,\n safeMessage: safeMessage || void 0\n };\n}\nexport {\n classifyInvokeFailureMessage as c,\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AkB;AACjE,EAAE,MAAM,WAAW,GAAG,SAAS,GAAG;AAClC,IAAI,GAAG,OAAO;AACd,IAAI,SAAS,EAAE,kBAAkB;AACjC,IAAI,OAAO,EAAE;AACb,GAAG,GAAG,OAAO;AACb,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,YAAY;AACxB,IAAI,OAAO,EAAE,WAAW;AACxB,IAAI,SAAS;AACb,IAAI,eAAe,EAAE,OAAO,IAAI,MAAM;AACtC,IAAI,WAAW,EAAE,WAAW,IAAI;AAChC,GAAG;AACH;;;;"}
@@ -0,0 +1,29 @@
1
+ async function getLogger(opts = {}) {
2
+ const { level = "info", file = false, console = true } = opts;
3
+ const mod = await import('@aopslab/xf-logger');
4
+ return await mod.createLogger({
5
+ level,
6
+ runtime: "nodejs",
7
+ printServerConsole: !!console,
8
+ printFile: file,
9
+ fileType: "txt",
10
+ splitErrorWarn: true,
11
+ prettyConsole: true,
12
+ path: "./logs/aops-server",
13
+ base: { module: "AOPS-API" }
14
+ });
15
+ }
16
+ function normalizeNonEmptyProjectText(value) {
17
+ if (typeof value !== "string") return void 0;
18
+ const trimmed = value.trim();
19
+ return trimmed.length > 0 ? trimmed : void 0;
20
+ }
21
+ function resolveProjectAliasValue(input) {
22
+ return normalizeNonEmptyProjectText(input.projectId) ?? normalizeNonEmptyProjectText(input.projectName) ?? normalizeNonEmptyProjectText(input.project);
23
+ }
24
+ function hasProjectAliasValue(input, contextProjectId) {
25
+ return Boolean(resolveProjectAliasValue(input) ?? normalizeNonEmptyProjectText(contextProjectId));
26
+ }
27
+
28
+ export { getLogger as g, hasProjectAliasValue as h, normalizeNonEmptyProjectText as n, resolveProjectAliasValue as r };
29
+ //# sourceMappingURL=project-alias-DqE2v58Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-alias-DqE2v58Q.js","sources":["../../../.svelte-kit/output/server/chunks/project-alias.js"],"sourcesContent":["async function getLogger(opts = {}) {\n const { level = \"info\", file = false, console = true } = opts;\n const mod = await import(\"@aopslab/xf-logger\");\n return await mod.createLogger({\n level,\n runtime: \"nodejs\",\n printServerConsole: !!console,\n printFile: file,\n fileType: \"txt\",\n splitErrorWarn: true,\n prettyConsole: true,\n path: \"./logs/aops-server\",\n base: { module: \"AOPS-API\" }\n });\n}\nfunction normalizeNonEmptyProjectText(value) {\n if (typeof value !== \"string\") return void 0;\n const trimmed = value.trim();\n return trimmed.length > 0 ? trimmed : void 0;\n}\nfunction resolveProjectAliasValue(input) {\n return normalizeNonEmptyProjectText(input.projectId) ?? normalizeNonEmptyProjectText(input.projectName) ?? normalizeNonEmptyProjectText(input.project);\n}\nfunction hasProjectAliasValue(input, contextProjectId) {\n return Boolean(resolveProjectAliasValue(input) ?? normalizeNonEmptyProjectText(contextProjectId));\n}\nexport {\n getLogger as g,\n hasProjectAliasValue as h,\n normalizeNonEmptyProjectText as n,\n resolveProjectAliasValue as r\n};\n"],"names":[],"mappings":"AAAA,eAAe,SAAS,CAAC,IAAI,GAAG,EAAE,EAAE;AACpC,EAAE,MAAM,EAAE,KAAK,GAAG,MAAM,EAAE,IAAI,GAAG,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,GAAG,IAAI;AAC/D,EAAE,MAAM,GAAG,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAChD,EAAE,OAAO,MAAM,GAAG,CAAC,YAAY,CAAC;AAChC,IAAI,KAAK;AACT,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,kBAAkB,EAAE,CAAC,CAAC,OAAO;AACjC,IAAI,SAAS,EAAE,IAAI;AACnB,IAAI,QAAQ,EAAE,KAAK;AACnB,IAAI,cAAc,EAAE,IAAI;AACxB,IAAI,aAAa,EAAE,IAAI;AACvB,IAAI,IAAI,EAAE,oBAAoB;AAC9B,IAAI,IAAI,EAAE,EAAE,MAAM,EAAE,UAAU;AAC9B,GAAG,CAAC;AACJ;AACA,SAAS,4BAA4B,CAAC,KAAK,EAAE;AAC7C,EAAE,IAAI,OAAO,KAAK,KAAK,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