apps 0.0.1-beta.5 → 0.0.1-beta.55

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 (188) hide show
  1. package/README.md +68 -44
  2. package/framework-reference.json +1 -1
  3. package/js/chunk-47F7VXST.js +221 -0
  4. package/js/chunk-5FHWNLCI.js +88 -0
  5. package/js/{chunk-M3B3DE4K.js → chunk-74YVXBKY.js} +463 -218
  6. package/js/chunk-7UUHJR2Q.js +49 -0
  7. package/js/{chunk-CYYBFC2K.js → chunk-AQU56EPI.js} +9 -5
  8. package/js/chunk-BTSIG4NQ.js +1885 -0
  9. package/js/chunk-CDXQDN7W.js +92 -0
  10. package/js/{chunk-UK573G7W.js → chunk-EOPQ727L.js} +87 -51
  11. package/js/{chunk-27F7W2LG.js → chunk-H2CJWXA3.js} +2 -2
  12. package/js/{chunk-JU7VHODU.js → chunk-H72MEDMN.js} +65 -10
  13. package/js/{chunk-CDL5PM2Q.js → chunk-IFJU5SYQ.js} +19082 -18402
  14. package/js/{chunk-UDDE5KOR.js → chunk-JK5S2N2S.js} +148 -34
  15. package/js/{chunk-RJDDBDSN.js → chunk-JM7LOD2W.js} +628 -85
  16. package/js/{chunk-VFZKSM3T.js → chunk-JPEUKEV4.js} +3 -3
  17. package/js/{chunk-FWQC6I3C.js → chunk-KGCTYL2S.js} +523 -63
  18. package/js/{chunk-KUMBKVJD.js → chunk-KLYSEHUD.js} +2 -2
  19. package/js/chunk-L4K2K22P.js +42 -0
  20. package/js/chunk-LTDHQJ2Z.js +171 -0
  21. package/js/chunk-MWKHKOTL.js +240 -0
  22. package/js/chunk-OD3KFKZD.js +1617 -0
  23. package/js/{chunk-57RKNWL2.js → chunk-PD6I2SDG.js} +4 -4
  24. package/js/chunk-PXXZ6ABC.js +266 -0
  25. package/js/chunk-QEBRH5AP.js +729 -0
  26. package/js/chunk-TLWLJ7PD.js +4342 -0
  27. package/js/{chunk-IJX4CYZO.js → chunk-TUMGL2OC.js} +228 -264
  28. package/js/{chunk-XHO2ZX6W.js → chunk-UM62MBJQ.js} +96 -41
  29. package/js/{chunk-IPI4MFSN.js → chunk-XBG7HHXC.js} +2 -2
  30. package/js/chunk-XCSG7FT7.js +340 -0
  31. package/js/client.js +142 -94
  32. package/js/contracts.js +123 -33
  33. package/js/effect.js +19 -21
  34. package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
  35. package/js/graphql.js +63 -60
  36. package/js/host.js +83 -60
  37. package/js/index.js +262 -222
  38. package/js/mcp/effect.js +23 -23
  39. package/js/mcp/stdio.js +48 -40
  40. package/js/mcp.js +109 -72
  41. package/js/openapi.js +4129 -1419
  42. package/js/react.js +2 -3
  43. package/js/skills/effect.js +6 -3
  44. package/js/skills.js +208 -82
  45. package/js/storage/facet.js +1 -540
  46. package/js/ui/auth/contracts.js +2 -2
  47. package/js/ui/auth.js +5 -5
  48. package/js/ui/contracts.js +5 -4
  49. package/js/ui/serving.js +8517 -214
  50. package/package.json +2 -3
  51. package/runtime.json +1 -1
  52. package/types/app-cache/src/index.d.ts +10 -1
  53. package/types/apps/src/contracts/api-response-error.d.ts +4 -0
  54. package/types/apps/src/contracts/app.d.ts +9 -8
  55. package/types/apps/src/contracts/cache.d.ts +20 -0
  56. package/types/apps/src/contracts/context.d.ts +19 -11
  57. package/types/apps/src/contracts/elicitation.d.ts +6 -6
  58. package/types/apps/src/contracts/events.d.ts +93 -0
  59. package/types/apps/src/contracts/failure.d.ts +30 -1
  60. package/types/apps/src/contracts/graphql.d.ts +2 -1
  61. package/types/apps/src/contracts/host.d.ts +57 -18
  62. package/types/apps/src/contracts/live.d.ts +2 -0
  63. package/types/apps/src/contracts/mcp.d.ts +96 -10
  64. package/types/apps/src/contracts/network.d.ts +84 -0
  65. package/types/apps/src/contracts/openapi-compile.d.ts +32 -3
  66. package/types/apps/src/contracts/openapi.d.ts +45 -9
  67. package/types/apps/src/contracts/operations.d.ts +8 -9
  68. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  69. package/types/apps/src/contracts/protocols/1.d.ts +733 -81
  70. package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
  71. package/types/apps/src/contracts/protocols/2.d.ts +69 -26
  72. package/types/apps/src/contracts/protocols/3.d.ts +133 -33
  73. package/types/apps/src/contracts/protocols/4.d.ts +1306 -0
  74. package/types/apps/src/contracts/protocols/5.d.ts +1200 -0
  75. package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
  76. package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
  77. package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
  78. package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
  79. package/types/apps/src/contracts/protocols/current.d.ts +2476 -0
  80. package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
  81. package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
  82. package/types/apps/src/contracts/provider-error.d.ts +9 -0
  83. package/types/apps/src/contracts/provider.d.ts +115 -10
  84. package/types/apps/src/contracts/router.d.ts +59 -0
  85. package/types/apps/src/contracts/skills.d.ts +50 -13
  86. package/types/apps/src/contracts/sql.d.ts +58 -0
  87. package/types/apps/src/contracts/ui.d.ts +19 -1
  88. package/types/apps/src/contracts/workflows.d.ts +6 -0
  89. package/types/apps/src/facet.d.ts +4 -5
  90. package/types/apps/src/graphql.d.ts +1 -3
  91. package/types/apps/src/host.d.ts +5 -0
  92. package/types/apps/src/implementation/account-router.d.ts +13 -0
  93. package/types/apps/src/implementation/app.d.ts +5 -4
  94. package/types/apps/src/implementation/authoring.d.ts +25 -5
  95. package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
  96. package/types/apps/src/implementation/cache.d.ts +4 -0
  97. package/types/apps/src/implementation/catalog-cache.d.ts +43 -5
  98. package/types/apps/src/implementation/elicitation.d.ts +18 -15
  99. package/types/apps/src/implementation/events.d.ts +59 -0
  100. package/types/apps/src/implementation/failure-detail.d.ts +25 -3
  101. package/types/apps/src/implementation/graphql-catalog.d.ts +4 -7
  102. package/types/apps/src/implementation/graphql.d.ts +4 -3
  103. package/types/apps/src/implementation/input-problems.d.ts +6 -2
  104. package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
  105. package/types/apps/src/implementation/live.d.ts +2 -2
  106. package/types/apps/src/implementation/mcp-call.d.ts +6 -5
  107. package/types/apps/src/implementation/mcp-catalog.d.ts +7 -8
  108. package/types/apps/src/implementation/mcp-client.d.ts +49 -25
  109. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  110. package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
  111. package/types/apps/src/implementation/mcp.d.ts +52 -25
  112. package/types/apps/src/implementation/network.d.ts +16 -0
  113. package/types/apps/src/implementation/openapi-compile.d.ts +27 -6
  114. package/types/apps/src/implementation/openapi-document.d.ts +46 -19
  115. package/types/apps/src/implementation/openapi-names.d.ts +9 -4
  116. package/types/apps/src/implementation/openapi-request.d.ts +10 -2
  117. package/types/apps/src/implementation/openapi-source.d.ts +8 -6
  118. package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
  119. package/types/apps/src/implementation/operations.d.ts +43 -5
  120. package/types/apps/src/implementation/optimistic.d.ts +1 -1
  121. package/types/apps/src/implementation/protocol-operations.d.ts +6 -4
  122. package/types/apps/src/implementation/provider-error.d.ts +28 -1
  123. package/types/apps/src/implementation/provider.d.ts +19 -5
  124. package/types/apps/src/implementation/query-commit.d.ts +1 -1
  125. package/types/apps/src/implementation/router-catalog.d.ts +223 -0
  126. package/types/apps/src/implementation/router.d.ts +70 -0
  127. package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
  128. package/types/apps/src/implementation/schema.d.ts +95 -11
  129. package/types/apps/src/implementation/skills.d.ts +18 -24
  130. package/types/apps/src/implementation/sql.d.ts +71 -0
  131. package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
  132. package/types/apps/src/implementation/ui-auth.d.ts +1 -1
  133. package/types/apps/src/implementation/ui-client.d.ts +2 -2
  134. package/types/apps/src/implementation/ui-document.d.ts +5 -0
  135. package/types/apps/src/implementation/ui-errors.d.ts +1 -1
  136. package/types/apps/src/implementation/ui-serving.d.ts +11 -5
  137. package/types/apps/src/implementation/ui-watch.d.ts +1 -1
  138. package/types/apps/src/implementation/upstream-error.d.ts +7 -0
  139. package/types/apps/src/implementation/webhooks.d.ts +1 -1
  140. package/types/apps/src/implementation/workflow-context.d.ts +1 -1
  141. package/types/apps/src/implementation/workflows.d.ts +1 -1
  142. package/types/apps/src/index.d.ts +32 -13
  143. package/types/apps/src/mcp-stdio.d.ts +2 -5
  144. package/types/apps/src/mcp.d.ts +25 -5
  145. package/types/apps/src/openapi.d.ts +6 -6
  146. package/types/apps/src/react.d.ts +1 -1
  147. package/types/apps/src/skills.d.ts +10 -8
  148. package/types/telemetry/src/app-records.d.ts +42 -0
  149. package/types/telemetry/src/browser-operations.d.ts +7 -4
  150. package/types/telemetry/src/browser.d.ts +8 -3
  151. package/types/telemetry/src/config.d.ts +2 -2
  152. package/types/telemetry/src/index.d.ts +1 -0
  153. package/types/telemetry/src/layer.d.ts +2 -2
  154. package/types/telemetry/src/ownership.d.ts +56 -0
  155. package/types/telemetry/src/recorded-failure.d.ts +29 -0
  156. package/types/telemetry/src/relay.d.ts +2 -2
  157. package/types/telemetry/src/transport.d.ts +8 -1
  158. package/types/utils/src/api-error.d.ts +55 -0
  159. package/types/utils/src/connection-failure.d.ts +33 -0
  160. package/types/utils/src/recorded-message.d.ts +18 -0
  161. package/types/utils/src/user-facing-error.d.ts +83 -0
  162. package/js/chunk-3XKZDQLM.js +0 -93
  163. package/js/chunk-4M277YTM.js +0 -136
  164. package/js/chunk-67EVWIGJ.js +0 -224
  165. package/js/chunk-C3VAOK5B.js +0 -215
  166. package/js/chunk-DQAZTA4I.js +0 -2375
  167. package/js/chunk-G7T27IWB.js +0 -63
  168. package/js/chunk-LUVSFETN.js +0 -1347
  169. package/js/chunk-N7YDVXYJ.js +0 -186
  170. package/js/chunk-PJJ24GU7.js +0 -877
  171. package/js/chunk-PZB6T6KU.js +0 -19
  172. package/js/chunk-SB3V4YVR.js +0 -18
  173. package/js/chunk-TDNYXSIX.js +0 -29
  174. package/js/chunk-W4DMKWAB.js +0 -35
  175. package/js/chunk-YEPYT6SD.js +0 -85
  176. package/js/chunk-ZQINWV4W.js +0 -630
  177. package/types/app-data/src/implementation/cursor.d.ts +0 -10
  178. package/types/app-data/src/implementation/index-key.d.ts +0 -7
  179. package/types/app-data/src/implementation/promise.d.ts +0 -68
  180. package/types/app-data/src/implementation/range.d.ts +0 -8
  181. package/types/app-data/src/implementation/schema.d.ts +0 -18
  182. package/types/app-data/src/implementation/sqlite.d.ts +0 -11
  183. package/types/app-data/src/index.d.ts +0 -4
  184. package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
  185. package/types/apps/src/contracts/storage.d.ts +0 -68
  186. package/types/apps/src/implementation/account-operations.d.ts +0 -151
  187. package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
  188. package/types/apps/src/implementation/storage.d.ts +0 -15
