@jini-ai/integrations 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 (191) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +51 -0
  3. package/dist/composio/bounded-data.d.ts +36 -0
  4. package/dist/composio/bounded-data.d.ts.map +1 -0
  5. package/dist/composio/bounded-data.js +181 -0
  6. package/dist/composio/bounded-data.js.map +1 -0
  7. package/dist/composio/catalog.d.ts +147 -0
  8. package/dist/composio/catalog.d.ts.map +1 -0
  9. package/dist/composio/catalog.js +126 -0
  10. package/dist/composio/catalog.js.map +1 -0
  11. package/dist/composio/composio-config.d.ts +42 -0
  12. package/dist/composio/composio-config.d.ts.map +1 -0
  13. package/dist/composio/composio-config.js +145 -0
  14. package/dist/composio/composio-config.js.map +1 -0
  15. package/dist/composio/composio-descriptions.d.ts +16 -0
  16. package/dist/composio/composio-descriptions.d.ts.map +1 -0
  17. package/dist/composio/composio-descriptions.js +766 -0
  18. package/dist/composio/composio-descriptions.js.map +1 -0
  19. package/dist/composio/composio.d.ts +364 -0
  20. package/dist/composio/composio.d.ts.map +1 -0
  21. package/dist/composio/composio.js +1902 -0
  22. package/dist/composio/composio.js.map +1 -0
  23. package/dist/composio/errors.d.ts +15 -0
  24. package/dist/composio/errors.d.ts.map +1 -0
  25. package/dist/composio/errors.js +16 -0
  26. package/dist/composio/errors.js.map +1 -0
  27. package/dist/composio/file-lock.d.ts +13 -0
  28. package/dist/composio/file-lock.d.ts.map +1 -0
  29. package/dist/composio/file-lock.js +92 -0
  30. package/dist/composio/file-lock.js.map +1 -0
  31. package/dist/composio/index.d.ts +18 -0
  32. package/dist/composio/index.d.ts.map +1 -0
  33. package/dist/composio/index.js +7 -0
  34. package/dist/composio/index.js.map +1 -0
  35. package/dist/composio/json-schema.d.ts +93 -0
  36. package/dist/composio/json-schema.d.ts.map +1 -0
  37. package/dist/composio/json-schema.js +498 -0
  38. package/dist/composio/json-schema.js.map +1 -0
  39. package/dist/composio/output-protection.d.ts +32 -0
  40. package/dist/composio/output-protection.d.ts.map +1 -0
  41. package/dist/composio/output-protection.js +105 -0
  42. package/dist/composio/output-protection.js.map +1 -0
  43. package/dist/composio/service.d.ts +181 -0
  44. package/dist/composio/service.d.ts.map +1 -0
  45. package/dist/composio/service.js +758 -0
  46. package/dist/composio/service.js.map +1 -0
  47. package/dist/media-providers/capability-registry.d.ts +28 -0
  48. package/dist/media-providers/capability-registry.d.ts.map +1 -0
  49. package/dist/media-providers/capability-registry.js +27 -0
  50. package/dist/media-providers/capability-registry.js.map +1 -0
  51. package/dist/media-providers/catalog.d.ts +20 -0
  52. package/dist/media-providers/catalog.d.ts.map +1 -0
  53. package/dist/media-providers/catalog.js +20 -0
  54. package/dist/media-providers/catalog.js.map +1 -0
  55. package/dist/media-providers/dispatch/context.d.ts +21 -0
  56. package/dist/media-providers/dispatch/context.d.ts.map +1 -0
  57. package/dist/media-providers/dispatch/context.js +36 -0
  58. package/dist/media-providers/dispatch/context.js.map +1 -0
  59. package/dist/media-providers/dispatch/credentials.d.ts +4 -0
  60. package/dist/media-providers/dispatch/credentials.d.ts.map +1 -0
  61. package/dist/media-providers/dispatch/credentials.js +25 -0
  62. package/dist/media-providers/dispatch/credentials.js.map +1 -0
  63. package/dist/media-providers/dispatch/engine.d.ts +30 -0
  64. package/dist/media-providers/dispatch/engine.d.ts.map +1 -0
  65. package/dist/media-providers/dispatch/engine.js +208 -0
  66. package/dist/media-providers/dispatch/engine.js.map +1 -0
  67. package/dist/media-providers/dispatch/index.d.ts +25 -0
  68. package/dist/media-providers/dispatch/index.d.ts.map +1 -0
  69. package/dist/media-providers/dispatch/index.js +24 -0
  70. package/dist/media-providers/dispatch/index.js.map +1 -0
  71. package/dist/media-providers/dispatch/openai-compatible.d.ts +44 -0
  72. package/dist/media-providers/dispatch/openai-compatible.d.ts.map +1 -0
  73. package/dist/media-providers/dispatch/openai-compatible.js +214 -0
  74. package/dist/media-providers/dispatch/openai-compatible.js.map +1 -0
  75. package/dist/media-providers/dispatch/providers/aihubmix-shared.d.ts +72 -0
  76. package/dist/media-providers/dispatch/providers/aihubmix-shared.d.ts.map +1 -0
  77. package/dist/media-providers/dispatch/providers/aihubmix-shared.js +131 -0
  78. package/dist/media-providers/dispatch/providers/aihubmix-shared.js.map +1 -0
  79. package/dist/media-providers/dispatch/providers/aihubmix.d.ts +4 -0
  80. package/dist/media-providers/dispatch/providers/aihubmix.d.ts.map +1 -0
  81. package/dist/media-providers/dispatch/providers/aihubmix.js +205 -0
  82. package/dist/media-providers/dispatch/providers/aihubmix.js.map +1 -0
  83. package/dist/media-providers/dispatch/providers/custom-image.d.ts +6 -0
  84. package/dist/media-providers/dispatch/providers/custom-image.d.ts.map +1 -0
  85. package/dist/media-providers/dispatch/providers/custom-image.js +94 -0
  86. package/dist/media-providers/dispatch/providers/custom-image.js.map +1 -0
  87. package/dist/media-providers/dispatch/providers/elevenlabs.d.ts +4 -0
  88. package/dist/media-providers/dispatch/providers/elevenlabs.d.ts.map +1 -0
  89. package/dist/media-providers/dispatch/providers/elevenlabs.js +163 -0
  90. package/dist/media-providers/dispatch/providers/elevenlabs.js.map +1 -0
  91. package/dist/media-providers/dispatch/providers/fishaudio.d.ts +3 -0
  92. package/dist/media-providers/dispatch/providers/fishaudio.d.ts.map +1 -0
  93. package/dist/media-providers/dispatch/providers/fishaudio.js +83 -0
  94. package/dist/media-providers/dispatch/providers/fishaudio.js.map +1 -0
  95. package/dist/media-providers/dispatch/providers/grok.d.ts +15 -0
  96. package/dist/media-providers/dispatch/providers/grok.d.ts.map +1 -0
  97. package/dist/media-providers/dispatch/providers/grok.js +150 -0
  98. package/dist/media-providers/dispatch/providers/grok.js.map +1 -0
  99. package/dist/media-providers/dispatch/providers/imagerouter.d.ts +6 -0
  100. package/dist/media-providers/dispatch/providers/imagerouter.d.ts.map +1 -0
  101. package/dist/media-providers/dispatch/providers/imagerouter.js +131 -0
  102. package/dist/media-providers/dispatch/providers/imagerouter.js.map +1 -0
  103. package/dist/media-providers/dispatch/providers/minimax.d.ts +3 -0
  104. package/dist/media-providers/dispatch/providers/minimax.d.ts.map +1 -0
  105. package/dist/media-providers/dispatch/providers/minimax.js +96 -0
  106. package/dist/media-providers/dispatch/providers/minimax.js.map +1 -0
  107. package/dist/media-providers/dispatch/providers/nanobanana.d.ts +3 -0
  108. package/dist/media-providers/dispatch/providers/nanobanana.d.ts.map +1 -0
  109. package/dist/media-providers/dispatch/providers/nanobanana.js +142 -0
  110. package/dist/media-providers/dispatch/providers/nanobanana.js.map +1 -0
  111. package/dist/media-providers/dispatch/providers/openai.d.ts +4 -0
  112. package/dist/media-providers/dispatch/providers/openai.d.ts.map +1 -0
  113. package/dist/media-providers/dispatch/providers/openai.js +231 -0
  114. package/dist/media-providers/dispatch/providers/openai.js.map +1 -0
  115. package/dist/media-providers/dispatch/providers/openrouter.d.ts +13 -0
  116. package/dist/media-providers/dispatch/providers/openrouter.d.ts.map +1 -0
  117. package/dist/media-providers/dispatch/providers/openrouter.js +152 -0
  118. package/dist/media-providers/dispatch/providers/openrouter.js.map +1 -0
  119. package/dist/media-providers/dispatch/providers/senseaudio.d.ts +4 -0
  120. package/dist/media-providers/dispatch/providers/senseaudio.d.ts.map +1 -0
  121. package/dist/media-providers/dispatch/providers/senseaudio.js +190 -0
  122. package/dist/media-providers/dispatch/providers/senseaudio.js.map +1 -0
  123. package/dist/media-providers/dispatch/providers/volcengine.d.ts +3 -0
  124. package/dist/media-providers/dispatch/providers/volcengine.d.ts.map +1 -0
  125. package/dist/media-providers/dispatch/providers/volcengine.js +95 -0
  126. package/dist/media-providers/dispatch/providers/volcengine.js.map +1 -0
  127. package/dist/media-providers/dispatch/response-parsers.d.ts +44 -0
  128. package/dist/media-providers/dispatch/response-parsers.d.ts.map +1 -0
  129. package/dist/media-providers/dispatch/response-parsers.js +103 -0
  130. package/dist/media-providers/dispatch/response-parsers.js.map +1 -0
  131. package/dist/media-providers/dispatch/ssrf-guard.d.ts +51 -0
  132. package/dist/media-providers/dispatch/ssrf-guard.d.ts.map +1 -0
  133. package/dist/media-providers/dispatch/ssrf-guard.js +215 -0
  134. package/dist/media-providers/dispatch/ssrf-guard.js.map +1 -0
  135. package/dist/media-providers/dispatch/stub.d.ts +5 -0
  136. package/dist/media-providers/dispatch/stub.d.ts.map +1 -0
  137. package/dist/media-providers/dispatch/stub.js +98 -0
  138. package/dist/media-providers/dispatch/stub.js.map +1 -0
  139. package/dist/media-providers/dispatch/types.d.ts +133 -0
  140. package/dist/media-providers/dispatch/types.d.ts.map +1 -0
  141. package/dist/media-providers/dispatch/types.js +2 -0
  142. package/dist/media-providers/dispatch/types.js.map +1 -0
  143. package/dist/media-providers/dispatch/vendor-adapter.d.ts +54 -0
  144. package/dist/media-providers/dispatch/vendor-adapter.d.ts.map +1 -0
  145. package/dist/media-providers/dispatch/vendor-adapter.js +68 -0
  146. package/dist/media-providers/dispatch/vendor-adapter.js.map +1 -0
  147. package/dist/media-providers/dispatch/vendor-registry.d.ts +36 -0
  148. package/dist/media-providers/dispatch/vendor-registry.d.ts.map +1 -0
  149. package/dist/media-providers/dispatch/vendor-registry.js +46 -0
  150. package/dist/media-providers/dispatch/vendor-registry.js.map +1 -0
  151. package/dist/media-providers/index.d.ts +22 -0
  152. package/dist/media-providers/index.d.ts.map +1 -0
  153. package/dist/media-providers/index.js +22 -0
  154. package/dist/media-providers/index.js.map +1 -0
  155. package/dist/media-providers/policy.d.ts +49 -0
  156. package/dist/media-providers/policy.d.ts.map +1 -0
  157. package/dist/media-providers/policy.js +39 -0
  158. package/dist/media-providers/policy.js.map +1 -0
  159. package/dist/media-providers/providers.d.ts +33 -0
  160. package/dist/media-providers/providers.d.ts.map +1 -0
  161. package/dist/media-providers/providers.js +200 -0
  162. package/dist/media-providers/providers.js.map +1 -0
  163. package/dist/media-providers/seed.d.ts +14 -0
  164. package/dist/media-providers/seed.d.ts.map +1 -0
  165. package/dist/media-providers/seed.js +109 -0
  166. package/dist/media-providers/seed.js.map +1 -0
  167. package/dist/media-providers/sqlite-task-store.d.ts +29 -0
  168. package/dist/media-providers/sqlite-task-store.d.ts.map +1 -0
  169. package/dist/media-providers/sqlite-task-store.js +234 -0
  170. package/dist/media-providers/sqlite-task-store.js.map +1 -0
  171. package/dist/media-providers/staging.d.ts +29 -0
  172. package/dist/media-providers/staging.d.ts.map +1 -0
  173. package/dist/media-providers/staging.js +141 -0
  174. package/dist/media-providers/staging.js.map +1 -0
  175. package/dist/media-providers/task-store.d.ts +94 -0
  176. package/dist/media-providers/task-store.d.ts.map +1 -0
  177. package/dist/media-providers/task-store.js +160 -0
  178. package/dist/media-providers/task-store.js.map +1 -0
  179. package/dist/media-providers/tokens.d.ts +7 -0
  180. package/dist/media-providers/tokens.d.ts.map +1 -0
  181. package/dist/media-providers/tokens.js +13 -0
  182. package/dist/media-providers/tokens.js.map +1 -0
  183. package/dist/media-providers/types.d.ts +123 -0
  184. package/dist/media-providers/types.d.ts.map +1 -0
  185. package/dist/media-providers/types.js +12 -0
  186. package/dist/media-providers/types.js.map +1 -0
  187. package/dist/media-providers/video-request.d.ts +62 -0
  188. package/dist/media-providers/video-request.d.ts.map +1 -0
  189. package/dist/media-providers/video-request.js +219 -0
  190. package/dist/media-providers/video-request.js.map +1 -0
  191. package/package.json +93 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for describing the origin of the Work and
