@irogane/kaji 0.2.0-beta.11
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.
- package/LICENSE +105 -0
- package/README.md +598 -0
- package/contracts/README.md +14 -0
- package/contracts/beta-core-v1.json +52 -0
- package/contracts/cli/init-cases-v1.json +27 -0
- package/contracts/errors/error-codes.json +48 -0
- package/contracts/errors/integration-recovery-v1.json +127 -0
- package/contracts/errors/provider-normalization.json +111 -0
- package/contracts/events/conformance-invalid.json +20 -0
- package/contracts/events/conformance.json +511 -0
- package/contracts/events/new-kaji-event-v1.schema.json +1021 -0
- package/contracts/events/stored-kaji-event-v1.schema.json +1025 -0
- package/contracts/feature-tiers-v1.json +488 -0
- package/contracts/integrations/abi-index-v1.json +8 -0
- package/contracts/integrations/conformance-invalid.json +443 -0
- package/contracts/integrations/conformance-valid.json +121 -0
- package/contracts/integrations/copy-provenance-v1.schema.json +61 -0
- package/contracts/integrations/echo-tool-abi-v1.json +37 -0
- package/contracts/integrations/github-api-conformance-v1.json +644 -0
- package/contracts/integrations/github-tool-abi-typescript-v1.json +369 -0
- package/contracts/integrations/github-tool-abi-v1.json +146 -0
- package/contracts/integrations/gmail-api-conformance-v1.json +750 -0
- package/contracts/integrations/gmail-tool-abi-v1.json +62 -0
- package/contracts/integrations/index.schema.json +37 -0
- package/contracts/integrations/manifest.schema.json +119 -0
- package/contracts/parity/expected-normalized.json +4906 -0
- package/contracts/parity/scenarios.json +100 -0
- package/contracts/parity/scenarios.schema.json +214 -0
- package/contracts/providers/cost-conformance.json +112 -0
- package/contracts/release/github-proof-v1.schema.json +138 -0
- package/contracts/release/gmail-proof-v1.schema.json +138 -0
- package/contracts/release/kaji-ts-consumer-handoff-v1.schema.json +1289 -0
- package/contracts/release/publisher-identity-receipt-v1.schema.json +319 -0
- package/contracts/release/typescript-onboarding-evidence-v1.schema.json +740 -0
- package/contracts/tools/conformance-invalid.json +271 -0
- package/contracts/tools/conformance-valid.json +78 -0
- package/contracts/tools/tool-schema-v1.schema.json +18 -0
- package/dist/anthropic.cjs +1231 -0
- package/dist/anthropic.cjs.map +1 -0
- package/dist/anthropic.d.cts +26 -0
- package/dist/anthropic.d.ts +26 -0
- package/dist/anthropic.js +270 -0
- package/dist/anthropic.js.map +1 -0
- package/dist/auth.cjs +1507 -0
- package/dist/auth.cjs.map +1 -0
- package/dist/auth.d.cts +129 -0
- package/dist/auth.d.ts +129 -0
- package/dist/auth.js +1039 -0
- package/dist/auth.js.map +1 -0
- package/dist/base-B9FRMcP8.d.cts +140 -0
- package/dist/base-nHQd1VtS.d.ts +140 -0
- package/dist/chunk-AAM33KAO.js +4367 -0
- package/dist/chunk-AAM33KAO.js.map +1 -0
- package/dist/chunk-KAJ6BM64.js +153 -0
- package/dist/chunk-KAJ6BM64.js.map +1 -0
- package/dist/chunk-KCAXIOZS.js +308 -0
- package/dist/chunk-KCAXIOZS.js.map +1 -0
- package/dist/chunk-LSJ4AVO2.js +243 -0
- package/dist/chunk-LSJ4AVO2.js.map +1 -0
- package/dist/chunk-TM7ZGOJX.js +716 -0
- package/dist/chunk-TM7ZGOJX.js.map +1 -0
- package/dist/cli/bin.d.ts +2 -0
- package/dist/cli/bin.js +13 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/chunk-2RCWPRVY.js +6277 -0
- package/dist/cli/chunk-2RCWPRVY.js.map +1 -0
- package/dist/cli/chunk-SEBX54TR.js +681 -0
- package/dist/cli/chunk-SEBX54TR.js.map +1 -0
- package/dist/cli/index.d.ts +232 -0
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init-worker.d.ts +2 -0
- package/dist/cli/init-worker.js +18 -0
- package/dist/cli/init-worker.js.map +1 -0
- package/dist/cli/integration-copy-worker.js +48 -0
- package/dist/cli/integration-copy-worker.js.map +1 -0
- package/dist/cli/package-entry-cjs.cjs +21 -0
- package/dist/cli/package-entry-cjs.cjs.map +1 -0
- package/dist/cli/package-entry-cjs.d.cts +2 -0
- package/dist/cli/package-entry.d.ts +2 -0
- package/dist/cli/package-entry.js +13 -0
- package/dist/cli/package-entry.js.map +1 -0
- package/dist/context-BaFHrQHv.d.cts +21 -0
- package/dist/context-BaFHrQHv.d.ts +21 -0
- package/dist/context-C-YPY-GS.d.cts +1538 -0
- package/dist/context-C-YPY-GS.d.ts +1538 -0
- package/dist/index.cjs +12346 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1560 -0
- package/dist/index.d.ts +1560 -0
- package/dist/index.js +7852 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/github.cjs +2092 -0
- package/dist/integrations/github.cjs.map +1 -0
- package/dist/integrations/github.d.cts +21 -0
- package/dist/integrations/github.d.ts +21 -0
- package/dist/integrations/github.js +2088 -0
- package/dist/integrations/github.js.map +1 -0
- package/dist/integrations.cjs +3370 -0
- package/dist/integrations.cjs.map +1 -0
- package/dist/integrations.d.cts +202 -0
- package/dist/integrations.d.ts +202 -0
- package/dist/integrations.js +2650 -0
- package/dist/integrations.js.map +1 -0
- package/dist/observability-Cj--OkME.d.cts +96 -0
- package/dist/observability-Cj--OkME.d.ts +96 -0
- package/dist/openai.cjs +1235 -0
- package/dist/openai.cjs.map +1 -0
- package/dist/openai.d.cts +32 -0
- package/dist/openai.d.ts +32 -0
- package/dist/openai.js +272 -0
- package/dist/openai.js.map +1 -0
- package/dist/testing.cjs +554 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +43 -0
- package/dist/testing.d.ts +43 -0
- package/dist/testing.js +118 -0
- package/dist/testing.js.map +1 -0
- package/package.json +188 -0
- package/registry/echo/index.ts +53 -0
- package/registry/echo/manifest.json +53 -0
- package/registry/github/LICENSE +105 -0
- package/registry/github/client.ts +1727 -0
- package/registry/github/index.ts +263 -0
- package/registry/github/manifest.json +227 -0
- package/registry/github/owner-fixtures.json +10 -0
- package/registry/github/tests/github.test.ts +32 -0
- package/registry/gmail/LICENSE +105 -0
- package/registry/gmail/client.ts +548 -0
- package/registry/gmail/index.ts +165 -0
- package/registry/gmail/manifest.json +102 -0
- package/registry/gmail/owner-fixtures.json +10 -0
- package/registry/gmail/tests/gmail.test.ts +32 -0
- package/registry/index.json +21 -0
- package/registry/index.schema.json +37 -0
- package/registry/schema.json +119 -0
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"cases": [
|
|
4
|
+
{
|
|
5
|
+
"name": "environment auth missing env",
|
|
6
|
+
"target": "manifest",
|
|
7
|
+
"document": {
|
|
8
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
9
|
+
"auth": { "kind": "env" }, "files": ["index.ts"],
|
|
10
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
11
|
+
},
|
|
12
|
+
"expectedPath": "/auth",
|
|
13
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "environment auth has unsafe lowercase env",
|
|
17
|
+
"target": "manifest",
|
|
18
|
+
"document": {
|
|
19
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
20
|
+
"auth": { "kind": "env", "env": "api_key" }, "files": ["index.ts"],
|
|
21
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
22
|
+
},
|
|
23
|
+
"expectedPath": "/auth",
|
|
24
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "environment auth has OAuth fields",
|
|
28
|
+
"target": "manifest",
|
|
29
|
+
"document": {
|
|
30
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
31
|
+
"auth": { "kind": "env", "env": "API_KEY", "scopes": ["read"] },
|
|
32
|
+
"files": ["index.ts"],
|
|
33
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
34
|
+
},
|
|
35
|
+
"expectedPath": "/auth",
|
|
36
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "OAuth auth missing provider",
|
|
40
|
+
"target": "manifest",
|
|
41
|
+
"document": {
|
|
42
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
43
|
+
"auth": { "kind": "oauth", "clientIdEnv": "GOOGLE_CLIENT_ID", "scopes": ["read"] }, "files": ["index.ts"],
|
|
44
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
45
|
+
},
|
|
46
|
+
"expectedPath": "/auth",
|
|
47
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "OAuth auth missing client ID environment variable",
|
|
51
|
+
"target": "manifest",
|
|
52
|
+
"document": {
|
|
53
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
54
|
+
"auth": { "kind": "oauth", "provider": "google", "scopes": ["read"] }, "files": ["index.ts"],
|
|
55
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
56
|
+
},
|
|
57
|
+
"expectedPath": "/auth",
|
|
58
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "OAuth auth missing scopes",
|
|
62
|
+
"target": "manifest",
|
|
63
|
+
"document": {
|
|
64
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
65
|
+
"auth": { "kind": "oauth", "provider": "google", "clientIdEnv": "GOOGLE_CLIENT_ID" }, "files": ["index.ts"],
|
|
66
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
67
|
+
},
|
|
68
|
+
"expectedPath": "/auth",
|
|
69
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "OAuth auth has empty scopes",
|
|
73
|
+
"target": "manifest",
|
|
74
|
+
"document": {
|
|
75
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
76
|
+
"auth": { "kind": "oauth", "provider": "google", "clientIdEnv": "GOOGLE_CLIENT_ID", "scopes": [] }, "files": ["index.ts"],
|
|
77
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
78
|
+
},
|
|
79
|
+
"expectedPath": "/auth",
|
|
80
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "OAuth auth has duplicate scopes",
|
|
84
|
+
"target": "manifest",
|
|
85
|
+
"document": {
|
|
86
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
87
|
+
"auth": { "kind": "oauth", "provider": "google", "clientIdEnv": "GOOGLE_CLIENT_ID", "scopes": ["read", "read"] },
|
|
88
|
+
"files": ["index.ts"],
|
|
89
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
90
|
+
},
|
|
91
|
+
"expectedPath": "/auth",
|
|
92
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "OAuth auth has env fields",
|
|
96
|
+
"target": "manifest",
|
|
97
|
+
"document": {
|
|
98
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
99
|
+
"auth": { "kind": "oauth", "provider": "google", "clientIdEnv": "GOOGLE_CLIENT_ID", "scopes": ["read"], "env": "API_KEY" },
|
|
100
|
+
"files": ["index.ts"],
|
|
101
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
102
|
+
},
|
|
103
|
+
"expectedPath": "/auth",
|
|
104
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "none auth has credential fields",
|
|
108
|
+
"target": "manifest",
|
|
109
|
+
"document": {
|
|
110
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
111
|
+
"auth": { "kind": "none", "env": "API_KEY" }, "files": ["index.ts"],
|
|
112
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
113
|
+
},
|
|
114
|
+
"expectedPath": "/auth",
|
|
115
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "invalid authentication docs URI",
|
|
119
|
+
"target": "manifest",
|
|
120
|
+
"document": {
|
|
121
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
122
|
+
"auth": { "kind": "env", "env": "API_KEY", "docs": "not a uri" },
|
|
123
|
+
"files": ["index.ts"],
|
|
124
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
125
|
+
},
|
|
126
|
+
"expectedPath": "/auth",
|
|
127
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"name": "tool missing risk",
|
|
131
|
+
"target": "manifest",
|
|
132
|
+
"document": {
|
|
133
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
134
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
135
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "parallel_safe": false }]
|
|
136
|
+
},
|
|
137
|
+
"expectedPath": "/tools/0",
|
|
138
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "tool missing name",
|
|
142
|
+
"target": "manifest",
|
|
143
|
+
"document": {
|
|
144
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
145
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
146
|
+
"tools": [{ "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
147
|
+
},
|
|
148
|
+
"expectedPath": "/tools/0",
|
|
149
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "tool missing parameters",
|
|
153
|
+
"target": "manifest",
|
|
154
|
+
"document": {
|
|
155
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
156
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
157
|
+
"tools": [{ "name": "x", "description": "x", "risk": "read", "parallel_safe": false }]
|
|
158
|
+
},
|
|
159
|
+
"expectedPath": "/tools/0",
|
|
160
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "tool missing parallel safe classification",
|
|
164
|
+
"target": "manifest",
|
|
165
|
+
"document": {
|
|
166
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
167
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
168
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read" }]
|
|
169
|
+
},
|
|
170
|
+
"expectedPath": "/tools/0",
|
|
171
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "tool has invalid Draft 2020-12 parameter schema",
|
|
175
|
+
"target": "manifest",
|
|
176
|
+
"document": {
|
|
177
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
178
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
179
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "not-a-json-type" }, "risk": "read", "parallel_safe": false }]
|
|
180
|
+
},
|
|
181
|
+
"expectedPath": "/tools/0/parameters/type",
|
|
182
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "tool has unsupported parameter schema dialect",
|
|
186
|
+
"target": "manifest",
|
|
187
|
+
"document": {
|
|
188
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
189
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
190
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "$schema": "https://json-schema.org/draft/2019-09/schema" }, "risk": "read", "parallel_safe": false }]
|
|
191
|
+
},
|
|
192
|
+
"expectedPath": "/tools/0/parameters/$schema",
|
|
193
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "tool has invalid regular expression pattern",
|
|
197
|
+
"target": "manifest",
|
|
198
|
+
"document": {
|
|
199
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
200
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
201
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "[" } } }, "risk": "read", "parallel_safe": false }]
|
|
202
|
+
},
|
|
203
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
204
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "tool has invalid schema identifier",
|
|
208
|
+
"target": "manifest",
|
|
209
|
+
"document": {
|
|
210
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
211
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
212
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "$id": "not uri with spaces", "type": "object" } } }, "risk": "read", "parallel_safe": false }]
|
|
213
|
+
},
|
|
214
|
+
"expectedPath": "/tools/0/parameters/properties/value/$id",
|
|
215
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"name": "tool pattern uses ECMAScript named capture",
|
|
219
|
+
"target": "manifest",
|
|
220
|
+
"document": {
|
|
221
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
222
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
223
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "(?<name>a)" } } }, "risk": "read", "parallel_safe": false }]
|
|
224
|
+
},
|
|
225
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
226
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "tool pattern uses Python named capture",
|
|
230
|
+
"target": "manifest",
|
|
231
|
+
"document": {
|
|
232
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
233
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
234
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "(?P<name>a)" } } }, "risk": "read", "parallel_safe": false }]
|
|
235
|
+
},
|
|
236
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
237
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "tool pattern uses inline flags",
|
|
241
|
+
"target": "manifest",
|
|
242
|
+
"document": {
|
|
243
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
244
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
245
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "(?i:a)" } } }, "risk": "read", "parallel_safe": false }]
|
|
246
|
+
},
|
|
247
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
248
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "tool pattern uses atomic groups",
|
|
252
|
+
"target": "manifest",
|
|
253
|
+
"document": {
|
|
254
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
255
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
256
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "(?>a)" } } }, "risk": "read", "parallel_safe": false }]
|
|
257
|
+
},
|
|
258
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
259
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "tool pattern uses Python anchors",
|
|
263
|
+
"target": "manifest",
|
|
264
|
+
"document": {
|
|
265
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
266
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
267
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "\\A[a-z]+\\Z" } } }, "risk": "read", "parallel_safe": false }]
|
|
268
|
+
},
|
|
269
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
270
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"name": "tool pattern uses Unicode properties",
|
|
274
|
+
"target": "manifest",
|
|
275
|
+
"document": {
|
|
276
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
277
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
278
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "\\p{Letter}+" } } }, "risk": "read", "parallel_safe": false }]
|
|
279
|
+
},
|
|
280
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
281
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "tool pattern uses backreferences",
|
|
285
|
+
"target": "manifest",
|
|
286
|
+
"document": {
|
|
287
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
288
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
289
|
+
"tools": [{ "name": "x", "description": "x", "parameters": { "type": "object", "properties": { "value": { "type": "string", "pattern": "(a)\\1" } } }, "risk": "read", "parallel_safe": false }]
|
|
290
|
+
},
|
|
291
|
+
"expectedPath": "/tools/0/parameters/properties/value/pattern",
|
|
292
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "tool has non-positive timeout",
|
|
296
|
+
"target": "manifest",
|
|
297
|
+
"document": {
|
|
298
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
299
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
300
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false, "timeout_ms": 0 }]
|
|
301
|
+
},
|
|
302
|
+
"expectedPath": "/tools/0/timeout_ms",
|
|
303
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "duplicate tool name",
|
|
307
|
+
"target": "manifest",
|
|
308
|
+
"document": {
|
|
309
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
310
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
311
|
+
"tools": [
|
|
312
|
+
{ "name": "x", "description": "first", "parameters": {}, "risk": "read", "parallel_safe": false },
|
|
313
|
+
{ "name": "x", "description": "second", "parameters": {}, "risk": "write", "parallel_safe": false }
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
"expectedPath": "/tools/1/name",
|
|
317
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "absolute manifest file path",
|
|
321
|
+
"target": "manifest",
|
|
322
|
+
"document": {
|
|
323
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
324
|
+
"auth": { "kind": "none" }, "files": ["/tmp/index.ts"],
|
|
325
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
326
|
+
},
|
|
327
|
+
"expectedPath": "/files/0",
|
|
328
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "parent traversal manifest file path",
|
|
332
|
+
"target": "manifest",
|
|
333
|
+
"document": {
|
|
334
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
335
|
+
"auth": { "kind": "none" }, "files": ["../index.ts"],
|
|
336
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
337
|
+
},
|
|
338
|
+
"expectedPath": "/files/0",
|
|
339
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"name": "duplicate manifest file",
|
|
343
|
+
"target": "manifest",
|
|
344
|
+
"document": {
|
|
345
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
346
|
+
"auth": { "kind": "none" }, "files": ["index.ts", "index.ts"],
|
|
347
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
348
|
+
},
|
|
349
|
+
"expectedPath": "/files",
|
|
350
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"name": "index manifest path escapes registry",
|
|
354
|
+
"target": "index",
|
|
355
|
+
"document": {
|
|
356
|
+
"$schema": "./index.schema.json", "version": "0.1.0",
|
|
357
|
+
"integrations": {
|
|
358
|
+
"x": { "manifest": "../x/manifest.json", "stability": "beta", "runtimes": ["typescript"] }
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"expectedPath": "/integrations/x/manifest",
|
|
362
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "unknown stability tier",
|
|
366
|
+
"target": "index",
|
|
367
|
+
"document": {
|
|
368
|
+
"$schema": "./index.schema.json", "version": "0.1.0",
|
|
369
|
+
"integrations": {
|
|
370
|
+
"x": { "manifest": "x/manifest.json", "stability": "preview", "runtimes": ["typescript"] }
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
"expectedPath": "/integrations/x/stability",
|
|
374
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"name": "unknown integration runtime",
|
|
378
|
+
"target": "index",
|
|
379
|
+
"document": {
|
|
380
|
+
"$schema": "./index.schema.json", "version": "0.1.0",
|
|
381
|
+
"integrations": {
|
|
382
|
+
"x": { "manifest": "x/manifest.json", "stability": "beta", "runtimes": ["ruby"] }
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
"expectedPath": "/integrations/x/runtimes/0",
|
|
386
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"name": "index key does not match manifest name",
|
|
390
|
+
"target": "registry",
|
|
391
|
+
"index": {
|
|
392
|
+
"$schema": "./index.schema.json", "version": "0.1.0",
|
|
393
|
+
"integrations": {
|
|
394
|
+
"alias": { "manifest": "actual/manifest.json", "stability": "beta", "runtimes": ["typescript"] }
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
"manifests": {
|
|
398
|
+
"actual/manifest.json": {
|
|
399
|
+
"name": "actual", "version": "0.1.0", "namespace": "actual", "description": "actual",
|
|
400
|
+
"auth": { "kind": "none" }, "files": ["index.ts"],
|
|
401
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"files": ["actual/index.ts"],
|
|
405
|
+
"expectedPath": "/name",
|
|
406
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"name": "index points to missing manifest",
|
|
410
|
+
"target": "registry",
|
|
411
|
+
"index": {
|
|
412
|
+
"$schema": "./index.schema.json", "version": "0.1.0",
|
|
413
|
+
"integrations": {
|
|
414
|
+
"ghost": { "manifest": "ghost/manifest.json", "stability": "experimental", "runtimes": ["typescript"] }
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"manifests": {},
|
|
418
|
+
"files": [],
|
|
419
|
+
"expectedPath": "/integrations/ghost/manifest",
|
|
420
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"name": "manifest references missing file",
|
|
424
|
+
"target": "registry",
|
|
425
|
+
"index": {
|
|
426
|
+
"$schema": "./index.schema.json", "version": "0.1.0",
|
|
427
|
+
"integrations": {
|
|
428
|
+
"x": { "manifest": "x/manifest.json", "stability": "experimental", "runtimes": ["typescript"] }
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"manifests": {
|
|
432
|
+
"x/manifest.json": {
|
|
433
|
+
"name": "x", "version": "0.1.0", "namespace": "x", "description": "x",
|
|
434
|
+
"auth": { "kind": "none" }, "files": ["missing.ts"],
|
|
435
|
+
"tools": [{ "name": "x", "description": "x", "parameters": {}, "risk": "read", "parallel_safe": false }]
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"files": [],
|
|
439
|
+
"expectedPath": "/files/0",
|
|
440
|
+
"expectedCode": "INTEGRATION_SCHEMA_INVALID"
|
|
441
|
+
}
|
|
442
|
+
]
|
|
443
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"cases": [
|
|
4
|
+
{
|
|
5
|
+
"name": "manifest with no authentication",
|
|
6
|
+
"target": "manifest",
|
|
7
|
+
"document": {
|
|
8
|
+
"name": "echo",
|
|
9
|
+
"version": "0.1.0",
|
|
10
|
+
"namespace": "echo",
|
|
11
|
+
"description": "Echo text.",
|
|
12
|
+
"auth": { "kind": "none" },
|
|
13
|
+
"files": ["index.ts"],
|
|
14
|
+
"tools": [
|
|
15
|
+
{
|
|
16
|
+
"name": "say",
|
|
17
|
+
"description": "Echo text.",
|
|
18
|
+
"parameters": {
|
|
19
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
20
|
+
"type": "object",
|
|
21
|
+
"properties": {
|
|
22
|
+
"message": {
|
|
23
|
+
"$id": "https://kaji.dev/schemas/echo-message-v1.json",
|
|
24
|
+
"type": "string",
|
|
25
|
+
"pattern": "^[a-z]+$"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": ["message"],
|
|
29
|
+
"additionalProperties": false
|
|
30
|
+
},
|
|
31
|
+
"risk": "read",
|
|
32
|
+
"parallel_safe": false
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "manifest with optional environment authentication",
|
|
39
|
+
"target": "manifest",
|
|
40
|
+
"document": {
|
|
41
|
+
"name": "search",
|
|
42
|
+
"version": "0.1.0",
|
|
43
|
+
"namespace": "search",
|
|
44
|
+
"description": "Search text.",
|
|
45
|
+
"auth": {
|
|
46
|
+
"kind": "env",
|
|
47
|
+
"env": "SEARCH_API_KEY",
|
|
48
|
+
"optional": true,
|
|
49
|
+
"docs": "https://example.com/auth"
|
|
50
|
+
},
|
|
51
|
+
"files": ["index.ts"],
|
|
52
|
+
"tools": [
|
|
53
|
+
{
|
|
54
|
+
"name": "search",
|
|
55
|
+
"description": "Search text.",
|
|
56
|
+
"parameters": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {
|
|
59
|
+
"query": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"pattern": "^(red|blue)-[0-9]{1,3}$"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"risk": "read",
|
|
66
|
+
"parallel_safe": true,
|
|
67
|
+
"timeout_ms": 1000
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "manifest with OAuth authentication",
|
|
74
|
+
"target": "manifest",
|
|
75
|
+
"document": {
|
|
76
|
+
"name": "mail",
|
|
77
|
+
"version": "0.1.0",
|
|
78
|
+
"namespace": "mail",
|
|
79
|
+
"description": "Read mail.",
|
|
80
|
+
"auth": {
|
|
81
|
+
"kind": "oauth",
|
|
82
|
+
"provider": "google",
|
|
83
|
+
"clientIdEnv": "GOOGLE_CLIENT_ID",
|
|
84
|
+
"clientSecretEnv": "GOOGLE_CLIENT_SECRET",
|
|
85
|
+
"scopes": ["https://www.googleapis.com/auth/gmail.readonly"],
|
|
86
|
+
"docs": "https://example.com/oauth"
|
|
87
|
+
},
|
|
88
|
+
"files": ["mail/index.ts"],
|
|
89
|
+
"tools": [
|
|
90
|
+
{
|
|
91
|
+
"name": "read",
|
|
92
|
+
"description": "Read mail.",
|
|
93
|
+
"parameters": { "type": "object" },
|
|
94
|
+
"risk": "read",
|
|
95
|
+
"parallel_safe": false
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "registry index with beta and experimental entries",
|
|
102
|
+
"target": "index",
|
|
103
|
+
"document": {
|
|
104
|
+
"$schema": "./index.schema.json",
|
|
105
|
+
"version": "0.1.0",
|
|
106
|
+
"integrations": {
|
|
107
|
+
"echo": {
|
|
108
|
+
"manifest": "echo/manifest.json",
|
|
109
|
+
"stability": "beta",
|
|
110
|
+
"runtimes": ["python", "typescript"]
|
|
111
|
+
},
|
|
112
|
+
"http": {
|
|
113
|
+
"manifest": "http/manifest.json",
|
|
114
|
+
"stability": "experimental",
|
|
115
|
+
"runtimes": ["typescript"]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kaji.dev/schemas/integration-copy-provenance-v1.json",
|
|
4
|
+
"title": "Kaji copied integration bundle provenance",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"schemaVersion",
|
|
8
|
+
"integration",
|
|
9
|
+
"sdkVersion",
|
|
10
|
+
"runtime",
|
|
11
|
+
"stability",
|
|
12
|
+
"registryEntrySha256",
|
|
13
|
+
"abiSha256",
|
|
14
|
+
"manifestSha256",
|
|
15
|
+
"license",
|
|
16
|
+
"files"
|
|
17
|
+
],
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"properties": {
|
|
20
|
+
"schemaVersion": { "const": "1.0.0" },
|
|
21
|
+
"integration": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
24
|
+
},
|
|
25
|
+
"sdkVersion": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
26
|
+
"runtime": { "enum": ["python", "typescript"] },
|
|
27
|
+
"stability": { "enum": ["experimental", "beta"] },
|
|
28
|
+
"registryEntrySha256": { "$ref": "#/$defs/sha256" },
|
|
29
|
+
"abiSha256": { "$ref": "#/$defs/sha256" },
|
|
30
|
+
"manifestSha256": { "$ref": "#/$defs/sha256" },
|
|
31
|
+
"license": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"required": ["identifier", "url", "sha256"],
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"properties": {
|
|
36
|
+
"identifier": { "type": "string", "minLength": 1, "maxLength": 128 },
|
|
37
|
+
"url": { "type": "string", "format": "uri" },
|
|
38
|
+
"sha256": { "$ref": "#/$defs/sha256" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"files": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"minProperties": 1,
|
|
44
|
+
"propertyNames": {
|
|
45
|
+
"allOf": [
|
|
46
|
+
{
|
|
47
|
+
"pattern": "^(?!/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|/)\\.\\.?(?:/|$))[A-Za-z0-9_@.+-]+(?:/[A-Za-z0-9_@.+-]+)*$"
|
|
48
|
+
},
|
|
49
|
+
{ "not": { "const": ".kaji-integration-provenance.json" } }
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
"additionalProperties": { "$ref": "#/$defs/sha256" }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"$defs": {
|
|
56
|
+
"sha256": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|