apps 0.0.1-beta.43 → 0.0.1-beta.46

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 (54) hide show
  1. package/framework-reference.json +1 -1
  2. package/js/{chunk-XSD3RZFX.js → chunk-3B2JAOSE.js} +23 -12
  3. package/js/{chunk-KTPKTBKZ.js → chunk-3UGDI2UI.js} +5 -5
  4. package/js/chunk-5FHWNLCI.js +88 -0
  5. package/js/{chunk-MSDGZ7FA.js → chunk-6QXPBJ5T.js} +14 -13
  6. package/js/{chunk-Z3S2IVI3.js → chunk-7LGRK7TP.js} +2 -2
  7. package/js/{chunk-T65AFHU3.js → chunk-7UUHJR2Q.js} +1 -1
  8. package/js/{chunk-4ZTVLEN6.js → chunk-CDXQDN7W.js} +1 -1
  9. package/js/{chunk-OBXHQNWC.js → chunk-CVAJ4F6O.js} +16 -3
  10. package/js/{chunk-KBIKBWSS.js → chunk-H72MEDMN.js} +4 -3
  11. package/js/{chunk-VU6GQ2SH.js → chunk-JM7LOD2W.js} +212 -22
  12. package/js/{chunk-EJUK2NK5.js → chunk-KLYSEHUD.js} +1 -1
  13. package/js/{chunk-ILYK7BQG.js → chunk-LHCGND3R.js} +12 -46
  14. package/js/{chunk-EMHFXFTJ.js → chunk-LTDHQJ2Z.js} +53 -0
  15. package/js/{chunk-47BLLMRQ.js → chunk-OJ47HQVJ.js} +143 -65
  16. package/js/{chunk-MZH4J2PO.js → chunk-PD6I2SDG.js} +1 -1
  17. package/js/{chunk-KSGYJV46.js → chunk-TUMGL2OC.js} +1 -1
  18. package/js/{chunk-5GLC42LK.js → chunk-UM62MBJQ.js} +42 -24
  19. package/js/{chunk-IN2WIN7I.js → chunk-XBG7HHXC.js} +1 -1
  20. package/js/{chunk-RIKH5H2X.js → chunk-XK5I2XOI.js} +39 -29
  21. package/js/client.js +9 -9
  22. package/js/contracts.js +9 -5
  23. package/js/effect.js +14 -14
  24. package/js/graphql.js +23 -21
  25. package/js/host.js +79 -54
  26. package/js/index.js +23 -18
  27. package/js/mcp/effect.js +16 -16
  28. package/js/mcp/stdio.js +30 -25
  29. package/js/mcp.js +23 -21
  30. package/js/openapi.js +106 -80
  31. package/js/skills/effect.js +5 -5
  32. package/js/skills.js +53 -36
  33. package/js/ui/auth.js +3 -3
  34. package/js/ui/contracts.js +3 -3
  35. package/js/ui/serving.js +7 -7
  36. package/package.json +1 -1
  37. package/runtime.json +1 -1
  38. package/types/apps/src/contracts/host.d.ts +15 -0
  39. package/types/apps/src/host.d.ts +5 -0
  40. package/types/apps/src/implementation/authoring.d.ts +25 -5
  41. package/types/apps/src/implementation/cache.d.ts +4 -0
  42. package/types/apps/src/implementation/elicitation.d.ts +6 -3
  43. package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
  44. package/types/apps/src/implementation/operations.d.ts +2 -2
  45. package/types/apps/src/implementation/router-catalog.d.ts +4 -4
  46. package/types/apps/src/implementation/workflows.d.ts +1 -1
  47. package/types/telemetry/src/index.d.ts +1 -0
  48. package/types/telemetry/src/ownership.d.ts +56 -0
  49. package/types/telemetry/src/recorded-failure.d.ts +20 -11
  50. package/types/utils/src/api-error.d.ts +4 -2
  51. package/types/utils/src/recorded-message.d.ts +7 -4
  52. package/types/utils/src/user-facing-error.d.ts +4 -2
  53. package/js/chunk-EG72MSVK.js +0 -16
  54. package/js/{chunk-LNSVJS2Q.js → chunk-EOPQ727L.js} +2 -2