@@ -1,35 +1,28 @@
1
1
  /** Remote skill readers return complete portable bundles, never installed host files. */
2
2
  import { Effect } from "effect";
3
- import { SkillLoadFailed, type GitHubSkillsOptions, type WellKnownSkillsOptions, type SkillTransport } from "../contracts/skills.js";
3
+ import { NetworkRefused } from "../contracts/network.js";
4
+ import { ProviderError } from "../contracts/provider-error.js";
5
+ import { AppSkills, SkillLoadFailed, type GitHubSkillsOptions, type WellKnownSkillsOptions, type SkillTransport } from "../contracts/skills.js";
4
6
  /** Give every failure without a message one that names the service. */
5
- export declare const withService: (service: string | undefined) => <A, R>(effect: Effect.Effect<A, SkillLoadFailed, R>) => Effect.Effect<A, SkillLoadFailed, R>;
7
+ export declare const withService: (service: string | undefined) => <A, R>(effect: Effect.Effect<A, SkillLoadFailed | NetworkRefused, R>) => Effect.Effect<A, NetworkRefused | SkillLoadFailed, R>;
8
+ interface ReadRequest {
9
+ readonly headers?: Readonly<Record<string, string>>;
10
+ /** Describe a refusal by Executor's app network; defaults to the refusal itself. */
11
+ readonly refused?: (refused: NetworkRefused) => SkillLoadFailed | NetworkRefused;
12
+ }
6
13
  /** One loader invocation owns its byte budget and all of its network requests. */
7
14
  export declare const reader: (transport: SkillTransport) => Effect.Effect<{
8
- fetchBytes: (url: string, post?: {
9
- readonly body: Uint8Array;
10
- readonly headers: Record<string, string>;
11
- }) => Effect.Effect<Uint8Array<ArrayBuffer>, SkillLoadFailed, never>;
12
- read: (url: string) => Effect.Effect<string, SkillLoadFailed, never>;
13
- json: (url: string) => Effect.Effect<unknown, SkillLoadFailed, never>;
15
+ fetchBytes: (url: string, request?: ReadRequest & {
16
+ readonly body?: Uint8Array;
17
+ }) => Effect.Effect<Uint8Array<ArrayBuffer>, NetworkRefused | SkillLoadFailed, never>;
18
+ read: (url: string, request?: ReadRequest) => Effect.Effect<string, NetworkRefused | SkillLoadFailed, never>;
19
+ json: (url: string) => Effect.Effect<unknown, NetworkRefused | SkillLoadFailed, never>;
14
20
  }, never, never>;
