apps 0.0.1-beta.42 → 0.0.1-beta.44

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 (36) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/chunk-5FHWNLCI.js +88 -0
  3. package/js/{chunk-KTPKTBKZ.js → chunk-5SHUB37R.js} +4 -4
  4. package/js/{chunk-XSD3RZFX.js → chunk-646JVUH4.js} +2 -2
  5. package/js/{chunk-MSDGZ7FA.js → chunk-7EBODVQJ.js} +4 -4
  6. package/js/{chunk-VU6GQ2SH.js → chunk-CZGWW4NQ.js} +25 -13
  7. package/js/{chunk-47BLLMRQ.js → chunk-DRJRCHHO.js} +8 -8
  8. package/js/{chunk-T65AFHU3.js → chunk-DZQYE626.js} +1 -1
  9. package/js/{chunk-OBXHQNWC.js → chunk-ELO5PRCO.js} +2 -2
  10. package/js/{chunk-KBIKBWSS.js → chunk-H72MEDMN.js} +4 -3
  11. package/js/{chunk-Z3S2IVI3.js → chunk-MGGMEGB2.js} +2 -2
  12. package/js/{chunk-ILYK7BQG.js → chunk-OTGUPKKK.js} +1 -1
  13. package/js/{chunk-RIKH5H2X.js → chunk-V3RS2BK6.js} +3 -3
  14. package/js/{chunk-IN2WIN7I.js → chunk-XBG7HHXC.js} +1 -1
  15. package/js/client.js +2 -2
  16. package/js/contracts.js +3 -3
  17. package/js/effect.js +10 -10
  18. package/js/graphql.js +11 -11
  19. package/js/host.js +10 -10
  20. package/js/index.js +5 -5
  21. package/js/mcp/effect.js +12 -12
  22. package/js/mcp/stdio.js +12 -12
  23. package/js/mcp.js +13 -13
  24. package/js/openapi.js +9 -9
  25. package/js/skills/effect.js +3 -3
  26. package/js/skills.js +5 -5
  27. package/js/ui/serving.js +2 -2
  28. package/package.json +1 -1
  29. package/runtime.json +1 -1
  30. package/types/telemetry/src/browser-operations.d.ts +1 -1
  31. package/types/telemetry/src/recorded-failure.d.ts +20 -11
  32. package/types/utils/src/api-error.d.ts +4 -2
  33. package/types/utils/src/connection-failure.d.ts +33 -0
  34. package/types/utils/src/recorded-message.d.ts +7 -4
  35. package/types/utils/src/user-facing-error.d.ts +83 -0
  36. package/js/chunk-EG72MSVK.js +0 -16
@@ -8,7 +8,7 @@ import { HttpClient, HttpClientError } from "effect/http";
8
8
  export declare const browserPageId: () => string | undefined;
9
9
  /** Safe event shared with the host's error reporter and product analytics. */
10
10
  export declare const BrowserOperationFailure: Schema.Struct<{
11
- readonly error_type: Schema.Literals<readonly ["BrowserDecodeFailed", "BrowserTransportFailed", "BrowserOperationFailed"]>;
11
+ readonly error_type: Schema.Literals<readonly ["BrowserDecodeFailed", "BrowserConnectionFailed", "BrowserTransportFailed", "BrowserOperationFailed"]>;
12
12
  readonly trace_id: Schema.String;
13
13
  readonly span_id: Schema.String;
14
14
  readonly page_id: Schema.String;
@@ -1,20 +1,29 @@
1
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.
2
+ * Failures as Executor's telemetry records them. Traces and error reports keep an error's text only
3
+ * when Executor wrote it: a tagged error is recorded by its tag and the fixed sentence it declares
4
+ * (see `RecordedMessage`), or by its tag alone when it declares none. Its fields, message, stack and
5
+ * cause are not recorded, so a value an error carries for its caller, an app's text or a service's
6
+ * reply cannot reach telemetry by an error forgetting to declare. The error itself, and what its
7
+ * caller receives, are unchanged.
6
8
  */
7
9
  import { Cause } from "effect";
8
10
  /**
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.
11
+ * The error a trace or error report records in place of `error`.
12
+ *
13
+ * - A tagged error is named by its tag: a field called `name`, such as a requested skill's or an
14
+ * app's, replaces the error's own name. Its message is the sentence it declares, or empty. Its
15
+ * stack is generated here and names no frames: the error's own stack begins with its message,
16
+ * which can span lines that look like frames. Traces still show where it failed through the
17
+ * operation's own spans, which Effect appends to a recorded stack.
18
+ * - Any other value that is not an `Error`, such as a plain object Effect would print as JSON, is
19
+ * recorded as `UnrecognizedFailure` with no text.
20
+ * - An untagged `Error` is a defect or a platform's error: its message and stack come from the
21
+ * JavaScript engine or a library and are kept, as they are the only diagnosis of an Executor bug.
22
+ * Its cause is recorded by these same rules.
13
23
  */
14
24
  export declare const recordedError: (error: unknown) => unknown;
15
25
  /**
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.
26
+ * A failure's cause as traces record it: each failure and defect by `recordedError`. Interruptions
27
+ * are unchanged, and each reason keeps its annotations, which locate it.
19
28
  */
20
29
  export declare const recordedCause: <E>(cause: Cause.Cause<E>) => Cause.Cause<unknown>;
@@ -24,8 +24,10 @@ type Definition<Tag extends string, Fields extends Schema.Struct.Fields> = Heade
24
24
  */
25
25
  readonly message: string | ((fields: Schema.Struct.Type<Fields>) => string);
26
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.
27
+ * What traces and error reports record beside the tag. A fixed `message` is recorded as is; a
28
+ * message derived from fields is recorded only through this, from fixed text and closed fields,
29
+ * never a value the caller chose, an app's text or a service's reply. Without it the error is
30
+ * recorded by its tag alone.
29
31
  */
30
32
  readonly recorded?: (fields: Schema.Struct.Type<Fields>) => string;
31
33
  };
