apps 0.0.1-beta.117 → 0.0.1-beta.119

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 (48) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-74H25C4X.js → chunk-3KNB4HRA.js} +3 -3
  3. package/js/{chunk-ACQXVKVQ.js → chunk-5TYZML5C.js} +1 -1
  4. package/js/{chunk-OWN3DP2W.js → chunk-CCJUTN55.js} +1 -1
  5. package/js/{chunk-VAI3EVCS.js → chunk-DA6RXOMJ.js} +2 -2
  6. package/js/{chunk-YDW7DX3A.js → chunk-EAPSQBFN.js} +2 -2
  7. package/js/{chunk-OIMMQRYE.js → chunk-EPHGO53W.js} +14 -10
  8. package/js/{chunk-4PIQKACY.js → chunk-EPZ3P7IX.js} +2 -2
  9. package/js/{chunk-2RGJMA7N.js → chunk-F4CV5TQJ.js} +4 -4
  10. package/js/{chunk-4EOLLVQ6.js → chunk-GPWOAH4M.js} +10 -10
  11. package/js/{chunk-ES6QUAAC.js → chunk-HFZBYCHQ.js} +6 -6
  12. package/js/{chunk-6A6P5TYV.js → chunk-JEDUDIPK.js} +56 -52
  13. package/js/{chunk-OSVCX4MV.js → chunk-JYHMBE45.js} +13 -13
  14. package/js/{chunk-4X2UI4R2.js → chunk-KJW5IPM4.js} +1 -1
  15. package/js/{chunk-62NVUKED.js → chunk-MJUHAHDG.js} +2 -2
  16. package/js/{chunk-7HG422GB.js → chunk-NCOPALJZ.js} +1 -1
  17. package/js/{chunk-KLSEU35Y.js → chunk-QUFLMMTG.js} +1 -1
  18. package/js/{chunk-PBGPES67.js → chunk-SO33LZ7J.js} +2 -2
  19. package/js/{chunk-OIH73VFM.js → chunk-SPGGRZ5K.js} +4 -4
  20. package/js/{chunk-ZKDXML77.js → chunk-U2GHFWX2.js} +18 -0
  21. package/js/{chunk-URKOTNDA.js → chunk-VATGZDJK.js} +13 -7
  22. package/js/{chunk-SXQVVXJE.js → chunk-VC7IINQX.js} +20 -8
  23. package/js/{chunk-UPTAFF6L.js → chunk-VKYKMAV3.js} +6 -6
  24. package/js/{chunk-DILSCQPJ.js → chunk-VXBCDIWD.js} +2 -2
  25. package/js/{chunk-HLMJBE4T.js → chunk-XR5CO3XR.js} +3 -3
  26. package/js/{chunk-GFRK2I3S.js → chunk-Z2TCKZKF.js} +2 -2
  27. package/js/client.js +10 -10
  28. package/js/contracts.js +7 -7
  29. package/js/effect.js +18 -18
  30. package/js/graphql.js +20 -20
  31. package/js/host.js +18 -18
  32. package/js/index.js +13 -13
  33. package/js/mcp/effect.js +19 -19
  34. package/js/mcp.js +21 -21
  35. package/js/openapi.js +28 -23
  36. package/js/react.js +2 -2
  37. package/js/skills/effect.js +6 -6
  38. package/js/skills.js +29 -17
  39. package/js/ui/auth/contracts.js +2 -2
  40. package/js/ui/auth.js +5 -5
  41. package/js/ui/contracts.js +5 -5
  42. package/js/ui/serving.js +24 -22
  43. package/package.json +1 -1
  44. package/runtime.json +1 -1
  45. package/types/apps/src/implementation/router-catalog.d.ts +8 -89
  46. package/types/apps/src/implementation/ui-serving.d.ts +13 -4
  47. package/types/apps/src/ui-serving.d.ts +1 -2
  48. package/types/apps/src/implementation/ui-watch.d.ts +0 -2
@@ -3,7 +3,7 @@
3
3
  * is reported on its own entry; the root failing fails the read, as a single-source app would.
4
4
  */
5
5
  import { Effect, Schema } from "effect";
