@inhuman.tools/harness-contract 0.0.0-stage → 0.1.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.
- package/LICENSE.md +7 -0
- package/dist/contract.d.ts +1910 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +353 -0
- package/dist/contract.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonrpc.d.ts +18 -0
- package/dist/jsonrpc.d.ts.map +1 -0
- package/dist/jsonrpc.js +34 -0
- package/dist/jsonrpc.js.map +1 -0
- package/dist/schemas/authorization.d.ts +1721 -0
- package/dist/schemas/authorization.d.ts.map +1 -0
- package/dist/schemas/authorization.js +289 -0
- package/dist/schemas/authorization.js.map +1 -0
- package/dist/schemas/connection.d.ts +133 -0
- package/dist/schemas/connection.d.ts.map +1 -0
- package/dist/schemas/connection.js +55 -0
- package/dist/schemas/connection.js.map +1 -0
- package/dist/schemas/rpc.d.ts +86 -0
- package/dist/schemas/rpc.d.ts.map +1 -0
- package/dist/schemas/rpc.js +66 -0
- package/dist/schemas/rpc.js.map +1 -0
- package/dist/schemas/shapes.d.ts +514 -0
- package/dist/schemas/shapes.d.ts.map +1 -0
- package/dist/schemas/shapes.js +342 -0
- package/dist/schemas/shapes.js.map +1 -0
- package/dist/spec/cli.d.ts +3 -0
- package/dist/spec/cli.d.ts.map +1 -0
- package/dist/spec/cli.js +40 -0
- package/dist/spec/cli.js.map +1 -0
- package/dist/spec/generate.d.ts +21 -0
- package/dist/spec/generate.d.ts.map +1 -0
- package/dist/spec/generate.js +100 -0
- package/dist/spec/generate.js.map +1 -0
- package/dist/spec/readme.d.ts +4 -0
- package/dist/spec/readme.d.ts.map +1 -0
- package/dist/spec/readme.js +124 -0
- package/dist/spec/readme.js.map +1 -0
- package/package.json +57 -3
- package/src/contract.ts +418 -0
- package/src/index.ts +6 -0
- package/src/jsonrpc.ts +42 -0
- package/src/schemas/authorization.ts +312 -0
- package/src/schemas/connection.ts +68 -0
- package/src/schemas/rpc.ts +88 -0
- package/src/schemas/shapes.ts +379 -0
- package/src/spec/cli.ts +45 -0
- package/src/spec/generate.ts +115 -0
- package/src/spec/readme.ts +126 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,iBAAiB,EAA2B,MAAM,gBAAgB,CAAC;AACzG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEvD,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,0HAA0H;IAC1H,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;CACzB;AAED,sFAAsF;AACtF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,IAAI,iBAAiB,CAChH,CAAC,EACD,CAAC,EACD,GAAG,EACH,WAAW,CACZ,CAAC;AAQF,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,MAAM,EAAE,CAE1D;AAoVD;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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E,CAKlH;AAED,oCAAoC;AACpC,wBAAgB,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAE5D;AAED,4GAA4G;AAC5G,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAOzE"}
|
package/dist/contract.js
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { isContractProcedure, oc } from "@orpc/contract";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import * as authorization from "./schemas/authorization.js";
|
|
4
|
+
import * as connection from "./schemas/connection.js";
|
|
5
|
+
import { uiFormSchema, uiResolveInput } from "./schemas/rpc.js";
|
|
6
|
+
import * as shapes from "./schemas/shapes.js";
|
|
7
|
+
/** The HTTP path a procedure is projected to in the OpenAPI document. */
|
|
8
|
+
export function httpPathOf(meta) {
|
|
9
|
+
return meta.host === "any" ? `/${meta.method}` : `/${meta.host}/${meta.method}`;
|
|
10
|
+
}
|
|
11
|
+
function rpc(host, method, doc) {
|
|
12
|
+
const meta = doc.mayPark === true ? { method, host, mayPark: true } : { method, host };
|
|
13
|
+
const namespace = method.includes("/") ? method.slice(0, method.indexOf("/")) : method;
|
|
14
|
+
return oc.$meta(meta).route({
|
|
15
|
+
method: "POST",
|
|
16
|
+
path: httpPathOf(meta),
|
|
17
|
+
summary: doc.summary,
|
|
18
|
+
...(doc.description === undefined ? {} : { description: doc.description }),
|
|
19
|
+
tags: [host === "any" ? "ui" : `${host}.${namespace}`],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** A parking method's output: its result, or the form to answer. */
|
|
23
|
+
const parks = (result) => z.union([result, uiFormSchema]);
|
|
24
|
+
const session = {
|
|
25
|
+
kv: {
|
|
26
|
+
set: rpc("session", "kv/set", {
|
|
27
|
+
summary: "Write a key in session, project or kernel scope",
|
|
28
|
+
description: 'Session `model` / `connection` also become the last-choice default (project + kernel) when `remember` is set. `/model` and `/connect` send "1"; a bare session write (subagent, `--model`, `--connection`) does not.',
|
|
29
|
+
})
|
|
30
|
+
.input(shapes.kvSetInput)
|
|
31
|
+
.output(shapes.kvOutput),
|
|
32
|
+
clear: rpc("session", "kv/clear", { summary: "Clear a key in session, project or kernel scope" })
|
|
33
|
+
.input(shapes.kvClearInput)
|
|
34
|
+
.output(shapes.kvOutput),
|
|
35
|
+
},
|
|
36
|
+
plugin: {
|
|
37
|
+
method: rpc("session", "plugin/method", {
|
|
38
|
+
summary: "Call a plugin's own state method",
|
|
39
|
+
description: "A plugin command's call into that plugin's own state. `args` is a JSON object, since action params cross as strings. `field` names the argument the composer text (`input`) fills; an empty `input` then refuses. A failure is data (`ok: false`), not an RPC error.",
|
|
40
|
+
})
|
|
41
|
+
.input(shapes.pluginMethodInput)
|
|
42
|
+
.output(shapes.pluginMethodOutput),
|
|
43
|
+
},
|
|
44
|
+
policy: {
|
|
45
|
+
set: rpc("session", "policy/set", { summary: "Set the session's permission mode" })
|
|
46
|
+
.input(shapes.policySetInput)
|
|
47
|
+
.output(shapes.policySetOutput),
|
|
48
|
+
explain: rpc("session", "policy/explain", {
|
|
49
|
+
summary: "Explain what would happen to a call right now",
|
|
50
|
+
description: "Runs the same floor, grant and resolution code as a real call, with no judge and no effect. Returns the tier (block, soft-deny, ask, allow), the classes that voted, which resolver licenses it in the session's mode and from which layer, and the outcome.",
|
|
51
|
+
})
|
|
52
|
+
.input(authorization.policyExplainInput)
|
|
53
|
+
.output(authorization.policyExplainOutput),
|
|
54
|
+
overlay: rpc("session", "policy/overlay", {
|
|
55
|
+
summary: "Set or clear this session's authorization overlay",
|
|
56
|
+
description: "A human decision for this session only. It may loosen what the user's config says, but never past the project layer. Refused for any caller that is not a human client.",
|
|
57
|
+
})
|
|
58
|
+
.input(authorization.policyOverlayInput)
|
|
59
|
+
.output(authorization.policyOverlayOutput),
|
|
60
|
+
configGet: rpc("session", "policy/config-get", {
|
|
61
|
+
summary: "Read the authorization layers this session resolves against",
|
|
62
|
+
})
|
|
63
|
+
.input(authorization.policyConfigGetInput)
|
|
64
|
+
.output(authorization.policyConfigGetOutput),
|
|
65
|
+
},
|
|
66
|
+
connect: {
|
|
67
|
+
adopt: rpc("session", "connect/adopt", {
|
|
68
|
+
summary: "Adopt a connection and make it this session's connection",
|
|
69
|
+
description: "Delegates to the kernel's `connect/adopt`, then writes the new connection id into the session's `connection` key and warms it. May park for UI.",
|
|
70
|
+
mayPark: true,
|
|
71
|
+
})
|
|
72
|
+
.input(shapes.connectAdoptInput)
|
|
73
|
+
.output(shapes.sessionConnectAdoptOutput),
|
|
74
|
+
},
|
|
75
|
+
turn: {
|
|
76
|
+
send: rpc("session", "turn", {
|
|
77
|
+
summary: "Submit a prompt as a turn, a steer or a queued prompt",
|
|
78
|
+
description: "Pictures (`visuals`) ride only on a fresh turn: standard base64, stored beside the session, and the model must accept images.",
|
|
79
|
+
})
|
|
80
|
+
.input(shapes.turnInput)
|
|
81
|
+
.output(shapes.turnOutput),
|
|
82
|
+
cancel: rpc("session", "turn/cancel", { summary: "Cancel a running turn by turn id or eval request id" })
|
|
83
|
+
.input(shapes.turnCancelInput)
|
|
84
|
+
.output(shapes.turnCancelOutput),
|
|
85
|
+
visual: rpc("session", "turn/visual", { summary: "Read one picture seated on the session's head turn" })
|
|
86
|
+
.input(shapes.turnVisualReadInput)
|
|
87
|
+
.output(shapes.turnVisualReadOutput),
|
|
88
|
+
rewind: rpc("session", "turn/rewind", { summary: "Rewind the session to before a turn" })
|
|
89
|
+
.input(shapes.turnRewindInput)
|
|
90
|
+
.output(shapes.turnRewindOutput),
|
|
91
|
+
retry: rpc("session", "turn/retry", { summary: "Retry the last turn" })
|
|
92
|
+
.input(shapes.turnRetryInput)
|
|
93
|
+
.output(shapes.turnRetryOutput),
|
|
94
|
+
},
|
|
95
|
+
blob: {
|
|
96
|
+
get: rpc("session", "blob/get", {
|
|
97
|
+
summary: "Read one blob the session's document references, by content hash",
|
|
98
|
+
description: "Large bodies (a file's prior text today) live in the kernel's blob bucket; the document keeps `{sha256, bytes, mime, head}`. `text/*` blobs return `text`, anything else `bytesBase64`. The hash a document names is the capability; there is no listing.",
|
|
99
|
+
})
|
|
100
|
+
.input(shapes.blobGetInput)
|
|
101
|
+
.output(shapes.blobGetOutput),
|
|
102
|
+
vacuum: rpc("session", "blob/vacuum", {
|
|
103
|
+
summary: "Move the session's large stored text into the blob bucket",
|
|
104
|
+
description: "A session written before large bodies left the document keeps a file's prior text and an isolated completion's prompt inline, and the stored image carries them forever. The vacuum moves every such body over the inline limit into the kernel's blob bucket, leaving the head and a reference, then rewrites the stored image as one snapshot. Completions still running are skipped. `dryRun` counts what would move and writes nothing. Reads stay whole: the wire projection and `blob/get` resolve the references.",
|
|
105
|
+
})
|
|
106
|
+
.input(shapes.blobVacuumInput)
|
|
107
|
+
.output(shapes.blobVacuumOutput),
|
|
108
|
+
},
|
|
109
|
+
compact: rpc("session", "compact", { summary: "Compact the session's context, optionally around a focus" })
|
|
110
|
+
.input(shapes.compactInput)
|
|
111
|
+
.output(shapes.compactOutput),
|
|
112
|
+
rename: rpc("session", "rename", { summary: "Set the session title" })
|
|
113
|
+
.input(shapes.renameInput)
|
|
114
|
+
.output(shapes.renameOutput),
|
|
115
|
+
eval: rpc("session", "eval", {
|
|
116
|
+
summary: "Admit a Scheme program as an unattended eval turn",
|
|
117
|
+
description: "Idempotent per `requestId`: a repeat with the same input returns the admitted turn; a repeat with different input is refused. `ok: false` with `policy_unavailable` means the requested permission policy cannot run unattended.",
|
|
118
|
+
})
|
|
119
|
+
.input(shapes.evalInput)
|
|
120
|
+
.output(shapes.evalOutput),
|
|
121
|
+
ask: {
|
|
122
|
+
answer: rpc("session", "ask/answer", {
|
|
123
|
+
summary: "Answer the live approval ask",
|
|
124
|
+
description: "Answer the live ask or soft-deny on `sessionId`: this session, or a worker that escalated to it. `store` remembers a human yes to an ask as a grant (scope, subject, TTL); a soft-deny is never stored and a block is never put to a human.",
|
|
125
|
+
})
|
|
126
|
+
.input(authorization.askAnswerInput)
|
|
127
|
+
.output(authorization.askAnswerOutput),
|
|
128
|
+
},
|
|
129
|
+
ack: {
|
|
130
|
+
pending: rpc("session", "ack/pending", {
|
|
131
|
+
summary: "List calls waiting for an acknowledgement",
|
|
132
|
+
description: "A call that is allowed but flagged `needsAcknowledgement` waits for a person. Acks travel over RPC only: there is no ack job and no transcript entry. Absent `sessionId`: this session and the workers that escalated to it.",
|
|
133
|
+
})
|
|
134
|
+
.input(authorization.ackPendingInput)
|
|
135
|
+
.output(authorization.ackPendingOutput),
|
|
136
|
+
answer: rpc("session", "ack/answer", {
|
|
137
|
+
summary: "Acknowledge or refuse a pending call, optionally remembering the acknowledgement",
|
|
138
|
+
description: "Human clients only. `accept` lets the call run; a refusal is a human denial (its `comment` is what the agent reads). `store` remembers the acknowledgement at session, project, bot or global scope as one of the offered `storeOptions`; prompt-created project, bot and global acks last 7 days. A block and a policy denial are never put here. When the prompt was also an ask (a combined prompt), the same answer settles both.",
|
|
139
|
+
})
|
|
140
|
+
.input(authorization.ackAnswerInput)
|
|
141
|
+
.output(authorization.ackAnswerOutput),
|
|
142
|
+
},
|
|
143
|
+
resident: {
|
|
144
|
+
set: rpc("session", "resident/set", { summary: "Mark the session resident (kept alive) or not" })
|
|
145
|
+
.input(shapes.residentSetInput)
|
|
146
|
+
.output(shapes.residentSetOutput),
|
|
147
|
+
},
|
|
148
|
+
queue: {
|
|
149
|
+
steerFirst: rpc("session", "queue/steer-first", {
|
|
150
|
+
summary: "Promote the first queued prompt to a steer",
|
|
151
|
+
description: "A queued row named by the id the client saw. Already drained or moved is `ok: false`.",
|
|
152
|
+
})
|
|
153
|
+
.input(shapes.queueRowInput)
|
|
154
|
+
.output(shapes.queueRowOutput),
|
|
155
|
+
retractLast: rpc("session", "queue/retract-last", {
|
|
156
|
+
summary: "Retract the last queued prompt",
|
|
157
|
+
description: "A queued row named by the id the client saw. Already drained or moved is `ok: false`.",
|
|
158
|
+
})
|
|
159
|
+
.input(shapes.queueRowInput)
|
|
160
|
+
.output(shapes.queueRowOutput),
|
|
161
|
+
},
|
|
162
|
+
agentCalls: {
|
|
163
|
+
list: rpc("session", "agent-calls/list", { summary: "List agent calls made from this session" })
|
|
164
|
+
.input(shapes.agentCallsListInput)
|
|
165
|
+
.output(shapes.agentCallsListOutput),
|
|
166
|
+
inspect: rpc("session", "agent-calls/inspect", { summary: "Inspect one agent call by request id" })
|
|
167
|
+
.input(shapes.agentCallsInspectInput)
|
|
168
|
+
.output(shapes.agentCallsInspectOutput),
|
|
169
|
+
cancel: rpc("session", "agent-calls/cancel", { summary: "Cancel one agent call by request id" })
|
|
170
|
+
.input(shapes.agentCallsCancelInput)
|
|
171
|
+
.output(shapes.agentCallsCancelOutput),
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
const kernel = {
|
|
175
|
+
termContinue: {
|
|
176
|
+
set: rpc("kernel", "term-continue/set", { summary: "Remember which session a terminal key continues" })
|
|
177
|
+
.input(shapes.termContinueSetInput)
|
|
178
|
+
.output(shapes.termContinueOutput),
|
|
179
|
+
clear: rpc("kernel", "term-continue/clear", { summary: "Forget a terminal key's continue session" })
|
|
180
|
+
.input(shapes.termContinueClearInput)
|
|
181
|
+
.output(shapes.termContinueOutput),
|
|
182
|
+
},
|
|
183
|
+
connect: {
|
|
184
|
+
drop: rpc("kernel", "connect/drop", {
|
|
185
|
+
summary: "Remove a connection and its secrets",
|
|
186
|
+
description: "Without `confirm: true` it parks on a confirmation form; cancelling answers `{ok: false}`.",
|
|
187
|
+
mayPark: true,
|
|
188
|
+
})
|
|
189
|
+
.input(shapes.connectDropInput)
|
|
190
|
+
.output(parks(shapes.connectDropOutput)),
|
|
191
|
+
adopt: rpc("kernel", "connect/adopt", {
|
|
192
|
+
summary: "Adopt a connection from a driver",
|
|
193
|
+
description: "Runs the driver's adopt flow. The flow may need the human (sign-in, a pasted key) and then parks. Cancelling answers `{ok: false}`.",
|
|
194
|
+
mayPark: true,
|
|
195
|
+
})
|
|
196
|
+
.input(shapes.connectAdoptInput)
|
|
197
|
+
.output(parks(shapes.connectAdoptOutput)),
|
|
198
|
+
list: rpc("kernel", "connect/list", { summary: "List connections, optionally by ability claim" })
|
|
199
|
+
.input(connection.listConnectionsInput)
|
|
200
|
+
.output(connection.listConnectionsOutput),
|
|
201
|
+
models: rpc("kernel", "connect/models", { summary: "Probe the model catalog of one or all connections" })
|
|
202
|
+
.input(connection.connectModelsInput)
|
|
203
|
+
.output(connection.connectModelsOutput),
|
|
204
|
+
get: rpc("kernel", "connect/get", { summary: "Read one connection with its settings" })
|
|
205
|
+
.input(connection.getConnectionInput)
|
|
206
|
+
.output(connection.getConnectionOutput),
|
|
207
|
+
setEnabled: rpc("kernel", "connect/set-enabled", { summary: "Enable or disable a connection" })
|
|
208
|
+
.input(connection.setEnabledInput)
|
|
209
|
+
.output(connection.setEnabledOutput),
|
|
210
|
+
alwaysAllow: rpc("kernel", "connect/always-allow", { summary: "Always allow one tool of a connection" })
|
|
211
|
+
.input(connection.persistToolInput)
|
|
212
|
+
.output(connection.persistToolOutput),
|
|
213
|
+
excludeTool: rpc("kernel", "connect/exclude-tool", { summary: "Exclude one tool of a connection" })
|
|
214
|
+
.input(connection.persistToolInput)
|
|
215
|
+
.output(connection.persistToolOutput),
|
|
216
|
+
login: rpc("kernel", "connect/login", {
|
|
217
|
+
summary: "Sign in to a connection",
|
|
218
|
+
description: "May open a browser flow and park until the human finishes it.",
|
|
219
|
+
mayPark: true,
|
|
220
|
+
})
|
|
221
|
+
.input(connection.loginInput)
|
|
222
|
+
.output(parks(connection.loginOutput)),
|
|
223
|
+
logout: rpc("kernel", "connect/logout", { summary: "Sign out of a connection" })
|
|
224
|
+
.input(connection.logoutInput)
|
|
225
|
+
.output(connection.logoutOutput),
|
|
226
|
+
update: rpc("kernel", "connect/update", {
|
|
227
|
+
summary: "Rename a connection or merge its settings",
|
|
228
|
+
description: "Rename or merge settings of a connection that already exists. The id stays.",
|
|
229
|
+
})
|
|
230
|
+
.input(shapes.connectUpdateInput)
|
|
231
|
+
.output(shapes.connectUpdateOutput),
|
|
232
|
+
},
|
|
233
|
+
mcpServer: {
|
|
234
|
+
adopt: rpc("kernel", "mcp-server/adopt", {
|
|
235
|
+
summary: "Adopt an MCP server as a connection",
|
|
236
|
+
description: "May need the human (sign-in) and then parks.",
|
|
237
|
+
mayPark: true,
|
|
238
|
+
})
|
|
239
|
+
.input(shapes.mcpServerAdoptInput)
|
|
240
|
+
.output(parks(shapes.mcpServerAdoptOutput)),
|
|
241
|
+
search: rpc("kernel", "mcp-server/search", { summary: "Search the official MCP registry" })
|
|
242
|
+
.input(shapes.mcpServerSearchInput)
|
|
243
|
+
.output(shapes.mcpServerSearchOutput),
|
|
244
|
+
},
|
|
245
|
+
config: {
|
|
246
|
+
set: rpc("kernel", "config/set", { summary: "Set kernel configuration fields" })
|
|
247
|
+
.input(shapes.configSetInput)
|
|
248
|
+
.output(shapes.configSetOutput),
|
|
249
|
+
},
|
|
250
|
+
grant: {
|
|
251
|
+
list: rpc("kernel", "grant/list", { summary: "List stored grants" })
|
|
252
|
+
.input(authorization.grantListInput)
|
|
253
|
+
.output(authorization.grantListOutput),
|
|
254
|
+
add: rpc("kernel", "grant/add", {
|
|
255
|
+
summary: "Store a grant from settings",
|
|
256
|
+
description: "A grant turns an ask into allow for a family (a command, a path, an MCP server+tool+account). It never lifts a soft-deny or a block. Settings grants do not expire unless `ttlMs` is given.",
|
|
257
|
+
})
|
|
258
|
+
.input(authorization.grantAddInput)
|
|
259
|
+
.output(authorization.grantAddOutput),
|
|
260
|
+
revoke: rpc("kernel", "grant/revoke", { summary: "Revoke a stored grant" })
|
|
261
|
+
.input(authorization.grantRevokeInput)
|
|
262
|
+
.output(authorization.grantRevokeOutput),
|
|
263
|
+
},
|
|
264
|
+
ack: {
|
|
265
|
+
list: rpc("kernel", "ack/list", {
|
|
266
|
+
summary: "List stored acknowledgements",
|
|
267
|
+
description: "The acknowledgements a person stored at session, project, bot or global scope (same rows, TTL and scopes as grants). Flags themselves live in the `authorization` block (see `policy/config-get`).",
|
|
268
|
+
})
|
|
269
|
+
.input(authorization.ackListInput)
|
|
270
|
+
.output(authorization.ackListOutput),
|
|
271
|
+
add: rpc("kernel", "ack/add", {
|
|
272
|
+
summary: "Store an acknowledgement from settings",
|
|
273
|
+
description: 'Equivalent to "you can send any email you want in this project". Settings acknowledgements do not expire unless `ttlMs` is given.',
|
|
274
|
+
})
|
|
275
|
+
.input(authorization.ackAddInput)
|
|
276
|
+
.output(authorization.ackAddOutput),
|
|
277
|
+
revoke: rpc("kernel", "ack/revoke", { summary: "Revoke a stored acknowledgement" })
|
|
278
|
+
.input(authorization.ackRevokeInput)
|
|
279
|
+
.output(authorization.ackRevokeOutput),
|
|
280
|
+
},
|
|
281
|
+
plugin: {
|
|
282
|
+
set: rpc("kernel", "plugin/set", { summary: "Enable, disable or foreground a plugin" })
|
|
283
|
+
.input(shapes.pluginSetInput)
|
|
284
|
+
.output(shapes.pluginSetOutput),
|
|
285
|
+
install: rpc("kernel", "plugin/install", { summary: "Install a plugin from an npm spec" })
|
|
286
|
+
.input(shapes.pluginInstallInput)
|
|
287
|
+
.output(shapes.pluginInstallOutput),
|
|
288
|
+
remove: rpc("kernel", "plugin/remove", { summary: "Remove an installed plugin" })
|
|
289
|
+
.input(shapes.pluginRemoveInput)
|
|
290
|
+
.output(shapes.pluginRemoveOutput),
|
|
291
|
+
},
|
|
292
|
+
skill: {
|
|
293
|
+
list: rpc("kernel", "skill/list", { summary: "List skill files for a project and home" })
|
|
294
|
+
.input(shapes.skillListInput)
|
|
295
|
+
.output(shapes.skillListOutput),
|
|
296
|
+
write: rpc("kernel", "skill/write", { summary: "Write a skill file" })
|
|
297
|
+
.input(shapes.skillWriteInput)
|
|
298
|
+
.output(shapes.skillWriteOutput),
|
|
299
|
+
remove: rpc("kernel", "skill/remove", { summary: "Remove a skill file" })
|
|
300
|
+
.input(shapes.skillRemoveInput)
|
|
301
|
+
.output(shapes.skillRemoveOutput),
|
|
302
|
+
read: rpc("kernel", "skill/read", { summary: "Read a skill file with its body" })
|
|
303
|
+
.input(shapes.skillReadInput)
|
|
304
|
+
.output(shapes.skillReadOutput),
|
|
305
|
+
},
|
|
306
|
+
bot: {
|
|
307
|
+
write: rpc("kernel", "bot/write", {
|
|
308
|
+
summary: "Write a bot definition",
|
|
309
|
+
description: "Absent `invokes`, `reasoningEffort` and `modelPreferences` keep the file's current value; an empty list clears. Absent `mcp` keeps the file's grants; an empty list clears them. A settings save that does not know these fields must not wipe them.",
|
|
310
|
+
})
|
|
311
|
+
.input(shapes.botWriteInput)
|
|
312
|
+
.output(shapes.botWriteOutput),
|
|
313
|
+
remove: rpc("kernel", "bot/remove", { summary: "Remove a bot definition" })
|
|
314
|
+
.input(shapes.botRemoveInput)
|
|
315
|
+
.output(shapes.botRemoveOutput),
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
const common = {
|
|
319
|
+
resolve: rpc("any", "ui/resolve", {
|
|
320
|
+
summary: "Answer a parked UI form",
|
|
321
|
+
description: 'Finishes a call that answered `{form: "ui", pending, body}`. The reply is the resumed call\'s result, or another park form. `kind: "cancel"` aborts the parked call. Closing the socket cancels every park it owns.',
|
|
322
|
+
})
|
|
323
|
+
.input(uiResolveInput)
|
|
324
|
+
.output(z.record(z.string(), z.unknown())),
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* The daemon's RPC contract, grouped by host and namespace. The tree is for
|
|
328
|
+
* callers; the JSON-RPC wire name of each procedure is `meta.method`.
|
|
329
|
+
* `turn` is `session.turn.send`: the namespace and the bare method share a name.
|
|
330
|
+
*/
|
|
331
|
+
export const contract = { session, kernel, ui: common };
|
|
332
|
+
/** Every procedure of a router with its tree path, in declaration order. */
|
|
333
|
+
export function listProcedures(router = contract, path = []) {
|
|
334
|
+
if (isContractProcedure(router)) {
|
|
335
|
+
return [{ path, procedure: router, meta: router["~orpc"].meta }];
|
|
336
|
+
}
|
|
337
|
+
return Object.entries(router).flatMap(([key, child]) => listProcedures(child, [...path, key]));
|
|
338
|
+
}
|
|
339
|
+
/** The wire name of a procedure. */
|
|
340
|
+
export function methodOf(procedure) {
|
|
341
|
+
return procedure["~orpc"].meta.method;
|
|
342
|
+
}
|
|
343
|
+
/** Wire name for a tree path (`["session","kv","set"]` is `kv/set`), or `undefined` for an unknown path. */
|
|
344
|
+
export function methodForPath(path) {
|
|
345
|
+
let node = contract;
|
|
346
|
+
for (const key of path) {
|
|
347
|
+
if (typeof node !== "object" || node === null || !Object.hasOwn(node, key))
|
|
348
|
+
return undefined;
|
|
349
|
+
node = node[key];
|
|
350
|
+
}
|
|
351
|
+
return isContractProcedure(node) ? node["~orpc"].meta.method : undefined;
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,mBAAmB,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACzG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAgC9C,yEAAyE;AACzE,MAAM,UAAU,UAAU,CAAC,IAAiB;IAC1C,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;AAClF,CAAC;AAED,SAAS,GAAG,CAAC,IAAiB,EAAE,MAAc,EAAE,GAAQ;IACtD,MAAM,IAAI,GAAgB,GAAG,CAAC,OAAO,KAAK,IAAI,CAAC,CAA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AAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACjG,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,QAAQ,CAAC,SAA2B;IAClD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;AACxC,CAAC;AAED,4GAA4G;AAC5G,MAAM,UAAU,aAAa,CAAC,IAAuB;IACnD,IAAI,IAAI,GAAY,QAAQ,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;YAAE,OAAO,SAAS,CAAC;QAC7F,IAAI,GAAI,IAAgC,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,OAAO,CAAC,CAAC,IAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5F,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type JsonRpcId } from "./schemas/rpc.js";
|
|
2
|
+
export declare const JSON_RPC_VERSION: "2.0";
|
|
3
|
+
export declare const JSON_RPC_PARSE_ERROR = -32700;
|
|
4
|
+
export declare const JSON_RPC_INVALID_REQUEST = -32600;
|
|
5
|
+
export declare const JSON_RPC_METHOD_NOT_FOUND = -32601;
|
|
6
|
+
export declare const JSON_RPC_INVALID_PARAMS = -32602;
|
|
7
|
+
export declare const JSON_RPC_INTERNAL_ERROR = -32603;
|
|
8
|
+
/** JSON-RPC error on a Client waiter. Transport loss is a plain Error. */
|
|
9
|
+
export declare class RpcClientError extends Error {
|
|
10
|
+
readonly code: number;
|
|
11
|
+
constructor(code: number, message: string);
|
|
12
|
+
}
|
|
13
|
+
/** Method-not-found / invalid-params: do not treat as a socket drop. */
|
|
14
|
+
export declare function isRpcContractError(error: unknown): boolean;
|
|
15
|
+
export declare function encodeJsonRpcRequest(id: string | number, method: string, params?: unknown): string;
|
|
16
|
+
export declare function encodeJsonRpcResult(id: JsonRpcId, result: unknown): string;
|
|
17
|
+
export declare function encodeJsonRpcError(id: JsonRpcId, code: number, message: string, data?: unknown): string;
|
|
18
|
+
//# sourceMappingURL=jsonrpc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.d.ts","sourceRoot":"","sources":["../src/jsonrpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,gBAAgB,EAAG,KAAc,CAAC;AAC/C,eAAO,MAAM,oBAAoB,SAAU,CAAC;AAC5C,eAAO,MAAM,wBAAwB,SAAU,CAAC;AAChD,eAAO,MAAM,yBAAyB,SAAU,CAAC;AACjD,eAAO,MAAM,uBAAuB,SAAU,CAAC;AAC/C,eAAO,MAAM,uBAAuB,SAAU,CAAC;AAE/C,0EAA0E;AAC1E,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBACV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C;AAED,wEAAwE;AACxE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAK1D;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,OAAY,GAAG,MAAM,CAEtG;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAE1E;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAMvG"}
|
package/dist/jsonrpc.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const JSON_RPC_VERSION = "2.0";
|
|
2
|
+
export const JSON_RPC_PARSE_ERROR = -32_700;
|
|
3
|
+
export const JSON_RPC_INVALID_REQUEST = -32_600;
|
|
4
|
+
export const JSON_RPC_METHOD_NOT_FOUND = -32_601;
|
|
5
|
+
export const JSON_RPC_INVALID_PARAMS = -32_602;
|
|
6
|
+
export const JSON_RPC_INTERNAL_ERROR = -32_603;
|
|
7
|
+
/** JSON-RPC error on a Client waiter. Transport loss is a plain Error. */
|
|
8
|
+
export class RpcClientError extends Error {
|
|
9
|
+
code;
|
|
10
|
+
constructor(code, message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "RpcClientError";
|
|
13
|
+
this.code = code;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** Method-not-found / invalid-params: do not treat as a socket drop. */
|
|
17
|
+
export function isRpcContractError(error) {
|
|
18
|
+
return (error instanceof RpcClientError &&
|
|
19
|
+
(error.code === JSON_RPC_METHOD_NOT_FOUND || error.code === JSON_RPC_INVALID_PARAMS));
|
|
20
|
+
}
|
|
21
|
+
export function encodeJsonRpcRequest(id, method, params = {}) {
|
|
22
|
+
return JSON.stringify({ jsonrpc: JSON_RPC_VERSION, id, method, params });
|
|
23
|
+
}
|
|
24
|
+
export function encodeJsonRpcResult(id, result) {
|
|
25
|
+
return JSON.stringify({ jsonrpc: JSON_RPC_VERSION, id, result });
|
|
26
|
+
}
|
|
27
|
+
export function encodeJsonRpcError(id, code, message, data) {
|
|
28
|
+
return JSON.stringify({
|
|
29
|
+
jsonrpc: JSON_RPC_VERSION,
|
|
30
|
+
id,
|
|
31
|
+
error: data === undefined ? { code, message } : { code, message, data },
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=jsonrpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonrpc.js","sourceRoot":"","sources":["../src/jsonrpc.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAM,CAAC;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAM,CAAC;AAChD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,MAAM,CAAC;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,CAAC;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,CAAC;AAE/C,0EAA0E;AAC1E,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC9B,IAAI,CAAS;IACtB,YAAY,IAAY,EAAE,OAAe;QACvC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,wEAAwE;AACxE,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,OA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