@@ -119,6 +119,21 @@ export declare const HostDataError: Schema.Union<readonly [typeof OpenapiRespons
119
119
  export declare const ToolResultObservation: Context.Reference<{
120
120
  readonly failed: () => void;
121
121
  }>;
122
+ /**
123
+ * One tool invocation's own timing, on the isolate's clock: how long it ran, and how much of that
124
+ * it waited on upstream providers, waited on elicitation answers and ran the app's authored code.
125
+ * Each instant counts once, so the rest is Executor's own time. The isolated handler returns it
126
+ * beside the result so the host can add the other isolates' parts.
127
+ */
128
+ export declare const InvocationTiming: Schema.Struct<{
129
+ readonly elapsedMs: Schema.Finite;
130
+ readonly upstreamMs: Schema.Finite;
131
+ readonly elicitationMs: Schema.Finite;
132
+ readonly authoredMs: Schema.Finite;
133
+ }>;
134
+ export type InvocationTiming = typeof InvocationTiming.Type;
135
+ /** Receives the invocation's timing once it is over; hosts that do not return it ignore it. */
136
+ export declare const InvocationTimingSink: Context.Reference<(timing: InvocationTiming) => void>;
122
137
  /** Native handler; context comes from host authority, never from request content. */
123
138
  export type AppHandler = (request: Request, context: HostContext) => Effect.Effect<Response>;
124
139
  export { type AppOperation, type OperationContext } from "./operations.js";
@@ -6,6 +6,11 @@ export { isolatedCacheSession } from "./implementation/cache-session.js";
6
6
  export declare const hostContext: (accounts: ResolvedAccountsInput, approval?: unknown) => HostContext;
7
7
  /** Portable Promise handler. Invoke only after the host has authorized and resolved accounts. */
8
8
  export declare const createAppHandler: (app: unknown) => ((request: Request, context: HostContext) => Promise<Response>);
9
+ /**
10
+ * The clock this framework's spans read, in nanoseconds. The runtime's bridge times the isolate's
11
+ * whole dispatch with it, so that time and the invocation's own timing share one clock.
12
+ */
13
+ export declare const isolatedClock: () => bigint;
9
14
  /** Isolates return bounded, telemetry beside the protocol result; no exporter secret enters app code. */
10
15
  export declare const createIsolatedAppHandler: (app: unknown) => (request: Request, context: HostContext) => Promise<Response>;
11
16
  /**
@@ -1,12 +1,32 @@
1
1
  /** Small, explicit adapters between authored callbacks and native Effect operations. */
2
- import { Effect } from "effect";
2
+ import { Effect, type Context } from "effect";
3
3
  /** Project one Effect operation into its author-facing Promise signature. */
4
4
  export type PromiseMethod<Method> = Method extends (...args: infer Args) => Effect.Effect<infer A, infer _E> ? (...args: Args) => Promise<A> : Method;
5
5
  /** Project only an object's methods; data and schema types are not recursively rewritten. */
6
6
  export type PromiseMethods<T> = {
7
7
  readonly [Key in keyof T]: PromiseMethod<T[Key]>;
8
8
  };
9
- /** Reuse a framework callback's cancellation-bound Effect, or adapt an ordinary async callback. */
10
- export declare const fromPromise: <Args extends readonly unknown[], A>(callback: (...args: Args) => Promise<A>) => ((...args: Args) => Effect.Effect<A, unknown>);
11
- /** Bind cancellation once so Promise callers and native framework callers run the same operation. */
12
- export declare const toPromise: <Args extends readonly unknown[], A, E>(operation: (...args: Args) => Effect.Effect<A, E>, signal?: AbortSignal) => ((...args: Args) => Promise<A>);
9
+ /** Which of the app's callbacks runs, recorded on the `app.code` span around it. */
10
+ export type AppCode = "factory" | "router" | "approval" | "handler" | "loader" | "cache" | "webhook" | "check" | "skills" | "elicitation" | "workflow" | "step";
11
+ /**
12
+ * Run `effect` as the app's own code. Its time is the app's, except for work it starts for
13
+ * Executor, an upstream or a person, which opens its own boundary inside.
14
+ */
15
+ export declare const appCode: (code: AppCode) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, import("effect/Tracer").ParentSpan>>;
16
+ /**
17
+ * Reuse a framework callback's cancellation-bound Effect, or run an ordinary async callback as the
18
+ * app's code. Every callback an app supplies enters the framework here, so its time is the app's.
19
+ */
20
+ export declare const fromPromise: <Args extends readonly unknown[], A>(callback: (...args: Args) => Promise<A>, code: AppCode) => ((...args: Args) => Effect.Effect<A, unknown>);
21
+ /**
22
+ * `target[key]`, called on `target`. A method read off its object as a bare value loses its
23
+ * receiver, so an app's method, such as one of its cache's, enters `fromPromise` through this.
24
+ */
25
+ export declare const method: <K extends PropertyKey, T extends { readonly [P in K]: (...args: never) => unknown; }>(target: T, key: K) => T[K];
26
+ /**
27
+ * Bind cancellation once so Promise callers and native framework callers run the same operation.
28
+ * `signalOf` is the signal, or reads it from each call's arguments, such as a loader's `context.signal`.
29
+ */
30
+ export declare const toPromise: <Args extends readonly unknown[], A, E>(operation: (...args: Args) => Effect.Effect<A, E>, signalOf?: AbortSignal | ((...args: Args) => AbortSignal),
31
+ /** Services a Promise call runs with, such as its invocation's telemetry. */
32
+ services?: Context.Context<never>) => ((...args: Args) => Promise<A>);
@@ -1,8 +1,12 @@
1
+ /** Bind the portable Effect cache to an app invocation's author API. */
2
+ import { type Context } from "effect";
1
3
  import type { AppCache, HostCache } from "../contracts/cache.js";
2
4
  import type { ResolvedAccounts } from "../contracts/host.js";
3
5
  /** Missing host support is explicit on use; ordinary apps do not need cache support. */
4
6
  export declare const unavailableCache: HostCache;
5
7
  /** Account scopes are derived from trusted current bindings. Loaders get a fresh owned HTTP signal. */
6
8
  export declare const authorCache: (host: HostCache, accounts: ResolvedAccounts, signal: AbortSignal,
9
+ /** The invocation's telemetry, which Promise calls from authored code run in. */
10
+ telemetry: Context.Context<never>,
7
11
  /** The invocation's trusted deadline. Waiting on another caller's load never runs past it. */
8
12
  deadline?: number) => AppCache;
@@ -1,5 +1,5 @@
1
1
  /** Validate both sides of a tool's form and bind delivery to its invocation lifetime. */
2
- import { Effect, Schema } from "effect";
2
+ import { Effect, Schema, type Context } from "effect";
3
3
  import { ElicitationFailed, type ElicitationHandler, type Elicit } from "../contracts/elicitation.js";
4
4
  /** Parse a form and retain its response parser, so invalid answers can be rejected before consuming a host continuation. */
5
5
  export declare const prepareElicitation: (input: unknown) => Effect.Effect<{
@@ -99,5 +99,8 @@ export declare const prepareElicitation: (input: unknown) => Effect.Effect<{
99
99
  } | undefined;
100
100
  }, ElicitationFailed, never>;
101
101
  }, ElicitationFailed, never>;
