apps 0.0.1-beta.0 → 0.0.1-beta.10

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 (141) hide show
  1. package/README.md +145 -30
  2. package/framework-reference.json +1 -1
  3. package/js/browser-XIPJGLH2.js +65 -0
  4. package/js/{chunk-36DNRFZQ.js → chunk-27F7W2LG.js} +1 -1
  5. package/js/{chunk-VFUZI3NY.js → chunk-57RKNWL2.js} +4 -4
  6. package/js/{chunk-BPEFS4YF.js → chunk-5T57N25Q.js} +122 -18
  7. package/js/chunk-72JNVHPK.js +41 -0
  8. package/js/{chunk-2OTCEKL2.js → chunk-CDL5PM2Q.js} +2643 -1646
  9. package/js/{chunk-KWTCHVLT.js → chunk-CRDWFA74.js} +69 -54
  10. package/js/chunk-CZ7CSFO4.js +39 -0
  11. package/js/{chunk-WIDTG42X.js → chunk-EPT3ZP52.js} +79 -26
  12. package/js/chunk-FL2QR3XW.js +507 -0
  13. package/js/{chunk-3ANFZFCV.js → chunk-IJX4CYZO.js} +15 -18
  14. package/js/chunk-IPI4MFSN.js +78 -0
  15. package/js/chunk-JU7VHODU.js +104 -0
  16. package/js/chunk-KUMBKVJD.js +39 -0
  17. package/js/{chunk-YDR4CPJA.js → chunk-M3B3DE4K.js} +8 -8
  18. package/js/chunk-MKWZPDR6.js +63 -0
  19. package/js/{chunk-7JXHF5IF.js → chunk-N7YDVXYJ.js} +49 -1
  20. package/js/chunk-NKLWZJLE.js +172 -0
  21. package/js/{chunk-OWD2YICM.js → chunk-ODEIDRGW.js} +116 -88
  22. package/js/{chunk-D6BKYP2L.js → chunk-PJJ24GU7.js} +4 -4
  23. package/js/{chunk-EP6AEUZO.js → chunk-PZB6T6KU.js} +1 -1
  24. package/js/chunk-R3EV5FTO.js +97 -0
  25. package/js/chunk-RFVIONFX.js +189 -0
  26. package/js/{chunk-W7Q5EOTS.js → chunk-UK573G7W.js} +32 -32
  27. package/js/chunk-UVL56Z6E.js +6641 -0
  28. package/js/{chunk-Q2FD5IBM.js → chunk-V5KNQVCT.js} +505 -124
  29. package/js/{chunk-SBKHUC5L.js → chunk-VFZKSM3T.js} +5 -25
  30. package/js/{chunk-HP7E42X6.js → chunk-WLE7WX2U.js} +1158 -232
  31. package/js/{chunk-X3YBZCJW.js → chunk-YXQHV65J.js} +58 -62
  32. package/js/chunk-Z5M2LQOZ.js +209 -0
  33. package/js/{chunk-R6JMJSVT.js → chunk-ZQINWV4W.js} +60 -20
  34. package/js/client.js +11 -27
  35. package/js/contracts.js +138 -27
  36. package/js/effect.js +20 -15
  37. package/js/es-APDZKREY.js +40968 -0
  38. package/js/graphql.js +220 -123
  39. package/js/host.js +75 -19
  40. package/js/index.js +261 -117
  41. package/js/mcp/effect.js +24 -17
  42. package/js/mcp/stdio.js +26 -21
  43. package/js/mcp.js +127 -26
  44. package/js/openapi.js +3048 -150
  45. package/js/operations/approval.js +1 -1
  46. package/js/react.js +4 -4
  47. package/js/skills/effect.js +11 -0
  48. package/js/skills.js +893 -0
  49. package/js/storage/facet.js +7 -7
  50. package/js/ui/auth/contracts.js +9 -10
  51. package/js/ui/auth.js +17 -15
  52. package/js/ui/contracts.js +5 -5
  53. package/js/ui/serving.js +14 -13
  54. package/package.json +9 -1
  55. package/runtime.json +1 -1
  56. package/types/app-cache/src/contracts/cache.d.ts +119 -0
  57. package/types/app-cache/src/index.d.ts +93 -0
  58. package/types/app-data/src/contracts/database.d.ts +33 -6
  59. package/types/app-data/src/implementation/schema.d.ts +2 -17
  60. package/types/apps/src/contracts/api-response-error.d.ts +43 -0
  61. package/types/apps/src/contracts/app.d.ts +16 -4
  62. package/types/apps/src/contracts/cache.d.ts +44 -0
  63. package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
  64. package/types/apps/src/contracts/failure.d.ts +25 -0
  65. package/types/apps/src/contracts/graphql.d.ts +18 -1
  66. package/types/apps/src/contracts/host.d.ts +76 -528
  67. package/types/apps/src/contracts/mcp.d.ts +19 -1
  68. package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
  69. package/types/apps/src/contracts/openapi-document.d.ts +53 -0
  70. package/types/apps/src/contracts/openapi.d.ts +160 -30
  71. package/types/apps/src/contracts/operations.d.ts +0 -5
  72. package/types/apps/src/contracts/protocol-version.d.ts +6 -0
  73. package/types/apps/src/contracts/protocols/1.d.ts +1589 -0
  74. package/types/apps/src/contracts/protocols/2.d.ts +668 -0
  75. package/types/apps/src/contracts/protocols/3.d.ts +676 -0
  76. package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
  77. package/types/apps/src/contracts/protocols/5.d.ts +1090 -0
  78. package/types/apps/src/contracts/provider-error.d.ts +15 -0
  79. package/types/apps/src/contracts/provider.d.ts +69 -6
  80. package/types/apps/src/contracts/router.d.ts +59 -0
  81. package/types/apps/src/contracts/skills.d.ts +122 -0
  82. package/types/apps/src/contracts/storage.d.ts +3 -3
  83. package/types/apps/src/contracts/swagger-client.d.ts +29 -0
  84. package/types/apps/src/contracts/ui-auth.d.ts +6 -14
  85. package/types/apps/src/contracts/workflows.d.ts +34 -3
  86. package/types/apps/src/graphql.d.ts +5 -7
  87. package/types/apps/src/host.d.ts +1 -0
  88. package/types/apps/src/implementation/account-router.d.ts +12 -0
  89. package/types/apps/src/implementation/app.d.ts +5 -4
  90. package/types/apps/src/implementation/cache-session.d.ts +7 -0
  91. package/types/apps/src/implementation/cache.d.ts +8 -0
  92. package/types/apps/src/implementation/catalog-cache.d.ts +36 -0
  93. package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
  94. package/types/apps/src/implementation/elicitation.d.ts +13 -13
  95. package/types/apps/src/implementation/failure-detail.d.ts +25 -0
  96. package/types/apps/src/implementation/git.d.ts +25 -0
  97. package/types/apps/src/implementation/graphql-catalog.d.ts +7 -0
  98. package/types/apps/src/implementation/graphql.d.ts +81 -3
  99. package/types/apps/src/implementation/inflate.d.ts +16 -0
  100. package/types/apps/src/implementation/input-problems.d.ts +3 -0
  101. package/types/apps/src/implementation/mcp-call.d.ts +3 -2
  102. package/types/apps/src/implementation/mcp-catalog.d.ts +9 -0
  103. package/types/apps/src/implementation/mcp-client.d.ts +39 -22
  104. package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
  105. package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
  106. package/types/apps/src/implementation/mcp.d.ts +55 -2
  107. package/types/apps/src/implementation/openapi-compile.d.ts +120 -0
  108. package/types/apps/src/implementation/openapi-document.d.ts +51 -0
  109. package/types/apps/src/implementation/openapi-names.d.ts +18 -0
  110. package/types/apps/src/implementation/openapi-request.d.ts +10 -4
  111. package/types/apps/src/implementation/openapi-source.d.ts +36 -0
  112. package/types/apps/src/implementation/openapi.d.ts +39 -3
  113. package/types/apps/src/implementation/operations.d.ts +26 -3
  114. package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
  115. package/types/apps/src/implementation/provider-error.d.ts +10 -0
  116. package/types/apps/src/implementation/provider.d.ts +9 -4
  117. package/types/apps/src/implementation/router-catalog.d.ts +225 -0
  118. package/types/apps/src/implementation/router.d.ts +59 -0
  119. package/types/apps/src/implementation/schema.d.ts +11 -6
  120. package/types/apps/src/implementation/skill-files.d.ts +10 -0
  121. package/types/apps/src/implementation/skills.d.ts +43 -0
  122. package/types/apps/src/implementation/storage.d.ts +5 -3
  123. package/types/apps/src/implementation/swagger-client.d.ts +28 -0
  124. package/types/apps/src/implementation/ui-auth.d.ts +11 -5
  125. package/types/apps/src/implementation/ui-serving.d.ts +4 -2
  126. package/types/apps/src/implementation/webhooks.d.ts +1 -1
  127. package/types/apps/src/implementation/workflow-context.d.ts +11 -3
  128. package/types/apps/src/index.d.ts +11 -3
  129. package/types/apps/src/mcp-stdio.d.ts +2 -5
  130. package/types/apps/src/mcp.d.ts +8 -7
  131. package/types/apps/src/openapi.d.ts +8 -6
  132. package/types/apps/src/skills.d.ts +75 -0
  133. package/types/apps/src/ui-auth.d.ts +2 -2
  134. package/types/telemetry/src/browser-operations.d.ts +5 -2
  135. package/types/telemetry/src/config.d.ts +2 -0
  136. package/js/chunk-22WRQZT7.js +0 -389
  137. package/js/chunk-BKVL7XAJ.js +0 -47
  138. package/js/chunk-C24KEZXR.js +0 -59
  139. package/js/chunk-LOKGDT6B.js +0 -28
  140. package/js/chunk-MLKGABMK.js +0 -9
  141. package/types/apps/src/implementation/account-operations.d.ts +0 -32