6
- import { HostDeclarationInvalid, HostEvaluationFailed, type HostRouterError } from "../contracts/host.js";
6
+ import { HostDeclarationInvalid, HostEvaluationFailed, HostedRouter, HostedTool, HostedToolSummary, type HostRouterError } from "../contracts/host.js";
7
7
  import type { AppOperation } from "../contracts/operations.js";
8
8
  import type { AppRouter, DynamicRouter, RouterMeta } from "../contracts/router.js";
9
9
  import type { OperationSchedule } from "../contracts/schedules.js";
@@ -103,6 +103,11 @@ export declare const operationDescription: (name: string, router: string, operat
103
103
  * Upstream names can contain dots, which static router keys cannot.
104
104
  */
105
105
  export declare const fixedRouter: (operations: Readonly<Record<string, AppOperation>>, meta?: RouterMeta) => DynamicRouter;
106
+ /** Tools and routers of a catalog, or of part of one, in router order. */
107
+ interface Catalog {
108
+ readonly tools: ReadonlyArray<HostedTool | HostedToolSummary>;
109
+ readonly routers: ReadonlyArray<HostedRouter>;
110
+ }
106
111
  export interface CatalogOptions {
107
112
  /** Omit schemas. */
108
113
  readonly summary: boolean;
@@ -122,94 +127,7 @@ export interface CatalogOptions {
122
127
  * Read a router tree. Every nested router is listed, for grouping; the root only when it has
123
128
  * metadata. A nested dynamic source that fails is reported on its router's entry.
124
129
  */
125
- export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined, options: CatalogOptions) => Effect.Effect<{
126
- tools: ({
127
- readonly description: string;
128
- readonly name: string;
129
- readonly inputSchema: {
130
- readonly [x: string]: Schema.Json;
131
- };
132
- readonly _meta?: {
133
- readonly [x: string]: Schema.Json;
134
- };
135
- readonly router?: string;
136
- readonly title?: string;
137
- readonly annotations?: {
138
- readonly title?: string;
139
- readonly readOnlyHint?: boolean;
140
- readonly destructiveHint?: boolean;
141
- readonly idempotentHint?: boolean;
142
- readonly openWorldHint?: boolean;
143
- };
144
- readonly outputSchema?: {
145
- readonly [x: string]: Schema.Json;
146
- };
147
- readonly schedules?: readonly {
148
- readonly name: string;
149
- readonly timing: {
150
- readonly kind: "interval";
151
- readonly milliseconds: number;
152
- } | {
153
- readonly kind: "cron";
154
- readonly calendar: {
155
- readonly expression: string;
156
- readonly timezone: string;
157
- };
158
- };
159
- readonly input: Schema.Json;
160
- readonly scope?: "app";
161
- }[];
162
- readonly readOnly?: boolean;
163
- readonly tags?: readonly string[];
164
- readonly kindConfirmed?: boolean;
165
- } | {
166
- readonly description: string;
167
- readonly name: string;
168
- readonly router?: string;
169
- readonly title?: string;
170
- readonly annotations?: {
171
- readonly title?: string;
172
- readonly readOnlyHint?: boolean;
173
- readonly destructiveHint?: boolean;
174
- readonly idempotentHint?: boolean;
175
- readonly openWorldHint?: boolean;
176
- };
177
- readonly schedules?: readonly {
178
- readonly name: string;
179
- readonly timing: {
180
- readonly kind: "interval";
181
- readonly milliseconds: number;
182
- } | {
183
- readonly kind: "cron";
184
- readonly calendar: {
185
- readonly expression: string;
186
- readonly timezone: string;
187
- };
188
- };
189
- readonly input: Schema.Json;
190
- readonly scope?: "app";
191
- }[];
192
- readonly readOnly?: boolean;
193
- readonly tags?: readonly string[];
194
- readonly kindConfirmed?: boolean;
195
- })[];
196
- routers: {
197
- readonly path: string;
198
- readonly description?: string;
199
- readonly error?: import("../index.js").ProviderError | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed;
200
- readonly title?: string;
201
- readonly icons?: readonly {
202
- readonly src: string;
203
- readonly mimeType?: string;
204
- readonly sizes?: readonly string[];
205
- readonly theme?: "light" | "dark";
206
- }[];
207
- readonly tags?: {
208
- readonly [x: string]: string;
209
- };
210
- readonly skill?: string;
211
- }[];
212
- }, import("../index.js").ProviderError | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed, never>;
130
+ export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined, options: CatalogOptions) => Effect.Effect<Catalog, import("../index.js").ProviderError | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed, never>;
213
131
  /**
214
132
  * One skill for each router with instructions. Skills and tools fail independently: a dynamic
215
133
  * router whose metadata cannot be read, including the root, contributes no skill and does not
@@ -229,3 +147,4 @@ export declare const routerSkills: (root: AppRouter | DynamicRouter | undefined)
229
147
  };
230
148
  readonly "allowed-tools"?: string;
231
149
  }[], never, never>;
150
+ export {};
@@ -2,17 +2,26 @@ import { Effect, Option, Stream } from "effect";
2
2
  import { HttpServerRequest, HttpServerResponse } from "effect/http";
3
3
  import { UiFailed, UiForbidden, type AppUiAsset, type AppUiRange, type AppUiStoredFile, type UiAccountNotice } from "../contracts/ui.js";
4
4
  /**
5
- * Render an authorized version with a host-owned version watcher. Account problems that stop
6
- * the app replace its document with a page that links to their fix; others add a dismissible card.
5
+ * The version's public file a page path names, or a 404 for a missing file. `None` means the path
6
+ * is the page itself. Hosts answer files before the page's account and usage work, which a file
7
+ * needs none of.
8
+ */
9
+ export declare const appFile: <E, R>(options: {
10
+ readonly origin: string;
11
+ readonly asset: (path: string) => Effect.Effect<AppUiAsset | undefined, E, R>;
12
+ }) => Effect.Effect<Option.None<HttpServerResponse.HttpServerResponse> | Option.Some<HttpServerResponse.HttpServerResponse>, UiFailed | UiForbidden | E, HttpServerRequest.HttpServerRequest | R>;
13
+ /**
14
+ * Render an authorized version with a host-owned version watcher, for a path `appFile` left to
15
+ * the page. Account problems that stop the app replace its document with a page that links to
16
+ * their fix; others add a dismissible card.
7
17
  */
8
18
  export declare const appDocument: <E, R>(options: {
9
19
  readonly version: string;
10
20
  /** The account IDs the page runs with, by requirement. */
11
21
  readonly accountIds?: Readonly<Record<string, readonly string[]>> | undefined;
12
- readonly origin: string;
13
22
  readonly accounts?: UiAccountNotice | undefined;
14
23
  readonly asset: (path: string) => Effect.Effect<AppUiAsset | undefined, E, R>;
15
- }) => Effect.Effect<HttpServerResponse.HttpServerResponse, UiFailed | UiForbidden | E, HttpServerRequest.HttpServerRequest | R>;
24
+ }) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>;
16
25
  /**
17
26
  * A version's public file, read from the host's store. The version lists it, so bytes that
18
27
  * are gone are a storage fault, never a missing page.
@@ -1,3 +1,2 @@
1
1
  /** Host-only rendering utilities; the host supplies authorized retained assets. */
