@capybara-hq/plugin-sdk 0.0.0-stage → 0.1.0-rc.1

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 (72) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +2 -0
  3. package/README.md +27 -2
  4. package/dist/agent-template.d.ts +47 -0
  5. package/dist/agent-template.js +123 -0
  6. package/dist/bootstrap.d.ts +67 -0
  7. package/dist/bootstrap.js +109 -0
  8. package/dist/cards.d.ts +64 -0
  9. package/dist/cards.js +217 -0
  10. package/dist/channel.d.ts +230 -0
  11. package/dist/channel.js +26 -0
  12. package/dist/connector-auth.d.ts +64 -0
  13. package/dist/connector-auth.js +96 -0
  14. package/dist/connector.d.ts +154 -0
  15. package/dist/connector.js +1 -0
  16. package/dist/ctx.d.ts +176 -0
  17. package/dist/ctx.js +1 -0
  18. package/dist/define-extension.d.ts +41 -0
  19. package/dist/define-extension.js +85 -0
  20. package/dist/directory.d.ts +29 -0
  21. package/dist/directory.js +1 -0
  22. package/dist/extension-point.d.ts +29 -0
  23. package/dist/extension-point.js +36 -0
  24. package/dist/file-preview.d.ts +64 -0
  25. package/dist/file-preview.js +72 -0
  26. package/dist/frontmatter.d.ts +12 -0
  27. package/dist/frontmatter.js +36 -0
  28. package/dist/hooks.d.ts +195 -0
  29. package/dist/hooks.js +14 -0
  30. package/dist/identity.d.ts +44 -0
  31. package/dist/identity.js +1 -0
  32. package/dist/index.d.ts +28 -0
  33. package/dist/index.js +28 -0
  34. package/dist/marketplace.d.ts +99 -0
  35. package/dist/marketplace.js +256 -0
  36. package/dist/model-params.d.ts +82 -0
  37. package/dist/model-params.js +222 -0
  38. package/dist/model.d.ts +227 -0
  39. package/dist/model.js +152 -0
  40. package/dist/permissions.d.ts +67 -0
  41. package/dist/permissions.js +271 -0
  42. package/dist/plugin-manifest.d.ts +141 -0
  43. package/dist/plugin-manifest.js +322 -0
  44. package/dist/plugin-package.d.ts +139 -0
  45. package/dist/plugin-package.js +448 -0
  46. package/dist/sandbox.d.ts +152 -0
  47. package/dist/sandbox.js +96 -0
  48. package/dist/secret.d.ts +5 -0
  49. package/dist/secret.js +8 -0
  50. package/dist/semver-range.d.ts +6 -0
  51. package/dist/semver-range.js +12 -0
  52. package/dist/skill-invocation.d.ts +83 -0
  53. package/dist/skill-invocation.js +201 -0
  54. package/dist/skill-keys.d.ts +9 -0
  55. package/dist/skill-keys.js +16 -0
  56. package/dist/skill.d.ts +77 -0
  57. package/dist/skill.js +244 -0
  58. package/dist/storage.d.ts +96 -0
  59. package/dist/storage.js +9 -0
  60. package/dist/tool-key.d.ts +28 -0
  61. package/dist/tool-key.js +40 -0
  62. package/dist/tool.d.ts +154 -0
  63. package/dist/tool.js +218 -0
  64. package/dist/ui.d.ts +265 -0
  65. package/dist/ui.js +358 -0
  66. package/dist/url.d.ts +2 -0
  67. package/dist/url.js +12 -0
  68. package/package.json +40 -3
  69. package/schemas/bootstrap.v1.schema.json +125 -0
  70. package/schemas/connector-template.v1.schema.json +116 -0
  71. package/schemas/marketplace.v1.schema.json +270 -0
  72. package/schemas/plugin.v1.schema.json +330 -0
