@intentius/chant-lexicon-aws 0.44.9 → 0.44.12

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.
@@ -0,0 +1,332 @@
1
+ /**
2
+ * `awsAgentCoreFetchTrace` — pull a Bedrock AgentCore session history and
3
+ * render it as dogwood replay-trace text (#1685, follow-on from #1682).
4
+ *
5
+ * Contributed the way the fly lexicon contributes `flyApply` and the cedar
6
+ * lexicon contributes `dogwoodReplay`: a plain exported async function taking
7
+ * one args object, re-exported from `src/op/activities/index.ts`, resolved **by
8
+ * name** by core's activity registry when a project lists the `aws` lexicon.
9
+ * No Temporal import beneath it, so the local executor runs it unchanged and a
10
+ * Temporal worker registers the same function. Transport is injectable through
11
+ * the same `AwsReadHttp` seam `src/api/read-client.ts` already uses, so tests
12
+ * never touch the network and `endpoint` retargets the whole thing.
13
+ *
14
+ * The output is text. The cedar lexicon's `PolicyReplayOp` reads a trace from
15
+ * `tracePath`, so `outPath` here is the handoff — and it is the *only* handoff.
16
+ * Neither package imports the other; the decoupling contract is the grammar.
17
+ *
18
+ * ## Which AgentCore surface actually carries decision history
19
+ *
20
+ * Investigated before building, because the answer changes what can be shipped.
21
+ * Verified against the live API reference and devguide on 2026-08-10:
22
+ *
23
+ * - **There is no `GetTrace`, no `GetSession`, and no `ListRuntimeSessions`.**
24
+ * The `bedrock-agentcore` data plane (API version 2024-02-28) publishes
25
+ * `StopRuntimeSession` with no read counterpart — a runtime session can be
26
+ * killed but not enumerated. `bedrock-agentcore-control` (2023-06-05) is
27
+ * resource CRUD only.
28
+ * <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_Operations.html>
29
+ * - **AgentCore Memory is the one fetchable session history**, and it is what
30
+ * this module reads: `ListSessions`
31
+ * (`POST /memories/{memoryId}/actor/{actorId}/sessions`) and `ListEvents`
32
+ * (`POST /memories/{memoryId}/actor/{actorId}/sessions/{sessionId}`), both
33
+ * paginated, with a `payload[]` of `conversational` (roles `ASSISTANT`,
34
+ * `USER`, `TOOL`, `OTHER`) or `blob` members.
35
+ * <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_ListEvents.html>
36
+ * <https://docs.aws.amazon.com/bedrock-agentcore/latest/APIReference/API_PayloadType.html>
37
+ * The caveat is load-bearing and is repeated in {@link AgentCoreMemorySource}:
38
+ * Memory holds what the agent *wrote* via `CreateEvent`. It is a store, not a
39
+ * service-side audit. An agent that never writes leaves nothing to replay.
40
+ * - **The service's own per-tool-call and per-decision records are CloudWatch
41
+ * Logs, not an API.** Gateway `tools/call` bodies land in
42
+ * `/aws/vendedlogs/bedrock-agentcore/gateway/APPLICATION_LOGS/{gateway_id}`;
43
+ * the allow/deny itself lives in `aws/spans` span attributes
44
+ * (`aws.agentcore.policy.authorization_decision` = `ALLOW`|`DENY`,
45
+ * `…determining_policies`, `…effects`, `…temporal.event_timestamp_ns`).
46
+ * <https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-gateway-metrics.html>
47
+ * <https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-policy-metrics.html>
48
+ * Both are reachable only through CloudWatch Logs Insights / X-Ray
49
+ * Transaction Search, and the gateway record's `requestBody` is a Java map
50
+ * `toString` (`{id=1, jsonrpc=2.0, method=tools/call, params={…}}`) rather
51
+ * than JSON. Those two sources are therefore *named and refused* here rather
52
+ * than guessed at — see {@link AgentCoreTraceUnavailableError}. An honest
53
+ * partial beats an invented API.
54
+ * - **No emulator serves any of it.** Floci's service index lists no
55
+ * `bedrock-agentcore` at all (its only Bedrock entry is a `bedrock-runtime`
56
+ * stub), and MiniStack implements twelve control-plane runtime/endpoint
57
+ * operations and states that Memory, Gateway, Identity and the rest are not
58
+ * implemented. A control-plane emulator is structurally incapable of serving
59
+ * decision history anyway, since every per-call record lives in CloudWatch.
60
+ * So the testable path today is the injected transport, and the mocked
61
+ * fixtures in `./trace-fetch.test.ts` are the contract.
62
+ *
63
+ * ## Signing
64
+ *
65
+ * SigV4 through `read-client.ts`'s `requestHeaders`, which is the same seam its
66
+ * own CloudFormation and Cloud Control calls use (#1686). Signed when
67
+ * credentials resolve and the target is real AWS; scope-only against an
68
+ * endpoint override, since an emulator does not verify signatures and requiring
69
+ * credentials to read a local lane would be a tax with nothing behind it.
70
+ * `signEndpointOverride: true` opts back in for an override that *is* real AWS.
71
+ */
72
+ import { type AwsCredentialSource, type AwsReadHttp } from "../api/read-client.js";
73
+ import { type AgentCoreFields, type AgentCoreSessionEvent, type AgentCoreTimeOrigin, type AgentCoreTraceIssue, type AgentCoreTraceIssueKind } from "./trace-render.js";
74
+ /**
75
+ * Where a history is read from.
76
+ *
77
+ * Only `memory` is implemented, and the reason the other two are named rather
78
+ * than omitted is that "which surface carries this" is the question #1685 asked
79
+ * first. A caller who reaches for `spans` gets the finding, not a 404.
80
+ */
81
+ export type AgentCoreTraceSource =
82
+ /** AgentCore Memory `ListEvents`. The one fetchable session history. */
83
+ "memory"
84
+ /** Gateway vended `tools/call` logs. CloudWatch-only, and not JSON. */
85
+ | "gateway-logs"
86
+ /** `aws/spans` policy-decision span attributes. CloudWatch/X-Ray-only. */
87
+ | "spans";
88
+ /** Marker type for the documented Memory caveat. See the module header. */
89
+ export type AgentCoreMemorySource = Extract<AgentCoreTraceSource, "memory">;
90
+ /**
91
+ * A source that exists in AWS but is not reachable the way this module reads.
92
+ *
93
+ * The message names the finding and the surface, so a caller who hits it knows
94
+ * whether they are blocked on chant or on AWS. Both current cases are the
95
+ * latter: the record is real, it is in CloudWatch Logs, and getting at it is a
96
+ * Logs Insights integration rather than an AgentCore API call.
97
+ */
98
+ export declare class AgentCoreTraceUnavailableError extends Error {
99
+ readonly source: AgentCoreTraceSource;
100
+ constructor(source: AgentCoreTraceSource, message: string);
101
+ }
102
+ /** One `payload[]` member, as `ListEvents` returns it. */
103
+ export interface MemoryPayloadMember {
104
+ readonly conversational?: {
105
+ readonly role?: string;
106
+ readonly content?: unknown;
107
+ };
108
+ readonly blob?: unknown;
109
+ }
110
+ /** One event, as `ListEvents` returns it. Fields this module does not read are ignored. */
111
+ export interface MemoryEvent {
112
+ readonly eventId?: string;
113
+ readonly sessionId?: string;
114
+ readonly actorId?: string;
115
+ readonly memoryId?: string;
116
+ /** restJson1 timestamp: epoch seconds (possibly fractional) or an ISO-8601 string. */
117
+ readonly eventTimestamp?: number | string;
118
+ readonly metadata?: unknown;
119
+ readonly payload?: readonly MemoryPayloadMember[];
120
+ readonly branch?: {
121
+ readonly name?: string;
122
+ readonly rootEventId?: string;
123
+ };
124
+ }
125
+ /**
126
+ * Epoch milliseconds from whatever the wire carried.
127
+ *
128
+ * restJson1 renders a `timestamp` shape as epoch **seconds**, possibly
129
+ * fractional, but the docs' examples and several SDK paths show ISO-8601, so
130
+ * both are accepted. A bare number is disambiguated by magnitude: anything at
131
+ * or beyond 1e12 is already milliseconds (1e12 ms is 2001; 1e12 s is the year
132
+ * 33658), so the heuristic has no realistic collision. Anything else throws
133
+ * rather than being coerced — a guessed timestamp puts every temporal window in
134
+ * the replay in the wrong place.
135
+ */
136
+ export declare function toEpochMs(value: unknown, what: string): number;
137
+ /** What to do with a payload key the trace grammar cannot spell. */
138
+ export type NonIdentifierFieldPolicy = "rename" | "fail";
139
+ /** `tool-name` → `tool_name`, `2fa` → `f_2fa`. Deterministic, so goldens hold. */
140
+ export declare function identifierFor(key: string): string;
141
+ /** A key the coercion had to rewrite, reported so a rename is never silent. */
142
+ export interface FieldRename {
143
+ readonly path: string;
144
+ readonly from: string;
145
+ readonly to: string;
146
+ }
147
+ /**
148
+ * A non-integer JS number as a decimal literal the Cedar surface accepts.
149
+ *
150
+ * `String(1e-7)` is `"1e-7"`, which is not a decimal literal, so a legitimate
151
+ * small payload number would otherwise abort the whole fetch. `toFixed(20)` is
152
+ * the widest non-exponential rendering JS offers, and the trailing zeros it
153
+ * pads with come back off.
154
+ *
155
+ * A value too small for even that rounds to `0.0`, and a trace that says a
156
+ * policy compared against zero when the agent saw something else is the whole
157
+ * failure class this module exists to prevent — so it throws instead, naming
158
+ * the field.
159
+ */
160
+ export declare function decimalText(value: number, context?: string): string;
161
+ /**
162
+ * Coerce arbitrary JSON into trace values.
163
+ *
164
+ * A non-integer number becomes a Cedar decimal rather than being rounded,
165
+ * because the scale is the thing a policy compares against. `null` and
166
+ * `undefined` are dropped from *records*, because Cedar has no null and an
167
+ * invented sentinel would be matched by a predicate that meant something else.
168
+ * And a key the grammar cannot spell is renamed — every rename is returned, so
169
+ * a caller can see it, and `onNonIdentifierField: "fail"` refuses instead.
170
+ *
171
+ * Two things throw rather than being smoothed over, and both are the same
172
+ * failure this module refuses everywhere else — data that changes meaning
173
+ * without saying so. A `null` *inside an array* would shift every later index,
174
+ * so a predicate on `args[1]` would start matching `args[0]`'s value. And two
175
+ * payload keys that rewrite to the same identifier (`tool-name` and `tool.name`
176
+ * both become `tool_name`) would silently drop one of them.
177
+ */
178
+ export declare function coerceFields(value: unknown, options?: {
179
+ onNonIdentifierField?: NonIdentifierFieldPolicy;
180
+ }, path?: string, renames?: FieldRename[]): {
181
+ fields: AgentCoreFields;
182
+ renames: FieldRename[];
183
+ };
184
+ /**
185
+ * How a `conversational` role becomes an action and an event kind.
186
+ *
187
+ * The default is a convention, not a contract AWS publishes — `Conversational`
188
+ * carries a role and content and nothing else, so the tool name, if there is
189
+ * one, is inside the content the agent wrote. Override it per project.
190
+ */
191
+ export interface RoleMapping {
192
+ readonly action: string;
193
+ readonly kind: string;
194
+ }
195
+ /** Default role mapping. `TOOL` is a decision-kind `request`: it is the call being authorized. */
196
+ export declare const DEFAULT_ROLE_MAPPING: Readonly<Record<string, RoleMapping>>;
197
+ /**
198
+ * The `blob` convention this module reads.
199
+ *
200
+ * A `blob` payload is arbitrary JSON, so there is nothing to parse until
201
+ * someone agrees on a shape. This is that shape, and it is the one worth
202
+ * writing from `CreateEvent`: `action` and `kind` decide the trace's grammar
203
+ * slots, `input`/`output`/`error` become the payload groups that land in both
204
+ * bags, and everything else becomes `attributes`. Every key is optional; an
205
+ * absent `action` falls back to the role mapping's `OTHER`.
206
+ */
207
+ export declare const BLOB_KEYS: readonly ["action", "kind", "input", "output", "error"];
208
+ /** Options shared by the normalizer and the activity. */
209
+ export interface AgentCoreNormalizeOptions {
210
+ /** Overrides merged over {@link DEFAULT_ROLE_MAPPING}. */
211
+ readonly roles?: Readonly<Record<string, RoleMapping>>;
212
+ /** Cedar resource id for every event. Default: the event's `memoryId`. */
213
+ readonly target?: string;
214
+ /** Default `"rename"`. */
215
+ readonly onNonIdentifierField?: NonIdentifierFieldPolicy;
216
+ }
217
+ /** A normalized history plus whatever the coercion had to rewrite. */
218
+ export interface NormalizedHistory {
219
+ readonly events: readonly AgentCoreSessionEvent[];
220
+ readonly renames: readonly FieldRename[];
221
+ }
222
+ /**
223
+ * `ListEvents` output → the renderer's normalized events. Pure: no transport.
224
+ *
225
+ * One event with N payload members becomes N normalized events sharing the
226
+ * event's timestamp, with `#0`, `#1`, … appended to the id — the trace's
227
+ * `requestId` has to identify a decision point, and a two-member event is two
228
+ * decision points. A member that is neither `conversational` nor `blob` is a
229
+ * shape this module does not know, and it throws rather than being skipped:
230
+ * a silently dropped tool call is a temporal predicate that silently misses.
231
+ */
232
+ export declare function normalizeMemoryEvents(events: readonly MemoryEvent[], options?: AgentCoreNormalizeOptions): NormalizedHistory;
233
+ /** Where to read from, how to reach it, and what to sign with. */
234
+ export interface AgentCoreReadOptions {
235
+ /** Endpoint override. Omit for the real regional host. */
236
+ readonly endpoint?: string;
237
+ /** Default `us-east-1`. */
238
+ readonly region?: string;
239
+ /**
240
+ * What to sign with: literal credentials, or a resolver that decides.
241
+ * Omitted, the environment answers; with nothing there, the request goes out
242
+ * carrying the credential scope and no signature.
243
+ */
244
+ readonly credentials?: AwsCredentialSource;
245
+ /** Environment the credential fallback reads. Defaults to `process.env`; injectable for tests. */
246
+ readonly env?: Record<string, string | undefined>;
247
+ /** Sign even against an endpoint override — for an override that is real AWS. */
248
+ readonly signEndpointOverride?: boolean;
249
+ /** Signing clock. Injected by tests so a signature is reproducible. */
250
+ readonly now?: Date;
251
+ }
252
+ /** What {@link listMemoryEvents} takes. */
253
+ export interface ListMemoryEventsArgs extends AgentCoreReadOptions {
254
+ readonly memoryId: string;
255
+ readonly actorId: string;
256
+ readonly sessionId: string;
257
+ /** Stop after this many events. Default 1000 — a runaway session is not a trace. */
258
+ readonly maxEvents?: number;
259
+ }
260
+ /**
261
+ * `ListEvents` for one session, paginated to exhaustion or to `maxEvents`.
262
+ *
263
+ * `includePayloads` is always true: without it the response carries event ids
264
+ * and timestamps and nothing to match a predicate against, which is a trace
265
+ * that replays green and proves nothing.
266
+ */
267
+ export declare function listMemoryEvents(args: ListMemoryEventsArgs, signal?: AbortSignal, http?: AwsReadHttp): Promise<MemoryEvent[]>;
268
+ /** What {@link awsAgentCoreFetchTrace} takes. */
269
+ export interface AwsAgentCoreFetchTraceArgs extends AgentCoreReadOptions, AgentCoreNormalizeOptions {
270
+ /** Default `"memory"`. The other two are named and refused — see the module header. */
271
+ readonly source?: AgentCoreTraceSource;
272
+ /** AgentCore Memory resource id. */
273
+ readonly memoryId: string;
274
+ /** Actor whose sessions are being read. */
275
+ readonly actorId: string;
276
+ /** The session to replay. */
277
+ readonly sessionId: string;
278
+ /**
279
+ * Window start, inclusive. Read by {@link toEpochMs}, the same function the
280
+ * event timestamps go through — so epoch seconds, epoch milliseconds, or
281
+ * anything `Date.parse` reads, and a bound is never on a different scale
282
+ * from the events it is being compared against.
283
+ */
284
+ readonly since?: number | string;
285
+ /** Window end, inclusive. Read the same way as {@link since}. */
286
+ readonly until?: number | string;
287
+ /** Cap on events fetched before the window filter. Default 1000. */
288
+ readonly maxEvents?: number;
289
+ /** Cedar namespace for actions and entity types. Default `"AgentCore"`. */
290
+ readonly namespace?: string;
291
+ /** Entity type for the actor. Default `"Actor"`. */
292
+ readonly principalType?: string;
293
+ /** Entity type for the target. Default `"Runtime"`. */
294
+ readonly resourceType?: string;
295
+ /** Default `"epoch-seconds"`. */
296
+ readonly origin?: AgentCoreTimeOrigin;
297
+ /** Kinds that build a Cedar request. Default `["request"]`. */
298
+ readonly decisionKinds?: readonly string[];
299
+ /** Weakenings to tolerate. Empty by default. */
300
+ readonly allow?: readonly AgentCoreTraceIssueKind[];
301
+ /** Write the rendered trace here — what `PolicyReplayOp`'s `tracePath` reads. */
302
+ readonly outPath?: string;
303
+ /** Throw when the window produced no events. Default `true`. */
304
+ readonly requireEvents?: boolean;
305
+ }
306
+ /** What {@link awsAgentCoreFetchTrace} returns. */
307
+ export interface AwsAgentCoreFetchTraceResult {
308
+ readonly source: AgentCoreTraceSource;
309
+ readonly sessionId: string;
310
+ /** The rendered trace, one event per line, newline-terminated. */
311
+ readonly text: string;
312
+ /** Lines in the trace — decision points plus history-only events. */
313
+ readonly lineCount: number;
314
+ /** Events `ListEvents` returned before the window filter. */
315
+ readonly fetched: number;
316
+ /** Absolute path written, when `outPath` was given. */
317
+ readonly outPath?: string;
318
+ /** Payload keys the trace grammar could not spell, rewritten and reported. */
319
+ readonly renames: readonly FieldRename[];
320
+ /** Weakenings the caller allowed. Empty unless `allow` named something. */
321
+ readonly issues: readonly AgentCoreTraceIssue[];
322
+ }
323
+ /**
324
+ * Fetch an AgentCore session history and render it as dogwood trace text.
325
+ *
326
+ * The window is applied client-side because `ListEvents`' `filter` takes a
327
+ * branch and event metadata and has no time predicate, so a server-side window
328
+ * is not on offer. `maxEvents` bounds the fetch; `since`/`until` bound what is
329
+ * normalized and rendered.
330
+ */
331
+ export declare function awsAgentCoreFetchTrace(args: AwsAgentCoreFetchTraceArgs, signal?: AbortSignal, http?: AwsReadHttp): Promise<AwsAgentCoreFetchTraceResult>;
332
+ //# sourceMappingURL=trace-fetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-fetch.d.ts","sourceRoot":"","sources":["../../src/agentcore/trace-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,gDAAgD;IAChD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAEpD,iFAAiF;IACjF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,mDAAmD;AACnD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACjD;AAOD;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,0BAA0B,EAChC,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,GAAE,WAAyB,GAC9B,OAAO,CAAC,4BAA4B,CAAC,CAqDvC"}
@@ -0,0 +1,256 @@
1
+ /**
2
+ * Render an AgentCore session history as dogwood replay-trace text (#1685).
3
+ *
4
+ * This module is pure: normalized events in, text out, no transport and no
5
+ * filesystem. It exists separately from `./trace-fetch.ts` for two reasons.
6
+ * The Bedrock AgentCore observability surface is in preview and moving, so the
7
+ * thing most likely to be rewritten is the fetch, and the grammar it renders
8
+ * into is the thing least likely to move. And the line grammar has two traps in
9
+ * it that are worth testing byte-for-byte without a mock HTTP stack in the way.
10
+ *
11
+ * ## The grammar
12
+ *
13
+ * From the #1657 verification (§6, read from
14
+ * `dogwood-language/src/interpreter/log_parse.rs` at the pinned SHA
15
+ * `5063bcc2d6d6cf5024d1b0498e6cc8ef52cbcf0c`), one event per line:
16
+ *
17
+ * ```
18
+ * @<timestamp> [scope(principal: <uid>, resource: <uid>)]
19
+ * [entities(<uid>: { <attrs> } [in [<uid>, …]], …)]
20
+ * [request_context(<group>: { … }, …)]
21
+ * <Ns>::Action::"<Name>"::<kind>(<field>: <value>, …)
22
+ * ```
23
+ *
24
+ * The three envelopes are optional and must appear in that order; the trailing
25
+ * group is the logged record. Blank lines are skipped and there is no comment
26
+ * syntax, so a `//` inside a value survives.
27
+ *
28
+ * ## The two traps
29
+ *
30
+ * 1. **`request_context(…)` and the logged record are different bags.** The
31
+ * Cedar request is built from the first, temporal predicates match against
32
+ * the second, and a field supplied to only one weakens either the Cedar
33
+ * check or the temporal check while the replay still exits 0 with a verdict
34
+ * that looks authoritative. So every payload group an event carries is
35
+ * written to *both*, always — there is no per-event opt-out here, because an
36
+ * AgentCore history has no way to express "this field is deliberately
37
+ * Cedar-invisible". A decision-kind event with no payload at all is a
38
+ * refusal, not a shrug: see {@link renderAgentCoreTrace}.
39
+ * 2. **Actions must be fully qualified.** `AgentCore::Action::"Transfer"`,
40
+ * never `Transfer` — a short name leaves the temporal predicate unmatched
41
+ * while Cedar still authorizes. A bare tool name from the history is
42
+ * qualified here; an already-qualified one is validated and passed through.
43
+ *
44
+ * ## Decoupling
45
+ *
46
+ * Nothing here imports the cedar lexicon, and the cedar lexicon imports nothing
47
+ * from here. The contract between them is the text. The value and event types
48
+ * below are deliberately shaped so an object built here is *structurally*
49
+ * assignable to the cedar side's `TraceValue`/`TraceEvent` for anyone who wants
50
+ * that, but neither package depends on the other to get it, and the rendering
51
+ * is implemented twice on purpose. Where a choice was free — the space inside
52
+ * `{ … }`, the `, ` between fields, the order of the record's own injections —
53
+ * it matches `lexicons/cedar/src/dogwood/trace.ts` byte for byte, so a trace
54
+ * fetched from AWS and a trace built by hand look the same to a reader and to
55
+ * the parser.
56
+ */
57
+ /** `Ns::Type::"id"` in value position. */
58
+ export interface AgentCoreEntityRef {
59
+ readonly traceValue: "entity";
60
+ readonly uid: string;
61
+ }
62
+ /** `1.50` — Cedar's decimal surface form, which a JS number cannot carry. */
63
+ export interface AgentCoreDecimal {
64
+ readonly traceValue: "decimal";
65
+ readonly text: string;
66
+ }
67
+ /** Surface text passed through untouched — the escape hatch, used sparingly. */
68
+ export interface AgentCoreRaw {
69
+ readonly traceValue: "raw";
70
+ readonly text: string;
71
+ }
72
+ /** A tagged value: one rendered specially rather than by JS type. */
73
+ export type AgentCoreTagged = AgentCoreEntityRef | AgentCoreDecimal | AgentCoreRaw;
74
+ /** Anything that can sit in a trace field, in Cedar surface forms. */
75
+ export type AgentCoreTraceValue = string | number | boolean | AgentCoreTagged | readonly AgentCoreTraceValue[] | {
76
+ readonly [key: string]: AgentCoreTraceValue;
77
+ };
78
+ /** A named group of fields — what one `request_context` envelope entry holds. */
79
+ export type AgentCoreFields = {
80
+ readonly [key: string]: AgentCoreTraceValue;
81
+ };
82
+ /**
83
+ * A history that cannot become an honest trace.
84
+ *
85
+ * Thrown rather than worked around. Every case this covers is one where the
86
+ * alternative is a trace that replays green and proves less than it looks like
87
+ * it proves, which is the failure mode the whole module is arranged against.
88
+ */
89
+ export declare class AgentCoreTraceError extends Error {
90
+ /** 0-based position in the event list, when one event is to blame. */
91
+ readonly index?: number | undefined;
92
+ constructor(message: string,
93
+ /** 0-based position in the event list, when one event is to blame. */
94
+ index?: number | undefined);
95
+ }
96
+ /** `Ns::Type::"id"`. Validated at construction, so a short name cannot slip through. */
97
+ export declare function agentCoreEntityRef(uid: string): AgentCoreEntityRef;
98
+ /**
99
+ * A Cedar decimal, written as it should appear (`"1.50"`).
100
+ *
101
+ * `context` names the field it came from when there is one, so a payload that
102
+ * cannot be represented says *where* rather than only *what*.
103
+ */
104
+ export declare function agentCoreDecimal(text: string, context?: string): AgentCoreDecimal;
105
+ /** Surface text, rendered verbatim. For values this module has no shape for. */
106
+ export declare function agentCoreRaw(text: string): AgentCoreRaw;
107
+ /** Render one value in the Cedar surface form the trace parser reads. */
108
+ export declare function renderValue(value: AgentCoreTraceValue): string;
109
+ /** `{ a: 1, b: "x" }` — a record body, braces included. */
110
+ export declare function renderFields(fields: AgentCoreFields): string;
111
+ /**
112
+ * One decision-relevant thing that happened in an AgentCore session, in the
113
+ * shape the fetch normalizes to and the renderer reads.
114
+ *
115
+ * This is deliberately *not* the dogwood event shape. It is the semantic shape
116
+ * of an agent session — who acted, on what, with which payload — so that a
117
+ * change to the observability surface under preview churn is a change to the
118
+ * mapping in `./trace-fetch.ts` and not to the grammar below.
119
+ */
120
+ export interface AgentCoreSessionEvent {
121
+ /** When it happened, epoch **milliseconds**. Converted to the trace's i64 here. */
122
+ readonly timeMs: number;
123
+ /** The session it belongs to. Lands in the logged record as `sessionId`. */
124
+ readonly sessionId: string;
125
+ /** Unique within the session. Lands in the logged record as `requestId`. */
126
+ readonly eventId: string;
127
+ /**
128
+ * The dogwood event kind. `request` / `response` / `error` conventionally;
129
+ * the truth is whichever kinds the project's `.dwschema` marks `decision`,
130
+ * and that file is not visible from here.
131
+ */
132
+ readonly kind: string;
133
+ /**
134
+ * The tool or operation. A bare name (`"Transfer"`) is qualified with the
135
+ * namespace; an already-qualified `Ns::Action::"Name"` is validated and used
136
+ * as-is. Never rendered short.
137
+ */
138
+ readonly action: string;
139
+ /** Who acted — an actor id, or a fully qualified uid to override the type. */
140
+ readonly actor: string;
141
+ /** What was acted on — a runtime/gateway id, or a fully qualified uid. */
142
+ readonly target: string;
143
+ /** The call's input payload. Lands in both bags as the `input` group. */
144
+ readonly input?: AgentCoreFields;
145
+ /** The call's result. Lands in both bags as the `output` group. */
146
+ readonly output?: AgentCoreFields;
147
+ /** A failure's detail. Lands in both bags as the `error` group. */
148
+ readonly error?: AgentCoreFields;
149
+ /**
150
+ * Anything the source carried that has no field of its own. Lands in both
151
+ * bags as the `attributes` group.
152
+ */
153
+ readonly attributes?: AgentCoreFields;
154
+ }
155
+ /** How `@<i64>` is derived from `timeMs`. */
156
+ export type AgentCoreTimeOrigin =
157
+ /** Epoch seconds. Absolute, comparable across sessions, large numbers. */
158
+ "epoch-seconds"
159
+ /** Seconds since the earliest event, so the first line reads `@0`. */
160
+ | "relative-seconds";
161
+ /** What {@link renderAgentCoreTrace} takes. */
162
+ export interface AgentCoreTraceOptions {
163
+ /** Cedar namespace for actions and entity types. Default `"AgentCore"`. */
164
+ readonly namespace?: string;
165
+ /** Entity type for `actor`. Default `"Actor"`. */
166
+ readonly principalType?: string;
167
+ /** Entity type for `target`. Default `"Runtime"`. */
168
+ readonly resourceType?: string;
169
+ /** Default `"epoch-seconds"`. */
170
+ readonly origin?: AgentCoreTimeOrigin;
171
+ /**
172
+ * Kinds that produce a decision, and so build a Cedar request. Default
173
+ * `["request"]`, the convention the default event schema follows. A
174
+ * history-only event never becomes a Cedar request, so an absent payload on
175
+ * one is not a weakening.
176
+ */
177
+ readonly decisionKinds?: readonly string[];
178
+ /** Weakenings to tolerate. Empty by default — see {@link renderAgentCoreTrace}. */
179
+ readonly allow?: readonly AgentCoreTraceIssueKind[];
180
+ }
181
+ /** What {@link auditAgentCoreEvents} can find. */
182
+ export type AgentCoreTraceIssueKind =
183
+ /** A decision-kind event with no payload: the Cedar request carries no context. */
184
+ "no-request-context"
185
+ /** Two events in one session sharing an id: `requestId` stops identifying anything. */
186
+ | "duplicate-event-id";
187
+ /** One finding against a normalized history. */
188
+ export interface AgentCoreTraceIssue {
189
+ readonly kind: AgentCoreTraceIssueKind;
190
+ /** 0-based position in the *sorted* event list. */
191
+ readonly index: number;
192
+ readonly timeMs: number;
193
+ readonly message: string;
194
+ }
195
+ /**
196
+ * `Ns::Action::"Name"` from a bare tool name, or a qualified action validated.
197
+ *
198
+ * The fully-qualified requirement is the second §6 trap: a short name leaves
199
+ * every temporal predicate unmatched while Cedar still authorizes, so the
200
+ * replay is green and blind.
201
+ */
202
+ export declare function qualifyAction(action: string, namespace: string, index?: number): string;
203
+ /** `Ns::Type::"id"` from a bare id, or a qualified uid validated. */
204
+ export declare function qualifyUid(id: string, namespace: string, type: string, what: string, index?: number): string;
205
+ /**
206
+ * The weakening checks, applied to a normalized history.
207
+ *
208
+ * Everything here is something that makes a replay *weaker* rather than
209
+ * something that makes it fail, which is exactly the class a green replay run
210
+ * hides. Structural malformation throws instead: see {@link AgentCoreTraceError}.
211
+ */
212
+ export declare function auditAgentCoreEvents(events: readonly AgentCoreSessionEvent[], options?: AgentCoreTraceOptions): AgentCoreTraceIssue[];
213
+ /** One line's worth: the envelopes and the logged record, fully resolved. */
214
+ export interface AgentCoreTraceLine {
215
+ readonly timestamp: number;
216
+ readonly action: string;
217
+ readonly kind: string;
218
+ readonly scope: {
219
+ readonly principal: string;
220
+ readonly resource: string;
221
+ };
222
+ readonly requestContext: AgentCoreFields;
223
+ readonly record: AgentCoreFields;
224
+ }
225
+ /**
226
+ * Resolve one normalized event into the envelopes and the logged record.
227
+ *
228
+ * Both bags get every payload group; the record additionally gets the event
229
+ * schema's own injections (`callerPrincipal`, `callerResource`, `sessionId`,
230
+ * `requestId`), which are never part of the Cedar request. Field order matches
231
+ * the §6 example line: groups first, then the injections.
232
+ */
233
+ export declare function toTraceLine(event: AgentCoreSessionEvent, timestamp: number, options?: AgentCoreTraceOptions, index?: number): AgentCoreTraceLine;
234
+ /** One line as the trace parser reads it. Never ends in a newline. */
235
+ export declare function renderTraceLine(line: AgentCoreTraceLine): string;
236
+ /** A rendered trace, and what the audit tolerated on the way. */
237
+ export interface AgentCoreTrace {
238
+ /** The text, one event per line, newline-terminated. */
239
+ readonly text: string;
240
+ /** The resolved lines, in render order. */
241
+ readonly lines: readonly AgentCoreTraceLine[];
242
+ /** Findings the caller allowed. Empty unless `allow` named something. */
243
+ readonly issues: readonly AgentCoreTraceIssue[];
244
+ }
245
+ /**
246
+ * Render a normalized AgentCore history as dogwood trace text.
247
+ *
248
+ * The inversion of the §6 traps: every payload group lands in both bags, every
249
+ * action comes out fully qualified, the history is ordered the way the
250
+ * interpreter reads it, and a history that would produce a weakened trace
251
+ * throws instead. Naming a kind in `allow` is how a caller says the weakening
252
+ * is the point — the alternative was a trace that replays green and proves
253
+ * less than it looks like it proves.
254
+ */
255
+ export declare function renderAgentCoreTrace(events: readonly AgentCoreSessionEvent[], options?: AgentCoreTraceOptions): AgentCoreTrace;
256
+ //# sourceMappingURL=trace-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-render.d.ts","sourceRoot":"","sources":["../../src/agentcore/trace-render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAIH,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,YAAY,CAAC;AAuBnF,sEAAsE;AACtE,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,MAAM,GACN,OAAO,GACP,eAAe,GACf,SAAS,mBAAmB,EAAE,GAC9B;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,CAAC;AAEpD,iFAAiF;AACjF,MAAM,MAAM,eAAe,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