@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.
- package/dist/agent.d.ts +179 -0
- package/dist/agent.js +45 -0
- package/dist/command.d.ts +76 -0
- package/dist/command.js +13 -0
- package/dist/config/agent.d.ts +42 -0
- package/dist/config/agent.js +21 -0
- package/dist/config/command.d.ts +28 -0
- package/dist/config/command.js +13 -0
- package/dist/config/compaction.d.ts +14 -0
- package/dist/config/compaction.js +13 -0
- package/dist/config/experimental.d.ts +20 -0
- package/dist/config/experimental.js +27 -0
- package/dist/config/formatter.d.ts +11 -0
- package/dist/config/formatter.js +11 -0
- package/dist/config/lsp.d.ts +20 -0
- package/dist/config/lsp.js +16 -0
- package/dist/config/mcp.d.ts +20 -0
- package/dist/config/mcp.js +15 -0
- package/dist/config/media.d.ts +15 -0
- package/dist/config/media.js +14 -0
- package/dist/config/model.d.ts +18 -0
- package/dist/config/model.js +28 -0
- package/dist/config/plugin.d.ts +11 -0
- package/dist/config/plugin.js +10 -0
- package/dist/config/policy.d.ts +10 -0
- package/dist/config/policy.js +8 -0
- package/dist/config/provider.d.ts +392 -0
- package/dist/config/provider.js +109 -0
- package/dist/config/reference.d.ts +21 -0
- package/dist/config/reference.js +18 -0
- package/dist/config/shell.d.ts +9 -0
- package/dist/config/shell.js +7 -0
- package/dist/config/tool-output.d.ts +8 -0
- package/dist/config/tool-output.js +8 -0
- package/dist/config/warming.d.ts +10 -0
- package/dist/config/warming.js +16 -0
- package/dist/config/watcher.d.ts +7 -0
- package/dist/config/watcher.js +7 -0
- package/dist/config/websearch.d.ts +9 -0
- package/dist/config/websearch.js +13 -0
- package/dist/config/worktree.d.ts +7 -0
- package/dist/config/worktree.js +7 -0
- package/dist/config.d.ts +182 -0
- package/dist/config.js +135 -0
- package/dist/connection.d.ts +79 -0
- package/dist/connection.js +25 -0
- package/dist/credential-legacy.d.ts +54 -0
- package/dist/credential-legacy.js +19 -0
- package/dist/credential.d.ts +255 -0
- package/dist/credential.js +56 -0
- package/dist/durable-event-manifest.d.ts +3 -0
- package/dist/durable-event-manifest.js +5 -0
- package/dist/event-log.d.ts +14 -0
- package/dist/event-log.js +17 -0
- package/dist/event-manifest.d.ts +12865 -0
- package/dist/event-manifest.js +48 -0
- package/dist/event.d.ts +142 -0
- package/dist/event.js +110 -0
- package/dist/file-diff.d.ts +21 -0
- package/dist/file-diff.js +18 -0
- package/dist/filesystem-v1.d.ts +1 -0
- package/dist/filesystem-v1.js +1 -0
- package/dist/filesystem.d.ts +123 -0
- package/dist/filesystem.js +38 -0
- package/dist/form.d.ts +1438 -0
- package/dist/form.js +128 -0
- package/dist/identifier.d.ts +4 -0
- package/dist/identifier.js +25 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +41 -0
- package/dist/installation-event.d.ts +149 -0
- package/dist/installation-event.js +16 -0
- package/dist/instruction-entry.d.ts +29 -0
- package/dist/instruction-entry.js +26 -0
- package/dist/instruction.d.ts +13 -0
- package/dist/instruction.js +8 -0
- package/dist/integration-id.d.ts +5 -0
- package/dist/integration-id.js +3 -0
- package/dist/integration.d.ts +2410 -0
- package/dist/integration.js +91 -0
- package/dist/kilocode/gateway.d.ts +975 -0
- package/dist/kilocode/gateway.js +328 -0
- package/dist/kilocode/handshake.d.ts +36 -0
- package/dist/kilocode/handshake.js +29 -0
- package/dist/kilocode/marketplace.d.ts +593 -0
- package/dist/kilocode/marketplace.js +122 -0
- package/dist/kilocode/provider-usage.d.ts +371 -0
- package/dist/kilocode/provider-usage.js +60 -0
- package/dist/legacy-event.d.ts +1 -0
- package/dist/legacy-event.js +1 -0
- package/dist/llm.d.ts +4 -0
- package/dist/llm.js +3 -0
- package/dist/location-event.d.ts +68 -0
- package/dist/location-event.js +5 -0
- package/dist/location.d.ts +56 -0
- package/dist/location.js +28 -0
- package/dist/lsp-event.d.ts +67 -0
- package/dist/lsp-event.js +4 -0
- package/dist/mcp-event.d.ts +222 -0
- package/dist/mcp-event.js +24 -0
- package/dist/mcp.d.ts +145 -0
- package/dist/mcp.js +120 -0
- package/dist/model-compatibility.d.ts +38 -0
- package/dist/model-compatibility.js +28 -0
- package/dist/model.d.ts +406 -0
- package/dist/model.js +115 -0
- package/dist/models-dev.d.ts +69 -0
- package/dist/models-dev.js +7 -0
- package/dist/money.d.ts +10 -0
- package/dist/money.js +5 -0
- package/dist/permission-saved.d.ts +22 -0
- package/dist/permission-saved.js +16 -0
- package/dist/permission-v1.d.ts +1 -0
- package/dist/permission-v1.js +1 -0
- package/dist/permission.d.ts +302 -0
- package/dist/permission.js +46 -0
- package/dist/persistent-pty.d.ts +539 -0
- package/dist/persistent-pty.js +55 -0
- package/dist/plugin.d.ts +132 -0
- package/dist/plugin.js +37 -0
- package/dist/project-id.d.ts +5 -0
- package/dist/project-id.js +3 -0
- package/dist/project.d.ts +270 -0
- package/dist/project.js +47 -0
- package/dist/prompt-input.d.ts +110 -0
- package/dist/prompt-input.js +21 -0
- package/dist/prompt.d.ts +297 -0
- package/dist/prompt.js +61 -0
- package/dist/provider.d.ts +275 -0
- package/dist/provider.js +66 -0
- package/dist/pty-ticket.d.ts +8 -0
- package/dist/pty-ticket.js +7 -0
- package/dist/pty.d.ts +462 -0
- package/dist/pty.js +43 -0
- package/dist/question.d.ts +15 -0
- package/dist/question.js +15 -0
- package/dist/reference.d.ts +120 -0
- package/dist/reference.js +30 -0
- package/dist/rpc.d.ts +111 -0
- package/dist/rpc.js +9 -0
- package/dist/schema.d.ts +11 -0
- package/dist/schema.js +17 -0
- package/dist/server-event.d.ts +132 -0
- package/dist/server-event.js +5 -0
- package/dist/session-error.d.ts +16 -0
- package/dist/session-error.js +11 -0
- package/dist/session-event.d.ts +21417 -0
- package/dist/session-event.js +565 -0
- package/dist/session-fork.d.ts +16 -0
- package/dist/session-fork.js +7 -0
- package/dist/session-id.d.ts +5 -0
- package/dist/session-id.js +6 -0
- package/dist/session-inbox.d.ts +756 -0
- package/dist/session-inbox.js +47 -0
- package/dist/session-legacy.d.ts +7 -0
- package/dist/session-legacy.js +118 -0
- package/dist/session-message.d.ts +2049 -0
- package/dist/session-message.js +234 -0
- package/dist/session-metadata.d.ts +8 -0
- package/dist/session-metadata.js +9 -0
- package/dist/session-revert.d.ts +896 -0
- package/dist/session-revert.js +63 -0
- package/dist/session-stats.d.ts +186 -0
- package/dist/session-stats.js +53 -0
- package/dist/session-status-event.d.ts +291 -0
- package/dist/session-status-event.js +45 -0
- package/dist/session-transfer.d.ts +910 -0
- package/dist/session-transfer.js +8 -0
- package/dist/session-v1.d.ts +1 -0
- package/dist/session-v1.js +1 -0
- package/dist/session.d.ts +320 -0
- package/dist/session.js +116 -0
- package/dist/shell.d.ts +386 -0
- package/dist/shell.js +61 -0
- package/dist/skill.d.ts +130 -0
- package/dist/skill.js +47 -0
- package/dist/snapshot.d.ts +4 -0
- package/dist/snapshot.js +3 -0
- package/dist/token-usage.d.ts +14 -0
- package/dist/token-usage.js +14 -0
- package/dist/tool.d.ts +78 -0
- package/dist/tool.js +22 -0
- package/dist/tui-event.d.ts +307 -0
- package/dist/tui-event.js +52 -0
- package/dist/v1/filesystem.d.ts +78 -0
- package/dist/v1/filesystem.js +8 -0
- package/dist/v1/legacy-event.d.ts +104 -0
- package/dist/v1/legacy-event.js +15 -0
- package/dist/v1/permission.d.ts +306 -0
- package/dist/v1/permission.js +41 -0
- package/dist/v1/session.d.ts +6977 -0
- package/dist/v1/session.js +531 -0
- package/dist/vcs-event.d.ts +76 -0
- package/dist/vcs-event.js +11 -0
- package/dist/vcs.d.ts +36 -0
- package/dist/vcs.js +24 -0
- package/dist/websearch.d.ts +108 -0
- package/dist/websearch.js +33 -0
- package/dist/workspace-event.d.ts +247 -0
- package/dist/workspace-event.js +25 -0
- package/dist/workspace-id.d.ts +6 -0
- package/dist/workspace-id.js +14 -0
- package/dist/workspace.d.ts +15 -0
- package/dist/workspace.js +14 -0
- package/dist/worktree-event.d.ts +153 -0
- package/dist/worktree-event.js +18 -0
- package/dist/worktree.d.ts +282 -0
- package/dist/worktree.js +83 -0
- package/package.json +42 -4
- package/README.md +0 -3
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
export * as KiloGatewayRpc from "./gateway.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Rpc } from "../rpc.js";
|
|
4
|
+
import { optional } from "../schema.js";
|
|
5
|
+
// The `kilocode.gateway` RPC contract: the reference Kilo RPC. The Gateway plugin in packages/kilo-plugin
|
|
6
|
+
// registers the handlers; clients (TUI, VS Code, JetBrains) import this contract from
|
|
7
|
+
// `@opencode/schema/kilocode/gateway`, never from Core or the plugin.
|
|
8
|
+
// Standard Schemas, so the promise client of the TUI accepts the contract too.
|
|
9
|
+
const portable = Schema.toStandardSchemaV1;
|
|
10
|
+
const Failure = { unauthorized: portable(Schema.Undefined), failed: portable(Schema.Undefined) };
|
|
11
|
+
const OrganizationID = Schema.NullOr(Schema.String);
|
|
12
|
+
export const Profile = Schema.Struct({
|
|
13
|
+
email: Schema.String,
|
|
14
|
+
name: Schema.optional(Schema.String),
|
|
15
|
+
organizations: Schema.Array(Schema.Struct({ id: Schema.String, name: Schema.String, role: Schema.optional(Schema.String) })),
|
|
16
|
+
hasPersonalAccount: Schema.Boolean,
|
|
17
|
+
/** The team that requests use now. `null` is the personal account. */
|
|
18
|
+
organizationID: OrganizationID,
|
|
19
|
+
});
|
|
20
|
+
export const AuthStatus = Schema.Struct({
|
|
21
|
+
authenticated: Schema.Boolean,
|
|
22
|
+
organizationID: OrganizationID,
|
|
23
|
+
server: Schema.String,
|
|
24
|
+
});
|
|
25
|
+
export const Balance = Schema.Struct({
|
|
26
|
+
balance: Schema.NullOr(Schema.Number),
|
|
27
|
+
isDepleted: Schema.optional(Schema.Boolean),
|
|
28
|
+
});
|
|
29
|
+
export const KiloPass = Schema.NullOr(Schema.Struct({
|
|
30
|
+
currentPeriodBaseCreditsUsd: Schema.Number,
|
|
31
|
+
currentPeriodUsageUsd: Schema.Number,
|
|
32
|
+
currentPeriodBonusCreditsUsd: Schema.Number,
|
|
33
|
+
nextBillingAt: Schema.NullOr(Schema.String),
|
|
34
|
+
}));
|
|
35
|
+
export const ByokEntry = Schema.Struct({
|
|
36
|
+
id: Schema.String,
|
|
37
|
+
provider_id: Schema.String,
|
|
38
|
+
management_source: Schema.Literals(["user", "coding_plan"]),
|
|
39
|
+
is_enabled: Schema.Boolean,
|
|
40
|
+
});
|
|
41
|
+
export const CodingPlanSubscription = Schema.Struct({
|
|
42
|
+
id: Schema.String,
|
|
43
|
+
planId: Schema.String,
|
|
44
|
+
planName: Schema.String,
|
|
45
|
+
providerName: Schema.String,
|
|
46
|
+
providerId: Schema.String,
|
|
47
|
+
canQueryUsage: Schema.Boolean,
|
|
48
|
+
hasInstalledByokKey: Schema.Boolean,
|
|
49
|
+
status: Schema.Literals(["active", "past_due", "canceled"]),
|
|
50
|
+
cancelAtPeriodEnd: Schema.Boolean,
|
|
51
|
+
});
|
|
52
|
+
export const CodingPlanUsage = Schema.Struct({
|
|
53
|
+
schemaVersion: Schema.Literal(1),
|
|
54
|
+
fetchedAt: Schema.String,
|
|
55
|
+
subscription: Schema.Struct({
|
|
56
|
+
id: Schema.String,
|
|
57
|
+
planName: Schema.String,
|
|
58
|
+
providerId: Schema.String,
|
|
59
|
+
providerName: Schema.String,
|
|
60
|
+
windows: Schema.Array(Schema.Struct({
|
|
61
|
+
id: Schema.String,
|
|
62
|
+
remainingPercent: Schema.Number,
|
|
63
|
+
resetsAt: Schema.String,
|
|
64
|
+
startsAt: Schema.optional(Schema.String),
|
|
65
|
+
period: Schema.Struct({
|
|
66
|
+
unit: Schema.Literals(["hour", "day", "week", "month"]),
|
|
67
|
+
value: Schema.Number,
|
|
68
|
+
}),
|
|
69
|
+
})),
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
export const OrganizationMode = Schema.Struct({
|
|
73
|
+
id: Schema.String,
|
|
74
|
+
organization_id: Schema.String,
|
|
75
|
+
name: Schema.String,
|
|
76
|
+
slug: Schema.String,
|
|
77
|
+
created_by: Schema.String,
|
|
78
|
+
created_at: Schema.String,
|
|
79
|
+
updated_at: Schema.String,
|
|
80
|
+
config: Schema.Struct({
|
|
81
|
+
roleDefinition: Schema.optional(Schema.String),
|
|
82
|
+
whenToUse: Schema.optional(Schema.String),
|
|
83
|
+
description: Schema.optional(Schema.String),
|
|
84
|
+
customInstructions: Schema.optional(Schema.String),
|
|
85
|
+
groups: Schema.optional(Schema.Array(Schema.Union([
|
|
86
|
+
Schema.String,
|
|
87
|
+
Schema.Tuple([
|
|
88
|
+
Schema.String,
|
|
89
|
+
Schema.Struct({
|
|
90
|
+
fileRegex: Schema.optional(Schema.String),
|
|
91
|
+
description: Schema.optional(Schema.String),
|
|
92
|
+
}),
|
|
93
|
+
]),
|
|
94
|
+
]))),
|
|
95
|
+
}),
|
|
96
|
+
});
|
|
97
|
+
export const Notification = Schema.Struct({
|
|
98
|
+
id: Schema.String,
|
|
99
|
+
title: Schema.String,
|
|
100
|
+
message: Schema.String,
|
|
101
|
+
action: Schema.optional(Schema.Struct({
|
|
102
|
+
actionText: Schema.String,
|
|
103
|
+
actionURL: Schema.String,
|
|
104
|
+
})),
|
|
105
|
+
showIn: Schema.optional(Schema.Array(Schema.String)),
|
|
106
|
+
suggestModelId: Schema.optional(Schema.String),
|
|
107
|
+
});
|
|
108
|
+
export const ImageModel = Schema.Struct({
|
|
109
|
+
id: Schema.String,
|
|
110
|
+
name: Schema.String,
|
|
111
|
+
description: Schema.optional(Schema.String),
|
|
112
|
+
});
|
|
113
|
+
export const TranscriptionModel = Schema.Struct({
|
|
114
|
+
id: Schema.String,
|
|
115
|
+
name: Schema.String,
|
|
116
|
+
});
|
|
117
|
+
// The wire shape of the `models.embeddings` answer. `@kilocode/gateway-core/embedding-catalog` decodes the same shape
|
|
118
|
+
// from the Kilo API; a logic package imports nothing from `@opencode/*` and Schema depends on no Kilo package, so
|
|
119
|
+
// each side keeps its definition and packages/kilo-plugin/test/gateway.test.ts checks that they stay equal.
|
|
120
|
+
export const EmbeddingCatalog = Schema.Struct({
|
|
121
|
+
defaultModel: Schema.String,
|
|
122
|
+
models: Schema.Array(Schema.Struct({
|
|
123
|
+
id: Schema.String,
|
|
124
|
+
name: Schema.String,
|
|
125
|
+
dimension: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
126
|
+
scoreThreshold: Schema.Finite,
|
|
127
|
+
note: Schema.optionalKey(Schema.String),
|
|
128
|
+
})),
|
|
129
|
+
aliases: Schema.Record(Schema.String, Schema.String),
|
|
130
|
+
});
|
|
131
|
+
export const FimTarget = Schema.Struct({
|
|
132
|
+
provider: Schema.Literals(["kilo", "inception", "mistral"]),
|
|
133
|
+
model: Schema.String,
|
|
134
|
+
url: Schema.optional(Schema.String),
|
|
135
|
+
});
|
|
136
|
+
export const EditTarget = Schema.Struct({
|
|
137
|
+
provider: Schema.Literals(["kilo", "inception"]),
|
|
138
|
+
model: Schema.String,
|
|
139
|
+
url: Schema.String,
|
|
140
|
+
});
|
|
141
|
+
export const ModelEntry = Schema.Struct({
|
|
142
|
+
id: Schema.String,
|
|
143
|
+
name: Schema.String,
|
|
144
|
+
recommended: Schema.optional(Schema.Boolean).annotate({
|
|
145
|
+
description: "The current Gateway scope's default model, not a catalog ranking.",
|
|
146
|
+
}),
|
|
147
|
+
isFree: Schema.Boolean,
|
|
148
|
+
recommendedIndex: Schema.optional(Schema.Number),
|
|
149
|
+
hasUserByokAvailable: Schema.optional(Schema.Boolean),
|
|
150
|
+
mayTrainOnYourPrompts: Schema.optional(Schema.Boolean),
|
|
151
|
+
autoRouting: Schema.optional(Schema.Struct({
|
|
152
|
+
models: Schema.Array(Schema.String),
|
|
153
|
+
})),
|
|
154
|
+
terminalBench: Schema.optional(Schema.Struct({
|
|
155
|
+
overallScore: Schema.Number,
|
|
156
|
+
avgAttemptCostUsd: Schema.Number,
|
|
157
|
+
})),
|
|
158
|
+
description: Schema.optional(Schema.String),
|
|
159
|
+
reasoning: Schema.optional(Schema.Boolean),
|
|
160
|
+
family: Schema.optional(Schema.String),
|
|
161
|
+
aiSDKProvider: Schema.optional(Schema.String),
|
|
162
|
+
});
|
|
163
|
+
export const CatalogFailure = Schema.Struct({
|
|
164
|
+
kind: Schema.Literals(["unauthorized", "network", "schema", "http", "organization_missing"]),
|
|
165
|
+
status: optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(100), Schema.isLessThanOrEqualTo(599))),
|
|
166
|
+
}).annotate({ identifier: "KiloGateway.CatalogFailure" });
|
|
167
|
+
export const SessionMetadata = Schema.Struct({
|
|
168
|
+
routedModelID: Schema.optional(Schema.String),
|
|
169
|
+
vercelID: Schema.optional(Schema.String),
|
|
170
|
+
});
|
|
171
|
+
// kilo_port(unattributed:session:142910b3fc8c) kilo_port(unattributed:session:5dd7101d7cc6) v1 `platform` on session
|
|
172
|
+
// create. A client sets this key in the session metadata on `session.create`, for example `"vscode"`,
|
|
173
|
+
// `"agent-manager"` or `"cli"`. Children and forks inherit it; the Gateway reads it from the root session to set
|
|
174
|
+
// `X-KILOCODE-FEATURE`.
|
|
175
|
+
export const PLATFORM_METADATA_KEY = "kilocode.platform";
|
|
176
|
+
// Custom auto routers (ADR 0005). The payloads are the Cloud contract, decoded by `KiloCustomRouter` in
|
|
177
|
+
// @kilocode/gateway-core; these methods run them in the Gateway account scope and pass them through unchanged.
|
|
178
|
+
// A failed Cloud request fails with `router`: the user-facing message and the Cloud error code.
|
|
179
|
+
const RouterFailure = {
|
|
180
|
+
...Failure,
|
|
181
|
+
router: portable(Schema.Struct({ code: Schema.String, retryAt: Schema.optional(Schema.String) })),
|
|
182
|
+
};
|
|
183
|
+
const RouterTarget = Schema.Struct({
|
|
184
|
+
/** Router model ID or slug, as `kilo auto router` accepts it. */
|
|
185
|
+
router: Schema.String,
|
|
186
|
+
/** `<provider>/<model>` of a catalog model. */
|
|
187
|
+
model: Schema.String,
|
|
188
|
+
});
|
|
189
|
+
export const RouterEvalConfig = Schema.Struct({
|
|
190
|
+
server: Schema.String,
|
|
191
|
+
organizationID: OrganizationID,
|
|
192
|
+
provider: Schema.String,
|
|
193
|
+
model: Schema.String,
|
|
194
|
+
/** Config for the published CLI in the eval container. Has no credentials. */
|
|
195
|
+
config: Schema.Unknown,
|
|
196
|
+
/** Credentials for the published CLI in the eval container. Secret. */
|
|
197
|
+
auth: Schema.Unknown,
|
|
198
|
+
});
|
|
199
|
+
// The TUI, VS Code, and JetBrains clients use this contract for account/profile, balance, Kilo Pass,
|
|
200
|
+
// BYOK, coding plans, team modes, notifications, media and embedding models, and FIM/edit routing.
|
|
201
|
+
export const Definition = Rpc.define({
|
|
202
|
+
id: "kilocode.gateway",
|
|
203
|
+
methods: {
|
|
204
|
+
authStatus: {
|
|
205
|
+
input: portable(Schema.Struct({})),
|
|
206
|
+
output: portable(AuthStatus),
|
|
207
|
+
errors: Failure,
|
|
208
|
+
},
|
|
209
|
+
profile: {
|
|
210
|
+
input: portable(Schema.Struct({})),
|
|
211
|
+
output: portable(Profile),
|
|
212
|
+
errors: Failure,
|
|
213
|
+
},
|
|
214
|
+
balance: {
|
|
215
|
+
input: portable(Schema.Struct({})),
|
|
216
|
+
output: portable(Balance),
|
|
217
|
+
errors: Failure,
|
|
218
|
+
},
|
|
219
|
+
kiloPass: {
|
|
220
|
+
input: portable(Schema.Struct({})),
|
|
221
|
+
output: portable(KiloPass),
|
|
222
|
+
errors: Failure,
|
|
223
|
+
},
|
|
224
|
+
byok: {
|
|
225
|
+
input: portable(Schema.Struct({})),
|
|
226
|
+
output: portable(Schema.Array(ByokEntry)),
|
|
227
|
+
errors: Failure,
|
|
228
|
+
},
|
|
229
|
+
codingPlans: {
|
|
230
|
+
input: portable(Schema.Struct({})),
|
|
231
|
+
output: portable(Schema.Array(CodingPlanSubscription)),
|
|
232
|
+
errors: Failure,
|
|
233
|
+
},
|
|
234
|
+
codingPlanUsage: {
|
|
235
|
+
input: portable(Schema.Struct({ subscriptionID: Schema.String })),
|
|
236
|
+
output: portable(CodingPlanUsage),
|
|
237
|
+
errors: Failure,
|
|
238
|
+
},
|
|
239
|
+
"organization.set": {
|
|
240
|
+
input: portable(Schema.Struct({ organizationID: OrganizationID })),
|
|
241
|
+
output: portable(Schema.Struct({})),
|
|
242
|
+
errors: Failure,
|
|
243
|
+
},
|
|
244
|
+
modes: {
|
|
245
|
+
input: portable(Schema.Struct({})),
|
|
246
|
+
output: portable(Schema.Array(OrganizationMode)),
|
|
247
|
+
errors: Failure,
|
|
248
|
+
},
|
|
249
|
+
notifications: {
|
|
250
|
+
input: portable(Schema.Struct({})),
|
|
251
|
+
output: portable(Schema.Array(Notification)),
|
|
252
|
+
errors: Failure,
|
|
253
|
+
},
|
|
254
|
+
models: {
|
|
255
|
+
input: portable(Schema.Struct({})),
|
|
256
|
+
output: portable(Schema.Array(ModelEntry)),
|
|
257
|
+
errors: { ...Failure, failed: portable(CatalogFailure) },
|
|
258
|
+
},
|
|
259
|
+
"models.images": {
|
|
260
|
+
input: portable(Schema.Struct({})),
|
|
261
|
+
output: portable(Schema.Array(ImageModel)),
|
|
262
|
+
errors: Failure,
|
|
263
|
+
},
|
|
264
|
+
"models.transcriptions": {
|
|
265
|
+
input: portable(Schema.Struct({})),
|
|
266
|
+
output: portable(Schema.Array(TranscriptionModel)),
|
|
267
|
+
errors: Failure,
|
|
268
|
+
},
|
|
269
|
+
"models.embeddings": {
|
|
270
|
+
input: portable(Schema.Struct({})),
|
|
271
|
+
output: portable(EmbeddingCatalog),
|
|
272
|
+
errors: Failure,
|
|
273
|
+
},
|
|
274
|
+
"autocomplete.fimTarget": {
|
|
275
|
+
input: portable(Schema.Struct({ provider: Schema.optional(Schema.String), model: Schema.optional(Schema.String) })),
|
|
276
|
+
output: portable(FimTarget),
|
|
277
|
+
errors: Failure,
|
|
278
|
+
},
|
|
279
|
+
"autocomplete.editTarget": {
|
|
280
|
+
input: portable(Schema.Struct({ provider: Schema.optional(Schema.String), model: Schema.optional(Schema.String) })),
|
|
281
|
+
output: portable(EditTarget),
|
|
282
|
+
errors: Failure,
|
|
283
|
+
},
|
|
284
|
+
"session.metadata": {
|
|
285
|
+
input: portable(Schema.Struct({ sessionID: Schema.String })),
|
|
286
|
+
output: portable(SessionMetadata),
|
|
287
|
+
errors: Failure,
|
|
288
|
+
},
|
|
289
|
+
"routers.list": {
|
|
290
|
+
input: portable(Schema.Struct({})),
|
|
291
|
+
output: portable(Schema.Unknown),
|
|
292
|
+
errors: RouterFailure,
|
|
293
|
+
},
|
|
294
|
+
"routers.add": {
|
|
295
|
+
input: portable(RouterTarget),
|
|
296
|
+
output: portable(Schema.Unknown),
|
|
297
|
+
errors: RouterFailure,
|
|
298
|
+
},
|
|
299
|
+
"routers.remove": {
|
|
300
|
+
input: portable(RouterTarget),
|
|
301
|
+
output: portable(Schema.Unknown),
|
|
302
|
+
errors: RouterFailure,
|
|
303
|
+
},
|
|
304
|
+
"routers.evalPlan": {
|
|
305
|
+
input: portable(Schema.Struct({ routerID: Schema.String })),
|
|
306
|
+
output: portable(Schema.Unknown),
|
|
307
|
+
errors: RouterFailure,
|
|
308
|
+
},
|
|
309
|
+
"routers.evalCase": {
|
|
310
|
+
input: portable(Schema.Struct({ routerID: Schema.String, caseID: Schema.String })),
|
|
311
|
+
output: portable(Schema.Unknown),
|
|
312
|
+
errors: RouterFailure,
|
|
313
|
+
},
|
|
314
|
+
"routers.evalConfig": {
|
|
315
|
+
input: portable(Schema.Struct({ entry: Schema.Unknown })),
|
|
316
|
+
output: portable(RouterEvalConfig),
|
|
317
|
+
errors: RouterFailure,
|
|
318
|
+
},
|
|
319
|
+
"routers.evalResult": {
|
|
320
|
+
input: portable(Schema.Struct({ result: Schema.Unknown })),
|
|
321
|
+
output: portable(Schema.Unknown),
|
|
322
|
+
errors: RouterFailure,
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
events: {
|
|
326
|
+
organization: { schema: portable(Schema.Struct({ organizationID: OrganizationID })) },
|
|
327
|
+
},
|
|
328
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export * as KiloHandshakeRpc from "./handshake.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
export declare const Info: Schema.Struct<{
|
|
4
|
+
/** Always `kilo`. The app name of the server can be the name of the client that started it (`KILO_CLIENT`). */
|
|
5
|
+
readonly product: Schema.Literal<"kilo">;
|
|
6
|
+
/** The Kilo version of the server build. */
|
|
7
|
+
readonly version: Schema.String;
|
|
8
|
+
/** The release channel of the server build. */
|
|
9
|
+
readonly channel: Schema.String;
|
|
10
|
+
}>;
|
|
11
|
+
export type Info = typeof Info.Type;
|
|
12
|
+
export declare const Definition: {
|
|
13
|
+
readonly id: "kilocode.handshake";
|
|
14
|
+
readonly methods: {
|
|
15
|
+
get: {
|
|
16
|
+
input: import("effect/StandardSchema").StandardSchemaV1<{}, {}> & Schema.Struct<{}>;
|
|
17
|
+
output: import("effect/StandardSchema").StandardSchemaV1<{
|
|
18
|
+
readonly product: "kilo";
|
|
19
|
+
readonly version: string;
|
|
20
|
+
readonly channel: string;
|
|
21
|
+
}, {
|
|
22
|
+
readonly product: "kilo";
|
|
23
|
+
readonly version: string;
|
|
24
|
+
readonly channel: string;
|
|
25
|
+
}> & Schema.Struct<{
|
|
26
|
+
/** Always `kilo`. The app name of the server can be the name of the client that started it (`KILO_CLIENT`). */
|
|
27
|
+
readonly product: Schema.Literal<"kilo">;
|
|
28
|
+
/** The Kilo version of the server build. */
|
|
29
|
+
readonly version: Schema.String;
|
|
30
|
+
/** The release channel of the server build. */
|
|
31
|
+
readonly channel: Schema.String;
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
readonly events: {};
|
|
36
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * as KiloHandshakeRpc from "./handshake.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { Rpc } from "../rpc.js";
|
|
4
|
+
// The `kilocode.handshake` RPC contract: the identity of a Kilo v2 server. The handshake plugin in
|
|
5
|
+
// packages/kilo-plugin registers the handler; clients (TUI, VS Code, JetBrains) import this contract from
|
|
6
|
+
// `@opencode/schema/kilocode/handshake`.
|
|
7
|
+
//
|
|
8
|
+
// A client calls `get` first to confirm that it talks to a Kilo v2 server. The other servers answer differently: an
|
|
9
|
+
// upstream OpenCode server has no `kilocode.handshake` RPC (RPC error `rpc.unavailable`), and a Kilo v1 server has no
|
|
10
|
+
// `/api/rpc` route (HTTP 404).
|
|
11
|
+
const portable = Schema.toStandardSchemaV1;
|
|
12
|
+
export const Info = Schema.Struct({
|
|
13
|
+
/** Always `kilo`. The app name of the server can be the name of the client that started it (`KILO_CLIENT`). */
|
|
14
|
+
product: Schema.Literal("kilo"),
|
|
15
|
+
/** The Kilo version of the server build. */
|
|
16
|
+
version: Schema.String,
|
|
17
|
+
/** The release channel of the server build. */
|
|
18
|
+
channel: Schema.String,
|
|
19
|
+
});
|
|
20
|
+
export const Definition = Rpc.define({
|
|
21
|
+
id: "kilocode.handshake",
|
|
22
|
+
methods: {
|
|
23
|
+
get: {
|
|
24
|
+
input: portable(Schema.Struct({})),
|
|
25
|
+
output: portable(Info),
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
events: {},
|
|
29
|
+
});
|