@@ -0,0 +1,270 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://capybarahq.com/schemas/marketplace.v1.schema.json",
4
+ "title": "Capybara marketplace manifest marketplace.json (schemaVersion 1)",
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string",
9
+ "maxLength": 2000
10
+ },
11
+ "schemaVersion": {
12
+ "type": "number",
13
+ "const": 1
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "maxLength": 100
19
+ },
20
+ "owner": {
21
+ "type": "object",
22
+ "properties": {
23
+ "name": {
24
+ "type": "string",
25
+ "minLength": 1,
26
+ "maxLength": 100
27
+ },
28
+ "url": {
29
+ "type": "string",
30
+ "maxLength": 2000,
31
+ "pattern": "^https:\\/\\/\\S+$"
32
+ }
33
+ },
34
+ "required": [
35
+ "name"
36
+ ]
37
+ },
38
+ "description": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "maxLength": 1024
42
+ },
43
+ "plugins": {
44
+ "maxItems": 5000,
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "properties": {
49
+ "name": {
50
+ "type": "string",
51
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
52
+ },
53
+ "summary": {
54
+ "type": "object",
55
+ "properties": {
56
+ "en": {
57
+ "type": "string",
58
+ "minLength": 1,
59
+ "maxLength": 280
60
+ },
61
+ "zh": {
62
+ "type": "string",
63
+ "minLength": 1,
64
+ "maxLength": 280
65
+ }
66
+ },
67
+ "required": [
68
+ "en"
69
+ ]
70
+ },
71
+ "version": {
72
+ "type": "string",
73
+ "maxLength": 256,
74
+ "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
75
+ },
76
+ "minKernel": {
77
+ "type": "string",
78
+ "maxLength": 256,
79
+ "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
80
+ },
81
+ "permissions": {
82
+ "type": "object",
83
+ "properties": {
84
+ "keys": {
85
+ "maxItems": 500,
86
+ "type": "array",
87
+ "items": {
88
+ "type": "string",
89
+ "maxLength": 300,
90
+ "pattern": "^[a-z][a-z.]{0,62}(?::[^\\r\\n]{1,256})?$"
91
+ }
92
+ },
93
+ "sensitive": {
94
+ "maxItems": 500,
95
+ "type": "array",
96
+ "items": {
97
+ "type": "string",
98
+ "maxLength": 300,
99
+ "pattern": "^[a-z][a-z.]{0,62}(?::[^\\r\\n]{1,256})?$"
100
+ }
101
+ }
102
+ },
103
+ "required": [
104
+ "keys",
105
+ "sensitive"
106
+ ]
107
+ },
108
+ "homepage": {
109
+ "type": "string",
110
+ "maxLength": 2000,
111
+ "pattern": "^https:\\/\\/\\S+$"
112
+ },
113
+ "source": {
114
+ "anyOf": [
115
+ {
116
+ "type": "object",
117
+ "properties": {
118
+ "path": {
119
+ "type": "string",
120
+ "maxLength": 512
121
+ },
122
+ "git": {
123
+ "not": {}
124
+ },
125
+ "npm": {
126
+ "not": {}
127
+ },
128
+ "archive": {
129
+ "not": {}
130
+ }
131
+ },
132
+ "required": [
133
+ "path"
134
+ ]
135
+ },
136
+ {
137
+ "type": "object",
138
+ "properties": {
139
+ "git": {
140
+ "type": "object",
141
+ "properties": {
142
+ "url": {
143
+ "type": "string",
144
+ "maxLength": 2000,
145
+ "pattern": "^https:\\/\\/\\S+$"
146
+ },
147
+ "ref": {
148
+ "type": "string",
149
+ "minLength": 1,
150
+ "maxLength": 256
151
+ },
152
+ "commit": {
153
+ "type": "string",
154
+ "pattern": "^[0-9a-f]{40}$"
155
+ },
156
+ "path": {
157
+ "type": "string",
158
+ "maxLength": 512
159
+ }
160
+ },
161
+ "required": [
162
+ "url"
163
+ ]
164
+ },
165
+ "path": {
166
+ "not": {}
167
+ },
168
+ "npm": {
169
+ "not": {}
170
+ },
171
+ "archive": {
172
+ "not": {}
173
+ }
174
+ },
175
+ "required": [
176
+ "git"
177
+ ]
178
+ },
179
+ {
180
+ "type": "object",
181
+ "properties": {
182
+ "npm": {
183
+ "type": "object",
184
+ "properties": {
185
+ "package": {
186
+ "type": "string",
187
+ "maxLength": 214,
188
+ "pattern": "^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*$"
189
+ },
190
+ "version": {
191
+ "type": "string",
192
+ "maxLength": 256,
193
+ "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
194
+ },
195
+ "integrity": {
196
+ "type": "string",
197
+ "pattern": "^sha512-[A-Za-z0-9+/]{86}==$"
198
+ }
199
+ },
200
+ "required": [
201
+ "package",
202
+ "version",
203
+ "integrity"
204
+ ]
205
+ },
206
+ "path": {
207
+ "not": {}
208
+ },
209
+ "git": {
210
+ "not": {}
211
+ },
212
+ "archive": {
213
+ "not": {}
214
+ }
215
+ },
216
+ "required": [
217
+ "npm"
218
+ ]
219
+ },
220
+ {
221
+ "type": "object",
222
+ "properties": {
223
+ "archive": {
224
+ "type": "object",
225
+ "properties": {
226
+ "url": {
227
+ "type": "string",
228
+ "maxLength": 2000,
229
+ "pattern": "^https:\\/\\/\\S+$"
230
+ },
231
+ "integrity": {
232
+ "type": "string"
233
+ }
234
+ },
235
+ "required": [
236
+ "url",
237
+ "integrity"
238
+ ]
239
+ },
240
+ "path": {
241
+ "not": {}
242
+ },
243
+ "git": {
244
+ "not": {}
245
+ },
246
+ "npm": {
247
+ "not": {}
248
+ }
249
+ },
250
+ "required": [
251
+ "archive"
252
+ ]
253
+ }
254
+ ]
255
+ }
256
+ },
257
+ "required": [
258
+ "name",
259
+ "summary",
260
+ "source"
261
+ ]
262
+ }
263
+ }
264
+ },
265
+ "required": [
266
+ "schemaVersion",
267
+ "name",
268
+ "plugins"
269
+ ]
270
+ }
@@ -0,0 +1,330 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://capybarahq.com/schemas/plugin.v1.schema.json",
4
+ "title": "Capybara plugin manifest .capybara-plugin/plugin.json (schemaVersion 1)",
5
+ "type": "object",
6
+ "properties": {
7
+ "$schema": {
8
+ "type": "string",
9
+ "maxLength": 512
10
+ },
11
+ "schemaVersion": {
12
+ "type": "number",
13
+ "const": 1
14
+ },
15
+ "name": {
16
+ "type": "string",
17
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
18
+ },
19
+ "version": {
20
+ "type": "string",
21
+ "maxLength": 256,
22
+ "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
23
+ },
24
+ "publisher": {
25
+ "type": "string",
26
+ "minLength": 1,
27
+ "maxLength": 100,
28
+ "pattern": "\\S"
29
+ },
30
+ "description": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 1024,
34
+ "pattern": "\\S"
35
+ },
36
+ "displayName": {
37
+ "type": "object",
38
+ "properties": {
39
+ "zh": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "maxLength": 100,
43
+ "pattern": "\\S"
44
+ },
45
+ "en": {
46
+ "type": "string",
47
+ "minLength": 1,
48
+ "maxLength": 100,
49
+ "pattern": "\\S"
50
+ }
51
+ },
52
+ "required": [
53
+ "zh",
54
+ "en"
55
+ ],
56
+ "additionalProperties": false
57
+ },
58
+ "icon": {
59
+ "type": "string",
60
+ "minLength": 3,
61
+ "maxLength": 512,
62
+ "allOf": [
63
+ {
64
+ "pattern": "^\\.\\/"
65
+ },
66
+ {
67
+ "pattern": "\\.(?:svg|png)$"
68
+ }
69
+ ]
70
+ },
71
+ "license": {
72
+ "type": "string",
73
+ "minLength": 1,
74
+ "maxLength": 100,
75
+ "pattern": "\\S"
76
+ },
77
+ "homepage": {
78
+ "type": "string",
79
+ "maxLength": 2000,
80
+ "pattern": "^https:\\/\\/\\S+$"
81
+ },
82
+ "dependencies": {
83
+ "maxItems": 20,
84
+ "type": "array",
85
+ "items": {
86
+ "type": "object",
87
+ "properties": {
88
+ "name": {
89
+ "type": "string",
90
+ "pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
91
+ },
92
+ "version": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "maxLength": 256
96
+ }
97
+ },
98
+ "required": [
99
+ "name",
100
+ "version"
101
+ ],
102
+ "additionalProperties": false
103
+ }
104
+ },
105
+ "skills": {
106
+ "maxItems": 50,
107
+ "type": "array",
108
+ "items": {
109
+ "type": "object",
110
+ "properties": {
111
+ "path": {
112
+ "type": "string",
113
+ "minLength": 3,
114
+ "maxLength": 512,
115
+ "pattern": "^\\.\\/"
116
+ },
117
+ "pinned": {
118
+ "type": "boolean"
119
+ }
120
+ },
121
+ "required": [
122
+ "path"
123
+ ],
124
+ "additionalProperties": false
125
+ }
126
+ },
127
+ "connectorTemplates": {
128
+ "maxItems": 20,
129
+ "type": "array",
130
+ "items": {
131
+ "type": "object",
132
+ "properties": {
133
+ "path": {
134
+ "type": "string",
135
+ "minLength": 3,
136
+ "maxLength": 512,
137
+ "pattern": "^\\.\\/"
138
+ }
139
+ },
140
+ "required": [
141
+ "path"
142
+ ],
143
+ "additionalProperties": false
144
+ }
145
+ },
146
+ "agents": {
147
+ "maxItems": 64,
148
+ "type": "array",
149
+ "items": {
150
+ "type": "object",
151
+ "properties": {
152
+ "path": {
153
+ "type": "string",
154
+ "minLength": 3,
155
+ "maxLength": 512,
156
+ "allOf": [
157
+ {
158
+ "pattern": "^\\.\\/"
159
+ },
160
+ {
161
+ "pattern": "\\.md$"
162
+ }
163
+ ]
164
+ }
165
+ },
166
+ "required": [
167
+ "path"
168
+ ],
169
+ "additionalProperties": false
170
+ }
171
+ },
172
+ "extension": {
173
+ "type": "object",
174
+ "properties": {
175
+ "entry": {
176
+ "type": "string",
177
+ "minLength": 3,
178
+ "maxLength": 512,
179
+ "pattern": "^\\.\\/"
180
+ },
181
+ "manifest": {
182
+ "type": "object",
183
+ "properties": {
184
+ "name": {
185
+ "type": "string"
186
+ },
187
+ "version": {
188
+ "type": "string"
189
+ },
190
+ "sdk": {
191
+ "type": "string",
192
+ "maxLength": 256
193
+ },
194
+ "provides": {
195
+ "type": "array",
196
+ "items": {
197
+ "type": "string"
198
+ }
199
+ },
200
+ "requires": {
201
+ "type": "array",
202
+ "items": {
203
+ "type": "string"
204
+ }
205
+ },
206
+ "optional": {
207
+ "type": "array",
208
+ "items": {
209
+ "type": "string"
210
+ }
211
+ },
212
+ "permissions": {
213
+ "type": "object",
214
+ "propertyNames": {
215
+ "type": "string"
216
+ },
217
+ "additionalProperties": {}
218
+ },
219
+ "ui": {
220
+ "type": "array",
221
+ "items": {
222
+ "type": "object",
223
+ "propertyNames": {
224
+ "type": "string"
225
+ },
226
+ "additionalProperties": {}
227
+ }
228
+ },
229
+ "config": {
230
+ "type": "object",
231
+ "properties": {
232
+ "deployment": {
233
+ "maxItems": 1000,
234
+ "type": "array",
235
+ "items": {
236
+ "type": "object",
237
+ "properties": {
238
+ "path": {
239
+ "type": "string",
240
+ "maxLength": 1000
241
+ },
242
+ "secret": {
243
+ "type": "boolean"
244
+ },
245
+ "hot": {
246
+ "type": "boolean"
247
+ }
248
+ },
249
+ "required": [
250
+ "path",
251
+ "secret",
252
+ "hot"
253
+ ],
254
+ "additionalProperties": false
255
+ }
256
+ },
257
+ "org": {
258
+ "maxItems": 1000,
259
+ "type": "array",
260
+ "items": {
261
+ "type": "object",
262
+ "properties": {
263
+ "path": {
264
+ "type": "string",
265
+ "maxLength": 1000
266
+ },
267
+ "secret": {
268
+ "type": "boolean"
269
+ },
270
+ "hot": {
271
+ "type": "boolean"
272
+ }
273
+ },
274
+ "required": [
275
+ "path",
276
+ "secret",
277
+ "hot"
278
+ ],
279
+ "additionalProperties": false
280
+ }
281
+ }
282
+ },
283
+ "required": [
284
+ "deployment",
285
+ "org"
286
+ ],
287
+ "additionalProperties": false
288
+ }
289
+ },
290
+ "required": [
291
+ "name",
292
+ "version",
293
+ "sdk",
294
+ "provides",
295
+ "requires",
296
+ "optional",
297
+ "permissions",
298
+ "config"
299
+ ],
300
+ "additionalProperties": false
301
+ },
302
+ "migrations": {
303
+ "type": "string",
304
+ "minLength": 3,
305
+ "maxLength": 512,
306
+ "pattern": "^\\.\\/"
307
+ },
308
+ "ui": {
309
+ "type": "string",
310
+ "minLength": 3,
311
+ "maxLength": 512,
312
+ "pattern": "^\\.\\/"
313
+ }
314
+ },
315
+ "required": [
316
+ "entry",
317
+ "manifest"
318
+ ],
319
+ "additionalProperties": false
320
+ }
321
+ },
322
+ "required": [
323
+ "schemaVersion",
324
+ "name",
325
+ "version",
326
+ "publisher",
327
+ "description"
328
+ ],
329
+ "additionalProperties": false
330
+ }