@mastra/server 1.63.0 → 1.63.1-alpha.1
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/CHANGELOG.md +14 -0
- package/LICENSE.md +6 -4
- package/dist/{dist-Xj9TvH1A.cjs → dist-D1upRr-y.cjs} +25 -10
- package/dist/dist-D1upRr-y.cjs.map +1 -0
- package/dist/{dist-L0EogwX_.js → dist-DdX88nxf.js} +25 -10
- package/dist/dist-DdX88nxf.js.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/package.json +4 -4
- package/dist/dist-L0EogwX_.js.map +0 -1
- package/dist/dist-Xj9TvH1A.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/server
|
|
2
2
|
|
|
3
|
+
## 1.63.1-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`078affd`](https://github.com/mastra-ai/mastra/commit/078affdaea57ac5e95a77e9e7b197d1878190684), [`9e3403e`](https://github.com/mastra-ai/mastra/commit/9e3403e9868240cb18841898e84cf008ebd7a87e), [`791bf5e`](https://github.com/mastra-ai/mastra/commit/791bf5e81cd27e2e1cff66122f1380ab8a3dda41)]:
|
|
8
|
+
- @mastra/core@1.63.1-alpha.1
|
|
9
|
+
|
|
10
|
+
## 1.63.1-alpha.0
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`bae1502`](https://github.com/mastra-ai/mastra/commit/bae150254b06a4da6964d7c137af97f336362359)]:
|
|
15
|
+
- @mastra/core@1.63.1-alpha.0
|
|
16
|
+
|
|
3
17
|
## 1.63.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/LICENSE.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
Portions of this software are licensed as follows:
|
|
2
2
|
|
|
3
|
-
- All content that resides under any directory named
|
|
3
|
+
- All content that resides under any directory named `ee/` within this
|
|
4
4
|
repository, including but not limited to:
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
5
|
+
- `@mastra/core/auth/ee`
|
|
6
|
+
- `@mastra/core/agent-builder/ee`
|
|
7
|
+
- `@mastra/editor/ee`
|
|
8
|
+
|
|
9
|
+
is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
|
|
8
10
|
|
|
9
11
|
- All third-party components incorporated into the Mastra Software are
|
|
10
12
|
licensed under the original license provided by the owner of the
|
|
@@ -4693,7 +4693,7 @@ function splitLines(text) {
|
|
|
4693
4693
|
return result;
|
|
4694
4694
|
}
|
|
4695
4695
|
//#endregion
|
|
4696
|
-
//#region ../memory/dist/src-
|
|
4696
|
+
//#region ../memory/dist/src-BsEVZAdq.js
|
|
4697
4697
|
var __defProp$3 = Object.defineProperty;
|
|
4698
4698
|
var __exportAll = (all, no_symbols) => {
|
|
4699
4699
|
let target = {};
|
|
@@ -20747,7 +20747,7 @@ function createKnowledgeWriteTools(memory, options) {
|
|
|
20747
20747
|
}),
|
|
20748
20748
|
knowledge_update_node: (0, _mastra_core_tools.createTool)({
|
|
20749
20749
|
id: "knowledge_update_node",
|
|
20750
|
-
description: "Update a visible node name or kind using optimistic concurrency.",
|
|
20750
|
+
description: "Update a visible node name or kind using optimistic concurrency. Provide at least one of name or kind.",
|
|
20751
20751
|
inputSchema: {
|
|
20752
20752
|
type: "object",
|
|
20753
20753
|
properties: {
|
|
@@ -20769,11 +20769,11 @@ function createKnowledgeWriteTools(memory, options) {
|
|
|
20769
20769
|
}
|
|
20770
20770
|
},
|
|
20771
20771
|
required: ["node", "expectedVersion"],
|
|
20772
|
-
anyOf: [{ required: ["name"] }, { required: ["kind"] }],
|
|
20773
20772
|
additionalProperties: false
|
|
20774
20773
|
},
|
|
20775
20774
|
execute: async (input) => {
|
|
20776
20775
|
const value = input;
|
|
20776
|
+
if (value.name === void 0 && value.kind === void 0) throw new Error("knowledge_update_node requires at least one of: name, kind.");
|
|
20777
20777
|
const store = await getStore(memory);
|
|
20778
20778
|
const node = await store.getNode(value.node);
|
|
20779
20779
|
if (!node || node.mergedInto) throw new Error(`Knowledge node not found: ${value.node}`);
|
|
@@ -21125,7 +21125,14 @@ var subconscious_exports = /* @__PURE__ */ __exportAll({
|
|
|
21125
21125
|
});
|
|
21126
21126
|
const BUILT_IN_OBSERVATION = /* @__PURE__ */ new Set(["capture", "remind"]);
|
|
21127
21127
|
const BUILT_IN_REFLECTION = /* @__PURE__ */ new Set(["curate", "learn"]);
|
|
21128
|
-
const DEFAULT_MAX_STEPS =
|
|
21128
|
+
const DEFAULT_MAX_STEPS = 50;
|
|
21129
|
+
/**
|
|
21130
|
+
* Curation walks a worklist that can reach hundreds of records, and its completion marker is
|
|
21131
|
+
* fail-closed: a curator that runs out of steps advances no cursor at all. It gets a much larger
|
|
21132
|
+
* default budget than the other agents, which each handle a single bounded prompt.
|
|
21133
|
+
*/
|
|
21134
|
+
const DEFAULT_MAX_STEPS_BY_AGENT = { curate: 200 };
|
|
21135
|
+
const MAX_MAX_STEPS = 500;
|
|
21129
21136
|
const DEFAULT_RECENT_UPDATES = 10;
|
|
21130
21137
|
const MAX_RECENT_UPDATES = 100;
|
|
21131
21138
|
function entryName(entry) {
|
|
@@ -21142,7 +21149,7 @@ function assertUniqueNames(entries, phase) {
|
|
|
21142
21149
|
}
|
|
21143
21150
|
function boundedSteps(entry, fallback) {
|
|
21144
21151
|
const steps = entry?.maxSteps ?? fallback;
|
|
21145
|
-
if (!Number.isInteger(steps) || steps < 1 || steps >
|
|
21152
|
+
if (!Number.isInteger(steps) || steps < 1 || steps > MAX_MAX_STEPS) throw new Error(`Subconscious maxSteps must be an integer between 1 and ${MAX_MAX_STEPS}.`);
|
|
21146
21153
|
return steps;
|
|
21147
21154
|
}
|
|
21148
21155
|
function resolveExtractor(entry) {
|
|
@@ -21157,12 +21164,13 @@ function resolveExtractor(entry) {
|
|
|
21157
21164
|
function resolveAgent(entry, builtIns, globalModel, globalMaxSteps) {
|
|
21158
21165
|
const config = typeof entry === "string" ? void 0 : entry;
|
|
21159
21166
|
const name = entryName(entry);
|
|
21167
|
+
const fallbackMaxSteps = globalMaxSteps ?? DEFAULT_MAX_STEPS_BY_AGENT[name] ?? DEFAULT_MAX_STEPS;
|
|
21160
21168
|
return {
|
|
21161
21169
|
name,
|
|
21162
21170
|
instructions: config?.instructions,
|
|
21163
21171
|
model: config?.model ?? globalModel,
|
|
21164
21172
|
agent: config?.agent,
|
|
21165
|
-
maxSteps: boundedSteps(config,
|
|
21173
|
+
maxSteps: boundedSteps(config, fallbackMaxSteps),
|
|
21166
21174
|
builtIn: builtIns.has(name)
|
|
21167
21175
|
};
|
|
21168
21176
|
}
|
|
@@ -21179,7 +21187,7 @@ var Subconscious = class {
|
|
|
21179
21187
|
const reflection = config.reflection ?? ["curate", "learn"];
|
|
21180
21188
|
assertUniqueNames(observation, "observation");
|
|
21181
21189
|
assertUniqueNames(reflection, "reflection");
|
|
21182
|
-
const maxSteps = boundedSteps(config, DEFAULT_MAX_STEPS);
|
|
21190
|
+
const maxSteps = config.maxSteps === void 0 ? void 0 : boundedSteps(config, DEFAULT_MAX_STEPS);
|
|
21183
21191
|
for (const entry of observation) this.#validateObservationEntry(entry);
|
|
21184
21192
|
for (const entry of reflection) this.#validateReflectionEntry(entry);
|
|
21185
21193
|
const recentUpdates = config.activity === false ? false : config.activity?.recentUpdates ?? DEFAULT_RECENT_UPDATES;
|
|
@@ -21282,6 +21290,11 @@ function resolveScope$1(context) {
|
|
|
21282
21290
|
`thread:${context.parentThreadId}`
|
|
21283
21291
|
]);
|
|
21284
21292
|
}
|
|
21293
|
+
/**
|
|
21294
|
+
* Upper bound on records pulled into a single reflection prompt. `hasMore` tells the agent the
|
|
21295
|
+
* worklist was truncated; the cursor it advances lets the next cycle pick up the remainder.
|
|
21296
|
+
*/
|
|
21297
|
+
const MAX_WORKLIST_RECORDS$1 = 1e3;
|
|
21285
21298
|
async function readWorklist$1(store, sourceThreadId, scope, after) {
|
|
21286
21299
|
const records = [];
|
|
21287
21300
|
let cursor = after;
|
|
@@ -21295,7 +21308,7 @@ async function readWorklist$1(store, sourceThreadId, scope, after) {
|
|
|
21295
21308
|
});
|
|
21296
21309
|
records.push(...page.records);
|
|
21297
21310
|
cursor = page.nextCursor;
|
|
21298
|
-
} while (cursor && records.length <
|
|
21311
|
+
} while (cursor && records.length < MAX_WORKLIST_RECORDS$1);
|
|
21299
21312
|
return {
|
|
21300
21313
|
records,
|
|
21301
21314
|
hasMore: Boolean(cursor)
|
|
@@ -21415,6 +21428,8 @@ function resolveScope(context) {
|
|
|
21415
21428
|
`thread:${context.parentThreadId}`
|
|
21416
21429
|
]);
|
|
21417
21430
|
}
|
|
21431
|
+
/** Upper bound on records pulled into a single reflection prompt; `hasMore` signals truncation. */
|
|
21432
|
+
const MAX_WORKLIST_RECORDS = 1e3;
|
|
21418
21433
|
async function readWorklist(store, sourceThreadId, scope, after) {
|
|
21419
21434
|
const records = [];
|
|
21420
21435
|
let cursor = after;
|
|
@@ -21427,7 +21442,7 @@ async function readWorklist(store, sourceThreadId, scope, after) {
|
|
|
21427
21442
|
});
|
|
21428
21443
|
records.push(...page.records);
|
|
21429
21444
|
cursor = page.nextCursor;
|
|
21430
|
-
} while (cursor && records.length <
|
|
21445
|
+
} while (cursor && records.length < MAX_WORKLIST_RECORDS);
|
|
21431
21446
|
return {
|
|
21432
21447
|
records,
|
|
21433
21448
|
hasMore: Boolean(cursor)
|
|
@@ -46364,4 +46379,4 @@ const agentBuilderWorkflows = {
|
|
|
46364
46379
|
//#endregion
|
|
46365
46380
|
exports.agentBuilderWorkflows = agentBuilderWorkflows;
|
|
46366
46381
|
|
|
46367
|
-
//# sourceMappingURL=dist-
|
|
46382
|
+
//# sourceMappingURL=dist-D1upRr-y.cjs.map
|