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
@@ -1,5 +1,6 @@
1
- /** Trusted bootstrap documents run before authored UI and never contain product credentials. */
1
+ /** Host responses around app sign-in. They carry no script and never contain product credentials. */
2
2
  import { HttpServerResponse } from "effect/unstable/http";
3
+ import { type AppSignInId } from "../contracts/ui-auth.js";
3
4
  /** Private app responses must not leak authentication URLs through caches or referrers. */
4
5
  export declare const appPrivateHeaders: {
5
6
  "cache-control": string;
@@ -7,7 +8,12 @@ export declare const appPrivateHeaders: {
7
8
  "x-content-type-options": string;
8
9
  "content-security-policy": string;
9
10
  };
10
- /** Serve only a fixed host script while authentication runs; the original URL remains available to that script. */
11
- export declare const appSignInPage: () => HttpServerResponse.HttpServerResponse;
12
- /** Preserve deep links, erase callback proofs before any request, and let the host set HttpOnly cookies. */
13
- export declare const appSignInScript: () => HttpServerResponse.HttpServerResponse;
11
+ /** Every sign-in hop is a server redirect, so the browser paints nothing until the app itself. */
12
+ export declare const appRedirect: (url: string) => HttpServerResponse.HttpServerResponse;
13
+ /**
14
+ * The callback URL carries the code in its query. It exists only as a redirect `Location`, never as
15
+ * a rendered document, and redeeming it also requires the attempt's HttpOnly cookie.
16
+ */
17
+ export declare const appSignInCallback: (origin: string, request: AppSignInId, code: string) => string;
18
+ /** A failed callback explains itself without script; reopening the app URL starts a new attempt. */
19
+ export declare const appSignInFailed: () => HttpServerResponse.HttpServerResponse;
@@ -9,8 +9,10 @@ export declare const appDocument: <E, R>(options: {
9
9
  readonly origin: string;
10
10
  readonly asset: (path: string) => Effect.Effect<AppUiAsset | undefined, E, R>;
11
11
  }) => 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.
12
+ /** Serve an asset only after the host has checked current access and file existence.
13
+ * Asset URLs name their deployment, so their bytes never change: the browser keeps them for a year
14
+ * and does not ask again. Shared proxies never store them. Revoking access stops every new request
15
+ * and all app data, while bytes a browser already downloaded stay in its cache.
14
16
  * HTML remains an uncached host-rendered entry point.
15
17
  */
16
18
  export declare const appAsset: (asset: AppUiAsset | undefined, build: string, path: string) => Effect.Effect<HttpServerResponse.HttpServerResponse, never, HttpServerRequest.HttpServerRequest>;
@@ -26,4 +26,4 @@ export declare const dispatchWebhook: <Context extends {
26
26
  readonly [x: string]: string;
27
27
  };
28
28
  readonly body: string;
29
- }, HostDeclarationInvalid | HostOperationNotFound | HostOperationFailed | HostInputInvalid | HostOutputInvalid, never>;
29
+ }, HostOperationNotFound | HostInputInvalid | HostOutputInvalid | HostDeclarationInvalid | HostOperationFailed, never>;
@@ -2,7 +2,15 @@
2
2
  import { Effect } from "effect";
3
3
  import type { AppDefinition } from "../contracts/app.js";
4
4
  import { WorkflowFailure, type WorkflowContext, type WorkflowExecution, type WorkflowStepContext } from "../contracts/workflows.js";
5
- /** Preserve typed failures and cancellation; authored exception text never leaves the app. */
6
- export declare const workflowSafe: <A>(work: Effect.Effect<A, unknown>) => Effect.Effect<A, WorkflowFailure>;
5
+ /**
6
+ * Preserve typed failures and cancellation. Other errors keep their name and bounded message,
7
+ * with the given account secrets replaced.
8
+ */
9
+ export declare const workflowSafe: <A>(work: Effect.Effect<A, unknown>, secrets: readonly string[]) => Effect.Effect<A, WorkflowFailure>;
7
10
  /** Construct one replay's Promise context. Step callbacks acquire fresh capabilities per actual attempt. */
