apps 0.0.1-beta.35 → 0.0.1-beta.37

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 (55) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-KZFV3WCJ.js → chunk-24EIFQYZ.js} +377 -50
  3. package/js/chunk-2FWXCU5I.js +16 -0
  4. package/js/{chunk-YYK6GEMC.js → chunk-3LRFKLUX.js} +24 -17
  5. package/js/{chunk-VBVOPW4U.js → chunk-7KEKFBV7.js} +1 -1
  6. package/js/{chunk-FFTALB6S.js → chunk-BWUHMKHQ.js} +1 -1
  7. package/js/{chunk-KBXQOJYW.js → chunk-CAOHGMNW.js} +2 -2
  8. package/js/{chunk-SRB2WDU7.js → chunk-D45FU4TZ.js} +1 -1
  9. package/js/{chunk-UWOIEJ56.js → chunk-GHDZEEPO.js} +26 -31
  10. package/js/{chunk-I7CNZ4CM.js → chunk-KEZ4YZSP.js} +18 -4
  11. package/js/{chunk-5KNA2Z5I.js → chunk-LQBR7AI7.js} +294 -164
  12. package/js/{chunk-LUROQKFP.js → chunk-QQKHJ72Y.js} +18 -10
  13. package/js/{chunk-IA3VSGR4.js → chunk-U74JVKTQ.js} +3 -3
  14. package/js/{chunk-5CQMUXW7.js → chunk-UCOMVHGW.js} +2 -2
  15. package/js/client.js +2 -1
  16. package/js/contracts.js +7 -4
  17. package/js/effect.js +10 -9
  18. package/js/graphql.js +11 -10
  19. package/js/host.js +10 -9
  20. package/js/index.js +5 -4
  21. package/js/mcp/effect.js +12 -11
  22. package/js/mcp/stdio.js +12 -11
  23. package/js/mcp.js +13 -12
  24. package/js/openapi.js +9 -8
  25. package/js/skills/effect.js +3 -2
  26. package/js/skills.js +47 -33
  27. package/js/ui/serving.js +2 -1
  28. package/package.json +1 -1
  29. package/runtime.json +1 -1
  30. package/types/apps/src/contracts/host.d.ts +10 -6
  31. package/types/apps/src/contracts/mcp.d.ts +6 -1
  32. package/types/apps/src/contracts/openapi.d.ts +1 -1
  33. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  34. package/types/apps/src/contracts/protocols/1.d.ts +8 -1
  35. package/types/apps/src/contracts/protocols/2.d.ts +1 -1
  36. package/types/apps/src/contracts/protocols/3.d.ts +1 -2
  37. package/types/apps/src/contracts/protocols/4.d.ts +1 -2
  38. package/types/apps/src/contracts/protocols/5.d.ts +3 -3
  39. package/types/apps/src/contracts/protocols/6.d.ts +3 -3
  40. package/types/apps/src/contracts/protocols/7.d.ts +3 -3
  41. package/types/apps/src/contracts/protocols/8.d.ts +13 -2
  42. package/types/apps/src/contracts/protocols/9.d.ts +1106 -0
  43. package/types/apps/src/contracts/skills.d.ts +5 -0
  44. package/types/apps/src/contracts/workflows.d.ts +6 -0
  45. package/types/apps/src/implementation/failure-detail.d.ts +4 -3
  46. package/types/apps/src/implementation/mcp-client.d.ts +1 -1
  47. package/types/apps/src/implementation/mcp.d.ts +1 -1
  48. package/types/apps/src/implementation/openapi-compile.d.ts +1 -1
  49. package/types/apps/src/implementation/router-catalog.d.ts +2 -3
  50. package/types/apps/src/implementation/skills.d.ts +8 -8
  51. package/types/apps/src/skills.d.ts +2 -1
  52. package/types/telemetry/src/app-records.d.ts +42 -0
  53. package/types/telemetry/src/recorded-failure.d.ts +20 -0
  54. package/types/utils/src/api-error.d.ts +5 -0
  55. package/types/utils/src/recorded-message.d.ts +15 -0
@@ -79,11 +79,16 @@ declare const SkillLoadFailed_base: Schema.Class<SkillLoadFailed, Schema.TaggedS
79
79
  readonly reason: Schema.Literals<readonly ["source", "request", "rate_limited", "document", "limit", "changed", "encoding"]>;
