apps 0.0.1-beta.43 → 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.
@@ -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
  };
@@ -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. */
@@ -43,8 +43,10 @@ type Definition<Tag extends string, Fields extends Schema.Struct.Fields> = Heade
43
43
  readonly [Key in keyof PresentationProperties | "_tag" | "message"]?: never;
44
44
  };
45
45
  /**
46
- * What traces and error reports record instead of the description, when the description quotes
47
- * an app's own error or a service's stated error for its caller. Only fixed text and typed fields.
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.
48
50
  */
49
51
  readonly recorded?: (fields: Schema.Struct.Type<Fields>) => string;
50
52
  } & (ErrorPresentation | {
@@ -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
- };