@mastra/server 1.86.0-alpha.6 → 1.86.0-alpha.7
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/dist/{a2a-BFN2C8f2.js → a2a-WPGF38fX.js} +1 -1
- package/dist/{a2a-DlEIsCZz.cjs → a2a-vSZkdSRE.cjs} +1 -1
- package/dist/{agent-builder-Bd6qGrt6.js → agent-builder-C4AIqOxt.js} +1 -1
- package/dist/{agent-builder-Bz1beuPE.cjs → agent-builder-dZlRNj1k.cjs} +1 -1
- package/dist/{agents-BMdbohgU.js → agents-272TP94y.js} +17 -6
- package/dist/{agents-DiQ_L6BU.cjs → agents-mjQZV5tv.cjs} +17 -6
- package/dist/{api-schema-manifest-CsefW4Vv.js → api-schema-manifest-BjhiTdNv.js} +1 -1
- package/dist/{api-schema-manifest-BuAf53GH.cjs → api-schema-manifest-DVkepK_s.cjs} +1 -1
- package/dist/{catalogue-CAIZ08il.cjs → catalogue-BTE9b_mr.cjs} +5 -5
- package/dist/{catalogue-BtSLF1p2.js → catalogue-DH64Duv-.js} +5 -5
- package/dist/{conversations-6v0VCbif.cjs → conversations-BWA_---j.cjs} +1 -1
- package/dist/{conversations-Dzpv_Cgt.js → conversations-CXyaNjLR.js} +1 -1
- package/dist/dist-Bn0zFASI.js +1 -0
- package/dist/{dist-Czbww9cr.js → dist-Bp1bObAq.js} +290 -25
- package/dist/{dist-C0Das1QD.cjs → dist-CSffo32A.cjs} +1 -1
- package/dist/{dist-C5rwoPuL.cjs → dist-DGwsCtT4.cjs} +290 -25
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{editor-builder-Cx9ZiHBw.cjs → editor-builder-BS2xogE_.cjs} +1 -1
- package/dist/{editor-builder-DpNB1W4s.js → editor-builder-BayzCprJ.js} +1 -1
- package/dist/{plans-DYNE2s8s.cjs → plans-Bes_LVgv.cjs} +1 -1
- package/dist/{plans-BoUO4vWD.js → plans-xGwuiZUd.js} +1 -1
- package/dist/{probe-image-size-DQsyQSUh.cjs → probe-image-size-BR5MlnnJ.cjs} +1 -1
- package/dist/{probe-image-size-C0BvSeqt.js → probe-image-size-DBCcUUw_.js} +1 -1
- package/dist/{responses-ByDnfqlJ.cjs → responses-BH567IZf.cjs} +1 -1
- package/dist/{responses-CGv4KFQ3.js → responses-CwQO5y2X.js} +1 -1
- package/dist/{routes-BLjObOVE.cjs → routes-6p-xrUIq.cjs} +11 -11
- package/dist/{routes-C0TLNOPH.js → routes-CrBCJmjc.js} +11 -11
- package/dist/{scores-EVbkxGHy.cjs → scores-CXNkN7Bn.cjs} +1 -1
- package/dist/{scores-CqNF-thA.js → scores-ksmJiJnJ.js} +1 -1
- package/dist/server/handlers/a2a.cjs +1 -1
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agents.cjs +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/conversations.cjs +1 -1
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/editor-builder.cjs +1 -1
- package/dist/server/handlers/editor-builder.js +1 -1
- package/dist/server/handlers/favorites-enrichment.cjs +1 -1
- package/dist/server/handlers/favorites-enrichment.js +1 -1
- package/dist/server/handlers/plans.cjs +1 -1
- package/dist/server/handlers/plans.js +1 -1
- package/dist/server/handlers/responses.cjs +1 -1
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/scores.cjs +1 -1
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/stored-agent-favorites.cjs +1 -1
- package/dist/server/handlers/stored-agent-favorites.js +1 -1
- package/dist/server/handlers/stored-agents.cjs +1 -1
- package/dist/server/handlers/stored-agents.js +1 -1
- package/dist/server/handlers/stored-skill-favorites.cjs +1 -1
- package/dist/server/handlers/stored-skill-favorites.js +1 -1
- package/dist/server/handlers/stored-skills.cjs +1 -1
- package/dist/server/handlers/stored-skills.js +1 -1
- package/dist/server/handlers/system.cjs +1 -1
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers/tools.cjs +1 -1
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/voice.cjs +1 -1
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers.cjs +9 -9
- package/dist/server/handlers.js +9 -9
- package/dist/server/server-adapter/index.cjs +2 -2
- package/dist/server/server-adapter/index.js +2 -2
- package/dist/server/server-adapter/routes/conversations.d.ts +3 -3
- package/dist/{server-adapter-CxMHZZAv.js → server-adapter-BGOi-s7x.js} +1 -1
- package/dist/{server-adapter-BkAKl970.cjs → server-adapter-Ceag3til.cjs} +1 -1
- package/dist/{tools-CZmeb9MB.js → tools-CY44YtDW.js} +1 -1
- package/dist/{tools-D07qyAT0.cjs → tools-DLZ7go-n.cjs} +1 -1
- package/dist/{voice-BNwHCtxv.js → voice-DTjrAgqg.js} +1 -1
- package/dist/{voice-DN72TM58.cjs → voice-NaerSeVQ.cjs} +1 -1
- package/package.json +3 -3
- package/dist/dist-C_7xKME1.js +0 -1
|
@@ -8656,7 +8656,7 @@ function splitLines(text) {
|
|
|
8656
8656
|
else result.push(result.pop().slice(0, -1));
|
|
8657
8657
|
return result;
|
|
8658
8658
|
}
|
|
8659
|
-
// ../memory/dist/src-
|
|
8659
|
+
// ../memory/dist/src-CDv__4kY.js
|
|
8660
8660
|
var __defProp$3 = Object.defineProperty;
|
|
8661
8661
|
var __exportAll = (all, no_symbols) => {
|
|
8662
8662
|
let target = {};
|
|
@@ -37278,7 +37278,7 @@ async function resolveImageDimensionsAsync(part) {
|
|
|
37278
37278
|
const url = resolveHttpAssetUrl(getObjectValue(part, "image") ?? getObjectValue(part, "data"));
|
|
37279
37279
|
if (!url) return existing;
|
|
37280
37280
|
try {
|
|
37281
|
-
const probeImageSize = (await Promise.resolve().then(() => /* @__PURE__ */ require_rolldown_runtime.__toESM(require("./probe-image-size-
|
|
37281
|
+
const probeImageSize = (await Promise.resolve().then(() => /* @__PURE__ */ require_rolldown_runtime.__toESM(require("./probe-image-size-BR5MlnnJ.cjs").default, 1))).default;
|
|
37282
37282
|
const probed = await probeImageSize(url, {
|
|
37283
37283
|
open_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
|
|
37284
37284
|
response_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
|
|
@@ -41498,6 +41498,79 @@ var BufferingCoordinator = class BufferingCoordinator {
|
|
|
41498
41498
|
* Key format: "refl:{lockKey}"
|
|
41499
41499
|
*/
|
|
41500
41500
|
static reflectionBufferCycleIds = /* @__PURE__ */ new Map();
|
|
41501
|
+
/**
|
|
41502
|
+
* The buffered-reflection op that set the reflection boundary and cycle, and the generation
|
|
41503
|
+
* it buffers for. Key format: "refl:{lockKey}"
|
|
41504
|
+
*/
|
|
41505
|
+
static reflectionBufferOwners = /* @__PURE__ */ new Map();
|
|
41506
|
+
/** Set the reflection boundary for a new buffered-reflection op on generation `recordId`. */
|
|
41507
|
+
static startReflectionBuffer(bufferKey, tokens, recordId) {
|
|
41508
|
+
const owner = {
|
|
41509
|
+
recordId,
|
|
41510
|
+
retired: false
|
|
41511
|
+
};
|
|
41512
|
+
BufferingCoordinator.lastBufferedBoundary.set(bufferKey, tokens);
|
|
41513
|
+
BufferingCoordinator.reflectionBufferOwners.set(bufferKey, owner);
|
|
41514
|
+
return owner;
|
|
41515
|
+
}
|
|
41516
|
+
/** Drop this process's reflection boundary, cycle, and owner. */
|
|
41517
|
+
static clearReflectionBuffer(bufferKey) {
|
|
41518
|
+
BufferingCoordinator.lastBufferedBoundary.delete(bufferKey);
|
|
41519
|
+
BufferingCoordinator.reflectionBufferCycleIds.delete(bufferKey);
|
|
41520
|
+
BufferingCoordinator.reflectionBufferOwners.delete(bufferKey);
|
|
41521
|
+
}
|
|
41522
|
+
/**
|
|
41523
|
+
* Another writer retired generation `recordId`, so a buffer this process prepared for it can
|
|
41524
|
+
* never activate. Its boundary and cycle are dropped now, or, while the op that set them is
|
|
41525
|
+
* still running (it may be awaiting its `onReflectionEnd` hook), when that op finishes. State
|
|
41526
|
+
* owned by a newer generation is kept.
|
|
41527
|
+
*/
|
|
41528
|
+
static retireReflectionBuffer(bufferKey, recordId) {
|
|
41529
|
+
const owner = BufferingCoordinator.reflectionBufferOwners.get(bufferKey);
|
|
41530
|
+
if (owner && owner.recordId !== recordId) return;
|
|
41531
|
+
if (owner && BufferingCoordinator.asyncBufferingOps.has(bufferKey)) {
|
|
41532
|
+
owner.retired = true;
|
|
41533
|
+
return;
|
|
41534
|
+
}
|
|
41535
|
+
BufferingCoordinator.clearReflectionBuffer(bufferKey);
|
|
41536
|
+
}
|
|
41537
|
+
/**
|
|
41538
|
+
* Reconcile this process's reflection buffer state against an observed head record.
|
|
41539
|
+
* Whenever `head.id` differs from `owner.recordId`, confirm against a fresh storage read started
|
|
41540
|
+
* after `owner` existed (never trusting `generationCount`, which resets to 0 after `clear()`):
|
|
41541
|
+
* only retire/clear when storage's live head is no longer `owner.recordId`.
|
|
41542
|
+
*/
|
|
41543
|
+
static async reconcileReflectionBufferHead(bufferKey, headId, readLiveHead) {
|
|
41544
|
+
const owner = BufferingCoordinator.reflectionBufferOwners.get(bufferKey);
|
|
41545
|
+
if (!owner || owner.recordId === headId) return;
|
|
41546
|
+
const ownerRecordId = owner.recordId;
|
|
41547
|
+
const live = await readLiveHead();
|
|
41548
|
+
if (BufferingCoordinator.reflectionBufferOwners.get(bufferKey) !== owner || owner.recordId !== ownerRecordId) return;
|
|
41549
|
+
if (live?.id === ownerRecordId) return;
|
|
41550
|
+
if (BufferingCoordinator.asyncBufferingOps.has(bufferKey)) {
|
|
41551
|
+
owner.retired = true;
|
|
41552
|
+
return;
|
|
41553
|
+
}
|
|
41554
|
+
BufferingCoordinator.clearReflectionBuffer(bufferKey);
|
|
41555
|
+
}
|
|
41556
|
+
/**
|
|
41557
|
+
* Take the buffered-reflection cycle id for generation `recordId` and release its
|
|
41558
|
+
* coordinator state after its buffer activates. State owned by another generation
|
|
41559
|
+
* is left untouched.
|
|
41560
|
+
*/
|
|
41561
|
+
static consumeReflectionBuffer(bufferKey, recordId) {
|
|
41562
|
+
const owner = BufferingCoordinator.reflectionBufferOwners.get(bufferKey);
|
|
41563
|
+
if (owner && owner.recordId !== recordId) return void 0;
|
|
41564
|
+
const cycleId = BufferingCoordinator.reflectionBufferCycleIds.get(bufferKey);
|
|
41565
|
+
if (owner && BufferingCoordinator.asyncBufferingOps.has(bufferKey)) owner.retired = true;
|
|
41566
|
+
else BufferingCoordinator.clearReflectionBuffer(bufferKey);
|
|
41567
|
+
return cycleId;
|
|
41568
|
+
}
|
|
41569
|
+
/** Called when the op that started as `owner` finishes; completes a deferred retirement. */
|
|
41570
|
+
static finishReflectionBuffer(bufferKey, owner) {
|
|
41571
|
+
if (BufferingCoordinator.reflectionBufferOwners.get(bufferKey) !== owner) return;
|
|
41572
|
+
if (owner.retired) BufferingCoordinator.clearReflectionBuffer(bufferKey);
|
|
41573
|
+
}
|
|
41501
41574
|
constructor(opts) {
|
|
41502
41575
|
this.observationConfig = opts.observationConfig;
|
|
41503
41576
|
this.reflectionConfig = opts.reflectionConfig;
|
|
@@ -41553,6 +41626,7 @@ var BufferingCoordinator = class BufferingCoordinator {
|
|
|
41553
41626
|
BufferingCoordinator.asyncBufferingOps.delete(obsBufKey);
|
|
41554
41627
|
BufferingCoordinator.asyncBufferingOps.delete(reflBufKey);
|
|
41555
41628
|
BufferingCoordinator.reflectionBufferCycleIds.delete(reflBufKey);
|
|
41629
|
+
BufferingCoordinator.reflectionBufferOwners.delete(reflBufKey);
|
|
41556
41630
|
}
|
|
41557
41631
|
}
|
|
41558
41632
|
/**
|
|
@@ -44405,6 +44479,79 @@ var ObservationTurn = class {
|
|
|
44405
44479
|
};
|
|
44406
44480
|
}
|
|
44407
44481
|
};
|
|
44482
|
+
const pendingValuesBaseSchema = zod.z.object({
|
|
44483
|
+
recordId: zod.z.string(),
|
|
44484
|
+
reflectedObservationLineCount: zod.z.number(),
|
|
44485
|
+
values: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
44486
|
+
});
|
|
44487
|
+
const pendingValuesSchema = zod.z.union([pendingValuesBaseSchema.extend({
|
|
44488
|
+
reflectionDigest: zod.z.string().regex(/^[a-f0-9]{64}$/),
|
|
44489
|
+
reflection: zod.z.never().optional()
|
|
44490
|
+
}), pendingValuesBaseSchema.extend({
|
|
44491
|
+
reflection: zod.z.string(),
|
|
44492
|
+
reflectionDigest: zod.z.never().optional()
|
|
44493
|
+
})]);
|
|
44494
|
+
const metadataSchema = zod.z.record(zod.z.string(), zod.z.unknown());
|
|
44495
|
+
function reflectionDigest(reflection) {
|
|
44496
|
+
return (0, crypto$1.createHash)("sha256").update(reflection).digest("hex");
|
|
44497
|
+
}
|
|
44498
|
+
function getMastraMetadata(metadata) {
|
|
44499
|
+
const parsed = metadataSchema.safeParse(metadata?.mastra);
|
|
44500
|
+
return parsed.success ? parsed.data : {};
|
|
44501
|
+
}
|
|
44502
|
+
/** Keep prepared values outside active OM metadata, durable across Memory instances. */
|
|
44503
|
+
async function stageBufferedReflectionValues(storage, record, values) {
|
|
44504
|
+
if (!record.threadId || !record.bufferedReflection) return;
|
|
44505
|
+
const digest = reflectionDigest(record.bufferedReflection);
|
|
44506
|
+
await storage.updateThreadMetadata({
|
|
44507
|
+
id: record.threadId,
|
|
44508
|
+
update: (thread) => ({
|
|
44509
|
+
...thread.metadata,
|
|
44510
|
+
mastra: {
|
|
44511
|
+
...getMastraMetadata(thread.metadata),
|
|
44512
|
+
omBufferedReflection: {
|
|
44513
|
+
recordId: record.id,
|
|
44514
|
+
reflectionDigest: digest,
|
|
44515
|
+
reflectedObservationLineCount: record.reflectedObservationLineCount ?? 0,
|
|
44516
|
+
values: values ?? {}
|
|
44517
|
+
}
|
|
44518
|
+
}
|
|
44519
|
+
})
|
|
44520
|
+
});
|
|
44521
|
+
}
|
|
44522
|
+
/** Called under the OM commit lock, only after this exact buffer was activated. */
|
|
44523
|
+
async function publishBufferedReflectionValues(storage, extractors, record) {
|
|
44524
|
+
if (!record.threadId || !record.bufferedReflection) return;
|
|
44525
|
+
const digest = reflectionDigest(record.bufferedReflection);
|
|
44526
|
+
await storage.updateThreadMetadata({
|
|
44527
|
+
id: record.threadId,
|
|
44528
|
+
update: (thread) => {
|
|
44529
|
+
const mastra = getMastraMetadata(thread.metadata);
|
|
44530
|
+
const parsed = pendingValuesSchema.safeParse(mastra.omBufferedReflection);
|
|
44531
|
+
if (!parsed.success) return;
|
|
44532
|
+
const pending = parsed.data;
|
|
44533
|
+
if (pending.recordId !== record.id || (pending.reflectionDigest !== void 0 ? pending.reflectionDigest !== digest : pending.reflection !== record.bufferedReflection) || pending.reflectedObservationLineCount !== (record.reflectedObservationLineCount ?? 0)) return;
|
|
44534
|
+
const update = buildThreadMetadataFromExtractedValues(extractors, pending.values);
|
|
44535
|
+
const previous = (0, _mastra_core_memory.getThreadOMMetadata)(thread.metadata);
|
|
44536
|
+
const metadata = (0, _mastra_core_memory.setThreadOMMetadata)(thread.metadata, {
|
|
44537
|
+
currentTask: update.currentTask ?? previous?.currentTask,
|
|
44538
|
+
suggestedResponse: update.suggestedResponse ?? previous?.suggestedResponse,
|
|
44539
|
+
threadTitle: update.threadTitle ?? previous?.threadTitle,
|
|
44540
|
+
extracted: {
|
|
44541
|
+
...previous?.extracted,
|
|
44542
|
+
...update.extracted
|
|
44543
|
+
}
|
|
44544
|
+
});
|
|
44545
|
+
return {
|
|
44546
|
+
...metadata,
|
|
44547
|
+
mastra: {
|
|
44548
|
+
...getMastraMetadata(metadata),
|
|
44549
|
+
omBufferedReflection: null
|
|
44550
|
+
}
|
|
44551
|
+
};
|
|
44552
|
+
}
|
|
44553
|
+
});
|
|
44554
|
+
}
|
|
44408
44555
|
/**
|
|
44409
44556
|
* Build the Reflector's system prompt.
|
|
44410
44557
|
*
|
|
@@ -44762,6 +44909,15 @@ function isReflectionApplied(returned, newRecordId, reflectedRecordId) {
|
|
|
44762
44909
|
return returned.supersededBy === void 0 && returned.id !== reflectedRecordId;
|
|
44763
44910
|
}
|
|
44764
44911
|
/**
|
|
44912
|
+
* The active observations a buffered-reflection swap writes: the buffered reflection replaces the
|
|
44913
|
+
* first `reflectedLineCount` lines, and the trimmed remainder follows after a blank line. Mirrors
|
|
44914
|
+
* `swapBufferedReflectionToActive` in the storage adapters.
|
|
44915
|
+
*/
|
|
44916
|
+
function bufferedActivationText({ bufferedReflection, observations, reflectedLineCount }) {
|
|
44917
|
+
const unreflected = observations.split("\n").slice(reflectedLineCount).join("\n").trim();
|
|
44918
|
+
return unreflected ? `${bufferedReflection}\n\n${unreflected}` : bufferedReflection;
|
|
44919
|
+
}
|
|
44920
|
+
/**
|
|
44765
44921
|
* Runs the Reflector agent for compressing observations.
|
|
44766
44922
|
* Handles synchronous reflection, async buffered reflection, and activation.
|
|
44767
44923
|
*/
|
|
@@ -45070,18 +45226,18 @@ var ReflectorRunner = class {
|
|
|
45070
45226
|
startAsyncBufferedReflection(record, observationTokens, lockKey, writer, requestContext, observabilityContext, reflectionHooks, priorExtractedValues, mainAgent, sendSignal, trigger, currentModel) {
|
|
45071
45227
|
const bufferKey = this.buffering.getReflectionBufferKey(lockKey);
|
|
45072
45228
|
if (this.buffering.isAsyncBufferingInProgress(bufferKey)) return;
|
|
45073
|
-
BufferingCoordinator.
|
|
45229
|
+
const owner = BufferingCoordinator.startReflectionBuffer(bufferKey, observationTokens, record.id);
|
|
45074
45230
|
registerOp(record.id, "bufferingReflection");
|
|
45075
45231
|
const flagSet = this.storage.setBufferingReflectionFlag(record.id, true).catch((err) => {
|
|
45076
45232
|
omError("[OM] Failed to set buffering reflection flag", err);
|
|
45077
45233
|
});
|
|
45078
|
-
const
|
|
45234
|
+
const run = async () => {
|
|
45079
45235
|
await flagSet;
|
|
45080
45236
|
let outcome;
|
|
45081
45237
|
let reflectionError;
|
|
45082
45238
|
try {
|
|
45083
45239
|
await reflectionHooks?.onReflectionStart?.();
|
|
45084
|
-
outcome = await this.doAsyncBufferedReflection(record, bufferKey, writer, requestContext, observabilityContext, priorExtractedValues, mainAgent, sendSignal, trigger, currentModel);
|
|
45240
|
+
outcome = await this.doAsyncBufferedReflection(record, bufferKey, owner, writer, requestContext, observabilityContext, priorExtractedValues, mainAgent, sendSignal, trigger, currentModel);
|
|
45085
45241
|
} catch (error) {
|
|
45086
45242
|
reflectionError = error instanceof Error ? error : new Error(String(error));
|
|
45087
45243
|
if (writer) try {
|
|
@@ -45104,7 +45260,7 @@ var ReflectorRunner = class {
|
|
|
45104
45260
|
omError("[OM] Failed to persist buffering-failed marker after async buffered reflection failure", markerError);
|
|
45105
45261
|
}
|
|
45106
45262
|
omError("[OM] Async buffered reflection failed", error);
|
|
45107
|
-
|
|
45263
|
+
owner.retired = true;
|
|
45108
45264
|
} finally {
|
|
45109
45265
|
try {
|
|
45110
45266
|
await reflectionHooks?.onReflectionEnd?.({
|
|
@@ -45115,13 +45271,15 @@ var ReflectorRunner = class {
|
|
|
45115
45271
|
} catch (hookError) {
|
|
45116
45272
|
omError("[OM] onReflectionEnd hook failed after async buffered reflection", hookError);
|
|
45117
45273
|
}
|
|
45118
|
-
BufferingCoordinator.
|
|
45274
|
+
BufferingCoordinator.finishReflectionBuffer(bufferKey, owner);
|
|
45275
|
+
if (BufferingCoordinator.asyncBufferingOps.get(bufferKey) === asyncOp) BufferingCoordinator.asyncBufferingOps.delete(bufferKey);
|
|
45119
45276
|
unregisterOp(record.id, "bufferingReflection");
|
|
45120
45277
|
await this.storage.setBufferingReflectionFlag(record.id, false).catch((err) => {
|
|
45121
45278
|
omError("[OM] Failed to clear buffering reflection flag", err);
|
|
45122
45279
|
});
|
|
45123
45280
|
}
|
|
45124
|
-
}
|
|
45281
|
+
};
|
|
45282
|
+
const asyncOp = run();
|
|
45125
45283
|
BufferingCoordinator.asyncBufferingOps.set(bufferKey, asyncOp);
|
|
45126
45284
|
this.trackBackgroundWork?.(asyncOp, lockKey);
|
|
45127
45285
|
}
|
|
@@ -45129,13 +45287,27 @@ var ReflectorRunner = class {
|
|
|
45129
45287
|
* Perform async buffered reflection — reflects observations and stores to bufferedReflection.
|
|
45130
45288
|
* Does NOT create a new generation or update activeObservations.
|
|
45131
45289
|
*/
|
|
45132
|
-
async doAsyncBufferedReflection(record, bufferKey, writer, requestContext, observabilityContext, priorExtractedValues, mainAgent, sendSignal, trigger, currentModel) {
|
|
45133
|
-
const
|
|
45290
|
+
async doAsyncBufferedReflection(record, bufferKey, owner, writer, requestContext, observabilityContext, priorExtractedValues, mainAgent, sendSignal, trigger, currentModel) {
|
|
45291
|
+
const freshRecord = await this.storage.getObservationalMemory(record.threadId, record.resourceId);
|
|
45292
|
+
if (BufferingCoordinator.reflectionBufferOwners.get(bufferKey) !== owner) {
|
|
45293
|
+
omDebug(`[OM:reflect] doAsyncBufferedReflection: ${bufferKey} was cleared while the op waited; stopping`);
|
|
45294
|
+
return;
|
|
45295
|
+
}
|
|
45296
|
+
const currentRecord = freshRecord ?? record;
|
|
45297
|
+
if (freshRecord?.bufferedReflection) {
|
|
45298
|
+
omDebug(`[OM:reflect] doAsyncBufferedReflection: live head ${freshRecord.id} already has a buffered reflection; skipping duplicate run`);
|
|
45299
|
+
owner.retired = true;
|
|
45300
|
+
return;
|
|
45301
|
+
}
|
|
45134
45302
|
const observationTokens = currentRecord.observationTokenCount ?? 0;
|
|
45135
45303
|
const reflectThreshold = getMaxThreshold(this.getEffectiveReflectionTokens(currentRecord));
|
|
45136
45304
|
const bufferActivation = this.reflectionConfig.bufferActivation ?? .5;
|
|
45137
45305
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
45138
45306
|
const cycleId = `reflect-buf-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
|
|
45307
|
+
if (owner.recordId !== currentRecord.id) {
|
|
45308
|
+
owner.recordId = currentRecord.id;
|
|
45309
|
+
owner.retired = false;
|
|
45310
|
+
}
|
|
45139
45311
|
BufferingCoordinator.reflectionBufferCycleIds.set(bufferKey, cycleId);
|
|
45140
45312
|
const allLines = (currentRecord.activeObservations ?? "").split("\n");
|
|
45141
45313
|
const totalLines = allLines.length;
|
|
@@ -45172,10 +45344,18 @@ var ReflectorRunner = class {
|
|
|
45172
45344
|
const compressionStartLevel = await this.getCompressionStartLevel(requestContext);
|
|
45173
45345
|
const reflectResult = await this.call(activeObservations, void 0, void 0, compressionTarget, void 0, true, compressionStartLevel, requestContext, priorExtractedValues, observabilityContext, void 0, mainAgent, sendSignal, currentModel);
|
|
45174
45346
|
reflectResult.observations = await applyTextTransform(this.hooks, "afterReflection", reflectResult.observations, hookContext);
|
|
45347
|
+
if (!reflectResult.observations.trim()) {
|
|
45348
|
+
omDebug(`[OM:reflect] doAsyncBufferedReflection: reflection for ${currentRecord.id} is empty after afterReflection; discarding it`);
|
|
45349
|
+
owner.retired = true;
|
|
45350
|
+
return {
|
|
45351
|
+
usage: reflectResult.usage,
|
|
45352
|
+
providerMetadata: reflectResult.providerMetadata
|
|
45353
|
+
};
|
|
45354
|
+
}
|
|
45175
45355
|
const reflectionTokenCount = this.tokenCounter.countObservations(reflectResult.observations);
|
|
45176
45356
|
omDebug(`[OM:reflect] doAsyncBufferedReflection: reflector returned ${reflectionTokenCount} tokens (${reflectResult.observations?.length} chars), saving to recordId=${currentRecord.id}`);
|
|
45177
45357
|
if (!await runOMCommit(this.buffering.getLockKey(currentRecord.threadId, currentRecord.resourceId), async () => {
|
|
45178
|
-
if ((await this.storage.getObservationalMemory(currentRecord.threadId, currentRecord.resourceId))?.id !== currentRecord.id) return false;
|
|
45358
|
+
if ((await this.storage.getObservationalMemory(currentRecord.threadId, currentRecord.resourceId))?.id !== currentRecord.id || BufferingCoordinator.reflectionBufferOwners.get(bufferKey) !== owner) return false;
|
|
45179
45359
|
await this.storage.updateBufferedReflection({
|
|
45180
45360
|
id: currentRecord.id,
|
|
45181
45361
|
reflection: reflectResult.observations,
|
|
@@ -45183,17 +45363,18 @@ var ReflectorRunner = class {
|
|
|
45183
45363
|
inputTokenCount: sliceTokenEstimate,
|
|
45184
45364
|
reflectedObservationLineCount
|
|
45185
45365
|
});
|
|
45366
|
+
const buffered = await this.storage.getObservationalMemory(currentRecord.threadId, currentRecord.resourceId);
|
|
45367
|
+
if (buffered?.id === currentRecord.id && buffered.bufferedReflection === reflectResult.observations) await stageBufferedReflectionValues(this.storage, buffered, reflectResult.extractedValues);
|
|
45186
45368
|
return true;
|
|
45187
45369
|
})) {
|
|
45188
45370
|
omDebug(`[OM:reflect] doAsyncBufferedReflection: record ${currentRecord.id} is no longer the head; discarding the buffered reflection`);
|
|
45189
|
-
|
|
45371
|
+
owner.retired = true;
|
|
45190
45372
|
return {
|
|
45191
45373
|
usage: reflectResult.usage,
|
|
45192
45374
|
providerMetadata: reflectResult.providerMetadata
|
|
45193
45375
|
};
|
|
45194
45376
|
}
|
|
45195
45377
|
omDebug(`[OM:reflect] doAsyncBufferedReflection: bufferedReflection saved with lineCount=${reflectedObservationLineCount}`);
|
|
45196
|
-
await persistThreadExtractedValues(this.storage, this.reflectionConfig.extractors, currentRecord.threadId ?? void 0, reflectResult.extractedValues);
|
|
45197
45378
|
if (writer) {
|
|
45198
45379
|
const endMarker = createBufferingEndMarker({
|
|
45199
45380
|
cycleId,
|
|
@@ -45219,6 +45400,57 @@ var ReflectorRunner = class {
|
|
|
45219
45400
|
};
|
|
45220
45401
|
}
|
|
45221
45402
|
/**
|
|
45403
|
+
* Decide what a buffered-reflection swap did. Built-in adapters only swap the buffer and line
|
|
45404
|
+
* count in the snapshot, return the stored record (no new generation) when another writer
|
|
45405
|
+
* extended them after the head check, and mark a generation they created after that check with
|
|
45406
|
+
* `bufferedReflectionVerified`. Adapters without that check build the new generation from
|
|
45407
|
+
* whatever is stored. Either way the swap must also produce what the snapshot's buffer and line
|
|
45408
|
+
* count give from the text the swap retired (retired records are never written again, so that
|
|
45409
|
+
* text is exactly what the swap read).
|
|
45410
|
+
*
|
|
45411
|
+
* Staged values are published only with the adapter's proof. Without it an extension that
|
|
45412
|
+
* repeats the unreflected tail produces the same text as the snapshot's buffer, so the values
|
|
45413
|
+
* fail closed: the activation still applies, but the staged values stay unpublished.
|
|
45414
|
+
*/
|
|
45415
|
+
async classifyBufferedReflectionSwap({ result, newRecordId, snapshot, bufferedReflection, reflectedLineCount }) {
|
|
45416
|
+
if (result.id === snapshot.id) return {
|
|
45417
|
+
kind: "not-applied",
|
|
45418
|
+
headId: result.id
|
|
45419
|
+
};
|
|
45420
|
+
const createdByThisSwap = result.id === newRecordId;
|
|
45421
|
+
if (!createdByThisSwap && result.supersededBy !== void 0) return {
|
|
45422
|
+
kind: "not-applied",
|
|
45423
|
+
headId: result.id
|
|
45424
|
+
};
|
|
45425
|
+
const swapActiveObservations = result.activeObservations;
|
|
45426
|
+
const bufferedReflectionVerified = result.bufferedReflectionVerified === true;
|
|
45427
|
+
let matchesSnapshotBuffer = false;
|
|
45428
|
+
try {
|
|
45429
|
+
const retired = (await this.storage.getObservationalMemoryHistory(snapshot.threadId, snapshot.resourceId, 5, { recordId: snapshot.id })).find((candidate) => candidate.id === snapshot.id);
|
|
45430
|
+
matchesSnapshotBuffer = retired !== void 0 && swapActiveObservations === bufferedActivationText({
|
|
45431
|
+
bufferedReflection,
|
|
45432
|
+
observations: retired.activeObservations,
|
|
45433
|
+
reflectedLineCount
|
|
45434
|
+
});
|
|
45435
|
+
} catch (error) {
|
|
45436
|
+
omError("[OM] Failed to read the generation retired by buffered reflection activation", error);
|
|
45437
|
+
}
|
|
45438
|
+
const snapshotBufferActivated = matchesSnapshotBuffer && bufferedReflectionVerified;
|
|
45439
|
+
if (createdByThisSwap) return {
|
|
45440
|
+
kind: "applied",
|
|
45441
|
+
record: result,
|
|
45442
|
+
snapshotBufferActivated
|
|
45443
|
+
};
|
|
45444
|
+
return matchesSnapshotBuffer ? {
|
|
45445
|
+
kind: "applied",
|
|
45446
|
+
record: result,
|
|
45447
|
+
snapshotBufferActivated
|
|
45448
|
+
} : {
|
|
45449
|
+
kind: "not-applied",
|
|
45450
|
+
headId: result.id
|
|
45451
|
+
};
|
|
45452
|
+
}
|
|
45453
|
+
/**
|
|
45222
45454
|
* Try to activate buffered reflection when threshold is reached.
|
|
45223
45455
|
* Returns a discriminated result so the caller can distinguish between
|
|
45224
45456
|
* "activated", "no buffer present", and "suppressed by overshoot guard"
|
|
@@ -45238,18 +45470,26 @@ var ReflectorRunner = class {
|
|
|
45238
45470
|
}
|
|
45239
45471
|
}
|
|
45240
45472
|
}
|
|
45241
|
-
const
|
|
45473
|
+
const storedRecord = await this.storage.getObservationalMemory(record.threadId, record.resourceId);
|
|
45474
|
+
const freshRecord = storedRecord ? { ...storedRecord } : void 0;
|
|
45242
45475
|
omDebug(`[OM:reflect] tryActivateBufferedReflection: recordId=${record.id}, hasBufferedReflection=${!!freshRecord?.bufferedReflection}, bufferedReflectionLen=${freshRecord?.bufferedReflection?.length ?? 0}`);
|
|
45243
45476
|
omDebug(`[OM:reflect] tryActivateBufferedReflection: freshRecord.id=${freshRecord?.id}, freshBufferedReflection=${freshRecord?.bufferedReflection ? "present (" + freshRecord.bufferedReflection.length + " chars)" : "empty"}, freshObsTokens=${freshRecord?.observationTokenCount}`);
|
|
45477
|
+
if (freshRecord) await BufferingCoordinator.reconcileReflectionBufferHead(bufferKey, freshRecord.id, () => this.storage.getObservationalMemory(record.threadId, record.resourceId));
|
|
45244
45478
|
if (!freshRecord?.bufferedReflection) {
|
|
45245
45479
|
omDebug(`[OM:reflect] tryActivateBufferedReflection: no buffered reflection after re-fetch`);
|
|
45246
45480
|
return { status: "no-buffer" };
|
|
45247
45481
|
}
|
|
45248
45482
|
const beforeTokens = freshRecord.observationTokenCount ?? 0;
|
|
45249
45483
|
const reflectedLineCount = freshRecord.reflectedObservationLineCount ?? 0;
|
|
45250
|
-
const
|
|
45484
|
+
const currentObservations = freshRecord.activeObservations ?? "";
|
|
45485
|
+
const unreflectedLines = currentObservations.split("\n").slice(reflectedLineCount);
|
|
45251
45486
|
const unreflectedContent = unreflectedLines.join("\n").trim();
|
|
45252
|
-
const
|
|
45487
|
+
const bufferedReflection = freshRecord.bufferedReflection;
|
|
45488
|
+
const combinedObservations = bufferedActivationText({
|
|
45489
|
+
bufferedReflection,
|
|
45490
|
+
observations: currentObservations,
|
|
45491
|
+
reflectedLineCount
|
|
45492
|
+
});
|
|
45253
45493
|
const combinedTokenCount = this.tokenCounter.countObservations(combinedObservations);
|
|
45254
45494
|
if (activationMetadata?.triggeredBy === "ttl" || activationMetadata?.triggeredBy === "provider_change") {
|
|
45255
45495
|
const unreflectedTailTokens = unreflectedContent ? this.tokenCounter.countObservations(unreflectedContent) : 0;
|
|
@@ -45275,28 +45515,48 @@ var ReflectorRunner = class {
|
|
|
45275
45515
|
}
|
|
45276
45516
|
omDebug(`[OM:reflect] tryActivateBufferedReflection: activating, beforeTokens=${beforeTokens}, combinedTokenCount=${combinedTokenCount}, reflectedLineCount=${reflectedLineCount}, unreflectedLines=${unreflectedLines.length}`);
|
|
45277
45517
|
const newRecordId = crypto.randomUUID();
|
|
45278
|
-
const
|
|
45518
|
+
const commit = await runOMCommit(lockKey, async () => {
|
|
45279
45519
|
abortSignal?.throwIfAborted();
|
|
45280
|
-
|
|
45520
|
+
const head = await this.storage.getObservationalMemory(record.threadId, record.resourceId);
|
|
45521
|
+
if (head && (head.id !== freshRecord.id || head.bufferedReflection !== freshRecord.bufferedReflection || head.reflectedObservationLineCount !== freshRecord.reflectedObservationLineCount)) return {
|
|
45522
|
+
kind: "not-applied",
|
|
45523
|
+
headId: head.id
|
|
45524
|
+
};
|
|
45525
|
+
const result = await this.storage.swapBufferedReflectionToActive({
|
|
45281
45526
|
currentRecord: freshRecord,
|
|
45282
45527
|
tokenCount: combinedTokenCount,
|
|
45283
45528
|
newRecordId
|
|
45284
45529
|
});
|
|
45530
|
+
const outcome = await this.classifyBufferedReflectionSwap({
|
|
45531
|
+
result,
|
|
45532
|
+
newRecordId,
|
|
45533
|
+
snapshot: freshRecord,
|
|
45534
|
+
bufferedReflection,
|
|
45535
|
+
reflectedLineCount
|
|
45536
|
+
});
|
|
45537
|
+
if (outcome.kind === "applied" && outcome.snapshotBufferActivated) try {
|
|
45538
|
+
await publishBufferedReflectionValues(this.storage, this.reflectionConfig.extractors, freshRecord);
|
|
45539
|
+
} catch (error) {
|
|
45540
|
+
omError("[OM] Failed to publish buffered reflection values after activation", error);
|
|
45541
|
+
}
|
|
45542
|
+
return outcome;
|
|
45285
45543
|
}, {
|
|
45286
45544
|
priority: "reflection",
|
|
45287
45545
|
abortSignal
|
|
45288
45546
|
});
|
|
45289
|
-
if (
|
|
45290
|
-
omDebug(`[OM:reflect] tryActivateBufferedReflection: buffered reflection on ${freshRecord.id} not applied (head is ${
|
|
45547
|
+
if (commit.kind === "not-applied") {
|
|
45548
|
+
omDebug(`[OM:reflect] tryActivateBufferedReflection: buffered reflection on ${freshRecord.id} not applied (head is ${commit.headId})`);
|
|
45549
|
+
if (commit.headId !== freshRecord.id) BufferingCoordinator.retireReflectionBuffer(bufferKey, freshRecord.id);
|
|
45291
45550
|
return { status: "not-applied" };
|
|
45292
45551
|
}
|
|
45293
|
-
|
|
45552
|
+
if (!commit.snapshotBufferActivated) omDebug(`[OM:reflect] tryActivateBufferedReflection: ${commit.record.id} does not hold exactly the snapshot's buffered reflection (extended by another writer, or unverifiable); staged values stay unpublished`);
|
|
45553
|
+
const originalCycleId = BufferingCoordinator.consumeReflectionBuffer(bufferKey, freshRecord.id);
|
|
45294
45554
|
const afterRecord = await this.storage.getObservationalMemory(record.threadId, record.resourceId);
|
|
45295
45555
|
const afterTokens = afterRecord?.observationTokenCount ?? 0;
|
|
45296
45556
|
omDebug(`[OM:reflect] tryActivateBufferedReflection: activation complete! beforeTokens=${beforeTokens}, afterTokens=${afterTokens}, newRecordId=${afterRecord?.id}, newGenCount=${afterRecord?.generationCount}`);
|
|
45297
45557
|
if (writer) {
|
|
45298
45558
|
const activationMarker = createActivationMarker({
|
|
45299
|
-
cycleId:
|
|
45559
|
+
cycleId: originalCycleId ?? `reflect-act-${Date.now()}-${Math.random().toString(36).slice(2, 11)}`,
|
|
45300
45560
|
operationType: "reflection",
|
|
45301
45561
|
chunksActivated: 1,
|
|
45302
45562
|
tokensActivated: beforeTokens,
|
|
@@ -45322,7 +45582,6 @@ var ReflectorRunner = class {
|
|
|
45322
45582
|
}).catch(() => {});
|
|
45323
45583
|
await this.persistMarkerToMessage(activationMarker, messageList, freshRecord.threadId ?? "", freshRecord.resourceId ?? void 0, abortSignal);
|
|
45324
45584
|
}
|
|
45325
|
-
BufferingCoordinator.reflectionBufferCycleIds.delete(bufferKey);
|
|
45326
45585
|
return { status: "activated" };
|
|
45327
45586
|
}
|
|
45328
45587
|
/**
|
|
@@ -45339,7 +45598,7 @@ var ReflectorRunner = class {
|
|
|
45339
45598
|
const priorExtractedValues = await getThreadExtractedValues(this.storage, this.reflectionConfig.extractors, requestedThreadId ?? record.threadId);
|
|
45340
45599
|
abortSignal?.throwIfAborted();
|
|
45341
45600
|
if (this.buffering.isAsyncReflectionEnabled() && observationTokens < reflectThreshold) {
|
|
45342
|
-
if ((() => {
|
|
45601
|
+
if (await (async () => {
|
|
45343
45602
|
if (!this.buffering.isAsyncReflectionEnabled()) return false;
|
|
45344
45603
|
if (record.isBufferingReflection) {
|
|
45345
45604
|
if (isOpActiveInProcess(record.id, "bufferingReflection")) return false;
|
|
@@ -45347,6 +45606,7 @@ var ReflectorRunner = class {
|
|
|
45347
45606
|
this.storage.setBufferingReflectionFlag(record.id, false).catch(() => {});
|
|
45348
45607
|
}
|
|
45349
45608
|
const bufferKey = this.buffering.getReflectionBufferKey(lockKey);
|
|
45609
|
+
await BufferingCoordinator.reconcileReflectionBufferHead(bufferKey, record.id, () => this.storage.getObservationalMemory(record.threadId, record.resourceId));
|
|
45350
45610
|
if (this.buffering.isAsyncBufferingInProgress(bufferKey)) return false;
|
|
45351
45611
|
if (BufferingCoordinator.lastBufferedBoundary.has(bufferKey)) return false;
|
|
45352
45612
|
if (record.bufferedReflection) return false;
|
|
@@ -45392,6 +45652,11 @@ var ReflectorRunner = class {
|
|
|
45392
45652
|
omDebug(`[OM:reflect] skipping async reflection — observationTokens (${observationTokens}) below activation point (${activationPoint}), triggered by ${activationTriggeredBy}`);
|
|
45393
45653
|
return;
|
|
45394
45654
|
}
|
|
45655
|
+
const bufferKey = this.buffering.getReflectionBufferKey(lockKey);
|
|
45656
|
+
if (this.buffering.isAsyncBufferingInProgress(bufferKey) || BufferingCoordinator.lastBufferedBoundary.has(bufferKey)) {
|
|
45657
|
+
omDebug(`[OM:reflect] skipping async reflection — reflection buffer already active or present for ${bufferKey}`);
|
|
45658
|
+
return;
|
|
45659
|
+
}
|
|
45395
45660
|
omDebug(`[OM:reflect] async activation failed, no blockAfter or below it (obsTokens=${observationTokens}, blockAfter=${this.reflectionConfig.blockAfter}) — starting background reflection`);
|
|
45396
45661
|
this.startAsyncBufferedReflection(record, observationTokens, lockKey, writer, requestContext, observabilityContext, reflectionHooks, priorExtractedValues, mainAgent, sendSignal, trigger, currentModel);
|
|
45397
45662
|
return;
|
|
@@ -52796,7 +53061,7 @@ const createModelInstance = async (provider, modelId, version = "v2") => {
|
|
|
52796
53061
|
try {
|
|
52797
53062
|
const providerFn = version === `v1` ? { v1: {
|
|
52798
53063
|
openai: async () => {
|
|
52799
|
-
const { openai } = await Promise.resolve().then(() => require("./dist-
|
|
53064
|
+
const { openai } = await Promise.resolve().then(() => require("./dist-CSffo32A.cjs"));
|
|
52800
53065
|
return openai(modelId);
|
|
52801
53066
|
},
|
|
52802
53067
|
anthropic: async () => {
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_http_exception = require("./http-exception-Co3MbFUf.cjs");
|
|
2
2
|
const require_editor_builder = require("./editor-builder-eF2IetF2.cjs");
|
|
3
3
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
4
|
-
const require_agents = require("./agents-
|
|
4
|
+
const require_agents = require("./agents-mjQZV5tv.cjs");
|
|
5
5
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
6
6
|
// src/server/utils/resolve-builder-model-policy.ts
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as HTTPException } from "./http-exception-CzaWkxMl.js";
|
|
2
2
|
import { i as builderAvailableModelsResponseSchema, l as infrastructureStatusResponseSchema, n as agentFeaturesSchema, s as builderSettingsResponseSchema } from "./editor-builder-CXLdplIj.js";
|
|
3
3
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
4
|
-
import { U as buildProvidersList } from "./agents-
|
|
4
|
+
import { U as buildProvidersList } from "./agents-272TP94y.js";
|
|
5
5
|
import { handleError } from "./server/handlers/error.js";
|
|
6
6
|
// src/server/utils/resolve-builder-model-policy.ts
|
|
7
7
|
/**
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils-j29NB2ZJ.cjs");
|
|
|
3
3
|
const require_http_exception = require("./http-exception-Co3MbFUf.cjs");
|
|
4
4
|
const require_agents = require("./agents-CH_G37hG.cjs");
|
|
5
5
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
6
|
-
const require_agents$1 = require("./agents-
|
|
6
|
+
const require_agents$1 = require("./agents-mjQZV5tv.cjs");
|
|
7
7
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
8
8
|
let _mastra_core_tools = require("@mastra/core/tools");
|
|
9
9
|
// src/server/handlers/plans.ts
|
|
@@ -3,7 +3,7 @@ import { _ as MastraFGAPermissions } from "./utils-CvYihOoy.js";
|
|
|
3
3
|
import { t as HTTPException } from "./http-exception-CzaWkxMl.js";
|
|
4
4
|
import { a as agentIdPathParams, o as agentPlanQuerySchema, s as agentPlanResponseSchema } from "./agents-B0OpLdbp.js";
|
|
5
5
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
6
|
-
import { G as getAgentFromSystem } from "./agents-
|
|
6
|
+
import { G as getAgentFromSystem } from "./agents-272TP94y.js";
|
|
7
7
|
import { handleError } from "./server/handlers/error.js";
|
|
8
8
|
import { submitPlanTool } from "@mastra/core/tools";
|
|
9
9
|
// src/server/handlers/plans.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-10nMEhjP.cjs");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-DGwsCtT4.cjs");
|
|
3
3
|
let tty = require("tty");
|
|
4
4
|
tty = require_rolldown_runtime.__toESM(tty, 1);
|
|
5
5
|
let process$1 = require("process");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CQI-hT2b.js";
|
|
2
|
-
import { a as require_tiff, c as require_png, d as require_gif, f as require_bmp, i as require_webp, l as require_jpeg, m as require_utils, o as require_svg, p as require_avif, r as require_sync, s as require_psd, u as require_ico } from "./dist-
|
|
2
|
+
import { a as require_tiff, c as require_png, d as require_gif, f as require_bmp, i as require_webp, l as require_jpeg, m as require_utils, o as require_svg, p as require_avif, r as require_sync, s as require_psd, u as require_ico } from "./dist-Bp1bObAq.js";
|
|
3
3
|
import tty from "tty";
|
|
4
4
|
import process$1 from "process";
|
|
5
5
|
import os from "os";
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils-j29NB2ZJ.cjs");
|
|
|
3
3
|
const require_http_exception = require("./http-exception-Co3MbFUf.cjs");
|
|
4
4
|
const require_responses = require("./responses-CTiwnWeF.cjs");
|
|
5
5
|
const require_route_builder = require("./route-builder-DjTBxSZN.cjs");
|
|
6
|
-
const require_agents = require("./agents-
|
|
6
|
+
const require_agents = require("./agents-mjQZV5tv.cjs");
|
|
7
7
|
const require_server_handlers_error = require("./server/handlers/error.cjs");
|
|
8
8
|
const require_server_handlers_responses_adapter = require("./server/handlers/responses.adapter.cjs");
|
|
9
9
|
const require_server_handlers_responses_storage = require("./server/handlers/responses.storage.cjs");
|
|
@@ -3,7 +3,7 @@ import { _ as MastraFGAPermissions, a as getEffectiveThreadId, i as getEffective
|
|
|
3
3
|
import { t as HTTPException } from "./http-exception-CzaWkxMl.js";
|
|
4
4
|
import { a as deleteResponseSchema, i as createResponseBodySchema, o as responseIdPathParams, u as responseObjectSchema } from "./responses-D-fsDRLd.js";
|
|
5
5
|
import { n as createRoute } from "./route-builder-Dz18c3qm.js";
|
|
6
|
-
import { G as getAgentFromSystem } from "./agents-
|
|
6
|
+
import { G as getAgentFromSystem } from "./agents-272TP94y.js";
|
|
7
7
|
import { handleError } from "./server/handlers/error.js";
|
|
8
8
|
import { buildCompletedResponse, buildInProgressResponse, createMessageId, createOutputTextPart, createResponseStreamEventTranslator, formatSseEvent, mapMastraToolsToResponseTools, mapResponseInputToExecutionMessages, mapResponseTurnRecordToResponse, toResponseStatus, toResponseUsage } from "./server/handlers/responses.adapter.js";
|
|
9
9
|
import { deleteResponseTurnRecord, findResponseTurnRecord, findResponseTurnRecordAcrossAgents, getAgentMemoryStore, persistResponseTurnRecord, resolveResponseTurnMessagesForStorage } from "./server/handlers/responses.storage.js";
|