8
- export declare const makeWorkflowContext: (execution: WorkflowExecution, definition: Pick<AppDefinition<never>, "queries" | "mutations">, fresh: (stepId: string, signal: AbortSignal) => Effect.Effect<WorkflowStepContext, WorkflowFailure>, signal: AbortSignal) => Effect.Effect<WorkflowContext>;
11
+ export declare const makeWorkflowContext: (execution: WorkflowExecution, definition: Pick<AppDefinition<never>, "tools">,
12
+ /** A step attempt's context, and the raw account secrets its failures must not reveal. */
13
+ fresh: (stepId: string, signal: AbortSignal) => Effect.Effect<{
14
+ readonly context: WorkflowStepContext;
15
+ readonly secrets: readonly string[];
16
+ }, WorkflowFailure>, signal: AbortSignal) => Effect.Effect<WorkflowContext>;
@@ -1,3 +1,6 @@
1
+ export { ProviderError } from "./contracts/provider-error.js";
2
+ export type { AppCache, CacheLoadContext, CacheGetOptions } from "./contracts/cache.js";
3
+ export { CacheError } from "../../app-cache/src/contracts/cache.js";
1
4
  /**
2
5
  * Public author API. Native contracts live in contracts/; this boundary
3
6
  * exposes ordinary declarations, schema helpers and Promise operations.
@@ -11,9 +14,13 @@ import { type PromiseMethods } from "./implementation/authoring.js";
11
14
  import { type Fields, type Infer, type ObjectSchema, type Schema } from "./implementation/schema.js";
12
15
  export { type JsonObject, type JsonValue, ValidationError } from "./contracts/schema.js";
13
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";
14
- export { type AccountOf, type AuthMethod, type AuthMethodData, type AuthMethods, type ManyAccounts, type OAuth2Config, type Provider, } from "./contracts/provider.js";
15
- export { defineProvider } from "./implementation/provider.js";
16
- export { accountOperations } from "./implementation/account-operations.js";
17
+ export { type AccountCheckContext, type AccountCheckResult, type AccountInfo, type AccountOf, type AuthMethod, type AuthMethodData, type AuthMethods, type ManyAccounts, type OAuth2Config, type Provider, } from "./contracts/provider.js";
18
+ export { defineProvider, type ProviderOptions } from "./implementation/provider.js";
19
+ export { accountRouter } from "./implementation/account-router.js";
20
+ export { router, dynamicRouter, type RouterDeclaration, type RouterChild, type RouterOptions, } from "./implementation/router.js";
21
+ export type { RouterIcon } from "./contracts/router.js";
22
+ export { dynamicSkills } from "./implementation/dynamic-skills.js";
23
+ export type { HostedTool as OperationDescription } from "./contracts/host.js";
17
24
  /** A secrets declaration inferred from an author schema. */
18
25
  export type SecretsMethod<Shape extends ObjectSchema<Fields>> = NativeSecretsMethod<EffectSchema.Decoder<Infer<Shape>>>;
19
26
  /** An OAuth declaration inferred from its author-facing response schema. */
@@ -56,3 +63,4 @@ export type { OperationContext } from "./contracts/operations.js";
56
63
  export { workflow, type Workflow, type WorkflowDeclaration } from "./implementation/workflows.js";
57
64
  export { NonRetryableError, WorkflowFailure, type WorkflowContext, type WorkflowStepContext, type WorkflowStep, type WorkflowStepOptions, type WorkflowDuration, type WorkflowReads, type WorkflowControls, } from "./contracts/workflows.js";
58
65
  export { interval, cron, type ScheduleDeclaration } from "./implementation/schedules.js";
66
+ export type { AppSkillSource as Skill, SkillFile } from "./contracts/skills.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,11 @@
1
1
  /** HTTP MCP helpers. Requires the optional @modelcontextprotocol/sdk peer. */
2
- import { type OperationKinds } from "./implementation/protocol-operations.js";
3
- import type { McpToolsOptions } from "./contracts/mcp.js";
2
+ import type { OperationKinds } from "./implementation/protocol-operations.js";
3
+ import { type McpCatalogOptions } from "./implementation/mcp-catalog.js";
4
+ export type { McpCatalogOptions } from "./implementation/mcp-catalog.js";
4
5
  export { McpError, type McpToolContext, type McpToolsOptions, type McpToolResult, } from "./contracts/mcp.js";