15
- export declare const githubSkillsEffect: (options: GitHubSkillsOptions) => Effect.Effect<readonly {
16
- readonly name: string;
17
- readonly description: string;
18
- readonly files: readonly {
19
- readonly path: string;
20
- readonly content: string;
21
- }[];
22
- readonly license?: string;
23
- readonly compatibility?: string;
24
- readonly metadata?: {
25
- readonly [x: string]: string;
26
- };
27
- readonly "allowed-tools"?: string;
28
- }[], SkillLoadFailed, never>;
21
+ export declare const githubSkillsEffect: (options: GitHubSkillsOptions) => Effect.Effect<typeof AppSkills.Type, SkillLoadFailed | NetworkRefused | ProviderError>;
29
22
  /** Fetch all indexed files and reject a publication whose index changes during the read. */
30
23
  export declare const wellKnownSkillsEffect: (options: WellKnownSkillsOptions) => Effect.Effect<readonly {
31
- readonly name: string;
32
24
  readonly description: string;
25
+ readonly name: string;
33
26
  readonly files: readonly {
34
27
  readonly path: string;
35
28
  readonly content: string;
@@ -40,4 +33,5 @@ export declare const wellKnownSkillsEffect: (options: WellKnownSkillsOptions) =>
40
33
  readonly [x: string]: string;
41
34
  };
42
35
  readonly "allowed-tools"?: string;
43
- }[], SkillLoadFailed, never>;
36
+ }[], NetworkRefused | SkillLoadFailed, never>;
37
+ export {};
@@ -0,0 +1,71 @@
1
+ /**
2
+ * `ctx.sql` over a data facet's SQLite storage, and the deploy-time migrator.
3
+ *
4
+ * Every statement runs inside a synchronous SQLite transaction: alone, or inside the author's
5
+ * `transaction`. Nothing here can wait on another call, so no lock or transaction outlives the
6
+ * statement that needs it. What a statement may do is decided by SQLite, not by reading the SQL:
7
+ * a query runs in a transaction that is always rolled back.
8
+ */
9
+ import { Effect, Schema } from "effect";
10
+ import { type AppSqlStorage, type Sql, type SqlReader } from "../contracts/sql.js";
11
+ import type { SkillFile } from "../contracts/skills.js";
12
+ export declare const noDatabase: Sql;
13
+ /** A workflow step mutation's identity, from the host's replay record. */
14
+ export interface StepReplay {
15
+ readonly key: string;
16
+ readonly fingerprint: string;
17
+ }
18
+ /**
19
+ * One invocation's SQL. Once the invocation ends or `signal` aborts, every statement is refused, so
20
+ * code still running after a timeout or cancellation cannot write late.
21
+ */
22
+ export declare const authorSql: (storage: AppSqlStorage, options: {
23
+ readonly signal: AbortSignal;
24
+ readonly step?: StepReplay;
25
+ /**
26
+ * The invocation's emitted events. A transaction that rolls back also discards the events its
27
+ * callback emitted, so subscribers never hear of writes that did not commit.
28
+ */
29
+ readonly emitted?: unknown[];
30
+ }) => {
31
+ reader: SqlReader;
32
+ writer: Sql;
33
+ close: () => void;
34
+ };
35
+ declare const MigrationFileInvalid_base: Schema.Class<MigrationFileInvalid, Schema.TaggedStruct<"MigrationFileInvalid", {
36
+ readonly path: Schema.String;
37
+ readonly reason: Schema.String;
38
+ }>, import("effect/Cause").YieldableError>;
39
+ /** A file in `migrations/` that is not a migration the host can order. */
40
+ export declare class MigrationFileInvalid extends MigrationFileInvalid_base {
41
+ get message(): string;
42
+ }
43
+ declare const MigrationHistoryChanged_base: Schema.Class<MigrationHistoryChanged, Schema.TaggedStruct<"MigrationHistoryChanged", {
44
+ readonly reason: Schema.String;
45
+ }>, import("effect/Cause").YieldableError>;
46
+ /** The build's migrations no longer start with the ones already applied to the database. */
47
+ export declare class MigrationHistoryChanged extends MigrationHistoryChanged_base {
48
+ get message(): string;
49
+ }
50
+ declare const MigrationFailed_base: Schema.Class<MigrationFailed, Schema.TaggedStruct<"MigrationFailed", {
51
+ readonly path: Schema.String;
52
+ readonly reason: Schema.String;
53
+ }>, import("effect/Cause").YieldableError>;
54
+ /** SQLite rejected a migration. Every migration of the deploy rolled back. */
55
+ export declare class MigrationFailed extends MigrationFailed_base {
56
+ get message(): string;
57
+ }
58
+ /** Whether a build's files give the app a database: any `.sql` file in `migrations/`. */
59
+ export declare const hasMigrations: (files: readonly {
60
+ readonly path: string;
61
+ }[]) => boolean;
62
+ /**
63
+ * Apply the build's pending migrations and report which ran. Every pending migration runs in one
64
+ * transaction, so a failing one leaves the database exactly as the active deployment knows it. The
65
+ * migrations already applied must still be the build's first ones, byte for byte.
66
+ */
67
+ export declare const migrate: (storage: AppSqlStorage, files: readonly SkillFile[]) => Effect.Effect<{
68
+ readonly id: number;
69
+ readonly name: string;
70
+ }[], MigrationFileInvalid | MigrationHistoryChanged | MigrationFailed, never>;
71
+ export {};
@@ -0,0 +1,9 @@
1
+ /** Host-rendered account notices; no authored app code or provider responses enter them. */
2
+ import type { UiAccountNotice, UiAccountProblem } from "../contracts/ui.js";
3
+ /** Missing, removed, incompatible, or rejected accounts stop the app; other failed checks are advisory. */
4
+ export declare const accountProblemBlocks: (problem: UiAccountProblem) => boolean;
5
+ export declare const accountProblemText: (problem: UiAccountProblem) => string;
6
+ /** Full page shown instead of the app while an account problem stops it from working. */
7
+ export declare const accountBlockedPage: (notice: UiAccountNotice) => string;
8
+ /** Inline card for advisory problems; the app still loads underneath. */
9
+ export declare const accountNoticeBootstrap: (notice: UiAccountNotice) => string;
@@ -1,5 +1,5 @@
1
1
  /** Host responses around app sign-in. They carry no script and never contain product credentials. */
2
- import { HttpServerResponse } from "effect/unstable/http";
2
+ import { HttpServerResponse } from "effect/http";
3
3
  import { type AppSignInId } from "../contracts/ui-auth.js";
4
4
  /** Private app responses must not leak authentication URLs through caches or referrers. */