@@ -0,0 +1,15 @@
1
+ import { Schema } from "effect";
2
+ declare const ProviderError_base: Schema.Class<ProviderError, Schema.TaggedStruct<"ProviderError", {
3
+ readonly reason: Schema.Literals<readonly ["unauthorized", "forbidden", "rate_limited", "unavailable", "rejected"]>;
4
+ readonly status: Schema.optional<Schema.Int>;
5
+ readonly accountId: Schema.optional<Schema.brand<Schema.String, "acc">>;
6
+ }>, import("effect/Cause").YieldableError>;
7
+ /**
8
+ * A recognized service failure. App authors can throw this ordinary Error from
9
+ * async code. Supply only a known reason and the account used for that request.
10
+ * Never include response bodies, messages, URLs or credentials. A bare 403 is
11
+ * `rejected`; `forbidden` requires explicit evidence of insufficient permission.
12
+ */
13
+ export declare class ProviderError extends ProviderError_base {
14
+ }
15
+ export {};
@@ -1,5 +1,5 @@
1
1
  /** Provider declarations use native Effect schemas. The trusted host interprets them. */
2
- import { Data, Schema } from "effect";
2
+ import { Data, type Effect, Schema } from "effect";
3
3
  import { type AccountId } from "./schema.js";
4
4
  declare const SecretsMethod_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Readonly<A> & {
5
5
  readonly _tag: "secrets";
@@ -15,21 +15,36 @@ export declare const OAuthClientAuth: Schema.Literals<readonly ["none", "client_
15
15
  export type OAuthClientAuth = typeof OAuthClientAuth.Type;
16
16
  /** Machine clients always authenticate; public clients cannot use the client-credentials grant. */
17
17
  export declare const OAuthSecretClientAuth: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
18
- /** OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain host-owned. */
18
+ /**
19
+ * Extra authorization request parameters, such as `access_type: "offline"`. RFC 6749 §3.1
20
+ * lets services define their own; the protocol and security parameters stay host-owned.
21
+ */
22
+ export declare const OAuthAuthorizationParams: Schema.$Record<Schema.String, Schema.String>;
23
+ /**
24
+ * OAuth endpoints and protocol choices. Omitted grant means authorization code; clients remain
25
+ * host-owned. Declared endpoints may name an RFC 7009 `revocationUrl`; discovery reads the
26
+ * server's `revocation_endpoint` metadata instead.
27
+ */
19
28
  export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
20
29
  readonly discover: Schema.String;
21
30
  readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
22
31
  readonly tokenUrl: Schema.optionalKey<Schema.Never>;
32
+ readonly revocationUrl: Schema.optionalKey<Schema.Never>;
23
33
  readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
24
34
  readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
35
+ readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
25
36
  readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
26
37
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
27
38
  }>, Schema.Struct<{
28
39
  readonly authorizationUrl: Schema.String;
29
40
  readonly tokenUrl: Schema.String;
41
+ readonly revocationUrl: Schema.optionalKey<Schema.String>;
30
42
  readonly scopes: Schema.$Array<Schema.String>;
43
+ /** RFC 8414 issuer identifier. Declared issuers are checked against the callback's `iss`. */
44
+ readonly issuer: Schema.optionalKey<Schema.String>;
31
45
  readonly discover: Schema.optionalKey<Schema.Never>;
32
46
  readonly grant: Schema.optionalKey<Schema.Literal<"authorization_code">>;
47
+ readonly authorizationParams: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
33
48
  readonly tokenEndpointAuthMethod: Schema.optionalKey<Schema.Literals<readonly ["none", "client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>>;
34
49
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
35
50
  }>, Schema.Struct<{
@@ -37,12 +52,14 @@ export declare const OAuth2Config: Schema.Union<readonly [Schema.Struct<{
37
52
  readonly discover: Schema.String;
38
53
  readonly authorizationUrl: Schema.optionalKey<Schema.Never>;
39
54
  readonly tokenUrl: Schema.optionalKey<Schema.Never>;
55
+ readonly revocationUrl: Schema.optionalKey<Schema.Never>;
40
56
  readonly scopes: Schema.optionalKey<Schema.$Array<Schema.String>>;
41
57
  readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
42
58
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
43
59
  }>, Schema.Struct<{
44
60
  readonly grant: Schema.Literal<"client_credentials">;
45
61
  readonly tokenUrl: Schema.String;
62
+ readonly revocationUrl: Schema.optionalKey<Schema.String>;
46
63
  readonly scopes: Schema.$Array<Schema.String>;
47
64
  readonly tokenEndpointAuthMethod: Schema.Literals<readonly ["client_secret_post", "client_secret_basic", "client_secret_basic_raw"]>;
48
65
  readonly resource: Schema.optionalKey<Schema.NullOr<Schema.String>>;
@@ -67,10 +84,54 @@ export declare class OAuth2Method<Response extends Schema.Decoder<unknown>> exte
67
84
  export type AuthMethod = SecretsMethod<Schema.Decoder<unknown>> | OAuth2Method<Schema.Decoder<unknown>>;
68
85
  /** Auth method names are chosen by the provider author. */
69
86
  export type AuthMethods = Readonly<Record<string, AuthMethod>>;
70
- /** A provider declaration. The future host derives its identity from normalized content. */
87
+ /**
88
+ * Upstream identity that a passing account check may report for display. Only these fields are
89
+ * retained; the host never stores raw provider responses.
90
+ */
91
+ export declare const AccountInfo: Schema.Struct<{
92
+ readonly externalId: Schema.optionalKey<Schema.String>;
93
+ readonly displayName: Schema.optionalKey<Schema.String>;
94
+ readonly username: Schema.optionalKey<Schema.String>;
95
+ readonly email: Schema.optionalKey<Schema.String>;
96
+ readonly avatarUrl: Schema.optionalKey<Schema.String>;
97
+ readonly profileUrl: Schema.optionalKey<Schema.String>;
98
+ }>;
99
+ export type AccountInfo = typeof AccountInfo.Type;
100
+ /** A passing account check. Failures are thrown, so there is no failing variant. */
101
+ export declare const AccountCheckResult: Schema.Struct<{
102
+ readonly accountInfo: Schema.optionalKey<Schema.Struct<{
103
+ readonly externalId: Schema.optionalKey<Schema.String>;
104
+ readonly displayName: Schema.optionalKey<Schema.String>;
105
+ readonly username: Schema.optionalKey<Schema.String>;
106
+ readonly email: Schema.optionalKey<Schema.String>;
107
+ readonly avatarUrl: Schema.optionalKey<Schema.String>;
108
+ readonly profileUrl: Schema.optionalKey<Schema.String>;
109
+ }>>;
110
+ }>;
111
+ export type AccountCheckResult = typeof AccountCheckResult.Type;
112
+ /** The account a provider's check verifies, with invocation-owned HTTP and cancellation. */
113
+ export interface AccountCheckContext<Auth extends AuthMethods> {
114
+ readonly account: AccountOfMethods<Auth>;
115
+ readonly fetch: (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
116
+ readonly signal: AbortSignal;
117
+ }
118
+ /**
119
+ * A safe authenticated read proving the account works for this app. Returning passes; a thrown
120
+ * `ProviderError` or HTTP status failure classifies the problem. Any other failure, including a
121
+ * timeout, means the check could not verify the account, not that its credentials are bad.
122
+ */
123
+ export interface AccountCheck<Auth extends AuthMethods> {
124
+ run(context: AccountCheckContext<Auth>): Effect.Effect<AccountCheckResult | void, unknown>;
125
+ }
126
+ /** A provider declaration. The host derives its identity from the declaration, never its check. */
71
127
  export declare class Provider<Auth extends AuthMethods> extends Data.Class<{
72
128
  readonly name: string;
73
129
  readonly auth: Auth;
130
+ /**
131
+ * Stored without its method types so a specific provider still fills a general slot. The host
132
+ * binds the account against this provider's methods before running it.
133
+ */
134
+ readonly health?: AccountCheck<AuthMethods>;
74
135
  }> {
75
136
  /** Declare zero or more accounts from this provider without performing I/O. */
76
137
  many(): ManyAccounts<Auth>;
@@ -85,12 +146,14 @@ export declare class ManyAccounts<Auth extends AuthMethods> extends ManyAccounts
85
146
  }
86
147
  /** Infer the data for one method from its native Effect decoder. */
87
148
  export type AuthMethodData<Method> = Method extends SecretsMethod<infer Fields> ? Fields["Type"] : Method extends OAuth2Method<infer Response> ? Response["Type"] : never;
88
- /** One selected account, discriminated by its author-chosen method name. */
89
- export type AccountOf<P> = P extends Provider<infer Auth> ? {
149
+ /** One account for these methods, discriminated by its author-chosen method name. */
150
+ export type AccountOfMethods<Auth extends AuthMethods> = {
90
151
  readonly [Method in keyof Auth & string]: {
91
152
  readonly id: AccountId;
92
153
  readonly method: Method;
93
154
  readonly fields: AuthMethodData<Auth[Method]>;
94
155
  };
95
- }[keyof Auth & string] : never;
156
+ }[keyof Auth & string];
157
+ /** One selected account, discriminated by its author-chosen method name. */
158
+ export type AccountOf<P> = P extends Provider<infer Auth> ? AccountOfMethods<Auth> : never;
96
159
  export {};
@@ -0,0 +1,59 @@
1
+ /** Routers group operations. Keys form tool paths; each operation keeps its own kind. */
2
+ import { Schema, type Effect } from "effect";
3
+ import type { HostedTool, HostedToolSummary } from "./host.js";
4
+ import type { AppOperation } from "./operations.js";
5
+ /** Object keys that JavaScript gives special meaning, so no router may use them. */
6
+ export declare const reservedRouterKeys: ReadonlySet<string>;
7
+ /** One static path segment. Dots separate segments, so a key never contains one. */
8
+ export declare const RouterKey: Schema.String;
9
+ /** An image a client may show beside a router, such as an MCP server's own icon. Models never read it. */
10
+ export declare const RouterIcon: Schema.Struct<{
11
+ readonly src: Schema.NonEmptyString;
12
+ readonly mimeType: Schema.optionalKey<Schema.String>;
13
+ readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
14
+ readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
15
+ }>;
16
+ export type RouterIcon = typeof RouterIcon.Type;
17
+ /**
18
+ * What an agent should know about a group of tools. `instructions` is published as a skill;
19
+ * `tags` describes labels that tools in this router carry, such as OpenAPI tags.
20
+ */
21
+ export declare const RouterMeta: Schema.Struct<{
22
+ readonly title: Schema.optionalKey<Schema.String>;
23
+ readonly description: Schema.optionalKey<Schema.String>;
24
+ readonly instructions: Schema.optionalKey<Schema.String>;
25
+ readonly icons: Schema.optionalKey<Schema.$Array<Schema.Struct<{
26
+ readonly src: Schema.NonEmptyString;
27
+ readonly mimeType: Schema.optionalKey<Schema.String>;
28
+ readonly sizes: Schema.optionalKey<Schema.$Array<Schema.String>>;
29
+ readonly theme: Schema.optionalKey<Schema.Literals<readonly ["light", "dark"]>>;
30
+ }>>>;
31
+ readonly tags: Schema.optionalKey<Schema.$Record<Schema.NonEmptyString, Schema.String>>;
32
+ }>;
33
+ export type RouterMeta = typeof RouterMeta.Type;
34
+ /** A statically declared router. Children are operations or further routers. */
35
+ export interface AppRouter {
36
+ readonly kind: "router";
37
+ readonly meta?: RouterMeta;
38
+ readonly children: Readonly<Record<string, AppNode>>;
39
+ }
40
+ /**
41
+ * A router whose tools are discovered when read, such as an MCP server or OpenAPI document.
42
+ * Names are relative to the router and may contain dots. `readOnly: true` marks a query;
43
+ * anything else is a mutation. Resolution never requires listing.
44
+ */
45
+ export interface DynamicRouter {
46
+ readonly kind: "dynamic";
47
+ /** Metadata supplied by the source. Author metadata on the router takes precedence. */
48
+ readonly meta?: () => Effect.Effect<RouterMeta, unknown>;
49
+ readonly list: () => Effect.Effect<readonly HostedTool[], unknown>;
50
+ readonly resolve: (name: string) => Effect.Effect<AppOperation | undefined, unknown>;
51
+ /** Names and descriptions without schemas. Omitted sources reduce list(). */
52
+ readonly summaries?: () => Effect.Effect<readonly HostedToolSummary[], unknown>;
53
+ /** One tool's full metadata without listing. Omitted sources search list(). */
54
+ readonly describe?: (name: string) => Effect.Effect<HostedTool | undefined, unknown>;
55
+ /** Static author metadata, merged over the source's metadata. */
56
+ readonly overrides?: RouterMeta;
57
+ }
58
+ /** Anything a router can contain. */
59
+ export type AppNode = AppOperation | AppRouter | DynamicRouter;
@@ -0,0 +1,122 @@
1
+ /** Portable Agent Skills returned by an app factory or loaded from published files. */
2
+ import { Schema } from "effect";
3
+ /** Canonical resource path within one skill. */
4
+ export declare const SkillFilePath: Schema.NonEmptyString;
5
+ /** UTF-8 text resource. Reading a resource never executes it. */
6
+ export declare const SkillFile: Schema.Struct<{
7
+ readonly path: Schema.NonEmptyString;
8
+ readonly content: Schema.String;
9
+ }>;
10
+ export type SkillFile = typeof SkillFile.Type;
11
+ /** Agent Skills format constraints, not Executor execution or storage budgets. */
12
+ export declare const skillFormatLimits: {
13
+ readonly nameCharacters: 64;
14
+ readonly descriptionCharacters: 1024;
15
+ readonly compatibilityCharacters: 500;
16
+ };
17
+ /** A lowercase alphanumeric skill directory name with single separating hyphens. */
18
+ export declare const AppSkillName: Schema.NonEmptyString;
19
+ /** Frontmatter is metadata only. In particular, allowed-tools never grants execution authority. */
20
+ export declare const AppSkillMetadata: Schema.Struct<{
21
+ readonly name: Schema.NonEmptyString;
22
+ readonly description: Schema.String;
23
+ readonly license: Schema.optionalKey<Schema.String>;
24
+ readonly compatibility: Schema.optionalKey<Schema.String>;
25
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
26
+ readonly "allowed-tools": Schema.optionalKey<Schema.String>;
27
+ }>;
28
+ export type AppSkillMetadata = typeof AppSkillMetadata.Type;
29
+ /** Files use paths relative to this skill directory; reading one never executes its contents. */
30
+ export declare const AppSkillSource: Schema.Struct<{
31
+ readonly files: Schema.$Array<Schema.Struct<{
32
+ readonly path: Schema.NonEmptyString;
33
+ readonly content: Schema.String;
34
+ }>>;
35
+ readonly name: Schema.NonEmptyString;
36
+ readonly description: Schema.String;
37
+ readonly license: Schema.optionalKey<Schema.String>;
38
+ readonly compatibility: Schema.optionalKey<Schema.String>;
39
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
40
+ readonly "allowed-tools": Schema.optionalKey<Schema.String>;
41
+ }>;
42
+ export type AppSkillSource = typeof AppSkillSource.Type;
43
+ declare const SkillDefinitionInvalid_base: Schema.Class<SkillDefinitionInvalid, Schema.TaggedStruct<"SkillDefinitionInvalid", {
44
+ readonly file: Schema.NonEmptyString;
45
+ readonly reason: Schema.Literals<readonly ["files", "directory", "missing-document", "frontmatter", "metadata", "name-mismatch"]>;
46
+ }>, import("effect/Cause").YieldableError>;
47
+ /** Invalid selected skill files fail the load. Errors identify the file without disclosing its contents. */
48
+ export declare class SkillDefinitionInvalid extends SkillDefinitionInvalid_base {
49
+ }
50
+ /** One evaluated catalog cannot contain ambiguous names. */
51
+ export declare const AppSkills: Schema.$Array<Schema.Struct<{
52
+ readonly files: Schema.$Array<Schema.Struct<{
53
+ readonly path: Schema.NonEmptyString;
54
+ readonly content: Schema.String;
55
+ }>>;
56
+ readonly name: Schema.NonEmptyString;
57
+ readonly description: Schema.String;
58
+ readonly license: Schema.optionalKey<Schema.String>;
59
+ readonly compatibility: Schema.optionalKey<Schema.String>;
60
+ readonly metadata: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
61
+ readonly "allowed-tools": Schema.optionalKey<Schema.String>;
62
+ }>>;
63
+ /** Short display name for a skill source, such as "GitLab" or an index host name. */
64
+ export declare const SkillServiceName: Schema.String;
65
+ declare const SkillLoadFailed_base: Schema.Class<SkillLoadFailed, Schema.TaggedStruct<"SkillLoadFailed", {
66
+ readonly reason: Schema.Literals<readonly ["source", "request", "rate_limited", "document", "limit", "changed", "encoding"]>;
67
+ readonly message: Schema.optional<Schema.String>;
68
+ readonly status: Schema.optional<Schema.Int>;
69
+ }>, import("effect/Cause").YieldableError>;
70
+ /**
71
+ * A skill loader failure shown to people. `message` is the explanation they read; write it for
72
+ * them and never include URLs, tokens or response bodies. `reason` selects the title and whether
73
+ * a retry can help. Custom loaders throw this error to get the same presentation as built-ins.
74
+ */
75
+ export declare class SkillLoadFailed extends SkillLoadFailed_base {
76
+ }
77
+ /** Bounds shared by skill loaders across all app hosts. */
78
+ export declare const skillLoadLimits: {
79
+ readonly files: 1000;
80
+ readonly fileBytes: 2000000;
81
+ readonly totalBytes: 20000000;
82
+ readonly concurrency: 8;
83
+ };
84
+ /** Invocation-owned transport and cancellation, supplied by the app context. */
85
+ export interface SkillTransport {
86
+ readonly fetch?: typeof globalThis.fetch | undefined;
87
+ readonly signal?: AbortSignal | undefined;
88
+ }
89
+ /** A custom loader's transport and the service name shown when a request fails. */
90
+ export interface SkillReaderOptions extends SkillTransport {
91
+ readonly service: string;
92
+ }
93
+ /**
94
+ * Catalog reuse shared by remote skill loaders, with the same policy as MCP tool catalogs. Pass
95
+ * `ctx.cache` to keep the loaded catalog; without it every read fetches the source again.
96
+ */
97
+ export interface SkillCacheOptions {
98
+ readonly cache?: import("./cache.js").AppCache;
99
+ /** Reuse the catalog for this duration. Defaults to five minutes. */
100
+ readonly freshFor?: import("effect").Duration.Input;
101
+ /** Serve the retained catalog while refreshing. Defaults to one day. */
102
+ readonly staleFor?: import("effect").Duration.Input;
103
+ }
104
+ /**
105
+ * A public GitHub repository and an optional immutable commit, tag or branch. With a cache, a
106
+ * branch or tag is resolved again when the catalog refreshes, and each commit's file list is kept.
107
+ */
108
+ export interface GitHubSkillsOptions extends SkillTransport, SkillCacheOptions {
109
+ readonly repo: string;
110
+ readonly path?: string;
111
+ readonly ref?: string;
112
+ }
113
+ /** A published directory index, including its listed skill documents and text references. */
114
+ export interface WellKnownSkillsOptions extends SkillTransport, SkillCacheOptions {
115
+ readonly url: string;
116
+ }
117
+ /** A folder in the deployed package; omitted path selects skills/. No host filesystem access. */
118
+ export interface FolderSkillsOptions {
119
+ readonly files: readonly SkillFile[];
120
+ readonly path?: string;
121
+ }
122
+ export {};
@@ -2,7 +2,7 @@
2
2
  import { Schema, type Effect } from "effect";
3
3
  import type { RowMetadata, ReadTable, WriteTable } from "../../../app-data/src/index.js";
4
4
  import type { Fields, ObjectValue } from "../implementation/schema.js";
5
- import type { DatabaseSchema, DatabaseSession, AppDatabaseError } from "../../../app-data/src/contracts/database.js";
5
+ import type { DatabaseSchema, DatabaseSession, DatabaseError } from "../../../app-data/src/contracts/database.js";
6
6
  /** Names for authored operations and tables. */
7
7
  export declare const StorageName: Schema.NonEmptyString;
8
8
  declare const AppStorageUnavailable_base: Schema.Class<AppStorageUnavailable, Schema.TaggedStruct<"AppStorageUnavailable", {}>, import("effect/Cause").YieldableError>;
@@ -15,8 +15,8 @@ export declare class AppStorageError extends AppStorageError_base {
15
15
  }
16
16
  /** The adapter owns the database connection and transaction for the whole authored invocation. */
17
17
  export interface AppStorage {
18
- readonly read: <A, E>(schema: DatabaseSchema, work: (session: DatabaseSession) => Effect.Effect<A, E>) => Effect.Effect<A, E | AppDatabaseError | AppStorageUnavailable | AppStorageError>;
19
- readonly mutate: <A, E>(schema: DatabaseSchema, work: (session: DatabaseSession) => Effect.Effect<A, E>) => Effect.Effect<A, E | AppDatabaseError | AppStorageUnavailable | AppStorageError>;
18
+ readonly read: <A, E>(schema: DatabaseSchema, work: (session: DatabaseSession) => Effect.Effect<A, E>) => Effect.Effect<A, E | DatabaseError | AppStorageUnavailable | AppStorageError>;
19
+ readonly mutate: <A, E>(schema: DatabaseSchema, work: (session: DatabaseSession) => Effect.Effect<A, E>) => Effect.Effect<A, E | DatabaseError | AppStorageUnavailable | AppStorageError>;
20
20
  }
21
21
  type InputValue<F extends Fields> = {
22
22
  readonly [K in keyof F as F[K]["optionalValue"] extends true ? never : F[K] extends {
@@ -0,0 +1,29 @@
1
+ /** Narrow declarations for the untyped public swagger-client APIs used by our adapters.
2
+ * Returned data remains unknown and is decoded before it enters Executor.
3
+ */
4
+ declare module "swagger-client" {
5
+ const SwaggerClient: {
6
+ buildRequest(options: {
7
+ spec: unknown;
8
+ operationId?: string;
9
+ pathName?: string;
10
+ method?: string;
11
+ parameters?: Readonly<Record<string, unknown>>;
12
+ requestBody?: unknown;
13
+ requestContentType?: string;
14
+ securities?: {
15
+ authorized: Readonly<Record<string, unknown>>;
16
+ };
17
+ }): unknown;
18
+ resolve(options: {
19
+ spec: unknown;
20
+ skipNormalization: boolean;
21
+ useCircularStructures: boolean;
22
+ requestInterceptor: () => never;
23
+ }): Promise<{
24
+ spec: unknown;
25
+ errors: readonly unknown[];
26
+ }>;
27
+ };
28
+ export default SwaggerClient;
29
+ }
@@ -1,7 +1,5 @@
1
1
  /** Browser authentication protocol. Identity and session storage belong to the host. */
2
2
  import { Schema } from "effect";
3
- import { HttpApi, HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
4
- import { UiFailed, UiForbidden, UiUnauthorized } from "./ui.js";
5
3
  /** Opaque correlation ID; possession alone does not authorize an app session. */
6
4
  export declare const AppSignInId: Schema.brand<Schema.String, "AppSignInId">;
7
5
  export type AppSignInId = typeof AppSignInId.Type;
@@ -10,19 +8,13 @@ export declare const AppSignInCode: Schema.RedactedFromValue<Schema.String>;
10
8
  /** A path on the current app origin, including its query and fragment; never a redirect to another host or host-owned route. */
11
9
  export declare const AppReturnPath: Schema.brand<Schema.String, "AppReturnPath">;
12
10
  export type AppReturnPath = typeof AppReturnPath.Type;
13
- /** The trusted callback exchanges an authorization code bound to a browser attempt. */
11
+ /** Callback query on the app origin. The code is single-use and works only with its attempt's cookie. */
14
12
  export declare const AppSignInCallback: Schema.Struct<{
15
13
  readonly request: Schema.brand<Schema.String, "AppSignInId">;
16
14
  readonly code: Schema.RedactedFromValue<Schema.String>;
17
15
  }>;
18
- /** Host-owned endpoints on every app origin, independent of the product's login mechanism. */
19
- export declare const AppSignInApi: HttpApi.HttpApi<"app-sign-in", HttpApiGroup.HttpApiGroup<"appSignIn", HttpApiEndpoint.HttpApiEndpoint<"start", "POST", "/_executor/auth/start", never, never, Schema.toCodecJson<Schema.Struct<{
20
- readonly returnTo: Schema.brand<Schema.String, "AppReturnPath">;
21
- }>>, never, Schema.toCodecJson<Schema.Struct<{
22
- readonly url: Schema.String;
23
- }>>, Schema.toCodecJson<typeof UiForbidden | typeof UiFailed>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"complete", "POST", "/_executor/auth/complete", never, never, Schema.toCodecJson<Schema.Struct<{
24
- readonly request: Schema.brand<Schema.String, "AppSignInId">;
25
- readonly code: Schema.RedactedFromValue<Schema.String>;
26
- }>>, never, Schema.toCodecJson<Schema.Struct<{
27
- readonly returnTo: Schema.brand<Schema.String, "AppReturnPath">;
28
- }>>, Schema.toCodecJson<typeof UiUnauthorized | typeof UiForbidden | typeof UiFailed>, never, never>, false>>;
16
+ /** Host-owned callback path on every app origin. */
17
+ export declare const appSignInCallbackPath = "/_executor/auth/callback";
18
+ /** Why the product could not authorize an attempt; the dashboard explains it without retrying. */
19
+ export declare const AppSignInFailure: Schema.Literals<readonly ["ended", "forbidden", "unavailable"]>;
20
+ export type AppSignInFailure = typeof AppSignInFailure.Type;
@@ -24,14 +24,33 @@ export declare const WorkflowStepOptions: Schema.Struct<{
24
24
  readonly timeout: Schema.optionalKey<Schema.Union<readonly [Schema.Finite, Schema.NonEmptyString]>>;
25
25
  }>;
26
26
  export type WorkflowStepOptions = typeof WorkflowStepOptions.Type;
27
+ /**
28
+ * Where and why a run failed: the failing step and the error the app's own code raised, its
29
+ * message bounded and with account secrets replaced. Runs from before these fields existed have none.
30
+ */
31
+ export declare const WorkflowFailureDetail: {
32
+ step: Schema.optionalKey<Schema.String>;
33
+ errorName: Schema.optionalKey<Schema.String>;
34
+ message: Schema.optionalKey<Schema.String>;
35
+ };
36
+ /** A failed run's recorded step and app error. */
37
+ export declare const WorkflowRunFailure: Schema.Struct<{
38
+ step: Schema.optionalKey<Schema.String>;
39
+ errorName: Schema.optionalKey<Schema.String>;
40
+ message: Schema.optionalKey<Schema.String>;
41
+ }>;
42
+ export type WorkflowRunFailure = typeof WorkflowRunFailure.Type;
27
43
  declare const WorkflowFailure_base: Schema.Class<WorkflowFailure, Schema.TaggedStruct<"WorkflowFailure", {
28
44
  readonly reason: Schema.Literals<readonly ["unavailable", "not_found", "input", "output", "operation", "approval", "credentials", "terminated", "execution", "conflict", "engine"]>;
29
45
  readonly retryable: Schema.Boolean;
46
+ readonly step: Schema.optionalKey<Schema.String>;
47
+ readonly errorName: Schema.optionalKey<Schema.String>;
48
+ readonly message: Schema.optionalKey<Schema.String>;
30
49
  }>, import("effect/Cause").YieldableError>;
31
- /** Safe failures cross host boundaries without authored exceptions or account fields. */
50
+ /** Failures cross host boundaries as reason codes plus the app's own bounded error detail. */
32
51
  export declare class WorkflowFailure extends WorkflowFailure_base {
33
52
  }
34
- /** Explicitly stop retrying an authored step. Its message stays inside the app runtime. */
53
+ /** Explicitly stop retrying an authored step. Its message is reported like any step error. */
35
54
  export declare class NonRetryableError extends Error {
36
55
  readonly name = "NonRetryableError";
37
56
  }
@@ -45,7 +64,7 @@ export declare const HostedWorkflow: Schema.Struct<{
45
64
  readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
46
65
  }>;
47
66
  export type HostedWorkflow = typeof HostedWorkflow.Type;
48
- /** Results are available only on completed runs; failure details are safe reason codes. */
67
+ /** Results are available only on completed runs; failures carry a reason code and app error detail. */
49
68
  export declare const WorkflowRun: Schema.Union<readonly [Schema.Struct<{
50
69
  readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "paused", "waitingForPause"]>;
51
70
  readonly profile: Schema.optionalKey<Schema.NonEmptyString>;
@@ -66,6 +85,12 @@ export declare const WorkflowRun: Schema.Union<readonly [Schema.Struct<{
66
85
  }>, Schema.Struct<{
67
86
  readonly status: Schema.Literal<"errored">;
68
87
  readonly error: Schema.Literals<readonly ["unavailable", "not_found", "input", "output", "operation", "approval", "credentials", "terminated", "execution", "conflict", "engine"]>;
88
+ /** The failing step and the app's own error, when the run recorded them. */
89
+ readonly failure: Schema.optionalKey<Schema.Struct<{
90
+ step: Schema.optionalKey<Schema.String>;
91
+ errorName: Schema.optionalKey<Schema.String>;
92
+ message: Schema.optionalKey<Schema.String>;
93
+ }>>;
69
94
  readonly profile: Schema.optionalKey<Schema.NonEmptyString>;
70
95
  readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
71
96
  readonly app: Schema.NonEmptyString;
@@ -104,6 +129,12 @@ export declare const WorkflowRunPage: Schema.Struct<{
104
129
  }>, Schema.Struct<{
105
130
  readonly status: Schema.Literal<"errored">;
106
131
  readonly error: Schema.Literals<readonly ["unavailable", "not_found", "input", "output", "operation", "approval", "credentials", "terminated", "execution", "conflict", "engine"]>;
132
+ /** The failing step and the app's own error, when the run recorded them. */
133
+ readonly failure: Schema.optionalKey<Schema.Struct<{
134
+ step: Schema.optionalKey<Schema.String>;
135
+ errorName: Schema.optionalKey<Schema.String>;
136
+ message: Schema.optionalKey<Schema.String>;
137
+ }>>;
107
138
  readonly profile: Schema.optionalKey<Schema.NonEmptyString>;
108
139
  readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
109
140
  readonly app: Schema.NonEmptyString;
@@ -1,10 +1,8 @@
1
1
  /** GraphQL helpers. Requires the optional graphql peer. */
2
- import { type OperationKinds } from "./implementation/protocol-operations.js";
3
- import type { GraphqlToolsOptions } from "./contracts/graphql.js";
2
+ import type { OperationKinds } from "./implementation/protocol-operations.js";
3
+ import { type GraphqlCatalogOptions } from "./implementation/graphql-catalog.js";
4
4
  export { GraphqlError, type GraphqlToolsOptions } from "./contracts/graphql.js";
5
- /** Discover operations for the selected account. Kinds override uncertain upstream read-only hints. */
6
- export declare const graphqlOperations: (options: GraphqlToolsOptions, 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
+ export type { GraphqlCatalogOptions } from "./implementation/graphql-catalog.js";
6
+ /** Lazy tools with optional persistent metadata caching for the selected account. */
7
+ export declare const graphqlRouter: (options: GraphqlCatalogOptions, kinds?: OperationKinds) => Promise<import("./index.js").RouterDeclaration<unknown, unknown>>;
10
8
  export type { OperationKinds } from "./implementation/protocol-operations.js";
@@ -1,6 +1,7 @@
1
1
  import { type HostContext, type ResolvedAccountsInput } from "./contracts/host.js";
2
2
  import { type ElicitationHandler } from "./contracts/elicitation.js";
3
3
  export type { HostContext, ResolvedAccountsInput } from "./contracts/host.js";
4
+ export { isolatedCacheSession } from "./implementation/cache-session.js";
4
5
  /** Parse trusted account bindings and an optional exact-call approval. Throws safe boundary errors on invalid input. */
5
6
  export declare const hostContext: (accounts: ResolvedAccountsInput, approval?: unknown) => HostContext;
6
7
  /** Portable Promise handler. Invoke only after the host has authorized and resolved accounts. */
@@ -0,0 +1,12 @@
1
+ import { type RouterDeclaration } from "./router.js";
2
+ /**
3
+ * Discover each selected account's router and combine matching names.
4
+ * Calls take { accountId, input }; each branch retains its account's input schema,
5
+ * credentials, approval and output validation. Empty selections expose no operations.
6
+ * Discovery is sequential and cancellation follows the caller's signal.
7
+ */
8
+ export declare const accountRouter: <Account extends {
9
+ readonly id: string;
10
+ }>(accounts: readonly Account[], discover: (account: Account) => Promise<RouterDeclaration>, options: {
11
+ readonly signal: AbortSignal;
12
+ }) => Promise<RouterDeclaration>;
@@ -4,7 +4,7 @@ import type { AppRequirements, AppContext, QueryContext, MutationContext, Webhoo
4
4
  import { type PromiseMethods } from "./authoring.js";
5
5
  import { type WorkflowDeclaration } from "./workflows.js";
6
6
  import type { WorkflowContext } from "../contracts/workflows.js";
7
- import { type OperationDeclaration } from "./operations.js";
7
+ import { type RouterDeclaration } from "./router.js";
8
8
  import { type Schema } from "./schema.js";
9
9
  type PromiseCatalog<Catalog> = Catalog extends Readonly<Record<string, object>> ? {
10
10
  readonly [Name in keyof Catalog]: {
@@ -14,15 +14,16 @@ type PromiseCatalog<Catalog> = Catalog extends Readonly<Record<string, object>>
14
14
  /** Author definition projected from native capabilities. Excluding callable objects keeps
15
15
  * factories from being inferred as definitions and preserves contextual handler inference. */
16
16
  export type AppDefinition<Requirements extends AppRequirements> = {
17
- readonly [Key in keyof NativeDefinition<WebhookContext<Requirements>>]: Key extends "workflows" ? Readonly<Record<string, WorkflowDeclaration<WorkflowContext<Requirements>>>> : Key extends "schedules" ? Readonly<Record<string, ScheduleDeclaration<MutationContext<Requirements>>>> : Key extends "queries" ? Readonly<Record<string, OperationDeclaration<"query", QueryContext<Requirements>>>> : Key extends "mutations" ? Readonly<Record<string, OperationDeclaration<"mutation", MutationContext<Requirements>>>> : Key extends "webhooks" ? PromiseCatalog<NonNullable<NativeDefinition<WebhookContext<Requirements>>[Key]>> : NativeDefinition<WebhookContext<Requirements>>[Key];
17
+ readonly [Key in keyof NativeDefinition<WebhookContext<Requirements>>]: Key extends "workflows" ? Readonly<Record<string, WorkflowDeclaration<WorkflowContext<Requirements>>>> : Key extends "schedules" ? Readonly<Record<string, ScheduleDeclaration<MutationContext<Requirements>>>> : Key extends "tools" ? RouterDeclaration<QueryContext<Requirements>, MutationContext<Requirements>> : Key extends "webhooks" ? PromiseCatalog<NonNullable<NativeDefinition<WebhookContext<Requirements>>[Key]>> : NativeDefinition<WebhookContext<Requirements>>[Key];
18
18
  } & {
19
19
  readonly name?: never;
20
- readonly tools?: never;
20
+ readonly queries?: never;
21
+ readonly mutations?: never;
21
22
  readonly call?: never;
22
23
  };
23
24
  /** Adapt operation and webhook catalogs without evaluating their handlers. */
24
25
  export type EffectDefinition<Def> = {
25
- readonly [Key in keyof Def]: Key extends "workflows" ? Readonly<Record<string, import("../contracts/workflows.js").AppWorkflow>> : Key extends "schedules" ? NonNullable<NativeDefinition<unknown>["schedules"]> : Key extends "queries" | "mutations" ? Readonly<Record<string, import("../contracts/operations.js").AppOperation>> : Key extends "webhooks" ? NonNullable<NativeDefinition<WebhookContext>["webhooks"]> : Def[Key];
26
+ readonly [Key in keyof Def]: Key extends "tools" ? NonNullable<NativeDefinition<unknown>["tools"]> : Key extends "workflows" ? Readonly<Record<string, import("../contracts/workflows.js").AppWorkflow>> : Key extends "schedules" ? NonNullable<NativeDefinition<unknown>["schedules"]> : Key extends "webhooks" ? NonNullable<NativeDefinition<WebhookContext>["webhooks"]> : Key extends "skills" ? NonNullable<NativeDefinition<unknown>["skills"]> : Key extends "dynamicSkills" ? NonNullable<NativeDefinition<unknown>["dynamicSkills"]> : Def[Key];
26
27
  };
27
28
  declare const InternalApp: unique symbol;
28
29
  /** Recognize a declaration from this framework instance before host adaptation. */
@@ -0,0 +1,7 @@
1
+ import type { HostCache } from "../contracts/cache.js";
2
+ /** Own all refresh promises until drained or cancelled. Only generated trusted bridges create sessions. */
3
+ export declare const isolatedCacheSession: (callback: (input: unknown) => Promise<unknown>) => {
4
+ cache: HostCache;
5
+ drain: () => Promise<void>;
6
+ cancel: () => Promise<void>;
7
+ };
@@ -0,0 +1,8 @@
1
+ import type { AppCache, HostCache } from "../contracts/cache.js";
2
+ import type { ResolvedAccounts } from "../contracts/host.js";
3
+ /** Missing host support is explicit on use; ordinary apps do not need cache support. */
4
+ export declare const unavailableCache: HostCache;
5
+ /** Account scopes are derived from trusted current bindings. Loaders get a fresh owned HTTP signal. */
6
+ export declare const authorCache: (host: HostCache, accounts: ResolvedAccounts, signal: AbortSignal,
7
+ /** The invocation's trusted deadline. Waiting on another caller's load never runs past it. */
8
+ deadline?: number) => AppCache;
@@ -0,0 +1,36 @@
1
+ import { Duration, Effect, Schema } from "effect";
2
+ import type { AppCache, CacheLoadContext } from "../contracts/cache.js";
3
+ import { JsonObject, type JsonValue } from "../contracts/schema.js";
4
+ export interface CatalogCacheOptions {
5
+ /** App/build scope, optionally narrowed to the current account. */
6
+ readonly cache?: AppCache;
7
+ /** Reuse metadata for this duration. Defaults to five minutes. */
8
+ readonly freshFor?: Duration.Input;
9
+ /** Serve retained metadata while refreshing. Defaults to one day. */
10
+ readonly staleFor?: Duration.Input;
11
+ /** Await a fresh revision at an explicit logical connection or refresh boundary. */
12
+ readonly revalidate?: boolean;
13
+ }
14
+ /** One load: the tools, and optionally a record describing the whole catalog. */
15
+ export interface CatalogLoad<A> {
16
+ readonly tools: readonly A[];
17
+ readonly header?: JsonObject;
18
+ }
19
+ export declare const catalogCache: <A extends {
20
+ readonly name: string;
21
+ }, S>(options: CatalogCacheOptions & {
22
+ readonly prefix: readonly JsonValue[];
23
+ readonly schema: Schema.Decoder<A>;
24
+ /** Schema-free projection stored beside the full pages, so browsing never reads schemas. */
25
+ readonly summary: {
26
+ readonly schema: Schema.Decoder<S>;
27
+ readonly of: (tool: A) => S;
28
+ };
29
+ readonly load: (context?: CacheLoadContext) => Effect.Effect<CatalogLoad<A>, unknown>;
30
+ }) => Effect.Effect<{
31
+ list: () => Effect.Effect<readonly A[], unknown, never>;
32
+ /** The record stored with the current revision, if the source supplied one. */
33
+ header: () => Effect.Effect<JsonObject | undefined, unknown>;
34
+ summaries: () => Effect.Effect<S[], unknown, never>;
35
+ resolve: (name: string) => Effect.Effect<A | undefined, unknown, never>;
36
+ }, unknown, never>;
@@ -0,0 +1,7 @@
1
+ /** Author-facing lazy skill sources adapt once to the framework's Effect execution path. */
2
+ import type { DynamicSkills } from "../contracts/dynamic-skills.js";
3
+ import type { AppSkillSource } from "../contracts/skills.js";
4
+ /** Declare skills that load only when skills are read, such as `list: () => githubSkills({...})`. */
5
+ export declare const dynamicSkills: (source: {
6
+ readonly list: () => readonly AppSkillSource[] | Promise<readonly AppSkillSource[]>;
7
+ }) => DynamicSkills;