5
- /** Discover operations for the selected account. Kinds override uncertain upstream read-only hints. */
6
- export declare const mcpOperations: (options: McpToolsOptions, 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
- }>;
6
+ /**
7
+ * A router over a server's tools for the selected account. Its title, description and
8
+ * instructions come from the server. Kinds override uncertain upstream read-only hints.
9
+ */
10
+ export declare const mcpRouter: (options: McpCatalogOptions, kinds?: OperationKinds) => Promise<import("./index.js").RouterDeclaration<unknown, unknown>>;
10
11
  export type { OperationKinds } from "./implementation/protocol-operations.js";
@@ -1,10 +1,12 @@
1
1
  /** OpenAPI helpers over normalized operation metadata; no optional dependency is needed. */
2
2
  import { type OperationKinds } from "./implementation/protocol-operations.js";
3
3
  import type { OpenapiToolsOptions } from "./contracts/openapi.js";
4
- export { OpenapiError, type OpenapiToolsOptions, type OpenapiOperation, type CredentialBinding, type RequestParameter, } 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
- }>;
4
+ export { OpenapiError, isOpenapiTextMedia, openapiBinaryResultSchema, OpenapiErrorResponse, type OpenapiToolsOptions, type OpenapiOperation, type CredentialBinding, OpenapiParameter, OpenapiRequestBody, openapiMediaKind, } from "./contracts/openapi.js";
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
+ export * from "./contracts/openapi-compile.js";
12
+ export { liveOpenapiRouter, type OpenapiSourceOptions } from "./implementation/openapi-source.js";
@@ -0,0 +1,75 @@
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";
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.
6
+ */
7
+ export declare const githubSkills: (options: GitHubSkillsOptions) => Promise<readonly {
8
+ readonly name: string;
9
+ readonly description: string;
10
+ readonly files: readonly {
11
+ readonly path: string;
12
+ readonly content: string;
13
+ }[];
14
+ readonly license?: string;
15
+ readonly compatibility?: string;
16
+ readonly metadata?: {
17
+ readonly [x: string]: string;
18
+ };
19
+ readonly "allowed-tools"?: string;
20
+ }[]>;
21
+ /** Fetch a published skill index and its text files. Pass `cache: ctx.cache` to reuse the catalog. */
22
+ export declare const wellKnownSkills: (options: WellKnownSkillsOptions) => Promise<readonly {
23
+ readonly name: string;
24
+ readonly description: string;
25
+ readonly files: readonly {
26
+ readonly path: string;
27
+ readonly content: string;
28
+ }[];
29
+ readonly license?: string;
30
+ readonly compatibility?: string;
31
+ readonly metadata?: {
32
+ readonly [x: string]: string;
33
+ };
34
+ readonly "allowed-tools"?: string;
35
+ }[]>;
36
+ /** Parse a bundled standard skill directory into an app capability. */
37
+ export declare const fileSkill: (files: readonly SkillFile[]) => Promise<{
38
+ readonly name: string;
39
+ readonly description: string;
40
+ readonly files: readonly {
41
+ readonly path: string;
42
+ readonly content: string;
43
+ }[];
44
+ readonly license?: string;
45
+ readonly compatibility?: string;
46
+ readonly metadata?: {
47
+ readonly [x: string]: string;
48
+ };
49
+ readonly "allowed-tools"?: string;
50
+ }>;
51
+ /** Read skill directories from ctx.files. Omitted path selects skills/; missing folders return []. */
52
+ export declare const folderSkills: (options: FolderSkillsOptions) => Promise<readonly {
53
+ readonly name: string;
54
+ readonly description: string;
55
+ readonly files: readonly {
56
+ readonly path: string;
57
+ readonly content: string;
58
+ }[];
59
+ readonly license?: string;
60
+ readonly compatibility?: string;
61
+ readonly metadata?: {
62
+ readonly [x: string]: string;
63
+ };
64
+ readonly "allowed-tools"?: string;
65
+ }[]>;
66
+ /**
67
+ * 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
+ */
70
+ export declare const skillReader: (options: SkillReaderOptions) => {
71
+ /** Fetch one UTF-8 text file. */
72
+ text: (url: string) => Promise<string>;
73
+ /** Fetch and parse one JSON document. */
74
+ json: (url: string) => Promise<unknown>;
75
+ };
@@ -1,3 +1,3 @@
1
- /** Host-only app authentication protocol and bootstrap; products supply identity and session lifecycle. */
1
+ /** Host-only app authentication protocol; products supply identity and session lifecycle. */
2
2
  export * from "./contracts/ui-auth.js";
