@kilocode/schema 0.0.0-stage → 0.0.0-v2-9

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 (210) hide show
  1. package/dist/agent.d.ts +179 -0
  2. package/dist/agent.js +45 -0
  3. package/dist/command.d.ts +76 -0
  4. package/dist/command.js +13 -0
  5. package/dist/config/agent.d.ts +42 -0
  6. package/dist/config/agent.js +21 -0
  7. package/dist/config/command.d.ts +28 -0
  8. package/dist/config/command.js +13 -0
  9. package/dist/config/compaction.d.ts +14 -0
  10. package/dist/config/compaction.js +13 -0
  11. package/dist/config/experimental.d.ts +20 -0
  12. package/dist/config/experimental.js +27 -0
  13. package/dist/config/formatter.d.ts +11 -0
  14. package/dist/config/formatter.js +11 -0
  15. package/dist/config/lsp.d.ts +20 -0
  16. package/dist/config/lsp.js +16 -0
  17. package/dist/config/mcp.d.ts +20 -0
  18. package/dist/config/mcp.js +15 -0
  19. package/dist/config/media.d.ts +15 -0
  20. package/dist/config/media.js +14 -0
  21. package/dist/config/model.d.ts +18 -0
  22. package/dist/config/model.js +28 -0
  23. package/dist/config/plugin.d.ts +11 -0
  24. package/dist/config/plugin.js +10 -0
  25. package/dist/config/policy.d.ts +10 -0
  26. package/dist/config/policy.js +8 -0
  27. package/dist/config/provider.d.ts +392 -0
  28. package/dist/config/provider.js +109 -0
  29. package/dist/config/reference.d.ts +21 -0
  30. package/dist/config/reference.js +18 -0
  31. package/dist/config/shell.d.ts +9 -0
  32. package/dist/config/shell.js +7 -0
  33. package/dist/config/tool-output.d.ts +8 -0
  34. package/dist/config/tool-output.js +8 -0
  35. package/dist/config/warming.d.ts +10 -0
  36. package/dist/config/warming.js +16 -0
  37. package/dist/config/watcher.d.ts +7 -0
  38. package/dist/config/watcher.js +7 -0
  39. package/dist/config/websearch.d.ts +9 -0
  40. package/dist/config/websearch.js +13 -0
  41. package/dist/config/worktree.d.ts +7 -0
  42. package/dist/config/worktree.js +7 -0
  43. package/dist/config.d.ts +182 -0
  44. package/dist/config.js +135 -0
  45. package/dist/connection.d.ts +79 -0
  46. package/dist/connection.js +25 -0
  47. package/dist/credential-legacy.d.ts +54 -0
  48. package/dist/credential-legacy.js +19 -0
  49. package/dist/credential.d.ts +255 -0
  50. package/dist/credential.js +56 -0
  51. package/dist/durable-event-manifest.d.ts +3 -0
  52. package/dist/durable-event-manifest.js +5 -0
  53. package/dist/event-log.d.ts +14 -0
  54. package/dist/event-log.js +17 -0
  55. package/dist/event-manifest.d.ts +12865 -0
  56. package/dist/event-manifest.js +48 -0
  57. package/dist/event.d.ts +142 -0
  58. package/dist/event.js +110 -0
  59. package/dist/file-diff.d.ts +21 -0
  60. package/dist/file-diff.js +18 -0
  61. package/dist/filesystem-v1.d.ts +1 -0
  62. package/dist/filesystem-v1.js +1 -0
  63. package/dist/filesystem.d.ts +123 -0
  64. package/dist/filesystem.js +38 -0
  65. package/dist/form.d.ts +1438 -0
  66. package/dist/form.js +128 -0
  67. package/dist/identifier.d.ts +4 -0
  68. package/dist/identifier.js +25 -0
  69. package/dist/index.d.ts +41 -0
  70. package/dist/index.js +41 -0
  71. package/dist/installation-event.d.ts +149 -0
  72. package/dist/installation-event.js +16 -0
  73. package/dist/instruction-entry.d.ts +29 -0
  74. package/dist/instruction-entry.js +26 -0
  75. package/dist/instruction.d.ts +13 -0
  76. package/dist/instruction.js +8 -0
  77. package/dist/integration-id.d.ts +5 -0
  78. package/dist/integration-id.js +3 -0
  79. package/dist/integration.d.ts +2410 -0
  80. package/dist/integration.js +91 -0
  81. package/dist/kilocode/gateway.d.ts +975 -0
  82. package/dist/kilocode/gateway.js +328 -0
  83. package/dist/kilocode/handshake.d.ts +36 -0
  84. package/dist/kilocode/handshake.js +29 -0
  85. package/dist/kilocode/marketplace.d.ts +593 -0
  86. package/dist/kilocode/marketplace.js +122 -0
  87. package/dist/kilocode/provider-usage.d.ts +371 -0
  88. package/dist/kilocode/provider-usage.js +60 -0
  89. package/dist/legacy-event.d.ts +1 -0
  90. package/dist/legacy-event.js +1 -0
  91. package/dist/llm.d.ts +4 -0
  92. package/dist/llm.js +3 -0
  93. package/dist/location-event.d.ts +68 -0
  94. package/dist/location-event.js +5 -0
  95. package/dist/location.d.ts +56 -0
  96. package/dist/location.js +28 -0
  97. package/dist/lsp-event.d.ts +67 -0
  98. package/dist/lsp-event.js +4 -0
  99. package/dist/mcp-event.d.ts +222 -0
  100. package/dist/mcp-event.js +24 -0
  101. package/dist/mcp.d.ts +145 -0
  102. package/dist/mcp.js +120 -0
  103. package/dist/model-compatibility.d.ts +38 -0
  104. package/dist/model-compatibility.js +28 -0
  105. package/dist/model.d.ts +406 -0
  106. package/dist/model.js +115 -0
  107. package/dist/models-dev.d.ts +69 -0
  108. package/dist/models-dev.js +7 -0
  109. package/dist/money.d.ts +10 -0
  110. package/dist/money.js +5 -0
  111. package/dist/permission-saved.d.ts +22 -0
  112. package/dist/permission-saved.js +16 -0
  113. package/dist/permission-v1.d.ts +1 -0
  114. package/dist/permission-v1.js +1 -0
  115. package/dist/permission.d.ts +302 -0
  116. package/dist/permission.js +46 -0
  117. package/dist/persistent-pty.d.ts +539 -0
  118. package/dist/persistent-pty.js +55 -0
  119. package/dist/plugin.d.ts +132 -0
  120. package/dist/plugin.js +37 -0
  121. package/dist/project-id.d.ts +5 -0
  122. package/dist/project-id.js +3 -0
  123. package/dist/project.d.ts +270 -0
  124. package/dist/project.js +47 -0
  125. package/dist/prompt-input.d.ts +110 -0
  126. package/dist/prompt-input.js +21 -0
  127. package/dist/prompt.d.ts +297 -0
  128. package/dist/prompt.js +61 -0
  129. package/dist/provider.d.ts +275 -0
  130. package/dist/provider.js +66 -0
  131. package/dist/pty-ticket.d.ts +8 -0
  132. package/dist/pty-ticket.js +7 -0
  133. package/dist/pty.d.ts +462 -0
  134. package/dist/pty.js +43 -0
  135. package/dist/question.d.ts +15 -0
  136. package/dist/question.js +15 -0
  137. package/dist/reference.d.ts +120 -0
  138. package/dist/reference.js +30 -0
  139. package/dist/rpc.d.ts +111 -0
  140. package/dist/rpc.js +9 -0
  141. package/dist/schema.d.ts +11 -0
  142. package/dist/schema.js +17 -0
  143. package/dist/server-event.d.ts +132 -0
  144. package/dist/server-event.js +5 -0
  145. package/dist/session-error.d.ts +16 -0
  146. package/dist/session-error.js +11 -0
  147. package/dist/session-event.d.ts +21417 -0
  148. package/dist/session-event.js +565 -0
  149. package/dist/session-fork.d.ts +16 -0
  150. package/dist/session-fork.js +7 -0
  151. package/dist/session-id.d.ts +5 -0
  152. package/dist/session-id.js +6 -0
  153. package/dist/session-inbox.d.ts +756 -0
  154. package/dist/session-inbox.js +47 -0
  155. package/dist/session-legacy.d.ts +7 -0
  156. package/dist/session-legacy.js +118 -0
  157. package/dist/session-message.d.ts +2049 -0
  158. package/dist/session-message.js +234 -0
  159. package/dist/session-metadata.d.ts +8 -0
  160. package/dist/session-metadata.js +9 -0
  161. package/dist/session-revert.d.ts +896 -0
  162. package/dist/session-revert.js +63 -0
  163. package/dist/session-stats.d.ts +186 -0
  164. package/dist/session-stats.js +53 -0
  165. package/dist/session-status-event.d.ts +291 -0
  166. package/dist/session-status-event.js +45 -0
  167. package/dist/session-transfer.d.ts +910 -0
  168. package/dist/session-transfer.js +8 -0
  169. package/dist/session-v1.d.ts +1 -0
  170. package/dist/session-v1.js +1 -0
  171. package/dist/session.d.ts +320 -0
  172. package/dist/session.js +116 -0
  173. package/dist/shell.d.ts +386 -0
  174. package/dist/shell.js +61 -0
  175. package/dist/skill.d.ts +130 -0
  176. package/dist/skill.js +47 -0
  177. package/dist/snapshot.d.ts +4 -0
  178. package/dist/snapshot.js +3 -0
  179. package/dist/token-usage.d.ts +14 -0
  180. package/dist/token-usage.js +14 -0
  181. package/dist/tool.d.ts +78 -0
  182. package/dist/tool.js +22 -0
  183. package/dist/tui-event.d.ts +307 -0
  184. package/dist/tui-event.js +52 -0
  185. package/dist/v1/filesystem.d.ts +78 -0
  186. package/dist/v1/filesystem.js +8 -0
  187. package/dist/v1/legacy-event.d.ts +104 -0
  188. package/dist/v1/legacy-event.js +15 -0
  189. package/dist/v1/permission.d.ts +306 -0
  190. package/dist/v1/permission.js +41 -0
  191. package/dist/v1/session.d.ts +6977 -0
  192. package/dist/v1/session.js +531 -0
  193. package/dist/vcs-event.d.ts +76 -0
  194. package/dist/vcs-event.js +11 -0
  195. package/dist/vcs.d.ts +36 -0
  196. package/dist/vcs.js +24 -0
  197. package/dist/websearch.d.ts +108 -0
  198. package/dist/websearch.js +33 -0
  199. package/dist/workspace-event.d.ts +247 -0
  200. package/dist/workspace-event.js +25 -0
  201. package/dist/workspace-id.d.ts +6 -0
  202. package/dist/workspace-id.js +14 -0
  203. package/dist/workspace.d.ts +15 -0
  204. package/dist/workspace.js +14 -0
  205. package/dist/worktree-event.d.ts +153 -0
  206. package/dist/worktree-event.js +18 -0
  207. package/dist/worktree.d.ts +282 -0
  208. package/dist/worktree.js +83 -0
  209. package/package.json +42 -4
  210. package/README.md +0 -3
