agentfootprint 9.46.3 → 9.48.0
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.
- package/CLAUDE.md +49 -2
- package/dist/adapters/code/agentcore.js +35 -7
- package/dist/adapters/code/agentcore.js.map +1 -1
- package/dist/adapters/code/local.js +94 -10
- package/dist/adapters/code/local.js.map +1 -1
- package/dist/core/Agent.js +18 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +147 -3
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/runManifest.js +7 -0
- package/dist/core/agent/runManifest.js.map +1 -1
- package/dist/core/checkin.js +16 -2
- package/dist/core/checkin.js.map +1 -1
- package/dist/core/pause.js +64 -1
- package/dist/core/pause.js.map +1 -1
- package/dist/doors/recipes.js +55 -0
- package/dist/doors/recipes.js.map +1 -0
- package/dist/esm/adapters/code/agentcore.js +35 -7
- package/dist/esm/adapters/code/agentcore.js.map +1 -1
- package/dist/esm/adapters/code/local.js +94 -10
- package/dist/esm/adapters/code/local.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +9 -1
- package/dist/esm/core/Agent.js +19 -2
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +68 -0
- package/dist/esm/core/agent/AgentBuilder.js +147 -3
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/runManifest.d.ts +18 -0
- package/dist/esm/core/agent/runManifest.js +7 -0
- package/dist/esm/core/agent/runManifest.js.map +1 -1
- package/dist/esm/core/checkin.d.ts +58 -0
- package/dist/esm/core/checkin.js +16 -2
- package/dist/esm/core/checkin.js.map +1 -1
- package/dist/esm/core/pause.d.ts +44 -0
- package/dist/esm/core/pause.js +61 -0
- package/dist/esm/core/pause.js.map +1 -1
- package/dist/esm/doors/recipes.d.ts +38 -0
- package/dist/esm/doors/recipes.js +39 -0
- package/dist/esm/doors/recipes.js.map +1 -0
- package/dist/esm/events/payloads.d.ts +29 -0
- package/dist/esm/hosting/conformance/cases.js +23 -4
- package/dist/esm/hosting/conformance/cases.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/observe.d.ts +2 -0
- package/dist/esm/observe.js +12 -0
- package/dist/esm/observe.js.map +1 -1
- package/dist/esm/recipes/apply.d.ts +67 -0
- package/dist/esm/recipes/apply.js +117 -0
- package/dist/esm/recipes/apply.js.map +1 -0
- package/dist/esm/recipes/defineAgentRecipe.d.ts +68 -0
- package/dist/esm/recipes/defineAgentRecipe.js +112 -0
- package/dist/esm/recipes/defineAgentRecipe.js.map +1 -0
- package/dist/esm/recipes/identifier.d.ts +40 -0
- package/dist/esm/recipes/identifier.js +95 -0
- package/dist/esm/recipes/identifier.js.map +1 -0
- package/dist/esm/recipes/index.d.ts +19 -0
- package/dist/esm/recipes/index.js +19 -0
- package/dist/esm/recipes/index.js.map +1 -0
- package/dist/esm/recipes/provenance.d.ts +57 -0
- package/dist/esm/recipes/provenance.js +53 -0
- package/dist/esm/recipes/provenance.js.map +1 -0
- package/dist/esm/recipes/types.d.ts +134 -0
- package/dist/esm/recipes/types.js +63 -0
- package/dist/esm/recipes/types.js.map +1 -0
- package/dist/esm/recipes/version.d.ts +38 -0
- package/dist/esm/recipes/version.js +84 -0
- package/dist/esm/recipes/version.js.map +1 -0
- package/dist/esm/recorders/observability/fileRecordingSink.d.ts +104 -0
- package/dist/esm/recorders/observability/fileRecordingSink.js +195 -0
- package/dist/esm/recorders/observability/fileRecordingSink.js.map +1 -0
- package/dist/esm/recorders/observability/recordingEnvelope.d.ts +292 -0
- package/dist/esm/recorders/observability/recordingEnvelope.js +375 -0
- package/dist/esm/recorders/observability/recordingEnvelope.js.map +1 -0
- package/dist/hosting/conformance/cases.js +23 -4
- package/dist/hosting/conformance/cases.js.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/observe.js +23 -1
- package/dist/observe.js.map +1 -1
- package/dist/recipes/apply.js +125 -0
- package/dist/recipes/apply.js.map +1 -0
- package/dist/recipes/defineAgentRecipe.js +118 -0
- package/dist/recipes/defineAgentRecipe.js.map +1 -0
- package/dist/recipes/identifier.js +100 -0
- package/dist/recipes/identifier.js.map +1 -0
- package/dist/recipes/index.js +24 -0
- package/dist/recipes/index.js.map +1 -0
- package/dist/recipes/provenance.js +57 -0
- package/dist/recipes/provenance.js.map +1 -0
- package/dist/recipes/types.js +64 -0
- package/dist/recipes/types.js.map +1 -0
- package/dist/recipes/version.js +89 -0
- package/dist/recipes/version.js.map +1 -0
- package/dist/recorders/observability/fileRecordingSink.js +201 -0
- package/dist/recorders/observability/fileRecordingSink.js.map +1 -0
- package/dist/recorders/observability/recordingEnvelope.js +382 -0
- package/dist/recorders/observability/recordingEnvelope.js.map +1 -0
- package/dist/types/adapters/code/agentcore.d.ts.map +1 -1
- package/dist/types/adapters/code/local.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +9 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +68 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/runManifest.d.ts +18 -0
- package/dist/types/core/agent/runManifest.d.ts.map +1 -1
- package/dist/types/core/checkin.d.ts +58 -0
- package/dist/types/core/checkin.d.ts.map +1 -1
- package/dist/types/core/pause.d.ts +44 -0
- package/dist/types/core/pause.d.ts.map +1 -1
- package/dist/types/doors/recipes.d.ts +39 -0
- package/dist/types/doors/recipes.d.ts.map +1 -0
- package/dist/types/events/payloads.d.ts +29 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/hosting/conformance/cases.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/observe.d.ts +2 -0
- package/dist/types/observe.d.ts.map +1 -1
- package/dist/types/recipes/apply.d.ts +68 -0
- package/dist/types/recipes/apply.d.ts.map +1 -0
- package/dist/types/recipes/defineAgentRecipe.d.ts +69 -0
- package/dist/types/recipes/defineAgentRecipe.d.ts.map +1 -0
- package/dist/types/recipes/identifier.d.ts +41 -0
- package/dist/types/recipes/identifier.d.ts.map +1 -0
- package/dist/types/recipes/index.d.ts +20 -0
- package/dist/types/recipes/index.d.ts.map +1 -0
- package/dist/types/recipes/provenance.d.ts +58 -0
- package/dist/types/recipes/provenance.d.ts.map +1 -0
- package/dist/types/recipes/types.d.ts +135 -0
- package/dist/types/recipes/types.d.ts.map +1 -0
- package/dist/types/recipes/version.d.ts +39 -0
- package/dist/types/recipes/version.d.ts.map +1 -0
- package/dist/types/recorders/observability/fileRecordingSink.d.ts +105 -0
- package/dist/types/recorders/observability/fileRecordingSink.d.ts.map +1 -0
- package/dist/types/recorders/observability/recordingEnvelope.d.ts +293 -0
- package/dist/types/recorders/observability/recordingEnvelope.d.ts.map +1 -0
- package/package.json +15 -2
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* recordingEnvelope — the versioned, serialized contract around a recording.
|
|
3
|
+
*
|
|
4
|
+
* `recordRun` already freezes a run into `{ events, snapshot, structure }`, and
|
|
5
|
+
* that shape is exactly right for handing to a viewer in the same process. What
|
|
6
|
+
* it is NOT is a thing you can put on disk and read back next quarter: it
|
|
7
|
+
* carries no format marker, no producer version, no statement of which run it
|
|
8
|
+
* is, and no statement of whether it is the WHOLE run. So every consumer that
|
|
9
|
+
* wanted to archive one, attach one to a bug report, or feed one to an analysis
|
|
10
|
+
* tool invented its own wrapper — and each wrapper made a different guess about
|
|
11
|
+
* the same missing facts.
|
|
12
|
+
*
|
|
13
|
+
* This is the producer-owned answer: one envelope, one format string, and every
|
|
14
|
+
* field either a fact the library can prove or a fact the caller stated.
|
|
15
|
+
*
|
|
16
|
+
* import { persistRecording, fileRecordingSink } from 'agentfootprint/observe';
|
|
17
|
+
*
|
|
18
|
+
* const recorder = recordRun(agent);
|
|
19
|
+
* await agent.run({ message });
|
|
20
|
+
* await persistRecording(recorder, {
|
|
21
|
+
* sink: fileRecordingSink({ directory: './run-archive' }),
|
|
22
|
+
* run: { complete: true },
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* ## The rule this file exists to keep: never stamp a fact you had to guess
|
|
26
|
+
*
|
|
27
|
+
* An envelope is read by people and tools that were not there when the run
|
|
28
|
+
* happened. That makes every field a claim, and a claim that turns out to be a
|
|
29
|
+
* guess is worse than a missing field — a missing field sends the reader to
|
|
30
|
+
* look, a wrong field stops them looking. So each one has a stated source:
|
|
31
|
+
*
|
|
32
|
+
* runId, sessionId, derived from the EVENT META, which is the only
|
|
33
|
+
* principal, tenant place these are recorded, or stated by the caller.
|
|
34
|
+
* Never synthesized. See "identity" below.
|
|
35
|
+
* startedAt / endedAt derived from event wall clocks, but only where the
|
|
36
|
+
* stream can honestly supply them (see below).
|
|
37
|
+
* complete CALLER INPUT, always. Nothing in a finished
|
|
38
|
+
* recording says whether the run reached its end.
|
|
39
|
+
* droppedEvents read off the live recorder, which counts them; a
|
|
40
|
+
* bare recording carries no count, so it is asked for
|
|
41
|
+
* rather than assumed to be 0.
|
|
42
|
+
* configuration lifted from the run's own `run_configured` event —
|
|
43
|
+
* the manifest, which is names-and-ids only by law.
|
|
44
|
+
* producer read from the package manifests at runtime.
|
|
45
|
+
*
|
|
46
|
+
* Where a fact is neither derivable nor supplied, this REFUSES
|
|
47
|
+
* ({@link IndeterminateRunFactError}) instead of filling in a plausible value.
|
|
48
|
+
*
|
|
49
|
+
* ## Identity is never invented
|
|
50
|
+
*
|
|
51
|
+
* `principal` and `tenant` come from `EventMeta`, and `EventMeta`'s own law
|
|
52
|
+
* (see src/events/types.ts) is that they are stamped ONLY from an explicit
|
|
53
|
+
* `run(input, { identity })` — never from the run's internal identity, and
|
|
54
|
+
* never from a session id, because "a conversation id is not an actor". By
|
|
55
|
+
* sourcing them from the meta and nowhere else, this envelope inherits that
|
|
56
|
+
* guarantee whole: an anonymous run produces an envelope with no `principal`
|
|
57
|
+
* key at all, not a placeholder and not a session id wearing an actor's name.
|
|
58
|
+
*
|
|
59
|
+
* ## `runId` has two namespaces, and this one is deliberate
|
|
60
|
+
*
|
|
61
|
+
* A footprintjs snapshot carries its OWN engine-level `runId`
|
|
62
|
+
* (`<timestamp>-<padded counter>`, minted per `executor.run()`), while the
|
|
63
|
+
* agentfootprint events carry `run-<timestamp>-<seq>` from `makeRunId()`. They
|
|
64
|
+
* are different ids for different layers and they do not match. This envelope
|
|
65
|
+
* uses the EVENT-meta one exclusively, because that is the id `sessionId`,
|
|
66
|
+
* `principal` and `tenant` ride beside and the one every typed-event consumer
|
|
67
|
+
* correlates on. When the events cannot supply it, this refuses rather than
|
|
68
|
+
* falling back to the snapshot's — quietly substituting an id from another
|
|
69
|
+
* namespace would make two envelopes look comparable when they are not.
|
|
70
|
+
*/
|
|
71
|
+
import type { RunManifestLike } from '../../lib/context-bisect/arms/types.js';
|
|
72
|
+
import type { Recording, RunRecorder } from './recordRun.js';
|
|
73
|
+
/**
|
|
74
|
+
* The format marker. Bumped only for a change an older reader could not
|
|
75
|
+
* survive — a reader that does not recognise the string must refuse the file,
|
|
76
|
+
* never half-read it.
|
|
77
|
+
*/
|
|
78
|
+
export declare const RECORDING_ENVELOPE_FORMAT = "agentfootprint.recording.v1";
|
|
79
|
+
/**
|
|
80
|
+
* The privacy policy id a `'full'` envelope carries when the caller names none.
|
|
81
|
+
* A stable string so a retention rule can match on it rather than on prose.
|
|
82
|
+
*/
|
|
83
|
+
export declare const FULL_PRIVACY_POLICY_ID = "agentfootprint.privacy.full.v1";
|
|
84
|
+
/**
|
|
85
|
+
* What a caller may ASK for. Only `'full'` is implemented in v1; the other two
|
|
86
|
+
* are named here so the refusal can name them back, and so a consumer writing
|
|
87
|
+
* against a future version gets a compile-time hint rather than a typo.
|
|
88
|
+
*/
|
|
89
|
+
export type RecordingPrivacyMode = 'full' | 'structure-only' | 'redacted';
|
|
90
|
+
/** Versions of the two libraries that produced the bytes. */
|
|
91
|
+
export interface RecordingProducer {
|
|
92
|
+
/** This library's version, or `'unknown'` when the manifest is unreadable. */
|
|
93
|
+
readonly agentfootprintVersion: string;
|
|
94
|
+
/** The engine underneath it, or `'unknown'`. */
|
|
95
|
+
readonly footprintjsVersion: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* WHICH run this is, and how much of it this is.
|
|
99
|
+
*
|
|
100
|
+
* Every field is either derived from the recording's own events or stated by
|
|
101
|
+
* the caller — see the module header for the per-field source.
|
|
102
|
+
*/
|
|
103
|
+
export interface RecordingRun {
|
|
104
|
+
/** From `EventMeta.runId` — the agentfootprint run id, not the engine's. */
|
|
105
|
+
readonly runId: string;
|
|
106
|
+
/** Present only when the run was session-bound. Never invented. */
|
|
107
|
+
readonly sessionId?: string;
|
|
108
|
+
/** The actor the caller NAMED. Absent for an anonymous run. */
|
|
109
|
+
readonly principal?: string;
|
|
110
|
+
/** The tenant boundary the caller NAMED. Absent for a single-tenant run. */
|
|
111
|
+
readonly tenant?: string;
|
|
112
|
+
/** ISO 8601. The first recorded event's wall clock, unless the caller said. */
|
|
113
|
+
readonly startedAt: string;
|
|
114
|
+
/**
|
|
115
|
+
* ISO 8601. Absent when the recording is not `complete` and the caller named
|
|
116
|
+
* no end — a run that had not finished has no end time to report.
|
|
117
|
+
*/
|
|
118
|
+
readonly endedAt?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Did this recording capture the run through to its end?
|
|
121
|
+
*
|
|
122
|
+
* ALWAYS the caller's statement. A frozen recording looks identical whether
|
|
123
|
+
* it was taken after the run or from a crash handler mid-run, and there is no
|
|
124
|
+
* run-terminal event in the registry to check, so the library cannot know.
|
|
125
|
+
* Defaulting it to `true` would make every crash dump claim to be whole.
|
|
126
|
+
*/
|
|
127
|
+
readonly complete: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Events discarded to stay under the recorder's `maxEvents` cap. `0` means
|
|
130
|
+
* "none were dropped", proven — never "we did not look".
|
|
131
|
+
*/
|
|
132
|
+
readonly droppedEvents: number;
|
|
133
|
+
}
|
|
134
|
+
/** What the agent was configured as — names and ids only, no values. */
|
|
135
|
+
export interface RecordingConfiguration {
|
|
136
|
+
readonly agentId?: string;
|
|
137
|
+
/**
|
|
138
|
+
* The run manifest, as the run itself declared it in
|
|
139
|
+
* `agentfootprint.agent.run_configured`.
|
|
140
|
+
*
|
|
141
|
+
* Safe to archive by construction: the manifest's own law is NAMES AND IDS
|
|
142
|
+
* ONLY — no endpoints, directories, connection strings or keys — precisely
|
|
143
|
+
* because it was built to ride into recordings and shared traces.
|
|
144
|
+
*/
|
|
145
|
+
readonly manifest?: RunManifestLike;
|
|
146
|
+
}
|
|
147
|
+
/** What was done to the bytes before they were stored. */
|
|
148
|
+
export interface RecordingPrivacy {
|
|
149
|
+
/**
|
|
150
|
+
* `'full'` — the recording is exactly what `recordRun` captured, unredacted.
|
|
151
|
+
*
|
|
152
|
+
* A v1 envelope can say nothing else: the redacting modes are not built, and
|
|
153
|
+
* this refuses to produce a label it cannot honour.
|
|
154
|
+
*/
|
|
155
|
+
readonly mode: 'full';
|
|
156
|
+
/** Names the policy the producer applied. See {@link FULL_PRIVACY_POLICY_ID}. */
|
|
157
|
+
readonly policyId: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* One archived run: the recording, plus everything a reader needs to know what
|
|
161
|
+
* they are holding.
|
|
162
|
+
*
|
|
163
|
+
* Plain JSON by construction — no Dates, no Maps, no live handles — so
|
|
164
|
+
* `JSON.parse(JSON.stringify(envelope))` is the same envelope. Absent optional
|
|
165
|
+
* fields are absent KEYS rather than keys with `undefined`, which is what makes
|
|
166
|
+
* that round trip exact.
|
|
167
|
+
*/
|
|
168
|
+
export interface RecordingEnvelope {
|
|
169
|
+
readonly format: typeof RECORDING_ENVELOPE_FORMAT;
|
|
170
|
+
readonly producer: RecordingProducer;
|
|
171
|
+
readonly run: RecordingRun;
|
|
172
|
+
readonly configuration?: RecordingConfiguration;
|
|
173
|
+
readonly privacy: RecordingPrivacy;
|
|
174
|
+
/** The recording itself, unmodified — `{ snapshot, events, structure }`. */
|
|
175
|
+
readonly recording: Recording;
|
|
176
|
+
}
|
|
177
|
+
/** A timestamp a caller may state, in any of the three obvious spellings. */
|
|
178
|
+
export type RecordingTimestamp = string | number | Date;
|
|
179
|
+
/** The run facts a caller states — the half the library cannot derive. */
|
|
180
|
+
export interface RecordingRunFacts {
|
|
181
|
+
/**
|
|
182
|
+
* Did the recording capture the run through to its end?
|
|
183
|
+
*
|
|
184
|
+
* Required, and deliberately so: this is the one field with no derivation and
|
|
185
|
+
* no safe default, so the API asks rather than guesses. Say `false` for a
|
|
186
|
+
* recording frozen from a crash handler, a timeout, or mid-stream.
|
|
187
|
+
*/
|
|
188
|
+
readonly complete: boolean;
|
|
189
|
+
/** Override the event-derived run id, or supply it when events cannot. */
|
|
190
|
+
readonly runId?: string;
|
|
191
|
+
readonly sessionId?: string;
|
|
192
|
+
readonly principal?: string;
|
|
193
|
+
readonly tenant?: string;
|
|
194
|
+
readonly startedAt?: RecordingTimestamp;
|
|
195
|
+
readonly endedAt?: RecordingTimestamp;
|
|
196
|
+
/**
|
|
197
|
+
* Events lost to the recorder's cap. Read off a live `recordRun` handle
|
|
198
|
+
* automatically; state it when persisting a bare `Recording`, whose shape
|
|
199
|
+
* carries no count.
|
|
200
|
+
*/
|
|
201
|
+
readonly droppedEvents?: number;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Where an envelope goes. One method, so a destination is a few lines: a
|
|
205
|
+
* directory, an object store, a table, an HTTP endpoint.
|
|
206
|
+
*/
|
|
207
|
+
export interface RecordingSink {
|
|
208
|
+
/**
|
|
209
|
+
* Store one envelope.
|
|
210
|
+
*
|
|
211
|
+
* @returns `id` the sink's own handle for what it just stored.
|
|
212
|
+
* `uri` where it landed, when the sink has a meaningful address.
|
|
213
|
+
*/
|
|
214
|
+
write(envelope: RecordingEnvelope): Promise<{
|
|
215
|
+
id: string;
|
|
216
|
+
uri?: string;
|
|
217
|
+
}>;
|
|
218
|
+
}
|
|
219
|
+
/** Options for {@link persistRecording}. */
|
|
220
|
+
export interface PersistRecordingOptions {
|
|
221
|
+
readonly sink: RecordingSink;
|
|
222
|
+
/**
|
|
223
|
+
* The run facts. Required because {@link RecordingRunFacts.complete} is:
|
|
224
|
+
* an envelope that did not state whether it holds a whole run is an envelope
|
|
225
|
+
* whose reader has to guess.
|
|
226
|
+
*/
|
|
227
|
+
readonly run: RecordingRunFacts;
|
|
228
|
+
/** Override the manifest lifted from the run's own `run_configured` event. */
|
|
229
|
+
readonly configuration?: RecordingConfiguration;
|
|
230
|
+
readonly privacy?: {
|
|
231
|
+
readonly mode?: RecordingPrivacyMode;
|
|
232
|
+
readonly policyId?: string;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
/** Options for {@link buildRecordingEnvelope}. */
|
|
236
|
+
export type BuildRecordingEnvelopeOptions = Omit<PersistRecordingOptions, 'sink'>;
|
|
237
|
+
/** A recording to envelope, or the live handle that is still collecting one. */
|
|
238
|
+
export type RecordingSource = Recording | RunRecorder;
|
|
239
|
+
/**
|
|
240
|
+
* Raised when a privacy mode is asked for that this version cannot honour.
|
|
241
|
+
*
|
|
242
|
+
* Its own class because the answer is never "retry": a caller catching this has
|
|
243
|
+
* to change what they store or how they store it.
|
|
244
|
+
*/
|
|
245
|
+
export declare class UnsupportedPrivacyModeError extends Error {
|
|
246
|
+
readonly code: "ERR_UNSUPPORTED_PRIVACY_MODE";
|
|
247
|
+
readonly mode: string;
|
|
248
|
+
constructor(mode: string);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Raised when a required run fact is neither derivable from the recording nor
|
|
252
|
+
* stated by the caller.
|
|
253
|
+
*
|
|
254
|
+
* Carries the `field` so a caller can catch it and supply exactly that one.
|
|
255
|
+
*/
|
|
256
|
+
export declare class IndeterminateRunFactError extends Error {
|
|
257
|
+
readonly code: "ERR_INDETERMINATE_RUN_FACT";
|
|
258
|
+
readonly field: string;
|
|
259
|
+
constructor(field: string, detail: string);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Freeze a recording into an archivable envelope, without storing it.
|
|
263
|
+
*
|
|
264
|
+
* The half of {@link persistRecording} that has no destination — useful when
|
|
265
|
+
* the envelope goes somewhere this library should not know about (a request
|
|
266
|
+
* body, a queue), and the unit under test for the contract itself.
|
|
267
|
+
*/
|
|
268
|
+
export declare function buildRecordingEnvelope(source: RecordingSource, options: BuildRecordingEnvelopeOptions): RecordingEnvelope;
|
|
269
|
+
/**
|
|
270
|
+
* Build the envelope and hand it to a sink.
|
|
271
|
+
*
|
|
272
|
+
* @param source the handle from `recordRun(agent)`, or the recording it made.
|
|
273
|
+
* Prefer the handle: it is the only thing that knows how many
|
|
274
|
+
* events the cap discarded.
|
|
275
|
+
* @param options the destination, the run facts, and the privacy statement.
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```ts
|
|
279
|
+
* const recorder = recordRun(agent);
|
|
280
|
+
* await agent.run({ message: 'Weather in San Francisco?' });
|
|
281
|
+
*
|
|
282
|
+
* const { uri } = await persistRecording(recorder, {
|
|
283
|
+
* sink: fileRecordingSink({ directory: './run-archive' }),
|
|
284
|
+
* run: { complete: true },
|
|
285
|
+
* });
|
|
286
|
+
* recorder.stop();
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
export declare function persistRecording(source: RecordingSource, options: PersistRecordingOptions): Promise<{
|
|
290
|
+
id: string;
|
|
291
|
+
uri?: string;
|
|
292
|
+
}>;
|
|
293
|
+
//# sourceMappingURL=recordingEnvelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recordingEnvelope.d.ts","sourceRoot":"","sources":["../../../../src/recorders/observability/recordingEnvelope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CASvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentfootprint",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.48.0",
|
|
4
4
|
"description": "The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"node": ">=20"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
|
-
"clean": "rm -rf dist coverage node_modules
|
|
59
|
+
"clean": "rm -rf dist coverage node_modules",
|
|
60
60
|
"build": "rm -rf dist && tsc && tsc -p tsconfig.esm.json && node scripts/postbuild-esm.mjs",
|
|
61
61
|
"watch": "tsc -w",
|
|
62
62
|
"test": "vitest run",
|
|
@@ -230,6 +230,16 @@
|
|
|
230
230
|
"default": "./dist/doors/skill-graph.js"
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
|
+
"./recipes": {
|
|
234
|
+
"import": {
|
|
235
|
+
"types": "./dist/esm/doors/recipes.d.ts",
|
|
236
|
+
"default": "./dist/esm/doors/recipes.js"
|
|
237
|
+
},
|
|
238
|
+
"require": {
|
|
239
|
+
"types": "./dist/types/doors/recipes.d.ts",
|
|
240
|
+
"default": "./dist/doors/recipes.js"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
233
243
|
"./package.json": "./package.json"
|
|
234
244
|
},
|
|
235
245
|
"typesVersions": {
|
|
@@ -269,6 +279,9 @@
|
|
|
269
279
|
],
|
|
270
280
|
"skill-graph": [
|
|
271
281
|
"./dist/types/doors/skill-graph.d.ts"
|
|
282
|
+
],
|
|
283
|
+
"recipes": [
|
|
284
|
+
"./dist/types/doors/recipes.d.ts"
|
|
272
285
|
]
|
|
273
286
|
}
|
|
274
287
|
},
|