@@ -0,0 +1,33 @@
1
+ /** Requests the browser could not complete because no response reached it. */
2
+ import { Cause } from "effect";
3
+ import { HttpClientError } from "effect/http";
4
+ import { UserFacingError } from "./user-facing-error.js";
5
+ /**
6
+ * Fetch rejects with a `TypeError` when no response arrives: the device is offline, the page
7
+ * navigated away first, the connection was reset before a response, or the browser blocked the
8
+ * request. The server may still have completed the request and records its own outcome. Failures Executor constructs itself, such as a batch reply
9
+ * that ended without an answer, carry no such cause and stay unexpected.
10
+ */
11
+ export declare const isConnectionFailure: (error: unknown) => error is HttpClientError.HttpClientError;
12
+ /** Typed API clients may surface a lost connection as a failure or, after narrowing, a defect. */
13
+ export declare const hasConnectionFailure: (cause: Cause.Cause<unknown>) => boolean;
14
+ /** The browser could not reach Executor. Nothing on the server needs fixing. */
15
+ export declare const ConnectionFailed: import("effect/Schema").Class<{} & UserFacingError & {
16
+ readonly _tag: "ConnectionFailed";
17
+ }, Omit<import("effect/Schema").TaggedStruct<"ConnectionFailed", {
18
+ readonly message: typeof import("./api-error.js").MessageField;
19
+ readonly recovery: import("effect/Schema").decodeTo<import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
20
+ readonly action: import("effect/Schema").String;
21
+ readonly instructions: import("effect/Schema").String;
22
+ }>>, import("effect/Schema").Struct<{
23
+ readonly action: import("effect/Schema").String;
24
+ readonly instructions: import("effect/Schema").String;
25
+ }>, never, never>;
26
+ }>, "~type.make.in"> & {
27
+ readonly "~type.make.in": {
28
+ readonly _tag?: "ConnectionFailed";
29
+ };
30
+ }, UserFacingError>;
31
+ export type ConnectionFailed = typeof ConnectionFailed.Type;
32
+ /** What to show for a failure no contract declares: a lost connection, or an unexpected error. */
33
+ export declare const undeclaredError: (cause: Cause.Cause<unknown>) => UserFacingError;
@@ -1,8 +1,11 @@
1
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.
2
+ * The fixed sentence traces and error reports record for a tagged error, beside its tag. Telemetry
3
+ * records no other text from a tagged error: one that declares no sentence is recorded by its tag
4
+ * alone (`@executor-js/telemetry/recorded-failure`). Declare one from fixed text and closed fields
5
+ * only, never from a value the caller supplied (a slug, a name, a tool name, an argument's key),
6
+ * an app's own text or a service's reply. That text still reaches the caller the error is for.
7
+ * `ApiError` and `UserFacingError` declare a fixed message for you; a message derived from fields
8
+ * declares `recorded`.
6
9
  */
7
10
  export declare const RecordedMessage: unique symbol;
8
11
  /** The fixed sentence an error declares for telemetry, if it declares one. */
@@ -0,0 +1,83 @@
1
+ import { Schema, type Cause } from "effect";
2
+ import "effect/http-api";
3
+ import { MessageField } from "./api-error.js";
4
+ /** Curated explanation and recovery. Never include raw diagnostics, credentials, or form values. */
5
+ export interface ErrorPresentation {
6
+ readonly title: string;
7
+ readonly description: string;
8
+ readonly recovery: {
9
+ readonly action: string;
10
+ readonly instructions: string;
11
+ };
12
+ /** Repeating the failed operation can help. Configuration changes are not retries. */
13
+ readonly retryable?: boolean;
14
+ /** False when the user's agent cannot act on the fix prompt, so hosts do not offer it. */
15
+ readonly agentFixable?: boolean;
16
+ /** One safe value the user needs for recovery, such as a URL to send to the service. */
17
+ readonly detail?: {
18
+ readonly label: string;
19
+ readonly value: string;
20
+ };
21
+ /**
22
+ * Present only when the Executor team must fix the problem. Safe evidence for a public
23
+ * report: fixed codes and statuses, never user data, URLs, or upstream text.
24
+ */
25
+ readonly report?: string;
26
+ }
27
+ type PresentationProperties = Required<Omit<ErrorPresentation, "detail" | "report">> & {
28
+ readonly detail: ErrorPresentation["detail"];
29
+ readonly report: ErrorPresentation["report"];
30
+ readonly code: string;
31
+ readonly fixPrompt: string;
32
+ };
33
+ /** A yieldable error that owns its safe user explanation and agent recovery task. */
34
+ export interface UserFacingError extends Cause.YieldableError, PresentationProperties {
35
+ readonly _tag: string;
36
+ }
37
+ type Header<Tag extends string> = {
38
+ readonly tag: Tag;
39
+ readonly status: number;
40
+ };
41
+ type Definition<Tag extends string, Fields extends Schema.Struct.Fields> = Header<Tag> & {
42
+ readonly fields: Fields & {
43
+ readonly [Key in keyof PresentationProperties | "_tag" | "message"]?: never;
44
+ };
45
+ /**
46
+ * What traces and error reports record beside the tag. A fixed description is recorded as is; a
47
+ * presentation derived from fields is recorded only through this, from fixed text and closed
48
+ * fields, never a value the caller chose, an app's text or a service's reply. Without it the
49
+ * error is recorded by its tag alone.
50
+ */
51
+ readonly recorded?: (fields: Schema.Struct.Type<Fields>) => string;
52
+ } & (ErrorPresentation | {
53
+ readonly presentation: (fields: Schema.Struct.Type<Fields>) => ErrorPresentation;
54
+ });
55
+ declare const RecoveryField: Schema.decodeTo<Schema.optionalKey<Schema.Struct<{
56
+ readonly action: Schema.String;
57
+ readonly instructions: Schema.String;
58
+ }>>, Schema.Struct<{
59
+ readonly action: Schema.String;
60
+ readonly instructions: Schema.String;
61
+ }>, never, never>;
62
+ type DerivedFields = {
63
+ readonly message: typeof MessageField;
64
+ readonly recovery: typeof RecoveryField;
65
+ };
66
+ type ErrorFields<Tag extends string, Fields extends Schema.Struct.Fields> = Omit<Schema.TaggedStruct<Tag, Fields & DerivedFields>, "~type.make.in"> & {
67
+ readonly "~type.make.in": Schema.TaggedStruct<Tag, Fields>["~type.make.in"];
68
+ };
69
+ type ErrorClass<Tag extends string, Fields extends Schema.Struct.Fields> = Schema.Class<Schema.Struct.Type<Fields> & UserFacingError & {
70
+ readonly _tag: Tag;
71
+ }, ErrorFields<Tag, Fields>, UserFacingError>;
72
+ /** Define a schema-backed error with no payload. Its tag becomes its public error code. */
73
+ declare function define<const Tag extends string>(definition: Header<Tag> & ErrorPresentation): ErrorClass<Tag, {}>;
74
+ /** Define a schema-backed error whose safe presentation can depend on its parsed fields. */
75
+ declare function define<const Tag extends string, const Fields extends Schema.Struct.Fields>(definition: Definition<Tag, Fields>): ErrorClass<Tag, Fields>;
76
+ /** Define the schema, error constructor, user copy, and agent recovery together. */
77
+ export declare const UserFacingError: {
78
+ define: typeof define;
79
+ is: (value: unknown) => value is UserFacingError;
80
+ };
81
+ /** Defects get a safe explanation without exposing an arbitrary cause. */
82
+ export declare const UnexpectedError: ErrorClass<"UnexpectedError", {}>;
83
+ export {};
@@ -1,16 +0,0 @@
1
- import {
2
- Predicate_exports
3
- } from "./chunk-IFJU5SYQ.js";
4
-
5
- // ../utils/src/recorded-message.ts
6
- var RecordedMessage = /* @__PURE__ */ Symbol.for("@executor-js/utils/RecordedMessage");
7
- var recordedMessage = (error) => {
8
- if (!Predicate_exports.hasProperty(error, RecordedMessage)) return void 0;
9
- const message = error[RecordedMessage];
10
- return typeof message === "string" ? message : void 0;
11
- };
12
-
13
- export {
14
- RecordedMessage,
15
- recordedMessage
16
- };