@@ -0,0 +1,79 @@
1
+ export * as Connection from "./connection.js";
2
+ import { Schema } from "effect";
3
+ /**
4
+ * Runtime problem an integration reported for a connection. `needs_auth` asks the user to sign in again:
5
+ * at `url` when set (the credential itself stays valid), otherwise by reconnecting the integration.
6
+ */
7
+ export interface Status extends Schema.Schema.Type<typeof Status> {
8
+ }
9
+ export declare const Status: Schema.Struct<{
10
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
11
+ readonly message: Schema.String;
12
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
13
+ }>;
14
+ export interface CredentialInfo extends Schema.Schema.Type<typeof CredentialInfo> {
15
+ }
16
+ export declare const CredentialInfo: Schema.Struct<{
17
+ readonly type: Schema.Literal<"credential">;
18
+ readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
19
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
20
+ };
21
+ readonly label: Schema.String;
22
+ /** Whether the connection stores a key, an OAuth grant, or an external credential-source reference. */
23
+ readonly method: Schema.Literals<readonly ["key", "oauth", "external"]>;
24
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
25
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
26
+ readonly message: Schema.String;
27
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
28
+ }>>>, Schema.optionalKey<Schema.Struct<{
29
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
30
+ readonly message: Schema.String;
31
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
32
+ }>>, never, never>;
33
+ }>;
34
+ export interface EnvInfo extends Schema.Schema.Type<typeof EnvInfo> {
35
+ }
36
+ export declare const EnvInfo: Schema.Struct<{
37
+ readonly type: Schema.Literal<"env">;
38
+ readonly name: Schema.String;
39
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
40
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
41
+ readonly message: Schema.String;
42
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
43
+ }>>>, Schema.optionalKey<Schema.Struct<{
44
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
45
+ readonly message: Schema.String;
46
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
47
+ }>>, never, never>;
48
+ }>;
49
+ export declare const Info: Schema.Union<readonly [Schema.Struct<{
50
+ readonly type: Schema.Literal<"credential">;
51
+ readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
52
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
53
+ };
54
+ readonly label: Schema.String;
55
+ /** Whether the connection stores a key, an OAuth grant, or an external credential-source reference. */
56
+ readonly method: Schema.Literals<readonly ["key", "oauth", "external"]>;
57
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
58
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
59
+ readonly message: Schema.String;
60
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
61
+ }>>>, Schema.optionalKey<Schema.Struct<{
62
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
63
+ readonly message: Schema.String;
64
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
65
+ }>>, never, never>;
66
+ }>, Schema.Struct<{
67
+ readonly type: Schema.Literal<"env">;
68
+ readonly name: Schema.String;
69
+ readonly status: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
70
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
71
+ readonly message: Schema.String;
72
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
73
+ }>>>, Schema.optionalKey<Schema.Struct<{
74
+ readonly status: Schema.Literals<readonly ["needs_auth"]>;
75
+ readonly message: Schema.String;
76
+ readonly url: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
77
+ }>>, never, never>;
78
+ }>]>;
79
+ export type Info = typeof Info.Type;
@@ -0,0 +1,25 @@
1
+ export * as Connection from "./connection.js";
2
+ import { Schema } from "effect";
3
+ import { Credential } from "./credential.js";
4
+ import { optional } from "./schema.js";
5
+ export const Status = Schema.Struct({
6
+ status: Schema.Literals(["needs_auth"]),
7
+ message: Schema.String,
8
+ url: optional(Schema.String),
9
+ }).annotate({ identifier: "Connection.Status" });
10
+ export const CredentialInfo = Schema.Struct({
11
+ type: Schema.Literal("credential"),
12
+ id: Credential.ID,
13
+ label: Schema.String,
14
+ /** Whether the connection stores a key, an OAuth grant, or an external credential-source reference. */
15
+ method: Schema.Literals(["key", "oauth", "external"]),
16
+ status: optional(Status),
17
+ }).annotate({ identifier: "Connection.CredentialInfo" });
18
+ export const EnvInfo = Schema.Struct({
19
+ type: Schema.Literal("env"),
20
+ name: Schema.String,
21
+ status: optional(Status),
22
+ }).annotate({ identifier: "Connection.EnvInfo" });
23
+ export const Info = Schema.Union([CredentialInfo, EnvInfo])
24
+ .pipe(Schema.toTaggedUnion("type"))
25
+ .annotate({ identifier: "Connection.Info" });
@@ -0,0 +1,54 @@
1
+ export * as CredentialLegacy from "./credential-legacy.js";
2
+ import { Schema } from "effect";
3
+ /** Decodes a stored or exported credential value of either shape into the current `Credential.Value`. */
4
+ export declare const Value: Schema.Union<readonly [Schema.Struct<{
5
+ readonly type: Schema.Literal<"oauth">;
6
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
7
+ readonly refresh: Schema.String;
8
+ readonly access: Schema.String;
9
+ readonly expires: Schema.Int;
10
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
11
+ }>, Schema.decodeTo<Schema.Struct<{
12
+ readonly type: Schema.Literal<"key">;
13
+ readonly key: Schema.String;
14
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
15
+ }>, Schema.Struct<{
16
+ readonly type: Schema.Literal<"key">;
17
+ readonly key: Schema.String;
18
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
19
+ readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
20
+ }>, never, never>, Schema.Struct<{
21
+ readonly type: Schema.Literal<"external">;
22
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
23
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
24
+ }>]>;
25
+ /** Decodes an `auth export` entry of either shape into the current `Credential.Entry`. */
26
+ export declare const Entry: Schema.Struct<{
27
+ readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
28
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
29
+ };
30
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
31
+ readonly label: Schema.String;
32
+ readonly active: Schema.Boolean;
33
+ readonly value: Schema.Union<readonly [Schema.Struct<{
34
+ readonly type: Schema.Literal<"oauth">;
35
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
36
+ readonly refresh: Schema.String;
37
+ readonly access: Schema.String;
38
+ readonly expires: Schema.Int;
39
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
40
+ }>, Schema.decodeTo<Schema.Struct<{
41
+ readonly type: Schema.Literal<"key">;
42
+ readonly key: Schema.String;
43
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
44
+ }>, Schema.Struct<{
45
+ readonly type: Schema.Literal<"key">;
46
+ readonly key: Schema.String;
47
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
48
+ readonly configuration: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean, Schema.$Array<Schema.String>]>>>, never, never>;
49
+ }>, never, never>, Schema.Struct<{
50
+ readonly type: Schema.Literal<"external">;
51
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
52
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
53
+ }>]>;
54
+ }>;
@@ -0,0 +1,19 @@
1
+ export * as CredentialLegacy from "./credential-legacy.js";
2
+ import { Schema, SchemaTransformation } from "effect";
3
+ import { Credential } from "./credential.js";
4
+ import { Form } from "./form.js";
5
+ import { optional } from "./schema.js";
6
+ /**
7
+ * Storage and import compatibility for credentials written before v2.1 (not V1 contracts). Key credentials then kept
8
+ * their setup-form answers in `configuration`; they now live in `metadata`. Only decoders for stored rows and
9
+ * `auth export` files use these schemas, so the public credential contract never sees the old field.
10
+ */
11
+ const Key = Schema.Struct({ ...Credential.Key.fields, configuration: optional(Form.Answer) }).pipe(Schema.decodeTo(Credential.Key, SchemaTransformation.transform({
12
+ // Form answers overrode metadata when both reached provider settings, so they keep precedence.
13
+ decode: ({ configuration, ...key }) => configuration === undefined ? key : { ...key, metadata: { ...key.metadata, ...configuration } },
14
+ encode: (key) => key,
15
+ })));
16
+ /** Decodes a stored or exported credential value of either shape into the current `Credential.Value`. */
17
+ export const Value = Schema.Union([Credential.OAuth, Key, Credential.External]);
18
+ /** Decodes an `auth export` entry of either shape into the current `Credential.Entry`. */
19
+ export const Entry = Schema.Struct({ ...Credential.Entry.fields, value: Value });
@@ -0,0 +1,255 @@
1
+ export * as Credential from "./credential.js";
2
+ import { Schema } from "effect";
3
+ export declare const ID: Schema.brand<Schema.String, "Credential.ID"> & {
4
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
5
+ };
6
+ export type ID = typeof ID.Type;
7
+ export declare const Event: {
8
+ Updated: Schema.Struct<{
9
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
10
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
11
+ };
12
+ readonly created: Schema.Finite;
13
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
14
+ readonly type: Schema.Literal<"credential.updated">;
15
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
16
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
17
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
18
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
19
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
20
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
21
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
22
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
23
+ }>, never, never>;
24
+ }>>>, Schema.optionalKey<Schema.Struct<{
25
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
26
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
27
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
28
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
29
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
30
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
31
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
32
+ }>, never, never>;
33
+ }>>, never, never>;
34
+ readonly data: Schema.Struct<{}>;
35
+ }> & {
36
+ type: "credential.updated";
37
+ durability: "ephemeral";
38
+ durable: undefined;
39
+ data: Schema.Struct<{}>;
40
+ };
41
+ Switched: Schema.Struct<{
42
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
43
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
44
+ };
45
+ readonly created: Schema.Finite;
46
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
47
+ readonly type: Schema.Literal<"credential.switched">;
48
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
49
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
50
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
51
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
52
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
53
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
54
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
55
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
56
+ }>, never, never>;
57
+ }>>>, Schema.optionalKey<Schema.Struct<{
58
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
59
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
60
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
61
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
62
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
63
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
64
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
65
+ }>, never, never>;
66
+ }>>, never, never>;
67
+ readonly data: Schema.Struct<{
68
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
69
+ readonly credentialID: Schema.NullOr<Schema.brand<Schema.String, "Credential.ID"> & {
70
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
71
+ }>;
72
+ }>;
73
+ }> & {
74
+ type: "credential.switched";
75
+ durability: "ephemeral";
76
+ durable: undefined;
77
+ data: Schema.Struct<{
78
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
79
+ readonly credentialID: Schema.NullOr<Schema.brand<Schema.String, "Credential.ID"> & {
80
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
81
+ }>;
82
+ }>;
83
+ };
84
+ Definitions: readonly [Schema.Struct<{
85
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
86
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
87
+ };
88
+ readonly created: Schema.Finite;
89
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
90
+ readonly type: Schema.Literal<"credential.updated">;
91
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
92
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
93
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
94
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
95
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
96
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
97
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
98
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
99
+ }>, never, never>;
100
+ }>>>, Schema.optionalKey<Schema.Struct<{
101
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
102
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
103
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
104
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
105
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
106
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
107
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
108
+ }>, never, never>;
109
+ }>>, never, never>;
110
+ readonly data: Schema.Struct<{}>;
111
+ }> & {
112
+ type: "credential.updated";
113
+ durability: "ephemeral";
114
+ durable: undefined;
115
+ data: Schema.Struct<{}>;
116
+ }, Schema.Struct<{
117
+ readonly id: Schema.brand<Schema.String, "Event.ID"> & {
118
+ create: () => string & import("effect/Brand").Brand<"Event.ID">;
119
+ };
120
+ readonly created: Schema.Finite;
121
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
122
+ readonly type: Schema.Literal<"credential.switched">;
123
+ readonly location: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
124
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
125
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
126
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
127
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
128
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
129
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
130
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
131
+ }>, never, never>;
132
+ }>>>, Schema.optionalKey<Schema.Struct<{
133
+ readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
134
+ readonly workspaceID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Workspace.ID"> & {
135
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
136
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
137
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Workspace.ID"> & {
138
+ ascending: (id?: string) => string & import("effect/Brand").Brand<"Workspace.ID">;
139
+ create: () => string & import("effect/Brand").Brand<"Workspace.ID">;
140
+ }>, never, never>;
141
+ }>>, never, never>;
142
+ readonly data: Schema.Struct<{
143
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
144
+ readonly credentialID: Schema.NullOr<Schema.brand<Schema.String, "Credential.ID"> & {
145
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
146
+ }>;
147
+ }>;
148
+ }> & {
149
+ type: "credential.switched";
150
+ durability: "ephemeral";
151
+ durable: undefined;
152
+ data: Schema.Struct<{
153
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
154
+ readonly credentialID: Schema.NullOr<Schema.brand<Schema.String, "Credential.ID"> & {
155
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
156
+ }>;
157
+ }>;
158
+ }];
159
+ };
160
+ export interface OAuth extends Schema.Schema.Type<typeof OAuth> {
161
+ }
162
+ export declare const OAuth: Schema.Struct<{
163
+ readonly type: Schema.Literal<"oauth">;
164
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
165
+ readonly refresh: Schema.String;
166
+ readonly access: Schema.String;
167
+ readonly expires: Schema.Int;
168
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
169
+ }>;
170
+ export interface Key extends Schema.Schema.Type<typeof Key> {
171
+ }
172
+ export declare const Key: Schema.Struct<{
173
+ readonly type: Schema.Literal<"key">;
174
+ readonly key: Schema.String;
175
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
176
+ }>;
177
+ /** References a credential source whose secrets and renewal are managed outside the credential store. */
178
+ export interface External extends Schema.Schema.Type<typeof External> {
179
+ }
180
+ export declare const External: Schema.Struct<{
181
+ readonly type: Schema.Literal<"external">;
182
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
183
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
184
+ }>;
185
+ export declare const Value: Schema.Union<readonly [Schema.Struct<{
186
+ readonly type: Schema.Literal<"oauth">;
187
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
188
+ readonly refresh: Schema.String;
189
+ readonly access: Schema.String;
190
+ readonly expires: Schema.Int;
191
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
192
+ }>, Schema.Struct<{
193
+ readonly type: Schema.Literal<"key">;
194
+ readonly key: Schema.String;
195
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
196
+ }>, Schema.Struct<{
197
+ readonly type: Schema.Literal<"external">;
198
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
199
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
200
+ }>]>;
201
+ export type Value = Schema.Schema.Type<typeof Value>;
202
+ export interface Entry extends Schema.Schema.Type<typeof Entry> {
203
+ }
204
+ export declare const Entry: Schema.Struct<{
205
+ readonly id: Schema.brand<Schema.String, "Credential.ID"> & {
206
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
207
+ };
208
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
209
+ readonly label: Schema.String;
210
+ readonly active: Schema.Boolean;
211
+ readonly value: Schema.Union<readonly [Schema.Struct<{
212
+ readonly type: Schema.Literal<"oauth">;
213
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
214
+ readonly refresh: Schema.String;
215
+ readonly access: Schema.String;
216
+ readonly expires: Schema.Int;
217
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
218
+ }>, Schema.Struct<{
219
+ readonly type: Schema.Literal<"key">;
220
+ readonly key: Schema.String;
221
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
222
+ }>, Schema.Struct<{
223
+ readonly type: Schema.Literal<"external">;
224
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
225
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
226
+ }>]>;
227
+ }>;
228
+ export interface CreateInput extends Schema.Schema.Type<typeof CreateInput> {
229
+ }
230
+ export declare const CreateInput: Schema.Struct<{
231
+ readonly id: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Credential.ID"> & {
232
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
233
+ }>>, Schema.optionalKey<Schema.brand<Schema.String, "Credential.ID"> & {
234
+ create: () => string & import("effect/Brand").Brand<"Credential.ID">;
235
+ }>, never, never>;
236
+ readonly integrationID: Schema.brand<Schema.String, "Integration.ID">;
237
+ readonly label: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
238
+ readonly value: Schema.Union<readonly [Schema.Struct<{
239
+ readonly type: Schema.Literal<"oauth">;
240
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
241
+ readonly refresh: Schema.String;
242
+ readonly access: Schema.String;
243
+ readonly expires: Schema.Int;
244
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
245
+ }>, Schema.Struct<{
246
+ readonly type: Schema.Literal<"key">;
247
+ readonly key: Schema.String;
248
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
249
+ }>, Schema.Struct<{
250
+ readonly type: Schema.Literal<"external">;
251
+ readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
252
+ readonly metadata: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Unknown>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Unknown>>, never, never>;
253
+ }>]>;
254
+ readonly activate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
255
+ }>;
@@ -0,0 +1,56 @@
1
+ export * as Credential from "./credential.js";
2
+ import { Schema } from "effect";
3
+ import { optional } from "./schema.js";
4
+ import { ephemeral, inventory } from "./event.js";
5
+ import { IntegrationID, IntegrationMethodID } from "./integration-id.js";
6
+ import { ascending } from "./identifier.js";
7
+ import { NonNegativeInt, statics } from "./schema.js";
8
+ export const ID = Schema.String.pipe(Schema.brand("Credential.ID"), Schema.annotate({ identifier: "Credential.ID" }), statics((schema) => ({ create: () => schema.make("cred_" + ascending()) })));
9
+ const Updated = ephemeral({
10
+ type: "credential.updated",
11
+ schema: {},
12
+ });
13
+ const Switched = ephemeral({
14
+ type: "credential.switched",
15
+ schema: { integrationID: IntegrationID, credentialID: Schema.NullOr(ID) },
16
+ });
17
+ export const Event = {
18
+ Updated,
19
+ Switched,
20
+ Definitions: inventory(Updated, Switched),
21
+ };
22
+ export const OAuth = Schema.Struct({
23
+ type: Schema.Literal("oauth"),
24
+ methodID: IntegrationMethodID,
25
+ refresh: Schema.String,
26
+ access: Schema.String,
27
+ expires: NonNegativeInt,
28
+ metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
29
+ }).annotate({ identifier: "Credential.OAuth" });
30
+ export const Key = Schema.Struct({
31
+ type: Schema.Literal("key"),
32
+ key: Schema.String,
33
+ metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
34
+ }).annotate({ identifier: "Credential.Key" });
35
+ export const External = Schema.Struct({
36
+ type: Schema.Literal("external"),
37
+ methodID: IntegrationMethodID,
38
+ metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
39
+ }).annotate({ identifier: "Credential.External" });
40
+ export const Value = Schema.Union([OAuth, Key, External])
41
+ .pipe(Schema.toTaggedUnion("type"))
42
+ .annotate({ identifier: "Credential.Value" });
43
+ export const Entry = Schema.Struct({
44
+ id: ID,
45
+ integrationID: IntegrationID,
46
+ label: Schema.String,
47
+ active: Schema.Boolean,
48
+ value: Value,
49
+ }).annotate({ identifier: "Credential.Entry" });
50
+ export const CreateInput = Schema.Struct({
51
+ id: optional(ID),
52
+ integrationID: IntegrationID,
53
+ label: optional(Schema.String),
54
+ value: Value,
55
+ activate: optional(Schema.Boolean),
56
+ }).annotate({ identifier: "Credential.CreateInput" });
@@ -0,0 +1,3 @@
1
+ export * as DurableEventManifest from "./durable-event-manifest.js";
2
+ import { Event } from "./event.js";
3
+ export declare const Durable: ReadonlyMap<string, Event.DurableDefinition<string, import("effect/Schema").Codec<unknown, unknown, never, never>>>;
@@ -0,0 +1,5 @@
1
+ export * as DurableEventManifest from "./durable-event-manifest.js";
2
+ import { Event } from "./event.js";
3
+ import { Worktree } from "./worktree.js";
4
+ import { SessionEvent } from "./session-event.js";
5
+ export const Durable = Event.durableMap([...SessionEvent.DurableDefinitions, Worktree.Event.Resolved]);
@@ -0,0 +1,14 @@
1
+ export * as EventLog from "./event-log.js";
2
+ import { Schema } from "effect";
3
+ /**
4
+ * Replay-to-live boundary marker for a durable log read. The reader now holds
5
+ * every event committed at or below this watermark; `seq` is absent when the
6
+ * captured watermark is empty. Emitted once for the captured watermark.
7
+ */
8
+ export declare const Synced: Schema.Struct<{
9
+ readonly type: Schema.Literal<"log.synced">;
10
+ readonly aggregateID: Schema.String;
11
+ readonly seq: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Int, "Event.Seq">>>, Schema.optionalKey<Schema.brand<Schema.Int, "Event.Seq">>, never, never>;
12
+ }>;
13
+ export interface Synced extends Schema.Schema.Type<typeof Synced> {
14
+ }
@@ -0,0 +1,17 @@
1
+ export * as EventLog from "./event-log.js";
2
+ import { Schema } from "effect";
3
+ import { Event } from "./event.js";
4
+ import { optional } from "./schema.js";
5
+ /**
6
+ * Replay-to-live boundary marker for a durable log read. The reader now holds
7
+ * every event committed at or below this watermark; `seq` is absent when the
8
+ * captured watermark is empty. Emitted once for the captured watermark.
9
+ */
10
+ export const Synced = Schema.Struct({
11
+ type: Schema.Literal("log.synced"),
12
+ aggregateID: Schema.String,
13
+ seq: optional(Event.Seq),
14
+ }).annotate({
15
+ identifier: "EventLog.Synced",
16
+ description: "Marker emitted once when a log read reaches its captured watermark. The reader holds every event committed at or below seq.",
17
+ });