80
80
  readonly message: Schema.optional<Schema.String>;
81
81
  readonly status: Schema.optional<Schema.Int>;
82
+ readonly missing: Schema.optional<Schema.Literals<readonly ["repository", "ref"]>>;
82
83
  }>, import("effect/Cause").YieldableError>;
83
84
  /**
84
85
  * A skill loader failure shown to people. `message` is the explanation they read; write it for
85
86
  * them and never include URLs, tokens or response bodies. `reason` selects the title and whether
86
87
  * a retry can help. Custom loaders throw this error to get the same presentation as built-ins.
88
+ * With `source`, `missing` names what the service's answer points to as missing: the `repository`,
89
+ * or the branch or tag (`ref`). It may be missing, or not readable with the request's credentials.
90
+ * Without it, the source's settings or the paths it lists are not valid.
91
+ * These fields choose the explanation; they never show that the failure lies outside Executor.
87
92
  */
88
93
  export declare class SkillLoadFailed extends SkillLoadFailed_base {
89
94
  }
@@ -1,5 +1,6 @@
1
1
  /** Portable workflow declarations, run views and durable execution capabilities. */
2
2
  import { Schema, type Effect } from "effect";
3
+ import { RecordedMessage } from "../../../utils/src/recorded-message.js";
3
4
  import { JsonValue } from "./schema.js";
4
5
  import type { AppContext, AppRequirements, QueryContext, MutationContext } from "./context.js";
5
6
  import type { Operation } from "../implementation/operations.js";
@@ -49,6 +50,11 @@ declare const WorkflowFailure_base: Schema.Class<WorkflowFailure, Schema.TaggedS
49
50
  }>, import("effect/Cause").YieldableError>;
50
51
  /** Failures cross host boundaries as reason codes plus the app's own bounded error detail. */
51
52
  export declare class WorkflowFailure extends WorkflowFailure_base {
53
+ /**
54
+ * The step name and error detail are the app's. Its run's owner reads them; telemetry records
55
+ * only the reason, however the failure was built or decoded.
56
+ */
57
+ get [RecordedMessage](): string | undefined;
52
58
  }
53
59
  /** Explicitly stop retrying an authored step. Its message is reported like any step error. */
