@mastra/core 1.87.0-alpha.19 → 1.87.0-alpha.20
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/agent/durable/index.cjs +1 -1
- package/dist/agent/durable/index.js +1 -1
- package/dist/agent/durable/workflows/finalize-run.d.ts +1 -1
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.js +2 -2
- package/dist/agent-builder/ee/index.cjs +1 -1
- package/dist/agent-builder/ee/index.js +1 -1
- package/dist/agent-controller/index.cjs +1 -1
- package/dist/agent-controller/index.js +1 -1
- package/dist/{agent-controller-lBdNfcFi.js → agent-controller-D2d_qiJr.js} +5 -5
- package/dist/{agent-controller-DzOEhUjR.cjs → agent-controller-WTjY0HJM.cjs} +5 -5
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-DAu4WaCb.js → background-tasks-CgspqU_S.js} +1 -1
- package/dist/{background-tasks-DOmQdBVn.cjs → background-tasks-DJ6x1bn-.cjs} +1 -1
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/{builder-BFcVEbX0.cjs → builder-B2P49nT9.cjs} +2 -2
- package/dist/{builder-DHFtMW8D.js → builder-MymUxyDK.js} +2 -2
- package/dist/capabilities/302ai.json +199 -199
- package/dist/capabilities/abliteratedllm.json +38 -38
- package/dist/capabilities/above.json +20 -20
- package/dist/capabilities/adaption.json +14 -14
- package/dist/capabilities/adzuki.json +31 -31
- package/dist/capabilities/agentrouter.json +11 -11
- package/dist/capabilities/agnes.json +4 -4
- package/dist/capabilities/ai-router.json +9 -9
- package/dist/capabilities/aiand.json +17 -34
- package/dist/capabilities/aigrow.json +14 -14
- package/dist/capabilities/aimlapi.json +152 -154
- package/dist/capabilities/aixy.json +25 -25
- package/dist/capabilities/aki-io.json +16 -16
- package/dist/capabilities/alibaba-cn.json +98 -98
- package/dist/capabilities/alibaba-coding-plan-cn.json +5 -5
- package/dist/capabilities/alibaba-coding-plan.json +5 -5
- package/dist/capabilities/alibaba-token-plan-cn.json +53 -53
- package/dist/capabilities/alibaba-token-plan.json +54 -54
- package/dist/capabilities/alibaba.json +82 -82
- package/dist/capabilities/ambient.json +13 -13
- package/dist/capabilities/amd-tokenlab.json +4 -4
- package/dist/capabilities/amd.json +9 -9
- package/dist/capabilities/anthropic.json +40 -40
- package/dist/capabilities/anyapi.json +48 -48
- package/dist/capabilities/apiko.json +5 -5
- package/dist/capabilities/arcee.json +11 -11
- package/dist/capabilities/augure.json +6 -6
- package/dist/capabilities/auriko.json +16 -16
- package/dist/capabilities/bailing.json +5 -5
- package/dist/capabilities/baseten.json +36 -36
- package/dist/capabilities/bee.json +5 -5
- package/dist/capabilities/berget.json +2 -2
- package/dist/capabilities/bothub.json +15 -15
- package/dist/capabilities/boundless.json +41 -41
- package/dist/capabilities/bumo.json +43 -43
- package/dist/capabilities/byteplus.json +29 -29
- package/dist/capabilities/cheapaimodel.json +10 -10
- package/dist/capabilities/cheapest-token.json +26 -26
- package/dist/capabilities/chutes.json +36 -36
- package/dist/capabilities/cline-pass.json +27 -27
- package/dist/capabilities/cloudcode.json +7 -7
- package/dist/capabilities/cloudferro-sherlock.json +4 -4
- package/dist/capabilities/cloudflare-workers-ai.json +20 -20
- package/dist/capabilities/commandcode.json +145 -145
- package/dist/capabilities/concentrate.json +284 -284
- package/dist/capabilities/cortecs.json +101 -101
- package/dist/capabilities/crossmodel.json +199 -199
- package/dist/capabilities/crusoe.json +15 -15
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +130 -130
- package/dist/capabilities/deepinfra.json +94 -94
- package/dist/capabilities/deepseek.json +3 -3
- package/dist/capabilities/digitalocean.json +115 -115
- package/dist/capabilities/dothoosh.json +28 -28
- package/dist/capabilities/doubleword.json +24 -24
- package/dist/capabilities/edenai.json +272 -272
- package/dist/capabilities/empiriolabs.json +178 -173
- package/dist/capabilities/engy.json +17 -17
- package/dist/capabilities/entrim.json +8 -8
- package/dist/capabilities/evroc.json +17 -17
- package/dist/capabilities/ezkielyna.json +6 -6
- package/dist/capabilities/fastrouter.json +94 -94
- package/dist/capabilities/fireworks-ai.json +97 -97
- package/dist/capabilities/fortytwo.json +4 -4
- package/dist/capabilities/freemodel.json +8 -8
- package/dist/capabilities/friendli.json +10 -10
- package/dist/capabilities/frogbot.json +93 -93
- package/dist/capabilities/gisoo.json +20 -20
- package/dist/capabilities/gmicloud.json +21 -21
- package/dist/capabilities/google.json +52 -52
- package/dist/capabilities/graphn.json +13 -13
- package/dist/capabilities/greenpt.json +34 -34
- package/dist/capabilities/groq.json +4 -4
- package/dist/capabilities/helicone.json +82 -82
- package/dist/capabilities/hetzner.json +4 -4
- package/dist/capabilities/hostinger-router.json +5 -5
- package/dist/capabilities/hpc-ai.json +9 -9
- package/dist/capabilities/huawei-maas.json +14 -14
- package/dist/capabilities/hubris.json +30 -30
- package/dist/capabilities/huggingface.json +76 -76
- package/dist/capabilities/humain.json +2 -2
- package/dist/capabilities/hyper.json +25 -25
- package/dist/capabilities/impossibl.json +159 -159
- package/dist/capabilities/inception.json +3 -3
- package/dist/capabilities/inceptron.json +8 -8
- package/dist/capabilities/inco.json +3 -3
- package/dist/capabilities/infer.json +17 -17
- package/dist/capabilities/inferall.json +7 -7
- package/dist/capabilities/inference-coop.json +15 -15
- package/dist/capabilities/inferenceapis.json +16 -16
- package/dist/capabilities/inferris.json +4 -4
- package/dist/capabilities/infersia.json +10 -10
- package/dist/capabilities/inferx.json +2 -2
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/io-net.json +5 -5
- package/dist/capabilities/iteracompute.json +43 -43
- package/dist/capabilities/jalapeno.json +11 -11
- package/dist/capabilities/jiekou.json +28 -28
- package/dist/capabilities/joingonka.json +4 -4
- package/dist/capabilities/jzstoken.json +53 -53
- package/dist/capabilities/keln.json +24 -24
- package/dist/capabilities/kenari.json +128 -129
- package/dist/capabilities/kilo.json +633 -635
- package/dist/capabilities/kimi-code-plan-cn.json +9 -9
- package/dist/capabilities/kimi-code-plan-global.json +9 -9
- package/dist/capabilities/kitani.json +6 -6
- package/dist/capabilities/klavo.json +24 -24
- package/dist/capabilities/korouter.json +32 -32
- package/dist/capabilities/kunavo.json +6 -6
- package/dist/capabilities/liquid.json +11 -11
- package/dist/capabilities/lithosai.json +2 -2
- package/dist/capabilities/llmgateway-providers.json +920 -920
- package/dist/capabilities/llmgateway.json +348 -348
- package/dist/capabilities/llmtr.json +30 -30
- package/dist/capabilities/longcat.json +2 -2
- package/dist/capabilities/lowrouter.json +65 -65
- package/dist/capabilities/lyceum.json +15 -15
- package/dist/capabilities/melious.json +14 -14
- package/dist/capabilities/merge-gateway.json +290 -284
- package/dist/capabilities/meta.json +10 -10
- package/dist/capabilities/minimax-cn-coding-plan.json +6 -6
- package/dist/capabilities/minimax-coding-plan.json +6 -6
- package/dist/capabilities/mistral.json +15 -15
- package/dist/capabilities/mixlayer.json +2 -2
- package/dist/capabilities/modal.json +12 -12
- package/dist/capabilities/model-oracle-ai.json +20 -20
- package/dist/capabilities/modelis.json +14 -14
- package/dist/capabilities/modular.json +16 -16
- package/dist/capabilities/moneo.json +8 -8
- package/dist/capabilities/moonshotai-cn.json +5 -5
- package/dist/capabilities/moonshotai.json +5 -5
- package/dist/capabilities/morph.json +13 -13
- package/dist/capabilities/munito-eu.json +8 -8
- package/dist/capabilities/munito.json +10 -10
- package/dist/capabilities/nan.json +28 -28
- package/dist/capabilities/nano-gpt.json +578 -576
- package/dist/capabilities/nearai.json +123 -123
- package/dist/capabilities/nebius.json +31 -31
- package/dist/capabilities/neon.json +131 -131
- package/dist/capabilities/neuralwatt.json +45 -45
- package/dist/capabilities/nokeep.json +5 -5
- package/dist/capabilities/novita-ai.json +127 -127
- package/dist/capabilities/nvidia.json +21 -11
- package/dist/capabilities/oathbreaker.json +5 -5
- package/dist/capabilities/obscurify.json +27 -27
- package/dist/capabilities/oci.json +7 -7
- package/dist/capabilities/ofox.json +249 -249
- package/dist/capabilities/ollama-cloud.json +58 -58
- package/dist/capabilities/openai.json +58 -58
- package/dist/capabilities/opencode-go.json +95 -87
- package/dist/capabilities/openreason.json +6 -6
- package/dist/capabilities/openrouter.json +553 -568
- package/dist/capabilities/opper.json +25 -25
- package/dist/capabilities/orcarouter.json +324 -324
- package/dist/capabilities/outerlabs.json +31 -31
- package/dist/capabilities/ovhcloud.json +17 -17
- package/dist/capabilities/pareto.json +4 -4
- package/dist/capabilities/perplexity-agent.json +56 -56
- package/dist/capabilities/phala.json +35 -35
- package/dist/capabilities/pioneer.json +2 -2
- package/dist/capabilities/poe.json +145 -145
- package/dist/capabilities/poolside.json +2 -2
- package/dist/capabilities/powerspring.json +12 -12
- package/dist/capabilities/primalabs.json +13 -13
- package/dist/capabilities/prime.json +119 -119
- package/dist/capabilities/privatemode-ai.json +9 -9
- package/dist/capabilities/proxystacks.json +7 -7
- package/dist/capabilities/qiniu-ai.json +12 -12
- package/dist/capabilities/refuseless.json +5 -5
- package/dist/capabilities/regolo-ai.json +5 -5
- package/dist/capabilities/requesty.json +202 -202
- package/dist/capabilities/ruapi.json +23 -23
- package/dist/capabilities/runcrate.json +14 -14
- package/dist/capabilities/runinfra.json +17 -17
- package/dist/capabilities/sakana.json +2 -2
- package/dist/capabilities/sambanova.json +6 -6
- package/dist/capabilities/sandbase.json +30 -30
- package/dist/capabilities/sarvam.json +13 -13
- package/dist/capabilities/scaleway.json +18 -18
- package/dist/capabilities/scnet-token-plan.json +8 -8
- package/dist/capabilities/scx-ai.json +23 -23
- package/dist/capabilities/sensenova.json +11 -11
- package/dist/capabilities/siliconflow-cn.json +65 -47
- package/dist/capabilities/siliconflow.json +61 -61
- package/dist/capabilities/snowflake-cortex.json +26 -26
- package/dist/capabilities/sokkan.json +5 -5
- package/dist/capabilities/sparrowcodes.json +16 -16
- package/dist/capabilities/standardcompute.json +88 -88
- package/dist/capabilities/steadyrouter.json +41 -41
- package/dist/capabilities/stepfun-ai-step-plan.json +8 -8
- package/dist/capabilities/stepfun-ai.json +8 -8
- package/dist/capabilities/stepfun-step-plan.json +8 -8
- package/dist/capabilities/stepfun.json +8 -8
- package/dist/capabilities/stepping-stone.json +15 -15
- package/dist/capabilities/subconscious.json +2 -2
- package/dist/capabilities/superbot-gg.json +4 -4
- package/dist/capabilities/synthetic.json +13 -13
- package/dist/capabilities/synthorai.json +27 -27
- package/dist/capabilities/teamorouter.json +24 -24
- package/dist/capabilities/teapot-router.json +9 -9
- package/dist/capabilities/tencent-token-plan-intl.json +21 -21
- package/dist/capabilities/tencent-token-plan.json +41 -41
- package/dist/capabilities/tencent-tokenhub.json +50 -50
- package/dist/capabilities/tensorx.json +49 -49
- package/dist/capabilities/tenstorrent.json +8 -8
- package/dist/capabilities/the-grid-ai.json +33 -33
- package/dist/capabilities/thinkingmachines.json +37 -37
- package/dist/capabilities/tinfoil.json +10 -10
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +50 -50
- package/dist/capabilities/tokengo.json +27 -27
- package/dist/capabilities/tokenify.json +10 -10
- package/dist/capabilities/trustedrouter.json +7 -7
- package/dist/capabilities/trustedtokens.json +16 -16
- package/dist/capabilities/umans-ai-coding-plan.json +17 -17
- package/dist/capabilities/umans-ai.json +14 -14
- package/dist/capabilities/uncensuredai.json +4 -4
- package/dist/capabilities/unrestricted.json +4 -4
- package/dist/capabilities/uplinkswitch.json +20 -20
- package/dist/capabilities/vancine.json +23 -23
- package/dist/capabilities/vercel.json +579 -574
- package/dist/capabilities/verda.json +4 -4
- package/dist/capabilities/vivgrid.json +64 -64
- package/dist/capabilities/volcengine-coding-plan.json +29 -29
- package/dist/capabilities/volcengine.json +26 -26
- package/dist/capabilities/vultr.json +19 -19
- package/dist/capabilities/wafer.ai.json +13 -13
- package/dist/capabilities/wallaby.json +5 -5
- package/dist/capabilities/wally.json +8 -8
- package/dist/capabilities/wandb.json +18 -18
- package/dist/capabilities/watt.json +20 -20
- package/dist/capabilities/xai.json +7 -7
- package/dist/capabilities/xpersona.json +13 -13
- package/dist/capabilities/xxapi.json +25 -25
- package/dist/capabilities/zai-coding-plan.json +17 -17
- package/dist/capabilities/zai.json +30 -30
- package/dist/capabilities/zenifra.json +28 -28
- package/dist/capabilities/zenmux.json +189 -189
- package/dist/capabilities/zerogpu.json +11 -11
- package/dist/capabilities/zhipuai-coding-plan.json +3 -3
- package/dist/capabilities/zhipuai.json +29 -29
- package/dist/capabilities/zro.json +4 -4
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-CbhgGgQD.cjs → channels-CKRPQRmF.cjs} +1 -1
- package/dist/{channels-BBwgs50q.js → channels-nnBeh58G.js} +1 -1
- package/dist/coding-agent/index.cjs +1 -1
- package/dist/coding-agent/index.js +1 -1
- package/dist/datasets/index.cjs +2 -2
- package/dist/datasets/index.js +2 -2
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +482 -482
- package/dist/docs/references/reference-knowledge-limits.md +16 -16
- package/dist/evals/index.cjs +1 -1
- package/dist/evals/index.js +1 -1
- package/dist/evals/scoreTraces/index.cjs +1 -1
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/{execution-fence-fqV6FGdV.cjs → execution-fence-CKFtgb2u.cjs} +29 -24
- package/dist/{execution-fence-B8yV_n51.js → execution-fence-DTrAehtv.js} +29 -24
- package/dist/harness/index.cjs +1 -1
- package/dist/harness/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/knowledge/index.cjs +26 -2
- package/dist/knowledge/index.js +26 -2
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +8075 -8071
- package/dist/{llm-Cy3WZXgA.js → llm-B6EYEbYf.js} +2 -2
- package/dist/{llm-B7ul27Ay.cjs → llm-P6sWWNc6.cjs} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-Dsub5fyz.js → manager-BvnXZAFj.js} +2 -2
- package/dist/{manager-CY-RzZJL.cjs → manager-tQrH4_MZ.cjs} +2 -2
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-yjoYfTS5.js → mastra-BhPympcg.js} +16 -16
- package/dist/{mastra-DXQUuwFl.cjs → mastra-CtL0diD6.cjs} +16 -16
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-BARBpXDN.cjs → model-Cy0Z_3FQ.cjs} +1 -1
- package/dist/{model-DauH8JTo.js → model-D2XwLRQi.js} +1 -1
- package/dist/{netlify-DGsETiFB.cjs → netlify-DgHrsLpJ.cjs} +1 -1
- package/dist/{netlify-BNBtKR4Q.js → netlify-d2fyniAS.js} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/processor-provider/index.cjs +1 -1
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +2 -2
- package/dist/processors/index.js +2 -2
- package/dist/{provider-registry-CfHy4Zhw.js → provider-registry-B9UP28b4.js} +21832 -21834
- package/dist/{provider-registry-Y6tbfFhH.cjs → provider-registry-Brcz84P1.cjs} +21832 -21834
- package/dist/provider-registry.json +22460 -22460
- package/dist/{registry-generator-DJiQAI8V.js → registry-generator-BDZrKvMb.js} +1 -1
- package/dist/{registry-generator-BEJ0APNc.cjs → registry-generator-DSvbAYar.cjs} +1 -1
- package/dist/{rehydrate-Da4_E_N8.js → rehydrate-Cme19iOk.js} +2 -2
- package/dist/{rehydrate-4Sl7D3kO.cjs → rehydrate-vAlkgCKL.cjs} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/storage/index.cjs +2 -2
- package/dist/storage/index.js +2 -2
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-CZy8XA_q.cjs → stream-B9y9VYqr.cjs} +1 -1
- package/dist/{stream-BFhCDJvz.js → stream-DSVk0bct.js} +1 -1
- package/dist/test-utils/llm-mock.cjs +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/tool-loop-agent/index.cjs +1 -1
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/{tool-loop-agent-DifR6VLI.cjs → tool-loop-agent-C3wj9NhP.cjs} +3 -3
- package/dist/{tool-loop-agent-SOpIJRws.js → tool-loop-agent-e2Bi-mrf.js} +3 -3
- package/dist/{utils-BjFntMW_.cjs → utils-B87rm4F-.cjs} +1 -1
- package/dist/{utils-DN_kWhH6.js → utils-DCDsj1CG.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-CBQ0dMBb.cjs → validate-XPZLQRoc.cjs} +1 -1
- package/dist/{validate-KIBMWuyc.js → validate-_e8OoEh5.js} +1 -1
- package/dist/vector/index.cjs +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/{worker-Bqg7bsxX.js → worker-BAstsOqw.js} +2 -2
- package/dist/{worker-Ct6E5_2p.cjs → worker-CGWclXz3.cjs} +2 -2
- package/dist/{worker-DVM_pvH7.js → worker-DvI9J9Qw.js} +2 -2
- package/dist/{worker-CJ_JYSy0.cjs → worker-DzMDk--h.cjs} +2 -2
- package/dist/{workflow-DEAvg0pI.cjs → workflow-BFF2mNDa.cjs} +3 -3
- package/dist/{workflow-BmShpn3p.js → workflow-DcpI9eNC.js} +3 -3
- package/dist/workflows/builder/index.cjs +1 -1
- package/dist/workflows/builder/index.js +1 -1
- package/dist/workflows/evented/index.cjs +1 -1
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +4 -4
- package/dist/workflows/index.js +4 -4
- package/package.json +3 -3
- package/src/llm/model/provider-types.generated.d.ts +8075 -8071
|
@@ -8,22 +8,22 @@ Text limits are counted in tokens. Counts are estimates, so treat the numbers as
|
|
|
8
8
|
|
|
9
9
|
> **Alpha:** Knowledge is in alpha. Its API may change between releases.
|
|
10
10
|
|
|
11
|
-
| Item | Limit
|
|
12
|
-
| -------------------------------------------------------------------------- |
|
|
13
|
-
| Note text | 250 tokens
|
|
14
|
-
| Page description | 100 tokens
|
|
15
|
-
| Page nesting | 10 levels
|
|
16
|
-
| Pages in one move, counting everything under the moved page | 500
|
|
17
|
-
| `knowledge_search` results, and notes and child pages per `knowledge_read` | 10 by default, up to 50
|
|
18
|
-
| Page body or `match` results per `knowledge_read` | 1,000 tokens by default, at least 100
|
|
19
|
-
| Notes, and notes mentioning the page, kept in a whole `knowledge_read` | 1,000 tokens per list
|
|
20
|
-
| `knowledge_list` entries | 50 by default, up to 100, within about 1,000 tokens by default
|
|
21
|
-
| `knowledge_list` depth | 1 level by default, up to 3
|
|
22
|
-
| Embedding chunks per page, for search by meaning | 100, of about 2,000 tokens each
|
|
23
|
-
| Pinned context per turn | 500 tokens by default, no maximum
|
|
24
|
-
| Pinned pages per turn | 20 by default
|
|
25
|
-
| Pinned listing depth | 1 level by default, up to 3
|
|
26
|
-
| Pages per pinned listing | As many as its token share holds, up to 1,000
|
|
11
|
+
| Item | Limit |
|
|
12
|
+
| -------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
13
|
+
| Note text | 250 tokens |
|
|
14
|
+
| Page description | 100 tokens. An importer cuts a longer one to fit and ends it with `…` |
|
|
15
|
+
| Page nesting | 10 levels |
|
|
16
|
+
| Pages in one move, counting everything under the moved page | 500 |
|
|
17
|
+
| `knowledge_search` results, and notes and child pages per `knowledge_read` | 10 by default, up to 50 |
|
|
18
|
+
| Page body or `match` results per `knowledge_read` | 1,000 tokens by default, at least 100 |
|
|
19
|
+
| Notes, and notes mentioning the page, kept in a whole `knowledge_read` | 1,000 tokens per list |
|
|
20
|
+
| `knowledge_list` entries | 50 by default, up to 100, within about 1,000 tokens by default |
|
|
21
|
+
| `knowledge_list` depth | 1 level by default, up to 3 |
|
|
22
|
+
| Embedding chunks per page, for search by meaning | 100, of about 2,000 tokens each |
|
|
23
|
+
| Pinned context per turn | 500 tokens by default, no maximum |
|
|
24
|
+
| Pinned pages per turn | 20 by default |
|
|
25
|
+
| Pinned listing depth | 1 level by default, up to 3 |
|
|
26
|
+
| Pages per pinned listing | As many as its token share holds, up to 1,000 |
|
|
27
27
|
|
|
28
28
|
A write over a limit fails, and the model gets the error as the tool result. Tool schemas don't show the token limits, because a schema can't count tokens.
|
|
29
29
|
|
package/dist/evals/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_execution_fence = require("../execution-fence-
|
|
2
|
+
const require_execution_fence = require("../execution-fence-CKFtgb2u.cjs");
|
|
3
3
|
const require_constants = require("../constants-B2FVV_2e.cjs");
|
|
4
4
|
const require_collect_tool_mocks = require("../collect-tool-mocks-k9fM6oDl.cjs");
|
|
5
5
|
exports.MastraScorer = require_execution_fence.MastraScorer;
|
package/dist/evals/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gc as SCORING_PREDICATE_ROOTS, Kc as evaluateScoringPredicate, _ as isNotScorable, c as runEvals, f as createClassifierScorer, g as filterRun, h as createScorer, m as ScorerRunError, p as MastraScorer, qc as validateScoringPredicate, v as notScorable } from "../execution-fence-
|
|
1
|
+
import { Gc as SCORING_PREDICATE_ROOTS, Kc as evaluateScoringPredicate, _ as isNotScorable, c as runEvals, f as createClassifierScorer, g as filterRun, h as createScorer, m as ScorerRunError, p as MastraScorer, qc as validateScoringPredicate, v as notScorable } from "../execution-fence-DTrAehtv.js";
|
|
2
2
|
import { Ar as scoringEntityTypeSchema, Cr as extractTrajectory, Dr as saveScorePayloadSchema, Er as listScoresResponseSchema, Fr as scoringInputWithExtractStepResultAndScoreAndReasonSchema, Ir as scoringInputWithExtractStepResultSchema, Lr as scoringPromptsSchema, Mr as scoringHookInputSchema, Nr as scoringInputSchema, Or as scoreResultSchema, Pr as scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, Rr as scoringSourceSchema, Tr as extractWorkflowTrajectory, jr as scoringExtractStepResultSchema, kr as scoreRowDataSchema, wr as extractTrajectoryFromTrace, zr as scoringValueSchema } from "../constants-Dro9fuhk.js";
|
|
3
3
|
import { t as collectToolMocks } from "../collect-tool-mocks-3s2BN8o7.js";
|
|
4
4
|
export { MastraScorer, SCORING_PREDICATE_ROOTS, ScorerRunError, collectToolMocks, createClassifierScorer, createScorer, evaluateScoringPredicate, extractTrajectory, extractTrajectoryFromTrace, extractWorkflowTrajectory, filterRun, isNotScorable, listScoresResponseSchema, notScorable, runEvals, saveScorePayloadSchema, scoreResultSchema, scoreRowDataSchema, scoringEntityTypeSchema, scoringExtractStepResultSchema, scoringHookInputSchema, scoringInputSchema, scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, scoringInputWithExtractStepResultAndScoreAndReasonSchema, scoringInputWithExtractStepResultSchema, scoringPromptsSchema, scoringSourceSchema, scoringValueSchema, validateScoringPredicate };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_error = require("../../error-D90lJ6M7.cjs");
|
|
3
3
|
const require_utils = require("../../utils-D-eNsgDM.cjs");
|
|
4
|
-
const require_execution_fence = require("../../execution-fence-
|
|
4
|
+
const require_execution_fence = require("../../execution-fence-CKFtgb2u.cjs");
|
|
5
5
|
const require_constants = require("../../constants-B2FVV_2e.cjs");
|
|
6
6
|
let zod_v4 = require("zod/v4");
|
|
7
7
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as MastraError, n as ErrorDomain, t as ErrorCategory } from "../../error-oh2DLsP2.js";
|
|
2
2
|
import { i as getEntityTypeForSpan } from "../../utils-DU_pU5SK.js";
|
|
3
|
-
import { Ns as createStep, Ps as createWorkflow } from "../../execution-fence-
|
|
3
|
+
import { Ns as createStep, Ps as createWorkflow } from "../../execution-fence-DTrAehtv.js";
|
|
4
4
|
import { Dr as saveScorePayloadSchema } from "../../constants-Dro9fuhk.js";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
@@ -4,7 +4,7 @@ const require_base = require("./base-BIzR1D3_.cjs");
|
|
|
4
4
|
const require_error = require("./error-D90lJ6M7.cjs");
|
|
5
5
|
const require_error$1 = require("./error-L1V4uUbd.cjs");
|
|
6
6
|
const require_output_helpers = require("./output-helpers-By5FbLpp.cjs");
|
|
7
|
-
const require_stream = require("./stream-
|
|
7
|
+
const require_stream = require("./stream-B9y9VYqr.cjs");
|
|
8
8
|
const require_workflows_constants = require("./workflows/constants.cjs");
|
|
9
9
|
const require_request_context = require("./request-context-D9RXYCy8.cjs");
|
|
10
10
|
const require_observability = require("./observability-VaoaeadK.cjs");
|
|
@@ -12,9 +12,9 @@ const require_storage = require("./storage-CfG0I2aF.cjs");
|
|
|
12
12
|
const require_utils = require("./utils-D-eNsgDM.cjs");
|
|
13
13
|
const require_tool = require("./tool-Dn9WSDVn.cjs");
|
|
14
14
|
const require_error_count = require("./error-count-DeDpeWU2.cjs");
|
|
15
|
-
const require_utils$1 = require("./utils-
|
|
15
|
+
const require_utils$1 = require("./utils-B87rm4F-.cjs");
|
|
16
16
|
const require_ee_iTj2bRDt = require("./ee-iTj2bRDt-D3-QLGDF.cjs");
|
|
17
|
-
const require_background_tasks = require("./background-tasks-
|
|
17
|
+
const require_background_tasks = require("./background-tasks-DJ6x1bn-.cjs");
|
|
18
18
|
const require_toolchecks = require("./toolchecks-DbBsQGHW.cjs");
|
|
19
19
|
const require_stream$1 = require("./stream-BGbj9jAU.cjs");
|
|
20
20
|
const require_fetchWithRetry = require("./fetchWithRetry-f5k4p7_1.cjs");
|
|
@@ -22,16 +22,16 @@ const require_utils_safe_stringify = require("./utils/safe-stringify.cjs");
|
|
|
22
22
|
const require_deep_equal = require("./deep-equal-TMDmByBC.cjs");
|
|
23
23
|
const require_dynamic_argument = require("./dynamic-argument-CUc1BBOS.cjs");
|
|
24
24
|
const require_message_list = require("./message-list-C0F2sDNC.cjs");
|
|
25
|
-
const require_llm = require("./llm-
|
|
25
|
+
const require_llm = require("./llm-P6sWWNc6.cjs");
|
|
26
26
|
const require_payload_transform = require("./payload-transform-CWgnsO9w.cjs");
|
|
27
27
|
const require_signals = require("./signals-CWxAMEmE.cjs");
|
|
28
28
|
const require_to_prompt = require("./to-prompt-CG-LyaBY.cjs");
|
|
29
29
|
const require_dist = require("./dist-P2rjrlmj.cjs");
|
|
30
30
|
const require_dist$1 = require("./dist-CXeCeeW7.cjs");
|
|
31
31
|
const require_model = require("./model-jBymoqGa.cjs");
|
|
32
|
-
const require_provider_registry = require("./provider-registry-
|
|
32
|
+
const require_provider_registry = require("./provider-registry-Brcz84P1.cjs");
|
|
33
33
|
const require_inmemory = require("./inmemory-Dc86VWGB.cjs");
|
|
34
|
-
const require_model$1 = require("./model-
|
|
34
|
+
const require_model$1 = require("./model-Cy0Z_3FQ.cjs");
|
|
35
35
|
const require_predicate_index = require("./predicate/index.cjs");
|
|
36
36
|
const require_classifier_index = require("./classifier/index.cjs");
|
|
37
37
|
const require_observability_context_storage = require("./observability/context-storage.cjs");
|
|
@@ -75999,7 +75999,7 @@ async function runDurableFinishSideEffects({ runId, initData, messageListState,
|
|
|
75999
75999
|
}
|
|
76000
76000
|
let titleGeneration;
|
|
76001
76001
|
let titleForStream;
|
|
76002
|
-
if (durableState?.threadId && durableState?.resourceId && !durableState.
|
|
76002
|
+
if (durableState?.threadId && durableState?.resourceId && !durableState.memoryConfig?.readOnly) {
|
|
76003
76003
|
const titleArgs = {
|
|
76004
76004
|
threadId: durableState.threadId,
|
|
76005
76005
|
resourceId: durableState.resourceId,
|
|
@@ -76009,9 +76009,13 @@ async function runDurableFinishSideEffects({ runId, initData, messageListState,
|
|
|
76009
76009
|
tracingContext
|
|
76010
76010
|
};
|
|
76011
76011
|
const generateThreadTitle = registryEntry?.generateThreadTitle;
|
|
76012
|
-
|
|
76013
|
-
|
|
76012
|
+
const authorizeTitle = async () => {
|
|
76013
|
+
await authorizeMemory(require_ee_iTj2bRDt.MastraFGAPermissions.MEMORY_READ);
|
|
76014
|
+
await authorizeMemory(require_ee_iTj2bRDt.MastraFGAPermissions.MEMORY_WRITE);
|
|
76015
|
+
};
|
|
76016
|
+
if (!durableState.observationalMemory) await authorizeTitle();
|
|
76014
76017
|
const savedTitle = (async () => {
|
|
76018
|
+
if (durableState.observationalMemory) await authorizeTitle();
|
|
76015
76019
|
if (generateThreadTitle) return generateThreadTitle(titleArgs);
|
|
76016
76020
|
else if (mastra) {
|
|
76017
76021
|
const agent = mastra.getAgentById(initData.agentId);
|
|
@@ -76331,7 +76335,7 @@ async function runStructuringPass({ options, mastra, agentId, messageList, strea
|
|
|
76331
76335
|
* This is standalone so a remote worker can call it with the agent and memory
|
|
76332
76336
|
* it rebuilt from its own Mastra instance.
|
|
76333
76337
|
*/
|
|
76334
|
-
async function generateDurableThreadTitle({ agent, memory, threadId,
|
|
76338
|
+
async function generateDurableThreadTitle({ agent, memory, threadId, memoryConfig, messageListState, requestContext, tracingContext }) {
|
|
76335
76339
|
const thread = await memory.getThreadById({ threadId });
|
|
76336
76340
|
const mergedConfig = memory.getMergedThreadConfig(memoryConfig);
|
|
76337
76341
|
const { shouldGenerate, model, instructions, minMessages } = agent.resolveTitleGenerationConfig(mergedConfig.generateTitle);
|
|
@@ -76343,19 +76347,20 @@ async function generateDurableThreadTitle({ agent, memory, threadId, resourceId,
|
|
|
76343
76347
|
if (!userMessage) return void 0;
|
|
76344
76348
|
const title = await agent.genTitle(userMessage, requestContext ?? new require_request_context.RequestContext(), require_observability.createObservabilityContext(tracingContext), model, instructions, uiMessages);
|
|
76345
76349
|
if (!title) return void 0;
|
|
76346
|
-
|
|
76347
|
-
|
|
76348
|
-
|
|
76349
|
-
|
|
76350
|
-
|
|
76351
|
-
|
|
76352
|
-
|
|
76353
|
-
|
|
76354
|
-
|
|
76355
|
-
|
|
76356
|
-
|
|
76357
|
-
|
|
76358
|
-
|
|
76350
|
+
if (!thread && !await memory.getThreadById({ threadId })) {
|
|
76351
|
+
agent.__getLogger().debug("Skipping generated title save: thread was deleted", { threadId });
|
|
76352
|
+
return;
|
|
76353
|
+
}
|
|
76354
|
+
try {
|
|
76355
|
+
await memory.updateThread({
|
|
76356
|
+
id: threadId,
|
|
76357
|
+
title,
|
|
76358
|
+
memoryConfig
|
|
76359
|
+
});
|
|
76360
|
+
} catch (error) {
|
|
76361
|
+
if (!await memory.getThreadById({ threadId })) return void 0;
|
|
76362
|
+
throw error;
|
|
76363
|
+
}
|
|
76359
76364
|
return title;
|
|
76360
76365
|
}
|
|
76361
76366
|
// src/agent/durable/workflows/shared/execute-scorers.ts
|
|
@@ -85721,7 +85726,7 @@ async function prepareForDurableExecution(options) {
|
|
|
85721
85726
|
});
|
|
85722
85727
|
let tripwireData;
|
|
85723
85728
|
if (inputProcessors.length > 0) try {
|
|
85724
|
-
const { ProcessorRunner } = await Promise.resolve().then(() => require("./stream-
|
|
85729
|
+
const { ProcessorRunner } = await Promise.resolve().then(() => require("./stream-B9y9VYqr.cjs")).then((n) => n.runner_exports);
|
|
85725
85730
|
await new ProcessorRunner({
|
|
85726
85731
|
inputProcessors,
|
|
85727
85732
|
outputProcessors,
|
|
@@ -4,7 +4,7 @@ import { t as MastraBase } from "./base-CKLWBhDo.js";
|
|
|
4
4
|
import { a as MastraNonRetryableError, i as MastraError, n as ErrorDomain, o as getErrorFromUnknown, t as ErrorCategory } from "./error-oh2DLsP2.js";
|
|
5
5
|
import { a as classifyProviderError, l as describeProviderError, t as recordTerminalErrorMessage, u as readProviderErrorDetails } from "./error-BC9Au-22.js";
|
|
6
6
|
import { S as isLeaseProvider, _ as PublisherQueueLimitError, b as NoopLeaseProvider, d as isRunLocalTopic, g as stripModelSnapshots, i as CachingPubSub, m as slimNestedAgentChunks, r as serializeError$1, t as DefaultStepResult, v as EventEmitterPubSub, y as withAck } from "./output-helpers-k2-48ssH.js";
|
|
7
|
-
import { $ as summarizeToolChoiceForSpan, $t as commitToolResult, A as isSignalChunkExcluded, An as isMastraTimeoutError, At as getSnapshotMemoryInfo, B as removeTrailingAssistantGuardContinuations, Bt as stateColumnsWrite, C as stampChunkProducedAt, Cn as DEADLINE_SAVE_CLAIM_HOLD_MS, D as isStructuredOutputError, Dn as getAbortReason, Dt as validateTemplate, E as escapeUnescapedControlCharsInJsonStrings, En as createTimeoutAbortSignal, Et as traverseMappingPath, F as endOutputStreamSpanOutsideStep, Fn as safeClose, Ft as latestStepResults, G as FLUSH_HELD_PARTS_KEY, Gt as diffStateAsJson, Ht as unusedStateEntries, I as findOwnModelStepSpan, In as safeEnqueue, It as materializeState, J as withoutHeldContent, K as REPROCESS_PART_KEY, Kt as patchState, Ln as safeError, Lt as materializeWorkflowRun, M as ProcessorRunner, Mn as settledOrElapsed, N as ProcessorState, Nt as applyStateColumnsWrite, O as asJsonSchema, On as guardStreamUntilMatch, Ot as getStepResult, P as endOutputStreamSpanAtStepEnd, Pn as MastraModelInput, Pt as isStateCheckpointDue, Q as summarizeProcessorToolsForSpan, R as isTrailingAssistantGuardContinuation, Rn as createRunScope, Rt as pickStateKeys, S as getChunkProducedAt, Sn as takenQueueThreadId, St as stepRefId, T as createOutputHandler, Tn as MastraTimeoutError, Tt as templateReadsState, Ut as applyStatePatch, V as ProviderHistoryCompat, Vt as summarizeStepResult, X as summarizeProcessorModelForSpan, Y as summarizeActiveToolsForSpan, Yt as isObservationalMemoryEnabled$1, Z as summarizeProcessorResultForSpan, Zt as parseMemoryRequestContext, _ as persistProcessorDataChunk, _t as stubStepResult, a as convertFullStreamChunkToMastra, an as snapshotToolResult, at as PROCESSOR_ABORT_SIGNAL, b as resolveOutputMessageSkippingCompletionChecks, bn as pendingQueueThreadId, bt as predicateReadsState, c as WorkflowRunOutput, cn as validationErrorModelOutput, ct as getHydratedStepResult, d as MastraModelOutput, dn as resolveSuspendedToolRunId, dt as lazyStepResults, en as computeModelOutputProviderMetadata, et as resolveProcessorSpanAttributes, f as clearStepPartIndexes, fn as resolveThreadIdFromArgs, ft as loadStepResults, g as isFeedbackContinuation, gn as applyStateSignal, gt as storageV2StepResultAccessors, h as findStepPartBoundaries, hn as tryStreamWithJsonFallback, ht as residentStepResultsLoader, in as resolveModelOutputAfterToolResultProcessors, it as createProcessorSendSignal, j as OUTPUT_STREAM_HOOK_DURATION_KEY_PREFIX, jn as raceAgainstAbort, k as getResponseFormat, kn as guardStreamWithAbort, kt as getStepResultAsync, l as TripWire, ln as isProcessorWorkflow, lt as hydrateStepResults, m as findIterationOffsetInParts, mn as tryGenerateWithJsonFallback, mt as residentStepResults, nn as latestProcessedModelOutput, nt as toProcessorSpanPhase, on as withAgentWorkflowToolMarker, ot as RunJournal, p as createDestructurableOutput, pn as supportedLanguageModelSpecifications, pt as loadedStepResults, q as takeHeldParts, rn as readModelOutput, rt as PROCESSOR_LATE_SIGNAL_SINK, s as MastraAgentNetworkStream, sn as normalizeModelOutput, st as buildStepResultAccessors, tn as hasToolResultProcessor, tt as resolveProcessorSpanName, u as getModelOutputForTripwire, un as isSupportedLanguageModel, ut as isStepResultStub, v as reconcileBufferedStepTexts, vn as assertNotQueueThreadId, vt as collectMappingStepRefs, w as markChunkOutputProcessed, wn as DEADLINE_SAVE_WAIT_MS, wt as resolveTemplate, x as resolveProcessorWriterMessageId, xn as queuedQueueThreadId, xt as resolveStepOutputs, y as resolveMessageText, yn as isQueueThreadId, yt as collectPredicateStepRefs, z as needsTrailingAssistantGuard, zn as createRunScopeKey, zt as stateBaseOf } from "./stream-
|
|
7
|
+
import { $ as summarizeToolChoiceForSpan, $t as commitToolResult, A as isSignalChunkExcluded, An as isMastraTimeoutError, At as getSnapshotMemoryInfo, B as removeTrailingAssistantGuardContinuations, Bt as stateColumnsWrite, C as stampChunkProducedAt, Cn as DEADLINE_SAVE_CLAIM_HOLD_MS, D as isStructuredOutputError, Dn as getAbortReason, Dt as validateTemplate, E as escapeUnescapedControlCharsInJsonStrings, En as createTimeoutAbortSignal, Et as traverseMappingPath, F as endOutputStreamSpanOutsideStep, Fn as safeClose, Ft as latestStepResults, G as FLUSH_HELD_PARTS_KEY, Gt as diffStateAsJson, Ht as unusedStateEntries, I as findOwnModelStepSpan, In as safeEnqueue, It as materializeState, J as withoutHeldContent, K as REPROCESS_PART_KEY, Kt as patchState, Ln as safeError, Lt as materializeWorkflowRun, M as ProcessorRunner, Mn as settledOrElapsed, N as ProcessorState, Nt as applyStateColumnsWrite, O as asJsonSchema, On as guardStreamUntilMatch, Ot as getStepResult, P as endOutputStreamSpanAtStepEnd, Pn as MastraModelInput, Pt as isStateCheckpointDue, Q as summarizeProcessorToolsForSpan, R as isTrailingAssistantGuardContinuation, Rn as createRunScope, Rt as pickStateKeys, S as getChunkProducedAt, Sn as takenQueueThreadId, St as stepRefId, T as createOutputHandler, Tn as MastraTimeoutError, Tt as templateReadsState, Ut as applyStatePatch, V as ProviderHistoryCompat, Vt as summarizeStepResult, X as summarizeProcessorModelForSpan, Y as summarizeActiveToolsForSpan, Yt as isObservationalMemoryEnabled$1, Z as summarizeProcessorResultForSpan, Zt as parseMemoryRequestContext, _ as persistProcessorDataChunk, _t as stubStepResult, a as convertFullStreamChunkToMastra, an as snapshotToolResult, at as PROCESSOR_ABORT_SIGNAL, b as resolveOutputMessageSkippingCompletionChecks, bn as pendingQueueThreadId, bt as predicateReadsState, c as WorkflowRunOutput, cn as validationErrorModelOutput, ct as getHydratedStepResult, d as MastraModelOutput, dn as resolveSuspendedToolRunId, dt as lazyStepResults, en as computeModelOutputProviderMetadata, et as resolveProcessorSpanAttributes, f as clearStepPartIndexes, fn as resolveThreadIdFromArgs, ft as loadStepResults, g as isFeedbackContinuation, gn as applyStateSignal, gt as storageV2StepResultAccessors, h as findStepPartBoundaries, hn as tryStreamWithJsonFallback, ht as residentStepResultsLoader, in as resolveModelOutputAfterToolResultProcessors, it as createProcessorSendSignal, j as OUTPUT_STREAM_HOOK_DURATION_KEY_PREFIX, jn as raceAgainstAbort, k as getResponseFormat, kn as guardStreamWithAbort, kt as getStepResultAsync, l as TripWire, ln as isProcessorWorkflow, lt as hydrateStepResults, m as findIterationOffsetInParts, mn as tryGenerateWithJsonFallback, mt as residentStepResults, nn as latestProcessedModelOutput, nt as toProcessorSpanPhase, on as withAgentWorkflowToolMarker, ot as RunJournal, p as createDestructurableOutput, pn as supportedLanguageModelSpecifications, pt as loadedStepResults, q as takeHeldParts, rn as readModelOutput, rt as PROCESSOR_LATE_SIGNAL_SINK, s as MastraAgentNetworkStream, sn as normalizeModelOutput, st as buildStepResultAccessors, tn as hasToolResultProcessor, tt as resolveProcessorSpanName, u as getModelOutputForTripwire, un as isSupportedLanguageModel, ut as isStepResultStub, v as reconcileBufferedStepTexts, vn as assertNotQueueThreadId, vt as collectMappingStepRefs, w as markChunkOutputProcessed, wn as DEADLINE_SAVE_WAIT_MS, wt as resolveTemplate, x as resolveProcessorWriterMessageId, xn as queuedQueueThreadId, xt as resolveStepOutputs, y as resolveMessageText, yn as isQueueThreadId, yt as collectPredicateStepRefs, z as needsTrailingAssistantGuard, zn as createRunScopeKey, zt as stateBaseOf } from "./stream-DSVk0bct.js";
|
|
8
8
|
import { HAND_BACK_STATE_SYMBOL, PARENT_STATE_SYMBOL, PUBSUB_SYMBOL, STREAM_FORMAT_SYMBOL, WORKFLOW_CANCELLED_SYMBOL } from "./workflows/constants.js";
|
|
9
9
|
import { c as MASTRA_THREAD_ID_KEY, d as isReservedRequestContextKey, f as mergeVersionOverrides$1, l as MASTRA_VERSIONS_KEY, n as MASTRA_AUTH_TOKEN_KEY, o as MASTRA_RESOURCE_ID_KEY, p as withoutLiveRequestKeys, r as MASTRA_INHERITED_MEMORY_KEY, s as MASTRA_SCOPES_KEY, t as MASTRA_CONTINUATION_TOOL_CALL_IDS_KEY, u as RequestContext } from "./request-context-COnZHt2-.js";
|
|
10
10
|
import { _ as resolveObservabilityContext, a as agentLoopTermination, c as compactStopReasonContext, g as createObservabilityContext, h as wrapMastra, i as subtractReportedUsage, m as unwrapMastraTracingProxy, n as extractUsageMetrics, o as executionFailureTermination, r as isUsageIncomplete, s as tripwireTermination, t as calculateObservedUsage } from "./observability-DPDWibyH.js";
|
|
@@ -13,9 +13,9 @@ import { a as getOrCreateSpan, f as resolveCurrentSpan, l as getTimeToFirstChunk
|
|
|
13
13
|
import { _ as getRequestContextInputValues, a as getModelFacingValidationError, d as validateToolOutput, g as getRequestContextInputSource, l as resolveToolOutputValidationSchema, r as createTool, u as validateToolInput } from "./tool-DIFduuTw.js";
|
|
14
14
|
import { isStandardSchemaWithJSON, standardSchemaToJSONSchema, toStandardSchema } from "./schema/index.js";
|
|
15
15
|
import { i as setSpanErrorOrigin, n as getSpanErrorOrigin } from "./error-count-BH-rJW7q.js";
|
|
16
|
-
import { A as eagerToolCallDidNotExecute, D as EagerToolExecutionCoordinator, E as EAGER_TOOL_EXECUTION_MARKER, F as hasRunningRunStep, I as isRunStepActive, L as setRunLeaseFence, M as isEagerlyExecutableToolCall, N as TOOL_ABORT_NOTICE, O as EagerToolExecutionNotRun, P as clearRunLeaseFence, R as startRunStep, S as selectFields, T as EAGER_TOOL_BAILOUT, a as ensureToolProperties, b as removeUndefinedValues, d as makeCoreTool, i as delay$1, j as eagerToolCallSuspensionIntent, k as eagerToolCallAlreadyAnnouncedInput, n as createMastraProxy, o as generateEmptyFromSchema, p as makeProcessorCoreTool, r as deepMerge$1, v as readPositiveIntEnv, w as EAGER_TOOL_ABORT_SIGNAL, y as rebindProcessorTools, z as whenRunStepsSettle } from "./utils-
|
|
16
|
+
import { A as eagerToolCallDidNotExecute, D as EagerToolExecutionCoordinator, E as EAGER_TOOL_EXECUTION_MARKER, F as hasRunningRunStep, I as isRunStepActive, L as setRunLeaseFence, M as isEagerlyExecutableToolCall, N as TOOL_ABORT_NOTICE, O as EagerToolExecutionNotRun, P as clearRunLeaseFence, R as startRunStep, S as selectFields, T as EAGER_TOOL_BAILOUT, a as ensureToolProperties, b as removeUndefinedValues, d as makeCoreTool, i as delay$1, j as eagerToolCallSuspensionIntent, k as eagerToolCallAlreadyAnnouncedInput, n as createMastraProxy, o as generateEmptyFromSchema, p as makeProcessorCoreTool, r as deepMerge$1, v as readPositiveIntEnv, w as EAGER_TOOL_ABORT_SIGNAL, y as rebindProcessorTools, z as whenRunStepsSettle } from "./utils-DCDsj1CG.js";
|
|
17
17
|
import { h as getWorkflowFGAResourceId, i as MastraFGAPermissions, y as requireFGA } from "./ee-iTj2bRDt-By_B9ngH.js";
|
|
18
|
-
import { c as createBackgroundTask, o as resolveBackgroundConfig, s as sanitizeToolArguments, t as generateBackgroundTaskSystemPrompt } from "./background-tasks-
|
|
18
|
+
import { c as createBackgroundTask, o as resolveBackgroundConfig, s as sanitizeToolArguments, t as generateBackgroundTaskSystemPrompt } from "./background-tasks-CgspqU_S.js";
|
|
19
19
|
import { a as isApprovalExempt, c as isProviderDefinedTool, d as markAgentWorkflowTool, f as markApprovalExempt, l as isProviderTool, n as getNeedsApprovalFn, o as isBuiltBeforeApproval, r as getProviderToolName, s as isMastraTool, t as getBeforeApprovalFn } from "./toolchecks-CRAfUe9H.js";
|
|
20
20
|
import { t as ToolStream } from "./stream-D9JOykz7.js";
|
|
21
21
|
import { a as waitDelay, i as getRetryAfterMs, n as DEFAULT_MAX_RETRY_AFTER_MS, r as clampDelayMs } from "./fetchWithRetry-DFSvpYDT.js";
|
|
@@ -23,16 +23,16 @@ import { boundedStringify, ensureSerializable, safeStringify } from "./utils/saf
|
|
|
23
23
|
import { t as deepEqual$3 } from "./deep-equal-d1xU02ag.js";
|
|
24
24
|
import { n as resolveDynamicArgument, t as getRequestUser } from "./dynamic-argument-BzPK3qPN.js";
|
|
25
25
|
import { A as stableStringify$1, E as removeWorkingMemoryTags, P as embed$3, Z as preserveResponseItemIdsOnMerge, a as isTerminalToolInvocationState, c as withUnavailableAttachmentUrls, d as aiV5UIMessagesToAIV5ModelMessages, f as coreContentToString, i as isClientToolInvocationUpdate, l as isDownloadAssetsError, m as filterMessagesForPersistence, n as MessageList, ot as normalizeToolOutput, p as messagesAreEqual, r as advancesToolInvocationState, s as unavailableAttachmentPlaceholder, t as convertMessages, u as MessageMerger } from "./message-list-RgFlLrxG.js";
|
|
26
|
-
import { a as ModelRouterLanguageModel, d as attachModelStreamTransport, f as isDataChunk, i as resolveModelConfig, n as ModelRouterEmbeddingModel, o as resolveApiProviderId, p as readModelStreamTransport } from "./llm-
|
|
26
|
+
import { a as ModelRouterLanguageModel, d as attachModelStreamTransport, f as isDataChunk, i as resolveModelConfig, n as ModelRouterEmbeddingModel, o as resolveApiProviderId, p as readModelStreamTransport } from "./llm-B6EYEbYf.js";
|
|
27
27
|
import { a as withToolPayloadTransformMetadata, i as transformToolPayloadForTargets, n as hasTransformedToolPayload, o as withToolPayloadTransformProviderMetadata, r as normalizeToolPayloadTransformPolicy, t as getTransformedToolPayload } from "./payload-transform-Dj3HUeD4.js";
|
|
28
28
|
import { d as signalSpanAttributes, h as signalToXmlMarkup, l as mastraDBMessageToSignal, n as createSignal, o as isMastraSignalMessage, s as isTransientSignalMessage, u as resolveDeliveryAttributes } from "./signals-CqR_iWkg.js";
|
|
29
29
|
import { h as resolveFilePartMediaTypeAndData, m as parseDataUri, o as categorizeFileData } from "./to-prompt-CMlVGYxC.js";
|
|
30
30
|
import { c as parsePartialJson, h as tool$1, m as generateId$1, p as asSchema$1, r as embed$4, u as APICallError$1 } from "./dist-TPVqg8oV.js";
|
|
31
31
|
import { n as embed$5 } from "./dist-D3cKCUe-.js";
|
|
32
32
|
import { i as hasFreeFormObject } from "./model-DS-b2R-R.js";
|
|
33
|
-
import { c as modelSupportsStructuredOutput, l as modelSupportsTemperature } from "./provider-registry-
|
|
33
|
+
import { c as modelSupportsStructuredOutput, l as modelSupportsTemperature } from "./provider-registry-B9UP28b4.js";
|
|
34
34
|
import { t as InMemoryServerCache } from "./inmemory-BK3zLwvM.js";
|
|
35
|
-
import { t as MastraLLMV1 } from "./model-
|
|
35
|
+
import { t as MastraLLMV1 } from "./model-D2XwLRQi.js";
|
|
36
36
|
import { MISSING, collectInvalidPredicatePaths, createPredicateEvaluator, derivePredicateLabel, normalizePredicatePath, walk } from "./predicate/index.js";
|
|
37
37
|
import { Classifier } from "./classifier/index.js";
|
|
38
38
|
import { initContextStorage, withSpanErrorAttempt } from "./observability/context-storage.js";
|
|
@@ -75993,7 +75993,7 @@ async function runDurableFinishSideEffects({ runId, initData, messageListState,
|
|
|
75993
75993
|
}
|
|
75994
75994
|
let titleGeneration;
|
|
75995
75995
|
let titleForStream;
|
|
75996
|
-
if (durableState?.threadId && durableState?.resourceId && !durableState.
|
|
75996
|
+
if (durableState?.threadId && durableState?.resourceId && !durableState.memoryConfig?.readOnly) {
|
|
75997
75997
|
const titleArgs = {
|
|
75998
75998
|
threadId: durableState.threadId,
|
|
75999
75999
|
resourceId: durableState.resourceId,
|
|
@@ -76003,9 +76003,13 @@ async function runDurableFinishSideEffects({ runId, initData, messageListState,
|
|
|
76003
76003
|
tracingContext
|
|
76004
76004
|
};
|
|
76005
76005
|
const generateThreadTitle = registryEntry?.generateThreadTitle;
|
|
76006
|
-
|
|
76007
|
-
|
|
76006
|
+
const authorizeTitle = async () => {
|
|
76007
|
+
await authorizeMemory(MastraFGAPermissions.MEMORY_READ);
|
|
76008
|
+
await authorizeMemory(MastraFGAPermissions.MEMORY_WRITE);
|
|
76009
|
+
};
|
|
76010
|
+
if (!durableState.observationalMemory) await authorizeTitle();
|
|
76008
76011
|
const savedTitle = (async () => {
|
|
76012
|
+
if (durableState.observationalMemory) await authorizeTitle();
|
|
76009
76013
|
if (generateThreadTitle) return generateThreadTitle(titleArgs);
|
|
76010
76014
|
else if (mastra) {
|
|
76011
76015
|
const agent = mastra.getAgentById(initData.agentId);
|
|
@@ -76325,7 +76329,7 @@ async function runStructuringPass({ options, mastra, agentId, messageList, strea
|
|
|
76325
76329
|
* This is standalone so a remote worker can call it with the agent and memory
|
|
76326
76330
|
* it rebuilt from its own Mastra instance.
|
|
76327
76331
|
*/
|
|
76328
|
-
async function generateDurableThreadTitle({ agent, memory, threadId,
|
|
76332
|
+
async function generateDurableThreadTitle({ agent, memory, threadId, memoryConfig, messageListState, requestContext, tracingContext }) {
|
|
76329
76333
|
const thread = await memory.getThreadById({ threadId });
|
|
76330
76334
|
const mergedConfig = memory.getMergedThreadConfig(memoryConfig);
|
|
76331
76335
|
const { shouldGenerate, model, instructions, minMessages } = agent.resolveTitleGenerationConfig(mergedConfig.generateTitle);
|
|
@@ -76337,19 +76341,20 @@ async function generateDurableThreadTitle({ agent, memory, threadId, resourceId,
|
|
|
76337
76341
|
if (!userMessage) return void 0;
|
|
76338
76342
|
const title = await agent.genTitle(userMessage, requestContext ?? new RequestContext(), createObservabilityContext(tracingContext), model, instructions, uiMessages);
|
|
76339
76343
|
if (!title) return void 0;
|
|
76340
|
-
|
|
76341
|
-
|
|
76342
|
-
|
|
76343
|
-
|
|
76344
|
-
|
|
76345
|
-
|
|
76346
|
-
|
|
76347
|
-
|
|
76348
|
-
|
|
76349
|
-
|
|
76350
|
-
|
|
76351
|
-
|
|
76352
|
-
|
|
76344
|
+
if (!thread && !await memory.getThreadById({ threadId })) {
|
|
76345
|
+
agent.__getLogger().debug("Skipping generated title save: thread was deleted", { threadId });
|
|
76346
|
+
return;
|
|
76347
|
+
}
|
|
76348
|
+
try {
|
|
76349
|
+
await memory.updateThread({
|
|
76350
|
+
id: threadId,
|
|
76351
|
+
title,
|
|
76352
|
+
memoryConfig
|
|
76353
|
+
});
|
|
76354
|
+
} catch (error) {
|
|
76355
|
+
if (!await memory.getThreadById({ threadId })) return void 0;
|
|
76356
|
+
throw error;
|
|
76357
|
+
}
|
|
76353
76358
|
return title;
|
|
76354
76359
|
}
|
|
76355
76360
|
// src/agent/durable/workflows/shared/execute-scorers.ts
|
|
@@ -85715,7 +85720,7 @@ async function prepareForDurableExecution(options) {
|
|
|
85715
85720
|
});
|
|
85716
85721
|
let tripwireData;
|
|
85717
85722
|
if (inputProcessors.length > 0) try {
|
|
85718
|
-
const { ProcessorRunner } = await import("./stream-
|
|
85723
|
+
const { ProcessorRunner } = await import("./stream-DSVk0bct.js").then((n) => n.L);
|
|
85719
85724
|
await new ProcessorRunner({
|
|
85720
85725
|
inputProcessors,
|
|
85721
85726
|
outputProcessors,
|
package/dist/harness/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_state_processor = require("../state-processor-DaSmhVUX.cjs");
|
|
3
3
|
const require_tools = require("../tools-C2q0ougI.cjs");
|
|
4
|
-
const require_agent_controller = require("../agent-controller-
|
|
4
|
+
const require_agent_controller = require("../agent-controller-WTjY0HJM.cjs");
|
|
5
5
|
// src/harness/index.ts
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Backwards-compatibility entrypoint.
|
package/dist/harness/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f as taskCheckTool, h as taskWriteTool, m as taskUpdateTool, o as assignTaskIds, p as taskCompleteTool } from "../state-processor-B_KsS82m.js";
|
|
2
2
|
import { s as askUserTool, t as submitPlanTool } from "../tools-ybbz1YKg.js";
|
|
3
|
-
import { a as Session, c as defaultDisplayState, l as defaultOMProgressState, n as parseSubagentMeta, t as AgentController } from "../agent-controller-
|
|
3
|
+
import { a as Session, c as defaultDisplayState, l as defaultOMProgressState, n as parseSubagentMeta, t as AgentController } from "../agent-controller-D2d_qiJr.js";
|
|
4
4
|
// src/harness/index.ts
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Backwards-compatibility entrypoint.
|
package/dist/index.cjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as Mastra } from "./mastra-
|
|
1
|
+
export { t as Mastra } from "./mastra-BhPympcg.js";
|
package/dist/knowledge/index.cjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_base = require("../base-BIzR1D3_.cjs");
|
|
3
|
-
const require_execution_fence = require("../execution-fence-
|
|
3
|
+
const require_execution_fence = require("../execution-fence-CKFtgb2u.cjs");
|
|
4
4
|
const require_tool = require("../tool-Dn9WSDVn.cjs");
|
|
5
|
+
const require_workspace = require("../workspace-BQD4tcQi.cjs");
|
|
5
6
|
let crypto = require("crypto");
|
|
6
7
|
let _mastra_schema_compat_schema = require("@mastra/schema-compat/schema");
|
|
7
8
|
// src/knowledge/changes.ts
|
|
@@ -2161,6 +2162,29 @@ const live = (page) => !!page && !page.deletedAt && !page.mergedInto;
|
|
|
2161
2162
|
/** Source IDs the host keeps for the folders it makes on an item's path; importers can't send them. */
|
|
2162
2163
|
const KNOWLEDGE_IMPORT_PATH_STUB_PREFIX = "~path:";
|
|
2163
2164
|
/**
|
|
2165
|
+
* An item's description cut to the page bound, ending in `…`. Every store refuses a longer one, and
|
|
2166
|
+
* that error would roll back the whole flush, leaving the cursor on this item for every later run.
|
|
2167
|
+
* Cuts between code points, at the last word break when one is in the back half.
|
|
2168
|
+
*/
|
|
2169
|
+
function fitKnowledgeImportDescription(description) {
|
|
2170
|
+
if (require_workspace.estimateTokenCount(description) <= 100) return description;
|
|
2171
|
+
const chars = [...description];
|
|
2172
|
+
const cut = (length) => {
|
|
2173
|
+
let text = chars.slice(0, length).join("");
|
|
2174
|
+
const lastBreak = text.search(/\s\S*$/);
|
|
2175
|
+
if (lastBreak > text.length / 2) text = text.slice(0, lastBreak);
|
|
2176
|
+
return `${text.trimEnd()}\u2026`;
|
|
2177
|
+
};
|
|
2178
|
+
let low = 0;
|
|
2179
|
+
let high = chars.length - 1;
|
|
2180
|
+
while (low < high) {
|
|
2181
|
+
const mid = Math.ceil((low + high) / 2);
|
|
2182
|
+
if (require_workspace.estimateTokenCount(cut(mid)) <= 100) low = mid;
|
|
2183
|
+
else high = mid - 1;
|
|
2184
|
+
}
|
|
2185
|
+
return cut(low);
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2164
2188
|
* Why an item can never land, whatever the store holds: a reserved `sourceId`, or a `path` the host
|
|
2165
2189
|
* can't place (with `parent` or `fallbackParent`, empty, an empty or blank segment, a page key too long to
|
|
2166
2190
|
* link to, or deeper than a page can sit under a target `targetDepth` keys deep). Null when it can.
|
|
@@ -2942,7 +2966,7 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
2942
2966
|
let rendered = hasBody ? await renderBody(item) : void 0;
|
|
2943
2967
|
let fields = {
|
|
2944
2968
|
name: item.title,
|
|
2945
|
-
...item.description !== void 0 ? { description: item.description } : {},
|
|
2969
|
+
...item.description !== void 0 ? { description: fitKnowledgeImportDescription(item.description) } : {},
|
|
2946
2970
|
...rendered ? { body: rendered.body } : {}
|
|
2947
2971
|
};
|
|
2948
2972
|
let page;
|
package/dist/knowledge/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as MastraBase } from "../base-CKLWBhDo.js";
|
|
2
|
-
import { $n as assertKnowledgeCeilingRaised, $r as KnowledgeImporterBindingConflictError, $t as KnowledgeLinkRepairUnsupportedError, Ai as knowledgeLinkRefKey, Bt as KnowledgeRunScopesError, Ci as MAX_KNOWLEDGE_PAGE_LINKS, Di as assertKnowledgeNoteTextWithinBound, Ei as MAX_KNOWLEDGE_PIN_LIST_DEPTH, Fi as parseKnowledgePageRef, Fo as getStorageSource, Ft as PINNED_READ_MEMO_KEY, Gt as moveKnowledgePage, Ht as knowledgeAgentScopes, Ii as KnowledgeInvalidCursorError, It as knowledgeDeliveredPins, Jt as updateKnowledgeNote, Kt as removeKnowledgeNote, Li as knowledgePageKeyProblem, Lt as buildKnowledgePageTools, Mi as knowledgePinDepth, Ni as knowledgePositionBetween, Oi as assertKnowledgePageDescriptionWithinBound, Pi as knowledgeScopeReadable, Po as augmentWithInit, Qn as MAX_KNOWLEDGE_SCOPE_TAGS, Qr as InMemoryKnowledgeStorage, Qt as KnowledgeLinkRefreshIncompleteError, Rt as heldScopes, Si as MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS, Ti as MAX_KNOWLEDGE_PAGE_LIST_LIMIT, Ut as knowledgePersonaScopes, Vt as knowledgeRunPrincipals, Wt as addKnowledgeNote, Xn as MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH, Xt as KnowledgeSemanticIndex, Yt as upsertKnowledgePage, Zn as MAX_KNOWLEDGE_RECORD_TEXT_LENGTH, _i as KnowledgePageKeyConflictError, _n as encodeKnowledgeScopeId, ai as KnowledgeNotFoundError, an as syncKnowledgePageBodyLinks, ar as expandKnowledgeScope, bi as MAX_KNOWLEDGE_PAGE_BODY_LINKS, ci as KnowledgeTransactionDeadlineError, cn as knowledgeReadScopeFor, cr as knowledgeSemanticDocumentId, di as createKnowledgeUlid, dn as compileKnowledgeScopes, dr as parseKnowledgeNodeCursor, ei as KnowledgeImporterRunStateError, en as canRepairKnowledgeLinksInBatch, er as assertKnowledgeDescriptionWithinBound, fi as inspectKnowledgeSchema, fn as knowledgeMemoryScopes, gi as KnowledgePageHasChildrenError, gn as decodeKnowledgeScopeId, hi as KnowledgePageDepthError, hn as strongerKnowledgeRole, ii as KnowledgeConflictError, in as repairKnowledgeLinks, ir as createKnowledgeNodeCursor, ji as knowledgePagePath, ki as canonicalKnowledgeName, li as KnowledgeUnsupportedCapabilityError, ln as knowledgeRoleOn, lr as knowledgeSemanticIdempotencyKey, mi as KnowledgeMoveTooLargeError, mn as knowledgeScopeAddress, ni as KNOWLEDGE_STORAGE_CONTRACT_VERSION, nn as refreshKnowledgeLinksTo, nr as assertKnowledgeScopeWithinCeiling, oi as KnowledgeSchemaResetRequiredError, on as updateKnowledgeLinks, or as isKnowledgeScopeVisible, pi as parseKnowledgeWikilinks, pn as knowledgeRunScopes, qt as removeKnowledgePage, ri as KNOWLEDGE_STORAGE_SCHEMA_VERSION, rn as reindexKnowledgeLinks, rr as canonicalizeKnowledgeScope, si as KnowledgeStorage, sn as knowledgeAccessGrants, sr as knowledgeScopeKey, ti as KnowledgeImportersStorage, tn as knowledgeSubtree, tr as assertKnowledgeRecordTextWithinBound, ui as assertKnowledgeSchemaCompatible, un as KnowledgeDeclarationError, ur as knowledgeVisibleScopeKeys, vi as MAX_KNOWLEDGE_MOVE_PAGES, vn as buildKnowledgeInstructions, wi as MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH, xi as MAX_KNOWLEDGE_PAGE_DEPTH, yi as MAX_KNOWLEDGE_NOTE_TOKENS, zt as KnowledgeRun } from "../execution-fence-
|
|
2
|
+
import { $n as assertKnowledgeCeilingRaised, $r as KnowledgeImporterBindingConflictError, $t as KnowledgeLinkRepairUnsupportedError, Ai as knowledgeLinkRefKey, Bt as KnowledgeRunScopesError, Ci as MAX_KNOWLEDGE_PAGE_LINKS, Di as assertKnowledgeNoteTextWithinBound, Ei as MAX_KNOWLEDGE_PIN_LIST_DEPTH, Fi as parseKnowledgePageRef, Fo as getStorageSource, Ft as PINNED_READ_MEMO_KEY, Gt as moveKnowledgePage, Ht as knowledgeAgentScopes, Ii as KnowledgeInvalidCursorError, It as knowledgeDeliveredPins, Jt as updateKnowledgeNote, Kt as removeKnowledgeNote, Li as knowledgePageKeyProblem, Lt as buildKnowledgePageTools, Mi as knowledgePinDepth, Ni as knowledgePositionBetween, Oi as assertKnowledgePageDescriptionWithinBound, Pi as knowledgeScopeReadable, Po as augmentWithInit, Qn as MAX_KNOWLEDGE_SCOPE_TAGS, Qr as InMemoryKnowledgeStorage, Qt as KnowledgeLinkRefreshIncompleteError, Rt as heldScopes, Si as MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS, Ti as MAX_KNOWLEDGE_PAGE_LIST_LIMIT, Ut as knowledgePersonaScopes, Vt as knowledgeRunPrincipals, Wt as addKnowledgeNote, Xn as MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH, Xt as KnowledgeSemanticIndex, Yt as upsertKnowledgePage, Zn as MAX_KNOWLEDGE_RECORD_TEXT_LENGTH, _i as KnowledgePageKeyConflictError, _n as encodeKnowledgeScopeId, ai as KnowledgeNotFoundError, an as syncKnowledgePageBodyLinks, ar as expandKnowledgeScope, bi as MAX_KNOWLEDGE_PAGE_BODY_LINKS, ci as KnowledgeTransactionDeadlineError, cn as knowledgeReadScopeFor, cr as knowledgeSemanticDocumentId, di as createKnowledgeUlid, dn as compileKnowledgeScopes, dr as parseKnowledgeNodeCursor, ei as KnowledgeImporterRunStateError, en as canRepairKnowledgeLinksInBatch, er as assertKnowledgeDescriptionWithinBound, fi as inspectKnowledgeSchema, fn as knowledgeMemoryScopes, gi as KnowledgePageHasChildrenError, gn as decodeKnowledgeScopeId, hi as KnowledgePageDepthError, hn as strongerKnowledgeRole, ii as KnowledgeConflictError, in as repairKnowledgeLinks, ir as createKnowledgeNodeCursor, ji as knowledgePagePath, ki as canonicalKnowledgeName, li as KnowledgeUnsupportedCapabilityError, ln as knowledgeRoleOn, lr as knowledgeSemanticIdempotencyKey, mi as KnowledgeMoveTooLargeError, mn as knowledgeScopeAddress, ni as KNOWLEDGE_STORAGE_CONTRACT_VERSION, nn as refreshKnowledgeLinksTo, nr as assertKnowledgeScopeWithinCeiling, oi as KnowledgeSchemaResetRequiredError, on as updateKnowledgeLinks, or as isKnowledgeScopeVisible, pi as parseKnowledgeWikilinks, pn as knowledgeRunScopes, qt as removeKnowledgePage, ri as KNOWLEDGE_STORAGE_SCHEMA_VERSION, rn as reindexKnowledgeLinks, rr as canonicalizeKnowledgeScope, si as KnowledgeStorage, sn as knowledgeAccessGrants, sr as knowledgeScopeKey, ti as KnowledgeImportersStorage, tn as knowledgeSubtree, tr as assertKnowledgeRecordTextWithinBound, ui as assertKnowledgeSchemaCompatible, un as KnowledgeDeclarationError, ur as knowledgeVisibleScopeKeys, vi as MAX_KNOWLEDGE_MOVE_PAGES, vn as buildKnowledgeInstructions, wi as MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH, xi as MAX_KNOWLEDGE_PAGE_DEPTH, yi as MAX_KNOWLEDGE_NOTE_TOKENS, zt as KnowledgeRun } from "../execution-fence-DTrAehtv.js";
|
|
3
3
|
import { standardSchemaToJSONSchema, toStandardSchema } from "../schema/index.js";
|
|
4
4
|
import { i as createStandardSchemaIssuesError } from "../tool-DIFduuTw.js";
|
|
5
|
+
import { mt as estimateTokenCount } from "../workspace-sqcfdZRR.js";
|
|
5
6
|
import { randomUUID } from "crypto";
|
|
6
7
|
// src/knowledge/changes.ts
|
|
7
8
|
const page = (op) => (result) => {
|
|
@@ -2160,6 +2161,29 @@ const live = (page) => !!page && !page.deletedAt && !page.mergedInto;
|
|
|
2160
2161
|
/** Source IDs the host keeps for the folders it makes on an item's path; importers can't send them. */
|
|
2161
2162
|
const KNOWLEDGE_IMPORT_PATH_STUB_PREFIX = "~path:";
|
|
2162
2163
|
/**
|
|
2164
|
+
* An item's description cut to the page bound, ending in `…`. Every store refuses a longer one, and
|
|
2165
|
+
* that error would roll back the whole flush, leaving the cursor on this item for every later run.
|
|
2166
|
+
* Cuts between code points, at the last word break when one is in the back half.
|
|
2167
|
+
*/
|
|
2168
|
+
function fitKnowledgeImportDescription(description) {
|
|
2169
|
+
if (estimateTokenCount(description) <= 100) return description;
|
|
2170
|
+
const chars = [...description];
|
|
2171
|
+
const cut = (length) => {
|
|
2172
|
+
let text = chars.slice(0, length).join("");
|
|
2173
|
+
const lastBreak = text.search(/\s\S*$/);
|
|
2174
|
+
if (lastBreak > text.length / 2) text = text.slice(0, lastBreak);
|
|
2175
|
+
return `${text.trimEnd()}\u2026`;
|
|
2176
|
+
};
|
|
2177
|
+
let low = 0;
|
|
2178
|
+
let high = chars.length - 1;
|
|
2179
|
+
while (low < high) {
|
|
2180
|
+
const mid = Math.ceil((low + high) / 2);
|
|
2181
|
+
if (estimateTokenCount(cut(mid)) <= 100) low = mid;
|
|
2182
|
+
else high = mid - 1;
|
|
2183
|
+
}
|
|
2184
|
+
return cut(low);
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2163
2187
|
* Why an item can never land, whatever the store holds: a reserved `sourceId`, or a `path` the host
|
|
2164
2188
|
* can't place (with `parent` or `fallbackParent`, empty, an empty or blank segment, a page key too long to
|
|
2165
2189
|
* link to, or deeper than a page can sit under a target `targetDepth` keys deep). Null when it can.
|
|
@@ -2941,7 +2965,7 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
2941
2965
|
let rendered = hasBody ? await renderBody(item) : void 0;
|
|
2942
2966
|
let fields = {
|
|
2943
2967
|
name: item.title,
|
|
2944
|
-
...item.description !== void 0 ? { description: item.description } : {},
|
|
2968
|
+
...item.description !== void 0 ? { description: fitKnowledgeImportDescription(item.description) } : {},
|
|
2945
2969
|
...rendered ? { body: rendered.body } : {}
|
|
2946
2970
|
};
|
|
2947
2971
|
let page;
|
package/dist/llm/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_llm = require("../llm-
|
|
3
|
-
const require_netlify = require("../netlify-
|
|
4
|
-
const require_provider_registry = require("../provider-registry-
|
|
2
|
+
const require_llm = require("../llm-P6sWWNc6.cjs");
|
|
3
|
+
const require_netlify = require("../netlify-DgHrsLpJ.cjs");
|
|
4
|
+
const require_provider_registry = require("../provider-registry-Brcz84P1.cjs");
|
|
5
5
|
exports.AzureOpenAIGateway = require_llm.AzureOpenAIGateway;
|
|
6
6
|
exports.EMBEDDING_MODELS = require_llm.EMBEDDING_MODELS;
|
|
7
7
|
exports.GATEWAY_AUTH_HEADER = require_netlify.GATEWAY_AUTH_HEADER;
|
package/dist/llm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ModelRouterLanguageModel, c as AzureOpenAIGateway, i as resolveModelConfig, l as defaultGateways, n as ModelRouterEmbeddingModel, r as resolveModelAuth, t as EMBEDDING_MODELS } from "../llm-
|
|
2
|
-
import { d as GATEWAY_AUTH_HEADER, g as getGatewayId, h as findGatewayForModel, r as ModelsDevGateway, t as NetlifyGateway, x as MastraModelGateway } from "../netlify-
|
|
3
|
-
import { c as modelSupportsStructuredOutput, f as MastraGateway, i as getProviderConfig, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, r as getModelReasoningOptions, s as modelSupportsAttachments, t as GatewayRegistry, u as parseModelString } from "../provider-registry-
|
|
1
|
+
import { a as ModelRouterLanguageModel, c as AzureOpenAIGateway, i as resolveModelConfig, l as defaultGateways, n as ModelRouterEmbeddingModel, r as resolveModelAuth, t as EMBEDDING_MODELS } from "../llm-B6EYEbYf.js";
|
|
2
|
+
import { d as GATEWAY_AUTH_HEADER, g as getGatewayId, h as findGatewayForModel, r as ModelsDevGateway, t as NetlifyGateway, x as MastraModelGateway } from "../netlify-d2fyniAS.js";
|
|
3
|
+
import { c as modelSupportsStructuredOutput, f as MastraGateway, i as getProviderConfig, l as modelSupportsTemperature, n as PROVIDER_REGISTRY, r as getModelReasoningOptions, s as modelSupportsAttachments, t as GatewayRegistry, u as parseModelString } from "../provider-registry-B9UP28b4.js";
|
|
4
4
|
export { AzureOpenAIGateway, EMBEDDING_MODELS, GATEWAY_AUTH_HEADER, GatewayRegistry, MastraGateway, MastraModelGateway, ModelRouterEmbeddingModel, ModelRouterLanguageModel, ModelsDevGateway, NetlifyGateway, PROVIDER_REGISTRY, defaultGateways, findGatewayForModel, getGatewayId, getModelReasoningOptions, getProviderConfig, modelSupportsAttachments, modelSupportsStructuredOutput, modelSupportsTemperature, parseModelString, resolveModelAuth, resolveModelConfig };
|