5
5
  export declare const appPrivateHeaders: {
@@ -1,4 +1,4 @@
1
- import { Atom } from "effect/unstable/reactivity";
1
+ import { AsyncResult, Atom } from "effect/reactivity";
2
2
  import { type OperationReference } from "../contracts/live.js";
3
3
  import { type Schema } from "./schema.js";
4
4
  /** A scoped page client. Host-injected context carries only the deployment, never credentials. */
@@ -12,5 +12,5 @@ export declare const createAppClient: () => {
12
12
  /** Create a callable mutation with optional withOptimisticUpdate projections over mounted queries. */
13
13
  mutation: <Input, Output>(reference: OperationReference<Input, Output, "mutation">, output: Schema<NoInfer<Output>, boolean>) => import("../client.js").AppMutation<Input, Output>;
14
14
  /** Share a live query across mounts and reconcile optimistic changes against fresh server reads. */
15
- queryAtom: <Input, Output>(reference: OperationReference<Input, Output, "query">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<Output, unknown>>;
15
+ queryAtom: <Input, Output>(reference: OperationReference<Input, Output, "query">, input: NoInfer<Input>, output: Schema<NoInfer<Output>, boolean>) => Atom.Atom<AsyncResult.AsyncResult<Output, unknown>>;
16
16
  };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Retained files sit at the deployment's asset root. Resolving path-relative resource URLs there,
3
+ * instead of with `<base>`, leaves the document base as the page URL for links, history and forms.
4
+ */
5
+ export declare const deploymentDocument: (html: string, deployment: string) => string;
@@ -1,2 +1,2 @@
1
1
  /** Inline host script: no app dependencies, credentials, or authored HTML enter its source. */
2
- export declare const appFailureBootstrap: string;
2
+ export declare const appFailureBootstrap = "<script>\"use strict\";(()=>{var D=()=>{let d,w=Date.now(),m=0,g=0,f=new Map,A=/^(?:chrome|moz|safari-web)-extension:/,R=new Set([\"Error\",\"TypeError\",\"ReferenceError\",\"SyntaxError\",\"RangeError\",\"URIError\",\"EvalError\",\"AggregateError\"]),x=(e,t=0,i=0)=>{let r=[];if(!URL.canParse(e))return r;let a=new URL(e);return a.origin!==location.origin||!a.pathname.startsWith(\"/_executor/assets/\")||!a.pathname.endsWith(\".js\")||(r.push({key:\"code.file.path\",value:{stringValue:a.pathname}}),Number.isSafeInteger(t)&&t>0&&r.push({key:\"code.line.number\",value:{intValue:String(t)}}),Number.isSafeInteger(i)&&i>0&&r.push({key:\"code.column.number\",value:{intValue:String(i)}})),r},E=(e,t,i=[])=>{let r=Date.now();r-w>=6e4&&(w=r,m=0,f.clear());let a=`${e}:${t.slice(0,2e3)}`,b=f.get(a);if(b!==void 0&&r-b<1e3||m>=20){g++;return}f.set(a,r),m++,i.push({key:\"executor.ui.failure.suppressed\",value:{intValue:String(g)}}),g=0;let h=Array.from(crypto.getRandomValues(new Uint8Array(16)),s=>s.toString(16).padStart(2,\"0\")).join(\"\"),S=`${Date.now()}000000`,n,u=\"Sending error report\\u2026\",k=()=>{if(d?.open)return;let s=document.createElement(\"div\"),V=s.attachShadow({mode:\"open\"}),o=document.createElement(\"dialog\");d=o,o.setAttribute(\"aria-labelledby\",\"executor-failure-title\");let y=document.createElement(\"h2\");y.id=\"executor-failure-title\",y.textContent=e===\"script\"?\"This app could not load\":\"This app stopped working\";let C=document.createElement(\"p\");C.textContent=e===\"script\"?\"A file needed by this page did not load. Reload the page to try again.\":\"The app encountered an unexpected error. Reload the page to try again.\";let L=document.createElement(\"p\");L.textContent=\"Copy any unsaved work before reloading.\";let T=document.createElement(\"details\"),v=document.createElement(\"summary\");v.textContent=\"Error details\";let c=document.createElement(\"textarea\");c.readOnly=!0,c.rows=10,c.cols=36,c.setAttribute(\"aria-label\",\"Error details\"),c.value=`${t.slice(0,12e3)}\n\nDiagnostic ID: ${h}`,T.append(v,c),n=document.createElement(\"p\"),n.setAttribute(\"role\",\"status\"),n.textContent=u;let l=document.createElement(\"button\");l.type=\"button\",l.textContent=\"Reload page\",l.addEventListener(\"click\",()=>location.reload());let p=document.createElement(\"button\");p.type=\"button\",p.textContent=\"Close\",p.addEventListener(\"click\",()=>o.close()),o.addEventListener(\"close\",()=>{d===o&&(d=void 0),s.remove()}),o.append(y,C,L,T,n,l,p),V.append(o),document.documentElement.append(s),o.showModal()};document.readyState===\"loading\"?document.addEventListener(\"DOMContentLoaded\",k,{once:!0}):k(),fetch(\"/_executor/api/telemetry/traces\",{method:\"POST\",headers:{\"content-type\":\"application/json\"},credentials:\"same-origin\",keepalive:!0,body:JSON.stringify({resourceSpans:[{scopeSpans:[{spans:[{traceId:h,spanId:h.slice(0,16),name:\"ui.app.failure\",kind:1,startTimeUnixNano:S,endTimeUnixNano:S,status:{code:2},attributes:[{key:\"executor.ui.failure.kind\",value:{stringValue:e}},...i]}]}]}]})}).then(s=>{u=s.ok?\"Error report sent.\":\"Could not send the error report. You can copy the error details.\",n&&(n.textContent=u)},()=>{u=\"Could not send the error report. You can copy the error details.\",n&&(n.textContent=u)})};window.addEventListener(\"error\",e=>{if(e instanceof ErrorEvent){if(A.test(e.filename))return;let t=x(e.filename,e.lineno,e.colno);e.error instanceof Error&&R.has(e.error.name)&&t.push({key:\"exception.type\",value:{stringValue:e.error.name}}),E(\"runtime\",e.error instanceof Error?e.error.stack??e.message:e.message,t)}else e.target instanceof HTMLScriptElement&&E(\"script\",`Could not load script: ${e.target.src}`,x(e.target.src))},!0),window.addEventListener(\"unhandledrejection\",e=>{let t=e.reason;E(\"rejection\",t instanceof Error?t.stack??t.message:\"An app operation failed without handling its error.\")})};D();})();</script>";
@@ -1,16 +1,22 @@
1
1
  import { Effect } from "effect";
2
- import { HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
3
- import { UiForbidden, type AppUiAsset } from "../contracts/ui.js";
4
- /** Render an authorized deployment with a host-owned deployment watcher. */
2
+ import { HttpServerRequest, HttpServerResponse } from "effect/http";
3
+ import { UiForbidden, type AppUiAsset, type UiAccountNotice } from "../contracts/ui.js";
4
+ /**
5
+ * Render an authorized deployment with a host-owned deployment watcher. Account problems that stop
6
+ * the app replace its document with a page that links to their fix; others add a dismissible card.
7
+ */
5
8
  export declare const appDocument: <E, R>(options: {
6
9
  readonly deployment: string;
7
10
  readonly profile?: string | undefined;
8
11
  readonly expectedProfileRevision?: number | undefined;
9
12
  readonly origin: string;
13
+ readonly accounts?: UiAccountNotice | undefined;
10
14
  readonly asset: (path: string) => Effect.Effect<AppUiAsset | undefined, E, R>;
11
15
  }) => Effect.Effect<HttpServerResponse.HttpServerResponse, UiForbidden | E, HttpServerRequest.HttpServerRequest | R>;
12
- /** Revalidate immutable assets only after the host has checked current access and file existence.
13
- * Browsers may retain bytes, but neither browsers nor shared proxies may reuse them without authorization.
16
+ /** Serve an asset only after the host has checked current access and file existence.
17
+ * Asset URLs name their deployment, so their bytes never change: the browser keeps them for a year
18
+ * and does not ask again. Shared proxies never store them. Revoking access stops every new request
19
+ * and all app data, while bytes a browser already downloaded stay in its cache.
14
20
  * HTML remains an uncached host-rendered entry point.
15
21
  */
16
22
  export declare const appAsset: (asset: AppUiAsset | undefined, build: string, path: string) => Effect.Effect<HttpServerResponse.HttpServerResponse, never, HttpServerRequest.HttpServerRequest>;
@@ -1,2 +1,2 @@
1
1
  /** Dependency-free browser source served by each host after app authorization. */
2
- export declare const appWatchScript: string;
2
+ export declare const appWatchScript = "\"use strict\";(()=>{var s=()=>{let i=document.getElementById(\"executor-context\")?.textContent;if(!i)return;let n=JSON.parse(i);if(typeof n!=\"object\"||n===null||!(\"deployment\"in n))return;let r=n.deployment;if(typeof r!=\"string\"||r.length===0)return;let t=new EventSource(\"/_executor/version\"),l=!1,o=()=>{l||(l=!0,t.close(),location.reload())};t.addEventListener(\"version\",d=>{let e=JSON.parse(d.data);typeof e==\"object\"&&e!==null&&\"deployment\"in e&&(e.deployment===null||typeof e.deployment==\"string\")&&e.deployment!==r&&o()}),t.addEventListener(\"revoked\",o),window.addEventListener(\"executor:deployment-changed\",o),window.addEventListener(\"pagehide\",()=>t.close(),{once:!0}),window.addEventListener(\"pageshow\",d=>{d.persisted&&o()})};s();})();";
@@ -0,0 +1,7 @@
1
+ import { UpstreamError } from "../contracts/failure.js";
2
+ /** Whether `bounded` shortened this message, so it may end partway through a secret. */
3
+ export declare const isShortenedUpstream: (message: string) => boolean;
4
+ /** The error a JSON error body states, if it uses JSON-RPC's or OAuth's error format. */
5
+ export declare const bodyUpstreamError: (json: unknown) => UpstreamError | undefined;
6
+ /** The `error` and `error_description` of a Bearer challenge (RFC 6750, section 3). */
7
+ export declare const challengeUpstreamError: (header: string | undefined) => UpstreamError | undefined;
@@ -26,4 +26,4 @@ export declare const dispatchWebhook: <Context extends {
26
26
  readonly [x: string]: string;
27
27
  };
28
28
  readonly body: string;
29
- }, HostOperationNotFound | HostInputInvalid | HostOutputInvalid | HostDeclarationInvalid | HostOperationFailed, never>;
29
+ }, HostDeclarationInvalid | HostOperationNotFound | HostOperationFailed | HostInputInvalid | HostOutputInvalid, never>;
@@ -8,7 +8,7 @@ import { WorkflowFailure, type WorkflowContext, type WorkflowExecution, type Wor
8
8
  */
9
9
  export declare const workflowSafe: <A>(work: Effect.Effect<A, unknown>, secrets: readonly string[]) => Effect.Effect<A, WorkflowFailure>;
10
10
  /** Construct one replay's Promise context. Step callbacks acquire fresh capabilities per actual attempt. */
11
- export declare const makeWorkflowContext: (execution: WorkflowExecution, definition: Pick<AppDefinition<never>, "queries" | "mutations">,
11
+ export declare const makeWorkflowContext: (execution: WorkflowExecution, definition: Pick<AppDefinition<never>, "tools">,
12
12
  /** A step attempt's context, and the raw account secrets its failures must not reveal. */
13
13
  fresh: (stepId: string, signal: AbortSignal) => Effect.Effect<{
14
14
  readonly context: WorkflowStepContext;
@@ -1,5 +1,5 @@
1
1
  /** Ordinary async workflow declarations, adapted once into native Effect handlers. */
2
- import { type Schema as EffectSchema } from "effect";
2
+ import type { Schema as EffectSchema } from "effect";
3
3
  import type { AppWorkflow, WorkflowContext } from "../contracts/workflows.js";
4
4
  import { type Schema } from "./schema.js";
5
5
  declare const NativeWorkflow: unique symbol;
@@ -1,4 +1,5 @@
1
1
  export { ProviderError } from "./contracts/provider-error.js";
2
+ export { FetchOptionUnsupported, NetworkRefused } from "./contracts/network.js";
2
3
  export type { AppCache, CacheLoadContext, CacheGetOptions } from "./contracts/cache.js";
3
4
  export { CacheError } from "../../app-cache/src/contracts/cache.js";
4
5
  /**
@@ -8,32 +9,49 @@ export { CacheError } from "../../app-cache/src/contracts/cache.js";
8
9
  import { type Schema as EffectSchema } from "effect";
9
10
  import type { WebhookContext } from "./contracts/context.js";
10
11
  import { type JsonResponse as NativeResponse } from "./contracts/http.js";
11
- import { type OAuth2Config, type OAuth2Method as NativeOAuth2Method, type SecretsMethod as NativeSecretsMethod } from "./contracts/provider.js";
12
+ import { type OAuth2Config as NativeOAuth2Config, type OAuth2Method as NativeOAuth2Method, type ReservedAuthorizationParam, type SecretsMethod as NativeSecretsMethod } from "./contracts/provider.js";
12
13
  import type { Webhook as NativeWebhook } from "./contracts/webhooks.js";
13
14
  import { type PromiseMethods } from "./implementation/authoring.js";
14
- import { type Fields, type Infer, type ObjectSchema, type Schema } from "./implementation/schema.js";
15
+ import { type Fields, type Infer, type ObjectSchema, type Schema, type SecretFields, type SecretObject } from "./implementation/schema.js";
15
16
  export { type JsonObject, type JsonValue, ValidationError } from "./contracts/schema.js";
16
- export { type Fields, type Infer, type ObjectSchema, type ObjectValue, type Schema, array, boolean, json, jsonSchema, literal, number, object, record, string, } from "./implementation/schema.js";
17
- export { type AccountOf, type AuthMethod, type AuthMethodData, type AuthMethods, type ManyAccounts, type OAuth2Config, type Provider, } from "./contracts/provider.js";
18
- export { defineProvider } from "./implementation/provider.js";
19
- export { accountOperations } from "./implementation/account-operations.js";
20
- export { dynamicTools } from "./implementation/dynamic-tools.js";
17
+ export { type Fields, type Infer, type ObjectSchema, type ObjectValue, type Schema, array, boolean, json, jsonSchema, literal, number, object, record, string, plain, raw, type SecretString, } from "./implementation/schema.js";
18
+ 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";
19
+ export { defineProvider, type ProviderOptions } from "./implementation/provider.js";
20
+ export { accountRouter } from "./implementation/account-router.js";
21
+ export { router, dynamicRouter, withApprovals, type OperationChild, type OperationDeclaration, type RouterDeclaration, type RouterChild, type RouterOptions, } from "./implementation/router.js";
22
+ export type { RouterIcon } from "./contracts/router.js";
21
23
  export { dynamicSkills } from "./implementation/dynamic-skills.js";
22
24
  export type { HostedTool as OperationDescription } from "./contracts/host.js";
25
+ /** Account fields as app code receives them from a method declared with this schema. */
26
+ type AccountFields<S> = S extends ObjectSchema<infer F> ? SecretFields<F> : SecretObject<Infer<S>>;
23
27
  /** A secrets declaration inferred from an author schema. */
24
- export type SecretsMethod<Shape extends ObjectSchema<Fields>> = NativeSecretsMethod<EffectSchema.Decoder<Infer<Shape>>>;
28
+ export type SecretsMethod<Shape extends ObjectSchema<Fields>> = NativeSecretsMethod<EffectSchema.Decoder<AccountFields<Shape>>>;
25
29
  /** An OAuth declaration inferred from its author-facing response schema. */
26
- export type OAuth2Method<Response extends Schema<unknown, boolean>> = NativeOAuth2Method<EffectSchema.Decoder<Infer<Response>>>;
30
+ export type OAuth2Method<Response extends Schema<unknown, boolean>> = NativeOAuth2Method<EffectSchema.Decoder<AccountFields<Response>>>;
27
31
  /** Default OAuth fields visible to app code. Host-only grants and clients stay private. */
28
32
  export declare const OAuth2AccessToken: Schema<{
29
33
  readonly access_token: string;
30
34
  }, false>;
35
+ /**
36
+ * OAuth options as authors write them. `authorizationParams` naming a host-owned protocol
37
+ * parameter such as `state` or `scope` is a type error as well as a declaration failure.
38
+ */
39
+ export type OAuth2Config = WithoutReservedParams<NativeOAuth2Config>;
40
+ type WithoutReservedParams<Config> = Config extends unknown ? "authorizationParams" extends keyof Config ? Config & {
41
+ readonly authorizationParams?: {
42
+ readonly [Key in ReservedAuthorizationParam]?: never;
43
+ };
44
+ } : Config : never;
31
45
  /** Declare a secrets method without requiring an Effect schema from the author. */
32
46
  export declare const secrets: <const F extends Fields>(options: {
33
47
  readonly label: string;
34
48
  readonly fields: ObjectSchema<F>;
35
49
  }) => SecretsMethod<ObjectSchema<F>>;
36
- /** Declare OAuth discovery/endpoints and an optional app-visible response projection. */
50
+ /**
51
+ * Declare OAuth discovery/endpoints and an optional app-visible response projection.
52
+ * `authorizationParams` adds service-defined sign-in parameters; a declared `authorizationUrl`
53
+ * keeps its own query. Neither can set host-owned parameters, and each parameter appears once.
54
+ */
37
55
  export declare function oauth2(options: OAuth2Config): OAuth2Method<typeof OAuth2AccessToken>;
38
56
  export declare function oauth2<Response extends Schema<unknown, boolean>>(options: OAuth2Config & {
39
57
  readonly response: Response;
@@ -41,6 +59,8 @@ export declare function oauth2<Response extends Schema<unknown, boolean>>(option
41
59
  export type { AccountSlots } from "./contracts/app.js";
42
60
  export type { AppRequirements, AppContext, QueryContext, MutationContext, WebhookContext, } from "./contracts/context.js";
43
61
  export { type App, type AppDefinition, defineApp } from "./implementation/app.js";
62
+ export { event, type EventDeclaration, type EventEmitter } from "./implementation/events.js";
63
+ export type { EmitOptions } from "./contracts/events.js";
44
64
  export type { Approval, ApprovalContext, ApprovalDecision } from "./approval.js";
45
65
  type AuthorWebhook<Member, Config, State> = Member extends object ? Omit<PromiseMethods<Member>, "config" | "state"> & {
46
66
  readonly config: Config;
@@ -55,9 +75,8 @@ export type JsonResponse = PromiseMethods<NativeResponse>;
55
75
  export declare const decodeJson: <T>(response: JsonResponse, schema: Schema<T, boolean>) => Promise<T>;
56
76
  export { NotImplemented } from "./contracts/app.js";
57
77
  export { ElicitationFailed, type FormElicitation, type ElicitationResponse, type Elicit, } from "./contracts/elicitation.js";
58
- export { table, defineDatabase, type Table, type DatabaseReader, type Database, type DatabaseDefinition, } from "./implementation/storage.js";
59
- export { id, userId } from "./implementation/schema.js";
60
- export { query, mutation, withApproval, type Operation, type OperationOptions, } from "./implementation/operations.js";
78
+ export type { Sql, SqlCursor, SqlReader, SqlRow, SqlTransaction, SqlValue, } from "./contracts/sql.js";
79
+ export { query, mutation, withApproval, toolAnnotations, type Operation, type OperationOptions, } from "./implementation/operations.js";
61
80
  export type { OperationContext } from "./contracts/operations.js";
62
81
  export { workflow, type Workflow, type WorkflowDeclaration } from "./implementation/workflows.js";
63
82
  export { NonRetryableError, WorkflowFailure, type WorkflowContext, type WorkflowStepContext, type WorkflowStep, type WorkflowStepOptions, type WorkflowDuration, type WorkflowReads, type WorkflowControls, } from "./contracts/workflows.js";
@@ -1,8 +1,5 @@
1
1
  import type { ProcessConfig } from "./contracts/mcp.js";
2
2
  import { type OperationKinds } from "./implementation/protocol-operations.js";
3
3
  export { McpError, type McpToolContext, type ProcessConfig } from "./contracts/mcp.js";
4
- /** Discover an account's tools; each discovery and call owns and closes its subprocess. */
5
- export declare const stdioOperations: (config: ProcessConfig, signal?: AbortSignal, kinds?: OperationKinds) => Promise<{
6
- queries: Record<string, import("./index.js").Operation<import("effect/Schema").Json, unknown, "query", import("./index.js").OperationContext>>;
7
- mutations: Record<string, import("./index.js").Operation<import("effect/Schema").Json, unknown, "mutation", import("./index.js").OperationContext>>;
8
- }>;
4
+ /** Discover an account's tools as a router; each discovery and call owns and closes its subprocess. */
5
+ export declare const stdioRouter: (config: ProcessConfig, signal?: AbortSignal, kinds?: OperationKinds) => Promise<import("./index.js").RouterDeclaration<unknown, unknown>>;
@@ -1,10 +1,30 @@
1
1
  /** HTTP MCP helpers. Requires the optional @modelcontextprotocol/sdk peer. */
2
2
  import type { OperationKinds } from "./implementation/protocol-operations.js";
3
+ import type { McpHealthOptions } from "./contracts/mcp.js";
4
+ import type { AccountCheckContext, AuthMethods } from "./contracts/provider.js";
3
5
  import { type McpCatalogOptions } from "./implementation/mcp-catalog.js";
4
6
  export type { McpCatalogOptions } from "./implementation/mcp-catalog.js";
5
- export { McpError, type McpToolContext, type McpToolsOptions, type McpToolResult, } from "./contracts/mcp.js";
6
- /** Discover operations for the selected account. Kinds override uncertain upstream read-only hints. */
7
- export declare const mcpOperations: (options: McpCatalogOptions, kinds?: OperationKinds) => Promise<{
8
- dynamicTools: import("./contracts/dynamic-tools.js").DynamicTools;
9
- }>;
7
+ export { McpCredentialsUnverified, McpError, type McpHealthOptions, type McpToolContext, type McpToolsOptions, type McpToolResult, } from "./contracts/mcp.js";
8
+ /**
9
+ * A router over a server's tools for the selected account. Its title, description and
10
+ * instructions come from the server. Kinds override uncertain upstream read-only hints.
11
+ */
12
+ export declare const mcpRouter: (options: McpCatalogOptions, kinds?: OperationKinds) => Promise<import("./index.js").RouterDeclaration<unknown, unknown>>;
13
+ /**
14
+ * A provider `health` check for an MCP server. Pass the check context `health` receives, then the
15
+ * server's `url` and the `headers` that send the account's credentials:
16
+ * `health: (check) => mcpHealth(check, { url, headers: headers(check.account) })`.
17
+ *
18
+ * It connects with those headers, initializes, and reads the first page of tools, then does the
19
+ * same without any headers. No tool runs. The check passes only when the server accepts the account
20
+ * and refuses the attempt without credentials. A refused account throws `ProviderError`, as HTTP
21
+ * helpers do. An unreachable or unusable server throws `McpError`, and a request Executor's network
22
+ * refuses throws `NetworkRefused`. A server that also answers without credentials, or whose answer
23
+ * to that attempt is not a refusal, throws `McpCredentialsUnverified`. Each of these errors means
24
+ * the check could not verify the account, and the account form explains why. Send credentials only
25
+ * in `headers`; the attempt without them uses the same `url`. The check context's `signal` cancels
26
+ * both attempts, and they share one budget that ends early enough before its `deadline` to report a
27
+ * server that did not answer in time. `timeoutMs` can only shorten that budget.
28
+ */
29
+ export declare const mcpHealth: <Auth extends AuthMethods>(check: AccountCheckContext<Auth>, options: McpHealthOptions) => Promise<void>;
10
30
  export type { OperationKinds } from "./implementation/protocol-operations.js";
@@ -2,11 +2,11 @@
2
2
  import { type OperationKinds } from "./implementation/protocol-operations.js";
3
3
  import type { OpenapiToolsOptions } from "./contracts/openapi.js";
4
4
  export { OpenapiError, isOpenapiTextMedia, openapiBinaryResultSchema, OpenapiErrorResponse, type OpenapiToolsOptions, type OpenapiOperation, type CredentialBinding, OpenapiParameter, OpenapiRequestBody, openapiMediaKind, } from "./contracts/openapi.js";
5
- /** Discover operations for the selected account. Kinds override uncertain upstream read-only hints. */
6
- export declare const openapiOperations: (options: OpenapiToolsOptions, kinds?: OperationKinds) => Promise<{
7
- queries: Record<string, import("./index.js").Operation<import("effect/Schema").Json, unknown, "query", import("./index.js").OperationContext>>;
8
- mutations: Record<string, import("./index.js").Operation<import("effect/Schema").Json, unknown, "mutation", import("./index.js").OperationContext>>;
9
- }>;
5
+ /**
6
+ * Discover a document's operations as a router for the selected account. Kinds override uncertain
7
+ * upstream read-only hints. Mount it under a key, or override its metadata with `router(...)`.
8
+ */
9
+ export declare const openapiRouter: (options: OpenapiToolsOptions, kinds?: OperationKinds) => Promise<import("./index.js").RouterDeclaration<unknown, unknown>>;
10
10
  export type { OperationKinds } from "./implementation/protocol-operations.js";
11
11
  export * from "./contracts/openapi-compile.js";
12
- export { liveOpenapiOperations, type OpenapiSourceOptions, } from "./implementation/openapi-source.js";
12
+ export { liveOpenapiRouter, type OpenapiSourceOptions } from "./implementation/openapi-source.js";
@@ -1,4 +1,4 @@
1
- import { AsyncResult, type Atom } from "effect/unstable/reactivity";
1
+ import { AsyncResult, type Atom } from "effect/reactivity";
2
2
  /** Subscribe for the component lifetime. Each mount owns and disposes its registry, including StrictMode remounts. */
3
3
  export declare const useAppQuery: <A, E>(atom: Atom.Atom<AsyncResult.AsyncResult<A, E>>) => {
4
4
  data: A | undefined;
@@ -1,12 +1,13 @@
1
1
  import { type FolderSkillsOptions, type GitHubSkillsOptions, type SkillReaderOptions, type WellKnownSkillsOptions, type SkillFile } from "./contracts/skills.js";
2
- export { SkillLoadFailed, SkillDefinitionInvalid, SkillServiceName, type SkillReaderOptions, type FolderSkillsOptions, type AppSkillSource as Skill, type SkillFile, type GitHubSkillsOptions, type SkillCacheOptions, type WellKnownSkillsOptions, } from "./contracts/skills.js";
2
+ export { SkillLoadFailed, SkillDefinitionInvalid, SkillServiceName, type SkillReaderOptions, type FolderSkillsOptions, type AppSkillSource as Skill, type SkillFile, type GitHubSkillsAccount, type GitHubSkillsOptions, type SkillCacheOptions, type WellKnownSkillsOptions, } from "./contracts/skills.js";
3
3
  /**
4
- * Fetch a public GitHub skill collection from one resolved commit. Pass `cache: ctx.cache` to reuse
5
- * the catalog; without it, mutable refs resolve again on each call.
4
+ * Fetch a GitHub skill collection from one resolved commit. A private repository takes `account`
5
+ * and its `token`. Pass `cache: ctx.cache` to reuse the catalog; without it, mutable refs resolve
6
+ * again on each call.
6
7
  */
7
8
  export declare const githubSkills: (options: GitHubSkillsOptions) => Promise<readonly {
8
- readonly name: string;
9
9
  readonly description: string;
10
+ readonly name: string;
10
11
  readonly files: readonly {
11
12
  readonly path: string;
12
13
  readonly content: string;
@@ -20,8 +21,8 @@ export declare const githubSkills: (options: GitHubSkillsOptions) => Promise<rea
20
21
  }[]>;
21
22
  /** Fetch a published skill index and its text files. Pass `cache: ctx.cache` to reuse the catalog. */
22
23
  export declare const wellKnownSkills: (options: WellKnownSkillsOptions) => Promise<readonly {
23
- readonly name: string;
24
24
  readonly description: string;
25
+ readonly name: string;
25
26
  readonly files: readonly {
26
27
  readonly path: string;
27
28
  readonly content: string;
@@ -35,8 +36,8 @@ export declare const wellKnownSkills: (options: WellKnownSkillsOptions) => Promi
35
36
  }[]>;
36
37
  /** Parse a bundled standard skill directory into an app capability. */
37
38
  export declare const fileSkill: (files: readonly SkillFile[]) => Promise<{
38
- readonly name: string;
39
39
  readonly description: string;
40
+ readonly name: string;
40
41
  readonly files: readonly {
41
42
  readonly path: string;
42
43
  readonly content: string;
@@ -50,8 +51,8 @@ export declare const fileSkill: (files: readonly SkillFile[]) => Promise<{
50
51
  }>;
51
52
  /** Read skill directories from ctx.files. Omitted path selects skills/; missing folders return []. */
52
53
  export declare const folderSkills: (options: FolderSkillsOptions) => Promise<readonly {
53
- readonly name: string;
54
54
  readonly description: string;
55
+ readonly name: string;
55
56
  readonly files: readonly {
56
57
  readonly path: string;
57
58
  readonly content: string;
@@ -65,7 +66,8 @@ export declare const folderSkills: (options: FolderSkillsOptions) => Promise<rea
65
66
  }[]>;
66
67
  /**
67
68
  * Read files for a custom remote skill loader, such as one for GitLab. Reads share one byte
68
- * budget and reject with the same safe SkillLoadFailed errors as githubSkills, naming `service`.
69
+ * budget and reject with the same safe SkillLoadFailed errors as githubSkills, naming `service`,
70
+ * or with `NetworkRefused` when Executor's network refuses a request.
69
71
  */
70
72
  export declare const skillReader: (options: SkillReaderOptions) => {
71
73
  /** Fetch one UTF-8 text file. */
@@ -0,0 +1,42 @@
1
+ /**
2
+ * What the host keeps of the spans and logs an app isolate returns.
3
+ *
4
+ * Those records come from whatever framework the app's build bundles, and the app's own code runs
5
+ * in the same isolate: it can throw any text, name its errors and codes, and rewrite every record
6
+ * before the isolate returns it. So the host does not filter the records it receives. It builds
7
+ * new ones from a closed vocabulary: the framework's span names, attributes whose values are
8
+ * closed sets, counts and status codes, and each exception's kind. Ids, parents and timings are
9
+ * kept. Everything else, including events other than exceptions, links, status and exception
10
+ * messages, stacks and log bodies, is dropped or replaced with a fixed sentence.
11
+ *
12
+ * The vocabulary is the framework's (`packages/apps`, `app-cache`, `app-data`): host request
13
+ * operations, failure sources and reasons, MCP and cache attributes. A name or value outside it is
14
+ * recorded as `unrecognized` or not at all. `bun run check` (`scripts/check-app-telemetry.ts`)
15
+ * fails when the framework names a span or sets an attribute key this vocabulary does not know.
16
+ */
17
+ import type { Schema } from "effect";
18
+ type Json = Schema.Json;
19
+ type JsonObject = {
20
+ readonly [key: string]: Json;
21
+ };
22
+ /** What an exception message, stack or log body from an app isolate records instead. */
23
+ export declare const appText = "Text from the app is not recorded";
24
+ /** The framework's span names, and the libraries' spans it runs. */
25
+ export declare const appSpanNames: ReadonlySet<string>;
26
+ export declare const appSpanAttributeKeys: ReadonlySet<string>;
27
+ /**
28
+ * Attributes the framework sets whose values the app chooses, such as its tool names, so the host
29
+ * drops them. `scripts/check-app-telemetry.ts` fails on a framework attribute in neither set.
30
+ */
31
+ export declare const droppedAppAttributeKeys: ReadonlySet<string>;
32
+ /** The span the host records for one an app isolate returned, or nothing without its timings. */
33
+ export declare const appSpan: (span: JsonObject & {
34
+ readonly traceId: string;
35
+ readonly spanId: string;
36
+ }) => JsonObject | undefined;
37
+ /** The log record the host records for one an app isolate returned. */
38
+ export declare const appLog: (log: JsonObject & {
39
+ readonly traceId?: string | undefined;
40
+ readonly spanId?: string | undefined;
41
+ }) => JsonObject;
42
+ export {};
@@ -1,11 +1,14 @@
1
1
  /** Correlate transport and decoded outcomes without exporting response bodies or errors. */
2
2
  import { Effect, Schema, Tracer } from "effect";
3
- import { HttpClient, HttpClientError } from "effect/unstable/http";
4
- /** A random document identity. It is never an authentication or user identifier. */
5
- export declare const browserPageId: () => string;
3
+ import { HttpClient, HttpClientError } from "effect/http";
4
+ /**
5
+ * A random identity for the current browser document. It is never an authentication or user
6
+ * identifier. Server renders have no document, so they get none instead of sharing one per isolate.
7
+ */
8
+ export declare const browserPageId: () => string | undefined;
6
9
  /** Safe event shared with the host's error reporter and product analytics. */
7
10
  export declare const BrowserOperationFailure: Schema.Struct<{
8
- readonly error_type: Schema.Literals<readonly ["BrowserDecodeFailed", "BrowserTransportFailed", "BrowserOperationFailed"]>;
11
+ readonly error_type: Schema.Literals<readonly ["BrowserDecodeFailed", "BrowserConnectionFailed", "BrowserTransportFailed", "BrowserOperationFailed"]>;
9
12
  readonly trace_id: Schema.String;
10
13
  readonly span_id: Schema.String;
11
14
  readonly page_id: Schema.String;
@@ -1,11 +1,16 @@
1
1
  /** Browser-owned Effect telemetry, shared by Promise calls and Atom runtimes. */
2
2
  import { Context, Effect, Layer, ManagedRuntime } from "effect";
3
- import { OtlpExporter } from "effect/unstable/observability";
4
- import { Atom } from "effect/unstable/reactivity";
3
+ import { OtlpExporter } from "effect/observability";
4
+ import { Atom } from "effect/reactivity";
5
5
  import type { TelemetryConfig } from "./config.js";
6
6
  declare const BrowserTelemetry_base: Context.ServiceClass<BrowserTelemetry, "executor/BrowserTelemetry", {
7
+ /**
8
+ * `load` names the document's initial route without a span: hydration resolves no route
9
+ * change, and first load is measured by the vitals. `start` opens a `ui.navigation` span
10
+ * that the router's next `end` closes or the next `start` interrupts.
11
+ */
7
12
  readonly navigation: (event: {
8
- readonly type: "start";
13
+ readonly type: "load" | "start";
9
14
  readonly path: string;
10
15
  } | {
11
16
  readonly type: "end";
@@ -33,8 +33,8 @@ export declare const TelemetryConfig: Schema.Struct<{
33
33
  export type TelemetryConfig = typeof TelemetryConfig.Type;
34
34
  /** Host-only destinations; never copied into an app's invocation telemetry capability. */
35
35
  export declare const CurrentTelemetryConfig: Context.Reference<{
36
- readonly version: string;
37
36
  readonly service: string;
37
+ readonly version: string;
38
38
  readonly environment: string;
39
39
  readonly clock?: "system" | "cloudflare-io" | undefined;
40
40
  readonly traces?: {
@@ -59,8 +59,8 @@ export declare const CurrentTelemetryConfig: Context.Reference<{
59
59
  } | undefined>;
60
60
  /** Read OTLP endpoints uniformly for all signals; development chooses which signals to configure. */
61
61
  export declare const telemetryConfig: (service: string) => Effect.Effect<{
62
- readonly version: string;
63
62
  readonly service: string;
63
+ readonly version: string;
64
64
  readonly environment: string;
65
65
  readonly clock?: "system" | "cloudflare-io" | undefined;
66
66
  readonly traces?: {
@@ -5,5 +5,6 @@ export { captureTelemetry, traceHeaders, withRemoteSpan, invocationFetch, type I
5
5
  export { collectTelemetry, forwardTelemetry, makeTelemetryForwarder, TelemetryBatch, } from "./relay.js";
6
6
  export { TraceContext, currentTraceContext, externalTrace, traceLinks } from "./trace-context.js";
7
7
  export { pendingSpan } from "./pending-span.js";
8
+ export { makeOwnershipAccounting, measuredSpan, owned, ownedBy, ownerAttribute, type Owner, type SpanMeasure, } from "./ownership.js";
8
9
  export { recordWorkerMeasurements } from "./measurements.js";
9
10
  export { allowlistedSpans, httpSpanAttributeAllowlist, spanAttributeAllowed, } from "./span-attributes.js";
@@ -2,6 +2,6 @@
2
2
  import { Layer, Logger } from "effect";
3
3
  import { type TelemetryConfig } from "./config.js";
4
4
  /** Build one tracer per runtime. Event mode defers export until Worker scope finalization. */
5
- export declare const telemetryLayer: (config: TelemetryConfig, lifetime?: "process" | "event", logger?: Logger.Logger<unknown, void>) => Layer.Layer<import("effect/unstable/observability/OtlpExporter").Flusher, never, never>;
5
+ export declare const telemetryLayer: (config: TelemetryConfig, lifetime?: "process" | "event", logger?: Logger.Logger<unknown, void>) => Layer.Layer<import("effect/observability/OtlpExporter").Flusher, never, never>;
6
6
  /** Node/local entry points resolve telemetry once and share it for their process lifetime. */
7
- export declare const telemetryFromConfig: (service: string) => Layer.Layer<import("effect/unstable/observability/OtlpExporter").Flusher, import("effect/Schema").SchemaError | import("effect/Config").ConfigError, never>;
7
+ export declare const telemetryFromConfig: (service: string) => Layer.Layer<import("effect/observability/OtlpExporter").Flusher, import("effect/Schema").SchemaError | import("effect/Config").ConfigError, never>;