102
- /** Bind a validated interaction to the live invocation; transport adapters share its form parser. */
103
- export declare const makeElicit: (handler: ElicitationHandler | undefined, signal: AbortSignal) => Elicit;
102
+ /**
103
+ * Bind a validated interaction to the live invocation; transport adapters share its form parser.
104
+ * Authored code's Promise calls run in the invocation's telemetry, like framework callers.
105
+ */
106
+ export declare const makeElicit: (handler: ElicitationHandler | undefined, signal: AbortSignal, telemetry: Context.Context<never>) => Elicit;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Divide a tool invocation's time, on its own isolate's clock, by who the work belonged to:
3
+ * Executor, the app's authored code, upstream providers, or a person answering an elicitation.
4
+ * Each boundary declares its owner where the work starts (see `owned`); the invocation's own span is
5
+ * Executor's. The host adds the other isolates' parts.
6
+ */
7
+ import { Effect } from "effect";
8
+ /** The span `makeElicit` opens while a person answers. */
9
+ export declare const elicitationWaitSpan = "app.elicitation.wait";
10
+ /** The span around each workflow control an app calls, which Executor answers. */
11
+ export declare const workflowControlSpan = "app.workflow.control";
12
+ /**
13
+ * Run a tool operation in its `app.<operation>` span and time it from the span's own start to its
14
+ * own end. The span records each part, and the isolated handler returns them to the host.
15
+ */
16
+ export declare const timedInvocation: (operation: "call" | "query" | "mutate") => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, import("effect/Tracer").ParentSpan>>;
@@ -1,5 +1,5 @@
1
1
  /** Pure operation declarations. Only the author callback crosses the Promise boundary. */
2
- import { Effect, Schema as EffectSchema } from "effect";
2
+ import { Schema as EffectSchema } from "effect";
3
3
  import type { AppOperation } from "../contracts/operations.js";
4
4
  import type { AppContext, QueryContext, MutationContext } from "../contracts/context.js";
5
5
  import type { Approval } from "../approval.js";