2
- export { appDocument, appAsset, assetPath, storedAppFile } from "./implementation/ui-serving.js";
3
- export { appWatchScript } from "./implementation/ui-watch.js";
2
+ export { appDocument, appAsset, appFile, assetPath, storedAppFile, } from "./implementation/ui-serving.js";
@@ -1,2 +0,0 @@
1
- /** Dependency-free browser source served by each host after app authorization. */
2
- export declare const appWatchScript = "\"use strict\";(()=>{var c=()=>{let s=document.getElementById(\"executor-context\")?.textContent;if(!s)return;let n=JSON.parse(s);if(typeof n!=\"object\"||n===null||!(\"version\"in n))return;let r=n.version;if(typeof r!=\"string\"||r.length===0)return;let t=new EventSource(\"/_executor/version\"),d=!1,o=()=>{d||(d=!0,t.close(),location.reload())};t.addEventListener(\"version\",i=>{let e=JSON.parse(i.data);typeof e==\"object\"&&e!==null&&\"version\"in e&&(e.version===null||typeof e.version==\"string\")&&e.version!==r&&o()}),t.addEventListener(\"revoked\",o),window.addEventListener(\"executor:deployment-changed\",o),window.addEventListener(\"pagehide\",()=>t.close(),{once:!0}),window.addEventListener(\"pageshow\",i=>{i.persisted&&o()})};c();})();";