3
- export { appPrivateHeaders, appSignInPage, appSignInScript } from "./implementation/ui-auth.js";
3
+ export { appPrivateHeaders, appRedirect, appSignInCallback, appSignInFailed, } from "./implementation/ui-auth.js";
@@ -1,8 +1,11 @@
1
1
  /** Correlate transport and decoded outcomes without exporting response bodies or errors. */
2
2
  import { Effect, Schema, Tracer } from "effect";
3
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;
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
11
  readonly error_type: Schema.Literals<readonly ["BrowserDecodeFailed", "BrowserTransportFailed", "BrowserOperationFailed"]>;
@@ -1,5 +1,7 @@
1
1
  /** Telemetry configuration is parsed at composition roots; headers remain redacted. */
2
2
  import { Config, Context, Effect, Schema } from "effect";
3
+ /** Bound each collector request, including its acknowledgement; exporter retries retain the batch. */
4
+ export declare const telemetryRequestTimeout: "5 seconds";
3
5
  /** One private exporter target. Endpoints are complete signal URLs. */
4
6
  export declare const TelemetryTarget: Schema.Struct<{
5
7
  readonly url: Schema.String;
@@ -1,389 +0,0 @@
1
- import {
2
- ApprovalElicitation,
3
- ElicitationFailed,
4
- OAuth2Config,
5
- OperationSchedule,
6
- WorkflowCommand,
7
- WorkflowFailure
8
- } from "./chunk-HP7E42X6.js";
9
- import {
10
- DatabaseSchema
11
- } from "./chunk-7JXHF5IF.js";
12
- import {
13
- AccountId,
14
- HttpUrl,
15
- JsonObject,
16
- JsonValue
17
- } from "./chunk-36DNRFZQ.js";
18
- import {
19
- Context_exports,
20
- Schema_exports
21
- } from "./chunk-2OTCEKL2.js";
22
-
23
- // src/contracts/tools.ts
24
- var ToolAnnotations = Schema_exports.Struct({
25
- title: Schema_exports.optionalKey(Schema_exports.String),
26
- readOnlyHint: Schema_exports.optionalKey(Schema_exports.Boolean),
27
- destructiveHint: Schema_exports.optionalKey(Schema_exports.Boolean),
28
- idempotentHint: Schema_exports.optionalKey(Schema_exports.Boolean),
29
- openWorldHint: Schema_exports.optionalKey(Schema_exports.Boolean)
30
- });
31
-
32
- // src/contracts/mcp.ts
33
- var McpClientLimits = Schema_exports.Struct({
34
- timeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
35
- maxTimeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
36
- maxTools: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
37
- maxPaginationCursors: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
38
- cleanupTimeoutMs: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
39
- });
40
- var defaultMcpClientLimits = McpClientLimits.make({
41
- timeoutMs: 3e4,
42
- maxTimeoutMs: 3e5,
43
- maxTools: 5e4,
44
- maxPaginationCursors: 1e3,
45
- cleanupTimeoutMs: 1e3
46
- });
47
- var mcpSdkTimerCeilingMs = 2147483647;
48
- var McpToolsOptions = Schema_exports.Struct({
49
- url: HttpUrl,
50
- headers: Schema_exports.optional(Schema_exports.Record(Schema_exports.String, Schema_exports.String)),
51
- signal: Schema_exports.optional(Schema_exports.instanceOf(AbortSignal)),
52
- timeoutMs: Schema_exports.optional(
53
- Schema_exports.Number.check(
54
- Schema_exports.isInt(),
55
- Schema_exports.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs })
56
- )
57
- )
58
- });
59
- var McpToolResult = Schema_exports.Struct({
60
- content: Schema_exports.Array(JsonObject),
61
- structuredContent: Schema_exports.optional(JsonObject),
62
- isError: Schema_exports.optional(Schema_exports.Boolean),
63
- _meta: Schema_exports.optional(JsonObject)
64
- });
65
- var McpToolMetadata = Schema_exports.Struct({
66
- name: Schema_exports.String,
67
- title: Schema_exports.optional(Schema_exports.String),
68
- description: Schema_exports.optional(Schema_exports.String),
69
- inputSchema: JsonObject,
70
- outputSchema: Schema_exports.optional(JsonObject),
71
- annotations: Schema_exports.optional(ToolAnnotations),
72
- _meta: Schema_exports.optional(JsonObject)
73
- });
74
- var McpError = class extends Schema_exports.TaggedError()("McpError", {
75
- phase: Schema_exports.Literals(["connect", "discover", "call", "schema", "transport"]),
76
- reason: Schema_exports.Literals([
77
- "request",
78
- "unauthorized",
79
- "invalid_response",
80
- "timeout",
81
- "invalid_input"
82
- ]),
83
- status: Schema_exports.optional(Schema_exports.Number)
84
- }) {
85
- };
86
- var ProcessConfig = Schema_exports.Struct({
87
- command: Schema_exports.NonEmptyString,
88
- args: Schema_exports.Array(Schema_exports.String),
89
- cwd: Schema_exports.optional(Schema_exports.String),
90
- env: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
91
- timeoutMs: Schema_exports.Int.check(
92
- Schema_exports.isBetween({ minimum: 1, maximum: defaultMcpClientLimits.maxTimeoutMs })
93
- )
94
- });
95
-
96
- // src/contracts/webhook-protocol.ts
97
- var WebhookTransportLimits = Schema_exports.Struct({
98
- maxBodyBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
99
- });
100
- var defaultWebhookTransportLimits = WebhookTransportLimits.make({
101
- maxBodyBytes: 1024 * 1024
102
- });
103
- var encodedBodyChars = 4 * Math.ceil(defaultWebhookTransportLimits.maxBodyBytes / 3);
104
- var WebhookRequestData = Schema_exports.Struct({
105
- url: HttpUrl,
106
- method: Schema_exports.Literals(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]),
107
- headers: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
108
- body: Schema_exports.String.check(Schema_exports.isMaxLength(encodedBodyChars))
109
- });
110
- var WebhookResponseData = Schema_exports.Struct({
111
- status: Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 200, maximum: 599 })),
112
- headers: Schema_exports.Record(Schema_exports.String, Schema_exports.String),
113
- body: Schema_exports.String.check(Schema_exports.isMaxLength(encodedBodyChars))
114
- });
115
- var ManualWebhookSetup = Schema_exports.Struct({
116
- instructions: Schema_exports.NonEmptyString,
117
- signingSecret: Schema_exports.Literals(["executor", "provider"])
118
- });
119
- var ManualWebhookDescriptor = Schema_exports.Struct({
120
- ...ManualWebhookSetup.fields,
121
- stateSchema: JsonObject
122
- });
123
- var HostedWebhook = Schema_exports.Struct({
124
- name: Schema_exports.NonEmptyString,
125
- account: Schema_exports.NonEmptyString,
126
- configSchema: JsonObject,
127
- setup: Schema_exports.optionalKey(ManualWebhookDescriptor)
128
- });
129
- var identity = {
130
- name: Schema_exports.NonEmptyString,
131
- subscriptionId: Schema_exports.NonEmptyString,
132
- sourceAccount: AccountId,
133
- callbackUrl: HttpUrl,
134
- secret: Schema_exports.String,
135
- config: JsonValue
136
- };
137
- var WebhookCommand = Schema_exports.Union([
138
- Schema_exports.Struct({ operation: Schema_exports.Literal("webhooks") }),
139
- Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-validate"), ...identity }),
140
- Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-complete"), ...identity, state: JsonValue }),
141
- Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-register"), ...identity }),
142
- Schema_exports.Struct({ operation: Schema_exports.Literal("webhook-unregister"), ...identity, state: JsonValue }),
143
- Schema_exports.Struct({
144
- operation: Schema_exports.Literal("webhook-handle"),
145
- ...identity,
146
- state: JsonValue,
147
- request: WebhookRequestData
148
- })
149
- ]);
150
-
151
- // src/contracts/operations.ts
152
- var OperationToolPrefixes = { query: "queries.", mutate: "mutations." };
153
-
154
- // src/contracts/host.ts
155
- var DeclaredAuthMethod = Schema_exports.Union([
156
- Schema_exports.Struct({ type: Schema_exports.Literal("secrets"), label: Schema_exports.String, fields: JsonObject }),
157
- Schema_exports.Struct({
158
- type: Schema_exports.Literal("oauth2"),
159
- ...OAuth2Config.members[0].fields,
160
- response: JsonObject
161
- }),
162
- Schema_exports.Struct({
163
- type: Schema_exports.Literal("oauth2"),
164
- ...OAuth2Config.members[1].fields,
165
- response: JsonObject
166
- }),
167
- Schema_exports.Struct({
168
- type: Schema_exports.Literal("oauth2"),
169
- ...OAuth2Config.members[2].fields,
170
- response: JsonObject
171
- }),
172
- Schema_exports.Struct({
173
- type: Schema_exports.Literal("oauth2"),
174
- ...OAuth2Config.members[3].fields,
175
- response: JsonObject
176
- })
177
- ]);
178
- var DeclaredProvider = Schema_exports.Struct({
179
- name: Schema_exports.NonEmptyString,
180
- auth: Schema_exports.Record(Schema_exports.NonEmptyString, DeclaredAuthMethod)
181
- });
182
- var DeclaredRequirements = Schema_exports.Struct({
183
- database: Schema_exports.optionalKey(DatabaseSchema),
184
- accounts: Schema_exports.Record(
185
- Schema_exports.NonEmptyString,
186
- Schema_exports.Struct({
187
- definition: DeclaredProvider,
188
- cardinality: Schema_exports.Literals(["one", "many"])
189
- })
190
- )
191
- });
192
- var ResolvedAccount = Schema_exports.Struct({
193
- id: AccountId,
194
- provider: DeclaredProvider,
195
- method: Schema_exports.NonEmptyString,
196
- fields: JsonObject
197
- });
198
- var ResolvedAccounts = Schema_exports.Record(
199
- Schema_exports.NonEmptyString,
200
- Schema_exports.Union([ResolvedAccount, Schema_exports.Array(ResolvedAccount)])
201
- );
202
- var TrustedToolApproval = Schema_exports.Struct({ tool: Schema_exports.NonEmptyString, input: JsonValue });
203
- var HostedTool = Schema_exports.Struct({
204
- schedules: Schema_exports.optionalKey(Schema_exports.Array(OperationSchedule)),
205
- name: Schema_exports.NonEmptyString,
206
- description: Schema_exports.String,
207
- inputSchema: JsonObject,
208
- readOnly: Schema_exports.optionalKey(Schema_exports.Boolean),
209
- title: Schema_exports.optionalKey(Schema_exports.String),
210
- outputSchema: Schema_exports.optionalKey(JsonObject),
211
- annotations: Schema_exports.optionalKey(ToolAnnotations),
212
- _meta: Schema_exports.optionalKey(JsonObject)
213
- });
214
- var HostRequest = Schema_exports.Union([
215
- WorkflowCommand,
216
- WebhookCommand,
217
- Schema_exports.Struct({ operation: Schema_exports.Literal("requirements") }),
218
- Schema_exports.Struct({ operation: Schema_exports.Literal("inspect") }),
219
- Schema_exports.Struct({
220
- operation: Schema_exports.Literal("query"),
221
- name: Schema_exports.NonEmptyString,
222
- input: JsonValue
223
- }),
224
- Schema_exports.Struct({
225
- operation: Schema_exports.Literal("mutate"),
226
- name: Schema_exports.NonEmptyString,
227
- input: JsonValue
228
- }),
229
- Schema_exports.Struct({
230
- operation: Schema_exports.Literal("call"),
231
- tool: Schema_exports.NonEmptyString,
232
- input: JsonValue
233
- })
234
- ]);
235
- var HostRequestInvalid = class extends Schema_exports.TaggedError()(
236
- "HostRequestInvalid",
237
- {}
238
- ) {
239
- };
240
- var HostAccountsInvalid = class extends Schema_exports.TaggedError()(
241
- "HostAccountsInvalid",
242
- {}
243
- ) {
244
- };
245
- var HostDeclarationInvalid = class extends Schema_exports.TaggedError()(
246
- "HostDeclarationInvalid",
247
- {}
248
- ) {
249
- };
250
- var HostEvaluationFailed = class extends Schema_exports.TaggedError()(
251
- "HostEvaluationFailed",
252
- {}
253
- ) {
254
- };
255
- var HostOperationNotFound = class extends Schema_exports.TaggedError()(
256
- "HostOperationNotFound",
257
- {}
258
- ) {
259
- };
260
- var HostOperationFailed = class extends Schema_exports.TaggedError()(
261
- "HostOperationFailed",
262
- {}
263
- ) {
264
- };
265
- var HostToolNotFound = class extends Schema_exports.TaggedError()(
266
- "HostToolNotFound",
267
- {}
268
- ) {
269
- };
270
- var HostInputInvalid = class extends Schema_exports.TaggedError()(
271
- "HostInputInvalid",
272
- {}
273
- ) {
274
- };
275
- var HostToolBlocked = class extends Schema_exports.TaggedError()("HostToolBlocked", {}) {
276
- };
277
- var HostToolApprovalRequired = class extends Schema_exports.TaggedError()(
278
- "HostToolApprovalRequired",
279
- { input: JsonValue, elicitation: ApprovalElicitation }
280
- ) {
281
- };
282
- var HostToolPolicyFailed = class extends Schema_exports.TaggedError()(
283
- "HostToolPolicyFailed",
284
- {}
285
- ) {
286
- };
287
- var HostOutputInvalid = class extends Schema_exports.TaggedError()(
288
- "HostOutputInvalid",
289
- {}
290
- ) {
291
- };
292
- var HostRequirementsError = Schema_exports.Union([HostRequestInvalid, HostDeclarationInvalid]);
293
- var HostInspectError = Schema_exports.Union([
294
- HostRequestInvalid,
295
- HostDeclarationInvalid,
296
- HostAccountsInvalid,
297
- HostEvaluationFailed
298
- ]);
299
- var HostCallError = Schema_exports.Union([
300
- WorkflowFailure,
301
- HostInspectError,
302
- HostToolNotFound,
303
- HostOperationNotFound,
304
- HostOperationFailed,
305
- HostInputInvalid,
306
- HostOutputInvalid,
307
- HostToolBlocked,
308
- HostToolApprovalRequired,
309
- HostToolPolicyFailed,
310
- ElicitationFailed
311
- ]);
312
- var HostDataError = HostCallError;
313
- var HostError = Schema_exports.Union([
314
- WorkflowFailure,
315
- HostRequestInvalid,
316
- HostAccountsInvalid,
317
- HostDeclarationInvalid,
318
- HostEvaluationFailed,
319
- HostOperationNotFound,
320
- HostOperationFailed,
321
- HostToolNotFound,
322
- HostInputInvalid,
323
- HostOutputInvalid,
324
- HostToolBlocked,
325
- HostToolApprovalRequired,
326
- HostToolPolicyFailed,
327
- ElicitationFailed
328
- ]);
329
- var ToolResultObservation = Context_exports.Reference(
330
- "apps/ToolResultObservation",
331
- { defaultValue: () => ({ failed: () => {
332
- } }) }
333
- );
334
- var HostResponse = Schema_exports.Union([
335
- Schema_exports.Struct({
336
- ok: Schema_exports.Literal(true),
337
- value: JsonValue,
338
- toolError: Schema_exports.optionalKey(Schema_exports.Literal(true))
339
- }),
340
- Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError })
341
- ]);
342
-
343
- export {
344
- ToolAnnotations,
345
- McpClientLimits,
346
- defaultMcpClientLimits,
347
- mcpSdkTimerCeilingMs,
348
- McpToolsOptions,
349
- McpToolResult,
350
- McpToolMetadata,
351
- McpError,
352
- ProcessConfig,
353
- WebhookTransportLimits,
354
- defaultWebhookTransportLimits,
355
- WebhookRequestData,
356
- WebhookResponseData,
357
- ManualWebhookSetup,
358
- ManualWebhookDescriptor,
359
- HostedWebhook,
360
- WebhookCommand,
361
- OperationToolPrefixes,
362
- DeclaredAuthMethod,
363
- DeclaredProvider,
364
- DeclaredRequirements,
365
- ResolvedAccount,
366
- ResolvedAccounts,
367
- TrustedToolApproval,
368
- HostedTool,
369
- HostRequest,
370
- HostRequestInvalid,
371
- HostAccountsInvalid,
372
- HostDeclarationInvalid,
373
- HostEvaluationFailed,
374
- HostOperationNotFound,
375
- HostOperationFailed,
376
- HostToolNotFound,
377
- HostInputInvalid,
378
- HostToolBlocked,
379
- HostToolApprovalRequired,
380
- HostToolPolicyFailed,
381
- HostOutputInvalid,
382
- HostRequirementsError,
383
- HostInspectError,
384
- HostCallError,
385
- HostDataError,
386
- HostError,
387
- ToolResultObservation,
388
- HostResponse
389
- };