54
60
  export declare class NonRetryableError extends Error {
@@ -1,6 +1,5 @@
1
1
  import { Option, Redacted } from "effect";
2
- import type { ResolvedAccounts } from "../contracts/host.js";
3
- import { McpError } from "../contracts/mcp.js";
2
+ import { McpError as HostMcpError, SkillLoadFailed as HostSkillLoadFailed, type ResolvedAccounts } from "../contracts/host.js";
4
3
  import type { ProviderError } from "../contracts/provider-error.js";
5
4
  import { type FailureFields, type FailurePhase, type UpstreamError } from "../contracts/failure.js";
6
5
  /** Fields of `FailureDetail` as constructor input. */
@@ -34,7 +33,9 @@ export declare const leavingProviderError: (error: ProviderError, secrets: reado
34
33
  * Rebuild an MCP failure's allowlisted fields, with account secrets replaced in the server's
35
34
  * error. Absent fields have no key, as catalogs cross the boundary as JSON values.
36
35
  */
37
- export declare const parseMcpError: (error: unknown, secrets: readonly string[]) => Option.Option<McpError>;
36
+ export declare const parseMcpError: (error: unknown, secrets: readonly string[]) => Option.Option<HostMcpError>;
37
+ /** Rebuild only the allowlisted skill loader fields from an author-visible rejection. */
38
+ export declare const parseSkillLoadFailed: (error: unknown) => Option.Option<HostSkillLoadFailed>;
38
39
  /** `Name: message` for any thrown value, before redaction. */
39
40
  export declare const describeFailure: (error: unknown) => string;
40
41
  /**
@@ -46,8 +46,8 @@ export declare function mcpClient(withClient: WithMcpClient, timeoutMs: number,
46
46
  readonly description?: string;
47
47
  readonly version?: string;
48
48
  readonly name?: string;
49
- readonly title?: string;
50
49
  readonly instructions?: string;
50
+ readonly title?: string;
51
51
  readonly icons?: readonly {
52
52
  readonly src: string;
53
53
  readonly mimeType?: string;
@@ -30,8 +30,8 @@ export declare const mcpClientEffect: (input: McpToolsOptions, changed?: Effect.
30
30
  readonly description?: string;
31
31
  readonly version?: string;
32
32
  readonly name?: string;
33
- readonly title?: string;
34
33
  readonly instructions?: string;
34
+ readonly title?: string;
35
35
  readonly icons?: readonly {
36
36
  readonly src: string;
37
37
  readonly mimeType?: string;
@@ -68,7 +68,7 @@ export declare const compileOpenApiDocument: (entry: OpenApiImport, inputDocumen
68
68
  readonly input: {
69
69
  readonly [x: string]: Schema.Json;
70
70
  };
71
- readonly method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS" | "QUERY";
71
+ readonly method: "HEAD" | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "OPTIONS" | "QUERY";
72
72
  readonly securitySchemes: {
73
73
  readonly [x: string]: {
74
74
  readonly [x: string]: Schema.Json;
@@ -6,7 +6,6 @@ import { Effect, Schema } from "effect";
6
6
  import { HostDeclarationInvalid, HostEvaluationFailed, type HostRouterError } from "../contracts/host.js";
7
7
  import type { AppOperation } from "../contracts/operations.js";
8
8
  import type { AppRouter, DynamicRouter, RouterMeta } from "../contracts/router.js";
9
- import { SkillLoadFailed } from "../contracts/skills.js";
10
9
  import type { OperationSchedule } from "../contracts/schedules.js";
11
10
  /**
12
11
  * Keep only a failure's safe fields. Anything unrecognized becomes an evaluation failure with the
@@ -189,7 +188,7 @@ export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined,
189
188
  routers: {
190
189
  readonly path: string;
191
190
  readonly description?: string;
192
- readonly error?: import("../index.js").ProviderError | SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed | import("../mcp.js").McpError;
191
+ readonly error?: import("../index.js").ProviderError | HostDeclarationInvalid | HostEvaluationFailed | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed;
193
192
  readonly title?: string;
194
193
  readonly tags?: {
195
194
  readonly [x: string]: string;
@@ -202,7 +201,7 @@ export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined,
202
201
  }[];
203
202
  readonly skill?: string;
204
203
  }[];
205
- }, import("../index.js").ProviderError | SkillLoadFailed | HostDeclarationInvalid | HostEvaluationFailed | import("../mcp.js").McpError, never>;
204
+ }, import("../index.js").ProviderError | HostDeclarationInvalid | HostEvaluationFailed | import("../contracts/host.js").McpError | import("../contracts/host.js").SkillLoadFailed, never>;
206
205
  /**
207
206
  * One skill for each router with instructions. Skills and tools fail independently: a dynamic
208
207
  * router whose metadata cannot be read, including the root, contributes no skill and does not
@@ -4,21 +4,21 @@ import { NetworkRefused } from "../contracts/network.js";
4
4
  import { ProviderError } from "../contracts/provider-error.js";
5
5
  import { AppSkills, SkillLoadFailed, type GitHubSkillsOptions, type WellKnownSkillsOptions, type SkillTransport } from "../contracts/skills.js";
6
6
  /** Give every failure without a message one that names the service. */
7
- 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
8
  interface ReadRequest {
9
9
  readonly headers?: Readonly<Record<string, string>>;
10
- /** Describe a refusal by Executor's app network; defaults to the refusal's own message. */
11
- readonly refused?: (refused: NetworkRefused) => SkillLoadFailed;
10
+ /** Describe a refusal by Executor's app network; defaults to the refusal itself. */
11
+ readonly refused?: (refused: NetworkRefused) => SkillLoadFailed | NetworkRefused;
12
12
  }
13
13
  /** One loader invocation owns its byte budget and all of its network requests. */
14
14
  export declare const reader: (transport: SkillTransport) => Effect.Effect<{
15
15
  fetchBytes: (url: string, request?: ReadRequest & {
16
16
  readonly body?: Uint8Array;
17
- }) => Effect.Effect<Uint8Array<ArrayBuffer>, SkillLoadFailed, never>;
18
- read: (url: string, request?: ReadRequest) => Effect.Effect<string, SkillLoadFailed, never>;
19
- json: (url: string) => Effect.Effect<unknown, SkillLoadFailed, never>;
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>;
20
20
  }, never, never>;
21
- export declare const githubSkillsEffect: (options: GitHubSkillsOptions) => Effect.Effect<typeof AppSkills.Type, SkillLoadFailed | ProviderError>;
21
+ export declare const githubSkillsEffect: (options: GitHubSkillsOptions) => Effect.Effect<typeof AppSkills.Type, SkillLoadFailed | NetworkRefused | ProviderError>;
22
22
  /** Fetch all indexed files and reject a publication whose index changes during the read. */
23
23
  export declare const wellKnownSkillsEffect: (options: WellKnownSkillsOptions) => Effect.Effect<readonly {
24
24
  readonly description: string;
@@ -33,5 +33,5 @@ export declare const wellKnownSkillsEffect: (options: WellKnownSkillsOptions) =>
33
33
  readonly [x: string]: string;
34
34
  };
35
35
  readonly "allowed-tools"?: string;
36
- }[], SkillLoadFailed, never>;
36
+ }[], NetworkRefused | SkillLoadFailed, never>;
37
37
  export {};
