@irogane/kaji 0.2.0-beta.11 → 0.3.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 (137) hide show
  1. package/README.md +112 -551
  2. package/dist/index.d.mts +253 -0
  3. package/dist/index.mjs +440 -0
  4. package/package.json +28 -166
  5. package/contracts/README.md +0 -14
  6. package/contracts/beta-core-v1.json +0 -52
  7. package/contracts/cli/init-cases-v1.json +0 -27
  8. package/contracts/errors/error-codes.json +0 -48
  9. package/contracts/errors/integration-recovery-v1.json +0 -127
  10. package/contracts/errors/provider-normalization.json +0 -111
  11. package/contracts/events/conformance-invalid.json +0 -20
  12. package/contracts/events/conformance.json +0 -511
  13. package/contracts/events/new-kaji-event-v1.schema.json +0 -1021
  14. package/contracts/events/stored-kaji-event-v1.schema.json +0 -1025
  15. package/contracts/feature-tiers-v1.json +0 -488
  16. package/contracts/integrations/abi-index-v1.json +0 -8
  17. package/contracts/integrations/conformance-invalid.json +0 -443
  18. package/contracts/integrations/conformance-valid.json +0 -121
  19. package/contracts/integrations/copy-provenance-v1.schema.json +0 -61
  20. package/contracts/integrations/echo-tool-abi-v1.json +0 -37
  21. package/contracts/integrations/github-api-conformance-v1.json +0 -644
  22. package/contracts/integrations/github-tool-abi-typescript-v1.json +0 -369
  23. package/contracts/integrations/github-tool-abi-v1.json +0 -146
  24. package/contracts/integrations/gmail-api-conformance-v1.json +0 -750
  25. package/contracts/integrations/gmail-tool-abi-v1.json +0 -62
  26. package/contracts/integrations/index.schema.json +0 -37
  27. package/contracts/integrations/manifest.schema.json +0 -119
  28. package/contracts/parity/expected-normalized.json +0 -4906
  29. package/contracts/parity/scenarios.json +0 -100
  30. package/contracts/parity/scenarios.schema.json +0 -214
  31. package/contracts/providers/cost-conformance.json +0 -112
  32. package/contracts/release/github-proof-v1.schema.json +0 -138
  33. package/contracts/release/gmail-proof-v1.schema.json +0 -138
  34. package/contracts/release/kaji-ts-consumer-handoff-v1.schema.json +0 -1289
  35. package/contracts/release/publisher-identity-receipt-v1.schema.json +0 -319
  36. package/contracts/release/typescript-onboarding-evidence-v1.schema.json +0 -740
  37. package/contracts/tools/conformance-invalid.json +0 -271
  38. package/contracts/tools/conformance-valid.json +0 -78
  39. package/contracts/tools/tool-schema-v1.schema.json +0 -18
  40. package/dist/anthropic.cjs +0 -1231
  41. package/dist/anthropic.cjs.map +0 -1
  42. package/dist/anthropic.d.cts +0 -26
  43. package/dist/anthropic.d.ts +0 -26
  44. package/dist/anthropic.js +0 -270
  45. package/dist/anthropic.js.map +0 -1
  46. package/dist/auth.cjs +0 -1507
  47. package/dist/auth.cjs.map +0 -1
  48. package/dist/auth.d.cts +0 -129
  49. package/dist/auth.d.ts +0 -129
  50. package/dist/auth.js +0 -1039
  51. package/dist/auth.js.map +0 -1
  52. package/dist/base-B9FRMcP8.d.cts +0 -140
  53. package/dist/base-nHQd1VtS.d.ts +0 -140
  54. package/dist/chunk-AAM33KAO.js +0 -4367
  55. package/dist/chunk-AAM33KAO.js.map +0 -1
  56. package/dist/chunk-KAJ6BM64.js +0 -153
  57. package/dist/chunk-KAJ6BM64.js.map +0 -1
  58. package/dist/chunk-KCAXIOZS.js +0 -308
  59. package/dist/chunk-KCAXIOZS.js.map +0 -1
  60. package/dist/chunk-LSJ4AVO2.js +0 -243
  61. package/dist/chunk-LSJ4AVO2.js.map +0 -1
  62. package/dist/chunk-TM7ZGOJX.js +0 -716
  63. package/dist/chunk-TM7ZGOJX.js.map +0 -1
  64. package/dist/cli/bin.d.ts +0 -2
  65. package/dist/cli/bin.js +0 -13
  66. package/dist/cli/bin.js.map +0 -1
  67. package/dist/cli/chunk-2RCWPRVY.js +0 -6277
  68. package/dist/cli/chunk-2RCWPRVY.js.map +0 -1
  69. package/dist/cli/chunk-SEBX54TR.js +0 -681
  70. package/dist/cli/chunk-SEBX54TR.js.map +0 -1
  71. package/dist/cli/index.d.ts +0 -232
  72. package/dist/cli/index.js +0 -11
  73. package/dist/cli/index.js.map +0 -1
  74. package/dist/cli/init-worker.d.ts +0 -2
  75. package/dist/cli/init-worker.js +0 -18
  76. package/dist/cli/init-worker.js.map +0 -1
  77. package/dist/cli/integration-copy-worker.js +0 -48
  78. package/dist/cli/integration-copy-worker.js.map +0 -1
  79. package/dist/cli/package-entry-cjs.cjs +0 -21
  80. package/dist/cli/package-entry-cjs.cjs.map +0 -1
  81. package/dist/cli/package-entry-cjs.d.cts +0 -2
  82. package/dist/cli/package-entry.d.ts +0 -2
  83. package/dist/cli/package-entry.js +0 -13
  84. package/dist/cli/package-entry.js.map +0 -1
  85. package/dist/context-BaFHrQHv.d.cts +0 -21
  86. package/dist/context-BaFHrQHv.d.ts +0 -21
  87. package/dist/context-C-YPY-GS.d.cts +0 -1538
  88. package/dist/context-C-YPY-GS.d.ts +0 -1538
  89. package/dist/index.cjs +0 -12346
  90. package/dist/index.cjs.map +0 -1
  91. package/dist/index.d.cts +0 -1560
  92. package/dist/index.d.ts +0 -1560
  93. package/dist/index.js +0 -7852
  94. package/dist/index.js.map +0 -1
  95. package/dist/integrations/github.cjs +0 -2092
  96. package/dist/integrations/github.cjs.map +0 -1
  97. package/dist/integrations/github.d.cts +0 -21
  98. package/dist/integrations/github.d.ts +0 -21
  99. package/dist/integrations/github.js +0 -2088
  100. package/dist/integrations/github.js.map +0 -1
  101. package/dist/integrations.cjs +0 -3370
  102. package/dist/integrations.cjs.map +0 -1
  103. package/dist/integrations.d.cts +0 -202
  104. package/dist/integrations.d.ts +0 -202
  105. package/dist/integrations.js +0 -2650
  106. package/dist/integrations.js.map +0 -1
  107. package/dist/observability-Cj--OkME.d.cts +0 -96
  108. package/dist/observability-Cj--OkME.d.ts +0 -96
  109. package/dist/openai.cjs +0 -1235
  110. package/dist/openai.cjs.map +0 -1
  111. package/dist/openai.d.cts +0 -32
  112. package/dist/openai.d.ts +0 -32
  113. package/dist/openai.js +0 -272
  114. package/dist/openai.js.map +0 -1
  115. package/dist/testing.cjs +0 -554
  116. package/dist/testing.cjs.map +0 -1
  117. package/dist/testing.d.cts +0 -43
  118. package/dist/testing.d.ts +0 -43
  119. package/dist/testing.js +0 -118
  120. package/dist/testing.js.map +0 -1
  121. package/registry/echo/index.ts +0 -53
  122. package/registry/echo/manifest.json +0 -53
  123. package/registry/github/LICENSE +0 -105
  124. package/registry/github/client.ts +0 -1727
  125. package/registry/github/index.ts +0 -263
  126. package/registry/github/manifest.json +0 -227
  127. package/registry/github/owner-fixtures.json +0 -10
  128. package/registry/github/tests/github.test.ts +0 -32
  129. package/registry/gmail/LICENSE +0 -105
  130. package/registry/gmail/client.ts +0 -548
  131. package/registry/gmail/index.ts +0 -165
  132. package/registry/gmail/manifest.json +0 -102
  133. package/registry/gmail/owner-fixtures.json +0 -10
  134. package/registry/gmail/tests/gmail.test.ts +0 -32
  135. package/registry/index.json +0 -21
  136. package/registry/index.schema.json +0 -37
  137. package/registry/schema.json +0 -119
