apps 0.0.1-beta.75 → 0.0.1-beta.76
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-RUP4JMKO.js → chunk-A5JIYK7N.js} +141 -14
- package/js/{chunk-MHB7IFG7.js → chunk-BPROQMUB.js} +1 -1
- package/js/{chunk-2QWOG4UJ.js → chunk-D3EM6XUC.js} +3 -3
- package/js/{chunk-PZ535RJX.js → chunk-DFPNS3O3.js} +2 -2
- package/js/{chunk-JSWN4D6V.js → chunk-DV6PXM42.js} +3 -3
- package/js/{chunk-F2OAC6GE.js → chunk-EAVF4IPZ.js} +1 -1
- package/js/{chunk-TSPJFGA6.js → chunk-GLPG3W7P.js} +4 -4
- package/js/{chunk-UCQBJUA5.js → chunk-JREDSVGB.js} +24 -107
- package/js/{chunk-OABWTKGG.js → chunk-L5OGF662.js} +2 -2
- package/js/{chunk-AE45SVBH.js → chunk-PKFTT3HW.js} +5 -5
- package/js/{chunk-7LMU3ER3.js → chunk-Q4IZAUIF.js} +13 -2
- package/js/{chunk-ECCWT5GJ.js → chunk-SNLZ5SUI.js} +65 -24
- package/js/{chunk-ZR7QAG67.js → chunk-ZHHWNWV3.js} +1 -1
- package/js/contracts.js +2 -2
- package/js/effect.js +9 -9
- package/js/graphql.js +11 -11
- package/js/host.js +9 -9
- package/js/index.js +5 -5
- package/js/mcp/effect.js +11 -11
- package/js/mcp/stdio.js +11 -11
- package/js/mcp.js +13 -13
- package/js/openapi.js +7 -7
- package/js/skills.js +5 -5
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +16 -0
- package/types/app-cache/src/index.d.ts +18 -0
- package/types/apps/src/contracts/protocols/current.d.ts +1 -0
- package/types/apps/src/implementation/cache.d.ts +24 -1
|
@@ -48,6 +48,17 @@ export declare const CacheAcquired: Schema.Struct<{
|
|
|
48
48
|
readonly staleUntil: Schema.Finite;
|
|
49
49
|
}>>;
|
|
50
50
|
readonly lease: Schema.NullOr<Schema.String>;
|
|
51
|
+
/**
|
|
52
|
+
* The entries of the command's `reads`, in order, read in the same transaction as `entry`.
|
|
53
|
+
* Absent when the store did not read them: a store that predates them, or reads past the
|
|
54
|
+
* batch byte bound. The caller then reads them with a separate `read`.
|
|
55
|
+
*/
|
|
56
|
+
readonly reads: Schema.optionalKey<Schema.$Array<Schema.NullOr<Schema.Struct<{
|
|
57
|
+
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
58
|
+
readonly version: Schema.String;
|
|
59
|
+
readonly freshUntil: Schema.Finite;
|
|
60
|
+
readonly staleUntil: Schema.Finite;
|
|
61
|
+
}>>>>;
|
|
51
62
|
}>;
|
|
52
63
|
/**
|
|
53
64
|
* Publication requires the lease acquired against the previously observed version.
|
|
@@ -64,6 +75,11 @@ export declare const CacheCommand: Schema.Union<readonly [Schema.Struct<{
|
|
|
64
75
|
readonly refresh: Schema.Boolean;
|
|
65
76
|
/** Claim only while the entry still has this version. Absent accepts the current one. */
|
|
66
77
|
readonly version: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
78
|
+
/**
|
|
79
|
+
* Other keys to read in the same transaction, as `read` would, so a caller that needs them
|
|
80
|
+
* beside the entry makes one round trip. Reading them claims and changes nothing.
|
|
81
|
+
*/
|
|
82
|
+
readonly reads: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
67
83
|
}>, Schema.Struct<{
|
|
68
84
|
readonly operation: Schema.Literal<"claim">;
|
|
69
85
|
readonly key: Schema.String;
|
|
@@ -41,6 +41,23 @@ deadline?: number) => {
|
|
|
41
41
|
* or wait for the lease owner.
|
|
42
42
|
*/
|
|
43
43
|
get: <A>(options: CacheGet<A>) => Effect.Effect<A, unknown, never>;
|
|
44
|
+
/**
|
|
45
|
+
* `get`, also reading the keys of this scope that `keys` names in the same round trip. `keys`
|
|
46
|
+
* gets the entry's store key, which is unique to this scope and key, so a caller can remember
|
|
47
|
+
* what it read under it. `reads` holds their entries, undecoded and in order, when the value
|
|
48
|
+
* was read from the store; it is undefined when the value was loaded or the store did not read
|
|
49
|
+
* them, and the caller then reads what it still needs.
|
|
50
|
+
*/
|
|
51
|
+
getWith: <A>(options: CacheGet<A>, keys: (key: string) => readonly Schema.Json[]) => Effect.Effect<{
|
|
52
|
+
value: A;
|
|
53
|
+
key: string;
|
|
54
|
+
reads: readonly ({
|
|
55
|
+
readonly value: Schema.Json;
|
|
56
|
+
readonly version: string;
|
|
57
|
+
readonly freshUntil: number;
|
|
58
|
+
readonly staleUntil: number;
|
|
59
|
+
} | null)[] | undefined;
|
|
60
|
+
}, unknown, never>;
|
|
44
61
|
/** Force one awaited refresh without removing the retained value. Concurrent refreshes share a load. */
|
|
45
62
|
revalidate: <A>(options: CacheGet<A>) => Effect.Effect<A, unknown, never>;
|
|
46
63
|
};
|
|
@@ -60,6 +77,7 @@ export declare const holdLeases: (transport: CacheTransport) => Effect.Effect<{
|
|
|
60
77
|
readonly key: string;
|
|
61
78
|
readonly refresh: boolean;
|
|
62
79
|
readonly version?: string | null;
|
|
80
|
+
readonly reads?: readonly string[];
|
|
63
81
|
} | {
|
|
64
82
|
readonly operation: "claim";
|
|
65
83
|
readonly key: string;
|
|
@@ -3382,6 +3382,7 @@ export declare const current: {
|
|
|
3382
3382
|
readonly key: Schema.String;
|
|
3383
3383
|
readonly refresh: Schema.Boolean;
|
|
3384
3384
|
readonly version: Schema.optionalKey<Schema.NullOr<Schema.String>>;
|
|
3385
|
+
readonly reads: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
3385
3386
|
}>, Schema.Struct<{
|
|
3386
3387
|
readonly operation: Schema.Literal<"claim">;
|
|
3387
3388
|
readonly key: Schema.String;
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
/** Bind the portable Effect cache to an app invocation's author API. */
|
|
2
2
|
import { type Context } from "effect";
|
|
3
|
-
import type { AppCache, HostCache } from "../contracts/cache.js";
|
|
3
|
+
import type { AppCache, CacheGetOptions, HostCache } from "../contracts/cache.js";
|
|
4
4
|
import type { ResolvedAccounts } from "../contracts/host.js";
|
|
5
|
+
import type { JsonValue } from "../contracts/schema.js";
|
|
6
|
+
/**
|
|
7
|
+
* Framework-only: `get` that also reads other keys of the same scope in its round trip to the
|
|
8
|
+
* store. Authored code never sees it; framework helpers use it when a cache provides it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getWithReads: unique symbol;
|
|
11
|
+
/**
|
|
12
|
+
* A `get` value, the store key it was read under, and the stored values of the other keys when
|
|
13
|
+
* the value was read from the store. The values are not decoded: the caller decodes only those it
|
|
14
|
+
* uses. A key with no value reads `undefined`.
|
|
15
|
+
*/
|
|
16
|
+
export interface GetWithReads<A> {
|
|
17
|
+
readonly value: A;
|
|
18
|
+
/** The entry's store key, unique to the cache's scope and the key. */
|
|
19
|
+
readonly key: string;
|
|
20
|
+
/** Undefined when the value was loaded or the store did not read them: read them separately. */
|
|
21
|
+
readonly reads: readonly unknown[] | undefined;
|
|
22
|
+
}
|
|
23
|
+
/** The framework-only `get` an app's cache provides beside the author API. */
|
|
24
|
+
export type CacheWithReads = AppCache & {
|
|
25
|
+
/** `keys` gets the entry's store key and names the other keys to read with it. */
|
|
26
|
+
readonly [getWithReads]?: <A>(options: CacheGetOptions<A>, keys: (key: string) => readonly JsonValue[]) => Promise<GetWithReads<A>>;
|
|
27
|
+
};
|
|
5
28
|
/** Missing host support is explicit on use; ordinary apps do not need cache support. */
|
|
6
29
|
export declare const unavailableCache: HostCache;
|
|
7
30
|
/** Account scopes are derived from trusted current bindings. Loaders get a fresh owned HTTP signal. */
|