@@ -66,7 +66,8 @@ export declare const folderSkills: (options: FolderSkillsOptions) => Promise<rea
66
66
  }[]>;
67
67
  /**
68
68
  * Read files for a custom remote skill loader, such as one for GitLab. Reads share one byte
69
- * 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.
70
71
  */
71
72
  export declare const skillReader: (options: SkillReaderOptions) => {
72
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 {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Failures as Executor's telemetry records them. An error whose message can carry an app's own
3
+ * text declares a fixed sentence instead (see `RecordedMessage`); traces and error reports record
4
+ * that sentence with the error's name. The error itself, and what its caller receives, are
5
+ * unchanged.
6
+ */
7
+ import { Cause } from "effect";
8
+ /**
9
+ * The error a trace or error report records in place of `error`. Its stack is generated here and
10
+ * names no frames: the error's own stack begins with its message, which can span lines that look
11
+ * like frames, so none of its text is kept. Traces still show where it failed through the
12
+ * operation's own spans, which Effect appends to a recorded stack.
13
+ */
14
+ export declare const recordedError: (error: unknown) => unknown;
15
+ /**
16
+ * A failure's cause as traces record it. A defect is recorded the same way when it is an error that
17
+ * declares a recorded message, such as a workflow failure a host turned into a defect; other
18
+ * defects and interruptions are unchanged. Each reason keeps its annotations, which locate it.
19
+ */
20
+ export declare const recordedCause: <E>(cause: Cause.Cause<E>) => Cause.Cause<unknown>;
@@ -23,6 +23,11 @@ type Definition<Tag extends string, Fields extends Schema.Struct.Fields> = Heade
23
23
  * record, so it never includes credentials, upstream response text or submitted values.
24
24
  */
25
25
  readonly message: string | ((fields: Schema.Struct.Type<Fields>) => string);
26
+ /**
27
+ * What traces and error reports record instead of `message`, when the message quotes an app's
28
+ * own error or a service's stated error for its caller. Only fixed text and typed fields.
29
+ */
30
+ readonly recorded?: (fields: Schema.Struct.Type<Fields>) => string;
26
31
  };
27
32
  type ErrorFields<Tag extends string, Fields extends Schema.Struct.Fields> = Omit<Schema.TaggedStruct<Tag, Fields & {
28
33
  readonly message: typeof MessageField;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What traces and error reports record for an error in place of its message. An error declares
3
+ * one when its message can carry text from outside Executor: an app's own error or output, or an
4
+ * error a service stated through an app. That text still reaches the caller the error is for;
5
+ * Executor's telemetry records only this fixed sentence, beside the error's name.
6
+ */
7
+ export declare const RecordedMessage: unique symbol;
8
+ /** The fixed sentence an error declares for telemetry, if it declares one. */
9
+ export declare const recordedMessage: (error: unknown) => string | undefined;
10
+ /**
11
+ * Declare a recorded message on one error that Executor did not define the text of, such as an
12
+ * error decoded from an app's reply. An error class's own declaration is kept. The error's fields
13
+ * and wire encoding are unchanged.
14
+ */
15
+ export declare const recordAs: <E>(error: E, message: string) => E;