@frockbot/applet-sdk 0.7.254 → 0.7.255

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 (2) hide show
  1. package/package.json +1 -1
  2. package/plugin/index.d.ts +58 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frockbot/applet-sdk",
3
- "version": "0.7.254",
3
+ "version": "0.7.255",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Authoring SDK for FrockBot Plugins: the declarations a Plugin is written against, and the build pipeline the cloud build service runs.",
package/plugin/index.d.ts CHANGED
@@ -30,15 +30,16 @@ export type PluginHookEvent =
30
30
 
31
31
  /**
32
32
  * The grants a Plugin may declare in `plugin.json`, in the kernel's order.
33
- * `storage`, `http`, `schedule`, `ai`, `memory` and `workspace` each open one
34
- * member of `ctx`; `files` and `computer` are declared to the authority and
35
- * open nothing here.
33
+ * `storage`, `http`, `schedule`, `ai`, `jev`, `memory` and `workspace` each
34
+ * open one member of `ctx`; `files` and `computer` are declared to the
35
+ * authority and open nothing here.
36
36
  */
37
37
  export type PluginGrant =
38
38
  | "storage"
39
39
  | "http"
40
40
  | "schedule"
41
41
  | "ai"
42
+ | "jev"
42
43
  | "files"
43
44
  | "memory"
44
45
  | "workspace"
@@ -160,6 +161,58 @@ export interface PluginModel {
160
161
  >;
161
162
  }
162
163
 
164
+ /**
165
+ * One Jev question, in Jev's wire shape. `instructions` says what to judge,
166
+ * as a string or as `{ target, decision, rules? , requirements? }`. A
167
+ * `choice` picks one label of `criteria` (`{ label: meaning }`); a `noul`
168
+ * gives the probability a condition holds (`criteria` optional,
169
+ * `{ true, false }`); a `score` places the state on `criteria`, 2 to 10
170
+ * levels, lowest first.
171
+ */
172
+ export type JevQuestion =
173
+ | {
174
+ type: "choice";
175
+ instructions: string | { [key: string]: unknown };
176
+ criteria: { [label: string]: unknown };
177
+ }
178
+ | {
179
+ type: "noul";
180
+ instructions: string | { [key: string]: unknown };
181
+ criteria?: { true?: unknown; false?: unknown };
182
+ }
183
+ | {
184
+ type: "score";
185
+ instructions: string | { [key: string]: unknown };
186
+ criteria: unknown[];
187
+ };
188
+
189
+ /**
190
+ * The `jev` grant: Jev, a decision model, for judgments the Plugin makes for
191
+ * itself. At most 32 questions and 64 KB a call, and 64 calls a run. The
192
+ * answers are the Plugin's alone: nothing the kernel decides reads them.
193
+ */
194
+ export interface PluginJev {
195
+ decide(request: {
196
+ state: { [key: string]: unknown };
197
+ questions: { [name: string]: JevQuestion };
198
+ }): Promise<
199
+ | {
200
+ status: "available";
201
+ value: {
202
+ model: string;
203
+ /**
204
+ * By question name: `{ type: "choice", choice, probabilities,
205
+ * confidence }`, `{ type: "noul", noul }` or `{ type: "score",
206
+ * score, probabilities, confidence }`.
207
+ */
208
+ answers: { [name: string]: { [key: string]: unknown } };
209
+ usage: { inputTokens: number; outputTokens: number };
210
+ };
211
+ }
212
+ | CapabilityFailure
213
+ >;
214
+ }
215
+
163
216
  /** One message in the normalized request a model provider is handed. */
164
217
  export interface PluginModelMessage {
165
218
  role: "user" | "assistant" | "tool";
@@ -387,6 +440,8 @@ export interface PluginContext {
387
440
  readonly settings: PluginSettings;
388
441
  /** The `ai` grant. */
389
442
  readonly model?: PluginModel;
443
+ /** The `jev` grant. */
444
+ readonly jev?: PluginJev;
390
445
  /**
391
446
  * The credentialed transport, present exactly while this Plugin is serving
392
447
  * one of its model provider contributions. A tool call's `ctx` has none.