141
+ reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Support. While redistributing the Work or
166
+ Derivative Works thereof, You may choose to offer, and charge a
167
+ fee for, acceptance of support, warranty, indemnity, or other
168
+ liability obligations and/or rights consistent with this License.
169
+ However, in accepting such obligations, You may act only on Your
170
+ own behalf and on Your sole responsibility, not on behalf of any
171
+ other Contributor, and only if You agree to indemnify, defend,
172
+ and hold each Contributor harmless for any liability incurred by,
173
+ or claims asserted against, such Contributor by reason of your
174
+ accepting any such warranty or support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Open Design contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # `@jini-ai/integrations`
2
+
3
+ Third-party vendor integrations, grouped as subpath exports of one package rather than two separate
4
+ packages: `./composio` (OAuth-authenticated tool-connector catalog discovery and execution) and
5
+ `./media-providers` (multi-vendor image/video/audio generation gateway). An npm package name allows
6
+ only one slash (`@scope/name`), so the literal import paths `@jini-ai/integrations/composio` and
7
+ `@jini-ai/integrations/media-providers` require exactly this shape — one package, two subpath
8
+ exports — not two packages living under a shared directory.
9
+
10
+ ## No root `.` export
11
+
12
+ There is deliberately no `.` export and no `main`/`types` field pointing at a barrel. Neither
13
+ subpath is "the default," and a root barrel re-exporting both would pull `./media-providers`'s code
14
+ into a `./composio`-only consumer's bundle — exactly the coupling this restructure exists to avoid.
15
+ `typesVersions` covers legacy TypeScript `moduleResolution: "node"` (node10) consumers, which ignore
16
+ `package.json#exports` entirely and would otherwise fail to resolve either subpath's `.d.ts` even
17
+ though `exports` itself resolves fine at runtime — the same class of node10 gap several packages in
18
+ this workspace hit and fixed with a `main`/`types` pair (see their `CHANGELOG.md` 0.1.2 entries);
19
+ `typesVersions` is this package's equivalent fix for a package with no single default entry to point
20
+ `main`/`types` at.
21
+
22
+ ## `./composio`
23
+
24
+ OAuth-authenticated Composio connector catalog discovery and execution. No runtime dependency
25
+ beyond `@jini-ai/protocol` (a devDependency only — every reference is `import type { JsonValue }`).
26
+ `npm install @jini-ai/integrations` is enough; nothing extra to add. See `src/composio/source-map.md`
27
+ for full provenance.
28
+
29
+ ## `./media-providers`
30
+
31
+ A gateway for generating images, video, and audio across many vendors behind one call — capability
32
+ registry, multi-vendor REST dispatch, policy and staging ports, and an optional SQLite task store.
33
+ See `src/media-providers/README.md` for the full feature list and `src/media-providers/source-map.md`
34
+ for provenance.
35
+
36
+ `better-sqlite3` (a native compiled addon) is an **optional peer dependency**, not a regular one.
37
+ Everything in `./media-providers` works without it — `renderStub`, the dispatch engine, the
38
+ capability registry, the in-memory task store — because the only code that touches it,
39
+ `createSqliteMediaTaskStore`, reaches it through a dynamic `await import('better-sqlite3')` inside
40
+ that one function, never a static import. Only a consumer that actually calls
41
+ `createSqliteMediaTaskStore` needs to `npm install better-sqlite3` themselves. This is the same
42
+ convention `@jini-ai/admin`'s `react`/`react-dom` optional peers use (see its README's "Layers"
43
+ section) and `packages/README.md`'s "Optional peer dependencies" table documents workspace-wide.
44
+
45
+ ## Why one package, not two
46
+
47
+ The two integrations used to be separate packages specifically so a composio-only consumer would
48
+ never be forced to install `better-sqlite3`. Making `better-sqlite3` an optional peer solves that
49
+ same problem without needing two packages, so they collapsed into subpaths of one — matching the
50
+ literal `@jini-ai/integrations/composio` / `@jini-ai/integrations/media-providers` import paths a
51
+ single npm package name can produce but two package names cannot.
@@ -0,0 +1,36 @@
1
+ import type { JsonValue } from '@jini-ai/protocol';
2
+ export declare const COMPOSIO_MAX_RESPONSE_BYTES: number;
3
+ export declare const COMPOSIO_MAX_ERROR_RESPONSE_BYTES: number;
4
+ export declare const COMPOSIO_MAX_CACHE_BYTES: number;
5
+ export declare const COMPOSIO_MAX_SECRET_STORE_BYTES: number;
6
+ export interface JsonStructureLimits {
7
+ maxDepth: number;
8
+ maxNodes: number;
9
+ maxArrayItems: number;
10
+ maxObjectKeys: number;
11
+ maxStringBytes: number;
12
+ }
13
+ export declare const COMPOSIO_REMOTE_JSON_LIMITS: JsonStructureLimits;
14
+ export declare class BoundedDataError extends Error {
15
+ constructor(message: string);
16
+ }
17
+ /** Reads at most `maxBytes` from a response body before allocating/decoding it. */
18
+ export declare function readBoundedResponseText(response: Response, maxBytes: number, label?: string): Promise<string>;
19
+ /** Reads and parses a response body only after its byte size is bounded. */
20
+ export declare function readBoundedResponseJson(response: Response, maxBytes?: number, label?: string): Promise<unknown>;
21
+ /** Reads a local UTF-8 file without allowing it to grow past `maxBytes`. */
22
+ export declare function readBoundedUtf8File(filePath: string, maxBytes: number): string;
23
+ /**
24
+ * Opens a secret-bearing regular file without following its final symlink,
25
+ * enforces owner-only mode on the opened inode, and reads it within a byte cap.
26
+ *
27
+ * @complexity Time: O(n). Space: O(n), where n is capped by `maxBytes`.
28
+ * @overallScore 100/100
29
+ */
30
+ export declare function readPrivateBoundedUtf8File(filePath: string, maxBytes: number): string;
31
+ /**
32
+ * Converts an unknown value into JSON while enforcing depth, node, collection,
33
+ * and string bounds before recursive copies are allocated.
34
+ */
35
+ export declare function toStructurallyBoundedJsonValue(value: unknown, limits?: JsonStructureLimits): JsonValue;
36
+ //# sourceMappingURL=bounded-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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* @module bounded-data
3
+ *
4
+ * Size and structural guards for untrusted remote and persisted JSON.
5
+ */
6
+ import fs from 'node:fs';
7
+ export const COMPOSIO_MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
8
+ export const COMPOSIO_MAX_ERROR_RESPONSE_BYTES = 64 * 1024;
9
+ export const COMPOSIO_MAX_CACHE_BYTES = 8 * 1024 * 1024;
10
+ export const COMPOSIO_MAX_SECRET_STORE_BYTES = 1024 * 1024;
11
+ export const COMPOSIO_REMOTE_JSON_LIMITS = {
12
+ maxDepth: 40,
13
+ maxNodes: 50_000,
14
+ maxArrayItems: 10_000,
15
+ maxObjectKeys: 10_000,
16
+ maxStringBytes: 1024 * 1024,
17
+ };
18
+ export class BoundedDataError extends Error {
19
+ constructor(message) {
20
+ super(message);
21
+ this.name = 'BoundedDataError';
22
+ }
23
+ }
24
+ /** Reads at most `maxBytes` from a response body before allocating/decoding it. */
25
+ export async function readBoundedResponseText(response, maxBytes, label = 'Composio response') {
26
+ const declaredLength = response.headers.get('content-length');
27
+ if (declaredLength !== null && /^\d+$/.test(declaredLength)) {
28
+ const bytes = Number(declaredLength);
29
+ if (!Number.isSafeInteger(bytes) || bytes > maxBytes) {
30
+ throw new BoundedDataError(`${label} exceeds the ${maxBytes}-byte limit`);
31
+ }
32
+ }
33
+ if (response.body === null)
34
+ return '';
35
+ const reader = response.body.getReader();
36
+ const chunks = [];
37
+ let totalBytes = 0;
38
+ try {
39
+ while (true) {
40
+ const { done, value } = await reader.read();
41
+ if (done)
42
+ break;
43
+ totalBytes += value.byteLength;
44
+ if (totalBytes > maxBytes) {
45
+ await reader.cancel().catch(() => undefined);
46
+ throw new BoundedDataError(`${label} exceeds the ${maxBytes}-byte limit`);
47
+ }
48
+ chunks.push(value);
49
+ }
50
+ }
51
+ finally {
52
+ reader.releaseLock();
53
+ }
54
+ const bytes = new Uint8Array(totalBytes);
55
+ let offset = 0;
56
+ for (const chunk of chunks) {
57
+ bytes.set(chunk, offset);
58
+ offset += chunk.byteLength;
59
+ }
60
+ return new TextDecoder('utf-8', { fatal: true }).decode(bytes);
61
+ }
62
+ /** Reads and parses a response body only after its byte size is bounded. */
63
+ export async function readBoundedResponseJson(response, maxBytes = COMPOSIO_MAX_RESPONSE_BYTES, label = 'Composio response') {
64
+ const text = await readBoundedResponseText(response, maxBytes, label);
65
+ let parsed;
66
+ try {
67
+ parsed = JSON.parse(text);
68
+ }
69
+ catch {
70
+ throw new BoundedDataError(`${label} is not valid JSON`);
71
+ }
72
+ return toStructurallyBoundedJsonValue(parsed);
73
+ }
74
+ /** Reads a local UTF-8 file without allowing it to grow past `maxBytes`. */
75
+ export function readBoundedUtf8File(filePath, maxBytes) {
76
+ const descriptor = fs.openSync(filePath, 'r');
77
+ try {
78
+ return readBoundedUtf8Descriptor(descriptor, maxBytes);
79
+ }
80
+ finally {
81
+ fs.closeSync(descriptor);
82
+ }
83
+ }
84
+ /**
85
+ * Opens a secret-bearing regular file without following its final symlink,
86
+ * enforces owner-only mode on the opened inode, and reads it within a byte cap.
87
+ *
88
+ * @complexity Time: O(n). Space: O(n), where n is capped by `maxBytes`.
89
+ * @overallScore 100/100
90
+ */
91
+ export function readPrivateBoundedUtf8File(filePath, maxBytes) {
92
+ const descriptor = fs.openSync(filePath, fs.constants.O_RDONLY | fs.constants.O_NOFOLLOW);
93
+ try {
94
+ if (!fs.fstatSync(descriptor).isFile()) {
95
+ throw new BoundedDataError('Secret JSON path must be a regular file');
96
+ }
97
+ fs.fchmodSync(descriptor, 0o600);
98
+ return readBoundedUtf8Descriptor(descriptor, maxBytes);
99
+ }
100
+ finally {
101
+ fs.closeSync(descriptor);
102
+ }
103
+ }
104
+ function readBoundedUtf8Descriptor(descriptor, maxBytes) {
105
+ const chunks = [];
106
+ const buffer = Buffer.allocUnsafe(Math.min(64 * 1024, maxBytes + 1));
107
+ let totalBytes = 0;
108
+ while (true) {
109
+ const bytesRead = fs.readSync(descriptor, buffer, 0, buffer.length, null);
110
+ if (bytesRead === 0)
111
+ break;
112
+ totalBytes += bytesRead;
113
+ if (totalBytes > maxBytes) {
114
+ throw new BoundedDataError(`JSON file exceeds the ${maxBytes}-byte limit`);
115
+ }
116
+ chunks.push(Buffer.from(buffer.subarray(0, bytesRead)));
117
+ }
118
+ return new TextDecoder('utf-8', { fatal: true }).decode(Buffer.concat(chunks, totalBytes));
119
+ }
120
+ /**
121
+ * Converts an unknown value into JSON while enforcing depth, node, collection,
122
+ * and string bounds before recursive copies are allocated.
123
+ */
124
+ export function toStructurallyBoundedJsonValue(value, limits = COMPOSIO_REMOTE_JSON_LIMITS) {
125
+ const state = { nodes: 0, ancestors: new WeakSet() };
126
+ const visit = (current, depth) => {
127
+ state.nodes += 1;
128
+ if (state.nodes > limits.maxNodes) {
129
+ throw new BoundedDataError(`JSON value exceeds the ${limits.maxNodes}-node limit`);
130
+ }
131
+ if (depth > limits.maxDepth) {
132
+ throw new BoundedDataError(`JSON value exceeds the ${limits.maxDepth}-level depth limit`);
133
+ }
134
+ if (current === null || typeof current === 'boolean')
135
+ return current;
136
+ if (typeof current === 'number') {
137
+ if (!Number.isFinite(current))
138
+ throw new BoundedDataError('JSON value contains a non-finite number');
139
+ return current;
140
+ }
141
+ if (typeof current === 'string') {
142
+ if (Buffer.byteLength(current, 'utf8') > limits.maxStringBytes) {
143
+ throw new BoundedDataError(`JSON string exceeds the ${limits.maxStringBytes}-byte limit`);
144
+ }
145
+ return current;
146
+ }
147
+ if (typeof current !== 'object') {
148
+ throw new BoundedDataError('JSON value contains an unsupported runtime value');
149
+ }
150
+ if (state.ancestors.has(current))
151
+ throw new BoundedDataError('JSON value contains a cycle');
152
+ state.ancestors.add(current);
153
+ try {
154
+ if (Array.isArray(current)) {
155
+ if (current.length > limits.maxArrayItems) {
156
+ throw new BoundedDataError(`JSON array exceeds the ${limits.maxArrayItems}-item limit`);
157
+ }
158
+ return current.map((item) => visit(item, depth + 1));
159
+ }
160
+ const entries = Object.entries(current);
161
+ if (entries.length > limits.maxObjectKeys) {
162
+ throw new BoundedDataError(`JSON object exceeds the ${limits.maxObjectKeys}-key limit`);
163
+ }
164
+ const output = {};
165
+ for (const [key, child] of entries) {
166
+ Object.defineProperty(output, key, {
167
+ configurable: true,
168
+ enumerable: true,
169
+ value: visit(child, depth + 1),
170
+ writable: true,
171
+ });
172
+ }
173
+ return output;
174
+ }
175
+ finally {
176
+ state.ancestors.delete(current);
177
+ }
178
+ };
179
+ return visit(value, 0);
180
+ }
181
+ //# sourceMappingURL=bounded-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded-data.js","sourceRoot":"","sources":["../../src/composio/bounded-data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AAIzB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC3D,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACxD,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,GAAG,IAAI,CAAC;AAU3D,MAAM,CAAC,MAAM,2BAA2B,GAAwB;IAC9D,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,MAAM;IAChB,aAAa,EAAE,MAAM;IACrB,aAAa,EAAE,MAAM;IACrB,cAAc,EAAE,IAAI,GAAG,IAAI;CAC5B,CAAC;AAEF,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,QAAkB,EAClB,QAAgB,EAChB,KAAK,GAAG,mBAAmB;IAE3B,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,GA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C,CAAC;YACL,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;gBAAS,CAAC;YACT,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;AACzB,CAAC"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * @module catalog
3
+ *
4
+ * Product-neutral catalog and safety contracts used by the Composio adapter.
5
+ */
6
+ import type { JsonValue } from '@jini-ai/protocol';
7
+ export type JsonObject = {
8
+ [key: string]: JsonValue;
9
+ };
10
+ export type ConnectorStatus = 'available' | 'connected' | 'error' | 'disabled';
11
+ export type ConnectorToolSideEffect = 'read' | 'write' | 'destructive' | 'unknown';
12
+ export type ConnectorToolApproval = 'auto' | 'confirm' | 'disabled';
13
+ export type ConnectorToolUseCase = string;
14
+ export interface ConnectorToolSafety {
15
+ sideEffect: ConnectorToolSideEffect;
16
+ approval: ConnectorToolApproval;
17
+ reason: string;
18
+ }
19
+ export interface ConnectorToolCuration {
20
+ useCases?: ConnectorToolUseCase[];
21
+ reason?: string;
22
+ }
23
+ export interface ConnectorToolDetail {
24
+ name: string;
25
+ title: string;
26
+ description?: string;
27
+ inputSchemaJson?: JsonObject;
28
+ /** Present when the provider schema cannot be enforced safely. Such tools are never auto-callable. */
29
+ inputSchemaUnsupportedReason?: string | undefined;
30
+ outputSchemaJson?: JsonObject;
31
+ safety: ConnectorToolSafety;
32
+ refreshEligible: boolean;
33
+ curation?: ConnectorToolCuration;
34
+ }
35
+ export interface ConnectorCatalogToolDefinition extends ConnectorToolDetail {
36
+ /** Provider scopes required for this tool. Empty for local/read-only providers. */
37
+ requiredScopes: string[];
38
+ /** Provider-native tool identifier, when different from the package tool name. */
39
+ providerToolId?: string;
40
+ }
41
+ export interface ConnectorDetail {
42
+ id: string;
43
+ name: string;
44
+ provider: string;
45
+ category: string;
46
+ description?: string;
47
+ status: ConnectorStatus;
48
+ accountLabel?: string;
49
+ tools: ConnectorToolDetail[];
50
+ /**
51
+ * Runtime execution allowlist. Subset of `tools`. The agent layer
52
+ * only invokes tools whose names appear here. For Composio
53
+ * connectors hydration may only preserve static tool authority or add an
54
+ * exact package/host-curated provider identifier. Other discovered tools
55
+ * are display-only regardless of provider metadata.
56
+ *
57
+ * Optional in the type only for fixture brevity; daemon-built
58
+ * `ConnectorDetail` payloads always carry it.
59
+ */
60
+ allowedToolNames?: string[];
61
+ /**
62
+ * The hand-curated catalog subset. Stable across hydration: never
63
+ * extended by provider discovery, only ever the static catalog
64
+ * names. This preserves the static catalog baseline for consumers
65
+ * that need that curated subset, but it is not the advertised
66
+ * provider inventory count. UI summary badges should use `toolCount`
67
+ * when present; the drawer's rendered tool rows still come from
68
+ * `tools` directly.
69
+ *
70
+ * Optional in the type only for fixture brevity; daemon-built
71
+ * `ConnectorDetail` payloads always carry it.
72
+ */
73
+ curatedToolNames?: string[];
74
+ toolCount?: number;
75
+ toolsNextCursor?: string;
76
+ toolsHasMore?: boolean;
77
+ featuredToolNames?: string[];
78
+ minimumApproval?: ConnectorToolApproval;
79
+ lastError?: string;
80
+ auth?: ConnectorAuthDetail;
81
+ }
82
+ export interface ConnectorAuthDetail {
83
+ provider: 'local' | 'none' | 'oauth' | 'composio';
84
+ configured: boolean;
85
+ }
86
+ export interface ConnectorCatalogDefinition {
87
+ id: string;
88
+ name: string;
89
+ provider: string;
90
+ category: string;
91
+ description?: string;
92
+ tools: ConnectorCatalogToolDefinition[];
93
+ /** The complete allowlist of callable tool names for this connector. */
94
+ allowedToolNames: string[];
95
+ /**
96
+ * The hand-curated subset of `allowedToolNames` that is fixed at the
97
+ * catalog level — never extended by provider discovery (issue #748).
98
+ * Optional: when omitted, serialized wire details fall back to
99
+ * `allowedToolNames`, which is the right preview subset for
100
+ * non-Composio connectors that don't have a dynamic discovery layer
101
+ * in the first place.
102
+ */
103
+ curatedToolNames?: string[];
104
+ /** Display-only count of provider tools. This may be known before tool schemas are hydrated. */
105
+ toolCount?: number;
106
+ /** Preview pagination state for hydrated tool definitions. Execution code must not rely on partial pages. */
107
+ toolsNextCursor?: string;
108
+ toolsHasMore?: boolean;
109
+ /** How the connector is made available. `none` and `local` connectors require no user OAuth state. */
110
+ authentication: 'local' | 'none' | 'oauth' | 'composio';
111
+ /** Provider toolkit slug used by external connector providers such as Composio. */
112
+ providerConnectorId?: string;
113
+ featuredToolNames?: string[];
114
+ minimumApproval?: ConnectorToolApproval;
115
+ disabled?: boolean;
116
+ }
117
+ export interface ConnectorToolSafetyClassificationInput {
118
+ name: string;
119
+ providerToolId?: string;
120
+ title?: string;
121
+ description?: string;
122
+ requiredScopes?: readonly string[];
123
+ }
124
+ /**
125
+ * Classifies a provider tool conservatively from its name, description, and
126
+ * scopes. Ambiguous tools require confirmation.
127
+ */
128
+ export declare function classifyConnectorToolSafety(input: ConnectorToolSafetyClassificationInput): ConnectorToolSafety;
129
+ /** Returns whether a tool is safe for unattended refresh execution. */
130
+ export declare function isRefreshEligibleConnectorToolSafety(safety: ConnectorToolSafety): boolean;
131
+ /**
132
+ * Builds a catalog tool and derives safety defaults when the caller omitted
133
+ * them.
134
+ *
135
+ * @overallScore 100/100
136
+ */
137
+ export declare function defineConnectorTool(tool: Omit<ConnectorCatalogToolDefinition, 'safety' | 'refreshEligible'> & {
138
+ safety?: ConnectorToolSafety;
139
+ refreshEligible?: boolean;
140
+ }): ConnectorCatalogToolDefinition;
141
+ /**
142
+ * Creates a detached wire detail from a catalog definition.
143
+ *
144
+ * @overallScore 100/100
145
+ */
146
+ export declare function connectorDefinitionToDetail(definition: ConnectorCatalogDefinition): ConnectorDetail;
147
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/composio/catalog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD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