@mastra/server 1.25.1-alpha.0 → 1.26.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/dist/{chunk-KSHYQV6C.js → chunk-22KILIN3.js} +9 -3
- package/dist/chunk-22KILIN3.js.map +1 -0
- package/dist/{chunk-XV6SSNPX.js → chunk-22O6HC34.js} +5 -5
- package/dist/{chunk-XV6SSNPX.js.map → chunk-22O6HC34.js.map} +1 -1
- package/dist/{chunk-WOASWM5W.cjs → chunk-2KPTJJCW.cjs} +10 -10
- package/dist/{chunk-WOASWM5W.cjs.map → chunk-2KPTJJCW.cjs.map} +1 -1
- package/dist/{chunk-DTURLO75.cjs → chunk-2XC2RBAA.cjs} +9 -9
- package/dist/{chunk-DTURLO75.cjs.map → chunk-2XC2RBAA.cjs.map} +1 -1
- package/dist/{chunk-7Q5EF4YL.cjs → chunk-3CH5PPUX.cjs} +42 -42
- package/dist/{chunk-7Q5EF4YL.cjs.map → chunk-3CH5PPUX.cjs.map} +1 -1
- package/dist/{chunk-V7EVEI4C.js → chunk-43PQH5ID.js} +9 -2
- package/dist/chunk-43PQH5ID.js.map +1 -0
- package/dist/{chunk-W4B3I2S5.cjs → chunk-4B6G3RKY.cjs} +12 -12
- package/dist/{chunk-W4B3I2S5.cjs.map → chunk-4B6G3RKY.cjs.map} +1 -1
- package/dist/{chunk-VNFRE5PC.cjs → chunk-4CYUAX5K.cjs} +10 -10
- package/dist/{chunk-VNFRE5PC.cjs.map → chunk-4CYUAX5K.cjs.map} +1 -1
- package/dist/{chunk-PNMZ2R5P.cjs → chunk-4DWMVYPN.cjs} +258 -24
- package/dist/chunk-4DWMVYPN.cjs.map +1 -0
- package/dist/{chunk-AUOLHRVZ.cjs → chunk-4HMUEKS5.cjs} +38 -38
- package/dist/{chunk-AUOLHRVZ.cjs.map → chunk-4HMUEKS5.cjs.map} +1 -1
- package/dist/{chunk-GQTXBUV3.cjs → chunk-4MBZUIPB.cjs} +10 -10
- package/dist/{chunk-GQTXBUV3.cjs.map → chunk-4MBZUIPB.cjs.map} +1 -1
- package/dist/{chunk-FJ4PYS2Y.js → chunk-4NMG24TV.js} +4 -4
- package/dist/{chunk-FJ4PYS2Y.js.map → chunk-4NMG24TV.js.map} +1 -1
- package/dist/{chunk-M3FNKLTJ.cjs → chunk-5HVTQ372.cjs} +28 -28
- package/dist/{chunk-M3FNKLTJ.cjs.map → chunk-5HVTQ372.cjs.map} +1 -1
- package/dist/{chunk-WPAA5YCH.js → chunk-5THOEWRH.js} +5 -5
- package/dist/{chunk-WPAA5YCH.js.map → chunk-5THOEWRH.js.map} +1 -1
- package/dist/{chunk-IRGW3SKB.js → chunk-6KMLRD3J.js} +3 -3
- package/dist/{chunk-IRGW3SKB.js.map → chunk-6KMLRD3J.js.map} +1 -1
- package/dist/{chunk-TPBXZVM2.js → chunk-7Q2B5NYU.js} +3 -3
- package/dist/{chunk-TPBXZVM2.js.map → chunk-7Q2B5NYU.js.map} +1 -1
- package/dist/{chunk-B2NLS3NT.js → chunk-7TSZTH72.js} +8 -6
- package/dist/chunk-7TSZTH72.js.map +1 -0
- package/dist/{chunk-HOGOJPGP.js → chunk-7WSA4PNX.js} +20 -7
- package/dist/chunk-7WSA4PNX.js.map +1 -0
- package/dist/{chunk-35UZWWLE.js → chunk-AKSJV2GO.js} +4 -4
- package/dist/{chunk-35UZWWLE.js.map → chunk-AKSJV2GO.js.map} +1 -1
- package/dist/{chunk-U2MEDXN5.js → chunk-ASBDD4XW.js} +4 -4
- package/dist/{chunk-U2MEDXN5.js.map → chunk-ASBDD4XW.js.map} +1 -1
- package/dist/{chunk-UKMRQ6ER.cjs → chunk-AVDVDLX2.cjs} +9 -3
- package/dist/chunk-AVDVDLX2.cjs.map +1 -0
- package/dist/{chunk-2RC624RU.js → chunk-BDRUBV7I.js} +3 -3
- package/dist/{chunk-2RC624RU.js.map → chunk-BDRUBV7I.js.map} +1 -1
- package/dist/{chunk-ZXRN52DW.js → chunk-BH4XTSYU.js} +3 -3
- package/dist/{chunk-ZXRN52DW.js.map → chunk-BH4XTSYU.js.map} +1 -1
- package/dist/{chunk-TSYMLLXR.js → chunk-BLGIIR7K.js} +3 -3
- package/dist/{chunk-TSYMLLXR.js.map → chunk-BLGIIR7K.js.map} +1 -1
- package/dist/{chunk-AIGAXCMX.cjs → chunk-BLINU5LG.cjs} +7 -7
- package/dist/{chunk-AIGAXCMX.cjs.map → chunk-BLINU5LG.cjs.map} +1 -1
- package/dist/{chunk-7DC3GFTS.cjs → chunk-CRFSYKPF.cjs} +93 -91
- package/dist/chunk-CRFSYKPF.cjs.map +1 -0
- package/dist/{chunk-RE3O2Q7O.js → chunk-DDXXKCPP.js} +4 -4
- package/dist/{chunk-RE3O2Q7O.js.map → chunk-DDXXKCPP.js.map} +1 -1
- package/dist/{chunk-36MZMOPE.cjs → chunk-DNY4PR4R.cjs} +24 -24
- package/dist/{chunk-36MZMOPE.cjs.map → chunk-DNY4PR4R.cjs.map} +1 -1
- package/dist/{chunk-YGZZZ5L6.js → chunk-DXQ7AYPC.js} +6 -6
- package/dist/{chunk-YGZZZ5L6.js.map → chunk-DXQ7AYPC.js.map} +1 -1
- package/dist/{chunk-Z4PPU3CR.cjs → chunk-E2TQ7ELT.cjs} +11 -11
- package/dist/{chunk-Z4PPU3CR.cjs.map → chunk-E2TQ7ELT.cjs.map} +1 -1
- package/dist/{chunk-DOHUOYZS.cjs → chunk-E7CWDTUA.cjs} +7 -7
- package/dist/{chunk-DOHUOYZS.cjs.map → chunk-E7CWDTUA.cjs.map} +1 -1
- package/dist/{chunk-A5VD2RSU.cjs → chunk-F7DL7V5F.cjs} +5 -5
- package/dist/{chunk-A5VD2RSU.cjs.map → chunk-F7DL7V5F.cjs.map} +1 -1
- package/dist/{chunk-KAQ3OHOE.cjs → chunk-GCFGDETN.cjs} +10 -10
- package/dist/{chunk-KAQ3OHOE.cjs.map → chunk-GCFGDETN.cjs.map} +1 -1
- package/dist/{chunk-VCIHYF2N.js → chunk-GMGIODFO.js} +4 -4
- package/dist/{chunk-VCIHYF2N.js.map → chunk-GMGIODFO.js.map} +1 -1
- package/dist/{chunk-66VXBWSR.js → chunk-GXANKFKR.js} +4 -4
- package/dist/{chunk-66VXBWSR.js.map → chunk-GXANKFKR.js.map} +1 -1
- package/dist/{chunk-D7CXXSBA.js → chunk-HLMLJRQF.js} +3 -3
- package/dist/{chunk-D7CXXSBA.js.map → chunk-HLMLJRQF.js.map} +1 -1
- package/dist/{chunk-MRA3CYYV.cjs → chunk-HN77ZAKZ.cjs} +8 -8
- package/dist/{chunk-MRA3CYYV.cjs.map → chunk-HN77ZAKZ.cjs.map} +1 -1
- package/dist/{chunk-NI5HCR63.js → chunk-HZLF6FJO.js} +3 -3
- package/dist/{chunk-NI5HCR63.js.map → chunk-HZLF6FJO.js.map} +1 -1
- package/dist/{chunk-S7PYDU5I.js → chunk-J2G35GZP.js} +3 -3
- package/dist/{chunk-S7PYDU5I.js.map → chunk-J2G35GZP.js.map} +1 -1
- package/dist/{chunk-SNK6UFPW.cjs → chunk-JJNQWFEO.cjs} +33 -33
- package/dist/{chunk-SNK6UFPW.cjs.map → chunk-JJNQWFEO.cjs.map} +1 -1
- package/dist/{chunk-5MX3D4IX.js → chunk-JKFMRHNM.js} +3 -3
- package/dist/{chunk-5MX3D4IX.js.map → chunk-JKFMRHNM.js.map} +1 -1
- package/dist/{chunk-5QAZEJLG.cjs → chunk-JKLFAFM4.cjs} +10 -10
- package/dist/{chunk-5QAZEJLG.cjs.map → chunk-JKLFAFM4.cjs.map} +1 -1
- package/dist/{chunk-CFA5AY4I.js → chunk-JZP63ZOD.js} +4 -4
- package/dist/{chunk-CFA5AY4I.js.map → chunk-JZP63ZOD.js.map} +1 -1
- package/dist/{chunk-2HPMUAMW.js → chunk-KEFOJ6EP.js} +771 -8
- package/dist/chunk-KEFOJ6EP.js.map +1 -0
- package/dist/{chunk-KEYTQRMZ.cjs → chunk-KFOY72UU.cjs} +123 -110
- package/dist/chunk-KFOY72UU.cjs.map +1 -0
- package/dist/{chunk-VB4KLMMA.js → chunk-KHF2JHBR.js} +6 -6
- package/dist/{chunk-VB4KLMMA.js.map → chunk-KHF2JHBR.js.map} +1 -1
- package/dist/{chunk-53ZWW6YM.cjs → chunk-KIKJO2ZB.cjs} +10 -10
- package/dist/{chunk-53ZWW6YM.cjs.map → chunk-KIKJO2ZB.cjs.map} +1 -1
- package/dist/{chunk-JP6747C6.cjs → chunk-KYICR6A5.cjs} +6 -6
- package/dist/{chunk-JP6747C6.cjs.map → chunk-KYICR6A5.cjs.map} +1 -1
- package/dist/{chunk-IU42MFMF.cjs → chunk-LFN2SMZF.cjs} +11 -11
- package/dist/{chunk-IU42MFMF.cjs.map → chunk-LFN2SMZF.cjs.map} +1 -1
- package/dist/{chunk-L65D4K32.cjs → chunk-LGDGFN52.cjs} +90 -90
- package/dist/{chunk-L65D4K32.cjs.map → chunk-LGDGFN52.cjs.map} +1 -1
- package/dist/{chunk-S2ISWAFD.cjs → chunk-MKZHVKYE.cjs} +10 -10
- package/dist/{chunk-S2ISWAFD.cjs.map → chunk-MKZHVKYE.cjs.map} +1 -1
- package/dist/{chunk-W3QIBYWZ.js → chunk-ML7NKIET.js} +13 -11
- package/dist/chunk-ML7NKIET.js.map +1 -0
- package/dist/{chunk-IYPY7RRT.js → chunk-MOHMOMS5.js} +3 -3
- package/dist/{chunk-IYPY7RRT.js.map → chunk-MOHMOMS5.js.map} +1 -1
- package/dist/{chunk-76DAOWXY.js → chunk-N5YRVVTG.js} +4 -4
- package/dist/{chunk-76DAOWXY.js.map → chunk-N5YRVVTG.js.map} +1 -1
- package/dist/{chunk-VFFD2WJ2.cjs → chunk-NWYYYXDC.cjs} +10 -10
- package/dist/{chunk-VFFD2WJ2.cjs.map → chunk-NWYYYXDC.cjs.map} +1 -1
- package/dist/{chunk-TJL5FEEQ.cjs → chunk-O7UXVT73.cjs} +11 -11
- package/dist/{chunk-TJL5FEEQ.cjs.map → chunk-O7UXVT73.cjs.map} +1 -1
- package/dist/{chunk-KXNZSC3V.js → chunk-ODXAEAXO.js} +3 -3
- package/dist/{chunk-KXNZSC3V.js.map → chunk-ODXAEAXO.js.map} +1 -1
- package/dist/{chunk-R5MN7RFP.js → chunk-OF6LR77W.js} +3 -3
- package/dist/{chunk-R5MN7RFP.js.map → chunk-OF6LR77W.js.map} +1 -1
- package/dist/{chunk-SNGY24DC.js → chunk-OGTBBK3R.js} +3 -3
- package/dist/{chunk-SNGY24DC.js.map → chunk-OGTBBK3R.js.map} +1 -1
- package/dist/{chunk-HITLRKIU.cjs → chunk-OJJHZF5H.cjs} +4 -3
- package/dist/chunk-OJJHZF5H.cjs.map +1 -0
- package/dist/{chunk-B3MLNCJO.cjs → chunk-OQEY3KWO.cjs} +11 -11
- package/dist/{chunk-B3MLNCJO.cjs.map → chunk-OQEY3KWO.cjs.map} +1 -1
- package/dist/{chunk-4XI72F3Q.cjs → chunk-Q4CH5CG5.cjs} +8 -7
- package/dist/chunk-Q4CH5CG5.cjs.map +1 -0
- package/dist/{chunk-YDO5OPEU.cjs → chunk-Q7GNNLCY.cjs} +771 -8
- package/dist/chunk-Q7GNNLCY.cjs.map +1 -0
- package/dist/{chunk-EAJ2SSAY.cjs → chunk-Q7PFA6JM.cjs} +11 -11
- package/dist/{chunk-EAJ2SSAY.cjs.map → chunk-Q7PFA6JM.cjs.map} +1 -1
- package/dist/{chunk-VTPTMQFA.cjs → chunk-QMLUHYFO.cjs} +9 -2
- package/dist/chunk-QMLUHYFO.cjs.map +1 -0
- package/dist/{chunk-J3GI6BPX.js → chunk-RDUHVLT4.js} +258 -24
- package/dist/chunk-RDUHVLT4.js.map +1 -0
- package/dist/{chunk-UAINGDV5.cjs → chunk-RT6WIKLL.cjs} +6 -6
- package/dist/{chunk-UAINGDV5.cjs.map → chunk-RT6WIKLL.cjs.map} +1 -1
- package/dist/{chunk-NCVXAT2D.js → chunk-SBTPQZMU.js} +3 -3
- package/dist/{chunk-NCVXAT2D.js.map → chunk-SBTPQZMU.js.map} +1 -1
- package/dist/{chunk-735PUE35.cjs → chunk-SPDINGZM.cjs} +144 -142
- package/dist/chunk-SPDINGZM.cjs.map +1 -0
- package/dist/{chunk-RK2JEDNO.cjs → chunk-U4Y53V3G.cjs} +6 -6
- package/dist/{chunk-RK2JEDNO.cjs.map → chunk-U4Y53V3G.cjs.map} +1 -1
- package/dist/{chunk-7X4P2I6L.js → chunk-VQN4ACS3.js} +4 -3
- package/dist/chunk-VQN4ACS3.js.map +1 -0
- package/dist/{chunk-PRQGENYS.js → chunk-VXTJHEII.js} +5 -4
- package/dist/chunk-VXTJHEII.js.map +1 -0
- package/dist/{chunk-2KXVGOQU.cjs → chunk-W7BV2TAX.cjs} +4 -4
- package/dist/{chunk-2KXVGOQU.cjs.map → chunk-W7BV2TAX.cjs.map} +1 -1
- package/dist/{chunk-YCK3UBA3.cjs → chunk-WSGJLHWY.cjs} +28 -28
- package/dist/{chunk-YCK3UBA3.cjs.map → chunk-WSGJLHWY.cjs.map} +1 -1
- package/dist/{chunk-JCK52DK6.cjs → chunk-X5FUTLPK.cjs} +11 -11
- package/dist/{chunk-JCK52DK6.cjs.map → chunk-X5FUTLPK.cjs.map} +1 -1
- package/dist/{chunk-TG3SW2HK.js → chunk-XAQCI45V.js} +3 -3
- package/dist/{chunk-TG3SW2HK.js.map → chunk-XAQCI45V.js.map} +1 -1
- package/dist/{chunk-NQOGRE2Z.js → chunk-XMDO6GS2.js} +4 -4
- package/dist/{chunk-NQOGRE2Z.js.map → chunk-XMDO6GS2.js.map} +1 -1
- package/dist/{chunk-KFG2APPS.js → chunk-Z37657V7.js} +4 -4
- package/dist/{chunk-KFG2APPS.js.map → chunk-Z37657V7.js.map} +1 -1
- package/dist/{chunk-ZDCTQJFB.js → chunk-Z73DMS63.js} +3 -3
- package/dist/{chunk-ZDCTQJFB.js.map → chunk-Z73DMS63.js.map} +1 -1
- package/dist/{chunk-XALSGFDK.js → chunk-ZZJCYUVX.js} +3 -3
- package/dist/{chunk-XALSGFDK.js.map → chunk-ZZJCYUVX.js.map} +1 -1
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/{observational-memory-4TDIBXK6-LKQTCHRF.cjs → observational-memory-IL63MWVI-BXE2YSBH.cjs} +26 -26
- package/dist/{observational-memory-4TDIBXK6-LKQTCHRF.cjs.map → observational-memory-IL63MWVI-BXE2YSBH.cjs.map} +1 -1
- package/dist/{observational-memory-4TDIBXK6-H3GGM2SP.js → observational-memory-IL63MWVI-HW7Y2NCD.js} +3 -3
- package/dist/{observational-memory-4TDIBXK6-H3GGM2SP.js.map → observational-memory-IL63MWVI-HW7Y2NCD.js.map} +1 -1
- package/dist/{probe-image-size-7HF7Q24F.cjs → probe-image-size-H2PYJKCK.cjs} +113 -12
- package/dist/probe-image-size-H2PYJKCK.cjs.map +1 -0
- package/dist/{probe-image-size-M5NYSF5D.js → probe-image-size-QWKVSEOF.js} +113 -12
- package/dist/probe-image-size-QWKVSEOF.js.map +1 -0
- package/dist/server/handlers/a2a.cjs +9 -9
- package/dist/server/handlers/a2a.js +1 -1
- package/dist/server/handlers/agent-builder.cjs +16 -16
- package/dist/server/handlers/agent-builder.d.ts +6 -0
- package/dist/server/handlers/agent-builder.d.ts.map +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/agent-versions.cjs +8 -8
- package/dist/server/handlers/agent-versions.js +1 -1
- package/dist/server/handlers/agents.cjs +35 -35
- package/dist/server/handlers/agents.d.ts +200 -0
- package/dist/server/handlers/agents.d.ts.map +1 -1
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/auth.cjs +11 -11
- package/dist/server/handlers/auth.js +1 -1
- package/dist/server/handlers/background-tasks.cjs +4 -4
- package/dist/server/handlers/background-tasks.js +1 -1
- package/dist/server/handlers/conversations.cjs +5 -5
- package/dist/server/handlers/conversations.js +1 -1
- package/dist/server/handlers/datasets.cjs +26 -26
- package/dist/server/handlers/datasets.d.ts +20 -0
- package/dist/server/handlers/datasets.d.ts.map +1 -1
- package/dist/server/handlers/datasets.js +1 -1
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/mcp-client-versions.cjs +8 -8
- package/dist/server/handlers/mcp-client-versions.js +1 -1
- package/dist/server/handlers/mcp.cjs +9 -9
- package/dist/server/handlers/mcp.js +1 -1
- package/dist/server/handlers/memory.cjs +27 -27
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +27 -27
- package/dist/server/handlers/observability-new-endpoints.js +1 -1
- package/dist/server/handlers/observability.cjs +33 -33
- package/dist/server/handlers/observability.js +2 -2
- package/dist/server/handlers/processor-providers.cjs +3 -3
- package/dist/server/handlers/processor-providers.js +1 -1
- package/dist/server/handlers/processors.cjs +4 -4
- package/dist/server/handlers/processors.d.ts.map +1 -1
- package/dist/server/handlers/processors.js +1 -1
- package/dist/server/handlers/prompt-block-versions.cjs +8 -8
- package/dist/server/handlers/prompt-block-versions.js +1 -1
- package/dist/server/handlers/responses.cjs +4 -4
- package/dist/server/handlers/responses.js +1 -1
- package/dist/server/handlers/scorer-versions.cjs +8 -8
- package/dist/server/handlers/scorer-versions.js +1 -1
- package/dist/server/handlers/scores.cjs +7 -7
- package/dist/server/handlers/scores.js +1 -1
- package/dist/server/handlers/stored-agents.cjs +7 -7
- package/dist/server/handlers/stored-agents.js +1 -1
- package/dist/server/handlers/stored-mcp-clients.cjs +6 -6
- package/dist/server/handlers/stored-mcp-clients.js +1 -1
- package/dist/server/handlers/stored-prompt-blocks.cjs +6 -6
- package/dist/server/handlers/stored-prompt-blocks.js +1 -1
- package/dist/server/handlers/stored-scorers.cjs +6 -6
- package/dist/server/handlers/stored-scorers.js +1 -1
- package/dist/server/handlers/stored-skills.cjs +7 -7
- package/dist/server/handlers/stored-skills.js +1 -1
- package/dist/server/handlers/stored-workspaces.cjs +6 -6
- package/dist/server/handlers/stored-workspaces.js +1 -1
- package/dist/server/handlers/system.cjs +2 -2
- package/dist/server/handlers/system.js +1 -1
- package/dist/server/handlers/tool-providers.cjs +5 -5
- package/dist/server/handlers/tool-providers.js +1 -1
- package/dist/server/handlers/tools.cjs +6 -6
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/vector.cjs +16 -16
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -8
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +24 -24
- package/dist/server/handlers/workflows.d.ts +6 -0
- package/dist/server/handlers/workflows.d.ts.map +1 -1
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers/workspace.cjs +26 -26
- package/dist/server/handlers/workspace.js +1 -1
- package/dist/server/handlers.cjs +30 -30
- package/dist/server/handlers.js +15 -15
- package/dist/server/schemas/agent-builder.d.ts +1 -0
- package/dist/server/schemas/agent-builder.d.ts.map +1 -1
- package/dist/server/schemas/agents.d.ts +20 -0
- package/dist/server/schemas/agents.d.ts.map +1 -1
- package/dist/server/schemas/datasets.d.ts +10 -0
- package/dist/server/schemas/datasets.d.ts.map +1 -1
- package/dist/server/schemas/index.cjs +101 -101
- package/dist/server/schemas/index.js +4 -4
- package/dist/server/schemas/workflows.d.ts +1 -0
- package/dist/server/schemas/workflows.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +306 -306
- package/dist/server/server-adapter/index.js +37 -37
- package/dist/server/server-adapter/openapi-utils.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/agent-builder.d.ts +6 -0
- package/dist/server/server-adapter/routes/agent-builder.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/datasets.d.ts +20 -0
- package/dist/server/server-adapter/routes/datasets.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/legacy.d.ts +40 -0
- package/dist/server/server-adapter/routes/legacy.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/workflows.d.ts +6 -0
- package/dist/server/server-adapter/routes/workflows.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-2HPMUAMW.js.map +0 -1
- package/dist/chunk-4XI72F3Q.cjs.map +0 -1
- package/dist/chunk-735PUE35.cjs.map +0 -1
- package/dist/chunk-7DC3GFTS.cjs.map +0 -1
- package/dist/chunk-7X4P2I6L.js.map +0 -1
- package/dist/chunk-B2NLS3NT.js.map +0 -1
- package/dist/chunk-HITLRKIU.cjs.map +0 -1
- package/dist/chunk-HOGOJPGP.js.map +0 -1
- package/dist/chunk-J3GI6BPX.js.map +0 -1
- package/dist/chunk-KEYTQRMZ.cjs.map +0 -1
- package/dist/chunk-KSHYQV6C.js.map +0 -1
- package/dist/chunk-PNMZ2R5P.cjs.map +0 -1
- package/dist/chunk-PRQGENYS.js.map +0 -1
- package/dist/chunk-UKMRQ6ER.cjs.map +0 -1
- package/dist/chunk-V7EVEI4C.js.map +0 -1
- package/dist/chunk-VTPTMQFA.cjs.map +0 -1
- package/dist/chunk-W3QIBYWZ.js.map +0 -1
- package/dist/chunk-YDO5OPEU.cjs.map +0 -1
- package/dist/probe-image-size-7HF7Q24F.cjs.map +0 -1
- package/dist/probe-image-size-M5NYSF5D.js.map +0 -1
|
@@ -1040,7 +1040,7 @@ function imageSize(input) {
|
|
|
1040
1040
|
throw new TypeError(`unsupported file type: ${type}`);
|
|
1041
1041
|
}
|
|
1042
1042
|
|
|
1043
|
-
// ../memory/dist/chunk-
|
|
1043
|
+
// ../memory/dist/chunk-25XLVCFF.js
|
|
1044
1044
|
var OM_DEBUG_LOG = process.env.OM_DEBUG ? join(process.cwd(), "om-debug.log") : null;
|
|
1045
1045
|
function omDebug(msg) {
|
|
1046
1046
|
if (!OM_DEBUG_LOG) return;
|
|
@@ -1223,6 +1223,17 @@ var BufferingCoordinator = class _BufferingCoordinator {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
};
|
|
1226
|
+
function didProviderChange(actorModel, lastModel) {
|
|
1227
|
+
if (actorModel === void 0 || lastModel === void 0) return false;
|
|
1228
|
+
const actorHasSlash = actorModel.includes("/");
|
|
1229
|
+
const lastHasSlash = lastModel.includes("/");
|
|
1230
|
+
if (actorHasSlash && lastHasSlash) {
|
|
1231
|
+
return actorModel !== lastModel;
|
|
1232
|
+
}
|
|
1233
|
+
const actorModelId = actorHasSlash ? actorModel.slice(actorModel.indexOf("/") + 1) : actorModel;
|
|
1234
|
+
const lastModelId = lastHasSlash ? lastModel.slice(lastModel.indexOf("/") + 1) : lastModel;
|
|
1235
|
+
return actorModelId !== lastModelId;
|
|
1236
|
+
}
|
|
1226
1237
|
function formatRelativeTime(date, currentDate) {
|
|
1227
1238
|
const diffMs = currentDate.getTime() - date.getTime();
|
|
1228
1239
|
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
@@ -1503,7 +1514,12 @@ function createActivationMarker(params) {
|
|
|
1503
1514
|
threadId: params.threadId,
|
|
1504
1515
|
generationCount: params.generationCount,
|
|
1505
1516
|
config: params.config,
|
|
1506
|
-
observations: params.observations
|
|
1517
|
+
observations: params.observations,
|
|
1518
|
+
triggeredBy: params.triggeredBy,
|
|
1519
|
+
lastActivityAt: params.lastActivityAt,
|
|
1520
|
+
ttlExpiredMs: params.ttlExpiredMs,
|
|
1521
|
+
previousModel: params.previousModel,
|
|
1522
|
+
currentModel: params.currentModel
|
|
1507
1523
|
}
|
|
1508
1524
|
};
|
|
1509
1525
|
}
|
|
@@ -1651,7 +1667,7 @@ function sortThreadsByOldestMessage(messagesByThread) {
|
|
|
1651
1667
|
})).sort((a, b) => a.oldestTimestamp - b.oldestTimestamp).map((t2) => t2.threadId);
|
|
1652
1668
|
}
|
|
1653
1669
|
function stripThreadTags(observations) {
|
|
1654
|
-
return observations.replace(
|
|
1670
|
+
return observations.replace(/<\/?thread\b[^>]{0,1024}>/gi, "").trim();
|
|
1655
1671
|
}
|
|
1656
1672
|
function isTieredModelTarget(model) {
|
|
1657
1673
|
if (typeof model === "string") {
|
|
@@ -2988,6 +3004,7 @@ var ObservationStep = class {
|
|
|
2988
3004
|
resourceId,
|
|
2989
3005
|
checkThreshold: true,
|
|
2990
3006
|
messages: step0Messages,
|
|
3007
|
+
currentModel: this.turn.actorModelContext,
|
|
2991
3008
|
writer: this.turn.writer,
|
|
2992
3009
|
messageList
|
|
2993
3010
|
});
|
|
@@ -3011,8 +3028,11 @@ var ObservationStep = class {
|
|
|
3011
3028
|
observationTokens: obsTokens,
|
|
3012
3029
|
threadId,
|
|
3013
3030
|
writer: this.turn.writer,
|
|
3031
|
+
messageList,
|
|
3032
|
+
currentModel: this.turn.actorModelContext,
|
|
3014
3033
|
requestContext: this.turn.requestContext,
|
|
3015
|
-
observabilityContext: this.turn.observabilityContext
|
|
3034
|
+
observabilityContext: this.turn.observabilityContext,
|
|
3035
|
+
lastActivityAt: getLastActivityFromMessages(messageList.get.all.db())
|
|
3016
3036
|
});
|
|
3017
3037
|
await this.turn.refreshRecord();
|
|
3018
3038
|
if (this.turn.record.generationCount > preReflectGeneration) {
|
|
@@ -3176,6 +3196,7 @@ var ObservationStep = class {
|
|
|
3176
3196
|
threadId,
|
|
3177
3197
|
resourceId,
|
|
3178
3198
|
messages: messageList.get.all.db(),
|
|
3199
|
+
currentModel: this.turn.actorModelContext,
|
|
3179
3200
|
writer: this.turn.writer,
|
|
3180
3201
|
messageList
|
|
3181
3202
|
});
|
|
@@ -3187,8 +3208,10 @@ var ObservationStep = class {
|
|
|
3187
3208
|
threadId,
|
|
3188
3209
|
writer: this.turn.writer,
|
|
3189
3210
|
messageList,
|
|
3211
|
+
currentModel: this.turn.actorModelContext,
|
|
3190
3212
|
requestContext: this.turn.requestContext,
|
|
3191
|
-
observabilityContext: this.turn.observabilityContext
|
|
3213
|
+
observabilityContext: this.turn.observabilityContext,
|
|
3214
|
+
lastActivityAt: getLastActivityFromMessages(messageList.get.all.db())
|
|
3192
3215
|
});
|
|
3193
3216
|
return {
|
|
3194
3217
|
succeeded: true,
|
|
@@ -3228,6 +3251,8 @@ var ObservationTurn = class {
|
|
|
3228
3251
|
requestContext;
|
|
3229
3252
|
/** Optional observability context for nested OM spans. */
|
|
3230
3253
|
observabilityContext;
|
|
3254
|
+
/** Current actor model for this step. Updated by the processor before prepare(). */
|
|
3255
|
+
actorModelContext;
|
|
3231
3256
|
/** Optional processor-provided hooks for turn/step lifecycle integration. */
|
|
3232
3257
|
hooks;
|
|
3233
3258
|
constructor(opts) {
|
|
@@ -5086,12 +5111,44 @@ function extractReflectorListItems(content) {
|
|
|
5086
5111
|
function validateCompression(reflectedTokens, targetThreshold) {
|
|
5087
5112
|
return reflectedTokens < targetThreshold;
|
|
5088
5113
|
}
|
|
5114
|
+
function formatModelContext(provider, modelId) {
|
|
5115
|
+
if (provider && modelId) {
|
|
5116
|
+
return `${provider}/${modelId}`;
|
|
5117
|
+
}
|
|
5118
|
+
return modelId;
|
|
5119
|
+
}
|
|
5120
|
+
function getCurrentModel(model) {
|
|
5121
|
+
return formatModelContext(model?.provider, model?.modelId);
|
|
5122
|
+
}
|
|
5123
|
+
function getLastModelFromMessageList(messageList) {
|
|
5124
|
+
const messages = messageList?.get.all.db();
|
|
5125
|
+
if (!messages) return void 0;
|
|
5126
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
5127
|
+
const message = messages[i];
|
|
5128
|
+
if (!message || message.role !== "assistant" || !message.content || typeof message.content === "string") {
|
|
5129
|
+
continue;
|
|
5130
|
+
}
|
|
5131
|
+
for (let j = message.content.parts.length - 1; j >= 0; j--) {
|
|
5132
|
+
const part = message.content.parts[j];
|
|
5133
|
+
if (part?.type === "step-start" && typeof part.model === "string" && part.model.length > 0) {
|
|
5134
|
+
return part.model;
|
|
5135
|
+
}
|
|
5136
|
+
}
|
|
5137
|
+
const metadata = message.content.metadata;
|
|
5138
|
+
const model = formatModelContext(metadata?.provider, metadata?.modelId);
|
|
5139
|
+
if (model) {
|
|
5140
|
+
return model;
|
|
5141
|
+
}
|
|
5142
|
+
}
|
|
5143
|
+
return void 0;
|
|
5144
|
+
}
|
|
5089
5145
|
async function withAbortCheck(fn, abortSignal) {
|
|
5090
5146
|
if (abortSignal?.aborted) throw new Error("The operation was aborted.");
|
|
5091
5147
|
const result = await fn();
|
|
5092
5148
|
if (abortSignal?.aborted) throw new Error("The operation was aborted.");
|
|
5093
5149
|
return result;
|
|
5094
5150
|
}
|
|
5151
|
+
var EARLY_ACTIVATION_SIZE_FLOOR_RATIO = 0.75;
|
|
5095
5152
|
var ReflectorRunner = class {
|
|
5096
5153
|
reflectionConfig;
|
|
5097
5154
|
observationConfig;
|
|
@@ -5131,7 +5188,8 @@ var ReflectorRunner = class {
|
|
|
5131
5188
|
observationTokens: getMaxThreshold(
|
|
5132
5189
|
record ? this.getEffectiveReflectionTokens(record) : this.reflectionConfig.observationTokens
|
|
5133
5190
|
),
|
|
5134
|
-
scope: this.scope
|
|
5191
|
+
scope: this.scope,
|
|
5192
|
+
activateAfterIdle: this.reflectionConfig.activateAfterIdle
|
|
5135
5193
|
};
|
|
5136
5194
|
}
|
|
5137
5195
|
/**
|
|
@@ -5415,9 +5473,11 @@ var ReflectorRunner = class {
|
|
|
5415
5473
|
}
|
|
5416
5474
|
/**
|
|
5417
5475
|
* Try to activate buffered reflection when threshold is reached.
|
|
5418
|
-
* Returns
|
|
5476
|
+
* Returns a discriminated result so the caller can distinguish between
|
|
5477
|
+
* "activated", "no buffer present", and "suppressed by overshoot guard"
|
|
5478
|
+
* without re-deriving that state.
|
|
5419
5479
|
*/
|
|
5420
|
-
async tryActivateBufferedReflection(record, lockKey, writer, messageList) {
|
|
5480
|
+
async tryActivateBufferedReflection(record, lockKey, writer, messageList, activationMetadata) {
|
|
5421
5481
|
const bufferKey = this.buffering.getReflectionBufferKey(lockKey);
|
|
5422
5482
|
const asyncOp = BufferingCoordinator.asyncBufferingOps.get(bufferKey);
|
|
5423
5483
|
if (asyncOp) {
|
|
@@ -5438,8 +5498,8 @@ var ReflectorRunner = class {
|
|
|
5438
5498
|
`[OM:reflect] tryActivateBufferedReflection: freshRecord.id=${freshRecord?.id}, freshBufferedReflection=${freshRecord?.bufferedReflection ? "present (" + freshRecord.bufferedReflection.length + " chars)" : "empty"}, freshObsTokens=${freshRecord?.observationTokenCount}`
|
|
5439
5499
|
);
|
|
5440
5500
|
if (!freshRecord?.bufferedReflection) {
|
|
5441
|
-
omDebug(`[OM:reflect] tryActivateBufferedReflection: no buffered reflection after re-fetch
|
|
5442
|
-
return
|
|
5501
|
+
omDebug(`[OM:reflect] tryActivateBufferedReflection: no buffered reflection after re-fetch`);
|
|
5502
|
+
return { status: "no-buffer" };
|
|
5443
5503
|
}
|
|
5444
5504
|
const beforeTokens = freshRecord.observationTokenCount ?? 0;
|
|
5445
5505
|
const reflectedLineCount = freshRecord.reflectedObservationLineCount ?? 0;
|
|
@@ -5451,6 +5511,26 @@ var ReflectorRunner = class {
|
|
|
5451
5511
|
|
|
5452
5512
|
${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
5453
5513
|
const combinedTokenCount = this.tokenCounter.countObservations(combinedObservations);
|
|
5514
|
+
if (activationMetadata?.triggeredBy === "ttl" || activationMetadata?.triggeredBy === "provider_change") {
|
|
5515
|
+
const unreflectedTailTokens = unreflectedContent ? this.tokenCounter.countObservations(unreflectedContent) : 0;
|
|
5516
|
+
const bufferedReflectionTokens = freshRecord.bufferedReflectionTokens ?? 0;
|
|
5517
|
+
if (unreflectedTailTokens < bufferedReflectionTokens) {
|
|
5518
|
+
omDebug(
|
|
5519
|
+
`[OM:reflect] tryActivateBufferedReflection: suppressing early ${activationMetadata.triggeredBy} activation \u2014 unreflectedTailTokens=${unreflectedTailTokens} < bufferedReflectionTokens=${bufferedReflectionTokens}; keeping buffer for threshold activation`
|
|
5520
|
+
);
|
|
5521
|
+
return { status: "suppressed", reason: "composition" };
|
|
5522
|
+
}
|
|
5523
|
+
const bufferActivation = this.reflectionConfig.bufferActivation;
|
|
5524
|
+
const reflectThreshold = getMaxThreshold(this.getEffectiveReflectionTokens(freshRecord));
|
|
5525
|
+
const regularActivationTarget = reflectThreshold * (1 - bufferActivation);
|
|
5526
|
+
const minCombinedTokens = Math.round(regularActivationTarget * EARLY_ACTIVATION_SIZE_FLOOR_RATIO);
|
|
5527
|
+
if (combinedTokenCount < minCombinedTokens) {
|
|
5528
|
+
omDebug(
|
|
5529
|
+
`[OM:reflect] tryActivateBufferedReflection: suppressing early ${activationMetadata.triggeredBy} activation \u2014 combinedTokenCount=${combinedTokenCount} < minCombinedTokens=${minCombinedTokens} (${EARLY_ACTIVATION_SIZE_FLOOR_RATIO * 100}% of regular activation target ${Math.round(regularActivationTarget)}, threshold=${reflectThreshold}, bufferActivation=${bufferActivation}); keeping buffer for threshold activation`
|
|
5530
|
+
);
|
|
5531
|
+
return { status: "suppressed", reason: "size" };
|
|
5532
|
+
}
|
|
5533
|
+
}
|
|
5454
5534
|
omDebug(
|
|
5455
5535
|
`[OM:reflect] tryActivateBufferedReflection: activating, beforeTokens=${beforeTokens}, combinedTokenCount=${combinedTokenCount}, reflectedLineCount=${reflectedLineCount}, unreflectedLines=${unreflectedLines.length}`
|
|
5456
5536
|
);
|
|
@@ -5477,6 +5557,11 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5477
5557
|
threadId: freshRecord.threadId ?? "",
|
|
5478
5558
|
generationCount: afterRecord?.generationCount ?? freshRecord.generationCount ?? 0,
|
|
5479
5559
|
observations: afterRecord?.activeObservations,
|
|
5560
|
+
triggeredBy: activationMetadata?.triggeredBy,
|
|
5561
|
+
lastActivityAt: activationMetadata?.lastActivityAt,
|
|
5562
|
+
ttlExpiredMs: activationMetadata?.ttlExpiredMs,
|
|
5563
|
+
previousModel: activationMetadata?.previousModel,
|
|
5564
|
+
currentModel: activationMetadata?.currentModel,
|
|
5480
5565
|
config: this.getObservationMarkerConfig(freshRecord)
|
|
5481
5566
|
});
|
|
5482
5567
|
void writer.custom(activationMarker).catch(() => {
|
|
@@ -5489,7 +5574,7 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5489
5574
|
);
|
|
5490
5575
|
}
|
|
5491
5576
|
BufferingCoordinator.reflectionBufferCycleIds.delete(bufferKey);
|
|
5492
|
-
return
|
|
5577
|
+
return { status: "activated" };
|
|
5493
5578
|
}
|
|
5494
5579
|
/**
|
|
5495
5580
|
* Check if reflection needed and trigger if so.
|
|
@@ -5503,9 +5588,12 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5503
5588
|
writer,
|
|
5504
5589
|
abortSignal,
|
|
5505
5590
|
messageList,
|
|
5591
|
+
currentModel,
|
|
5506
5592
|
reflectionHooks,
|
|
5507
5593
|
requestContext,
|
|
5508
|
-
observabilityContext
|
|
5594
|
+
observabilityContext,
|
|
5595
|
+
lastActivityAt,
|
|
5596
|
+
threadId: requestedThreadId
|
|
5509
5597
|
} = opts;
|
|
5510
5598
|
const lockKey = this.buffering.getLockKey(record.threadId, record.resourceId);
|
|
5511
5599
|
const reflectThreshold = getMaxThreshold(this.getEffectiveReflectionTokens(record));
|
|
@@ -5537,9 +5625,23 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5537
5625
|
);
|
|
5538
5626
|
}
|
|
5539
5627
|
}
|
|
5540
|
-
|
|
5628
|
+
const activateAfterIdle = this.reflectionConfig.activateAfterIdle;
|
|
5629
|
+
const ttlExpiredMs = activateAfterIdle !== void 0 && lastActivityAt !== void 0 ? Date.now() - lastActivityAt : void 0;
|
|
5630
|
+
const ttlExpired = ttlExpiredMs !== void 0 && activateAfterIdle !== void 0 && ttlExpiredMs >= activateAfterIdle;
|
|
5631
|
+
const actorModel = getCurrentModel(currentModel);
|
|
5632
|
+
const lastModel = getLastModelFromMessageList(messageList);
|
|
5633
|
+
const providerChanged = this.reflectionConfig.activateOnProviderChange === true && didProviderChange(actorModel, lastModel);
|
|
5634
|
+
if (observationTokens < reflectThreshold && !ttlExpired && !providerChanged) {
|
|
5541
5635
|
return;
|
|
5542
5636
|
}
|
|
5637
|
+
const activationTriggeredBy = observationTokens >= reflectThreshold ? "threshold" : providerChanged ? "provider_change" : "ttl";
|
|
5638
|
+
const activationMetadata = {
|
|
5639
|
+
triggeredBy: activationTriggeredBy,
|
|
5640
|
+
lastActivityAt: activationTriggeredBy === "ttl" ? lastActivityAt : void 0,
|
|
5641
|
+
ttlExpiredMs: activationTriggeredBy === "ttl" ? ttlExpiredMs : void 0,
|
|
5642
|
+
previousModel: activationTriggeredBy === "provider_change" ? lastModel : void 0,
|
|
5643
|
+
currentModel: activationTriggeredBy === "provider_change" ? actorModel : void 0
|
|
5644
|
+
};
|
|
5543
5645
|
if (record.isReflecting) {
|
|
5544
5646
|
if (isOpActiveInProcess(record.id, "reflecting")) {
|
|
5545
5647
|
omDebug(`[OM:reflect] isReflecting=true and active in this process, skipping`);
|
|
@@ -5549,8 +5651,20 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5549
5651
|
await this.storage.setReflectingFlag(record.id, false);
|
|
5550
5652
|
}
|
|
5551
5653
|
if (this.buffering.isAsyncReflectionEnabled()) {
|
|
5552
|
-
const
|
|
5553
|
-
|
|
5654
|
+
const activationResult = await this.tryActivateBufferedReflection(
|
|
5655
|
+
record,
|
|
5656
|
+
lockKey,
|
|
5657
|
+
writer,
|
|
5658
|
+
messageList,
|
|
5659
|
+
activationMetadata
|
|
5660
|
+
);
|
|
5661
|
+
if (activationResult.status === "activated") {
|
|
5662
|
+
return;
|
|
5663
|
+
}
|
|
5664
|
+
if (activationResult.status === "suppressed") {
|
|
5665
|
+
omDebug(
|
|
5666
|
+
`[OM:reflect] skipping sync fallback / re-buffer after suppressed early ${activationMetadata.triggeredBy} activation (reason=${activationResult.reason})`
|
|
5667
|
+
);
|
|
5554
5668
|
return;
|
|
5555
5669
|
}
|
|
5556
5670
|
if (this.reflectionConfig.blockAfter && observationTokens >= this.reflectionConfig.blockAfter) {
|
|
@@ -5578,7 +5692,7 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5578
5692
|
registerOp(record.id, "reflecting");
|
|
5579
5693
|
const cycleId = crypto.randomUUID();
|
|
5580
5694
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5581
|
-
const threadId =
|
|
5695
|
+
const threadId = requestedThreadId ?? "unknown";
|
|
5582
5696
|
if (writer) {
|
|
5583
5697
|
const startMarker = createObservationStartMarker({
|
|
5584
5698
|
cycleId,
|
|
@@ -6294,7 +6408,7 @@ async function resolveImageDimensionsAsync(part) {
|
|
|
6294
6408
|
return existing;
|
|
6295
6409
|
}
|
|
6296
6410
|
try {
|
|
6297
|
-
const mod = await import('./probe-image-size-
|
|
6411
|
+
const mod = await import('./probe-image-size-QWKVSEOF.js');
|
|
6298
6412
|
const probeImageSize = mod.default;
|
|
6299
6413
|
const probed = await probeImageSize(url, {
|
|
6300
6414
|
open_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
|
|
@@ -7226,6 +7340,88 @@ function buildMessageRange(messages) {
|
|
|
7226
7340
|
const last = [...messages].reverse().find(messageHasVisibleContent) ?? messages[messages.length - 1];
|
|
7227
7341
|
return `${first.id}:${last.id}`;
|
|
7228
7342
|
}
|
|
7343
|
+
function getLastActivityFromMessages(messages) {
|
|
7344
|
+
if (!messages) return void 0;
|
|
7345
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
7346
|
+
const message = messages[i];
|
|
7347
|
+
if (!message || message.role !== "assistant") {
|
|
7348
|
+
continue;
|
|
7349
|
+
}
|
|
7350
|
+
if (!message.content || typeof message.content === "string") {
|
|
7351
|
+
return message.createdAt ? new Date(message.createdAt).getTime() : void 0;
|
|
7352
|
+
}
|
|
7353
|
+
for (let j = message.content.parts.length - 1; j >= 0; j--) {
|
|
7354
|
+
const part = message.content.parts[j];
|
|
7355
|
+
if (!part || part.type?.startsWith("data-")) {
|
|
7356
|
+
continue;
|
|
7357
|
+
}
|
|
7358
|
+
if (part.createdAt !== void 0) {
|
|
7359
|
+
return part.createdAt;
|
|
7360
|
+
}
|
|
7361
|
+
}
|
|
7362
|
+
return message.createdAt ? new Date(message.createdAt).getTime() : void 0;
|
|
7363
|
+
}
|
|
7364
|
+
return void 0;
|
|
7365
|
+
}
|
|
7366
|
+
function formatModelContext2(provider, modelId) {
|
|
7367
|
+
if (provider && modelId) {
|
|
7368
|
+
return `${provider}/${modelId}`;
|
|
7369
|
+
}
|
|
7370
|
+
return modelId;
|
|
7371
|
+
}
|
|
7372
|
+
function getLastModelFromMessages(messages) {
|
|
7373
|
+
if (!messages) return void 0;
|
|
7374
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
7375
|
+
const message = messages[i];
|
|
7376
|
+
if (!message || message.role !== "assistant" || !message.content || typeof message.content === "string") {
|
|
7377
|
+
continue;
|
|
7378
|
+
}
|
|
7379
|
+
for (let j = message.content.parts.length - 1; j >= 0; j--) {
|
|
7380
|
+
const part = message.content.parts[j];
|
|
7381
|
+
if (part?.type === "step-start" && typeof part.model === "string" && part.model.length > 0) {
|
|
7382
|
+
return part.model;
|
|
7383
|
+
}
|
|
7384
|
+
}
|
|
7385
|
+
const metadata = message.content.metadata;
|
|
7386
|
+
const model = formatModelContext2(metadata?.provider, metadata?.modelId);
|
|
7387
|
+
if (model) {
|
|
7388
|
+
return model;
|
|
7389
|
+
}
|
|
7390
|
+
}
|
|
7391
|
+
return void 0;
|
|
7392
|
+
}
|
|
7393
|
+
function getCurrentModel2(model) {
|
|
7394
|
+
return formatModelContext2(model?.provider, model?.modelId);
|
|
7395
|
+
}
|
|
7396
|
+
function parseActivationTTL(value, fieldPath) {
|
|
7397
|
+
if (value === void 0) {
|
|
7398
|
+
return void 0;
|
|
7399
|
+
}
|
|
7400
|
+
if (typeof value === "number") {
|
|
7401
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
7402
|
+
throw new Error(`${fieldPath} must be a non-negative number of milliseconds or a duration string like "5m".`);
|
|
7403
|
+
}
|
|
7404
|
+
return value;
|
|
7405
|
+
}
|
|
7406
|
+
const trimmed = value.trim();
|
|
7407
|
+
const match = trimmed.match(
|
|
7408
|
+
/^(\d+(?:\.\d+)?)\s*(ms|msec|msecs|millisecond|milliseconds|s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours)$/i
|
|
7409
|
+
);
|
|
7410
|
+
if (!match) {
|
|
7411
|
+
throw new Error(
|
|
7412
|
+
`${fieldPath} must be a non-negative number of milliseconds or a duration string like "5m" or "1hr".`
|
|
7413
|
+
);
|
|
7414
|
+
}
|
|
7415
|
+
const rawAmount = match[1];
|
|
7416
|
+
const rawUnit = match[2];
|
|
7417
|
+
const amount = Number(rawAmount);
|
|
7418
|
+
const unit = rawUnit.toLowerCase();
|
|
7419
|
+
if (!Number.isFinite(amount) || amount < 0) {
|
|
7420
|
+
throw new Error(`${fieldPath} must be a non-negative number of milliseconds or a duration string like "5m".`);
|
|
7421
|
+
}
|
|
7422
|
+
const multiplier = unit === "ms" || unit === "msec" || unit === "msecs" || unit === "millisecond" || unit === "milliseconds" ? 1 : unit === "s" || unit === "sec" || unit === "secs" || unit === "second" || unit === "seconds" ? 1e3 : unit === "m" || unit === "min" || unit === "mins" || unit === "minute" || unit === "minutes" ? 6e4 : 36e5;
|
|
7423
|
+
return amount * multiplier;
|
|
7424
|
+
}
|
|
7229
7425
|
var ObservationalMemory = class _ObservationalMemory {
|
|
7230
7426
|
storage;
|
|
7231
7427
|
tokenCounter;
|
|
@@ -7372,6 +7568,8 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
|
|
|
7372
7568
|
config.observation?.messageTokens ?? OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
|
|
7373
7569
|
),
|
|
7374
7570
|
bufferActivation: asyncBufferingDisabled ? void 0 : config.observation?.bufferActivation ?? OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferActivation,
|
|
7571
|
+
activateAfterIdle: parseActivationTTL(config.activateAfterIdle, "activateAfterIdle"),
|
|
7572
|
+
activateOnProviderChange: config.activateOnProviderChange ?? false,
|
|
7375
7573
|
blockAfter: asyncBufferingDisabled ? void 0 : resolveBlockAfter(
|
|
7376
7574
|
config.observation?.blockAfter ?? (config.observation?.bufferTokens ?? OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferTokens ? 1.2 : void 0),
|
|
7377
7575
|
config.observation?.messageTokens ?? OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
|
|
@@ -7390,6 +7588,8 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
|
|
|
7390
7588
|
},
|
|
7391
7589
|
providerOptions: config.reflection?.providerOptions ?? OBSERVATIONAL_MEMORY_DEFAULTS.reflection.providerOptions,
|
|
7392
7590
|
bufferActivation: asyncBufferingDisabled ? void 0 : config?.reflection?.bufferActivation ?? OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation,
|
|
7591
|
+
activateAfterIdle: parseActivationTTL(config.activateAfterIdle, "activateAfterIdle"),
|
|
7592
|
+
activateOnProviderChange: config.activateOnProviderChange ?? false,
|
|
7393
7593
|
blockAfter: asyncBufferingDisabled ? void 0 : resolveBlockAfter(
|
|
7394
7594
|
config.reflection?.blockAfter ?? (config.reflection?.bufferActivation ?? OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation ? 1.2 : void 0),
|
|
7395
7595
|
config.reflection?.observationTokens ?? OBSERVATIONAL_MEMORY_DEFAULTS.reflection.observationTokens
|
|
@@ -7784,7 +7984,8 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
|
|
|
7784
7984
|
return {
|
|
7785
7985
|
messageTokens: getMaxThreshold(this.observationConfig.messageTokens),
|
|
7786
7986
|
observationTokens: getMaxThreshold(this.reflectionConfig.observationTokens),
|
|
7787
|
-
scope: this.scope
|
|
7987
|
+
scope: this.scope,
|
|
7988
|
+
activateAfterIdle: this.observationConfig.activateAfterIdle
|
|
7788
7989
|
};
|
|
7789
7990
|
}
|
|
7790
7991
|
/**
|
|
@@ -9022,7 +9223,7 @@ ${grouped}` : grouped;
|
|
|
9022
9223
|
await BufferingCoordinator.awaitBuffering(threadId, resourceId ?? null, this.scope);
|
|
9023
9224
|
const preStatus = await this.getStatus({ threadId, resourceId, messages });
|
|
9024
9225
|
if (preStatus.canActivate) {
|
|
9025
|
-
const actResult = await this.activate({ threadId, resourceId });
|
|
9226
|
+
const actResult = await this.activate({ threadId, resourceId, messages });
|
|
9026
9227
|
activated = actResult.activated;
|
|
9027
9228
|
}
|
|
9028
9229
|
const postStatus = await this.getStatus({ threadId, resourceId, messages });
|
|
@@ -9282,10 +9483,37 @@ ${grouped}` : grouped;
|
|
|
9282
9483
|
if (!chunks.length) {
|
|
9283
9484
|
return { activated: false, record };
|
|
9284
9485
|
}
|
|
9486
|
+
let activationTriggeredBy = "threshold";
|
|
9487
|
+
let activationLastActivityAt;
|
|
9488
|
+
let activateAfterIdleExpiredMs;
|
|
9489
|
+
let previousModel;
|
|
9490
|
+
let currentModel;
|
|
9285
9491
|
if (opts.checkThreshold) {
|
|
9286
|
-
const
|
|
9287
|
-
|
|
9288
|
-
|
|
9492
|
+
const thresholdMessages = opts.messages ?? await this.loadMessagesFromStorage(
|
|
9493
|
+
threadId,
|
|
9494
|
+
resourceId,
|
|
9495
|
+
record.lastObservedAt ? new Date(record.lastObservedAt) : void 0
|
|
9496
|
+
);
|
|
9497
|
+
const activateAfterIdle = this.observationConfig.activateAfterIdle;
|
|
9498
|
+
const lastActivityAt = getLastActivityFromMessages(thresholdMessages);
|
|
9499
|
+
const ttlExpiredMs = activateAfterIdle !== void 0 && lastActivityAt !== void 0 ? Date.now() - lastActivityAt : void 0;
|
|
9500
|
+
const ttlExpired = ttlExpiredMs !== void 0 && activateAfterIdle !== void 0 && ttlExpiredMs >= activateAfterIdle;
|
|
9501
|
+
const actorModel = getCurrentModel2(opts.currentModel);
|
|
9502
|
+
const lastModel = getLastModelFromMessages(thresholdMessages);
|
|
9503
|
+
const providerChanged = this.observationConfig.activateOnProviderChange === true && didProviderChange(actorModel, lastModel);
|
|
9504
|
+
if (providerChanged) {
|
|
9505
|
+
activationTriggeredBy = "provider_change";
|
|
9506
|
+
previousModel = lastModel;
|
|
9507
|
+
currentModel = actorModel;
|
|
9508
|
+
} else if (ttlExpired) {
|
|
9509
|
+
activationTriggeredBy = "ttl";
|
|
9510
|
+
activationLastActivityAt = lastActivityAt;
|
|
9511
|
+
activateAfterIdleExpiredMs = ttlExpiredMs;
|
|
9512
|
+
} else {
|
|
9513
|
+
const status = await this.getStatus({ threadId, resourceId, messages: thresholdMessages });
|
|
9514
|
+
if (status.pendingTokens < status.threshold) {
|
|
9515
|
+
return { activated: false, record };
|
|
9516
|
+
}
|
|
9289
9517
|
}
|
|
9290
9518
|
}
|
|
9291
9519
|
if (record.isBufferingObservation) {
|
|
@@ -9343,6 +9571,11 @@ ${grouped}` : grouped;
|
|
|
9343
9571
|
threadId: postSwapRecord.threadId ?? record.threadId ?? "",
|
|
9344
9572
|
generationCount: postSwapRecord.generationCount ?? 0,
|
|
9345
9573
|
observations: chunkData?.observations ?? activationResult.observations,
|
|
9574
|
+
triggeredBy: activationTriggeredBy,
|
|
9575
|
+
lastActivityAt: activationLastActivityAt,
|
|
9576
|
+
ttlExpiredMs: activateAfterIdleExpiredMs,
|
|
9577
|
+
previousModel,
|
|
9578
|
+
currentModel,
|
|
9346
9579
|
config: this.getObservationMarkerConfig()
|
|
9347
9580
|
});
|
|
9348
9581
|
void opts.writer.custom(activationMarker).catch(() => {
|
|
@@ -9700,6 +9933,7 @@ var ObservationalMemoryProcessor = class {
|
|
|
9700
9933
|
const observabilityContext = getOmObservabilityContext(args);
|
|
9701
9934
|
state.__omObservabilityContext = observabilityContext;
|
|
9702
9935
|
this.turn.observabilityContext = observabilityContext;
|
|
9936
|
+
this.turn.actorModelContext = actorModelContext;
|
|
9703
9937
|
{
|
|
9704
9938
|
const step = this.turn.step(stepNumber);
|
|
9705
9939
|
let ctx;
|
|
@@ -9831,5 +10065,5 @@ function getObservationsAsOf(activeObservations, asOf) {
|
|
|
9831
10065
|
}
|
|
9832
10066
|
|
|
9833
10067
|
export { ModelByInputTokens, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, ObservationalMemoryProcessor, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, combineObservationGroupRanges, deriveObservationGroupProvenance, e, estimateTokenCount, extractCurrentTask, formatMessagesForObserver, formatToolResultForObserver, getObservationsAsOf, hasCurrentTaskSection, injectAnchorIds, optimizeObservationsForContext, parseAnchorId, parseObservationGroups, parseObserverOutput, reconcileObservationGroupsFromReflection, renderObservationGroupsForReflection, resolveToolResultValue, stripEphemeralAnchorIds, stripObservationGroups, truncateStringByTokens, wrapInObservationGroup };
|
|
9834
|
-
//# sourceMappingURL=chunk-
|
|
9835
|
-
//# sourceMappingURL=chunk-
|
|
10068
|
+
//# sourceMappingURL=chunk-RDUHVLT4.js.map
|
|
10069
|
+
//# sourceMappingURL=chunk-RDUHVLT4.js.map
|