@inferencebureau/apps-sdk 0.16.6 → 0.16.7
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/index.d.ts +42 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -151,8 +151,45 @@ export interface AppSettings {
|
|
|
151
151
|
integrations?: IntegrationSetting[];
|
|
152
152
|
/** Whether the team is emailed when production fails. On unless `{ failures: false }`. */
|
|
153
153
|
alerts?: AlertSetting;
|
|
154
|
+
/**
|
|
155
|
+
* The app's MCP server for its own users, at `<app address>/mcp`: people add it in Claude or ChatGPT and sign in as
|
|
156
|
+
* one of the app's users. Its tools are the actions that export `mcp` (ActionMcp). Left out, the endpoint is off.
|
|
157
|
+
*/
|
|
158
|
+
mcp?: McpSetting | true;
|
|
154
159
|
[key: string]: unknown;
|
|
155
160
|
}
|
|
161
|
+
/** What MCP clients and the sign-in's consent page call the app's MCP server. */
|
|
162
|
+
export interface McpSetting {
|
|
163
|
+
/** At most 60 characters; the app's name when left out. */
|
|
164
|
+
name?: string;
|
|
165
|
+
/** At most 500 characters. */
|
|
166
|
+
description?: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* An action as a tool on the app's MCP server (settings.ib.ts `mcp`): `export const mcp: ActionMcp = { … }` beside
|
|
170
|
+
* `options`. It runs as the signed-in user, held to their roles in permissions.ib.ts like the app's own pages; its
|
|
171
|
+
* input is the action's params. A user whose roles can't run it doesn't see it.
|
|
172
|
+
*/
|
|
173
|
+
export interface ActionMcp {
|
|
174
|
+
/** The tool's name in a client's list, at most 60 characters. */
|
|
175
|
+
title: string;
|
|
176
|
+
/** What it does, what it changes and its limits, for the person and the model. At most 1000 characters. */
|
|
177
|
+
description: string;
|
|
178
|
+
/** It changes nothing (needs the read scope only). False unless set. */
|
|
179
|
+
readOnly?: boolean;
|
|
180
|
+
/** It deletes, overwrites, sends something outside or spends money: clients ask before each call. True for a write unless set false. */
|
|
181
|
+
destructive?: boolean;
|
|
182
|
+
/** Running it again with the same input changes nothing more. */
|
|
183
|
+
idempotent?: boolean;
|
|
184
|
+
/** It reaches services outside the app (email, payments, other APIs). */
|
|
185
|
+
openWorld?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* The widget that shows its answers in Claude and ChatGPT (MCP Apps): `widgets/<name>.html`, one self-contained
|
|
188
|
+
* page (inline scripts and styles, no outside requests) that gets the answer from the client by postMessage.
|
|
189
|
+
* Lowercase letters, digits and dashes.
|
|
190
|
+
*/
|
|
191
|
+
widget?: string;
|
|
192
|
+
}
|
|
156
193
|
/**
|
|
157
194
|
* Failure emails: when an action, job, deploy, release or request fails in production, the team's owners, admins and
|
|
158
195
|
* the members who can see the app get an email naming what failed, at most one every 12 hours per app (failures in
|
|
@@ -787,8 +824,9 @@ export interface ModelClient<M extends ModelTypes = UntypedModel> {
|
|
|
787
824
|
build(values?: M["input"]): M["record"];
|
|
788
825
|
/**
|
|
789
826
|
* Whether `password` is the one stored in the record's password field (`password` unless named). Hashes are never
|
|
790
|
-
* returned.
|
|
791
|
-
* an ApiError with status 429 and a message to show, without checking.
|
|
827
|
+
* returned. Every check is counted before the password is: per record, per `email` and per visitor `ip`; past a limit
|
|
828
|
+
* it throws an ApiError with status 429 and a message to show, without checking. A correct password clears the
|
|
829
|
+
* record's and the email's counts.
|
|
792
830
|
*/
|
|
793
831
|
checkPassword(id: string, password: string, field?: M["passwords"] | (CheckPasswordOptions & {
|
|
794
832
|
field?: M["passwords"];
|
|
@@ -1594,6 +1632,8 @@ export interface ActionCaller {
|
|
|
1594
1632
|
/** A storefront customer's Shopify id (numeric), and their shopifyCustomer record's id when the app syncs customers. */
|
|
1595
1633
|
customerId?: string | null;
|
|
1596
1634
|
customerRecordId?: string | null;
|
|
1635
|
+
/** The account a web app's signed-in user acts in (`$session: "accountId"`). */
|
|
1636
|
+
accountId?: string | null;
|
|
1597
1637
|
}
|
|
1598
1638
|
export type ActionRun<P = Record<string, unknown>> = (ctx: ActionContext<P>) => unknown | Promise<unknown>;
|
|
1599
1639
|
export type ActionOnSuccess<P = Record<string, unknown>> = (ctx: ActionContext<P>) => void | Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inferencebureau/apps-sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.7",
|
|
4
4
|
"description": "The SDK an Inference Bureau app's code imports: action helpers, metadata types, the records API client, React hooks with AutoTable and AutoForm, and a test harness for its actions.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"keywords": [
|