@@ -1,271 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "cases": [
4
- {
5
- "name": "nested required",
6
- "kind": "invalid_arguments",
7
- "schema": {
8
- "type": "object",
9
- "required": ["profile"],
10
- "properties": {
11
- "profile": {
12
- "type": "object",
13
- "required": ["email"],
14
- "properties": { "email": { "type": "string" } }
15
- }
16
- }
17
- },
18
- "arguments": { "profile": {} },
19
- "expectedPath": "/profile",
20
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
21
- "retryable": false,
22
- "outcome": "not_started"
23
- },
24
- {
25
- "name": "nested additional property",
26
- "kind": "invalid_arguments",
27
- "schema": {
28
- "type": "object",
29
- "required": ["profile"],
30
- "properties": {
31
- "profile": {
32
- "type": "object",
33
- "additionalProperties": false,
34
- "properties": { "name": { "type": "string" } }
35
- }
36
- }
37
- },
38
- "arguments": { "profile": { "extra": true } },
39
- "expectedPath": "/profile",
40
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
41
- "retryable": false,
42
- "outcome": "not_started"
43
- },
44
- {
45
- "name": "top-level additional property",
46
- "kind": "invalid_arguments",
47
- "schema": {
48
- "type": "object",
49
- "additionalProperties": false,
50
- "properties": { "name": { "type": "string" } }
51
- },
52
- "arguments": { "name": "kaji", "extra": true },
53
- "expectedPath": "/",
54
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
55
- "retryable": false,
56
- "outcome": "not_started"
57
- },
58
- {
59
- "name": "const",
60
- "kind": "invalid_arguments",
61
- "schema": {
62
- "type": "object",
63
- "properties": { "mode": { "const": "strict" } }
64
- },
65
- "arguments": { "mode": "relaxed" },
66
- "expectedPath": "/mode",
67
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
68
- "retryable": false,
69
- "outcome": "not_started"
70
- },
71
- {
72
- "name": "enum",
73
- "kind": "invalid_arguments",
74
- "schema": {
75
- "type": "object",
76
- "properties": { "mode": { "enum": ["safe", "strict"] } }
77
- },
78
- "arguments": { "mode": "other" },
79
- "expectedPath": "/mode",
80
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
81
- "retryable": false,
82
- "outcome": "not_started"
83
- },
84
- {
85
- "name": "number minimum",
86
- "kind": "invalid_arguments",
87
- "schema": {
88
- "type": "object",
89
- "properties": { "count": { "type": "integer", "minimum": 1, "maximum": 5 } }
90
- },
91
- "arguments": { "count": 0 },
92
- "expectedPath": "/count",
93
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
94
- "retryable": false,
95
- "outcome": "not_started"
96
- },
97
- {
98
- "name": "number maximum",
99
- "kind": "invalid_arguments",
100
- "schema": {
101
- "type": "object",
102
- "properties": { "count": { "type": "integer", "minimum": 1, "maximum": 5 } }
103
- },
104
- "arguments": { "count": 6 },
105
- "expectedPath": "/count",
106
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
107
- "retryable": false,
108
- "outcome": "not_started"
109
- },
110
- {
111
- "name": "string minimum length",
112
- "kind": "invalid_arguments",
113
- "schema": {
114
- "type": "object",
115
- "properties": { "slug": { "type": "string", "minLength": 3, "maxLength": 8 } }
116
- },
117
- "arguments": { "slug": "ab" },
118
- "expectedPath": "/slug",
119
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
120
- "retryable": false,
121
- "outcome": "not_started"
122
- },
123
- {
124
- "name": "string maximum length",
125
- "kind": "invalid_arguments",
126
- "schema": {
127
- "type": "object",
128
- "properties": { "slug": { "type": "string", "minLength": 3, "maxLength": 8 } }
129
- },
130
- "arguments": { "slug": "too-long-slug" },
131
- "expectedPath": "/slug",
132
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
133
- "retryable": false,
134
- "outcome": "not_started"
135
- },
136
- {
137
- "name": "string pattern",
138
- "kind": "invalid_arguments",
139
- "schema": {
140
- "type": "object",
141
- "properties": { "slug": { "type": "string", "pattern": "^[a-z]+$" } }
142
- },
143
- "arguments": { "slug": "NOT-valid" },
144
- "expectedPath": "/slug",
145
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
146
- "retryable": false,
147
- "outcome": "not_started"
148
- },
149
- {
150
- "name": "array minimum items",
151
- "kind": "invalid_arguments",
152
- "schema": {
153
- "type": "object",
154
- "properties": { "ids": { "type": "array", "minItems": 1, "maxItems": 2 } }
155
- },
156
- "arguments": { "ids": [] },
157
- "expectedPath": "/ids",
158
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
159
- "retryable": false,
160
- "outcome": "not_started"
161
- },
162
- {
163
- "name": "array maximum items",
164
- "kind": "invalid_arguments",
165
- "schema": {
166
- "type": "object",
167
- "properties": { "ids": { "type": "array", "minItems": 1, "maxItems": 2 } }
168
- },
169
- "arguments": { "ids": [1, 2, 3] },
170
- "expectedPath": "/ids",
171
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
172
- "retryable": false,
173
- "outcome": "not_started"
174
- },
175
- {
176
- "name": "array item",
177
- "kind": "invalid_arguments",
178
- "schema": {
179
- "type": "object",
180
- "properties": { "ids": { "type": "array", "items": { "type": "integer" } } }
181
- },
182
- "arguments": { "ids": [1, "two"] },
183
- "expectedPath": "/ids/1",
184
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
185
- "retryable": false,
186
- "outcome": "not_started"
187
- },
188
- {
189
- "name": "email format",
190
- "kind": "invalid_arguments",
191
- "schema": {
192
- "type": "object",
193
- "properties": { "email": { "type": "string", "format": "email" } }
194
- },
195
- "arguments": { "email": "not-an-email" },
196
- "expectedPath": "/email",
197
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
198
- "retryable": false,
199
- "outcome": "not_started"
200
- },
201
- {
202
- "name": "uri format",
203
- "kind": "invalid_arguments",
204
- "schema": {
205
- "type": "object",
206
- "properties": { "url": { "type": "string", "format": "uri" } }
207
- },
208
- "arguments": { "url": "not a uri" },
209
- "expectedPath": "/url",
210
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
211
- "retryable": false,
212
- "outcome": "not_started"
213
- },
214
- {
215
- "name": "union branches",
216
- "kind": "invalid_arguments",
217
- "schema": {
218
- "type": "object",
219
- "properties": {
220
- "target": {
221
- "oneOf": [
222
- { "type": "string", "minLength": 1 },
223
- { "type": "integer", "minimum": 1 }
224
- ]
225
- }
226
- }
227
- },
228
- "arguments": { "target": false },
229
- "expectedPath": "/target",
230
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
231
- "retryable": false,
232
- "outcome": "not_started"
233
- },
234
- {
235
- "name": "local reference",
236
- "kind": "invalid_arguments",
237
- "schema": {
238
- "$defs": { "positive": { "type": "integer", "minimum": 1 } },
239
- "type": "object",
240
- "properties": { "value": { "$ref": "#/$defs/positive" } }
241
- },
242
- "arguments": { "value": 0 },
243
- "expectedPath": "/value",
244
- "expectedCode": "INVALID_TOOL_ARGUMENTS",
245
- "retryable": false,
246
- "outcome": "not_started"
247
- },
248
- {
249
- "name": "invalid type declaration",
250
- "kind": "invalid_schema",
251
- "schema": { "type": "not-a-json-schema-type" },
252
- "arguments": {},
253
- "expectedPath": "/type",
254
- "expectedCode": "INVALID_TOOL_SCHEMA",
255
- "expectedMessage": "Tool schema failed schema validation at /type",
256
- "retryable": false,
257
- "outcome": "not_started"
258
- },
259
- {
260
- "name": "invalid required declaration",
261
- "kind": "invalid_schema",
262
- "schema": { "type": "object", "required": "name" },
263
- "arguments": {},
264
- "expectedPath": "/required",
265
- "expectedCode": "INVALID_TOOL_SCHEMA",
266
- "expectedMessage": "Tool schema failed schema validation at /required",
267
- "retryable": false,
268
- "outcome": "not_started"
269
- }
270
- ]
271
- }
@@ -1,78 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "cases": [
4
- {
5
- "name": "nested object, format, and bounded array",
6
- "schema": {
7
- "type": "object",
8
- "required": ["profile", "tags"],
9
- "additionalProperties": false,
10
- "properties": {
11
- "profile": {
12
- "type": "object",
13
- "required": ["email", "role"],
14
- "additionalProperties": false,
15
- "properties": {
16
- "email": { "type": "string", "format": "email" },
17
- "role": { "enum": ["admin", "member"] }
18
- }
19
- },
20
- "tags": {
21
- "type": "array",
22
- "minItems": 1,
23
- "maxItems": 3,
24
- "items": { "type": "string", "minLength": 2, "maxLength": 8 }
25
- }
26
- }
27
- },
28
- "arguments": {
29
- "profile": { "email": "user@example.com", "role": "member" },
30
- "tags": ["beta"]
31
- }
32
- },
33
- {
34
- "name": "const and number bounds",
35
- "schema": {
36
- "type": "object",
37
- "required": ["mode", "count"],
38
- "properties": {
39
- "mode": { "const": "strict" },
40
- "count": { "type": "integer", "minimum": 1, "maximum": 5 }
41
- }
42
- },
43
- "arguments": { "mode": "strict", "count": 3 }
44
- },
45
- {
46
- "name": "union branch",
47
- "schema": {
48
- "type": "object",
49
- "required": ["target"],
50
- "properties": {
51
- "target": {
52
- "oneOf": [
53
- { "type": "string", "minLength": 1 },
54
- { "type": "integer", "minimum": 1 }
55
- ]
56
- }
57
- }
58
- },
59
- "arguments": { "target": 2 }
60
- },
61
- {
62
- "name": "local reference",
63
- "schema": {
64
- "$defs": {
65
- "target": {
66
- "type": "object",
67
- "required": ["url"],
68
- "properties": { "url": { "type": "string", "format": "uri" } }
69
- }
70
- },
71
- "type": "object",
72
- "required": ["target"],
73
- "properties": { "target": { "$ref": "#/$defs/target" } }
74
- },
75
- "arguments": { "target": { "url": "https://example.com/resource" } }
76
- }
77
- ]
78
- }
@@ -1,18 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://kaji.dev/contracts/tools/tool-schema-v1.schema.json",
4
- "title": "Kaji tool specification",
5
- "type": "object",
6
- "required": ["name", "description", "parameters", "risk"],
7
- "additionalProperties": false,
8
- "properties": {
9
- "name": { "type": "string", "pattern": "^[A-Za-z_][A-Za-z0-9_.-]*$" },
10
- "description": { "type": "string", "minLength": 1 },
11
- "parameters": { "type": "object" },
12
- "risk": {
13
- "enum": ["read", "write", "external_effect", "destructive", "admin"]
14
- },
15
- "parallel_safe": { "type": "boolean", "default": false },
16
- "timeout_ms": { "type": "integer", "minimum": 1 }
17
- }
18
- }