@mastra/core 1.87.0-alpha.4 → 1.87.0-alpha.5
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/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/agent-controller.d.ts +6 -0
- package/dist/agent-controller/index.cjs +1 -1
- package/dist/agent-controller/index.js +1 -1
- package/dist/agent-controller/worker-run-binding.d.ts +15 -0
- package/dist/{agent-controller-VBMIPr6h.js → agent-controller-CDwoELRq.js} +47 -5
- package/dist/{agent-controller-CqcyudV6.cjs → agent-controller-DEB1G03O.cjs} +47 -5
- package/dist/background-tasks/index.cjs +1 -1
- package/dist/background-tasks/index.js +1 -1
- package/dist/{background-tasks-FOaQ1LsS.cjs → background-tasks-B40g_Guf.cjs} +1 -1
- package/dist/{background-tasks-1tyymY2H.js → background-tasks-CBp2178j.js} +1 -1
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/{builder-CUbE9d87.js → builder-DTEXPju5.js} +2 -2
- package/dist/{builder-MLhVrFJw.cjs → builder-tuHJooMG.cjs} +2 -2
- package/dist/capabilities/302ai.json +203 -203
- package/dist/capabilities/abliteratedllm.json +34 -34
- package/dist/capabilities/abliteration-ai.json +9 -9
- package/dist/capabilities/above.json +19 -19
- package/dist/capabilities/adaption.json +9 -9
- package/dist/capabilities/adzuki.json +27 -27
- package/dist/capabilities/agentrouter.json +11 -11
- package/dist/capabilities/agnes.json +3 -3
- package/dist/capabilities/ai-router.json +6 -6
- package/dist/capabilities/aiand.json +26 -26
- package/dist/capabilities/aigrow.json +13 -13
- package/dist/capabilities/aimlapi.json +156 -156
- package/dist/capabilities/aipg.json +2 -2
- package/dist/capabilities/aixy.json +19 -19
- package/dist/capabilities/aki-io.json +15 -15
- package/dist/capabilities/alibaba-cn.json +94 -94
- package/dist/capabilities/alibaba-coding-plan-cn.json +6 -6
- package/dist/capabilities/alibaba-coding-plan.json +6 -6
- package/dist/capabilities/alibaba-token-plan-cn.json +48 -48
- package/dist/capabilities/alibaba-token-plan.json +51 -51
- package/dist/capabilities/alibaba.json +93 -59
- package/dist/capabilities/ambient.json +16 -16
- package/dist/capabilities/amd.json +9 -9
- package/dist/capabilities/anthropic.json +36 -36
- package/dist/capabilities/anyapi.json +17 -17
- package/dist/capabilities/apiko.json +4 -4
- package/dist/capabilities/arcee.json +10 -10
- package/dist/capabilities/augure.json +8 -8
- package/dist/capabilities/auriko.json +18 -18
- package/dist/capabilities/bailing.json +2 -2
- package/dist/capabilities/baseten.json +22 -22
- package/dist/capabilities/bee.json +4 -4
- package/dist/capabilities/berget.json +8 -8
- package/dist/capabilities/bothub.json +15 -15
- package/dist/capabilities/boundless.json +40 -40
- package/dist/capabilities/bumo.json +37 -37
- package/dist/capabilities/byteplus.json +29 -29
- package/dist/capabilities/cerebras.json +4 -4
- package/dist/capabilities/cheapaimodel.json +7 -7
- package/dist/capabilities/cheapest-token.json +28 -28
- package/dist/capabilities/chutes.json +7 -7
- package/dist/capabilities/cline-pass.json +37 -37
- package/dist/capabilities/cloudcode.json +7 -7
- package/dist/capabilities/cloudflare-workers-ai.json +17 -17
- package/dist/capabilities/commandcode.json +149 -149
- package/dist/capabilities/concentrate.json +271 -291
- package/dist/capabilities/cortecs.json +110 -110
- package/dist/capabilities/crossmodel.json +192 -192
- package/dist/capabilities/crusoe.json +10 -10
- package/dist/capabilities/daoxe.json +9 -9
- package/dist/capabilities/databricks.json +129 -129
- package/dist/capabilities/deepinfra.json +82 -82
- package/dist/capabilities/deepseek.json +3 -3
- package/dist/capabilities/digitalocean.json +113 -113
- package/dist/capabilities/dothoosh.json +28 -28
- package/dist/capabilities/doubleword.json +22 -22
- package/dist/capabilities/edenai.json +289 -289
- package/dist/capabilities/empiriolabs.json +172 -172
- package/dist/capabilities/engy.json +21 -21
- package/dist/capabilities/entrim.json +2 -2
- package/dist/capabilities/evroc.json +12 -12
- package/dist/capabilities/ezkielyna.json +6 -6
- package/dist/capabilities/fastrouter.json +75 -75
- package/dist/capabilities/fireworks-ai.json +98 -98
- package/dist/capabilities/freemodel.json +22 -22
- package/dist/capabilities/friendli.json +8 -8
- package/dist/capabilities/frogbot.json +93 -93
- package/dist/capabilities/gisoo.json +15 -15
- package/dist/capabilities/gmicloud.json +15 -15
- package/dist/capabilities/google.json +48 -48
- package/dist/capabilities/graphn.json +11 -11
- package/dist/capabilities/greenpt.json +37 -37
- package/dist/capabilities/groq.json +9 -9
- package/dist/capabilities/helicone.json +75 -75
- package/dist/capabilities/hopper.json +2 -2
- package/dist/capabilities/hostinger-router.json +13 -13
- package/dist/capabilities/hpc-ai.json +12 -12
- package/dist/capabilities/huawei-maas.json +12 -12
- package/dist/capabilities/hubris.json +30 -30
- package/dist/capabilities/huggingface.json +99 -99
- package/dist/capabilities/hyper.json +26 -26
- package/dist/capabilities/impossibl.json +167 -167
- package/dist/capabilities/inception.json +2 -2
- package/dist/capabilities/inceptron.json +6 -6
- package/dist/capabilities/inco.json +4 -4
- package/dist/capabilities/infer.json +13 -13
- package/dist/capabilities/inferall.json +12 -12
- package/dist/capabilities/inference-coop.json +15 -15
- package/dist/capabilities/inferenceapis.json +15 -15
- package/dist/capabilities/inferris.json +3 -3
- package/dist/capabilities/infersia.json +14 -14
- package/dist/capabilities/inferx.json +3 -3
- package/dist/capabilities/infomaniak.json +2 -2
- package/dist/capabilities/isoquant.json +4 -4
- package/dist/capabilities/iteracompute.json +56 -56
- package/dist/capabilities/jad-ai.json +3 -3
- package/dist/capabilities/jalapeno.json +10 -10
- package/dist/capabilities/jiekou.json +64 -64
- package/dist/capabilities/jzstoken.json +53 -53
- package/dist/capabilities/keln.json +17 -17
- package/dist/capabilities/kenari.json +120 -120
- package/dist/capabilities/kilo.json +632 -641
- package/dist/capabilities/kimi-code-plan-cn.json +7 -7
- package/dist/capabilities/kimi-code-plan-global.json +7 -7
- package/dist/capabilities/kitani.json +2 -2
- package/dist/capabilities/klavo.json +20 -20
- package/dist/capabilities/korouter.json +28 -28
- package/dist/capabilities/kunavo.json +10 -10
- package/dist/capabilities/liquid.json +10 -10
- package/dist/capabilities/lithosai.json +3 -3
- package/dist/capabilities/llmgateway-providers.json +913 -905
- package/dist/capabilities/llmgateway.json +334 -334
- package/dist/capabilities/llmtr.json +35 -35
- package/dist/capabilities/logits.json +2 -2
- package/dist/capabilities/lowrouter.json +50 -50
- package/dist/capabilities/lyceum.json +14 -14
- package/dist/capabilities/melious.json +13 -13
- package/dist/capabilities/merge-gateway.json +298 -298
- package/dist/capabilities/meta.json +10 -10
- package/dist/capabilities/mistral.json +16 -16
- package/dist/capabilities/mixlayer.json +5 -5
- package/dist/capabilities/modal.json +7 -7
- package/dist/capabilities/model-oracle-ai.json +25 -25
- package/dist/capabilities/modelis.json +17 -17
- package/dist/capabilities/modelscope.json +2 -2
- package/dist/capabilities/modular.json +5 -5
- package/dist/capabilities/moneo.json +13 -13
- package/dist/capabilities/moonshotai-cn.json +7 -7
- package/dist/capabilities/moonshotai.json +7 -7
- package/dist/capabilities/morph.json +10 -10
- package/dist/capabilities/munito-eu.json +6 -6
- package/dist/capabilities/munito.json +6 -6
- package/dist/capabilities/nan.json +27 -27
- package/dist/capabilities/nano-gpt.json +571 -568
- package/dist/capabilities/nearai.json +108 -108
- package/dist/capabilities/nebius.json +21 -21
- package/dist/capabilities/neon.json +130 -130
- package/dist/capabilities/neuralwatt.json +40 -40
- package/dist/capabilities/nokeep.json +4 -4
- package/dist/capabilities/novita-ai.json +155 -155
- package/dist/capabilities/nvidia.json +29 -29
- package/dist/capabilities/oathbreaker.json +2 -2
- package/dist/capabilities/obscurify.json +32 -32
- package/dist/capabilities/oci.json +5 -5
- package/dist/capabilities/ofox.json +374 -374
- package/dist/capabilities/ollama-cloud.json +54 -54
- package/dist/capabilities/openai.json +56 -56
- package/dist/capabilities/opencode-go.json +84 -84
- package/dist/capabilities/openreason.json +5 -5
- package/dist/capabilities/openrouter.json +562 -562
- package/dist/capabilities/opper.json +27 -27
- package/dist/capabilities/orcarouter.json +255 -255
- package/dist/capabilities/outerlabs.json +21 -21
- package/dist/capabilities/ovhcloud.json +21 -21
- package/dist/capabilities/pareto.json +5 -5
- package/dist/capabilities/pendra.json +4 -4
- package/dist/capabilities/perplexity-agent.json +67 -67
- package/dist/capabilities/perplexity.json +2 -2
- package/dist/capabilities/phala.json +30 -30
- package/dist/capabilities/pioneer.json +21 -21
- package/dist/capabilities/poe.json +139 -139
- package/dist/capabilities/powerspring.json +14 -14
- package/dist/capabilities/primalabs.json +10 -10
- package/dist/capabilities/prime.json +117 -117
- package/dist/capabilities/privatemode-ai.json +14 -14
- package/dist/capabilities/proxystacks.json +6 -6
- package/dist/capabilities/qiniu-ai.json +15 -15
- package/dist/capabilities/refuseless.json +10 -10
- package/dist/capabilities/regolo-ai.json +6 -6
- package/dist/capabilities/requesty.json +168 -168
- package/dist/capabilities/ruapi.json +15 -15
- package/dist/capabilities/runcrate.json +7 -7
- package/dist/capabilities/runinfra.json +8 -8
- package/dist/capabilities/sakana.json +6 -6
- package/dist/capabilities/sambanova.json +5 -5
- package/dist/capabilities/sandbase.json +21 -21
- package/dist/capabilities/sarvam.json +8 -8
- package/dist/capabilities/scaleway.json +18 -18
- package/dist/capabilities/scnet-token-plan.json +14 -14
- package/dist/capabilities/scx-ai.json +21 -21
- package/dist/capabilities/sensenova.json +9 -9
- package/dist/capabilities/siliconflow-cn.json +46 -46
- package/dist/capabilities/siliconflow.json +56 -56
- package/dist/capabilities/snowflake-cortex.json +19 -19
- package/dist/capabilities/sokkan.json +12 -12
- package/dist/capabilities/sparrowcodes.json +21 -21
- package/dist/capabilities/standardcompute.json +96 -96
- package/dist/capabilities/steadyrouter.json +41 -41
- package/dist/capabilities/stepfun-ai-step-plan.json +2 -2
- package/dist/capabilities/stepfun-ai.json +2 -2
- package/dist/capabilities/stepfun-step-plan.json +2 -2
- package/dist/capabilities/stepfun.json +2 -2
- package/dist/capabilities/stepping-stone.json +11 -11
- package/dist/capabilities/synthetic.json +8 -8
- package/dist/capabilities/synthorai.json +22 -22
- package/dist/capabilities/teamorouter.json +26 -26
- package/dist/capabilities/teapot-router.json +6 -6
- package/dist/capabilities/tencent-token-plan-intl.json +126 -0
- package/dist/capabilities/tencent-token-plan.json +41 -41
- package/dist/capabilities/tencent-tokenhub.json +47 -47
- package/dist/capabilities/tensorx.json +50 -50
- package/dist/capabilities/tenstorrent.json +2 -2
- package/dist/capabilities/the-grid-ai.json +32 -32
- package/dist/capabilities/thinkingmachines.json +64 -64
- package/dist/capabilities/tinfoil.json +12 -12
- package/dist/capabilities/toapis.json +2 -2
- package/dist/capabilities/togetherai.json +43 -43
- package/dist/capabilities/tokengo.json +20 -20
- package/dist/capabilities/tokenify.json +3 -3
- package/dist/capabilities/trustedrouter.json +6 -6
- package/dist/capabilities/trustedtokens.json +11 -11
- package/dist/capabilities/umans-ai-coding-plan.json +14 -14
- package/dist/capabilities/umans-ai.json +11 -11
- package/dist/capabilities/uncensuredai.json +5 -5
- package/dist/capabilities/unrestricted.json +4 -4
- package/dist/capabilities/uplinkswitch.json +18 -18
- package/dist/capabilities/upstage.json +6 -6
- package/dist/capabilities/vancine.json +18 -18
- package/dist/capabilities/vercel.json +545 -545
- package/dist/capabilities/vivgrid.json +81 -81
- package/dist/capabilities/volcengine-coding-plan.json +27 -27
- package/dist/capabilities/volcengine.json +25 -25
- package/dist/capabilities/vultr.json +31 -31
- package/dist/capabilities/wafer.ai.json +17 -17
- package/dist/capabilities/wallaby.json +2 -2
- package/dist/capabilities/wally.json +13 -13
- package/dist/capabilities/wandb.json +15 -15
- package/dist/capabilities/watt.json +23 -23
- package/dist/capabilities/xai.json +6 -6
- package/dist/capabilities/xiaomi-token-plan-ams.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-cn.json +2 -2
- package/dist/capabilities/xiaomi-token-plan-sgp.json +2 -2
- package/dist/capabilities/xiaomi.json +2 -2
- package/dist/capabilities/xpersona.json +9 -9
- package/dist/capabilities/xxapi.json +20 -20
- package/dist/capabilities/zai-coding-plan.json +19 -19
- package/dist/capabilities/zai.json +31 -31
- package/dist/capabilities/zenifra.json +31 -31
- package/dist/capabilities/zenmux.json +204 -204
- package/dist/capabilities/zerogpu.json +9 -9
- package/dist/capabilities/zhipuai-coding-plan.json +7 -7
- package/dist/capabilities/zhipuai.json +30 -30
- package/dist/capabilities/zro.json +4 -4
- package/dist/channels/index.cjs +2 -2
- package/dist/channels/index.js +2 -2
- package/dist/{channels-hBppCRhl.js → channels-CC2Z4adP.js} +1 -1
- package/dist/{channels-CZ0iY2yh.cjs → channels-Drxs9g13.cjs} +1 -1
- package/dist/coding-agent/index.cjs +1 -1
- package/dist/coding-agent/index.js +1 -1
- package/dist/{constants-B9ZDvXZ4.cjs → constants-Bou0hEgY.cjs} +4 -0
- package/dist/{constants-BmdTvEYN.js → constants-CFWgIaqA.js} +4 -0
- package/dist/datasets/experiment/scorer.d.ts +16 -5
- 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 +950 -950
- package/dist/docs/references/reference-knowledge-knowledge-tools.md +3 -3
- package/dist/evals/index.cjs +2 -2
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +2 -2
- package/dist/evals/scoreTraces/index.js +2 -2
- 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 +51 -16
- package/dist/knowledge/index.js +51 -16
- package/dist/knowledge/page-tools.d.ts +9 -0
- package/dist/knowledge/scope-runtime.d.ts +6 -0
- package/dist/llm/index.cjs +3 -3
- package/dist/llm/index.js +3 -3
- package/dist/llm/model/provider-types.generated.d.ts +8445 -8432
- package/dist/{llm-D6N-WJwo.cjs → llm-CbpBEabY.cjs} +2 -2
- package/dist/{llm-CsQOELh9.js → llm-D3y8qOKL.js} +2 -2
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +2 -2
- package/dist/{manager-CtsjlKP7.cjs → manager-BOn6RJwA.cjs} +106 -35
- package/dist/{manager-DBVDNjO2.js → manager-elIuArZa.js} +106 -35
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/{mastra-B60fJsMe.cjs → mastra-CDQJWY6v.cjs} +16 -16
- package/dist/{mastra-Bkpe1lBu.js → mastra-DQjco6Bt.js} +16 -16
- package/dist/memory/index.cjs +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{model-Da_pawSI.js → model-BjyU1L4I.js} +1 -1
- package/dist/{model-CAbL0zRc.cjs → model-C4aI7k-i.cjs} +1 -1
- package/dist/{netlify-hasf5dLA.cjs → netlify-BjuUEMrL.cjs} +1 -1
- package/dist/{netlify-CW26UJrG.js → netlify-BpB7PtZV.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-DnVkqIBw.js → provider-registry-BjdxtGZZ.js} +22165 -22131
- package/dist/{provider-registry-CeV5wjlF.cjs → provider-registry-bkFdaY45.cjs} +22165 -22131
- package/dist/provider-registry.json +22428 -22394
- package/dist/{registry-generator-G4PZCqrS.cjs → registry-generator-BORKO0_T.cjs} +1 -1
- package/dist/{registry-generator-DSR56u5H.js → registry-generator-CPF318Kc.js} +1 -1
- package/dist/{rehydrate-BLJ-q_V6.cjs → rehydrate-Cps4MTph.cjs} +2 -2
- package/dist/{rehydrate-zXo3Wo60.js → rehydrate-Cw2Id-Uz.js} +2 -2
- package/dist/relevance/index.cjs +2 -2
- package/dist/relevance/index.js +2 -2
- package/dist/{run-registry-oixTpWpa.cjs → run-registry-BTFPEkXT.cjs} +185 -36
- package/dist/{run-registry-Cl2QbXgN.js → run-registry-D5z2YVqJ.js} +174 -37
- package/dist/storage/constants.cjs +1 -1
- package/dist/storage/constants.js +1 -1
- package/dist/storage/domains/knowledge/base.d.ts +16 -1
- package/dist/storage/domains/knowledge/importers-inmemory.d.ts +1 -0
- package/dist/storage/domains/knowledge/importers.d.ts +8 -0
- package/dist/storage/domains/knowledge/inmemory.d.ts +1 -0
- package/dist/storage/domains/knowledge/pages-inmemory.d.ts +5 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.js +3 -3
- package/dist/storage/types.d.ts +8 -0
- package/dist/stream/index.cjs +2 -2
- package/dist/stream/index.js +2 -2
- package/dist/{stream-DaZh0apo.cjs → stream-D1OnBHDi.cjs} +1 -1
- package/dist/{stream-DUUfwH38.js → stream-DB5efioT.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-C4NvGYnM.js → tool-loop-agent-DkhFVx0h.js} +3 -3
- package/dist/{tool-loop-agent-DDowWQyO.cjs → tool-loop-agent-Ote8gJMn.cjs} +3 -3
- package/dist/{utils-CVN-336o.js → utils-BTKpGHA6.js} +1 -1
- package/dist/{utils-CmNJO2xP.cjs → utils-Dl_UFejV.cjs} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{validate-CgNNzqgp.js → validate-D6fUqYGz.js} +1 -1
- package/dist/{validate-LpK3-p_O.cjs → validate-DdDuQRoZ.cjs} +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-6qR81hZZ.cjs → worker-B27B9RlK.cjs} +2 -2
- package/dist/{worker-ChoZX7rg.js → worker-Bo_hTQJC.js} +2 -2
- package/dist/{worker-BdPUoHXa.js → worker-DC269pGx.js} +2 -2
- package/dist/{worker-BN2odJzu.cjs → worker-mq-oiLa5.cjs} +2 -2
- package/dist/{workflow-ww-N09bR.cjs → workflow-D61dV4AC.cjs} +3 -3
- package/dist/{workflow-D2MsV-JA.js → workflow-D97r3h2-.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 +10 -10
- package/src/llm/model/provider-types.generated.d.ts +8445 -8432
|
@@ -83,7 +83,7 @@ These searches also return `more`:
|
|
|
83
83
|
|
|
84
84
|
## `knowledge_list`
|
|
85
85
|
|
|
86
|
-
Lists the page tree under a starting point, so an agent can see how a scope or section is organized before it searches or reads. Without `from`, it lists
|
|
86
|
+
Lists the page tree under a starting point, so an agent can see how a scope or section is organized before it searches or reads. Without `from`, it lists every scope the run holds. Each entry has its `role` when there is one, and `can` says what the run may do there: `write`, `read` or `none`. Scopes with no page the run can read yet are listed too, with `empty: true`. A held scope the run can't read shows only its address, not its stored name or description.
|
|
87
87
|
|
|
88
88
|
**from** (`string`): Where to start: a page reference.
|
|
89
89
|
|
|
@@ -95,13 +95,13 @@ Lists the page tree under a starting point, so an agent can see how a scope or s
|
|
|
95
95
|
|
|
96
96
|
**cursor** (`string`): The previous result's nextCursor, or the cursor more gives. Pass the same from. A cursor keeps the depth and limit of the result it came from.
|
|
97
97
|
|
|
98
|
-
Returns `{ from?, entries, nextCursor?, more? }`. `from` is `{ ref, name }`. Each entry is `{ ref, name, depth, children, scope? }`, plus `description` when `descriptions` is `true`: `depth` is 1 for the starting point's children, `children` counts the readable child pages (and child scopes, for a scope), and `scope` is `true` for a scope.
|
|
98
|
+
Returns `{ from?, entries, nextCursor?, more? }`. `from` is `{ ref, name }`. Each entry is `{ ref, name, depth, children, scope? }`, plus `description` when `descriptions` is `true`: `depth` is 1 for the starting point's children, `children` counts the readable child pages (and child scopes, for a scope), and `scope` is `true` for a scope. Held-scope entries also include `role?`, `can?` (`write`, `read` or `none`) and `empty?`. An `empty: true` entry has no page the run can read yet, and its `name` is the scope address.
|
|
99
99
|
|
|
100
100
|
A result stops at `limit` entries or at the read cap (about 1,000 tokens of entries by default), whichever comes first, and always holds at least one entry. When it stops early, `more` says how many entries were left out and gives the cursor that continues where it stopped.
|
|
101
101
|
|
|
102
102
|
## `knowledge_read`
|
|
103
103
|
|
|
104
|
-
Reads a page: its body, notes, child pages, and the notes on other pages that mention it. A scope address reads that scope's page, which lists its pages and child scopes. Without `page`, it
|
|
104
|
+
Reads a page: its body, notes, child pages, and the notes on other pages that mention it. A scope address reads that scope's page, which lists its pages and child scopes. Without `page`, it returns `{ scopes }`: every scope the run holds, including scopes before any pages exist. Each scope is `{ address, name, description?, role?, can, empty? }`. `role` is there when the run has one. `can` says what the run may do there: `write`, `read` or `none`. A scope with no page the run can read yet has `empty: true`, and its `name` is the scope address. A held scope the run can't read shows only its address, not its stored name or description.
|
|
105
105
|
|
|
106
106
|
**page** (`string`): A page reference.
|
|
107
107
|
|
package/dist/evals/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_run_registry = require("../run-registry-
|
|
3
|
-
const require_constants = require("../constants-
|
|
2
|
+
const require_run_registry = require("../run-registry-BTFPEkXT.cjs");
|
|
3
|
+
const require_constants = require("../constants-Bou0hEgY.cjs");
|
|
4
4
|
const require_collect_tool_mocks = require("../collect-tool-mocks-k9fM6oDl.cjs");
|
|
5
5
|
exports.MastraScorer = require_run_registry.MastraScorer;
|
|
6
6
|
exports.SCORING_PREDICATE_ROOTS = require_run_registry.SCORING_PREDICATE_ROOTS;
|
package/dist/evals/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as MastraScorer, D as isNotScorable, E as filterRun,
|
|
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-
|
|
1
|
+
import { C as MastraScorer, D as isNotScorable, E as filterRun, Fc as validateScoringPredicate, Nc as SCORING_PREDICATE_ROOTS, O as notScorable, Pc as evaluateScoringPredicate, S as createClassifierScorer, T as createScorer, v as runEvals, w as ScorerRunError } from "../run-registry-D5z2YVqJ.js";
|
|
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-CFWgIaqA.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,8 +1,8 @@
|
|
|
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_run_registry = require("../../run-registry-
|
|
5
|
-
const require_constants = require("../../constants-
|
|
4
|
+
const require_run_registry = require("../../run-registry-BTFPEkXT.cjs");
|
|
5
|
+
const require_constants = require("../../constants-Bou0hEgY.cjs");
|
|
6
6
|
let zod_v4 = require("zod/v4");
|
|
7
7
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
8
8
|
async function scoreTraces({ scorerId, targets, mastra }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
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 { Hs as createStep, Us as createWorkflow } from "../../run-registry-
|
|
4
|
-
import { Dr as saveScorePayloadSchema } from "../../constants-
|
|
3
|
+
import { Hs as createStep, Us as createWorkflow } from "../../run-registry-D5z2YVqJ.js";
|
|
4
|
+
import { Dr as saveScorePayloadSchema } from "../../constants-CFWgIaqA.js";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
// src/evals/scoreTraces/scoreTraces.ts
|
|
7
7
|
async function scoreTraces({ scorerId, targets, mastra }) {
|
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-kRNZ38Nf.cjs");
|
|
3
3
|
const require_tools = require("../tools-n9lqzDNe.cjs");
|
|
4
|
-
const require_agent_controller = require("../agent-controller-
|
|
4
|
+
const require_agent_controller = require("../agent-controller-DEB1G03O.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-B9kxpM53.js";
|
|
2
2
|
import { s as askUserTool, t as submitPlanTool } from "../tools-DDfA_ES4.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-CDwoELRq.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-DQjco6Bt.js";
|
package/dist/knowledge/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_base = require("../base-BIzR1D3_.cjs");
|
|
3
|
-
const require_run_registry = require("../run-registry-
|
|
3
|
+
const require_run_registry = require("../run-registry-BTFPEkXT.cjs");
|
|
4
4
|
const require_tool = require("../tool-CYlT2UA-.cjs");
|
|
5
5
|
let crypto = require("crypto");
|
|
6
6
|
let _mastra_schema_compat_schema = require("@mastra/schema-compat/schema");
|
|
@@ -1213,20 +1213,24 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
1213
1213
|
const keyPath = async (page) => {
|
|
1214
1214
|
const keys = [];
|
|
1215
1215
|
const ids = [];
|
|
1216
|
-
|
|
1217
|
-
|
|
1216
|
+
if (page.isScope) return page.id === scope.id ? {
|
|
1217
|
+
keys,
|
|
1218
|
+
ids
|
|
1219
|
+
} : null;
|
|
1220
|
+
const parents = page.parentId ? await storage.getPageParents({
|
|
1221
|
+
parentId: page.parentId,
|
|
1222
|
+
read: "all"
|
|
1223
|
+
}) : [];
|
|
1224
|
+
for (const at of [page, ...parents]) {
|
|
1225
|
+
if (at.isScope) return at.id === scope.id ? {
|
|
1226
|
+
keys,
|
|
1227
|
+
ids
|
|
1228
|
+
} : null;
|
|
1218
1229
|
if (!live(at) || at.key === void 0) return null;
|
|
1219
1230
|
keys.unshift(at.key);
|
|
1220
1231
|
ids.unshift(at.id);
|
|
1221
|
-
at = at.parentId ? await storage.getPage({
|
|
1222
|
-
id: at.parentId,
|
|
1223
|
-
read: "all"
|
|
1224
|
-
}) : null;
|
|
1225
1232
|
}
|
|
1226
|
-
return
|
|
1227
|
-
keys,
|
|
1228
|
-
ids
|
|
1229
|
-
} : null;
|
|
1233
|
+
return null;
|
|
1230
1234
|
};
|
|
1231
1235
|
const sameKeys = (a, b) => a.length === b.length && a.every((key, i) => key === b[i]);
|
|
1232
1236
|
/**
|
|
@@ -1437,8 +1441,7 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
1437
1441
|
return node && !await gone(node) ? node : null;
|
|
1438
1442
|
};
|
|
1439
1443
|
const ref = (keys) => `${target.scope}#${keys.join("/")}`;
|
|
1440
|
-
const linkLine = async (link) => {
|
|
1441
|
-
const node = await importers.getNode(binding.id, link.sourceId);
|
|
1444
|
+
const linkLine = async (link, node) => {
|
|
1442
1445
|
const page = node ? await storage.getPage({
|
|
1443
1446
|
id: node.pageId,
|
|
1444
1447
|
read: "all"
|
|
@@ -1449,11 +1452,30 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
1449
1452
|
const renderLinks = async (links) => {
|
|
1450
1453
|
const lines = [];
|
|
1451
1454
|
const unresolved = [];
|
|
1455
|
+
const getNodes = async (sourceIds) => {
|
|
1456
|
+
if (!sourceIds.length) return [];
|
|
1457
|
+
if (importers.getNodes) return importers.getNodes(binding.id, sourceIds);
|
|
1458
|
+
const nodes = [];
|
|
1459
|
+
for (const sourceId of new Set(sourceIds)) {
|
|
1460
|
+
const node = await importers.getNode(binding.id, sourceId);
|
|
1461
|
+
if (node) nodes.push(node);
|
|
1462
|
+
}
|
|
1463
|
+
return nodes;
|
|
1464
|
+
};
|
|
1465
|
+
const read = async (sourceIds) => new Map((await getNodes(sourceIds)).map((node) => [node.sourceId, node]));
|
|
1466
|
+
const before = await read(links.map((link) => link.sourceId));
|
|
1467
|
+
const rendered = [];
|
|
1452
1468
|
for (const link of links) {
|
|
1453
|
-
const
|
|
1454
|
-
|
|
1455
|
-
|
|
1469
|
+
const node = before.get(link.sourceId);
|
|
1470
|
+
rendered.push({
|
|
1471
|
+
link,
|
|
1472
|
+
line: await linkLine(link, node),
|
|
1473
|
+
pageId: node?.pageId
|
|
1474
|
+
});
|
|
1456
1475
|
}
|
|
1476
|
+
const after = await read(rendered.filter((each) => each.line).map((each) => each.link.sourceId));
|
|
1477
|
+
for (const { link, line, pageId } of rendered) if (line && after.get(link.sourceId)?.pageId === pageId) lines.push(line);
|
|
1478
|
+
else unresolved.push(encodeLink(link));
|
|
1457
1479
|
return {
|
|
1458
1480
|
section: linkSection(lines),
|
|
1459
1481
|
unresolved
|
|
@@ -3400,6 +3422,19 @@ var KnowledgeScopeRuntime = class {
|
|
|
3400
3422
|
};
|
|
3401
3423
|
for (const address of addresses) await this.#materialize(address, principals, provenance, [], run);
|
|
3402
3424
|
}
|
|
3425
|
+
/**
|
|
3426
|
+
* The parent address a first write would place a not-yet-created scope under, as `#materialize`
|
|
3427
|
+
* chooses it: a template child's own parent, or the one held `belongsTo` candidate. Undefined when
|
|
3428
|
+
* the scope would stay unlinked.
|
|
3429
|
+
*/
|
|
3430
|
+
firstWriteParentAddress(address, principals) {
|
|
3431
|
+
const match = this.compiled.match(address);
|
|
3432
|
+
if (!match) return void 0;
|
|
3433
|
+
if (match.compiled.child) return address.slice(0, address.lastIndexOf("/"));
|
|
3434
|
+
if (!match.compiled.belongsTo) return void 0;
|
|
3435
|
+
const candidates = this.#belongsToCandidates(match, this.#held(principals));
|
|
3436
|
+
return candidates.length === 1 && candidates[0] !== address ? candidates[0] : void 0;
|
|
3437
|
+
}
|
|
3403
3438
|
/** The run's distinct principals grouped by declaration key, matched once. */
|
|
3404
3439
|
#held(principals) {
|
|
3405
3440
|
const held = /* @__PURE__ */ new Map();
|
package/dist/knowledge/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as MastraBase } from "../base-CKLWBhDo.js";
|
|
2
|
-
import { $t as knowledgeDeliveredPins, Ai as MAX_KNOWLEDGE_PAGE_BODY_LINKS, Bi as knowledgeLinkRefKey, Ci as parseKnowledgeWikilinks, Cn as knowledgeRunScopes, Di as KnowledgePageKeyConflictError, Dn as encodeKnowledgeScopeId, Ei as KnowledgePageHasChildrenError, En as decodeKnowledgeScopeId, Fi as MAX_KNOWLEDGE_PAGE_LIST_LIMIT, Gi as parseKnowledgePageRef, Hi as knowledgePinDepth, Ii as MAX_KNOWLEDGE_PIN_LIST_DEPTH, Ki as KnowledgeInvalidCursorError, Li as assertKnowledgeNoteTextWithinBound, Mi as MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS, Ni as MAX_KNOWLEDGE_PAGE_LINKS, Oi as MAX_KNOWLEDGE_MOVE_PAGES, On as buildKnowledgeInstructions, Pi as MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH, Qt as PINNED_READ_MEMO_KEY, Ri as assertKnowledgePageDescriptionWithinBound, Si as inspectKnowledgeSchema, Sn as knowledgeMemoryScopes, Ti as KnowledgePageDepthError, Tn as strongerKnowledgeRole, Ui as knowledgePositionBetween, Uo as augmentWithInit, Vi as knowledgePagePath, Wi as knowledgeScopeReadable, Wo as getStorageSource, _i as KnowledgeStorage, _n as knowledgeAccessGrants, _r as knowledgeScopeKey, an as removeKnowledgeNote, bi as assertKnowledgeSchemaCompatible, bn as KnowledgeDeclarationError, br as knowledgeVisibleScopeKeys, ci as InMemoryKnowledgeStorage, cn as upsertKnowledgePage, cr as MAX_KNOWLEDGE_SCOPE_TAGS, di as KnowledgeImportersStorage, dn as KnowledgeLinkRefreshIncompleteError, dr as assertKnowledgeRecordTextWithinBound, en as buildKnowledgePageTools, fi as KNOWLEDGE_STORAGE_CONTRACT_VERSION, fn as knowledgeSubtree, fr as assertKnowledgeScopeWithinCeiling, gi as KnowledgeSchemaResetRequiredError, gn as updateKnowledgeLinks, gr as isKnowledgeScopeVisible, hi as KnowledgeNotFoundError, hn as syncKnowledgePageBodyLinks, hr as expandKnowledgeScope, in as moveKnowledgePage, ji as MAX_KNOWLEDGE_PAGE_DEPTH, ki as MAX_KNOWLEDGE_NOTE_TOKENS, li as KnowledgeImporterBindingConflictError, ln as KnowledgeSemanticIndex, lr as assertKnowledgeCeilingRaised, mi as KnowledgeConflictError, mn as reindexKnowledgeLinks, mr as createKnowledgeNodeCursor, nn as knowledgeRunPrincipals, on as removeKnowledgePage, or as MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH, pi as KNOWLEDGE_STORAGE_SCHEMA_VERSION, pn as refreshKnowledgeLinksTo, pr as canonicalizeKnowledgeScope, rn as addKnowledgeNote, sn as updateKnowledgeNote, sr as MAX_KNOWLEDGE_RECORD_TEXT_LENGTH, tn as KnowledgeRun, ui as KnowledgeImporterRunStateError, ur as assertKnowledgeDescriptionWithinBound, vi as KnowledgeTransactionDeadlineError, vn as knowledgeReadScopeFor, vr as knowledgeSemanticDocumentId, wi as KnowledgeMoveTooLargeError, wn as knowledgeScopeAddress, xi as createKnowledgeUlid, xn as compileKnowledgeScopes, xr as parseKnowledgeNodeCursor, yi as KnowledgeUnsupportedCapabilityError, yn as knowledgeRoleOn, yr as knowledgeSemanticIdempotencyKey, zi as canonicalKnowledgeName } from "../run-registry-
|
|
2
|
+
import { $t as knowledgeDeliveredPins, Ai as MAX_KNOWLEDGE_PAGE_BODY_LINKS, Bi as knowledgeLinkRefKey, Ci as parseKnowledgeWikilinks, Cn as knowledgeRunScopes, Di as KnowledgePageKeyConflictError, Dn as encodeKnowledgeScopeId, Ei as KnowledgePageHasChildrenError, En as decodeKnowledgeScopeId, Fi as MAX_KNOWLEDGE_PAGE_LIST_LIMIT, Gi as parseKnowledgePageRef, Hi as knowledgePinDepth, Ii as MAX_KNOWLEDGE_PIN_LIST_DEPTH, Ki as KnowledgeInvalidCursorError, Li as assertKnowledgeNoteTextWithinBound, Mi as MAX_KNOWLEDGE_PAGE_DESCRIPTION_TOKENS, Ni as MAX_KNOWLEDGE_PAGE_LINKS, Oi as MAX_KNOWLEDGE_MOVE_PAGES, On as buildKnowledgeInstructions, Pi as MAX_KNOWLEDGE_PAGE_LINK_REF_LENGTH, Qt as PINNED_READ_MEMO_KEY, Ri as assertKnowledgePageDescriptionWithinBound, Si as inspectKnowledgeSchema, Sn as knowledgeMemoryScopes, Ti as KnowledgePageDepthError, Tn as strongerKnowledgeRole, Ui as knowledgePositionBetween, Uo as augmentWithInit, Vi as knowledgePagePath, Wi as knowledgeScopeReadable, Wo as getStorageSource, _i as KnowledgeStorage, _n as knowledgeAccessGrants, _r as knowledgeScopeKey, an as removeKnowledgeNote, bi as assertKnowledgeSchemaCompatible, bn as KnowledgeDeclarationError, br as knowledgeVisibleScopeKeys, ci as InMemoryKnowledgeStorage, cn as upsertKnowledgePage, cr as MAX_KNOWLEDGE_SCOPE_TAGS, di as KnowledgeImportersStorage, dn as KnowledgeLinkRefreshIncompleteError, dr as assertKnowledgeRecordTextWithinBound, en as buildKnowledgePageTools, fi as KNOWLEDGE_STORAGE_CONTRACT_VERSION, fn as knowledgeSubtree, fr as assertKnowledgeScopeWithinCeiling, gi as KnowledgeSchemaResetRequiredError, gn as updateKnowledgeLinks, gr as isKnowledgeScopeVisible, hi as KnowledgeNotFoundError, hn as syncKnowledgePageBodyLinks, hr as expandKnowledgeScope, in as moveKnowledgePage, ji as MAX_KNOWLEDGE_PAGE_DEPTH, ki as MAX_KNOWLEDGE_NOTE_TOKENS, li as KnowledgeImporterBindingConflictError, ln as KnowledgeSemanticIndex, lr as assertKnowledgeCeilingRaised, mi as KnowledgeConflictError, mn as reindexKnowledgeLinks, mr as createKnowledgeNodeCursor, nn as knowledgeRunPrincipals, on as removeKnowledgePage, or as MAX_KNOWLEDGE_NODE_DESCRIPTION_LENGTH, pi as KNOWLEDGE_STORAGE_SCHEMA_VERSION, pn as refreshKnowledgeLinksTo, pr as canonicalizeKnowledgeScope, rn as addKnowledgeNote, sn as updateKnowledgeNote, sr as MAX_KNOWLEDGE_RECORD_TEXT_LENGTH, tn as KnowledgeRun, ui as KnowledgeImporterRunStateError, ur as assertKnowledgeDescriptionWithinBound, vi as KnowledgeTransactionDeadlineError, vn as knowledgeReadScopeFor, vr as knowledgeSemanticDocumentId, wi as KnowledgeMoveTooLargeError, wn as knowledgeScopeAddress, xi as createKnowledgeUlid, xn as compileKnowledgeScopes, xr as parseKnowledgeNodeCursor, yi as KnowledgeUnsupportedCapabilityError, yn as knowledgeRoleOn, yr as knowledgeSemanticIdempotencyKey, zi as canonicalKnowledgeName } from "../run-registry-D5z2YVqJ.js";
|
|
3
3
|
import { standardSchemaToJSONSchema, toStandardSchema } from "../schema/index.js";
|
|
4
4
|
import { i as createStandardSchemaIssuesError } from "../tool-Z3bykc1m.js";
|
|
5
5
|
import { randomUUID } from "crypto";
|
|
@@ -1212,20 +1212,24 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
1212
1212
|
const keyPath = async (page) => {
|
|
1213
1213
|
const keys = [];
|
|
1214
1214
|
const ids = [];
|
|
1215
|
-
|
|
1216
|
-
|
|
1215
|
+
if (page.isScope) return page.id === scope.id ? {
|
|
1216
|
+
keys,
|
|
1217
|
+
ids
|
|
1218
|
+
} : null;
|
|
1219
|
+
const parents = page.parentId ? await storage.getPageParents({
|
|
1220
|
+
parentId: page.parentId,
|
|
1221
|
+
read: "all"
|
|
1222
|
+
}) : [];
|
|
1223
|
+
for (const at of [page, ...parents]) {
|
|
1224
|
+
if (at.isScope) return at.id === scope.id ? {
|
|
1225
|
+
keys,
|
|
1226
|
+
ids
|
|
1227
|
+
} : null;
|
|
1217
1228
|
if (!live(at) || at.key === void 0) return null;
|
|
1218
1229
|
keys.unshift(at.key);
|
|
1219
1230
|
ids.unshift(at.id);
|
|
1220
|
-
at = at.parentId ? await storage.getPage({
|
|
1221
|
-
id: at.parentId,
|
|
1222
|
-
read: "all"
|
|
1223
|
-
}) : null;
|
|
1224
1231
|
}
|
|
1225
|
-
return
|
|
1226
|
-
keys,
|
|
1227
|
-
ids
|
|
1228
|
-
} : null;
|
|
1232
|
+
return null;
|
|
1229
1233
|
};
|
|
1230
1234
|
const sameKeys = (a, b) => a.length === b.length && a.every((key, i) => key === b[i]);
|
|
1231
1235
|
/**
|
|
@@ -1436,8 +1440,7 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
1436
1440
|
return node && !await gone(node) ? node : null;
|
|
1437
1441
|
};
|
|
1438
1442
|
const ref = (keys) => `${target.scope}#${keys.join("/")}`;
|
|
1439
|
-
const linkLine = async (link) => {
|
|
1440
|
-
const node = await importers.getNode(binding.id, link.sourceId);
|
|
1443
|
+
const linkLine = async (link, node) => {
|
|
1441
1444
|
const page = node ? await storage.getPage({
|
|
1442
1445
|
id: node.pageId,
|
|
1443
1446
|
read: "all"
|
|
@@ -1448,11 +1451,30 @@ async function applyKnowledgeImportFlush(input) {
|
|
|
1448
1451
|
const renderLinks = async (links) => {
|
|
1449
1452
|
const lines = [];
|
|
1450
1453
|
const unresolved = [];
|
|
1454
|
+
const getNodes = async (sourceIds) => {
|
|
1455
|
+
if (!sourceIds.length) return [];
|
|
1456
|
+
if (importers.getNodes) return importers.getNodes(binding.id, sourceIds);
|
|
1457
|
+
const nodes = [];
|
|
1458
|
+
for (const sourceId of new Set(sourceIds)) {
|
|
1459
|
+
const node = await importers.getNode(binding.id, sourceId);
|
|
1460
|
+
if (node) nodes.push(node);
|
|
1461
|
+
}
|
|
1462
|
+
return nodes;
|
|
1463
|
+
};
|
|
1464
|
+
const read = async (sourceIds) => new Map((await getNodes(sourceIds)).map((node) => [node.sourceId, node]));
|
|
1465
|
+
const before = await read(links.map((link) => link.sourceId));
|
|
1466
|
+
const rendered = [];
|
|
1451
1467
|
for (const link of links) {
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1454
|
-
|
|
1468
|
+
const node = before.get(link.sourceId);
|
|
1469
|
+
rendered.push({
|
|
1470
|
+
link,
|
|
1471
|
+
line: await linkLine(link, node),
|
|
1472
|
+
pageId: node?.pageId
|
|
1473
|
+
});
|
|
1455
1474
|
}
|
|
1475
|
+
const after = await read(rendered.filter((each) => each.line).map((each) => each.link.sourceId));
|
|
1476
|
+
for (const { link, line, pageId } of rendered) if (line && after.get(link.sourceId)?.pageId === pageId) lines.push(line);
|
|
1477
|
+
else unresolved.push(encodeLink(link));
|
|
1456
1478
|
return {
|
|
1457
1479
|
section: linkSection(lines),
|
|
1458
1480
|
unresolved
|
|
@@ -3399,6 +3421,19 @@ var KnowledgeScopeRuntime = class {
|
|
|
3399
3421
|
};
|
|
3400
3422
|
for (const address of addresses) await this.#materialize(address, principals, provenance, [], run);
|
|
3401
3423
|
}
|
|
3424
|
+
/**
|
|
3425
|
+
* The parent address a first write would place a not-yet-created scope under, as `#materialize`
|
|
3426
|
+
* chooses it: a template child's own parent, or the one held `belongsTo` candidate. Undefined when
|
|
3427
|
+
* the scope would stay unlinked.
|
|
3428
|
+
*/
|
|
3429
|
+
firstWriteParentAddress(address, principals) {
|
|
3430
|
+
const match = this.compiled.match(address);
|
|
3431
|
+
if (!match) return void 0;
|
|
3432
|
+
if (match.compiled.child) return address.slice(0, address.lastIndexOf("/"));
|
|
3433
|
+
if (!match.compiled.belongsTo) return void 0;
|
|
3434
|
+
const candidates = this.#belongsToCandidates(match, this.#held(principals));
|
|
3435
|
+
return candidates.length === 1 && candidates[0] !== address ? candidates[0] : void 0;
|
|
3436
|
+
}
|
|
3402
3437
|
/** The run's distinct principals grouped by declaration key, matched once. */
|
|
3403
3438
|
#held(principals) {
|
|
3404
3439
|
const held = /* @__PURE__ */ new Map();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KnowledgePage, KnowledgeStorage } from '../storage/domains/knowledge/index.js';
|
|
2
2
|
import type { ToolAction } from '../tools/index.js';
|
|
3
|
+
import type { KnowledgeRole } from './declarations.js';
|
|
3
4
|
import { KnowledgeRun } from './run.js';
|
|
4
5
|
import type { KnowledgeScopeRuntime } from './scope-runtime.js';
|
|
5
6
|
import type { KnowledgeSemanticIndex } from './semantic.js';
|
|
@@ -24,6 +25,8 @@ export interface KnowledgePageToolGroups {
|
|
|
24
25
|
pins: boolean;
|
|
25
26
|
}
|
|
26
27
|
type Tools = Record<string, ToolAction<any, any, any>>;
|
|
28
|
+
/** What a run can do in a scope it holds: contributors and up can write, viewers only read. */
|
|
29
|
+
type HeldScopeAccess = 'write' | 'read' | 'none';
|
|
27
30
|
/** One entry of a `knowledge_list` result. */
|
|
28
31
|
export interface ListEntry {
|
|
29
32
|
ref: string;
|
|
@@ -34,6 +37,12 @@ export interface ListEntry {
|
|
|
34
37
|
/** Readable child pages, plus readable child scopes for a scope. */
|
|
35
38
|
children: number;
|
|
36
39
|
scope?: true;
|
|
40
|
+
/** Held scopes only (a listing without `from`): the run's role there, if any. */
|
|
41
|
+
role?: KnowledgeRole;
|
|
42
|
+
/** Held scopes only: what the run can do there. */
|
|
43
|
+
can?: HeldScopeAccess;
|
|
44
|
+
/** Held scopes only: no page there this run can read yet. */
|
|
45
|
+
empty?: true;
|
|
37
46
|
}
|
|
38
47
|
/** What {@link listKnowledgeTree} found: the entries in tree order, and where the listing stopped. */
|
|
39
48
|
export interface KnowledgeTreeListing {
|
|
@@ -77,5 +77,11 @@ export declare class KnowledgeScopeRuntime {
|
|
|
77
77
|
* `belongsTo` link, has its child scopes and declares no template pages; warnings fire as before.
|
|
78
78
|
*/
|
|
79
79
|
materializeScopes(addresses: readonly string[], principals: readonly string[], provenance: KnowledgeProvenance): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* The parent address a first write would place a not-yet-created scope under, as `#materialize`
|
|
82
|
+
* chooses it: a template child's own parent, or the one held `belongsTo` candidate. Undefined when
|
|
83
|
+
* the scope would stay unlinked.
|
|
84
|
+
*/
|
|
85
|
+
firstWriteParentAddress(address: string, principals: readonly string[]): string | undefined;
|
|
80
86
|
}
|
|
81
87
|
//# sourceMappingURL=scope-runtime.d.ts.map
|
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-CbpBEabY.cjs");
|
|
3
|
+
const require_netlify = require("../netlify-BjuUEMrL.cjs");
|
|
4
|
+
const require_provider_registry = require("../provider-registry-bkFdaY45.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 { l as GATEWAY_AUTH_HEADER, m as getGatewayId, p as findGatewayForModel, r as ModelsDevGateway, t as NetlifyGateway, y 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-D3y8qOKL.js";
|
|
2
|
+
import { l as GATEWAY_AUTH_HEADER, m as getGatewayId, p as findGatewayForModel, r as ModelsDevGateway, t as NetlifyGateway, y as MastraModelGateway } from "../netlify-BpB7PtZV.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-BjdxtGZZ.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 };
|