@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.
Files changed (136) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +598 -0
  3. package/contracts/README.md +14 -0
  4. package/contracts/beta-core-v1.json +52 -0
  5. package/contracts/cli/init-cases-v1.json +27 -0
  6. package/contracts/errors/error-codes.json +48 -0
  7. package/contracts/errors/integration-recovery-v1.json +127 -0
  8. package/contracts/errors/provider-normalization.json +111 -0
  9. package/contracts/events/conformance-invalid.json +20 -0
  10. package/contracts/events/conformance.json +511 -0
  11. package/contracts/events/new-kaji-event-v1.schema.json +1021 -0
  12. package/contracts/events/stored-kaji-event-v1.schema.json +1025 -0
  13. package/contracts/feature-tiers-v1.json +488 -0
  14. package/contracts/integrations/abi-index-v1.json +8 -0
  15. package/contracts/integrations/conformance-invalid.json +443 -0
  16. package/contracts/integrations/conformance-valid.json +121 -0
  17. package/contracts/integrations/copy-provenance-v1.schema.json +61 -0
  18. package/contracts/integrations/echo-tool-abi-v1.json +37 -0
  19. package/contracts/integrations/github-api-conformance-v1.json +644 -0
  20. package/contracts/integrations/github-tool-abi-typescript-v1.json +369 -0
  21. package/contracts/integrations/github-tool-abi-v1.json +146 -0
  22. package/contracts/integrations/gmail-api-conformance-v1.json +750 -0
  23. package/contracts/integrations/gmail-tool-abi-v1.json +62 -0
  24. package/contracts/integrations/index.schema.json +37 -0
  25. package/contracts/integrations/manifest.schema.json +119 -0
  26. package/contracts/parity/expected-normalized.json +4906 -0
  27. package/contracts/parity/scenarios.json +100 -0
  28. package/contracts/parity/scenarios.schema.json +214 -0
  29. package/contracts/providers/cost-conformance.json +112 -0
  30. package/contracts/release/github-proof-v1.schema.json +138 -0
  31. package/contracts/release/gmail-proof-v1.schema.json +138 -0
  32. package/contracts/release/kaji-ts-consumer-handoff-v1.schema.json +1289 -0
  33. package/contracts/release/publisher-identity-receipt-v1.schema.json +319 -0
  34. package/contracts/release/typescript-onboarding-evidence-v1.schema.json +740 -0
  35. package/contracts/tools/conformance-invalid.json +271 -0
  36. package/contracts/tools/conformance-valid.json +78 -0
  37. package/contracts/tools/tool-schema-v1.schema.json +18 -0
  38. package/dist/anthropic.cjs +1231 -0
  39. package/dist/anthropic.cjs.map +1 -0
  40. package/dist/anthropic.d.cts +26 -0
  41. package/dist/anthropic.d.ts +26 -0
  42. package/dist/anthropic.js +270 -0
  43. package/dist/anthropic.js.map +1 -0
  44. package/dist/auth.cjs +1507 -0
  45. package/dist/auth.cjs.map +1 -0
  46. package/dist/auth.d.cts +129 -0
  47. package/dist/auth.d.ts +129 -0
  48. package/dist/auth.js +1039 -0
  49. package/dist/auth.js.map +1 -0
  50. package/dist/base-B9FRMcP8.d.cts +140 -0
  51. package/dist/base-nHQd1VtS.d.ts +140 -0
  52. package/dist/chunk-AAM33KAO.js +4367 -0
  53. package/dist/chunk-AAM33KAO.js.map +1 -0
  54. package/dist/chunk-KAJ6BM64.js +153 -0
  55. package/dist/chunk-KAJ6BM64.js.map +1 -0
  56. package/dist/chunk-KCAXIOZS.js +308 -0
  57. package/dist/chunk-KCAXIOZS.js.map +1 -0
  58. package/dist/chunk-LSJ4AVO2.js +243 -0
  59. package/dist/chunk-LSJ4AVO2.js.map +1 -0
  60. package/dist/chunk-TM7ZGOJX.js +716 -0
  61. package/dist/chunk-TM7ZGOJX.js.map +1 -0
  62. package/dist/cli/bin.d.ts +2 -0
  63. package/dist/cli/bin.js +13 -0
  64. package/dist/cli/bin.js.map +1 -0
  65. package/dist/cli/chunk-2RCWPRVY.js +6277 -0
  66. package/dist/cli/chunk-2RCWPRVY.js.map +1 -0
  67. package/dist/cli/chunk-SEBX54TR.js +681 -0
  68. package/dist/cli/chunk-SEBX54TR.js.map +1 -0
  69. package/dist/cli/index.d.ts +232 -0
  70. package/dist/cli/index.js +11 -0
  71. package/dist/cli/index.js.map +1 -0
  72. package/dist/cli/init-worker.d.ts +2 -0
  73. package/dist/cli/init-worker.js +18 -0
  74. package/dist/cli/init-worker.js.map +1 -0
  75. package/dist/cli/integration-copy-worker.js +48 -0
  76. package/dist/cli/integration-copy-worker.js.map +1 -0
  77. package/dist/cli/package-entry-cjs.cjs +21 -0
  78. package/dist/cli/package-entry-cjs.cjs.map +1 -0
  79. package/dist/cli/package-entry-cjs.d.cts +2 -0
  80. package/dist/cli/package-entry.d.ts +2 -0
  81. package/dist/cli/package-entry.js +13 -0
  82. package/dist/cli/package-entry.js.map +1 -0
  83. package/dist/context-BaFHrQHv.d.cts +21 -0
  84. package/dist/context-BaFHrQHv.d.ts +21 -0
  85. package/dist/context-C-YPY-GS.d.cts +1538 -0
  86. package/dist/context-C-YPY-GS.d.ts +1538 -0
  87. package/dist/index.cjs +12346 -0
  88. package/dist/index.cjs.map +1 -0
  89. package/dist/index.d.cts +1560 -0
  90. package/dist/index.d.ts +1560 -0
  91. package/dist/index.js +7852 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/integrations/github.cjs +2092 -0
  94. package/dist/integrations/github.cjs.map +1 -0
  95. package/dist/integrations/github.d.cts +21 -0
  96. package/dist/integrations/github.d.ts +21 -0
  97. package/dist/integrations/github.js +2088 -0
  98. package/dist/integrations/github.js.map +1 -0
  99. package/dist/integrations.cjs +3370 -0
  100. package/dist/integrations.cjs.map +1 -0
  101. package/dist/integrations.d.cts +202 -0
  102. package/dist/integrations.d.ts +202 -0
  103. package/dist/integrations.js +2650 -0
  104. package/dist/integrations.js.map +1 -0
  105. package/dist/observability-Cj--OkME.d.cts +96 -0
  106. package/dist/observability-Cj--OkME.d.ts +96 -0
  107. package/dist/openai.cjs +1235 -0
  108. package/dist/openai.cjs.map +1 -0
  109. package/dist/openai.d.cts +32 -0
  110. package/dist/openai.d.ts +32 -0
  111. package/dist/openai.js +272 -0
  112. package/dist/openai.js.map +1 -0
  113. package/dist/testing.cjs +554 -0
  114. package/dist/testing.cjs.map +1 -0
  115. package/dist/testing.d.cts +43 -0
  116. package/dist/testing.d.ts +43 -0
  117. package/dist/testing.js +118 -0
  118. package/dist/testing.js.map +1 -0
  119. package/package.json +188 -0
  120. package/registry/echo/index.ts +53 -0
  121. package/registry/echo/manifest.json +53 -0
  122. package/registry/github/LICENSE +105 -0
  123. package/registry/github/client.ts +1727 -0
  124. package/registry/github/index.ts +263 -0
  125. package/registry/github/manifest.json +227 -0
  126. package/registry/github/owner-fixtures.json +10 -0
  127. package/registry/github/tests/github.test.ts +32 -0
  128. package/registry/gmail/LICENSE +105 -0
  129. package/registry/gmail/client.ts +548 -0
  130. package/registry/gmail/index.ts +165 -0
  131. package/registry/gmail/manifest.json +102 -0
  132. package/registry/gmail/owner-fixtures.json +10 -0
  133. package/registry/gmail/tests/gmail.test.ts +32 -0
  134. package/registry/index.json +21 -0
  135. package/registry/index.schema.json +37 -0
  136. package/registry/schema.json +119 -0
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "schemaVersion": 1,
4
+ "grammar": "kaji [--no-color] [--verbose] init [path] --provider mock|openai|anthropic --yes --force",
5
+ "defaults": {
6
+ "path": ".",
7
+ "provider": "mock"
8
+ },
9
+ "exitCodes": {
10
+ "successOrHelp": 0,
11
+ "validationRuntimeOrConflict": 1,
12
+ "usage": 2
13
+ },
14
+ "cases": [
15
+ { "name": "defaults", "args": [], "exitCode": 0 },
16
+ { "name": "explicit-path", "args": ["project"], "exitCode": 0 },
17
+ { "name": "mock-provider", "args": ["--provider", "mock"], "exitCode": 0 },
18
+ { "name": "openai-provider", "args": ["--provider", "openai"], "exitCode": 0 },
19
+ { "name": "anthropic-provider", "args": ["--provider", "anthropic"], "exitCode": 0 },
20
+ { "name": "yes", "args": ["--yes"], "exitCode": 0 },
21
+ { "name": "force", "args": ["--force"], "setup": "existing-file", "exitCode": 0 },
22
+ { "name": "unknown-provider", "args": ["--provider", "unknown"], "exitCode": 2 },
23
+ { "name": "missing-provider-value", "args": ["--provider"], "exitCode": 2 },
24
+ { "name": "unknown-option", "args": ["--unknown"], "exitCode": 2 },
25
+ { "name": "existing-file-refusal", "args": [], "setup": "existing-file", "exitCode": 1 }
26
+ ]
27
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kaji.dev/contracts/errors/error-codes.json",
4
+ "version": "1.0.0",
5
+ "codes": [
6
+ "INVALID_TOOL_SCHEMA",
7
+ "INVALID_TOOL_ARGUMENTS",
8
+ "INVALID_DURABLE_VALUE",
9
+ "INVALID_TOOL_RESULT",
10
+ "UNCLASSIFIED_TOOL_RISK",
11
+ "MISSING_TOOL_IDENTITY",
12
+ "TOOL_NOT_ALLOWED",
13
+ "APPROVAL_UNAVAILABLE",
14
+ "APPROVAL_REJECTED",
15
+ "APPROVAL_TIMEOUT",
16
+ "TOOL_CANCELLED",
17
+ "TOOL_TIMEOUT",
18
+ "TOOL_EXECUTION_FAILED",
19
+ "TOOL_START_RECORD_FAILED",
20
+ "EVENT_APPEND_FAILED",
21
+ "EVENT_PUBLISH_FAILED",
22
+ "EVENT_ID_CONFLICT",
23
+ "EVENT_BUFFER_OVERFLOW",
24
+ "EVENT_PAYLOAD_TOO_LARGE",
25
+ "EVENT_SCHEMA_INCOMPATIBLE",
26
+ "EVENT_STORE_CAPACITY_EXCEEDED",
27
+ "IDEMPOTENCY_CAPACITY_EXCEEDED",
28
+ "IDEMPOTENCY_CONFLICT",
29
+ "PROVIDER_API_ERROR",
30
+ "PROVIDER_AUTH_ERROR",
31
+ "PROVIDER_CONFIG_ERROR",
32
+ "PROVIDER_NETWORK_ERROR",
33
+ "PROVIDER_RATE_LIMITED",
34
+ "PROVIDER_OUTPUT_LIMIT",
35
+ "PROVIDER_CANCELLATION_CONTRACT_VIOLATION",
36
+ "TURN_TIMEOUT",
37
+ "INTEGRATION_SCHEMA_INVALID",
38
+ "INTEGRATION_ABI_MISMATCH",
39
+ "INTEGRATION_EXPERIMENTAL",
40
+ "INTEGRATION_API_ERROR",
41
+ "INTEGRATION_AUTH_REQUIRED",
42
+ "INTEGRATION_AUTH_ERROR",
43
+ "INTEGRATION_RATE_LIMITED",
44
+ "INTEGRATION_POLICY_REJECTED",
45
+ "INTEGRATION_REDIRECT_REJECTED",
46
+ "INTEGRATION_RESPONSE_LIMIT"
47
+ ]
48
+ }
@@ -0,0 +1,127 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kaji.dev/contracts/errors/integration-recovery-v1.json",
4
+ "version": "1.0.0",
5
+ "entries": {
6
+ "github_token_missing": {
7
+ "errorCode": "INTEGRATION_AUTH_REQUIRED",
8
+ "recoveryCode": "CONFIGURE_GITHUB_TOKEN",
9
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#github-token",
10
+ "problem": "GitHub authentication is required.",
11
+ "cause": "The configured GitHub token is unavailable.",
12
+ "fix": "Set the manifest-declared GitHub token environment variable and retry."
13
+ },
14
+ "gmail_grant_missing": {
15
+ "errorCode": "INTEGRATION_AUTH_REQUIRED",
16
+ "recoveryCode": "CONNECT_GMAIL",
17
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#gmail-grant",
18
+ "problem": "Gmail authorization is required.",
19
+ "cause": "No Gmail grant exists for this principal.",
20
+ "fix": "Use the package-qualified connect command for this runtime and principal, then retry."
21
+ },
22
+ "keychain_missing": {
23
+ "errorCode": "INTEGRATION_AUTH_ERROR",
24
+ "recoveryCode": "RESTORE_KEYCHAIN",
25
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#keychain-missing",
26
+ "problem": "The macOS Keychain is unavailable.",
27
+ "cause": "The Keychain command could not be found.",
28
+ "fix": "Restore `/usr/bin/security` on a supported macOS host and retry."
29
+ },
30
+ "keychain_locked": {
31
+ "errorCode": "INTEGRATION_AUTH_ERROR",
32
+ "recoveryCode": "UNLOCK_KEYCHAIN",
33
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#keychain-locked",
34
+ "problem": "The macOS Keychain is locked.",
35
+ "cause": "The stored integration grant cannot be read while Keychain is locked.",
36
+ "fix": "Unlock the login Keychain and retry."
37
+ },
38
+ "keychain_corrupt": {
39
+ "errorCode": "INTEGRATION_AUTH_ERROR",
40
+ "recoveryCode": "RESET_GMAIL_GRANT",
41
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#keychain-corrupt",
42
+ "problem": "The stored Gmail grant is invalid.",
43
+ "cause": "The Keychain entry is corrupt or incomplete.",
44
+ "fix": "Disconnect Gmail locally, then reconnect with the same principal."
45
+ },
46
+ "keychain_unsupported": {
47
+ "errorCode": "INTEGRATION_AUTH_ERROR",
48
+ "recoveryCode": "USE_SUPPORTED_KEYCHAIN",
49
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#keychain-unsupported",
50
+ "problem": "Secure Gmail grant storage is unsupported.",
51
+ "cause": "This host cannot provide the required macOS Keychain boundary.",
52
+ "fix": "Use a supported macOS host; do not fall back to plaintext storage."
53
+ },
54
+ "gmail_scope_drift": {
55
+ "errorCode": "INTEGRATION_AUTH_REQUIRED",
56
+ "recoveryCode": "RECONNECT_GMAIL",
57
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#gmail-scope-drift",
58
+ "problem": "The Gmail grant no longer has the required scopes.",
59
+ "cause": "Stored and required OAuth scopes differ.",
60
+ "fix": "Use the package-qualified connect command for this runtime and principal, then consent again."
61
+ },
62
+ "policy_rejected": {
63
+ "errorCode": "INTEGRATION_POLICY_REJECTED",
64
+ "recoveryCode": "REVIEW_INTEGRATION_POLICY",
65
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#policy-rejected",
66
+ "problem": "The integration request was rejected before dispatch.",
67
+ "cause": "A fixed-origin, repository, recipient, or schema policy did not match.",
68
+ "fix": "Review the integration allowlist and request shape before retrying."
69
+ },
70
+ "api_rejected": {
71
+ "errorCode": "INTEGRATION_API_ERROR",
72
+ "recoveryCode": "REVIEW_PROVIDER_REJECTION",
73
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#api-rejected",
74
+ "problem": "The provider rejected the integration request.",
75
+ "cause": "The provider returned a confirmed non-retryable API rejection.",
76
+ "fix": "Review the request against the provider response guidance before retrying manually."
77
+ },
78
+ "transient_read_failed": {
79
+ "errorCode": "INTEGRATION_API_ERROR",
80
+ "recoveryCode": "RETRY_INTEGRATION_READ",
81
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#transient-read",
82
+ "problem": "The integration read did not complete.",
83
+ "cause": "The provider returned a transient failure before any external effect.",
84
+ "fix": "Retry the idempotent read with bounded backoff."
85
+ },
86
+ "rate_limited": {
87
+ "errorCode": "INTEGRATION_RATE_LIMITED",
88
+ "recoveryCode": "RETRY_AFTER_RATE_LIMIT",
89
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#rate-limited",
90
+ "problem": "The provider rate limit was reached.",
91
+ "cause": "The provider confirmed that this request was rate limited.",
92
+ "fix": "Reduce parallelism and retry only after the bounded provider delay."
93
+ },
94
+ "redirect_rejected": {
95
+ "errorCode": "INTEGRATION_REDIRECT_REJECTED",
96
+ "recoveryCode": "REJECT_PROVIDER_REDIRECT",
97
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#redirect-rejected",
98
+ "problem": "The provider returned a redirect that Kaji will not follow.",
99
+ "cause": "Fixed-origin integration requests reject every redirect.",
100
+ "fix": "Verify the provider endpoint; do not retry an ambiguous mutation blindly."
101
+ },
102
+ "response_limit_exceeded": {
103
+ "errorCode": "INTEGRATION_RESPONSE_LIMIT",
104
+ "recoveryCode": "REDUCE_INTEGRATION_RESPONSE",
105
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#response-limit",
106
+ "problem": "The integration response exceeded a safety bound.",
107
+ "cause": "Provider headers or body were malformed or too large.",
108
+ "fix": "Narrow the read request; reconcile a mutation before any retry."
109
+ },
110
+ "github_mutation_unknown": {
111
+ "errorCode": "TOOL_EXECUTION_FAILED",
112
+ "recoveryCode": "RECONCILE_GITHUB_MUTATION",
113
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#github-mutation-unknown",
114
+ "problem": "The GitHub mutation outcome is unknown.",
115
+ "cause": "The connection failed after dispatch without a confirmed provider result.",
116
+ "fix": "Reconcile the GitHub issue or comment marker before any manual retry."
117
+ },
118
+ "gmail_mutation_unknown": {
119
+ "errorCode": "TOOL_EXECUTION_FAILED",
120
+ "recoveryCode": "RECONCILE_GMAIL_MUTATION",
121
+ "docUrl": "https://kaji.dev/docs/integrations/recovery-v1#gmail-mutation-unknown",
122
+ "problem": "The Gmail mutation outcome is unknown.",
123
+ "cause": "The connection failed after dispatch without a confirmed provider result.",
124
+ "fix": "Reconcile the Gmail draft key or sent message before any manual retry."
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://kaji.dev/contracts/errors/provider-normalization.json",
4
+ "version": "1.0.0",
5
+ "cases": [
6
+ {
7
+ "name": "config",
8
+ "source": "config",
9
+ "status": null,
10
+ "expected": {
11
+ "type": "config",
12
+ "code": "PROVIDER_CONFIG_ERROR",
13
+ "service": "fixture",
14
+ "action": "configure",
15
+ "status": null,
16
+ "retryable": false
17
+ }
18
+ },
19
+ {
20
+ "name": "network",
21
+ "source": "network",
22
+ "status": null,
23
+ "expected": {
24
+ "type": "network",
25
+ "code": "PROVIDER_NETWORK_ERROR",
26
+ "service": "fixture",
27
+ "action": "stream",
28
+ "status": null,
29
+ "retryable": true
30
+ }
31
+ },
32
+ {
33
+ "name": "api-without-status",
34
+ "source": "api",
35
+ "status": null,
36
+ "expected": {
37
+ "type": "api",
38
+ "code": "PROVIDER_API_ERROR",
39
+ "service": "fixture",
40
+ "action": "request",
41
+ "status": null,
42
+ "retryable": false
43
+ }
44
+ },
45
+ {
46
+ "name": "api-400",
47
+ "source": "api",
48
+ "status": 400,
49
+ "expected": {
50
+ "type": "api",
51
+ "code": "PROVIDER_API_ERROR",
52
+ "service": "fixture",
53
+ "action": "request",
54
+ "status": 400,
55
+ "retryable": false
56
+ }
57
+ },
58
+ {
59
+ "name": "api-401-is-auth",
60
+ "source": "api",
61
+ "status": 401,
62
+ "expected": {
63
+ "type": "auth",
64
+ "code": "PROVIDER_AUTH_ERROR",
65
+ "service": "fixture",
66
+ "action": "request",
67
+ "status": 401,
68
+ "retryable": false
69
+ }
70
+ },
71
+ {
72
+ "name": "api-403-is-auth",
73
+ "source": "api",
74
+ "status": 403,
75
+ "expected": {
76
+ "type": "auth",
77
+ "code": "PROVIDER_AUTH_ERROR",
78
+ "service": "fixture",
79
+ "action": "request",
80
+ "status": 403,
81
+ "retryable": false
82
+ }
83
+ },
84
+ {
85
+ "name": "api-429-is-rate-limited",
86
+ "source": "api",
87
+ "status": 429,
88
+ "expected": {
89
+ "type": "rate_limit",
90
+ "code": "PROVIDER_RATE_LIMITED",
91
+ "service": "fixture",
92
+ "action": "request",
93
+ "status": 429,
94
+ "retryable": true
95
+ }
96
+ },
97
+ {
98
+ "name": "api-500-is-retryable",
99
+ "source": "api",
100
+ "status": 500,
101
+ "expected": {
102
+ "type": "api",
103
+ "code": "PROVIDER_API_ERROR",
104
+ "service": "fixture",
105
+ "action": "request",
106
+ "status": 500,
107
+ "retryable": true
108
+ }
109
+ }
110
+ ]
111
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "cases": [
4
+ { "name": "missing-event-id", "kind": "new", "event": { "type": "session.created", "version": "1.0", "timestamp": 0, "session_id": "s" }, "path": "/id" },
5
+ { "name": "missing-version", "kind": "new", "event": { "id": "e", "type": "session.created", "timestamp": 0, "session_id": "s" }, "path": "/version" },
6
+ { "name": "missing-timestamp", "kind": "new", "event": { "id": "e", "type": "session.created", "version": "1.0", "session_id": "s" }, "path": "/timestamp" },
7
+ { "name": "missing-session-id", "kind": "new", "event": { "id": "e", "type": "session.created", "version": "1.0", "timestamp": 0 }, "path": "/session_id" },
8
+ { "name": "missing-event-type", "kind": "new", "event": { "id": "e", "version": "1.0", "timestamp": 0, "session_id": "s" }, "path": "/type" },
9
+ { "name": "empty-event-id", "kind": "new", "event": { "id": "", "type": "session.created", "version": "1.0", "timestamp": 0, "session_id": "s" }, "path": "/id" },
10
+ { "name": "empty-session-id", "kind": "new", "event": { "id": "e", "type": "session.created", "version": "1.0", "timestamp": 0, "session_id": "" }, "path": "/session_id" },
11
+ { "name": "empty-present-turn-id", "kind": "new", "event": { "id": "e", "type": "agent.reasoning.started", "version": "1.0", "timestamp": 0, "session_id": "s", "turn_id": "" }, "path": "/turn_id" },
12
+ { "name": "unknown-event-type", "kind": "new", "event": { "id": "e", "type": "unknown", "version": "1.0", "timestamp": 0, "session_id": "s" }, "path": "/type" },
13
+ { "name": "extra-field", "kind": "new", "event": { "id": "e", "type": "session.created", "version": "1.0", "timestamp": 0, "session_id": "s", "extra": true }, "path": "/extra" },
14
+ { "name": "draft-has-sequence", "kind": "new", "event": { "id": "e", "type": "session.created", "version": "1.0", "timestamp": 0, "session_id": "s", "sequence": 1 }, "path": "/sequence" },
15
+ { "name": "stored-missing-sequence", "kind": "stored", "event": { "id": "e", "type": "session.created", "version": "1.0", "timestamp": 0, "session_id": "s" }, "path": "/sequence" },
16
+ { "name": "unsafe-integral-number", "kind": "new", "event": { "id": "e", "type": "session.created", "version": "1.0", "timestamp": 0, "session_id": "s", "metadata": { "n": 9007199254740992 } }, "path": "/metadata/n" },
17
+ { "name": "partial-integration-recovery", "kind": "new", "event": { "id": "e", "type": "tool.call.failed", "version": "1.0", "timestamp": 0, "session_id": "s", "turn_id": "t", "tool_name": "integration", "tool_call_id": "c", "error": "Tool execution failed", "reason_code": "policy_rejected" }, "path": "/reason_code" },
18
+ { "name": "mismatched-integration-recovery", "kind": "new", "event": { "id": "e", "type": "tool.call.failed", "version": "1.0", "timestamp": 0, "session_id": "s", "turn_id": "t", "tool_name": "integration", "tool_call_id": "c", "error": "Tool execution failed", "reason_code": "policy_rejected", "recovery_code": "CONNECT_GMAIL", "doc_url": "https://kaji.dev/docs/integrations/recovery-v1#policy-rejected" }, "path": "/reason_code" }
19
+ ]
20
+ }