apps 0.0.1-beta.37 → 0.0.1-beta.39
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-GHDZEEPO.js → chunk-27TDXHRX.js} +395 -82
- package/js/{chunk-KOOJUMLR.js → chunk-3MMG2H6M.js} +2 -2
- package/js/{chunk-LQBR7AI7.js → chunk-3V575NIW.js} +217 -19
- package/js/{chunk-U74JVKTQ.js → chunk-5NIEOXRZ.js} +7 -7
- package/js/{chunk-BWUHMKHQ.js → chunk-5TJA7364.js} +2 -2
- package/js/{chunk-7KEKFBV7.js → chunk-7CSHVXVR.js} +3 -3
- package/js/{chunk-3LRFKLUX.js → chunk-BO4US6DZ.js} +9 -49
- package/js/{chunk-A4O72Z3A.js → chunk-DKUEYTYD.js} +167 -30
- package/js/{chunk-ENJCQWVF.js → chunk-E4BWL7KQ.js} +3 -3
- package/js/{chunk-CAOHGMNW.js → chunk-F3TBO2U3.js} +7 -94
- package/js/{chunk-POOIHRPF.js → chunk-GHXRRFZA.js} +11 -34
- package/js/{chunk-RSNZDT4L.js → chunk-JTMDWPCH.js} +2 -2
- package/js/{chunk-YW333DH3.js → chunk-KANDIVIH.js} +4 -4
- package/js/{chunk-2FWXCU5I.js → chunk-KAQD3DTI.js} +1 -1
- package/js/{chunk-QQKHJ72Y.js → chunk-LVWX4UWK.js} +9 -9
- package/js/{chunk-KEZ4YZSP.js → chunk-MLHNVYHT.js} +2 -2
- package/js/{chunk-IJQ5LE74.js → chunk-MXDKXAY4.js} +363 -401
- package/js/{chunk-BI6R577B.js → chunk-P7MGDPFD.js} +2 -2
- package/js/{chunk-24EIFQYZ.js → chunk-PCV73KVK.js} +35 -10
- package/js/{chunk-JU7F4PRK.js → chunk-RIXVGVA6.js} +2 -2
- package/js/{chunk-D45FU4TZ.js → chunk-SDHD6J37.js} +3 -3
- package/js/{chunk-UCOMVHGW.js → chunk-U5PFZDVB.js} +2 -2
- package/js/{chunk-PHO7HXTC.js → chunk-VIU2XXA7.js} +294 -47
- package/js/{chunk-TADLIUEU.js → chunk-VJQXXOQ3.js} +2 -2
- package/js/{chunk-NHCFIWN5.js → chunk-W2NV54JD.js} +1 -1
- package/js/{chunk-BI45HZWM.js → chunk-YQ35E7KS.js} +1 -1
- package/js/{chunk-WDBUOIWV.js → chunk-ZUKBIHMK.js} +3 -3
- package/js/client.js +13 -17
- package/js/contracts.js +16 -21
- package/js/effect.js +19 -24
- package/js/graphql.js +21 -26
- package/js/host.js +19 -24
- package/js/index.js +13 -26
- package/js/mcp/effect.js +21 -26
- package/js/mcp/stdio.js +21 -26
- package/js/mcp.js +23 -28
- package/js/openapi.js +17 -21
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -7
- package/js/skills.js +15 -17
- package/js/storage/facet.js +1 -214
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +5 -6
- package/js/ui/serving.js +10 -11
- package/package.json +1 -2
- package/runtime.json +1 -1
- package/types/apps/src/contracts/app.d.ts +0 -2
- package/types/apps/src/contracts/context.d.ts +12 -11
- package/types/apps/src/contracts/host.d.ts +10 -8
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/operations.d.ts +3 -3
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/4.d.ts +3 -3
- package/types/apps/src/contracts/protocols/5.d.ts +1 -1
- package/types/apps/src/contracts/protocols/6.d.ts +1 -1
- package/types/apps/src/contracts/protocols/7.d.ts +1 -1
- package/types/apps/src/contracts/sql.d.ts +58 -0
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/implementation/openapi-compile.d.ts +2 -2
- package/types/apps/src/implementation/schema.d.ts +1 -10
- package/types/apps/src/implementation/sql.d.ts +66 -0
- package/types/apps/src/index.d.ts +1 -2
- package/types/telemetry/src/transport.d.ts +8 -1
- package/js/chunk-73AV3JVU.js +0 -186
- package/js/chunk-HDAQBRT5.js +0 -1254
- package/js/chunk-IU7CCCUC.js +0 -630
- package/js/chunk-NHUHTWAF.js +0 -0
- package/js/chunk-V5DWGYRK.js +0 -268
- package/js/chunk-Y3XN4X4Q.js +0 -19
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -18
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/storage.d.ts +0 -15
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { AppSkillSource, SkillFile } from "./skills.js";
|
|
2
|
-
import type { DatabaseDefinition } from "./storage.js";
|
|
3
2
|
/** Native app contracts; factories and handlers compose in the host's Effect runtime. */
|
|
4
3
|
import { type Effect, Schema } from "effect";
|
|
5
4
|
import type { OperationSchedule } from "./schedules.js";
|
|
@@ -58,7 +57,6 @@ export interface BoundContext<Slots extends AccountSlots> {
|
|
|
58
57
|
/** The host evaluates this factory fresh with the configured app's selected accounts. */
|
|
59
58
|
export interface App<Slots extends AccountSlots, Def extends AppDefinition<never>> {
|
|
60
59
|
readonly accounts: Slots;
|
|
61
|
-
readonly database?: DatabaseDefinition;
|
|
62
60
|
readonly evaluate: (context: BoundContext<Slots>) => Effect.Effect<Def, unknown>;
|
|
63
61
|
}
|
|
64
62
|
declare const NotImplemented_base: Schema.Class<NotImplemented, Schema.TaggedStruct<"NotImplemented", {
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
/** Public handler contexts derive capabilities from one shared requirements declaration. */
|
|
2
2
|
import type { WorkflowControls } from "./workflows.js";
|
|
3
3
|
import type { AccountSlots, BoundContext } from "./app.js";
|
|
4
|
-
import type {
|
|
5
|
-
/** Requirements are pure values; selected accounts and
|
|
4
|
+
import type { Sql, SqlReader } from "./sql.js";
|
|
5
|
+
/** Requirements are pure values; selected accounts and SQL access belong to invocations. */
|
|
6
6
|
export interface AppRequirements {
|
|
7
7
|
readonly accounts: AccountSlots;
|
|
8
|
-
readonly database?: DatabaseDefinition;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Every handler has `ctx.sql`. The app's database exists once the build has SQL files in
|
|
11
|
+
* `migrations/`; before that, any statement fails and says so.
|
|
12
|
+
*/
|
|
13
|
+
type StorageContext<Writable extends boolean> = {
|
|
14
|
+
readonly sql: Writable extends true ? Sql : SqlReader;
|
|
15
|
+
};
|
|
15
16
|
/** Context available during dynamic app evaluation; storage opens only for handlers. */
|
|
16
17
|
export type AppContext<Requirements extends AppRequirements = AppRequirements> = BoundContext<Requirements["accounts"]>;
|
|
17
18
|
/** Interactive query context; declared storage exposes only read methods. */
|
|
18
|
-
export type QueryContext<Requirements extends AppRequirements = AppRequirements> = AppContext<Requirements> & StorageContext<
|
|
19
|
-
/** Interactive mutation context;
|
|
19
|
+
export type QueryContext<Requirements extends AppRequirements = AppRequirements> = AppContext<Requirements> & StorageContext<false>;
|
|
20
|
+
/** Interactive mutation context; outside calls happen between SQL transactions, never inside one. */
|
|
20
21
|
export type MutationContext<Requirements extends AppRequirements = AppRequirements> = Omit<AppContext<Requirements>, "workflows"> & {
|
|
21
22
|
readonly workflows: WorkflowControls;
|
|
22
|
-
} & StorageContext<
|
|
23
|
+
} & StorageContext<true>;
|
|
23
24
|
/** Background webhook context has account and storage access without interactive input. */
|
|
24
25
|
export type WebhookContext<Requirements extends AppRequirements = AppRequirements> = Omit<MutationContext<Requirements>, "elicit">;
|
|
25
26
|
export {};
|
|
@@ -12,9 +12,9 @@ import { DatabaseFieldReserved, DatabaseLimitExceeded } from "../../../app-data/
|
|
|
12
12
|
export { DatabaseFieldReserved, DatabaseLimitExceeded } from "../../../app-data/src/contracts/database.js";
|
|
13
13
|
/** Portable framework dispatch contracts. Requests never carry account bindings. */
|
|
14
14
|
import { Context, Schema, type Effect, type Redacted } from "effect";
|
|
15
|
-
import type {
|
|
15
|
+
import type { AppSqlStorage } from "./sql.js";
|
|
16
16
|
import type { InvocationTelemetry } from "../../../telemetry/src/index.js";
|
|
17
|
-
export {
|
|
17
|
+
export { type AppSqlStorage, type Sql, type SqlCursor, type SqlReader, type SqlRow, type SqlValue, } from "./sql.js";
|
|
18
18
|
import { ElicitationFailed, type ElicitationHandler } from "./elicitation.js";
|
|
19
19
|
export { ElicitationLimits, defaultElicitationLimits, FormElicitation, ElicitationResponse, ElicitationReply, ElicitationFailed, type ElicitationHandler, ApprovalElicitation, ApprovalResponse, approvalElicitation, } from "./elicitation.js";
|
|
20
20
|
export { McpClientLimits, defaultMcpClientLimits } from "./mcp.js";
|
|
@@ -35,15 +35,16 @@ export { protocol6 } from "./protocols/6.js";
|
|
|
35
35
|
export { protocol7, AccountCheckCommand, CredentialHost } from "./protocols/7.js";
|
|
36
36
|
export { protocol8 } from "./protocols/8.js";
|
|
37
37
|
export { protocol9 } from "./protocols/9.js";
|
|
38
|
+
export { protocol10, MigrateCommand, MigrateResult } from "./protocols/10.js";
|
|
38
39
|
export { AccountCheckResult, AccountInfo } from "./provider.js";
|
|
39
|
-
import { HostAccountsInvalid, HostDeclarationInvalid, HostEvaluationFailed, HostInputInvalid, HostKindMismatch, HostOperationFailed, HostOperationNotFound, HostOutputInvalid, HostRequestInvalid, HostToolApprovalRequired, HostToolBlocked, HostToolNotFound, HostToolPolicyFailed, McpError, SkillLoadFailed, SkillSources, type InvocationDeadline, ResolvedAccounts, type SkillCatalogResponse, type TrustedToolApproval } from "./protocols/
|
|
40
|
-
export { DeclaredRequirements, HostRequest } from "./protocols/
|
|
40
|
+
import { HostAccountsInvalid, HostDeclarationInvalid, HostEvaluationFailed, HostInputInvalid, HostKindMismatch, HostOperationFailed, HostOperationNotFound, HostOutputInvalid, HostRequestInvalid, HostToolApprovalRequired, HostToolBlocked, HostToolNotFound, HostToolPolicyFailed, McpError, SkillLoadFailed, SkillSources, type InvocationDeadline, ResolvedAccounts, type SkillCatalogResponse, type TrustedToolApproval } from "./protocols/10.js";
|
|
41
|
+
export { DeclaredRequirements, HostRequest } from "./protocols/10.js";
|
|
41
42
|
/**
|
|
42
43
|
* The MCP and skill loader failures as they cross the host boundary. Apps throw the author-facing
|
|
43
44
|
* classes from `apps/mcp` and `apps/skills`.
|
|
44
45
|
*/
|
|
45
|
-
export { McpError, SkillLoadFailed } from "./protocols/
|
|
46
|
-
export { DeclaredAuthMethod, DeclaredProvider, ResolvedAccount, ResolvedAccounts, TrustedToolApproval, InvocationDeadline, HostedTool, HostedToolSummary, HostRouterError, HostedRouter, HostedCatalog, HostedCatalogSummary, SkillSources, SkillCatalogResponse, HostRequestInvalid, HostAccountsInvalid, HostDeclarationInvalid, HostEvaluationFailed, HostOperationNotFound, HostOperationFailed, HostToolNotFound, HostKindMismatch, InputProblem, maxInputProblems, HostInputInvalid, HostToolBlocked, HostToolApprovalRequired, HostToolPolicyFailed, HostOutputInvalid, HostError, HostResponse, HostInvocation, } from "./protocols/
|
|
46
|
+
export { McpError, SkillLoadFailed } from "./protocols/10.js";
|
|
47
|
+
export { DeclaredAuthMethod, DeclaredProvider, ResolvedAccount, ResolvedAccounts, TrustedToolApproval, InvocationDeadline, HostedTool, HostedToolSummary, HostRouterError, HostedRouter, HostedCatalog, HostedCatalogSummary, SkillSources, SkillCatalogResponse, HostRequestInvalid, HostAccountsInvalid, HostDeclarationInvalid, HostEvaluationFailed, HostOperationNotFound, HostOperationFailed, HostToolNotFound, HostKindMismatch, InputProblem, maxInputProblems, HostInputInvalid, HostToolBlocked, HostToolApprovalRequired, HostToolPolicyFailed, HostOutputInvalid, HostError, HostResponse, HostInvocation, } from "./protocols/10.js";
|
|
47
48
|
/** Raw host inputs; the host boundary parses and redacts these immediately. */
|
|
48
49
|
export type ResolvedAccountsInput = typeof ResolvedAccounts.Encoded;
|
|
49
50
|
/** Trusted invocation context, supplied separately from the Request. */
|
|
@@ -62,7 +63,8 @@ export interface HostContext {
|
|
|
62
63
|
/** Trusted in-process tracing capability; never decoded from a public request. */
|
|
63
64
|
readonly telemetry?: InvocationTelemetry;
|
|
64
65
|
readonly approval?: TrustedToolApproval;
|
|
65
|
-
|
|
66
|
+
/** The data facet's SQLite storage, for apps that declare `sql`. Never exposed to app code. */
|
|
67
|
+
readonly storage?: AppSqlStorage;
|
|
66
68
|
readonly accounts: Redacted.Redacted<ResolvedAccounts>;
|
|
67
69
|
}
|
|
68
70
|
/** Skill commands. Send sources only to builds that declare skillSources. */
|
|
@@ -99,7 +101,7 @@ export declare const selectTools: (tools?: readonly string[]) => <A extends {
|
|
|
99
101
|
}[];
|
|
100
102
|
}>(catalog: A) => A;
|
|
101
103
|
/** Declaration reads do not bind accounts or evaluate the app factory. A named declaration
|
|
102
|
-
* problem
|
|
104
|
+
* problem is reported so the deploy can explain it. */
|
|
103
105
|
export declare const HostRequirementsError: Schema.Union<readonly [typeof HostRequestInvalid, typeof HostDeclarationInvalid, typeof DatabaseFieldReserved]>;
|
|
104
106
|
/** Inspection can fail while binding accounts or evaluating the live definition. */
|
|
105
107
|
export declare const HostInspectError: Schema.Union<readonly [typeof ProviderError, typeof McpError, typeof SkillLoadFailed, typeof HostRequestInvalid, typeof HostDeclarationInvalid, typeof HostAccountsInvalid, typeof HostEvaluationFailed]>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/** Browser subscription contracts contain no executable server declarations. */
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
import type { JsonValue } from "./schema.js";
|
|
4
|
+
/** Names of authored operations. */
|
|
5
|
+
export declare const OperationName: Schema.NonEmptyString;
|
|
4
6
|
/** Serializable named reference; the phantom field is never populated at runtime. */
|
|
5
7
|
export interface OperationReference<Input, Output, Kind extends "query" | "mutation"> {
|
|
6
8
|
readonly name: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/** Native operation declarations.
|
|
1
|
+
/** Native operation declarations. SQL access is an optional invocation capability. */
|
|
2
2
|
import type { Effect, Schema } from "effect";
|
|
3
3
|
import type { Approval } from "./approval.js";
|
|
4
4
|
import type { BoundContext, AccountSlots } from "./app.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { Sql, SqlReader } from "./sql.js";
|
|
6
6
|
import type { ToolAnnotations } from "./tools.js";
|
|
7
7
|
import type { JsonObject } from "./schema.js";
|
|
8
8
|
/** Host-bound operation capabilities; the author declaration refines accounts and storage. */
|
|
9
9
|
export type OperationContext = BoundContext<AccountSlots> & {
|
|
10
|
-
readonly
|
|
10
|
+
readonly sql?: SqlReader | Sql;
|
|
11
11
|
};
|
|
12
12
|
/** The host validates input, checks approval, then owns the transaction and output validation. */
|
|
13
13
|
export interface AppOperation<Input = unknown, Output = unknown> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The host protocol this framework speaks. It is written into `runtime.json` and every host
|
|
3
|
-
* snapshot. Released protocols are frozen: see `protocols/
|
|
3
|
+
* snapshot. Released protocols are frozen: see `protocols/10.ts` and notes/apps-publishing.md.
|
|
4
4
|
* This file has no imports so the package build script can read it directly.
|
|
5
5
|
*/
|
|
6
|
-
export declare const frameworkProtocol =
|
|
6
|
+
export declare const frameworkProtocol = 10;
|