@@ -64,7 +64,7 @@ export interface OperationOptions<Input, Output> {
64
64
  }
65
65
  /** Adapt metadata and approval without running user code. */
66
66
  export declare const operationOptions: <Input, Output>(options: OperationOptions<Input, Output>) => {
67
- approval?: (context: Parameters<Approval<Input>>[0]) => Effect.Effect<"approved" | "denied" | "user-approval", unknown, never>;
67
+ approval?: (context: Parameters<Approval<Input>>[0]) => import("effect/Effect").Effect<"approved" | "denied" | "user-approval", unknown, never>;
68
68
  input: EffectSchema.Decoder<Input, never>;
69
69
  _meta?: {
70
70
  readonly [x: string]: EffectSchema.Json;
@@ -29,6 +29,7 @@ export declare const routerSkillName: (path: string) => string;
29
29
  export declare const operationSummary: (name: string, router: string, operation: AppOperation, schedules?: readonly OperationSchedule[]) => Effect.Effect<{
30
30
  readonly description: string;
31
31
  readonly name: string;
32
+ readonly router?: string;
32
33
  readonly title?: string;
33
34
  readonly annotations?: {
34
35
  readonly title?: string;
@@ -52,7 +53,6 @@ export declare const operationSummary: (name: string, router: string, operation:
52
53
  readonly input: Schema.Json;
53
54
  }[];
54
55
  readonly readOnly?: boolean;
55
- readonly router?: string;
56
56
  readonly tags?: readonly string[];
57
57
  }, HostDeclarationInvalid, never>;
58
58
  /** A declared operation's full description, including rendered schemas. */
@@ -65,6 +65,7 @@ export declare const operationDescription: (name: string, router: string, operat
65
65
  readonly _meta?: {
66
66
  readonly [x: string]: Schema.Json;
67
67
  };
68
+ readonly router?: string;
68
69
  readonly title?: string;
69
70
  readonly annotations?: {
70
71
  readonly title?: string;
@@ -91,7 +92,6 @@ export declare const operationDescription: (name: string, router: string, operat
91
92
  readonly input: Schema.Json;
92
93
  }[];
93
94
  readonly readOnly?: boolean;
94
- readonly router?: string;
95
95
  readonly tags?: readonly string[];
96
96
  }, HostDeclarationInvalid, never>;
97
97
  /**
@@ -128,6 +128,7 @@ export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined,
128
128
  readonly _meta?: {
129
129
  readonly [x: string]: Schema.Json;
130
130
  };
131
+ readonly router?: string;
131
132
  readonly title?: string;
132
133
  readonly annotations?: {
133
134
  readonly title?: string;
@@ -154,11 +155,11 @@ export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined,
154
155
  readonly input: Schema.Json;
155
156
  }[];
156
157
  readonly readOnly?: boolean;
157
- readonly router?: string;
158
158
  readonly tags?: readonly string[];
159
159
  } | {
160
160
  readonly description: string;
161
161
  readonly name: string;
162
+ readonly router?: string;
162
163
  readonly title?: string;
163
164
  readonly annotations?: {
164
165
  readonly title?: string;
@@ -182,7 +183,6 @@ export declare const readCatalog: (root: AppRouter | DynamicRouter | undefined,
182
183
  readonly input: Schema.Json;
183
184
  }[];
184
185
  readonly readOnly?: boolean;
185
- readonly router?: string;
186
186
  readonly tags?: readonly string[];
187
187
  })[];
188
188
  routers: {
@@ -1,5 +1,5 @@
1
1
  /** Ordinary async workflow declarations, adapted once into native Effect handlers. */
2
- import { type Schema as EffectSchema } from "effect";
2
+ import type { Schema as EffectSchema } from "effect";
3
3
  import type { AppWorkflow, WorkflowContext } from "../contracts/workflows.js";
4
4
  import { type Schema } from "./schema.js";
5
5
  declare const NativeWorkflow: unique symbol;
@@ -5,5 +5,6 @@ export { captureTelemetry, traceHeaders, withRemoteSpan, invocationFetch, type I
5
5
  export { collectTelemetry, forwardTelemetry, makeTelemetryForwarder, TelemetryBatch, } from "./relay.js";
6
6
  export { TraceContext, currentTraceContext, externalTrace, traceLinks } from "./trace-context.js";
7
7
  export { pendingSpan } from "./pending-span.js";
8
+ export { makeOwnershipAccounting, measuredSpan, owned, ownedBy, ownerAttribute, type Owner, type SpanMeasure, } from "./ownership.js";
8
9
  export { recordWorkerMeasurements } from "./measurements.js";
9
10
  export { allowlistedSpans, httpSpanAttributeAllowlist, spanAttributeAllowed, } from "./span-attributes.js";
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Who a span's work belongs to, and how a measured span's time divides among them. A span that
3
+ * starts work for someone other than its caller declares the owner with `ownedBy`; any other span
4
+ * works for whoever its parent works for. Each instant then belongs to the innermost boundary in
5
+ * progress, so Executor's work inside an upstream session stays Executor's, and an app's callback
6
+ * inside Executor's cache stays the app's.
7
+ *
8
+ * Workers clocks advance only on I/O, so durations are comparable within one isolate and not across
9
+ * isolates: each isolate measures its own part, and the spans that already bracket the work define
10
+ * it, so the accounting and the trace agree.
11
+ */
12
+ import { Context, Effect, Tracer } from "effect";
13
+ /**
14
+ * Executor's own work; the app's authored code; waiting on an upstream provider; or waiting on a
15
+ * person's answer.
16
+ */
17
+ export type Owner = "executor" | "app" | "upstream" | "person";
18
+ /** The attribute that shows a boundary's owner in the trace; the telemetry tracer sets it. */
19
+ export declare const ownerAttribute = "executor.owner";
20
+ /** The owner a span declared when it started, if it is an ownership boundary. */
21
+ export declare const declaredOwner: (annotations: Context.Context<never>) => Owner | undefined;
22
+ /**
23
+ * Options for a span whose work belongs to `owner`. Every ownership boundary uses them, at the point
24
+ * the work starts: provider requests and sessions are the upstream's, Executor's services called by
25
+ * an app are Executor's, an app's callbacks are the app's, and waiting for an answer is the person's.
26
+ */
27
+ export declare const ownedBy: (owner: Owner, options?: Tracer.SpanOptionsNoTrace) => Tracer.SpanOptionsNoTrace;
28
+ /** Run `effect` in span `name`, owned by `owner`. */
29
+ export declare const owned: (owner: Owner, name: string, options?: Tracer.SpanOptionsNoTrace) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Tracer.ParentSpan>>;
30
+ /** What a measured span does with its work and its end. */
31
+ export interface SpanMeasure {
32
+ /** Wraps the work inside the span, for example to observe the spans it opens. */
33
+ readonly around?: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
34
+ /** Receives the span's end, before the span ends, to record what it measured on it. */
35
+ readonly end: (end: bigint, span: Tracer.Span) => void;
36
+ }
37
+ /**
38
+ * Run `effect` in span `name`, measured by `measure` from the span's own start to its own end, so
39
+ * the span's duration and the measurement share both boundaries.
40
+ */
41
+ export declare const measuredSpan: (name: string, options: Tracer.SpanOptionsNoTrace, measure: (start: bigint) => SpanMeasure) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Tracer.ParentSpan>>;
42
+ /**
43
+ * Divide a window that starts at `origin`, whose own work is `owner`'s, among owners. At each
44
+ * instant, the work in progress is the innermost span of each branch: a span with no child still
45
+ * open. Its owner takes the instant. With nothing open inside the window, `owner` takes it. Spans
46
+ * are counted as they open and end, in constant time each, and only spans still open are kept.
47
+ */
48
+ export declare const makeOwnershipAccounting: (origin: bigint, owner: Owner) => {
49
+ /** Run `effect` with the spans it opens observed, including spans it hands to later work. */
50
+ observe: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
51
+ /**
52
+ * Close the window at `end` and return its milliseconds by owner, each instant counted once.
53
+ * Spans still open count up to `end`; spans that open or end afterwards are ignored.
54
+ */
55
+ read: (end: bigint) => Readonly<Record<Owner, number>>;
56
+ };
@@ -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
- };
@@ -4392,8 +4392,6 @@ export {
4392
4392
  bodyFormData,
4393
4393
  HttpClientRequest_exports,
4394
4394
  fromWeb2 as fromWeb,
4395
- HttpServerResponse_exports,
4396
- HttpServerRequest_exports,
4397
4395
  HttpTraceContext_exports,
4398
4396
  HttpClient,
4399
4397
  transformResponse,
@@ -4406,6 +4404,8 @@ export {
4406
4404
  TracerPropagationEnabled,
4407
4405
  layerMergedContext,
4408
4406
  HttpClient_exports,
4407
+ HttpServerResponse_exports,
4408
+ HttpServerRequest_exports,
4409
4409
  prefixPath,
4410
4410
  fromLiteral
4411
4411
  };