apps 0.0.1-beta.15 → 0.0.1-beta.16
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/framework-reference.json +1 -1
- package/js/{chunk-H34RQANV.js → chunk-CIUZ3HSV.js} +1 -1
- package/js/{chunk-4J3IQXFD.js → chunk-L2QHGLWF.js} +2 -2
- package/js/{chunk-YHLXXXKH.js → chunk-QAXLPXKL.js} +2 -2
- package/js/{chunk-GKHJITGG.js → chunk-S2HMUOAV.js} +1 -1
- package/js/{chunk-SWXGYMUW.js → chunk-TEFD5OBS.js} +50 -5
- package/js/{chunk-O5G3NDEO.js → chunk-TXFDBLWA.js} +1 -1
- package/js/{chunk-JAKBOQ5T.js → chunk-ZBGV4RN4.js} +3 -3
- package/js/effect.js +4 -4
- package/js/graphql.js +5 -5
- package/js/host.js +4 -4
- package/js/index.js +7 -3
- package/js/mcp/effect.js +6 -6
- package/js/mcp/stdio.js +6 -6
- package/js/mcp.js +7 -7
- package/js/openapi.js +3 -3
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/implementation/operations.d.ts +10 -0
- package/types/apps/src/implementation/router.d.ts +9 -0
- package/types/apps/src/index.d.ts +2 -2
|
@@ -79,8 +79,18 @@ export declare const operationOptions: <Input, Output>(options: OperationOptions
|
|
|
79
79
|
title?: string;
|
|
80
80
|
description?: string;
|
|
81
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Replace a native operation's approval. Property descriptors are copied so an output schema that
|
|
84
|
+
* a protocol adapter builds only when read stays lazy.
|
|
85
|
+
*/
|
|
86
|
+
export declare const approvedOperation: <Input, Native extends AppOperation<Input, unknown>>(operation: Native, approval: Approval<Input>) => Native;
|
|
82
87
|
/** Attach the same approval function to a generated or shared operation. */
|
|
83
88
|
export declare const withApproval: <Input, Output, Kind extends "query" | "mutation", Context>(operation: Operation<Input, Output, Kind, Context>, approval: Approval<Input>) => Operation<Input, Output, Kind, Context>;
|
|
89
|
+
/**
|
|
90
|
+
* The advisory hints an operation carries, such as an MCP server's `destructiveHint`. App code
|
|
91
|
+
* reads them to choose an approval; the framework never infers one from them.
|
|
92
|
+
*/
|
|
93
|
+
export declare const toolAnnotations: (operation: OperationDeclaration<"query" | "mutation", never>) => ToolAnnotations | undefined;
|
|
84
94
|
/** Read operation. External reads are allowed; only database writes are mechanically prohibited. */
|
|
85
95
|
export declare const query: <Input, Output, Context extends AppContext = QueryContext>(options: OperationOptions<Input, Output>, run: (context: Context, input: Input) => Promise<Output>) => Operation<Input, Output, "query", Context>;
|
|
86
96
|
/** Explicit write operation. Database writes roll back on failure; external effects cannot be undone. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HostedTool } from "../contracts/host.js";
|
|
2
2
|
import type { AppOperation } from "../contracts/operations.js";
|
|
3
3
|
import { RouterMeta, type AppRouter, type DynamicRouter, type RouterIcon } from "../contracts/router.js";
|
|
4
|
+
import type { Approval } from "../approval.js";
|
|
4
5
|
import { type OperationDeclaration, type RouterChild, type RouterDeclaration } from "./operations.js";
|
|
5
6
|
export type { RouterChild, RouterDeclaration } from "./operations.js";
|
|
6
7
|
/** Author metadata for a router. Instructions become a skill named after the router's path. */
|
|
@@ -57,3 +58,11 @@ export declare const declaredOperations: (root: AppRouter | undefined, path?: st
|
|
|
57
58
|
readonly router: string;
|
|
58
59
|
readonly operation: AppOperation;
|
|
59
60
|
}>;
|
|
61
|
+
/**
|
|
62
|
+
* Choose an approval for each operation a router contains, including tools a dynamic router
|
|
63
|
+
* resolves later. `policy` receives the operation and its name relative to this router; returning
|
|
64
|
+
* undefined keeps the operation's own approval. Read hints with `toolAnnotations(operation)`.
|
|
65
|
+
* Apply it to each account's router before `accountRouter` combines them, so every account keeps
|
|
66
|
+
* its own tools' hints.
|
|
67
|
+
*/
|
|
68
|
+
export declare const withApprovals: <Query, Mutation>(source: RouterDeclaration<Query, Mutation>, policy: (operation: OperationDeclaration<"query" | "mutation", never>, name: string) => Approval | undefined) => RouterDeclaration<Query, Mutation>;
|
|
@@ -17,7 +17,7 @@ export { type Fields, type Infer, type ObjectSchema, type ObjectValue, type Sche
|
|
|
17
17
|
export { type AccountCheckContext, type AccountCheckResult, type AccountInfo, type AccountOf, type AuthMethod, type AuthMethodData, type AuthMethods, type ManyAccounts, type Provider, type ReservedAuthorizationParam, } from "./contracts/provider.js";
|
|
18
18
|
export { defineProvider, type ProviderOptions } from "./implementation/provider.js";
|
|
19
19
|
export { accountRouter } from "./implementation/account-router.js";
|
|
20
|
-
export { router, dynamicRouter, type RouterDeclaration, type RouterChild, type RouterOptions, } from "./implementation/router.js";
|
|
20
|
+
export { router, dynamicRouter, withApprovals, type RouterDeclaration, type RouterChild, type RouterOptions, } from "./implementation/router.js";
|
|
21
21
|
export type { RouterIcon } from "./contracts/router.js";
|
|
22
22
|
export { dynamicSkills } from "./implementation/dynamic-skills.js";
|
|
23
23
|
export type { HostedTool as OperationDescription } from "./contracts/host.js";
|
|
@@ -72,7 +72,7 @@ export { NotImplemented } from "./contracts/app.js";
|
|
|
72
72
|
export { ElicitationFailed, type FormElicitation, type ElicitationResponse, type Elicit, } from "./contracts/elicitation.js";
|
|
73
73
|
export { table, defineDatabase, type Table, type DatabaseReader, type Database, type DatabaseDefinition, } from "./implementation/storage.js";
|
|
74
74
|
export { id, userId } from "./implementation/schema.js";
|
|
75
|
-
export { query, mutation, withApproval, type Operation, type OperationOptions, } from "./implementation/operations.js";
|
|
75
|
+
export { query, mutation, withApproval, toolAnnotations, type Operation, type OperationOptions, } from "./implementation/operations.js";
|
|
76
76
|
export type { OperationContext } from "./contracts/operations.js";
|
|
77
77
|
export { workflow, type Workflow, type WorkflowDeclaration } from "./implementation/workflows.js";
|
|
78
78
|
export { NonRetryableError, WorkflowFailure, type WorkflowContext, type WorkflowStepContext, type WorkflowStep, type WorkflowStepOptions, type WorkflowDuration, type WorkflowReads, type WorkflowControls, } from "./contracts/workflows.js";
|