@mastra/server 1.25.1-alpha.1 → 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 +83 -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 +5 -5
- 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
|
@@ -1042,7 +1042,7 @@ function imageSize(input) {
|
|
|
1042
1042
|
throw new TypeError(`unsupported file type: ${type}`);
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
|
-
// ../memory/dist/chunk-
|
|
1045
|
+
// ../memory/dist/chunk-25XLVCFF.js
|
|
1046
1046
|
var OM_DEBUG_LOG = process.env.OM_DEBUG ? path.join(process.cwd(), "om-debug.log") : null;
|
|
1047
1047
|
function omDebug(msg) {
|
|
1048
1048
|
if (!OM_DEBUG_LOG) return;
|
|
@@ -1225,6 +1225,17 @@ var BufferingCoordinator = class _BufferingCoordinator {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
}
|
|
1227
1227
|
};
|
|
1228
|
+
function didProviderChange(actorModel, lastModel) {
|
|
1229
|
+
if (actorModel === void 0 || lastModel === void 0) return false;
|
|
1230
|
+
const actorHasSlash = actorModel.includes("/");
|
|
1231
|
+
const lastHasSlash = lastModel.includes("/");
|
|
1232
|
+
if (actorHasSlash && lastHasSlash) {
|
|
1233
|
+
return actorModel !== lastModel;
|
|
1234
|
+
}
|
|
1235
|
+
const actorModelId = actorHasSlash ? actorModel.slice(actorModel.indexOf("/") + 1) : actorModel;
|
|
1236
|
+
const lastModelId = lastHasSlash ? lastModel.slice(lastModel.indexOf("/") + 1) : lastModel;
|
|
1237
|
+
return actorModelId !== lastModelId;
|
|
1238
|
+
}
|
|
1228
1239
|
function formatRelativeTime(date, currentDate) {
|
|
1229
1240
|
const diffMs = currentDate.getTime() - date.getTime();
|
|
1230
1241
|
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
@@ -1505,7 +1516,12 @@ function createActivationMarker(params) {
|
|
|
1505
1516
|
threadId: params.threadId,
|
|
1506
1517
|
generationCount: params.generationCount,
|
|
1507
1518
|
config: params.config,
|
|
1508
|
-
observations: params.observations
|
|
1519
|
+
observations: params.observations,
|
|
1520
|
+
triggeredBy: params.triggeredBy,
|
|
1521
|
+
lastActivityAt: params.lastActivityAt,
|
|
1522
|
+
ttlExpiredMs: params.ttlExpiredMs,
|
|
1523
|
+
previousModel: params.previousModel,
|
|
1524
|
+
currentModel: params.currentModel
|
|
1509
1525
|
}
|
|
1510
1526
|
};
|
|
1511
1527
|
}
|
|
@@ -1653,7 +1669,7 @@ function sortThreadsByOldestMessage(messagesByThread) {
|
|
|
1653
1669
|
})).sort((a, b) => a.oldestTimestamp - b.oldestTimestamp).map((t2) => t2.threadId);
|
|
1654
1670
|
}
|
|
1655
1671
|
function stripThreadTags(observations) {
|
|
1656
|
-
return observations.replace(
|
|
1672
|
+
return observations.replace(/<\/?thread\b[^>]{0,1024}>/gi, "").trim();
|
|
1657
1673
|
}
|
|
1658
1674
|
function isTieredModelTarget(model) {
|
|
1659
1675
|
if (typeof model === "string") {
|
|
@@ -2990,6 +3006,7 @@ var ObservationStep = class {
|
|
|
2990
3006
|
resourceId,
|
|
2991
3007
|
checkThreshold: true,
|
|
2992
3008
|
messages: step0Messages,
|
|
3009
|
+
currentModel: this.turn.actorModelContext,
|
|
2993
3010
|
writer: this.turn.writer,
|
|
2994
3011
|
messageList
|
|
2995
3012
|
});
|
|
@@ -3013,8 +3030,11 @@ var ObservationStep = class {
|
|
|
3013
3030
|
observationTokens: obsTokens,
|
|
3014
3031
|
threadId,
|
|
3015
3032
|
writer: this.turn.writer,
|
|
3033
|
+
messageList,
|
|
3034
|
+
currentModel: this.turn.actorModelContext,
|
|
3016
3035
|
requestContext: this.turn.requestContext,
|
|
3017
|
-
observabilityContext: this.turn.observabilityContext
|
|
3036
|
+
observabilityContext: this.turn.observabilityContext,
|
|
3037
|
+
lastActivityAt: getLastActivityFromMessages(messageList.get.all.db())
|
|
3018
3038
|
});
|
|
3019
3039
|
await this.turn.refreshRecord();
|
|
3020
3040
|
if (this.turn.record.generationCount > preReflectGeneration) {
|
|
@@ -3178,6 +3198,7 @@ var ObservationStep = class {
|
|
|
3178
3198
|
threadId,
|
|
3179
3199
|
resourceId,
|
|
3180
3200
|
messages: messageList.get.all.db(),
|
|
3201
|
+
currentModel: this.turn.actorModelContext,
|
|
3181
3202
|
writer: this.turn.writer,
|
|
3182
3203
|
messageList
|
|
3183
3204
|
});
|
|
@@ -3189,8 +3210,10 @@ var ObservationStep = class {
|
|
|
3189
3210
|
threadId,
|
|
3190
3211
|
writer: this.turn.writer,
|
|
3191
3212
|
messageList,
|
|
3213
|
+
currentModel: this.turn.actorModelContext,
|
|
3192
3214
|
requestContext: this.turn.requestContext,
|
|
3193
|
-
observabilityContext: this.turn.observabilityContext
|
|
3215
|
+
observabilityContext: this.turn.observabilityContext,
|
|
3216
|
+
lastActivityAt: getLastActivityFromMessages(messageList.get.all.db())
|
|
3194
3217
|
});
|
|
3195
3218
|
return {
|
|
3196
3219
|
succeeded: true,
|
|
@@ -3230,6 +3253,8 @@ var ObservationTurn = class {
|
|
|
3230
3253
|
requestContext;
|
|
3231
3254
|
/** Optional observability context for nested OM spans. */
|
|
3232
3255
|
observabilityContext;
|
|
3256
|
+
/** Current actor model for this step. Updated by the processor before prepare(). */
|
|
3257
|
+
actorModelContext;
|
|
3233
3258
|
/** Optional processor-provided hooks for turn/step lifecycle integration. */
|
|
3234
3259
|
hooks;
|
|
3235
3260
|
constructor(opts) {
|
|
@@ -5088,12 +5113,44 @@ function extractReflectorListItems(content) {
|
|
|
5088
5113
|
function validateCompression(reflectedTokens, targetThreshold) {
|
|
5089
5114
|
return reflectedTokens < targetThreshold;
|
|
5090
5115
|
}
|
|
5116
|
+
function formatModelContext(provider, modelId) {
|
|
5117
|
+
if (provider && modelId) {
|
|
5118
|
+
return `${provider}/${modelId}`;
|
|
5119
|
+
}
|
|
5120
|
+
return modelId;
|
|
5121
|
+
}
|
|
5122
|
+
function getCurrentModel(model) {
|
|
5123
|
+
return formatModelContext(model?.provider, model?.modelId);
|
|
5124
|
+
}
|
|
5125
|
+
function getLastModelFromMessageList(messageList) {
|
|
5126
|
+
const messages = messageList?.get.all.db();
|
|
5127
|
+
if (!messages) return void 0;
|
|
5128
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
5129
|
+
const message = messages[i];
|
|
5130
|
+
if (!message || message.role !== "assistant" || !message.content || typeof message.content === "string") {
|
|
5131
|
+
continue;
|
|
5132
|
+
}
|
|
5133
|
+
for (let j = message.content.parts.length - 1; j >= 0; j--) {
|
|
5134
|
+
const part = message.content.parts[j];
|
|
5135
|
+
if (part?.type === "step-start" && typeof part.model === "string" && part.model.length > 0) {
|
|
5136
|
+
return part.model;
|
|
5137
|
+
}
|
|
5138
|
+
}
|
|
5139
|
+
const metadata = message.content.metadata;
|
|
5140
|
+
const model = formatModelContext(metadata?.provider, metadata?.modelId);
|
|
5141
|
+
if (model) {
|
|
5142
|
+
return model;
|
|
5143
|
+
}
|
|
5144
|
+
}
|
|
5145
|
+
return void 0;
|
|
5146
|
+
}
|
|
5091
5147
|
async function withAbortCheck(fn, abortSignal) {
|
|
5092
5148
|
if (abortSignal?.aborted) throw new Error("The operation was aborted.");
|
|
5093
5149
|
const result = await fn();
|
|
5094
5150
|
if (abortSignal?.aborted) throw new Error("The operation was aborted.");
|
|
5095
5151
|
return result;
|
|
5096
5152
|
}
|
|
5153
|
+
var EARLY_ACTIVATION_SIZE_FLOOR_RATIO = 0.75;
|
|
5097
5154
|
var ReflectorRunner = class {
|
|
5098
5155
|
reflectionConfig;
|
|
5099
5156
|
observationConfig;
|
|
@@ -5133,7 +5190,8 @@ var ReflectorRunner = class {
|
|
|
5133
5190
|
observationTokens: getMaxThreshold(
|
|
5134
5191
|
record ? this.getEffectiveReflectionTokens(record) : this.reflectionConfig.observationTokens
|
|
5135
5192
|
),
|
|
5136
|
-
scope: this.scope
|
|
5193
|
+
scope: this.scope,
|
|
5194
|
+
activateAfterIdle: this.reflectionConfig.activateAfterIdle
|
|
5137
5195
|
};
|
|
5138
5196
|
}
|
|
5139
5197
|
/**
|
|
@@ -5417,9 +5475,11 @@ var ReflectorRunner = class {
|
|
|
5417
5475
|
}
|
|
5418
5476
|
/**
|
|
5419
5477
|
* Try to activate buffered reflection when threshold is reached.
|
|
5420
|
-
* Returns
|
|
5478
|
+
* Returns a discriminated result so the caller can distinguish between
|
|
5479
|
+
* "activated", "no buffer present", and "suppressed by overshoot guard"
|
|
5480
|
+
* without re-deriving that state.
|
|
5421
5481
|
*/
|
|
5422
|
-
async tryActivateBufferedReflection(record, lockKey, writer, messageList) {
|
|
5482
|
+
async tryActivateBufferedReflection(record, lockKey, writer, messageList, activationMetadata) {
|
|
5423
5483
|
const bufferKey = this.buffering.getReflectionBufferKey(lockKey);
|
|
5424
5484
|
const asyncOp = BufferingCoordinator.asyncBufferingOps.get(bufferKey);
|
|
5425
5485
|
if (asyncOp) {
|
|
@@ -5440,8 +5500,8 @@ var ReflectorRunner = class {
|
|
|
5440
5500
|
`[OM:reflect] tryActivateBufferedReflection: freshRecord.id=${freshRecord?.id}, freshBufferedReflection=${freshRecord?.bufferedReflection ? "present (" + freshRecord.bufferedReflection.length + " chars)" : "empty"}, freshObsTokens=${freshRecord?.observationTokenCount}`
|
|
5441
5501
|
);
|
|
5442
5502
|
if (!freshRecord?.bufferedReflection) {
|
|
5443
|
-
omDebug(`[OM:reflect] tryActivateBufferedReflection: no buffered reflection after re-fetch
|
|
5444
|
-
return
|
|
5503
|
+
omDebug(`[OM:reflect] tryActivateBufferedReflection: no buffered reflection after re-fetch`);
|
|
5504
|
+
return { status: "no-buffer" };
|
|
5445
5505
|
}
|
|
5446
5506
|
const beforeTokens = freshRecord.observationTokenCount ?? 0;
|
|
5447
5507
|
const reflectedLineCount = freshRecord.reflectedObservationLineCount ?? 0;
|
|
@@ -5453,6 +5513,26 @@ var ReflectorRunner = class {
|
|
|
5453
5513
|
|
|
5454
5514
|
${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
5455
5515
|
const combinedTokenCount = this.tokenCounter.countObservations(combinedObservations);
|
|
5516
|
+
if (activationMetadata?.triggeredBy === "ttl" || activationMetadata?.triggeredBy === "provider_change") {
|
|
5517
|
+
const unreflectedTailTokens = unreflectedContent ? this.tokenCounter.countObservations(unreflectedContent) : 0;
|
|
5518
|
+
const bufferedReflectionTokens = freshRecord.bufferedReflectionTokens ?? 0;
|
|
5519
|
+
if (unreflectedTailTokens < bufferedReflectionTokens) {
|
|
5520
|
+
omDebug(
|
|
5521
|
+
`[OM:reflect] tryActivateBufferedReflection: suppressing early ${activationMetadata.triggeredBy} activation \u2014 unreflectedTailTokens=${unreflectedTailTokens} < bufferedReflectionTokens=${bufferedReflectionTokens}; keeping buffer for threshold activation`
|
|
5522
|
+
);
|
|
5523
|
+
return { status: "suppressed", reason: "composition" };
|
|
5524
|
+
}
|
|
5525
|
+
const bufferActivation = this.reflectionConfig.bufferActivation;
|
|
5526
|
+
const reflectThreshold = getMaxThreshold(this.getEffectiveReflectionTokens(freshRecord));
|
|
5527
|
+
const regularActivationTarget = reflectThreshold * (1 - bufferActivation);
|
|
5528
|
+
const minCombinedTokens = Math.round(regularActivationTarget * EARLY_ACTIVATION_SIZE_FLOOR_RATIO);
|
|
5529
|
+
if (combinedTokenCount < minCombinedTokens) {
|
|
5530
|
+
omDebug(
|
|
5531
|
+
`[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`
|
|
5532
|
+
);
|
|
5533
|
+
return { status: "suppressed", reason: "size" };
|
|
5534
|
+
}
|
|
5535
|
+
}
|
|
5456
5536
|
omDebug(
|
|
5457
5537
|
`[OM:reflect] tryActivateBufferedReflection: activating, beforeTokens=${beforeTokens}, combinedTokenCount=${combinedTokenCount}, reflectedLineCount=${reflectedLineCount}, unreflectedLines=${unreflectedLines.length}`
|
|
5458
5538
|
);
|
|
@@ -5479,6 +5559,11 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5479
5559
|
threadId: freshRecord.threadId ?? "",
|
|
5480
5560
|
generationCount: afterRecord?.generationCount ?? freshRecord.generationCount ?? 0,
|
|
5481
5561
|
observations: afterRecord?.activeObservations,
|
|
5562
|
+
triggeredBy: activationMetadata?.triggeredBy,
|
|
5563
|
+
lastActivityAt: activationMetadata?.lastActivityAt,
|
|
5564
|
+
ttlExpiredMs: activationMetadata?.ttlExpiredMs,
|
|
5565
|
+
previousModel: activationMetadata?.previousModel,
|
|
5566
|
+
currentModel: activationMetadata?.currentModel,
|
|
5482
5567
|
config: this.getObservationMarkerConfig(freshRecord)
|
|
5483
5568
|
});
|
|
5484
5569
|
void writer.custom(activationMarker).catch(() => {
|
|
@@ -5491,7 +5576,7 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5491
5576
|
);
|
|
5492
5577
|
}
|
|
5493
5578
|
BufferingCoordinator.reflectionBufferCycleIds.delete(bufferKey);
|
|
5494
|
-
return
|
|
5579
|
+
return { status: "activated" };
|
|
5495
5580
|
}
|
|
5496
5581
|
/**
|
|
5497
5582
|
* Check if reflection needed and trigger if so.
|
|
@@ -5505,9 +5590,12 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5505
5590
|
writer,
|
|
5506
5591
|
abortSignal,
|
|
5507
5592
|
messageList,
|
|
5593
|
+
currentModel,
|
|
5508
5594
|
reflectionHooks,
|
|
5509
5595
|
requestContext,
|
|
5510
|
-
observabilityContext
|
|
5596
|
+
observabilityContext,
|
|
5597
|
+
lastActivityAt,
|
|
5598
|
+
threadId: requestedThreadId
|
|
5511
5599
|
} = opts;
|
|
5512
5600
|
const lockKey = this.buffering.getLockKey(record.threadId, record.resourceId);
|
|
5513
5601
|
const reflectThreshold = getMaxThreshold(this.getEffectiveReflectionTokens(record));
|
|
@@ -5539,9 +5627,23 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5539
5627
|
);
|
|
5540
5628
|
}
|
|
5541
5629
|
}
|
|
5542
|
-
|
|
5630
|
+
const activateAfterIdle = this.reflectionConfig.activateAfterIdle;
|
|
5631
|
+
const ttlExpiredMs = activateAfterIdle !== void 0 && lastActivityAt !== void 0 ? Date.now() - lastActivityAt : void 0;
|
|
5632
|
+
const ttlExpired = ttlExpiredMs !== void 0 && activateAfterIdle !== void 0 && ttlExpiredMs >= activateAfterIdle;
|
|
5633
|
+
const actorModel = getCurrentModel(currentModel);
|
|
5634
|
+
const lastModel = getLastModelFromMessageList(messageList);
|
|
5635
|
+
const providerChanged = this.reflectionConfig.activateOnProviderChange === true && didProviderChange(actorModel, lastModel);
|
|
5636
|
+
if (observationTokens < reflectThreshold && !ttlExpired && !providerChanged) {
|
|
5543
5637
|
return;
|
|
5544
5638
|
}
|
|
5639
|
+
const activationTriggeredBy = observationTokens >= reflectThreshold ? "threshold" : providerChanged ? "provider_change" : "ttl";
|
|
5640
|
+
const activationMetadata = {
|
|
5641
|
+
triggeredBy: activationTriggeredBy,
|
|
5642
|
+
lastActivityAt: activationTriggeredBy === "ttl" ? lastActivityAt : void 0,
|
|
5643
|
+
ttlExpiredMs: activationTriggeredBy === "ttl" ? ttlExpiredMs : void 0,
|
|
5644
|
+
previousModel: activationTriggeredBy === "provider_change" ? lastModel : void 0,
|
|
5645
|
+
currentModel: activationTriggeredBy === "provider_change" ? actorModel : void 0
|
|
5646
|
+
};
|
|
5545
5647
|
if (record.isReflecting) {
|
|
5546
5648
|
if (isOpActiveInProcess(record.id, "reflecting")) {
|
|
5547
5649
|
omDebug(`[OM:reflect] isReflecting=true and active in this process, skipping`);
|
|
@@ -5551,8 +5653,20 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5551
5653
|
await this.storage.setReflectingFlag(record.id, false);
|
|
5552
5654
|
}
|
|
5553
5655
|
if (this.buffering.isAsyncReflectionEnabled()) {
|
|
5554
|
-
const
|
|
5555
|
-
|
|
5656
|
+
const activationResult = await this.tryActivateBufferedReflection(
|
|
5657
|
+
record,
|
|
5658
|
+
lockKey,
|
|
5659
|
+
writer,
|
|
5660
|
+
messageList,
|
|
5661
|
+
activationMetadata
|
|
5662
|
+
);
|
|
5663
|
+
if (activationResult.status === "activated") {
|
|
5664
|
+
return;
|
|
5665
|
+
}
|
|
5666
|
+
if (activationResult.status === "suppressed") {
|
|
5667
|
+
omDebug(
|
|
5668
|
+
`[OM:reflect] skipping sync fallback / re-buffer after suppressed early ${activationMetadata.triggeredBy} activation (reason=${activationResult.reason})`
|
|
5669
|
+
);
|
|
5556
5670
|
return;
|
|
5557
5671
|
}
|
|
5558
5672
|
if (this.reflectionConfig.blockAfter && observationTokens >= this.reflectionConfig.blockAfter) {
|
|
@@ -5580,7 +5694,7 @@ ${unreflectedContent}` : freshRecord.bufferedReflection;
|
|
|
5580
5694
|
registerOp(record.id, "reflecting");
|
|
5581
5695
|
const cycleId = crypto.randomUUID();
|
|
5582
5696
|
const startedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
5583
|
-
const threadId =
|
|
5697
|
+
const threadId = requestedThreadId ?? "unknown";
|
|
5584
5698
|
if (writer) {
|
|
5585
5699
|
const startMarker = createObservationStartMarker({
|
|
5586
5700
|
cycleId,
|
|
@@ -6296,7 +6410,7 @@ async function resolveImageDimensionsAsync(part) {
|
|
|
6296
6410
|
return existing;
|
|
6297
6411
|
}
|
|
6298
6412
|
try {
|
|
6299
|
-
const mod = await import('./probe-image-size-
|
|
6413
|
+
const mod = await import('./probe-image-size-H2PYJKCK.cjs');
|
|
6300
6414
|
const probeImageSize = mod.default;
|
|
6301
6415
|
const probed = await probeImageSize(url, {
|
|
6302
6416
|
open_timeout: REMOTE_IMAGE_PROBE_TIMEOUT_MS,
|
|
@@ -7228,6 +7342,88 @@ function buildMessageRange(messages) {
|
|
|
7228
7342
|
const last = [...messages].reverse().find(messageHasVisibleContent) ?? messages[messages.length - 1];
|
|
7229
7343
|
return `${first.id}:${last.id}`;
|
|
7230
7344
|
}
|
|
7345
|
+
function getLastActivityFromMessages(messages) {
|
|
7346
|
+
if (!messages) return void 0;
|
|
7347
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
7348
|
+
const message = messages[i];
|
|
7349
|
+
if (!message || message.role !== "assistant") {
|
|
7350
|
+
continue;
|
|
7351
|
+
}
|
|
7352
|
+
if (!message.content || typeof message.content === "string") {
|
|
7353
|
+
return message.createdAt ? new Date(message.createdAt).getTime() : void 0;
|
|
7354
|
+
}
|
|
7355
|
+
for (let j = message.content.parts.length - 1; j >= 0; j--) {
|
|
7356
|
+
const part = message.content.parts[j];
|
|
7357
|
+
if (!part || part.type?.startsWith("data-")) {
|
|
7358
|
+
continue;
|
|
7359
|
+
}
|
|
7360
|
+
if (part.createdAt !== void 0) {
|
|
7361
|
+
return part.createdAt;
|
|
7362
|
+
}
|
|
7363
|
+
}
|
|
7364
|
+
return message.createdAt ? new Date(message.createdAt).getTime() : void 0;
|
|
7365
|
+
}
|
|
7366
|
+
return void 0;
|
|
7367
|
+
}
|
|
7368
|
+
function formatModelContext2(provider, modelId) {
|
|
7369
|
+
if (provider && modelId) {
|
|
7370
|
+
return `${provider}/${modelId}`;
|
|
7371
|
+
}
|
|
7372
|
+
return modelId;
|
|
7373
|
+
}
|
|
7374
|
+
function getLastModelFromMessages(messages) {
|
|
7375
|
+
if (!messages) return void 0;
|
|
7376
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
7377
|
+
const message = messages[i];
|
|
7378
|
+
if (!message || message.role !== "assistant" || !message.content || typeof message.content === "string") {
|
|
7379
|
+
continue;
|
|
7380
|
+
}
|
|
7381
|
+
for (let j = message.content.parts.length - 1; j >= 0; j--) {
|
|
7382
|
+
const part = message.content.parts[j];
|
|
7383
|
+
if (part?.type === "step-start" && typeof part.model === "string" && part.model.length > 0) {
|
|
7384
|
+
return part.model;
|
|
7385
|
+
}
|
|
7386
|
+
}
|
|
7387
|
+
const metadata = message.content.metadata;
|
|
7388
|
+
const model = formatModelContext2(metadata?.provider, metadata?.modelId);
|
|
7389
|
+
if (model) {
|
|
7390
|
+
return model;
|
|
7391
|
+
}
|
|
7392
|
+
}
|
|
7393
|
+
return void 0;
|
|
7394
|
+
}
|
|
7395
|
+
function getCurrentModel2(model) {
|
|
7396
|
+
return formatModelContext2(model?.provider, model?.modelId);
|
|
7397
|
+
}
|
|
7398
|
+
function parseActivationTTL(value, fieldPath) {
|
|
7399
|
+
if (value === void 0) {
|
|
7400
|
+
return void 0;
|
|
7401
|
+
}
|
|
7402
|
+
if (typeof value === "number") {
|
|
7403
|
+
if (!Number.isFinite(value) || value < 0) {
|
|
7404
|
+
throw new Error(`${fieldPath} must be a non-negative number of milliseconds or a duration string like "5m".`);
|
|
7405
|
+
}
|
|
7406
|
+
return value;
|
|
7407
|
+
}
|
|
7408
|
+
const trimmed = value.trim();
|
|
7409
|
+
const match = trimmed.match(
|
|
7410
|
+
/^(\d+(?:\.\d+)?)\s*(ms|msec|msecs|millisecond|milliseconds|s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours)$/i
|
|
7411
|
+
);
|
|
7412
|
+
if (!match) {
|
|
7413
|
+
throw new Error(
|
|
7414
|
+
`${fieldPath} must be a non-negative number of milliseconds or a duration string like "5m" or "1hr".`
|
|
7415
|
+
);
|
|
7416
|
+
}
|
|
7417
|
+
const rawAmount = match[1];
|
|
7418
|
+
const rawUnit = match[2];
|
|
7419
|
+
const amount = Number(rawAmount);
|
|
7420
|
+
const unit = rawUnit.toLowerCase();
|
|
7421
|
+
if (!Number.isFinite(amount) || amount < 0) {
|
|
7422
|
+
throw new Error(`${fieldPath} must be a non-negative number of milliseconds or a duration string like "5m".`);
|
|
7423
|
+
}
|
|
7424
|
+
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;
|
|
7425
|
+
return amount * multiplier;
|
|
7426
|
+
}
|
|
7231
7427
|
var ObservationalMemory = class _ObservationalMemory {
|
|
7232
7428
|
storage;
|
|
7233
7429
|
tokenCounter;
|
|
@@ -7374,6 +7570,8 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
|
|
|
7374
7570
|
config.observation?.messageTokens ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
|
|
7375
7571
|
),
|
|
7376
7572
|
bufferActivation: asyncBufferingDisabled ? void 0 : config.observation?.bufferActivation ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferActivation,
|
|
7573
|
+
activateAfterIdle: parseActivationTTL(config.activateAfterIdle, "activateAfterIdle"),
|
|
7574
|
+
activateOnProviderChange: config.activateOnProviderChange ?? false,
|
|
7377
7575
|
blockAfter: asyncBufferingDisabled ? void 0 : resolveBlockAfter(
|
|
7378
7576
|
config.observation?.blockAfter ?? (config.observation?.bufferTokens ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.bufferTokens ? 1.2 : void 0),
|
|
7379
7577
|
config.observation?.messageTokens ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.observation.messageTokens
|
|
@@ -7392,6 +7590,8 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
|
|
|
7392
7590
|
},
|
|
7393
7591
|
providerOptions: config.reflection?.providerOptions ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.providerOptions,
|
|
7394
7592
|
bufferActivation: asyncBufferingDisabled ? void 0 : config?.reflection?.bufferActivation ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation,
|
|
7593
|
+
activateAfterIdle: parseActivationTTL(config.activateAfterIdle, "activateAfterIdle"),
|
|
7594
|
+
activateOnProviderChange: config.activateOnProviderChange ?? false,
|
|
7395
7595
|
blockAfter: asyncBufferingDisabled ? void 0 : resolveBlockAfter(
|
|
7396
7596
|
config.reflection?.blockAfter ?? (config.reflection?.bufferActivation ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.bufferActivation ? 1.2 : void 0),
|
|
7397
7597
|
config.reflection?.observationTokens ?? chunk3D55EABW_cjs.OBSERVATIONAL_MEMORY_DEFAULTS.reflection.observationTokens
|
|
@@ -7786,7 +7986,8 @@ Async buffering is enabled by default \u2014 this opt-out is only needed when us
|
|
|
7786
7986
|
return {
|
|
7787
7987
|
messageTokens: getMaxThreshold(this.observationConfig.messageTokens),
|
|
7788
7988
|
observationTokens: getMaxThreshold(this.reflectionConfig.observationTokens),
|
|
7789
|
-
scope: this.scope
|
|
7989
|
+
scope: this.scope,
|
|
7990
|
+
activateAfterIdle: this.observationConfig.activateAfterIdle
|
|
7790
7991
|
};
|
|
7791
7992
|
}
|
|
7792
7993
|
/**
|
|
@@ -9024,7 +9225,7 @@ ${grouped}` : grouped;
|
|
|
9024
9225
|
await BufferingCoordinator.awaitBuffering(threadId, resourceId ?? null, this.scope);
|
|
9025
9226
|
const preStatus = await this.getStatus({ threadId, resourceId, messages });
|
|
9026
9227
|
if (preStatus.canActivate) {
|
|
9027
|
-
const actResult = await this.activate({ threadId, resourceId });
|
|
9228
|
+
const actResult = await this.activate({ threadId, resourceId, messages });
|
|
9028
9229
|
activated = actResult.activated;
|
|
9029
9230
|
}
|
|
9030
9231
|
const postStatus = await this.getStatus({ threadId, resourceId, messages });
|
|
@@ -9284,10 +9485,37 @@ ${grouped}` : grouped;
|
|
|
9284
9485
|
if (!chunks.length) {
|
|
9285
9486
|
return { activated: false, record };
|
|
9286
9487
|
}
|
|
9488
|
+
let activationTriggeredBy = "threshold";
|
|
9489
|
+
let activationLastActivityAt;
|
|
9490
|
+
let activateAfterIdleExpiredMs;
|
|
9491
|
+
let previousModel;
|
|
9492
|
+
let currentModel;
|
|
9287
9493
|
if (opts.checkThreshold) {
|
|
9288
|
-
const
|
|
9289
|
-
|
|
9290
|
-
|
|
9494
|
+
const thresholdMessages = opts.messages ?? await this.loadMessagesFromStorage(
|
|
9495
|
+
threadId,
|
|
9496
|
+
resourceId,
|
|
9497
|
+
record.lastObservedAt ? new Date(record.lastObservedAt) : void 0
|
|
9498
|
+
);
|
|
9499
|
+
const activateAfterIdle = this.observationConfig.activateAfterIdle;
|
|
9500
|
+
const lastActivityAt = getLastActivityFromMessages(thresholdMessages);
|
|
9501
|
+
const ttlExpiredMs = activateAfterIdle !== void 0 && lastActivityAt !== void 0 ? Date.now() - lastActivityAt : void 0;
|
|
9502
|
+
const ttlExpired = ttlExpiredMs !== void 0 && activateAfterIdle !== void 0 && ttlExpiredMs >= activateAfterIdle;
|
|
9503
|
+
const actorModel = getCurrentModel2(opts.currentModel);
|
|
9504
|
+
const lastModel = getLastModelFromMessages(thresholdMessages);
|
|
9505
|
+
const providerChanged = this.observationConfig.activateOnProviderChange === true && didProviderChange(actorModel, lastModel);
|
|
9506
|
+
if (providerChanged) {
|
|
9507
|
+
activationTriggeredBy = "provider_change";
|
|
9508
|
+
previousModel = lastModel;
|
|
9509
|
+
currentModel = actorModel;
|
|
9510
|
+
} else if (ttlExpired) {
|
|
9511
|
+
activationTriggeredBy = "ttl";
|
|
9512
|
+
activationLastActivityAt = lastActivityAt;
|
|
9513
|
+
activateAfterIdleExpiredMs = ttlExpiredMs;
|
|
9514
|
+
} else {
|
|
9515
|
+
const status = await this.getStatus({ threadId, resourceId, messages: thresholdMessages });
|
|
9516
|
+
if (status.pendingTokens < status.threshold) {
|
|
9517
|
+
return { activated: false, record };
|
|
9518
|
+
}
|
|
9291
9519
|
}
|
|
9292
9520
|
}
|
|
9293
9521
|
if (record.isBufferingObservation) {
|
|
@@ -9345,6 +9573,11 @@ ${grouped}` : grouped;
|
|
|
9345
9573
|
threadId: postSwapRecord.threadId ?? record.threadId ?? "",
|
|
9346
9574
|
generationCount: postSwapRecord.generationCount ?? 0,
|
|
9347
9575
|
observations: chunkData?.observations ?? activationResult.observations,
|
|
9576
|
+
triggeredBy: activationTriggeredBy,
|
|
9577
|
+
lastActivityAt: activationLastActivityAt,
|
|
9578
|
+
ttlExpiredMs: activateAfterIdleExpiredMs,
|
|
9579
|
+
previousModel,
|
|
9580
|
+
currentModel,
|
|
9348
9581
|
config: this.getObservationMarkerConfig()
|
|
9349
9582
|
});
|
|
9350
9583
|
void opts.writer.custom(activationMarker).catch(() => {
|
|
@@ -9702,6 +9935,7 @@ var ObservationalMemoryProcessor = class {
|
|
|
9702
9935
|
const observabilityContext = getOmObservabilityContext(args);
|
|
9703
9936
|
state.__omObservabilityContext = observabilityContext;
|
|
9704
9937
|
this.turn.observabilityContext = observabilityContext;
|
|
9938
|
+
this.turn.actorModelContext = actorModelContext;
|
|
9705
9939
|
{
|
|
9706
9940
|
const step = this.turn.step(stepNumber);
|
|
9707
9941
|
let ctx;
|
|
@@ -9860,5 +10094,5 @@ exports.stripEphemeralAnchorIds = stripEphemeralAnchorIds;
|
|
|
9860
10094
|
exports.stripObservationGroups = stripObservationGroups;
|
|
9861
10095
|
exports.truncateStringByTokens = truncateStringByTokens;
|
|
9862
10096
|
exports.wrapInObservationGroup = wrapInObservationGroup;
|
|
9863
|
-
//# sourceMappingURL=chunk-
|
|
9864
|
-
//# sourceMappingURL=chunk-
|
|
10097
|
+
//# sourceMappingURL=chunk-4DWMVYPN.cjs.map
|
|
10098
|
+
//# sourceMappingURL=chunk-4DWMVYPN.cjs.map
|