botmancers 0.4.2 → 0.5.0
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 +28 -0
- package/README.md +22 -17
- package/app/.next/BUILD_ID +1 -1
- package/app/.next/app-path-routes-manifest.json +7 -0
- package/app/.next/build-manifest.json +3 -3
- package/app/.next/prerender-manifest.json +5 -5
- package/app/.next/required-server-files.json +2 -2
- package/app/.next/routes-manifest.json +55 -0
- package/app/.next/server/app/_global-error.html +1 -1
- package/app/.next/server/app/_global-error.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/app/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/_not-found.html +1 -1
- package/app/.next/server/app/_not-found.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/api/agent-deck/decks/route.js +2 -2
- package/app/.next/server/app/api/agent-deck/decks/route.js.nft.json +1 -1
- package/app/.next/server/app/api/agent-deck/settings/route.js +2 -2
- package/app/.next/server/app/api/agent-deck/settings/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/config/route.js +2 -2
- package/app/.next/server/app/api/bots/[id]/config/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js +12 -0
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route.js.nft.json +1 -0
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/pins/route_client-reference-manifest.js +3 -0
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/route.js +2 -2
- package/app/.next/server/app/api/bots/[id]/sessions/[ref]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/sessions/route.js +6 -3
- package/app/.next/server/app/api/bots/[id]/sessions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/[id]/skill/route.js +2 -2
- package/app/.next/server/app/api/bots/[id]/skill/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/availability/route.js +2 -2
- package/app/.next/server/app/api/bots/availability/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/delete-preview/route.js +2 -2
- package/app/.next/server/app/api/bots/delete-preview/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/import/route.js +2 -2
- package/app/.next/server/app/api/bots/import/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/manage/route.js +2 -2
- package/app/.next/server/app/api/bots/manage/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/name-migrations/route.js +2 -2
- package/app/.next/server/app/api/bots/name-migrations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/bots/route.js +3 -3
- package/app/.next/server/app/api/bots/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/approve/route.js +4 -4
- package/app/.next/server/app/api/conversations/[id]/approve/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/deny/route.js +4 -4
- package/app/.next/server/app/api/conversations/[id]/deny/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/draft/route.js +4 -4
- package/app/.next/server/app/api/conversations/[id]/draft/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js +2 -2
- package/app/.next/server/app/api/conversations/[id]/messages/[messageId]/stop/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/messages/route.js +5 -5
- package/app/.next/server/app/api/conversations/[id]/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/route.js +2 -2
- package/app/.next/server/app/api/conversations/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/[id]/stop/route.js +3 -3
- package/app/.next/server/app/api/conversations/[id]/stop/route.js.nft.json +1 -1
- package/app/.next/server/app/api/conversations/route.js +2 -2
- package/app/.next/server/app/api/conversations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/exchanges/[id]/cancel/route.js +4 -4
- package/app/.next/server/app/api/exchanges/[id]/cancel/route.js.nft.json +1 -1
- package/app/.next/server/app/api/exchanges/[id]/route.js +3 -3
- package/app/.next/server/app/api/exchanges/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/exchanges/route.js +3 -3
- package/app/.next/server/app/api/exchanges/route.js.nft.json +1 -1
- package/app/.next/server/app/api/files/[name]/route.js +3 -2
- package/app/.next/server/app/api/files/[name]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/groups/route.js +2 -2
- package/app/.next/server/app/api/groups/route.js.nft.json +1 -1
- package/app/.next/server/app/api/health/route.js +3 -2
- package/app/.next/server/app/api/health/route.js.nft.json +1 -1
- package/app/.next/server/app/api/mcp/route.js +2 -2
- package/app/.next/server/app/api/mcp/route.js.nft.json +1 -1
- package/app/.next/server/app/api/messages/[id]/between/route.js +2 -2
- package/app/.next/server/app/api/messages/[id]/between/route.js.nft.json +1 -1
- package/app/.next/server/app/api/runtime-connections/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/runtime-connections/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/runtime-connections/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/runtime-connections/route.js +9 -0
- package/app/.next/server/app/api/runtime-connections/route.js.nft.json +1 -0
- package/app/.next/server/app/api/runtime-connections/route_client-reference-manifest.js +3 -0
- package/app/.next/server/app/api/service-grants/route.js +2 -2
- package/app/.next/server/app/api/service-grants/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js +7 -6
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js +7 -6
- package/app/.next/server/app/api/v0/agents/[agentId]/conversations/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js +4 -4
- package/app/.next/server/app/api/v0/agents/[agentId]/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js +12 -0
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route.js.nft.json +1 -0
- package/app/.next/server/app/api/v0/agents/[agentId]/pins/route_client-reference-manifest.js +3 -0
- package/app/.next/server/app/api/v0/agents/[agentId]/route.js +7 -6
- package/app/.next/server/app/api/v0/agents/[agentId]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js +7 -6
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/[ref]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js +7 -6
- package/app/.next/server/app/api/v0/agents/[agentId]/sessions/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/agents/route.js +7 -6
- package/app/.next/server/app/api/v0/agents/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/capabilities/route.js +7 -6
- package/app/.next/server/app/api/v0/capabilities/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/conversations/[id]/route.js +4 -4
- package/app/.next/server/app/api/v0/conversations/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js +7 -6
- package/app/.next/server/app/api/v0/exchanges/[id]/cancel/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/exchanges/[id]/route.js +7 -6
- package/app/.next/server/app/api/v0/exchanges/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/exchanges/route.js +7 -6
- package/app/.next/server/app/api/v0/exchanges/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/mcp/route.js +8 -7
- package/app/.next/server/app/api/v0/mcp/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js +12 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route.js.nft.json +1 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/detach/route_client-reference-manifest.js +3 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js +12 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route.js.nft.json +1 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/messages/route_client-reference-manifest.js +3 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/route.js +12 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/route.js.nft.json +1 -0
- package/app/.next/server/app/api/v0/pins/[pinRef]/route_client-reference-manifest.js +3 -0
- package/app/.next/server/app/api/v0/requests/[id]/route.js +4 -4
- package/app/.next/server/app/api/v0/requests/[id]/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js +7 -6
- package/app/.next/server/app/api/v0/sessions/[ref]/messages/route.js.nft.json +1 -1
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route/app-paths-manifest.json +3 -0
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route/build-manifest.json +12 -0
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route/server-reference-manifest.json +4 -0
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js +12 -0
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route.js.nft.json +1 -0
- package/app/.next/server/app/api/v0/sessions/[ref]/pins/route_client-reference-manifest.js +3 -0
- package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js +4 -4
- package/app/.next/server/app/api/wake-grants/[id]/revoke/route.js.nft.json +1 -1
- package/app/.next/server/app/api/wakes/[id]/decision/route.js +4 -4
- package/app/.next/server/app/api/wakes/[id]/decision/route.js.nft.json +1 -1
- package/app/.next/server/app/api/wakes/[id]/retry/route.js +4 -4
- package/app/.next/server/app/api/wakes/[id]/retry/route.js.nft.json +1 -1
- package/app/.next/server/app/bots/[id]/config/page.js.nft.json +1 -1
- package/app/.next/server/app/bots/[id]/config/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/exchanges/page.js.nft.json +1 -1
- package/app/.next/server/app/exchanges/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/exchanges.html +1 -1
- package/app/.next/server/app/exchanges.rsc +3 -3
- package/app/.next/server/app/exchanges.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/exchanges.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/exchanges.segments/exchanges/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.html +1 -1
- package/app/.next/server/app/index.rsc +3 -3
- package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/page.js.nft.json +1 -1
- package/app/.next/server/app/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/settings/page.js.nft.json +1 -1
- package/app/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app/settings.html +1 -1
- package/app/.next/server/app/settings.rsc +3 -3
- package/app/.next/server/app/settings.segments/_full.segment.rsc +3 -3
- package/app/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/app/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +3 -3
- package/app/.next/server/app/threads/[id]/page.js.nft.json +1 -1
- package/app/.next/server/app/threads/[id]/page_client-reference-manifest.js +1 -1
- package/app/.next/server/app-paths-manifest.json +7 -0
- package/app/.next/server/chunks/1oeh_server_app_api_bots_[id]_sessions_[ref]_pins_route_actions_0e1st6o.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__02kssr-._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__06qkt0f._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__08qhrch._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__097ptn_._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__09m9-pe._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__0b7w1z3._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__0f5yqjs._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__0g4um3-._.js +44 -0
- package/app/.next/server/chunks/[root-of-the-server]__0hro5ey._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__0hwpgxq._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__0izjfmr._.js +355 -60
- package/app/.next/server/chunks/[root-of-the-server]__0lwsto-._.js +5 -0
- package/app/.next/server/chunks/[root-of-the-server]__0s1enbp._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__0uq7sci._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__0wg992i._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__13cd2fb._.js +44 -0
- package/app/.next/server/chunks/[root-of-the-server]__17mum5-._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1879cge._.js +3 -0
- package/app/.next/server/chunks/{[root-of-the-server]__17oz13o._.js → [root-of-the-server]__1_01-13._.js} +3 -3
- package/app/.next/server/chunks/[root-of-the-server]__1a2dh11._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1bhzfu_._.js +7 -0
- package/app/.next/server/chunks/[root-of-the-server]__1co3sok._.js +44 -0
- package/app/.next/server/chunks/[root-of-the-server]__1eh30sp._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1fmsid0._.js +44 -0
- package/app/.next/server/chunks/[root-of-the-server]__1i388e2._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1kvvs4u._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1qbgs3m._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1s6h1sj._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1slu7d7._.js +2 -2
- package/app/.next/server/chunks/[root-of-the-server]__1tuqc5v._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1v609eq._.js +44 -0
- package/app/.next/server/chunks/[root-of-the-server]__1y_j43n._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1zdv-vb._.js +3 -0
- package/app/.next/server/chunks/[root-of-the-server]__1zjs2tr._.js +3 -0
- package/app/.next/server/chunks/_0061c2q._.js +3 -0
- package/app/.next/server/chunks/_023se5j._.js +44 -0
- package/app/.next/server/chunks/_02pb_qv._.js +44 -0
- package/app/.next/server/chunks/_05ro-21._.js +44 -0
- package/app/.next/server/chunks/_07on0dc._.js +44 -0
- package/app/.next/server/chunks/_08208nz._.js +44 -0
- package/app/.next/server/chunks/_0a2do3x._.js +1 -1
- package/app/.next/server/chunks/_0fe5qz5._.js +44 -0
- package/app/.next/server/chunks/_0i8_xso._.js +3 -0
- package/app/.next/server/chunks/_0qoji5a._.js +44 -0
- package/app/.next/server/chunks/_0uv2pi5._.js +44 -0
- package/app/.next/server/chunks/_0wdl90-._.js +44 -0
- package/app/.next/server/chunks/_1-5mthb._.js +1 -1
- package/app/.next/server/chunks/_11-q8k1._.js +3 -0
- package/app/.next/server/chunks/_11ijk9k._.js +44 -0
- package/app/.next/server/chunks/_198sn69._.js +44 -0
- package/app/.next/server/chunks/_1ba_5hd._.js +44 -0
- package/app/.next/server/chunks/_1ess5if._.js +3 -0
- package/app/.next/server/chunks/_1i0zod4._.js +3 -0
- package/app/.next/server/chunks/_1m89jq5._.js +44 -0
- package/app/.next/server/chunks/_1n39wr_._.js +44 -0
- package/app/.next/server/chunks/_1ryxqo1._.js +44 -0
- package/app/.next/server/chunks/_1vemgly._.js +44 -0
- package/app/.next/server/chunks/_next-internal_server_app_api_runtime-connections_route_actions_06rulng.js +3 -0
- package/app/.next/server/chunks/_next-internal_server_app_api_v0_agents_[agentId]_pins_route_actions_08uftk9.js +3 -0
- package/app/.next/server/chunks/_next-internal_server_app_api_v0_pins_[pinRef]_detach_route_actions_0nk3268.js +3 -0
- package/app/.next/server/chunks/_next-internal_server_app_api_v0_pins_[pinRef]_messages_route_actions_1wenu96.js +3 -0
- package/app/.next/server/chunks/_next-internal_server_app_api_v0_pins_[pinRef]_route_actions_0z7fu_c.js +3 -0
- package/app/.next/server/chunks/_next-internal_server_app_api_v0_sessions_[ref]_pins_route_actions_0y3ere3.js +3 -0
- package/app/.next/server/chunks/lib_0kik6bx._.js +1 -1
- package/app/.next/server/chunks/lib_0lqoyb4._.js +217 -0
- package/app/.next/server/chunks/lib_0pe3tiv._.js +1 -1
- package/app/.next/server/chunks/lib_0riiofz._.js +44 -0
- package/app/.next/server/chunks/lib_16j2293._.js +217 -0
- package/app/.next/server/chunks/lib_1nb_61e._.js +217 -0
- package/app/.next/server/chunks/lib_service-api-http_ts_0xzqhny._.js +5 -5
- package/app/.next/server/chunks/lib_session-pins_ts_0lmxnwj._.js +20 -0
- package/app/.next/server/chunks/ssr/_0epgorw._.js +3 -0
- package/app/.next/server/chunks/ssr/_1cvuhjt._.js +3 -0
- package/app/.next/server/chunks/ssr/_1n5mvo5._.js +3 -0
- package/app/.next/server/chunks/ssr/_1o94bnv._.js +1 -1
- package/app/.next/server/chunks/ssr/app_bots_[id]_config_page_tsx_1e0uue9._.js +1 -1
- package/app/.next/server/chunks/ssr/app_components_AgentDeckRuntime_tsx_024janf._.js +1 -1
- package/app/.next/server/chunks/ssr/app_components_ExchangeCard_tsx_1shfcgn._.js +3 -0
- package/app/.next/server/chunks/ssr/app_exchanges_page_tsx_0j-n2a1._.js +3 -0
- package/app/.next/server/chunks/ssr/node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a._.js +3 -0
- package/app/.next/server/middleware-build-manifest.js +3 -3
- package/app/.next/server/pages/404.html +1 -1
- package/app/.next/server/pages/500.html +1 -1
- package/app/.next/server/server-reference-manifest.js +1 -1
- package/app/.next/server/server-reference-manifest.json +1 -1
- package/app/.next/static/chunks/0bhd8eso48g27.js +1 -0
- package/app/.next/static/chunks/1ku9himlsx-hn.js +1 -0
- package/app/.next/static/chunks/21aqekm5z0j47.js +1 -0
- package/app/.next/static/chunks/2a8bomryx66oj.css +3 -0
- package/app/.next/static/chunks/3230ywnpii0s6.js +3 -0
- package/app/.next/static/chunks/35l2c95bd-jud.js +1 -0
- package/app/.next/static/chunks/3cijpn6vx3yzv.js +1 -0
- package/app/.next/static/chunks/3ue9194j59kem.js +1 -0
- package/app/.next/static/chunks/44ese2s4gzze_.js +1 -0
- package/app/BUILD_INFO.json +2 -2
- package/app/package.json +1 -1
- package/app/server.js +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +2 -2
- package/dist/clients.js +7 -3
- package/dist/config.d.ts +2 -1
- package/dist/config.js +5 -4
- package/dist/contract.d.ts +1 -0
- package/dist/contract.js +5 -0
- package/dist/home.d.ts +1 -1
- package/dist/home.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/product.js +1 -1
- package/dist/upstream.js +2 -2
- package/package.json +1 -1
- package/schemas/botmancers.mcp.v2.tools.json +1588 -4
- package/skills/botmancers-collaboration/SKILL.md +21 -6
- package/skills/botmancers-collaboration/references/workflows.md +72 -0
- package/app/.next/server/chunks/[root-of-the-server]__0ab4e_k._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__0qozubc._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__0wtzcge._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__10m3szc._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__15hknun._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__16ikszu._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__1afl75n._.js +0 -3
- package/app/.next/server/chunks/[root-of-the-server]__1kvvdpx._.js +0 -7
- package/app/.next/server/chunks/[root-of-the-server]__1qoa704._.js +0 -7
- package/app/.next/server/chunks/_06rti77._.js +0 -30
- package/app/.next/server/chunks/_09k38l1._.js +0 -3
- package/app/.next/server/chunks/_0dlg5kj._.js +0 -30
- package/app/.next/server/chunks/_0dyculb._.js +0 -30
- package/app/.next/server/chunks/_0eig2jc._.js +0 -30
- package/app/.next/server/chunks/_0ggf7vy._.js +0 -3
- package/app/.next/server/chunks/_0gtqbub._.js +0 -3
- package/app/.next/server/chunks/_0i7ga8c._.js +0 -3
- package/app/.next/server/chunks/_0kghtb6._.js +0 -3
- package/app/.next/server/chunks/_0orubev._.js +0 -3
- package/app/.next/server/chunks/_0sfpe9z._.js +0 -3
- package/app/.next/server/chunks/_0th2j4w._.js +0 -3
- package/app/.next/server/chunks/_0uz7r06._.js +0 -30
- package/app/.next/server/chunks/_0x05ts4._.js +0 -3
- package/app/.next/server/chunks/_0y3geoj._.js +0 -30
- package/app/.next/server/chunks/_12tq5uv._.js +0 -30
- package/app/.next/server/chunks/_147-4gl._.js +0 -3
- package/app/.next/server/chunks/_14ky6a2._.js +0 -30
- package/app/.next/server/chunks/_16kbxdt._.js +0 -30
- package/app/.next/server/chunks/_1963m2f._.js +0 -30
- package/app/.next/server/chunks/_1_34_h3._.js +0 -30
- package/app/.next/server/chunks/_1cc-2mx._.js +0 -3
- package/app/.next/server/chunks/_1ee4ej2._.js +0 -3
- package/app/.next/server/chunks/_1esxu1s._.js +0 -3
- package/app/.next/server/chunks/_1gn7eh7._.js +0 -3
- package/app/.next/server/chunks/_1gw7qwf._.js +0 -3
- package/app/.next/server/chunks/_1inyx08._.js +0 -3
- package/app/.next/server/chunks/_1kjsnlr._.js +0 -3
- package/app/.next/server/chunks/_1nurj3f._.js +0 -30
- package/app/.next/server/chunks/_1p2rf_n._.js +0 -30
- package/app/.next/server/chunks/_1p8rola._.js +0 -3
- package/app/.next/server/chunks/_1u6tw78._.js +0 -30
- package/app/.next/server/chunks/app_api_import-capabilities_route_ts_013w1kt._.js +0 -3
- package/app/.next/server/chunks/lib_0t3s3rj._.js +0 -30
- package/app/.next/server/chunks/lib_0zxi6rx._.js +0 -148
- package/app/.next/server/chunks/lib_12udr7g._.js +0 -148
- package/app/.next/server/chunks/lib_draft_ts_1atoius._.js +0 -3
- package/app/.next/server/chunks/lib_session-catalog_ts_1i7f38f._.js +0 -30
- package/app/.next/server/chunks/ssr/_00ysoah._.js +0 -3
- package/app/.next/server/chunks/ssr/_157wnb_._.js +0 -3
- package/app/.next/server/chunks/ssr/app_1-nwnha._.js +0 -3
- package/app/.next/server/chunks/ssr/app_components_0bhuhd-._.js +0 -3
- package/app/.next/server/chunks/ssr/app_components_0w2_b3t._.js +0 -3
- package/app/.next/static/chunks/0774d7ob6aze_.js +0 -1
- package/app/.next/static/chunks/0d3ein53nlgja.js +0 -1
- package/app/.next/static/chunks/1i5xroz391zkb.js +0 -1
- package/app/.next/static/chunks/1vz50l951sr9e.css +0 -3
- package/app/.next/static/chunks/24ggj819yt3y6.js +0 -1
- package/app/.next/static/chunks/2_8lcalraul5s.js +0 -3
- package/app/.next/static/chunks/30i0-l04mmdvk.js +0 -1
- package/app/.next/static/chunks/3wdlh25l1vww9.js +0 -1
- /package/app/.next/static/{ewp56HqU5-d9bpFog3bli → gh3shm8hnVqXLr75rmvsL}/_buildManifest.js +0 -0
- /package/app/.next/static/{ewp56HqU5-d9bpFog3bli → gh3shm8hnVqXLr75rmvsL}/_clientMiddlewareManifest.js +0 -0
- /package/app/.next/static/{ewp56HqU5-d9bpFog3bli → gh3shm8hnVqXLr75rmvsL}/_ssgManifest.js +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports=[30323,e=>{"use strict";var t=e.i(69936);async function a(e,{params:n}){let{id:r}=await n;return(0,t.handleGetExchange)(e,r)}e.s(["GET",0,a])},80033,e=>{"use strict";var t=e.i(47909),a=e.i(74017),n=e.i(96250),r=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),d=e.i(16795),l=e.i(87718),u=e.i(95169),c=e.i(47587),_=e.i(66012),p=e.i(70101),g=e.i(26937),h=e.i(10372),v=e.i(93695),E=e.i(9580);e.i(52474);var m=e.i(220);let R=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/v0/exchanges/[id]/route",pathname:"/api/v0/exchanges/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/v0/exchanges/[id]/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(30323),...{}}),{workAsyncStorage:b,workUnitAsyncStorage:f,serverHooks:A}=R;async function S(e,t,n){n.requestMeta&&(0,r.setRequestMeta)(e,n.requestMeta),R.isDev&&(0,r.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let b="/api/v0/exchanges/[id]/route";b=b.replace(/\/index$/,"")||"/";let f=await R.prepare(e,t,{srcPage:b,multiZoneDraftMode:!1});if(!f)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:A,deploymentId:S,params:C,nextConfig:O,parsedUrl:w,isDraftMode:N,prerenderManifest:T,routerServerContext:x,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,resolvedPathname:k,clientReferenceManifest:I,serverActionsManifest:H}=f,L=(0,o.normalizeAppPath)(b),P=!!T.routes[k]&&(R.isDev||(0,E.isRouteCacheOwner)(k,R.cacheOwner,T.routes[k])),M=!!(T.dynamicRoutes[L]||P),D=async()=>((null==x?void 0:x.render404)?await x.render404(e,t,w,!1):t.end("This page could not be found"),null);if(M&&!N){let e=T.dynamicRoutes[L];if(e&&!1===e.fallback&&!P){if(O.adapterPath)return await D();throw new v.NoFallbackError}}let F=null;!M||R.isDev||N||(F="/index"===(F=k)?"/":F);let U=!0===R.isDev||!M,$=M&&!U;H&&I&&(0,s.setManifestsSingleton)({page:b,clientReferenceManifest:I,serverActionsManifest:H});let G=e.method||"GET",J=(0,i.getTracer)(),W=J.getActiveScopeSpan(),K=!!(null==x?void 0:x.isWrappedByNextServer),j=!!(0,r.getRequestMeta)(e,"minimalMode"),B=(0,r.getRequestMeta)(e,"incrementalCache")||await R.getIncrementalCache(e,O,T,j);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let X={params:C,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:N,supportsDynamicResponse:U,incrementalCache:B,hmrRefreshHash:(0,r.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,n,r)=>R.onRequestError(e,t,n,r,x)},sharedContext:{buildId:A,deploymentId:S}},V=new d.NodeNextRequest(e),z=new d.NodeNextResponse(t),Y=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:a})=>{try{if(!j&&q&&y&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await R.handle(Y,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let i=X.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let s=X.renderOpts.collectedTags;if(!M)return await (0,_.sendResponse)(V,z,r,i),null;{let e=await r.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(r.headers);s&&(t[h.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=h.INFINITE_CACHE?!1!==a&&a>0?O.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:n}}}}catch(t){throw(null==a?void 0:a.isStale)&&await R.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:q})},!1,x),t}},Q=async(r,s)=>{try{var o,d;let r=await R.handleResponse({req:e,nextConfig:O,cacheKey:F,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,responseGenerator:Z,waitUntil:n.waitUntil,isMinimalMode:j});if(!M)return;if((null==r||null==(o=r.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==r||null==(d=r.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});j||t.setHeader("x-nextjs-cache",q?"REVALIDATED":r.isMiss?"MISS":r.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.fromNodeOutgoingHttpHeaders)(r.value.headers);j&&M||i.delete(h.NEXT_CACHE_TAGS_HEADER),!r.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,g.getCacheControlHeader)(r.cacheControl)),await (0,_.sendResponse)(V,z,new Response(r.value.body,{headers:i,status:r.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await R.onRequestError(e,t,{routerKind:"App Router",routePath:L,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:q})},!1,x),M)throw t;await (0,_.sendResponse)(V,z,new Response(null,{status:500}));return}finally{(()=>{if(!r)return;let e=t.statusCode;r.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(r.setStatus({code:i.SpanStatusCode.ERROR}),r.setAttribute("error.type",e.toString()));let a=J.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=a.get("next.route")||L,o=`${G} ${n}`;r.setAttributes({"next.route":n,"http.route":n,"next.span_name":o}),r.updateName(o),s&&s!==r&&(s.setAttribute("http.route",n),s.updateName(o))})()}};if(K&&W)await Q(W,void 0);else{let t=J.getActiveScopeSpan();await J.withPropagatedContext(e.headers,()=>J.trace(u.BaseServerSpan.handleRequest,{spanName:`${G} ${b}`,kind:i.SpanKind.SERVER,attributes:{"http.method":G,"http.target":e.url}},e=>Q(e,t)),void 0,!K)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:f})},"routeModule",0,R,"serverHooks",0,A,"workAsyncStorage",0,b,"workUnitAsyncStorage",0,f])},90027,e=>{"use strict";var t=e.i(62349);let a=["active","ended","all"],n=["implementation","revision"],r=`
|
|
2
|
-
SELECT b.*, bot.name AS agent_name, bot.agent AS agent_runtime, r.id AS origin_request_id, c.id AS origin_conversation_id,
|
|
3
|
-
c.type AS conversation_type, c.bot_id AS conversation_bot_id, tb.name AS thread_agent_name, g.name AS group_name,
|
|
4
|
-
r.intent AS request_intent, r.execution_kind AS request_kind, r.state AS request_state,
|
|
5
|
-
r.source_conversation_id AS request_conversation_id, r.target_agent_id AS request_target_agent_id,
|
|
6
|
-
sa.launch_snapshot AS source_snapshot, sa.finished_at AS source_finished_at,
|
|
7
|
-
(SELECT MAX(COALESCE(ra.finished_at, ra.started_at)) FROM work_attempts ra WHERE ra.resumed_session_binding_id = b.id) AS resumed_last_at
|
|
8
|
-
FROM session_bindings b
|
|
9
|
-
JOIN bots bot ON bot.id = b.agent_id
|
|
10
|
-
LEFT JOIN work_attempts sa ON sa.id = b.source_attempt_id
|
|
11
|
-
LEFT JOIN work_requests r ON r.id = COALESCE(b.request_id, sa.request_id)
|
|
12
|
-
LEFT JOIN conversations c ON c.id = COALESCE(b.conversation_id, r.source_conversation_id)
|
|
13
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
14
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
15
|
-
`;function i(e,t){let a=e?.[t];return"string"==typeof a&&a.trim().length>0?a:null}function s(e){let t=e.origin_conversation_id;return t?"group"===e.conversation_type?{id:t,kind:"group",label:e.group_name?`Group ${e.group_name}`:"Group thread",thread_agent_id:null}:"bot"===e.conversation_type&&e.conversation_bot_id?{id:t,kind:"direct",label:e.thread_agent_name?`${e.thread_agent_name} thread`:"Agent thread",thread_agent_id:e.thread_agent_name?e.conversation_bot_id:null}:{id:t,kind:"agent_api",label:"Agent API conversation",thread_agent_id:null}:null}function o(e){var a;let r,o=null;try{o=e.source_snapshot?JSON.parse(e.source_snapshot):null}catch{}let d=s(e),l=null===e.released_at?"active":"ended",u=((r=(e.request_intent??"").split("\n").map(e=>e.trim()).find(e=>e.length>0))?r.length>80?`${r.slice(0,79).trimEnd()}…`:r:null)??(d?.kind==="group"?d.label:null)??`${e.agent_name} \xb7 ${a=e.created_at,`${new Date(a).toISOString().slice(0,16).replace("T"," ")} UTC`}`;return{ref:e.id,agent:{id:e.agent_id,name:e.agent_name,adapter:e.adapter,transport:i(o,"transport")},title:u,status:l,resumable:null===e.released_at&&null!==e.request_id&&null!==e.request_kind&&n.includes(e.request_kind)&&e.request_target_agent_id===e.agent_id&&(e.conversation_id??"")===(e.request_conversation_id??"")&&e.adapter===(0,t.resolveAgent)({agent:e.agent_runtime}).agent,created_at:e.created_at,ended_at:e.released_at,last_activity_at:Math.max(e.created_at,e.released_at??0,e.source_finished_at??0,e.resumed_last_at??0),origin:{conversation:d,work_request:e.origin_request_id&&e.request_kind&&e.request_state?{id:e.origin_request_id,execution_kind:e.request_kind,state:e.request_state}:null},context:{workspace:i(o,"cwd"),deck:i(o,"deck")}}}function d(e,t){return t.last_activity_at-e.last_activity_at||t.created_at-e.created_at||(e.ref<t.ref?-1:+(e.ref>t.ref))}function l(e,t,a){return e.prepare(`${r} WHERE b.id = ? AND b.agent_id = ?`).get(a,t)}e.s(["agentExists",0,function(e,t){return!!e.prepare("SELECT 1 FROM bots WHERE id = ?").get(t)},"conversationRef",0,function(e,t){let a=e.prepare(`
|
|
16
|
-
SELECT c.id AS origin_conversation_id, c.type AS conversation_type, c.bot_id AS conversation_bot_id,
|
|
17
|
-
tb.name AS thread_agent_name, g.name AS group_name
|
|
18
|
-
FROM conversations c
|
|
19
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
20
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
21
|
-
WHERE c.id = ?
|
|
22
|
-
`).get(t);return a?s(a):null},"getAgentSession",0,function(e,t,a){let n=l(e,t,a);if(!n)return;let r=e.prepare(`
|
|
23
|
-
SELECT a.attempt_number, a.kind, a.request_id, a.outcome, a.started_at, a.finished_at,
|
|
24
|
-
CASE WHEN a.id = ? THEN 'source' ELSE 'resume' END AS role
|
|
25
|
-
FROM work_attempts a
|
|
26
|
-
WHERE a.id = ? OR a.resumed_session_binding_id = ?
|
|
27
|
-
ORDER BY a.started_at ASC, a.id ASC
|
|
28
|
-
`).all(n.source_attempt_id,n.source_attempt_id,n.id);return{...o(n),attempts:r}},"isSessionFilter",0,function(e){return"string"==typeof e&&a.includes(e)},"listAgentSessions",0,function(e,t,a="all"){return e.prepare(`${r} WHERE b.agent_id = ? ${"active"===a?"AND b.released_at IS NULL":"ended"===a?"AND b.released_at IS NOT NULL":""}`).all(t).map(o).sort(d)},"sessionDebugExternalId",0,function(e,t,a){return l(e,t,a)?.external_session_id},"sessionTitle",0,function(e,t,a){let n=l(e,t,a);return n?o(n).title:null}])}];
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=_06rti77._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[38277,e=>{"use strict";var t=e.i(89171),a=e.i(62294),r=e.i(45383),n=e.i(63020);async function o(e,{params:i}){try{let{id:o}=await i,s=(0,r.getExchangeView)(o);if(s.requester.kind!==a.UI_OWNER_PRINCIPAL.kind||s.requester.id!==a.UI_OWNER_PRINCIPAL.id)throw new n.ExchangeError("exchange_not_found",`No exchange ${o}.`);let l=(0,n.cancelReasonFromBody)(await e.text()),{exchange:u,replayed:c}=await (0,r.cancelExchangeCommand)(o,a.UI_OWNER_PRINCIPAL,l);return t.NextResponse.json({exchange:u,replayed:c})}catch(e){if(e instanceof n.ExchangeError)return t.NextResponse.json((0,n.exchangeErrorBody)(e),{status:e.status});return console.error("Error cancelling exchange:",e instanceof Error?e.message:"unknown error"),t.NextResponse.json({error:{code:"internal_error",message:"The exchange could not be cancelled."}},{status:500})}}e.s(["POST",0,o])},32142,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),g=e.i(10372),v=e.i(93695),E=e.i(9580);e.i(52474);var x=e.i(220);let f=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/exchanges/[id]/cancel/route",pathname:"/api/exchanges/[id]/cancel",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/exchanges/[id]/cancel/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(38277),...{}}),{workAsyncStorage:m,workUnitAsyncStorage:w,serverHooks:C}=f;async function A(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),f.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let m="/api/exchanges/[id]/cancel/route";m=m.replace(/\/index$/,"")||"/";let w=await f.prepare(e,t,{srcPage:m,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:C,deploymentId:A,params:N,nextConfig:P,parsedUrl:T,isDraftMode:y,prerenderManifest:_,routerServerContext:O,isOnDemandRevalidate:S,revalidateOnlyGenerated:I,resolvedPathname:b,clientReferenceManifest:q,serverActionsManifest:H}=w,U=(0,s.normalizeAppPath)(m),k=!!_.routes[b]&&(f.isDev||(0,E.isRouteCacheOwner)(b,f.cacheOwner,_.routes[b])),M=!!(_.dynamicRoutes[U]||k),D=async()=>((null==O?void 0:O.render404)?await O.render404(e,t,T,!1):t.end("This page could not be found"),null);if(M&&!y){let e=_.dynamicRoutes[U];if(e&&!1===e.fallback&&!k){if(P.adapterPath)return await D();throw new v.NoFallbackError}}let j=null;!M||f.isDev||y||(j="/index"===(j=b)?"/":j);let L=!0===f.isDev||!M,F=M&&!L;H&&q&&(0,i.setManifestsSingleton)({page:m,clientReferenceManifest:q,serverActionsManifest:H});let B=e.method||"GET",K=(0,o.getTracer)(),$=K.getActiveScopeSpan(),G=!!(null==O?void 0:O.isWrappedByNextServer),W=!!(0,n.getRequestMeta)(e,"minimalMode"),V=(0,n.getRequestMeta)(e,"incrementalCache")||await f.getIncrementalCache(e,P,_,W);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let X={params:N,previewProps:_.preview,renderOpts:{experimental:{authInterrupts:!!P.experimental.authInterrupts,useCacheTimeout:P.experimental.useCacheTimeout},cacheComponents:!!P.cacheComponents,validationLevel:P.experimental.instantInsights.validationLevel,isDraftMode:y,supportsDynamicResponse:L,incrementalCache:V,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:P.cacheLife,staticPageGenerationTimeout:P.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>f.onRequestError(e,t,r,n,O)},sharedContext:{buildId:C,deploymentId:A}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),J=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:a})=>{try{if(!W&&S&&I&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await f.handle(J,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let o=X.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let i=X.renderOpts.collectedTags;if(!M)return await (0,p.sendResponse)(z,Z,n,o),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[g.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,r=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=g.INFINITE_CACHE?!1!==a&&a>0?P.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:x.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await f.onRequestError(e,t,{routerKind:"App Router",routePath:m,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:S})},!1,O),t}},Y=async(n,i)=>{try{var s,l;let n=await f.handleResponse({req:e,nextConfig:P,cacheKey:j,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:I,responseGenerator:Q,waitUntil:r.waitUntil,isMinimalMode:W});if(!M)return;if((null==n||null==(s=n.value)?void 0:s.kind)!==x.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});W||t.setHeader("x-nextjs-cache",S?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),y&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let o=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);W&&M||o.delete(g.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||o.get("Cache-Control")||o.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(n.value.body,{headers:o,status:n.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await f.onRequestError(e,t,{routerKind:"App Router",routePath:U,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:S})},!1,O),M)throw t;await (0,p.sendResponse)(z,Z,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:o.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let a=K.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==c.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route")||U,s=`${B} ${r}`;n.setAttributes({"next.route":r,"http.route":r,"next.span_name":s}),n.updateName(s),i&&i!==n&&(i.setAttribute("http.route",r),i.updateName(s))})()}};if(G&&$)await Y($,void 0);else{let t=K.getActiveScopeSpan();await K.withPropagatedContext(e.headers,()=>K.trace(c.BaseServerSpan.handleRequest,{spanName:`${B} ${m}`,kind:o.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},e=>Y(e,t)),void 0,!G)}}e.s(["handler",0,A,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:m,workUnitAsyncStorage:w})},"routeModule",0,f,"serverHooks",0,C,"workAsyncStorage",0,m,"workUnitAsyncStorage",0,w])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_09k38l1._.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports=[25180,e=>{"use strict";var t=e.i(69936);async function a(e,{params:n}){let{agentId:r,conversationId:i}=await n;return(0,t.handleGetConversation)(e,r,i)}e.s(["GET",0,a])},35209,e=>{"use strict";var t=e.i(47909),a=e.i(74017),n=e.i(96250),r=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),d=e.i(16795),l=e.i(87718),u=e.i(95169),c=e.i(47587),_=e.i(66012),p=e.i(70101),g=e.i(26937),h=e.i(10372),v=e.i(93695),E=e.i(9580);e.i(52474);var m=e.i(220);let R=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/v0/agents/[agentId]/conversations/[conversationId]/route",pathname:"/api/v0/agents/[agentId]/conversations/[conversationId]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/v0/agents/[agentId]/conversations/[conversationId]/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(25180),...{}}),{workAsyncStorage:b,workUnitAsyncStorage:f,serverHooks:A}=R;async function S(e,t,n){n.requestMeta&&(0,r.setRequestMeta)(e,n.requestMeta),R.isDev&&(0,r.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let b="/api/v0/agents/[agentId]/conversations/[conversationId]/route";b=b.replace(/\/index$/,"")||"/";let f=await R.prepare(e,t,{srcPage:b,multiZoneDraftMode:!1});if(!f)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:A,deploymentId:S,params:C,nextConfig:O,parsedUrl:w,isDraftMode:N,prerenderManifest:T,routerServerContext:q,isOnDemandRevalidate:x,revalidateOnlyGenerated:y,resolvedPathname:I,clientReferenceManifest:k,serverActionsManifest:H}=f,L=(0,o.normalizeAppPath)(b),P=!!T.routes[I]&&(R.isDev||(0,E.isRouteCacheOwner)(I,R.cacheOwner,T.routes[I])),M=!!(T.dynamicRoutes[L]||P),D=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,w,!1):t.end("This page could not be found"),null);if(M&&!N){let e=T.dynamicRoutes[L];if(e&&!1===e.fallback&&!P){if(O.adapterPath)return await D();throw new v.NoFallbackError}}let F=null;!M||R.isDev||N||(F="/index"===(F=I)?"/":F);let U=!0===R.isDev||!M,$=M&&!U;H&&k&&(0,s.setManifestsSingleton)({page:b,clientReferenceManifest:k,serverActionsManifest:H});let G=e.method||"GET",J=(0,i.getTracer)(),W=J.getActiveScopeSpan(),K=!!(null==q?void 0:q.isWrappedByNextServer),j=!!(0,r.getRequestMeta)(e,"minimalMode"),B=(0,r.getRequestMeta)(e,"incrementalCache")||await R.getIncrementalCache(e,O,T,j);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let X={params:C,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:N,supportsDynamicResponse:U,incrementalCache:B,hmrRefreshHash:(0,r.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,n,r)=>R.onRequestError(e,t,n,r,q)},sharedContext:{buildId:A,deploymentId:S}},V=new d.NodeNextRequest(e),z=new d.NodeNextResponse(t),Y=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:a})=>{try{if(!j&&x&&y&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await R.handle(Y,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let i=X.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let s=X.renderOpts.collectedTags;if(!M)return await (0,_.sendResponse)(V,z,r,i),null;{let e=await r.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(r.headers);s&&(t[h.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=h.INFINITE_CACHE?!1!==a&&a>0?O.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:n}}}}catch(t){throw(null==a?void 0:a.isStale)&&await R.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:x})},!1,q),t}},Q=async(r,s)=>{try{var o,d;let r=await R.handleResponse({req:e,nextConfig:O,cacheKey:F,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:x,revalidateOnlyGenerated:y,responseGenerator:Z,waitUntil:n.waitUntil,isMinimalMode:j});if(!M)return;if((null==r||null==(o=r.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==r||null==(d=r.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});j||t.setHeader("x-nextjs-cache",x?"REVALIDATED":r.isMiss?"MISS":r.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.fromNodeOutgoingHttpHeaders)(r.value.headers);j&&M||i.delete(h.NEXT_CACHE_TAGS_HEADER),!r.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,g.getCacheControlHeader)(r.cacheControl)),await (0,_.sendResponse)(V,z,new Response(r.value.body,{headers:i,status:r.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await R.onRequestError(e,t,{routerKind:"App Router",routePath:L,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:x})},!1,q),M)throw t;await (0,_.sendResponse)(V,z,new Response(null,{status:500}));return}finally{(()=>{if(!r)return;let e=t.statusCode;r.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(r.setStatus({code:i.SpanStatusCode.ERROR}),r.setAttribute("error.type",e.toString()));let a=J.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=a.get("next.route")||L,o=`${G} ${n}`;r.setAttributes({"next.route":n,"http.route":n,"next.span_name":o}),r.updateName(o),s&&s!==r&&(s.setAttribute("http.route",n),s.updateName(o))})()}};if(K&&W)await Q(W,void 0);else{let t=J.getActiveScopeSpan();await J.withPropagatedContext(e.headers,()=>J.trace(u.BaseServerSpan.handleRequest,{spanName:`${G} ${b}`,kind:i.SpanKind.SERVER,attributes:{"http.method":G,"http.target":e.url}},e=>Q(e,t)),void 0,!K)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:f})},"routeModule",0,R,"serverHooks",0,A,"workAsyncStorage",0,b,"workUnitAsyncStorage",0,f])},90027,e=>{"use strict";var t=e.i(62349);let a=["active","ended","all"],n=["implementation","revision"],r=`
|
|
2
|
-
SELECT b.*, bot.name AS agent_name, bot.agent AS agent_runtime, r.id AS origin_request_id, c.id AS origin_conversation_id,
|
|
3
|
-
c.type AS conversation_type, c.bot_id AS conversation_bot_id, tb.name AS thread_agent_name, g.name AS group_name,
|
|
4
|
-
r.intent AS request_intent, r.execution_kind AS request_kind, r.state AS request_state,
|
|
5
|
-
r.source_conversation_id AS request_conversation_id, r.target_agent_id AS request_target_agent_id,
|
|
6
|
-
sa.launch_snapshot AS source_snapshot, sa.finished_at AS source_finished_at,
|
|
7
|
-
(SELECT MAX(COALESCE(ra.finished_at, ra.started_at)) FROM work_attempts ra WHERE ra.resumed_session_binding_id = b.id) AS resumed_last_at
|
|
8
|
-
FROM session_bindings b
|
|
9
|
-
JOIN bots bot ON bot.id = b.agent_id
|
|
10
|
-
LEFT JOIN work_attempts sa ON sa.id = b.source_attempt_id
|
|
11
|
-
LEFT JOIN work_requests r ON r.id = COALESCE(b.request_id, sa.request_id)
|
|
12
|
-
LEFT JOIN conversations c ON c.id = COALESCE(b.conversation_id, r.source_conversation_id)
|
|
13
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
14
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
15
|
-
`;function i(e,t){let a=e?.[t];return"string"==typeof a&&a.trim().length>0?a:null}function s(e){let t=e.origin_conversation_id;return t?"group"===e.conversation_type?{id:t,kind:"group",label:e.group_name?`Group ${e.group_name}`:"Group thread",thread_agent_id:null}:"bot"===e.conversation_type&&e.conversation_bot_id?{id:t,kind:"direct",label:e.thread_agent_name?`${e.thread_agent_name} thread`:"Agent thread",thread_agent_id:e.thread_agent_name?e.conversation_bot_id:null}:{id:t,kind:"agent_api",label:"Agent API conversation",thread_agent_id:null}:null}function o(e){var a;let r,o=null;try{o=e.source_snapshot?JSON.parse(e.source_snapshot):null}catch{}let d=s(e),l=null===e.released_at?"active":"ended",u=((r=(e.request_intent??"").split("\n").map(e=>e.trim()).find(e=>e.length>0))?r.length>80?`${r.slice(0,79).trimEnd()}…`:r:null)??(d?.kind==="group"?d.label:null)??`${e.agent_name} \xb7 ${a=e.created_at,`${new Date(a).toISOString().slice(0,16).replace("T"," ")} UTC`}`;return{ref:e.id,agent:{id:e.agent_id,name:e.agent_name,adapter:e.adapter,transport:i(o,"transport")},title:u,status:l,resumable:null===e.released_at&&null!==e.request_id&&null!==e.request_kind&&n.includes(e.request_kind)&&e.request_target_agent_id===e.agent_id&&(e.conversation_id??"")===(e.request_conversation_id??"")&&e.adapter===(0,t.resolveAgent)({agent:e.agent_runtime}).agent,created_at:e.created_at,ended_at:e.released_at,last_activity_at:Math.max(e.created_at,e.released_at??0,e.source_finished_at??0,e.resumed_last_at??0),origin:{conversation:d,work_request:e.origin_request_id&&e.request_kind&&e.request_state?{id:e.origin_request_id,execution_kind:e.request_kind,state:e.request_state}:null},context:{workspace:i(o,"cwd"),deck:i(o,"deck")}}}function d(e,t){return t.last_activity_at-e.last_activity_at||t.created_at-e.created_at||(e.ref<t.ref?-1:+(e.ref>t.ref))}function l(e,t,a){return e.prepare(`${r} WHERE b.id = ? AND b.agent_id = ?`).get(a,t)}e.s(["agentExists",0,function(e,t){return!!e.prepare("SELECT 1 FROM bots WHERE id = ?").get(t)},"conversationRef",0,function(e,t){let a=e.prepare(`
|
|
16
|
-
SELECT c.id AS origin_conversation_id, c.type AS conversation_type, c.bot_id AS conversation_bot_id,
|
|
17
|
-
tb.name AS thread_agent_name, g.name AS group_name
|
|
18
|
-
FROM conversations c
|
|
19
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
20
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
21
|
-
WHERE c.id = ?
|
|
22
|
-
`).get(t);return a?s(a):null},"getAgentSession",0,function(e,t,a){let n=l(e,t,a);if(!n)return;let r=e.prepare(`
|
|
23
|
-
SELECT a.attempt_number, a.kind, a.request_id, a.outcome, a.started_at, a.finished_at,
|
|
24
|
-
CASE WHEN a.id = ? THEN 'source' ELSE 'resume' END AS role
|
|
25
|
-
FROM work_attempts a
|
|
26
|
-
WHERE a.id = ? OR a.resumed_session_binding_id = ?
|
|
27
|
-
ORDER BY a.started_at ASC, a.id ASC
|
|
28
|
-
`).all(n.source_attempt_id,n.source_attempt_id,n.id);return{...o(n),attempts:r}},"isSessionFilter",0,function(e){return"string"==typeof e&&a.includes(e)},"listAgentSessions",0,function(e,t,a="all"){return e.prepare(`${r} WHERE b.agent_id = ? ${"active"===a?"AND b.released_at IS NULL":"ended"===a?"AND b.released_at IS NOT NULL":""}`).all(t).map(o).sort(d)},"sessionDebugExternalId",0,function(e,t,a){return l(e,t,a)?.external_session_id},"sessionTitle",0,function(e,t,a){let n=l(e,t,a);return n?o(n).title:null}])}];
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=_0dlg5kj._.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports=[58119,e=>{"use strict";var t=e.i(69936);async function a(e,{params:n}){let{id:r}=await n;return(0,t.handleCancelExchange)(e,r)}e.s(["POST",0,a])},84429,e=>{"use strict";var t=e.i(47909),a=e.i(74017),n=e.i(96250),r=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),d=e.i(16795),l=e.i(87718),u=e.i(95169),c=e.i(47587),_=e.i(66012),p=e.i(70101),g=e.i(26937),h=e.i(10372),v=e.i(93695),E=e.i(9580);e.i(52474);var m=e.i(220);let R=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/v0/exchanges/[id]/cancel/route",pathname:"/api/v0/exchanges/[id]/cancel",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/v0/exchanges/[id]/cancel/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(58119),...{}}),{workAsyncStorage:b,workUnitAsyncStorage:f,serverHooks:A}=R;async function S(e,t,n){n.requestMeta&&(0,r.setRequestMeta)(e,n.requestMeta),R.isDev&&(0,r.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let b="/api/v0/exchanges/[id]/cancel/route";b=b.replace(/\/index$/,"")||"/";let f=await R.prepare(e,t,{srcPage:b,multiZoneDraftMode:!1});if(!f)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:A,deploymentId:S,params:C,nextConfig:O,parsedUrl:w,isDraftMode:N,prerenderManifest:T,routerServerContext:x,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,resolvedPathname:k,clientReferenceManifest:I,serverActionsManifest:P}=f,H=(0,o.normalizeAppPath)(b),L=!!T.routes[k]&&(R.isDev||(0,E.isRouteCacheOwner)(k,R.cacheOwner,T.routes[k])),M=!!(T.dynamicRoutes[H]||L),D=async()=>((null==x?void 0:x.render404)?await x.render404(e,t,w,!1):t.end("This page could not be found"),null);if(M&&!N){let e=T.dynamicRoutes[H];if(e&&!1===e.fallback&&!L){if(O.adapterPath)return await D();throw new v.NoFallbackError}}let F=null;!M||R.isDev||N||(F="/index"===(F=k)?"/":F);let U=!0===R.isDev||!M,$=M&&!U;P&&I&&(0,s.setManifestsSingleton)({page:b,clientReferenceManifest:I,serverActionsManifest:P});let J=e.method||"GET",W=(0,i.getTracer)(),K=W.getActiveScopeSpan(),j=!!(null==x?void 0:x.isWrappedByNextServer),B=!!(0,r.getRequestMeta)(e,"minimalMode"),G=(0,r.getRequestMeta)(e,"incrementalCache")||await R.getIncrementalCache(e,O,T,B);null==G||G.resetRequestCache(),globalThis.__incrementalCache=G;let X={params:C,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:N,supportsDynamicResponse:U,incrementalCache:G,hmrRefreshHash:(0,r.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,n,r)=>R.onRequestError(e,t,n,r,x)},sharedContext:{buildId:A,deploymentId:S}},V=new d.NodeNextRequest(e),z=new d.NodeNextResponse(t),Y=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:a})=>{try{if(!B&&q&&y&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await R.handle(Y,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let i=X.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let s=X.renderOpts.collectedTags;if(!M)return await (0,_.sendResponse)(V,z,r,i),null;{let e=await r.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(r.headers);s&&(t[h.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=h.INFINITE_CACHE?!1!==a&&a>0?O.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:n}}}}catch(t){throw(null==a?void 0:a.isStale)&&await R.onRequestError(e,t,{routerKind:"App Router",routePath:b,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:q})},!1,x),t}},Q=async(r,s)=>{try{var o,d;let r=await R.handleResponse({req:e,nextConfig:O,cacheKey:F,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,responseGenerator:Z,waitUntil:n.waitUntil,isMinimalMode:B});if(!M)return;if((null==r||null==(o=r.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==r||null==(d=r.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",q?"REVALIDATED":r.isMiss?"MISS":r.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.fromNodeOutgoingHttpHeaders)(r.value.headers);B&&M||i.delete(h.NEXT_CACHE_TAGS_HEADER),!r.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,g.getCacheControlHeader)(r.cacheControl)),await (0,_.sendResponse)(V,z,new Response(r.value.body,{headers:i,status:r.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await R.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:q})},!1,x),M)throw t;await (0,_.sendResponse)(V,z,new Response(null,{status:500}));return}finally{(()=>{if(!r)return;let e=t.statusCode;r.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(r.setStatus({code:i.SpanStatusCode.ERROR}),r.setAttribute("error.type",e.toString()));let a=W.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=a.get("next.route")||H,o=`${J} ${n}`;r.setAttributes({"next.route":n,"http.route":n,"next.span_name":o}),r.updateName(o),s&&s!==r&&(s.setAttribute("http.route",n),s.updateName(o))})()}};if(j&&K)await Q(K,void 0);else{let t=W.getActiveScopeSpan();await W.withPropagatedContext(e.headers,()=>W.trace(u.BaseServerSpan.handleRequest,{spanName:`${J} ${b}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":e.url}},e=>Q(e,t)),void 0,!j)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:b,workUnitAsyncStorage:f})},"routeModule",0,R,"serverHooks",0,A,"workAsyncStorage",0,b,"workUnitAsyncStorage",0,f])},90027,e=>{"use strict";var t=e.i(62349);let a=["active","ended","all"],n=["implementation","revision"],r=`
|
|
2
|
-
SELECT b.*, bot.name AS agent_name, bot.agent AS agent_runtime, r.id AS origin_request_id, c.id AS origin_conversation_id,
|
|
3
|
-
c.type AS conversation_type, c.bot_id AS conversation_bot_id, tb.name AS thread_agent_name, g.name AS group_name,
|
|
4
|
-
r.intent AS request_intent, r.execution_kind AS request_kind, r.state AS request_state,
|
|
5
|
-
r.source_conversation_id AS request_conversation_id, r.target_agent_id AS request_target_agent_id,
|
|
6
|
-
sa.launch_snapshot AS source_snapshot, sa.finished_at AS source_finished_at,
|
|
7
|
-
(SELECT MAX(COALESCE(ra.finished_at, ra.started_at)) FROM work_attempts ra WHERE ra.resumed_session_binding_id = b.id) AS resumed_last_at
|
|
8
|
-
FROM session_bindings b
|
|
9
|
-
JOIN bots bot ON bot.id = b.agent_id
|
|
10
|
-
LEFT JOIN work_attempts sa ON sa.id = b.source_attempt_id
|
|
11
|
-
LEFT JOIN work_requests r ON r.id = COALESCE(b.request_id, sa.request_id)
|
|
12
|
-
LEFT JOIN conversations c ON c.id = COALESCE(b.conversation_id, r.source_conversation_id)
|
|
13
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
14
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
15
|
-
`;function i(e,t){let a=e?.[t];return"string"==typeof a&&a.trim().length>0?a:null}function s(e){let t=e.origin_conversation_id;return t?"group"===e.conversation_type?{id:t,kind:"group",label:e.group_name?`Group ${e.group_name}`:"Group thread",thread_agent_id:null}:"bot"===e.conversation_type&&e.conversation_bot_id?{id:t,kind:"direct",label:e.thread_agent_name?`${e.thread_agent_name} thread`:"Agent thread",thread_agent_id:e.thread_agent_name?e.conversation_bot_id:null}:{id:t,kind:"agent_api",label:"Agent API conversation",thread_agent_id:null}:null}function o(e){var a;let r,o=null;try{o=e.source_snapshot?JSON.parse(e.source_snapshot):null}catch{}let d=s(e),l=null===e.released_at?"active":"ended",u=((r=(e.request_intent??"").split("\n").map(e=>e.trim()).find(e=>e.length>0))?r.length>80?`${r.slice(0,79).trimEnd()}…`:r:null)??(d?.kind==="group"?d.label:null)??`${e.agent_name} \xb7 ${a=e.created_at,`${new Date(a).toISOString().slice(0,16).replace("T"," ")} UTC`}`;return{ref:e.id,agent:{id:e.agent_id,name:e.agent_name,adapter:e.adapter,transport:i(o,"transport")},title:u,status:l,resumable:null===e.released_at&&null!==e.request_id&&null!==e.request_kind&&n.includes(e.request_kind)&&e.request_target_agent_id===e.agent_id&&(e.conversation_id??"")===(e.request_conversation_id??"")&&e.adapter===(0,t.resolveAgent)({agent:e.agent_runtime}).agent,created_at:e.created_at,ended_at:e.released_at,last_activity_at:Math.max(e.created_at,e.released_at??0,e.source_finished_at??0,e.resumed_last_at??0),origin:{conversation:d,work_request:e.origin_request_id&&e.request_kind&&e.request_state?{id:e.origin_request_id,execution_kind:e.request_kind,state:e.request_state}:null},context:{workspace:i(o,"cwd"),deck:i(o,"deck")}}}function d(e,t){return t.last_activity_at-e.last_activity_at||t.created_at-e.created_at||(e.ref<t.ref?-1:+(e.ref>t.ref))}function l(e,t,a){return e.prepare(`${r} WHERE b.id = ? AND b.agent_id = ?`).get(a,t)}e.s(["agentExists",0,function(e,t){return!!e.prepare("SELECT 1 FROM bots WHERE id = ?").get(t)},"conversationRef",0,function(e,t){let a=e.prepare(`
|
|
16
|
-
SELECT c.id AS origin_conversation_id, c.type AS conversation_type, c.bot_id AS conversation_bot_id,
|
|
17
|
-
tb.name AS thread_agent_name, g.name AS group_name
|
|
18
|
-
FROM conversations c
|
|
19
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
20
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
21
|
-
WHERE c.id = ?
|
|
22
|
-
`).get(t);return a?s(a):null},"getAgentSession",0,function(e,t,a){let n=l(e,t,a);if(!n)return;let r=e.prepare(`
|
|
23
|
-
SELECT a.attempt_number, a.kind, a.request_id, a.outcome, a.started_at, a.finished_at,
|
|
24
|
-
CASE WHEN a.id = ? THEN 'source' ELSE 'resume' END AS role
|
|
25
|
-
FROM work_attempts a
|
|
26
|
-
WHERE a.id = ? OR a.resumed_session_binding_id = ?
|
|
27
|
-
ORDER BY a.started_at ASC, a.id ASC
|
|
28
|
-
`).all(n.source_attempt_id,n.source_attempt_id,n.id);return{...o(n),attempts:r}},"isSessionFilter",0,function(e){return"string"==typeof e&&a.includes(e)},"listAgentSessions",0,function(e,t,a="all"){return e.prepare(`${r} WHERE b.agent_id = ? ${"active"===a?"AND b.released_at IS NULL":"ended"===a?"AND b.released_at IS NOT NULL":""}`).all(t).map(o).sort(d)},"sessionDebugExternalId",0,function(e,t,a){return l(e,t,a)?.external_session_id},"sessionTitle",0,function(e,t,a){let n=l(e,t,a);return n?o(n).title:null}])}];
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=_0dyculb._.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports=[8637,e=>{"use strict";var t=e.i(89171),n=e.i(62294),a=e.i(90027);async function r(e,{params:i}){try{let{id:r,ref:s}=await i;if(!(0,a.agentExists)(n.default,r))return t.NextResponse.json({error:"Agent not found"},{status:404});let o=(0,a.getAgentSession)(n.default,r,s);if(!o)return t.NextResponse.json({error:"Session not found"},{status:404});if("external_session_id"===new URL(e.url).searchParams.get("debug"))return t.NextResponse.json({session:o,debug:{external_session_id:(0,a.sessionDebugExternalId)(n.default,r,s)??null}});return t.NextResponse.json({session:o})}catch(e){return console.error("Error reading agent session:",e),t.NextResponse.json({error:"Failed to read session"},{status:500})}}e.s(["GET",0,r])},84098,e=>{"use strict";var t=e.i(47909),n=e.i(74017),a=e.i(96250),r=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),d=e.i(16795),u=e.i(87718),l=e.i(95169),c=e.i(47587),_=e.i(66012),p=e.i(70101),g=e.i(26937),h=e.i(10372),E=e.i(93695),m=e.i(9580);e.i(52474);var v=e.i(220);let R=new t.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/bots/[id]/sessions/[ref]/route",pathname:"/api/bots/[id]/sessions/[ref]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/bots/[id]/sessions/[ref]/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(8637),...{}}),{workAsyncStorage:f,workUnitAsyncStorage:b,serverHooks:A}=R;async function S(e,t,a){a.requestMeta&&(0,r.setRequestMeta)(e,a.requestMeta),R.isDev&&(0,r.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/bots/[id]/sessions/[ref]/route";f=f.replace(/\/index$/,"")||"/";let b=await R.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!b)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:A,deploymentId:S,params:C,nextConfig:N,parsedUrl:O,isDraftMode:w,prerenderManifest:x,routerServerContext:T,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,resolvedPathname:k,clientReferenceManifest:I,serverActionsManifest:L}=b,P=(0,o.normalizeAppPath)(f),H=!!x.routes[k]&&(R.isDev||(0,m.isRouteCacheOwner)(k,R.cacheOwner,x.routes[k])),M=!!(x.dynamicRoutes[P]||H),D=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,O,!1):t.end("This page could not be found"),null);if(M&&!w){let e=x.dynamicRoutes[P];if(e&&!1===e.fallback&&!H){if(N.adapterPath)return await D();throw new E.NoFallbackError}}let F=null;!M||R.isDev||w||(F="/index"===(F=k)?"/":F);let U=!0===R.isDev||!M,$=M&&!U;L&&I&&(0,s.setManifestsSingleton)({page:f,clientReferenceManifest:I,serverActionsManifest:L});let j=e.method||"GET",J=(0,i.getTracer)(),W=J.getActiveScopeSpan(),G=!!(null==T?void 0:T.isWrappedByNextServer),K=!!(0,r.getRequestMeta)(e,"minimalMode"),B=(0,r.getRequestMeta)(e,"incrementalCache")||await R.getIncrementalCache(e,N,x,K);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let X={params:C,previewProps:x.preview,renderOpts:{experimental:{authInterrupts:!!N.experimental.authInterrupts,useCacheTimeout:N.experimental.useCacheTimeout},cacheComponents:!!N.cacheComponents,validationLevel:N.experimental.instantInsights.validationLevel,isDraftMode:w,supportsDynamicResponse:U,incrementalCache:B,hmrRefreshHash:(0,r.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:N.cacheLife,staticPageGenerationTimeout:N.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,a,r)=>R.onRequestError(e,t,a,r,T)},sharedContext:{buildId:A,deploymentId:S}},V=new d.NodeNextRequest(e),z=new d.NodeNextResponse(t),Y=u.NextRequestAdapter.fromNodeNextRequest(V,(0,u.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:n})=>{try{if(!K&&q&&y&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await R.handle(Y,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let i=X.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let s=X.renderOpts.collectedTags;if(!M)return await (0,_.sendResponse)(V,z,r,i),null;{let e=await r.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(r.headers);s&&(t[h.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,a=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=h.INFINITE_CACHE?!1!==n&&n>0?N.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:a}}}}catch(t){throw(null==n?void 0:n.isStale)&&await R.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:q})},!1,T),t}},Q=async(r,s)=>{try{var o,d;let r=await R.handleResponse({req:e,nextConfig:N,cacheKey:F,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:x,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:K});if(!M)return;if((null==r||null==(o=r.value)?void 0:o.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==r||null==(d=r.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",q?"REVALIDATED":r.isMiss?"MISS":r.isStale?"STALE":"HIT"),w&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.fromNodeOutgoingHttpHeaders)(r.value.headers);K&&M||i.delete(h.NEXT_CACHE_TAGS_HEADER),!r.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,g.getCacheControlHeader)(r.cacheControl)),await (0,_.sendResponse)(V,z,new Response(r.value.body,{headers:i,status:r.value.status||200}));return}catch(t){if(t instanceof E.NoFallbackError||await R.onRequestError(e,t,{routerKind:"App Router",routePath:P,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:q})},!1,T),M)throw t;await (0,_.sendResponse)(V,z,new Response(null,{status:500}));return}finally{(()=>{if(!r)return;let e=t.statusCode;r.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(r.setStatus({code:i.SpanStatusCode.ERROR}),r.setAttribute("error.type",e.toString()));let n=J.getRootSpanAttributes();if(!n)return;if(n.get("next.span_type")!==l.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${n.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=n.get("next.route")||P,o=`${j} ${a}`;r.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),r.updateName(o),s&&s!==r&&(s.setAttribute("http.route",a),s.updateName(o))})()}};if(G&&W)await Q(W,void 0);else{let t=J.getActiveScopeSpan();await J.withPropagatedContext(e.headers,()=>J.trace(l.BaseServerSpan.handleRequest,{spanName:`${j} ${f}`,kind:i.SpanKind.SERVER,attributes:{"http.method":j,"http.target":e.url}},e=>Q(e,t)),void 0,!G)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:b})},"routeModule",0,R,"serverHooks",0,A,"workAsyncStorage",0,f,"workUnitAsyncStorage",0,b])},90027,e=>{"use strict";var t=e.i(62349);let n=["active","ended","all"],a=["implementation","revision"],r=`
|
|
2
|
-
SELECT b.*, bot.name AS agent_name, bot.agent AS agent_runtime, r.id AS origin_request_id, c.id AS origin_conversation_id,
|
|
3
|
-
c.type AS conversation_type, c.bot_id AS conversation_bot_id, tb.name AS thread_agent_name, g.name AS group_name,
|
|
4
|
-
r.intent AS request_intent, r.execution_kind AS request_kind, r.state AS request_state,
|
|
5
|
-
r.source_conversation_id AS request_conversation_id, r.target_agent_id AS request_target_agent_id,
|
|
6
|
-
sa.launch_snapshot AS source_snapshot, sa.finished_at AS source_finished_at,
|
|
7
|
-
(SELECT MAX(COALESCE(ra.finished_at, ra.started_at)) FROM work_attempts ra WHERE ra.resumed_session_binding_id = b.id) AS resumed_last_at
|
|
8
|
-
FROM session_bindings b
|
|
9
|
-
JOIN bots bot ON bot.id = b.agent_id
|
|
10
|
-
LEFT JOIN work_attempts sa ON sa.id = b.source_attempt_id
|
|
11
|
-
LEFT JOIN work_requests r ON r.id = COALESCE(b.request_id, sa.request_id)
|
|
12
|
-
LEFT JOIN conversations c ON c.id = COALESCE(b.conversation_id, r.source_conversation_id)
|
|
13
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
14
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
15
|
-
`;function i(e,t){let n=e?.[t];return"string"==typeof n&&n.trim().length>0?n:null}function s(e){let t=e.origin_conversation_id;return t?"group"===e.conversation_type?{id:t,kind:"group",label:e.group_name?`Group ${e.group_name}`:"Group thread",thread_agent_id:null}:"bot"===e.conversation_type&&e.conversation_bot_id?{id:t,kind:"direct",label:e.thread_agent_name?`${e.thread_agent_name} thread`:"Agent thread",thread_agent_id:e.thread_agent_name?e.conversation_bot_id:null}:{id:t,kind:"agent_api",label:"Agent API conversation",thread_agent_id:null}:null}function o(e){var n;let r,o=null;try{o=e.source_snapshot?JSON.parse(e.source_snapshot):null}catch{}let d=s(e),u=null===e.released_at?"active":"ended",l=((r=(e.request_intent??"").split("\n").map(e=>e.trim()).find(e=>e.length>0))?r.length>80?`${r.slice(0,79).trimEnd()}…`:r:null)??(d?.kind==="group"?d.label:null)??`${e.agent_name} \xb7 ${n=e.created_at,`${new Date(n).toISOString().slice(0,16).replace("T"," ")} UTC`}`;return{ref:e.id,agent:{id:e.agent_id,name:e.agent_name,adapter:e.adapter,transport:i(o,"transport")},title:l,status:u,resumable:null===e.released_at&&null!==e.request_id&&null!==e.request_kind&&a.includes(e.request_kind)&&e.request_target_agent_id===e.agent_id&&(e.conversation_id??"")===(e.request_conversation_id??"")&&e.adapter===(0,t.resolveAgent)({agent:e.agent_runtime}).agent,created_at:e.created_at,ended_at:e.released_at,last_activity_at:Math.max(e.created_at,e.released_at??0,e.source_finished_at??0,e.resumed_last_at??0),origin:{conversation:d,work_request:e.origin_request_id&&e.request_kind&&e.request_state?{id:e.origin_request_id,execution_kind:e.request_kind,state:e.request_state}:null},context:{workspace:i(o,"cwd"),deck:i(o,"deck")}}}function d(e,t){return t.last_activity_at-e.last_activity_at||t.created_at-e.created_at||(e.ref<t.ref?-1:+(e.ref>t.ref))}function u(e,t,n){return e.prepare(`${r} WHERE b.id = ? AND b.agent_id = ?`).get(n,t)}e.s(["agentExists",0,function(e,t){return!!e.prepare("SELECT 1 FROM bots WHERE id = ?").get(t)},"conversationRef",0,function(e,t){let n=e.prepare(`
|
|
16
|
-
SELECT c.id AS origin_conversation_id, c.type AS conversation_type, c.bot_id AS conversation_bot_id,
|
|
17
|
-
tb.name AS thread_agent_name, g.name AS group_name
|
|
18
|
-
FROM conversations c
|
|
19
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
20
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
21
|
-
WHERE c.id = ?
|
|
22
|
-
`).get(t);return n?s(n):null},"getAgentSession",0,function(e,t,n){let a=u(e,t,n);if(!a)return;let r=e.prepare(`
|
|
23
|
-
SELECT a.attempt_number, a.kind, a.request_id, a.outcome, a.started_at, a.finished_at,
|
|
24
|
-
CASE WHEN a.id = ? THEN 'source' ELSE 'resume' END AS role
|
|
25
|
-
FROM work_attempts a
|
|
26
|
-
WHERE a.id = ? OR a.resumed_session_binding_id = ?
|
|
27
|
-
ORDER BY a.started_at ASC, a.id ASC
|
|
28
|
-
`).all(a.source_attempt_id,a.source_attempt_id,a.id);return{...o(a),attempts:r}},"isSessionFilter",0,function(e){return"string"==typeof e&&n.includes(e)},"listAgentSessions",0,function(e,t,n="all"){return e.prepare(`${r} WHERE b.agent_id = ? ${"active"===n?"AND b.released_at IS NULL":"ended"===n?"AND b.released_at IS NOT NULL":""}`).all(t).map(o).sort(d)},"sessionDebugExternalId",0,function(e,t,n){return u(e,t,n)?.external_session_id},"sessionTitle",0,function(e,t,n){let a=u(e,t,n);return a?o(a).title:null}])}];
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=_0eig2jc._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[23241,e=>{"use strict";var t=e.i(89171),a=e.i(62294),r=e.i(45383),n=e.i(142),s=e.i(17834);async function o(e,{params:i}){let{id:l}=await i,d=await e.json().catch(()=>null),u=d?.decision;if("allow"!==u&&"deny"!==u)return t.NextResponse.json({error:{code:"invalid_request",message:"decision must be allow or deny."}},{status:400});try{let e=(0,r.decideWakeGrantCommand)(l,u,{category:"human_owner",principal:a.UI_OWNER_PRINCIPAL});return t.NextResponse.json({wakeId:e.wake.id,status:e.wake.status,reasonCode:e.wake.reason_code,requestId:e.request?.id??null,requestState:e.request?.state??null,grantId:e.grant?.id??null})}catch(e){if(e instanceof n.WakeSafetyError)return t.NextResponse.json({error:{code:e.code,message:e.message}},{status:e.status});if(e instanceof s.WakeRouterError)return t.NextResponse.json({error:{code:e.code,message:e.message}},{status:"not_found"===e.code?404:400});return console.error("Wake grant decision failed:",e),t.NextResponse.json({error:{code:"internal_error",message:"The decision could not be recorded."}},{status:500})}}e.s(["POST",0,o])},65848,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),v=e.i(10372),g=e.i(93695),w=e.i(9580);e.i(52474);var m=e.i(220);let f=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/wakes/[id]/decision/route",pathname:"/api/wakes/[id]/decision",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/wakes/[id]/decision/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(23241),...{}}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:x}=f;async function y(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),f.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/wakes/[id]/decision/route";E=E.replace(/\/index$/,"")||"/";let C=await f.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:x,deploymentId:y,params:A,nextConfig:T,parsedUrl:N,isDraftMode:P,prerenderManifest:S,routerServerContext:_,isOnDemandRevalidate:b,revalidateOnlyGenerated:k,resolvedPathname:O,clientReferenceManifest:q,serverActionsManifest:I}=C,H=(0,i.normalizeAppPath)(E),M=!!S.routes[O]&&(f.isDev||(0,w.isRouteCacheOwner)(O,f.cacheOwner,S.routes[O])),U=!!(S.dynamicRoutes[H]||M),D=async()=>((null==_?void 0:_.render404)?await _.render404(e,t,N,!1):t.end("This page could not be found"),null);if(U&&!P){let e=S.dynamicRoutes[H];if(e&&!1===e.fallback&&!M){if(T.adapterPath)return await D();throw new g.NoFallbackError}}let j=null;!U||f.isDev||P||(j="/index"===(j=O)?"/":j);let F=!0===f.isDev||!U,K=U&&!F;I&&q&&(0,o.setManifestsSingleton)({page:E,clientReferenceManifest:q,serverActionsManifest:I});let L=e.method||"GET",W=(0,s.getTracer)(),$=W.getActiveScopeSpan(),B=!!(null==_?void 0:_.isWrappedByNextServer),G=!!(0,n.getRequestMeta)(e,"minimalMode"),V=(0,n.getRequestMeta)(e,"incrementalCache")||await f.getIncrementalCache(e,T,S,G);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let X={params:A,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts,useCacheTimeout:T.experimental.useCacheTimeout},cacheComponents:!!T.cacheComponents,validationLevel:T.experimental.instantInsights.validationLevel,isDraftMode:P,supportsDynamicResponse:F,incrementalCache:V,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:T.cacheLife,staticPageGenerationTimeout:T.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>f.onRequestError(e,t,r,n,_)},sharedContext:{buildId:x,deploymentId:y}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),J=d.NextRequestAdapter.fromNodeNextRequest(z,(0,d.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:a})=>{try{if(!G&&b&&k&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await f.handle(J,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let s=X.renderOpts.pendingWaitUntil;s&&r.waitUntil&&(r.waitUntil(s),s=void 0);let o=X.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(z,Z,n,s),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);o&&(t[v.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,r=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==a&&a>0?T.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await f.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:b})},!1,_),t}},Y=async(n,o)=>{try{var i,l;let n=await f.handleResponse({req:e,nextConfig:T,cacheKey:j,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:b,revalidateOnlyGenerated:k,responseGenerator:Q,waitUntil:r.waitUntil,isMinimalMode:G});if(!U)return;if((null==n||null==(i=n.value)?void 0:i.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});G||t.setHeader("x-nextjs-cache",b?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),P&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);G&&U||s.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof g.NoFallbackError||await f.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:b})},!1,_),U)throw t;await (0,p.sendResponse)(z,Z,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let a=W.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route")||H,i=`${L} ${r}`;n.setAttributes({"next.route":r,"http.route":r,"next.span_name":i}),n.updateName(i),o&&o!==n&&(o.setAttribute("http.route",r),o.updateName(i))})()}};if(B&&$)await Y($,void 0);else{let t=W.getActiveScopeSpan();await W.withPropagatedContext(e.headers,()=>W.trace(u.BaseServerSpan.handleRequest,{spanName:`${L} ${E}`,kind:s.SpanKind.SERVER,attributes:{"http.method":L,"http.target":e.url}},e=>Y(e,t)),void 0,!B)}}e.s(["handler",0,y,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})},"routeModule",0,f,"serverHooks",0,x,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,C])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0ggf7vy._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[24834,e=>{"use strict";var t=e.i(89171),r=e.i(62294),n=e.i(10860),a=e.i(38636),i=e.i(62349);async function o(e,{params:s}){try{let{id:e}=await s,o=r.bots.getById(e);if(!o)return t.NextResponse.json({error:"Bot not found"},{status:404});let l=(0,n.readSkillState)(o.name),u=(0,a.hashSnapshot)((0,a.buildSnapshotInput)(o,l,r.memories.latestFacts(o.id))),d=r.launchSnapshots.listByBot(e).map(e=>({id:e.id,bot_id:e.bot_id,created_at:e.created_at,hash:e.hash,transport:e.transport,snapshot:JSON.parse(e.snapshot)}));return t.NextResponse.json({bot:(0,i.serializeBot)(o),skill:l,currentHash:u,snapshots:d})}catch(e){return console.error("Error fetching bot config:",e),t.NextResponse.json({error:"Failed to fetch bot config"},{status:500})}}e.s(["GET",0,o])},30124,e=>{"use strict";var t=e.i(47909),r=e.i(74017),n=e.i(96250),a=e.i(59756),i=e.i(61916),o=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),f=e.i(26937),m=e.i(10372),v=e.i(93695),R=e.i(9580);e.i(52474);var g=e.i(220);let _=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/bots/[id]/config/route",pathname:"/api/bots/[id]/config",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/bots/[id]/config/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(24834),...{}}),{workAsyncStorage:S,workUnitAsyncStorage:w,serverHooks:y}=_;async function E(e,t,n){n.requestMeta&&(0,a.setRequestMeta)(e,n.requestMeta),_.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let S="/api/bots/[id]/config/route";S=S.replace(/\/index$/,"")||"/";let w=await _.prepare(e,t,{srcPage:S,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:y,deploymentId:E,params:b,nextConfig:C,parsedUrl:k,isDraftMode:x,prerenderManifest:A,routerServerContext:T,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,resolvedPathname:O,clientReferenceManifest:I,serverActionsManifest:q}=w,H=(0,s.normalizeAppPath)(S),M=!!A.routes[O]&&(_.isDev||(0,R.isRouteCacheOwner)(O,_.cacheOwner,A.routes[O])),U=!!(A.dynamicRoutes[H]||M),D=async()=>((null==T?void 0:T.render404)?await T.render404(e,t,k,!1):t.end("This page could not be found"),null);if(U&&!x){let e=A.dynamicRoutes[H];if(e&&!1===e.fallback&&!M){if(C.adapterPath)return await D();throw new v.NoFallbackError}}let F=null;!U||_.isDev||x||(F="/index"===(F=O)?"/":F);let L=!0===_.isDev||!U,B=U&&!L;q&&I&&(0,o.setManifestsSingleton)({page:S,clientReferenceManifest:I,serverActionsManifest:q});let j=e.method||"GET",$=(0,i.getTracer)(),K=$.getActiveScopeSpan(),z=!!(null==T?void 0:T.isWrappedByNextServer),G=!!(0,a.getRequestMeta)(e,"minimalMode"),W=(0,a.getRequestMeta)(e,"incrementalCache")||await _.getIncrementalCache(e,C,A,G);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let Z={params:b,previewProps:A.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:x,supportsDynamicResponse:L,incrementalCache:W,hmrRefreshHash:(0,a.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,a)=>_.onRequestError(e,t,n,a,T)},sharedContext:{buildId:y,deploymentId:E}},V=new l.NodeNextRequest(e),X=new l.NodeNextResponse(t),J=u.NextRequestAdapter.fromNodeNextRequest(V,(0,u.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:r})=>{try{if(!G&&N&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await _.handle(J,Z);e.fetchMetrics=Z.renderOpts.fetchMetrics;let i=Z.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let o=Z.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(V,X,a,i),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);o&&(t[m.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==Z.renderOpts.collectedRevalidate&&!(Z.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&Z.renderOpts.collectedRevalidate,n=void 0===Z.renderOpts.collectedExpire||Z.renderOpts.collectedExpire>=m.INFINITE_CACHE?!1!==r&&r>0?C.expireTime:void 0:Z.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await _.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:B,isOnDemandRevalidate:N})},!1,T),t}},Y=async(a,o)=>{try{var s,l;let a=await _.handleResponse({req:e,nextConfig:C,cacheKey:F,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:A,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:P,responseGenerator:Q,waitUntil:n.waitUntil,isMinimalMode:G});if(!U)return;if((null==a||null==(s=a.value)?void 0:s.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==a||null==(l=a.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});G||t.setHeader("x-nextjs-cache",N?"REVALIDATED":a.isMiss?"MISS":a.isStale?"STALE":"HIT"),x&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,h.fromNodeOutgoingHttpHeaders)(a.value.headers);G&&U||i.delete(m.NEXT_CACHE_TAGS_HEADER),!a.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,f.getCacheControlHeader)(a.cacheControl)),await (0,p.sendResponse)(V,X,new Response(a.value.body,{headers:i,status:a.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await _.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:B,isOnDemandRevalidate:N})},!1,T),U)throw t;await (0,p.sendResponse)(V,X,new Response(null,{status:500}));return}finally{(()=>{if(!a)return;let e=t.statusCode;a.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(a.setStatus({code:i.SpanStatusCode.ERROR}),a.setAttribute("error.type",e.toString()));let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route")||H,s=`${j} ${n}`;a.setAttributes({"next.route":n,"http.route":n,"next.span_name":s}),a.updateName(s),o&&o!==a&&(o.setAttribute("http.route",n),o.updateName(s))})()}};if(z&&K)await Y(K,void 0);else{let t=$.getActiveScopeSpan();await $.withPropagatedContext(e.headers,()=>$.trace(d.BaseServerSpan.handleRequest,{spanName:`${j} ${S}`,kind:i.SpanKind.SERVER,attributes:{"http.method":j,"http.target":e.url}},e=>Y(e,t)),void 0,!z)}}e.s(["handler",0,E,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:S,workUnitAsyncStorage:w})},"routeModule",0,_,"serverHooks",0,y,"workAsyncStorage",0,S,"workUnitAsyncStorage",0,w])},10860,e=>{"use strict";var t=e.i(22734),r=e.i(14747),n=e.i(52036);function a(e){if(!/^[A-Za-z0-9_-]+$/.test(e))return null;let a=(0,n.skillsRootPath)(),i=r.default.resolve(a,e,"SKILL.md");if(!i.startsWith(a+r.default.sep))return null;try{let e=t.default.readFileSync(i,"utf8");return e.trim()?e:null}catch{return null}}function i(e){return/^[A-Za-z0-9_-]+$/.test(e)}function o(e){if(!e)return null;let t=a(e);if(!t)return null;let r=t.match(/ends with the exact token\s+(\S+)/i);return r?r[1]:null}function s(e){return i(e)?`skills/${e}/SKILL.md`:null}e.s(["applySkillEndToken",0,function(e,t){let r=o(e);return r?t?t.trimEnd().endsWith(r)?t:t+"\n"+r:r:t},"isSupportedSkillName",0,i,"localSkillForBot",0,a,"readSkillState",0,function(e){let t=s(e);if(!t)return{path:null,present:!1,content:null,status:"unsupported"};let r=a(e);return null===r?{path:t,present:!1,content:null,status:"absent"}:{path:t,present:!0,content:r,status:"present"}},"skillEndToken",0,o,"writeSkillForBot",0,function(e,a){let i=s(e);if(!i)throw Error("Skill files need a bot name matching /^[A-Za-z0-9_-]+$/");let o=(0,n.skillsRootPath)(),l=r.default.resolve(o,e,"SKILL.md");if(!l.startsWith(o+r.default.sep))throw Error("Skill files need a bot name matching /^[A-Za-z0-9_-]+$/");if(!a.trim()){try{t.default.rmSync(l)}catch{}return{path:i,present:!1,content:null,status:"absent"}}return t.default.mkdirSync(r.default.dirname(l),{recursive:!0}),t.default.writeFileSync(l,a),{path:i,present:!0,content:a,status:"present"}}])},38636,(e,t,r)=>{let{createHash:n}=e.r(54799);function a(e){if(Array.isArray(e))return e.map(a);if(null!==e&&"object"==typeof e){let t={};for(let r of Object.keys(e).sort())t[r]=a(e[r]);return t}return e}function i(e){return JSON.stringify(a(e))}function o(e){return null==e?null:String(e)}function s(e){return null==e?null:String(e).trim()||null}t.exports={sortKeysDeep:a,canonicalJson:i,hashSnapshot:function(e){return n("sha256").update(i(e),"utf8").digest("hex")},buildSnapshotInput:function(e,t,r=null){let n=s(e.agent)||"hermes",a=s(e.deck_id);return{agent:n,avatar_accessory:o(e.avatar_accessory),avatar_color:o(e.avatar_color),avatar_eyes:o(e.avatar_eyes),avatar_hands:o(e.avatar_hands),deck_id:a,deck_name:s(e.deck_name),description:null===e.description||void 0===e.description?"":String(e.description),import_operation_id:o(e.import_operation_id),import_schema_version:o(e.import_schema_version),memories:null==r?null:r.map(e=>String(e)),name:String(e.name),needs_deck_selection:null===a||function(e){if(!0===e||1===e)return!0;if("string"==typeof e){let t=e.trim().toLowerCase();return"1"===t||"true"===t}return!1}(e.needs_deck_selection),skill_content:o(t.content),skill_path:o(t.path),skill_present:null===t.present||void 0===t.present?null:!!t.present,source_provider:o(e.source_provider),template_id:o(e.template_id),template_url:o(e.template_url),title:null===e.title||void 0===e.title?"":String(e.title),working_directory:s(e.working_directory)}}}}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0gtqbub._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[20570,e=>{"use strict";var t=e.i(89171),r=e.i(62294);async function a(e){try{let a,{searchParams:n}=new URL(e.url),o=n.get("botId"),i=n.get("groupId");if(o?a=r.conversations.getByBotId(o):i&&(a=r.conversations.getByGroupId(i)),!a)return t.NextResponse.json({error:"Conversation not found"},{status:404});return t.NextResponse.json(a)}catch(e){return console.error("Error fetching conversation:",e),t.NextResponse.json({error:"Failed to fetch conversation"},{status:500})}}e.s(["GET",0,a])},16906,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),v=e.i(10372),g=e.i(93695),f=e.i(9580);e.i(52474);var E=e.i(220);let m=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/conversations/route",pathname:"/api/conversations",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/conversations/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(20570),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:C,serverHooks:x}=m;async function A(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),m.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/conversations/route";w=w.replace(/\/index$/,"")||"/";let C=await m.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:x,deploymentId:A,params:y,nextConfig:T,parsedUrl:N,isDraftMode:P,prerenderManifest:S,routerServerContext:b,isOnDemandRevalidate:O,revalidateOnlyGenerated:_,resolvedPathname:I,clientReferenceManifest:q,serverActionsManifest:H}=C,M=(0,s.normalizeAppPath)(w),U=!!S.routes[I]&&(m.isDev||(0,f.isRouteCacheOwner)(I,m.cacheOwner,S.routes[I])),D=!!(S.dynamicRoutes[M]||U),k=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,N,!1):t.end("This page could not be found"),null);if(D&&!P){let e=S.dynamicRoutes[M];if(e&&!1===e.fallback&&!U){if(T.adapterPath)return await k();throw new g.NoFallbackError}}let j=null;!D||m.isDev||P||(j="/index"===(j=I)?"/":j);let B=!0===m.isDev||!D,F=D&&!B;H&&q&&(0,i.setManifestsSingleton)({page:w,clientReferenceManifest:q,serverActionsManifest:H});let K=e.method||"GET",L=(0,o.getTracer)(),G=L.getActiveScopeSpan(),$=!!(null==b?void 0:b.isWrappedByNextServer),V=!!(0,n.getRequestMeta)(e,"minimalMode"),X=(0,n.getRequestMeta)(e,"incrementalCache")||await m.getIncrementalCache(e,T,S,V);null==X||X.resetRequestCache(),globalThis.__incrementalCache=X;let W={params:y,previewProps:S.preview,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts,useCacheTimeout:T.experimental.useCacheTimeout},cacheComponents:!!T.cacheComponents,validationLevel:T.experimental.instantInsights.validationLevel,isDraftMode:P,supportsDynamicResponse:B,incrementalCache:X,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:T.cacheLife,staticPageGenerationTimeout:T.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>m.onRequestError(e,t,a,n,b)},sharedContext:{buildId:x,deploymentId:A}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),J=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:r})=>{try{if(!V&&O&&_&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await m.handle(J,W);e.fetchMetrics=W.renderOpts.fetchMetrics;let o=W.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let i=W.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(z,Z,n,o),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[v.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,a=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==r&&r>0?T.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:E.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await m.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:O})},!1,b),t}},Y=async(n,i)=>{try{var s,l;let n=await m.handleResponse({req:e,nextConfig:T,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:S,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:_,responseGenerator:Q,waitUntil:a.waitUntil,isMinimalMode:V});if(!D)return;if((null==n||null==(s=n.value)?void 0:s.kind)!==E.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});V||t.setHeader("x-nextjs-cache",O?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),P&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let o=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);V&&D||o.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||o.get("Cache-Control")||o.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(n.value.body,{headers:o,status:n.value.status||200}));return}catch(t){if(t instanceof g.NoFallbackError||await m.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:O})},!1,b),D)throw t;await (0,p.sendResponse)(z,Z,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:o.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=L.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||M,s=`${K} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":s}),n.updateName(s),i&&i!==n&&(i.setAttribute("http.route",a),i.updateName(s))})()}};if($&&G)await Y(G,void 0);else{let t=L.getActiveScopeSpan();await L.withPropagatedContext(e.headers,()=>L.trace(d.BaseServerSpan.handleRequest,{spanName:`${K} ${w}`,kind:o.SpanKind.SERVER,attributes:{"http.method":K,"http.target":e.url}},e=>Y(e,t)),void 0,!$)}}e.s(["handler",0,A,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:C})},"routeModule",0,m,"serverHooks",0,x,"workAsyncStorage",0,w,"workUnitAsyncStorage",0,C])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0i7ga8c._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[72938,e=>{"use strict";var t=e.i(89171),r=e.i(62294),a=e.i(35631);async function n(){try{let e=(0,a.loadServiceGrants)(),n="loaded"===e.state?[...e.grants.entries()].map(([e,t])=>({service:e,agents:[...t.entries()].map(([e,t])=>({agent_id:e,agent_name:r.bots.getById(e)?.name??null,capabilities:a.SERVICE_CAPABILITIES.filter(e=>t.has(e))}))})):[];return t.NextResponse.json({state:e.state,path:e.path,reason:"invalid"===e.state?e.reason:null,services:n,audit:r.serviceAudit.list({limit:50})})}catch(e){return console.error("Error reading service grants:",e instanceof Error?e.message:"unknown error"),t.NextResponse.json({error:{code:"internal_error",message:"The service grants could not be read."}},{status:500})}}e.s(["GET",0,n])},87039,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),i=e.i(74677),o=e.i(69741),l=e.i(16795),u=e.i(87718),c=e.i(95169),d=e.i(47587),h=e.i(66012),p=e.i(70101),f=e.i(26937),g=e.i(10372),v=e.i(93695),m=e.i(9580);e.i(52474);var w=e.i(220);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/service-grants/route",pathname:"/api/service-grants",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/service-grants/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(72938),...{}}),{workAsyncStorage:R,workUnitAsyncStorage:b,serverHooks:A}=E;async function S(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),E.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let R="/api/service-grants/route";R=R.replace(/\/index$/,"")||"/";let b=await E.prepare(e,t,{srcPage:R,multiZoneDraftMode:!1});if(!b)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:A,deploymentId:S,params:y,nextConfig:C,parsedUrl:T,isDraftMode:x,prerenderManifest:_,routerServerContext:N,isOnDemandRevalidate:O,revalidateOnlyGenerated:I,resolvedPathname:$,clientReferenceManifest:P,serverActionsManifest:H}=b,k=(0,o.normalizeAppPath)(R),M=!!_.routes[$]&&(E.isDev||(0,m.isRouteCacheOwner)($,E.cacheOwner,_.routes[$])),q=!!(_.dynamicRoutes[k]||M),j=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,T,!1):t.end("This page could not be found"),null);if(q&&!x){let e=_.dynamicRoutes[k];if(e&&!1===e.fallback&&!M){if(C.adapterPath)return await j();throw new v.NoFallbackError}}let B=null;!q||E.isDev||x||(B="/index"===(B=$)?"/":B);let U=!0===E.isDev||!q,D=q&&!U;H&&P&&(0,i.setManifestsSingleton)({page:R,clientReferenceManifest:P,serverActionsManifest:H});let F=e.method||"GET",G=(0,s.getTracer)(),K=G.getActiveScopeSpan(),L=!!(null==N?void 0:N.isWrappedByNextServer),z=!!(0,n.getRequestMeta)(e,"minimalMode"),V=(0,n.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,C,_,z);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let Z={params:y,previewProps:_.preview,renderOpts:{experimental:{authInterrupts:!!C.experimental.authInterrupts,useCacheTimeout:C.experimental.useCacheTimeout},cacheComponents:!!C.cacheComponents,validationLevel:C.experimental.instantInsights.validationLevel,isDraftMode:x,supportsDynamicResponse:U,incrementalCache:V,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:C.cacheLife,staticPageGenerationTimeout:C.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>E.onRequestError(e,t,a,n,N)},sharedContext:{buildId:A,deploymentId:S}},X=new l.NodeNextRequest(e),J=new l.NodeNextResponse(t),W=u.NextRequestAdapter.fromNodeNextRequest(X,(0,u.signalFromNodeResponse)(t)),Y=async({previousCacheEntry:r})=>{try{if(!z&&O&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await E.handle(W,Z);e.fetchMetrics=Z.renderOpts.fetchMetrics;let s=Z.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let i=Z.renderOpts.collectedTags;if(!q)return await (0,h.sendResponse)(X,J,n,s),null;{let e=await n.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[g.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==Z.renderOpts.collectedRevalidate&&!(Z.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&Z.renderOpts.collectedRevalidate,a=void 0===Z.renderOpts.collectedExpire||Z.renderOpts.collectedExpire>=g.INFINITE_CACHE?!1!==r&&r>0?C.expireTime:void 0:Z.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:R,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:O})},!1,N),t}},Q=async(n,i)=>{try{var o,l;let n=await E.handleResponse({req:e,nextConfig:C,cacheKey:B,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:I,responseGenerator:Y,waitUntil:a.waitUntil,isMinimalMode:z});if(!q)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});z||t.setHeader("x-nextjs-cache",O?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),x&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,p.fromNodeOutgoingHttpHeaders)(n.value.headers);z&&q||s.delete(g.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,f.getCacheControlHeader)(n.cacheControl)),await (0,h.sendResponse)(X,J,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:k,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:D,isOnDemandRevalidate:O})},!1,N),q)throw t;await (0,h.sendResponse)(X,J,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=G.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||k,o=`${F} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),n.updateName(o),i&&i!==n&&(i.setAttribute("http.route",a),i.updateName(o))})()}};if(L&&K)await Q(K,void 0);else{let t=G.getActiveScopeSpan();await G.withPropagatedContext(e.headers,()=>G.trace(c.BaseServerSpan.handleRequest,{spanName:`${F} ${R}`,kind:s.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},e=>Q(e,t)),void 0,!L)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:R,workUnitAsyncStorage:b})},"routeModule",0,E,"serverHooks",0,A,"workAsyncStorage",0,R,"workUnitAsyncStorage",0,b])},35631,26571,e=>{"use strict";var t=e.i(22734),r=e.i(14747),a=e.i(54799),n=e.i(62294),s=e.i(52036);let i="BOTMANCERS_SERVICE_TOKENS",o=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,l=/^sha256:([0-9a-f]{64})$/;class u extends Error{constructor(e){super(e),this.name="ServiceTokenConfigError"}}function c(e){if(!e||!e.trim())return[];let t=[],r=new Set;for(let a of e.split(/[,\s]+/).filter(Boolean)){let e=a.indexOf("="),n=e>0?a.slice(0,e):"",s=l.exec(e>0?a.slice(e+1).toLowerCase():"");if(!o.test(n)||!s)throw new u(`${i} entries must be <service-id>=sha256:<64 hex digits>.`);if(r.has(n))throw new u(`${i} lists service ${n} twice.`);r.add(n),t.push({serviceId:n,digest:Buffer.from(s[1],"hex")})}return t}e.s(["SERVICE_TOKENS_ENV",0,i,"ServiceTokenConfigError",0,u,"parseServiceTokens",0,c,"serviceTokenAuthenticatorFromEnv",0,function(e=process.env){let t=c(e[i]);return t.length?e=>{let r,n,s=(n=(r=e.headers.get("authorization"))?/^Bearer[ \t]+(\S+)[ \t]*$/i.exec(r):null)?n[1]:null;if(!s||s.length>4096)return null;let i=(0,a.createHash)("sha256").update(s,"utf8").digest(),o=null;for(let e of t)(0,a.timingSafeEqual)(i,e.digest)&&null===o&&(o=e.serviceId);return o?{kind:"service",id:o}:null}:null}],26571);let d=["agents:read","sessions:read","conversations:read","sessions:message","exchanges:read","exchanges:create"],h=["botmancers-exchanges","botmancers-engine"],p=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,f=/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;class g extends Error{constructor(e){super(e),this.name="ServiceGrantsError"}}function v(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function m(e,t,r){let a=Object.keys(e).find(e=>!t.includes(e));if(void 0!==a)throw new g(`${r} has an unknown field "${a}".`)}let w=null;e.s(["EXCHANGE_KEY_PREFIX",0,"exchange:","MESSAGE_KEY_PREFIX",0,"message:","SERVICE_CAPABILITIES",0,d,"loadServiceGrants",0,function(e=process.env){let o,l=function(e=process.env){let t=(e.BOTMANCERS_SERVICE_GRANTS_PATH||"").trim();if(t)return r.default.resolve(t);let a=(0,s.botmancersHome)(e);return a?r.default.join(a,"config/service-grants.json"):null}(e);if(!l)return{state:"absent",path:null};try{o=t.default.statSync(l)}catch(e){if("ENOENT"===e.code)return{state:"absent",path:l};return{state:"invalid",path:l,reason:"The document cannot be read."}}let E=(0,a.createHash)("sha256").update(e[i]??"","utf8").digest("hex"),R=new Set(n.default.prepare("SELECT id FROM bots").all().map(e=>e.id)),b=(0,a.createHash)("sha256").update([...R].sort().join("\n"),"utf8").digest("hex"),A=[l,o.ino,o.size,o.mode,o.uid,o.mtimeMs,E,b].join(":");if(w&&w.key===A)return w.state;let S=function(e,r,a,n){let s;if(!r.isFile())return{state:"invalid",path:e,reason:"The document is not a regular file."};if("function"==typeof process.getuid&&r.uid!==process.getuid())return{state:"invalid",path:e,reason:"The document must be owned by the user running Botmancers."};if((63&r.mode)!=0)return{state:"invalid",path:e,reason:"The document must not be readable or writable by group or others (chmod 600)."};if("string"==typeof a)return{state:"invalid",path:e,reason:a};if(r.size>65536)return{state:"invalid",path:e,reason:"The document exceeds 65536 bytes."};try{s=t.default.readFileSync(e,"utf8")}catch{return{state:"invalid",path:e,reason:"The document cannot be read."}}try{return{state:"loaded",path:e,grants:function(e,t,r){let a;try{a=JSON.parse(e)}catch{throw new g("The document is not valid JSON.")}if(!v(a))throw new g("The document must be a JSON object.");if(m(a,["version","grants"],"The document"),1!==a.version)throw new g("version must be 1.");if(!Array.isArray(a.grants))throw new g("grants must be a list.");if(a.grants.length>512)throw new g("grants has more than 512 entries.");let n=new Map;return a.grants.forEach((e,a)=>{let s=`grants[${a}]`;if(!v(e))throw new g(`${s} must be an object.`);m(e,["service","agent","capabilities"],s);let{service:o,agent:l,capabilities:u}=e;if("string"!=typeof o||!p.test(o))throw new g(`${s}.service must be a configured service id (letters, digits, ".", "_", "-").`);if(h.includes(o))throw new g(`${s}.service names a reserved engine principal.`);if(t&&!t.has(o))throw new g(`${s}.service is not a configured service principal (${i}).`);if("string"!=typeof l||!f.test(l))throw new g(`${s}.agent must be one Agent id; wildcards are not allowed.`);if(r&&!r.has(l))throw new g(`${s}.agent is not a registered Agent.`);if(!Array.isArray(u)||0===u.length)throw new g(`${s}.capabilities must list at least one capability.`);let c=new Set;for(let e of u){if(!("string"==typeof e&&d.includes(e)))throw new g(`${s}.capabilities has an unknown capability.`);if(c.has(e))throw new g(`${s}.capabilities lists ${e} twice.`);c.add(e)}let w=n.get(o)??new Map;if(w.has(l))throw new g(`${s} repeats the grant of service ${o} for that Agent.`);w.set(l,c),n.set(o,w)}),n}(s,a,n)}}catch(t){if(t instanceof g)return{state:"invalid",path:e,reason:t.message};throw t}}(l,o,function(e){try{return new Set(c(e[i]).map(e=>e.serviceId))}catch(e){if(e instanceof u)return`${i} is malformed, so no grant can name a configured service.`;throw e}}(e),R);return w={key:A,state:S},S}],35631)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0kghtb6._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[43272,e=>{"use strict";var t=e.i(89171),r=e.i(62294);async function a(e,{params:n}){try{let{id:a}=await n,s=r.messages.getById(a);if(!s)return t.NextResponse.json({error:"Message not found"},{status:404});let{searchParams:o}=new URL(e.url),i=o.get("other")||o.get("to")||o.get("target")||o.get("end");if(!i)return t.NextResponse.json({error:"Other message id is required (other, to, target, or end)"},{status:400});let l=r.messages.getById(i);if(!l)return t.NextResponse.json({error:"Other message not found"},{status:404});if(l.conversation_id!==s.conversation_id)return t.NextResponse.json({error:"Messages are in different conversations"},{status:400});let u=(r.messages.getBetween(a,i)??[]).map(e=>{if("bot"===e.sender_type&&e.sender_id){let t=r.bots.getById(e.sender_id);return{...e,sender_name:t?.name}}return e});return t.NextResponse.json(u)}catch(e){return console.error("Error fetching messages between:",e),t.NextResponse.json({error:"Failed to fetch messages between"},{status:500})}}e.s(["GET",0,a])},84296,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),s=e.i(61916),o=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),g=e.i(10372),v=e.i(93695),m=e.i(9580);e.i(52474);var f=e.i(220);let w=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/messages/[id]/between/route",pathname:"/api/messages/[id]/between",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/messages/[id]/between/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(43272),...{}}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:x}=w;async function y(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),w.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/messages/[id]/between/route";E=E.replace(/\/index$/,"")||"/";let C=await w.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:x,deploymentId:y,params:b,nextConfig:A,parsedUrl:T,isDraftMode:N,prerenderManifest:_,routerServerContext:P,isOnDemandRevalidate:S,revalidateOnlyGenerated:O,resolvedPathname:q,clientReferenceManifest:I,serverActionsManifest:H}=C,M=(0,i.normalizeAppPath)(E),U=!!_.routes[q]&&(w.isDev||(0,m.isRouteCacheOwner)(q,w.cacheOwner,_.routes[q])),D=!!(_.dynamicRoutes[M]||U),j=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,T,!1):t.end("This page could not be found"),null);if(D&&!N){let e=_.dynamicRoutes[M];if(e&&!1===e.fallback&&!U){if(A.adapterPath)return await j();throw new v.NoFallbackError}}let k=null;!D||w.isDev||N||(k="/index"===(k=q)?"/":k);let B=!0===w.isDev||!D,F=D&&!B;H&&I&&(0,o.setManifestsSingleton)({page:E,clientReferenceManifest:I,serverActionsManifest:H});let K=e.method||"GET",L=(0,s.getTracer)(),$=L.getActiveScopeSpan(),G=!!(null==P?void 0:P.isWrappedByNextServer),V=!!(0,n.getRequestMeta)(e,"minimalMode"),X=(0,n.getRequestMeta)(e,"incrementalCache")||await w.getIncrementalCache(e,A,_,V);null==X||X.resetRequestCache(),globalThis.__incrementalCache=X;let W={params:b,previewProps:_.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,isDraftMode:N,supportsDynamicResponse:B,incrementalCache:X,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>w.onRequestError(e,t,a,n,P)},sharedContext:{buildId:x,deploymentId:y}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),J=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:r})=>{try{if(!V&&S&&O&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await w.handle(J,W);e.fetchMetrics=W.renderOpts.fetchMetrics;let s=W.renderOpts.pendingWaitUntil;s&&a.waitUntil&&(a.waitUntil(s),s=void 0);let o=W.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(z,Z,n,s),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);o&&(t[g.NEXT_CACHE_TAGS_HEADER]=o),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,a=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=g.INFINITE_CACHE?!1!==r&&r>0?A.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await w.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:S})},!1,P),t}},Y=async(n,o)=>{try{var i,l;let n=await w.handleResponse({req:e,nextConfig:A,cacheKey:k,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:_,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:O,responseGenerator:Q,waitUntil:a.waitUntil,isMinimalMode:V});if(!D)return;if((null==n||null==(i=n.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});V||t.setHeader("x-nextjs-cache",S?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let s=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);V&&D||s.delete(g.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||s.get("Cache-Control")||s.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(n.value.body,{headers:s,status:n.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await w.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:F,isOnDemandRevalidate:S})},!1,P),D)throw t;await (0,p.sendResponse)(z,Z,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:s.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=L.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||M,i=`${K} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":i}),n.updateName(i),o&&o!==n&&(o.setAttribute("http.route",a),o.updateName(i))})()}};if(G&&$)await Y($,void 0);else{let t=L.getActiveScopeSpan();await L.withPropagatedContext(e.headers,()=>L.trace(d.BaseServerSpan.handleRequest,{spanName:`${K} ${E}`,kind:s.SpanKind.SERVER,attributes:{"http.method":K,"http.target":e.url}},e=>Y(e,t)),void 0,!G)}}e.s(["handler",0,y,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})},"routeModule",0,w,"serverHooks",0,x,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,C])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0orubev._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[18150,e=>{"use strict";var t=e.i(89171),a=e.i(62294),r=e.i(62349);async function n(){try{let e=a.bots.managementRows().map(e=>{let t=(0,r.serializeBot)(e.bot);return{id:e.bot.id,name:e.bot.name,hidden:+!!e.bot.hidden,agent:t.agent,deck_id:t.deck_id,deck_name:t.deck_name,needs_deck_selection:t.needs_deck_selection,source_provider:e.bot.source_provider??null,created_at:e.bot.created_at,last_activity:e.last_activity,blocked:e.blocked}});return t.NextResponse.json(e)}catch(e){return console.error("Error listing agents for management:",e),t.NextResponse.json({error:"Failed to list agents"},{status:500})}}e.s(["GET",0,n])},84629,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),o=e.i(61916),i=e.i(74677),s=e.i(69741),l=e.i(16795),d=e.i(87718),u=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),v=e.i(10372),m=e.i(93695),g=e.i(9580);e.i(52474);var f=e.i(220);let E=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/bots/manage/route",pathname:"/api/bots/manage",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/bots/manage/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(18150),...{}}),{workAsyncStorage:w,workUnitAsyncStorage:C,serverHooks:b}=E;async function x(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),E.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/bots/manage/route";w=w.replace(/\/index$/,"")||"/";let C=await E.prepare(e,t,{srcPage:w,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:b,deploymentId:x,params:_,nextConfig:A,parsedUrl:y,isDraftMode:T,prerenderManifest:N,routerServerContext:P,isOnDemandRevalidate:S,revalidateOnlyGenerated:O,resolvedPathname:k,clientReferenceManifest:q,serverActionsManifest:H}=C,I=(0,s.normalizeAppPath)(w),M=!!N.routes[k]&&(E.isDev||(0,g.isRouteCacheOwner)(k,E.cacheOwner,N.routes[k])),U=!!(N.dynamicRoutes[I]||M),D=async()=>((null==P?void 0:P.render404)?await P.render404(e,t,y,!1):t.end("This page could not be found"),null);if(U&&!T){let e=N.dynamicRoutes[I];if(e&&!1===e.fallback&&!M){if(A.adapterPath)return await D();throw new m.NoFallbackError}}let j=null;!U||E.isDev||T||(j="/index"===(j=k)?"/":j);let F=!0===E.isDev||!U,K=U&&!F;H&&q&&(0,i.setManifestsSingleton)({page:w,clientReferenceManifest:q,serverActionsManifest:H});let B=e.method||"GET",L=(0,o.getTracer)(),$=L.getActiveScopeSpan(),G=!!(null==P?void 0:P.isWrappedByNextServer),V=!!(0,n.getRequestMeta)(e,"minimalMode"),X=(0,n.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,A,N,V);null==X||X.resetRequestCache(),globalThis.__incrementalCache=X;let z={params:_,previewProps:N.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts,useCacheTimeout:A.experimental.useCacheTimeout},cacheComponents:!!A.cacheComponents,validationLevel:A.experimental.instantInsights.validationLevel,isDraftMode:T,supportsDynamicResponse:F,incrementalCache:X,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:A.cacheLife,staticPageGenerationTimeout:A.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>E.onRequestError(e,t,r,n,P)},sharedContext:{buildId:b,deploymentId:x}},W=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),J=d.NextRequestAdapter.fromNodeNextRequest(W,(0,d.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:a})=>{try{if(!V&&S&&O&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await E.handle(J,z);e.fetchMetrics=z.renderOpts.fetchMetrics;let o=z.renderOpts.pendingWaitUntil;o&&r.waitUntil&&(r.waitUntil(o),o=void 0);let i=z.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(W,Z,n,o),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);i&&(t[v.NEXT_CACHE_TAGS_HEADER]=i),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==z.renderOpts.collectedRevalidate&&!(z.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&z.renderOpts.collectedRevalidate,r=void 0===z.renderOpts.collectedExpire||z.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==a&&a>0?A.expireTime:void 0:z.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:S})},!1,P),t}},Y=async(n,i)=>{try{var s,l;let n=await E.handleResponse({req:e,nextConfig:A,cacheKey:j,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:N,isRoutePPREnabled:!1,isOnDemandRevalidate:S,revalidateOnlyGenerated:O,responseGenerator:Q,waitUntil:r.waitUntil,isMinimalMode:V});if(!U)return;if((null==n||null==(s=n.value)?void 0:s.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});V||t.setHeader("x-nextjs-cache",S?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let o=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);V&&U||o.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||o.get("Cache-Control")||o.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(W,Z,new Response(n.value.body,{headers:o,status:n.value.status||200}));return}catch(t){if(t instanceof m.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:S})},!1,P),U)throw t;await (0,p.sendResponse)(W,Z,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:o.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let a=L.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route")||I,s=`${B} ${r}`;n.setAttributes({"next.route":r,"http.route":r,"next.span_name":s}),n.updateName(s),i&&i!==n&&(i.setAttribute("http.route",r),i.updateName(s))})()}};if(G&&$)await Y($,void 0);else{let t=L.getActiveScopeSpan();await L.withPropagatedContext(e.headers,()=>L.trace(u.BaseServerSpan.handleRequest,{spanName:`${B} ${w}`,kind:o.SpanKind.SERVER,attributes:{"http.method":B,"http.target":e.url}},e=>Y(e,t)),void 0,!G)}}e.s(["handler",0,x,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:w,workUnitAsyncStorage:C})},"routeModule",0,E,"serverHooks",0,b,"workAsyncStorage",0,w,"workUnitAsyncStorage",0,C])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0sfpe9z._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[97380,e=>{"use strict";var t=e.i(89171),r=e.i(45383),a=e.i(17834);async function n(e,{params:o}){let{id:s}=await o;try{let e=(0,r.retryWakeCommand)(s);return t.NextResponse.json({wakeId:e.wake.id,status:e.wake.status,reasonCode:e.wake.reason_code,requestId:e.request?.id??null,requestState:e.request?.state??null})}catch(e){if(e instanceof a.WakeRouterError)return t.NextResponse.json({error:{code:e.code,message:e.message}},{status:"not_found"===e.code?404:400});return console.error("Wake retry failed:",e),t.NextResponse.json({error:{code:"internal_error",message:"The Wake could not be retried."}},{status:500})}}e.s(["POST",0,n])},78984,e=>{"use strict";var t=e.i(47909),r=e.i(74017),a=e.i(96250),n=e.i(59756),o=e.i(61916),s=e.i(74677),i=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),v=e.i(10372),w=e.i(93695),m=e.i(9580);e.i(52474);var f=e.i(220);let g=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wakes/[id]/retry/route",pathname:"/api/wakes/[id]/retry",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/wakes/[id]/retry/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(97380),...{}}),{workAsyncStorage:C,workUnitAsyncStorage:E,serverHooks:x}=g;async function y(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),g.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let C="/api/wakes/[id]/retry/route";C=C.replace(/\/index$/,"")||"/";let E=await g.prepare(e,t,{srcPage:C,multiZoneDraftMode:!1});if(!E)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:x,deploymentId:y,params:A,nextConfig:T,parsedUrl:S,isDraftMode:N,prerenderManifest:P,routerServerContext:b,isOnDemandRevalidate:k,revalidateOnlyGenerated:_,resolvedPathname:O,clientReferenceManifest:q,serverActionsManifest:H}=E,I=(0,i.normalizeAppPath)(C),M=!!P.routes[O]&&(g.isDev||(0,m.isRouteCacheOwner)(O,g.cacheOwner,P.routes[O])),U=!!(P.dynamicRoutes[I]||M),D=async()=>((null==b?void 0:b.render404)?await b.render404(e,t,S,!1):t.end("This page could not be found"),null);if(U&&!N){let e=P.dynamicRoutes[I];if(e&&!1===e.fallback&&!M){if(T.adapterPath)return await D();throw new w.NoFallbackError}}let j=null;!U||g.isDev||N||(j="/index"===(j=O)?"/":j);let F=!0===g.isDev||!U,K=U&&!F;H&&q&&(0,s.setManifestsSingleton)({page:C,clientReferenceManifest:q,serverActionsManifest:H});let L=e.method||"GET",$=(0,o.getTracer)(),B=$.getActiveScopeSpan(),W=!!(null==b?void 0:b.isWrappedByNextServer),G=!!(0,n.getRequestMeta)(e,"minimalMode"),V=(0,n.getRequestMeta)(e,"incrementalCache")||await g.getIncrementalCache(e,T,P,G);null==V||V.resetRequestCache(),globalThis.__incrementalCache=V;let X={params:A,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!T.experimental.authInterrupts,useCacheTimeout:T.experimental.useCacheTimeout},cacheComponents:!!T.cacheComponents,validationLevel:T.experimental.instantInsights.validationLevel,isDraftMode:N,supportsDynamicResponse:F,incrementalCache:V,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:T.cacheLife,staticPageGenerationTimeout:T.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>g.onRequestError(e,t,a,n,b)},sharedContext:{buildId:x,deploymentId:y}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),J=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:r})=>{try{if(!G&&k&&_&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await g.handle(J,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let o=X.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let s=X.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(z,Z,n,o),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);s&&(t[v.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,a=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==r&&r>0?T.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await g.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:k})},!1,b),t}},Y=async(n,s)=>{try{var i,l;let n=await g.handleResponse({req:e,nextConfig:T,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:k,revalidateOnlyGenerated:_,responseGenerator:Q,waitUntil:a.waitUntil,isMinimalMode:G});if(!U)return;if((null==n||null==(i=n.value)?void 0:i.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});G||t.setHeader("x-nextjs-cache",k?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let o=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);G&&U||o.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||o.get("Cache-Control")||o.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(n.value.body,{headers:o,status:n.value.status||200}));return}catch(t){if(t instanceof w.NoFallbackError||await g.onRequestError(e,t,{routerKind:"App Router",routePath:I,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:K,isOnDemandRevalidate:k})},!1,b),U)throw t;await (0,p.sendResponse)(z,Z,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:o.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let r=$.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route")||I,i=`${L} ${a}`;n.setAttributes({"next.route":a,"http.route":a,"next.span_name":i}),n.updateName(i),s&&s!==n&&(s.setAttribute("http.route",a),s.updateName(i))})()}};if(W&&B)await Y(B,void 0);else{let t=$.getActiveScopeSpan();await $.withPropagatedContext(e.headers,()=>$.trace(d.BaseServerSpan.handleRequest,{spanName:`${L} ${C}`,kind:o.SpanKind.SERVER,attributes:{"http.method":L,"http.target":e.url}},e=>Y(e,t)),void 0,!W)}}e.s(["handler",0,y,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:E})},"routeModule",0,g,"serverHooks",0,x,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,E])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0th2j4w._.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports=[15003,e=>{"use strict";var t=e.i(69936);async function a(e,{params:n}){let{agentId:r}=await n;return(0,t.handleGetAgent)(e,r)}e.s(["GET",0,a])},17896,e=>{"use strict";var t=e.i(47909),a=e.i(74017),n=e.i(96250),r=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),d=e.i(16795),l=e.i(87718),u=e.i(95169),c=e.i(47587),_=e.i(66012),p=e.i(70101),g=e.i(26937),h=e.i(10372),v=e.i(93695),E=e.i(9580);e.i(52474);var m=e.i(220);let R=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/v0/agents/[agentId]/route",pathname:"/api/v0/agents/[agentId]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/v0/agents/[agentId]/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(15003),...{}}),{workAsyncStorage:A,workUnitAsyncStorage:b,serverHooks:f}=R;async function S(e,t,n){n.requestMeta&&(0,r.setRequestMeta)(e,n.requestMeta),R.isDev&&(0,r.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let A="/api/v0/agents/[agentId]/route";A=A.replace(/\/index$/,"")||"/";let b=await R.prepare(e,t,{srcPage:A,multiZoneDraftMode:!1});if(!b)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:f,deploymentId:S,params:C,nextConfig:O,parsedUrl:w,isDraftMode:N,prerenderManifest:T,routerServerContext:q,isOnDemandRevalidate:x,revalidateOnlyGenerated:y,resolvedPathname:I,clientReferenceManifest:k,serverActionsManifest:H}=b,L=(0,o.normalizeAppPath)(A),P=!!T.routes[I]&&(R.isDev||(0,E.isRouteCacheOwner)(I,R.cacheOwner,T.routes[I])),M=!!(T.dynamicRoutes[L]||P),D=async()=>((null==q?void 0:q.render404)?await q.render404(e,t,w,!1):t.end("This page could not be found"),null);if(M&&!N){let e=T.dynamicRoutes[L];if(e&&!1===e.fallback&&!P){if(O.adapterPath)return await D();throw new v.NoFallbackError}}let F=null;!M||R.isDev||N||(F="/index"===(F=I)?"/":F);let U=!0===R.isDev||!M,$=M&&!U;H&&k&&(0,s.setManifestsSingleton)({page:A,clientReferenceManifest:k,serverActionsManifest:H});let G=e.method||"GET",J=(0,i.getTracer)(),W=J.getActiveScopeSpan(),K=!!(null==q?void 0:q.isWrappedByNextServer),j=!!(0,r.getRequestMeta)(e,"minimalMode"),B=(0,r.getRequestMeta)(e,"incrementalCache")||await R.getIncrementalCache(e,O,T,j);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let X={params:C,previewProps:T.preview,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:N,supportsDynamicResponse:U,incrementalCache:B,hmrRefreshHash:(0,r.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,n,r)=>R.onRequestError(e,t,n,r,q)},sharedContext:{buildId:f,deploymentId:S}},V=new d.NodeNextRequest(e),z=new d.NodeNextResponse(t),Y=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:a})=>{try{if(!j&&x&&y&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await R.handle(Y,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let i=X.renderOpts.pendingWaitUntil;i&&n.waitUntil&&(n.waitUntil(i),i=void 0);let s=X.renderOpts.collectedTags;if(!M)return await (0,_.sendResponse)(V,z,r,i),null;{let e=await r.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(r.headers);s&&(t[h.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=h.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,n=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=h.INFINITE_CACHE?!1!==a&&a>0?O.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:n}}}}catch(t){throw(null==a?void 0:a.isStale)&&await R.onRequestError(e,t,{routerKind:"App Router",routePath:A,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:x})},!1,q),t}},Q=async(r,s)=>{try{var o,d;let r=await R.handleResponse({req:e,nextConfig:O,cacheKey:F,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:T,isRoutePPREnabled:!1,isOnDemandRevalidate:x,revalidateOnlyGenerated:y,responseGenerator:Z,waitUntil:n.waitUntil,isMinimalMode:j});if(!M)return;if((null==r||null==(o=r.value)?void 0:o.kind)!==m.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==r||null==(d=r.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});j||t.setHeader("x-nextjs-cache",x?"REVALIDATED":r.isMiss?"MISS":r.isStale?"STALE":"HIT"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.fromNodeOutgoingHttpHeaders)(r.value.headers);j&&M||i.delete(h.NEXT_CACHE_TAGS_HEADER),!r.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,g.getCacheControlHeader)(r.cacheControl)),await (0,_.sendResponse)(V,z,new Response(r.value.body,{headers:i,status:r.value.status||200}));return}catch(t){if(t instanceof v.NoFallbackError||await R.onRequestError(e,t,{routerKind:"App Router",routePath:L,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:x})},!1,q),M)throw t;await (0,_.sendResponse)(V,z,new Response(null,{status:500}));return}finally{(()=>{if(!r)return;let e=t.statusCode;r.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(r.setStatus({code:i.SpanStatusCode.ERROR}),r.setAttribute("error.type",e.toString()));let a=J.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==u.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=a.get("next.route")||L,o=`${G} ${n}`;r.setAttributes({"next.route":n,"http.route":n,"next.span_name":o}),r.updateName(o),s&&s!==r&&(s.setAttribute("http.route",n),s.updateName(o))})()}};if(K&&W)await Q(W,void 0);else{let t=J.getActiveScopeSpan();await J.withPropagatedContext(e.headers,()=>J.trace(u.BaseServerSpan.handleRequest,{spanName:`${G} ${A}`,kind:i.SpanKind.SERVER,attributes:{"http.method":G,"http.target":e.url}},e=>Q(e,t)),void 0,!K)}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:b})},"routeModule",0,R,"serverHooks",0,f,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,b])},90027,e=>{"use strict";var t=e.i(62349);let a=["active","ended","all"],n=["implementation","revision"],r=`
|
|
2
|
-
SELECT b.*, bot.name AS agent_name, bot.agent AS agent_runtime, r.id AS origin_request_id, c.id AS origin_conversation_id,
|
|
3
|
-
c.type AS conversation_type, c.bot_id AS conversation_bot_id, tb.name AS thread_agent_name, g.name AS group_name,
|
|
4
|
-
r.intent AS request_intent, r.execution_kind AS request_kind, r.state AS request_state,
|
|
5
|
-
r.source_conversation_id AS request_conversation_id, r.target_agent_id AS request_target_agent_id,
|
|
6
|
-
sa.launch_snapshot AS source_snapshot, sa.finished_at AS source_finished_at,
|
|
7
|
-
(SELECT MAX(COALESCE(ra.finished_at, ra.started_at)) FROM work_attempts ra WHERE ra.resumed_session_binding_id = b.id) AS resumed_last_at
|
|
8
|
-
FROM session_bindings b
|
|
9
|
-
JOIN bots bot ON bot.id = b.agent_id
|
|
10
|
-
LEFT JOIN work_attempts sa ON sa.id = b.source_attempt_id
|
|
11
|
-
LEFT JOIN work_requests r ON r.id = COALESCE(b.request_id, sa.request_id)
|
|
12
|
-
LEFT JOIN conversations c ON c.id = COALESCE(b.conversation_id, r.source_conversation_id)
|
|
13
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
14
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
15
|
-
`;function i(e,t){let a=e?.[t];return"string"==typeof a&&a.trim().length>0?a:null}function s(e){let t=e.origin_conversation_id;return t?"group"===e.conversation_type?{id:t,kind:"group",label:e.group_name?`Group ${e.group_name}`:"Group thread",thread_agent_id:null}:"bot"===e.conversation_type&&e.conversation_bot_id?{id:t,kind:"direct",label:e.thread_agent_name?`${e.thread_agent_name} thread`:"Agent thread",thread_agent_id:e.thread_agent_name?e.conversation_bot_id:null}:{id:t,kind:"agent_api",label:"Agent API conversation",thread_agent_id:null}:null}function o(e){var a;let r,o=null;try{o=e.source_snapshot?JSON.parse(e.source_snapshot):null}catch{}let d=s(e),l=null===e.released_at?"active":"ended",u=((r=(e.request_intent??"").split("\n").map(e=>e.trim()).find(e=>e.length>0))?r.length>80?`${r.slice(0,79).trimEnd()}…`:r:null)??(d?.kind==="group"?d.label:null)??`${e.agent_name} \xb7 ${a=e.created_at,`${new Date(a).toISOString().slice(0,16).replace("T"," ")} UTC`}`;return{ref:e.id,agent:{id:e.agent_id,name:e.agent_name,adapter:e.adapter,transport:i(o,"transport")},title:u,status:l,resumable:null===e.released_at&&null!==e.request_id&&null!==e.request_kind&&n.includes(e.request_kind)&&e.request_target_agent_id===e.agent_id&&(e.conversation_id??"")===(e.request_conversation_id??"")&&e.adapter===(0,t.resolveAgent)({agent:e.agent_runtime}).agent,created_at:e.created_at,ended_at:e.released_at,last_activity_at:Math.max(e.created_at,e.released_at??0,e.source_finished_at??0,e.resumed_last_at??0),origin:{conversation:d,work_request:e.origin_request_id&&e.request_kind&&e.request_state?{id:e.origin_request_id,execution_kind:e.request_kind,state:e.request_state}:null},context:{workspace:i(o,"cwd"),deck:i(o,"deck")}}}function d(e,t){return t.last_activity_at-e.last_activity_at||t.created_at-e.created_at||(e.ref<t.ref?-1:+(e.ref>t.ref))}function l(e,t,a){return e.prepare(`${r} WHERE b.id = ? AND b.agent_id = ?`).get(a,t)}e.s(["agentExists",0,function(e,t){return!!e.prepare("SELECT 1 FROM bots WHERE id = ?").get(t)},"conversationRef",0,function(e,t){let a=e.prepare(`
|
|
16
|
-
SELECT c.id AS origin_conversation_id, c.type AS conversation_type, c.bot_id AS conversation_bot_id,
|
|
17
|
-
tb.name AS thread_agent_name, g.name AS group_name
|
|
18
|
-
FROM conversations c
|
|
19
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
20
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
21
|
-
WHERE c.id = ?
|
|
22
|
-
`).get(t);return a?s(a):null},"getAgentSession",0,function(e,t,a){let n=l(e,t,a);if(!n)return;let r=e.prepare(`
|
|
23
|
-
SELECT a.attempt_number, a.kind, a.request_id, a.outcome, a.started_at, a.finished_at,
|
|
24
|
-
CASE WHEN a.id = ? THEN 'source' ELSE 'resume' END AS role
|
|
25
|
-
FROM work_attempts a
|
|
26
|
-
WHERE a.id = ? OR a.resumed_session_binding_id = ?
|
|
27
|
-
ORDER BY a.started_at ASC, a.id ASC
|
|
28
|
-
`).all(n.source_attempt_id,n.source_attempt_id,n.id);return{...o(n),attempts:r}},"isSessionFilter",0,function(e){return"string"==typeof e&&a.includes(e)},"listAgentSessions",0,function(e,t,a="all"){return e.prepare(`${r} WHERE b.agent_id = ? ${"active"===a?"AND b.released_at IS NULL":"ended"===a?"AND b.released_at IS NOT NULL":""}`).all(t).map(o).sort(d)},"sessionDebugExternalId",0,function(e,t,a){return l(e,t,a)?.external_session_id},"sessionTitle",0,function(e,t,a){let n=l(e,t,a);return n?o(n).title:null}])}];
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=_0uz7r06._.js.map
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[3423,e=>{"use strict";var t=e.i(43345);async function a(e,{params:r}){let{agentId:n}=await r;return(0,t.handleSendAgentMessage)(e,n)}e.s(["POST",0,a])},61192,e=>{"use strict";var t=e.i(47909),a=e.i(74017),r=e.i(96250),n=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),l=e.i(16795),u=e.i(87718),d=e.i(95169),c=e.i(47587),p=e.i(66012),h=e.i(70101),R=e.i(26937),v=e.i(10372),g=e.i(93695),m=e.i(9580);e.i(52474);var f=e.i(220);let w=new t.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/v0/agents/[agentId]/messages/route",pathname:"/api/v0/agents/[agentId]/messages",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/v0/agents/[agentId]/messages/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(3423),...{}}),{workAsyncStorage:E,workUnitAsyncStorage:C,serverHooks:x}=w;async function A(e,t,r){r.requestMeta&&(0,n.setRequestMeta)(e,r.requestMeta),w.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let E="/api/v0/agents/[agentId]/messages/route";E=E.replace(/\/index$/,"")||"/";let C=await w.prepare(e,t,{srcPage:E,multiZoneDraftMode:!1});if(!C)return t.statusCode=400,t.end("Bad Request"),null==r.waitUntil||r.waitUntil.call(r,Promise.resolve()),null;let{buildId:x,deploymentId:A,params:T,nextConfig:y,parsedUrl:S,isDraftMode:P,prerenderManifest:b,routerServerContext:N,isOnDemandRevalidate:O,revalidateOnlyGenerated:_,resolvedPathname:I,clientReferenceManifest:q,serverActionsManifest:H}=C,M=(0,o.normalizeAppPath)(E),U=!!b.routes[I]&&(w.isDev||(0,m.isRouteCacheOwner)(I,w.cacheOwner,b.routes[I])),D=!!(b.dynamicRoutes[M]||U),k=async()=>((null==N?void 0:N.render404)?await N.render404(e,t,S,!1):t.end("This page could not be found"),null);if(D&&!P){let e=b.dynamicRoutes[M];if(e&&!1===e.fallback&&!U){if(y.adapterPath)return await k();throw new g.NoFallbackError}}let F=null;!D||w.isDev||P||(F="/index"===(F=I)?"/":F);let K=!0===w.isDev||!D,j=D&&!K;H&&q&&(0,s.setManifestsSingleton)({page:E,clientReferenceManifest:q,serverActionsManifest:H});let L=e.method||"GET",$=(0,i.getTracer)(),B=$.getActiveScopeSpan(),G=!!(null==N?void 0:N.isWrappedByNextServer),V=!!(0,n.getRequestMeta)(e,"minimalMode"),X=(0,n.getRequestMeta)(e,"incrementalCache")||await w.getIncrementalCache(e,y,b,V);null==X||X.resetRequestCache(),globalThis.__incrementalCache=X;let W={params:T,previewProps:b.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts,useCacheTimeout:y.experimental.useCacheTimeout},cacheComponents:!!y.cacheComponents,validationLevel:y.experimental.instantInsights.validationLevel,isDraftMode:P,supportsDynamicResponse:K,incrementalCache:X,hmrRefreshHash:(0,n.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:y.cacheLife,staticPageGenerationTimeout:y.staticPageGenerationTimeout,waitUntil:r.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,a,r,n)=>w.onRequestError(e,t,r,n,N)},sharedContext:{buildId:x,deploymentId:A}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),J=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t)),Q=async({previousCacheEntry:a})=>{try{if(!V&&O&&_&&!a)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await w.handle(J,W);e.fetchMetrics=W.renderOpts.fetchMetrics;let i=W.renderOpts.pendingWaitUntil;i&&r.waitUntil&&(r.waitUntil(i),i=void 0);let s=W.renderOpts.collectedTags;if(!D)return await (0,p.sendResponse)(z,Z,n,i),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);s&&(t[v.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let a=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=v.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,r=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=v.INFINITE_CACHE?!1!==a&&a>0?y.expireTime:void 0:W.renderOpts.collectedExpire;return{value:{kind:f.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:a,expire:r}}}}catch(t){throw(null==a?void 0:a.isStale)&&await w.onRequestError(e,t,{routerKind:"App Router",routePath:E,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:O})},!1,N),t}},Y=async(n,s)=>{try{var o,l;let n=await w.handleResponse({req:e,nextConfig:y,cacheKey:F,routeKind:a.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:b,isRoutePPREnabled:!1,isOnDemandRevalidate:O,revalidateOnlyGenerated:_,responseGenerator:Q,waitUntil:r.waitUntil,isMinimalMode:V});if(!D)return;if((null==n||null==(o=n.value)?void 0:o.kind)!==f.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==n||null==(l=n.value)?void 0:l.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});V||t.setHeader("x-nextjs-cache",O?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),P&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,h.fromNodeOutgoingHttpHeaders)(n.value.headers);V&&D||i.delete(v.NEXT_CACHE_TAGS_HEADER),!n.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,R.getCacheControlHeader)(n.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(n.value.body,{headers:i,status:n.value.status||200}));return}catch(t){if(t instanceof g.NoFallbackError||await w.onRequestError(e,t,{routerKind:"App Router",routePath:M,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:O})},!1,N),D)throw t;await (0,p.sendResponse)(z,Z,new Response(null,{status:500}));return}finally{(()=>{if(!n)return;let e=t.statusCode;n.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(n.setStatus({code:i.SpanStatusCode.ERROR}),n.setAttribute("error.type",e.toString()));let a=$.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==d.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let r=a.get("next.route")||M,o=`${L} ${r}`;n.setAttributes({"next.route":r,"http.route":r,"next.span_name":o}),n.updateName(o),s&&s!==n&&(s.setAttribute("http.route",r),s.updateName(o))})()}};if(G&&B)await Y(B,void 0);else{let t=$.getActiveScopeSpan();await $.withPropagatedContext(e.headers,()=>$.trace(d.BaseServerSpan.handleRequest,{spanName:`${L} ${E}`,kind:i.SpanKind.SERVER,attributes:{"http.method":L,"http.target":e.url}},e=>Y(e,t)),void 0,!G)}}e.s(["handler",0,A,"patchFetch",0,function(){return(0,r.patchFetch)({workAsyncStorage:E,workUnitAsyncStorage:C})},"routeModule",0,w,"serverHooks",0,x,"workAsyncStorage",0,E,"workUnitAsyncStorage",0,C])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_0x05ts4._.js.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
module.exports=[30056,e=>{"use strict";var t=e.i(89171),n=e.i(62294),a=e.i(45383),r=e.i(63020),i=e.i(92628);async function s(e,{params:o}){try{let{id:e}=await o,s=(0,a.getExchangeView)(e);if(s.requester.kind!==n.UI_OWNER_PRINCIPAL.kind||s.requester.id!==n.UI_OWNER_PRINCIPAL.id)throw new r.ExchangeError("exchange_not_found",`No exchange ${e}.`);return t.NextResponse.json({exchange:s,detail:(0,i.exchangeDetail)(n.default,s)})}catch(e){if(e instanceof r.ExchangeError)return t.NextResponse.json((0,r.exchangeErrorBody)(e),{status:e.status});return console.error("Error reading exchange:",e instanceof Error?e.message:"unknown error"),t.NextResponse.json({error:{code:"internal_error",message:"The exchange could not be read."}},{status:500})}}e.s(["GET",0,s])},48601,e=>{"use strict";var t=e.i(47909),n=e.i(74017),a=e.i(96250),r=e.i(59756),i=e.i(61916),s=e.i(74677),o=e.i(69741),d=e.i(16795),u=e.i(87718),l=e.i(95169),c=e.i(47587),_=e.i(66012),p=e.i(70101),g=e.i(26937),E=e.i(10372),h=e.i(93695),m=e.i(9580);e.i(52474);var R=e.i(220);let v=new t.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/exchanges/[id]/route",pathname:"/api/exchanges/[id]",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/app/api/exchanges/[id]/route.ts",nextConfigOutput:"standalone",userland:()=>e.r(30056),...{}}),{workAsyncStorage:f,workUnitAsyncStorage:S,serverHooks:b}=v;async function A(e,t,a){a.requestMeta&&(0,r.setRequestMeta)(e,a.requestMeta),v.isDev&&(0,r.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let f="/api/exchanges/[id]/route";f=f.replace(/\/index$/,"")||"/";let S=await v.prepare(e,t,{srcPage:f,multiZoneDraftMode:!1});if(!S)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:b,deploymentId:A,params:C,nextConfig:O,parsedUrl:N,isDraftMode:T,prerenderManifest:x,routerServerContext:w,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,resolvedPathname:I,clientReferenceManifest:k,serverActionsManifest:L}=S,H=(0,o.normalizeAppPath)(f),M=!!x.routes[I]&&(v.isDev||(0,m.isRouteCacheOwner)(I,v.cacheOwner,x.routes[I])),P=!!(x.dynamicRoutes[H]||M),D=async()=>((null==w?void 0:w.render404)?await w.render404(e,t,N,!1):t.end("This page could not be found"),null);if(P&&!T){let e=x.dynamicRoutes[H];if(e&&!1===e.fallback&&!M){if(O.adapterPath)return await D();throw new h.NoFallbackError}}let F=null;!P||v.isDev||T||(F="/index"===(F=I)?"/":F);let U=!0===v.isDev||!P,W=P&&!U;L&&k&&(0,s.setManifestsSingleton)({page:f,clientReferenceManifest:k,serverActionsManifest:L});let $=e.method||"GET",j=(0,i.getTracer)(),J=j.getActiveScopeSpan(),B=!!(null==w?void 0:w.isWrappedByNextServer),G=!!(0,r.getRequestMeta)(e,"minimalMode"),K=(0,r.getRequestMeta)(e,"incrementalCache")||await v.getIncrementalCache(e,O,x,G);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let X={params:C,previewProps:x.preview,renderOpts:{experimental:{authInterrupts:!!O.experimental.authInterrupts,useCacheTimeout:O.experimental.useCacheTimeout},cacheComponents:!!O.cacheComponents,validationLevel:O.experimental.instantInsights.validationLevel,isDraftMode:T,supportsDynamicResponse:U,incrementalCache:K,hmrRefreshHash:(0,r.getRequestMeta)(e,"hmrRefreshHash"),cacheLifeProfiles:O.cacheLife,staticPageGenerationTimeout:O.staticPageGenerationTimeout,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,n,a,r)=>v.onRequestError(e,t,a,r,w)},sharedContext:{buildId:b,deploymentId:A}},V=new d.NodeNextRequest(e),Y=new d.NodeNextResponse(t),z=u.NextRequestAdapter.fromNodeNextRequest(V,(0,u.signalFromNodeResponse)(t)),Z=async({previousCacheEntry:n})=>{try{if(!G&&q&&y&&!n)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let r=await v.handle(z,X);e.fetchMetrics=X.renderOpts.fetchMetrics;let i=X.renderOpts.pendingWaitUntil;i&&a.waitUntil&&(a.waitUntil(i),i=void 0);let s=X.renderOpts.collectedTags;if(!P)return await (0,_.sendResponse)(V,Y,r,i),null;{let e=await r.blob(),t=(0,p.toNodeOutgoingHttpHeaders)(r.headers);s&&(t[E.NEXT_CACHE_TAGS_HEADER]=s),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let n=void 0!==X.renderOpts.collectedRevalidate&&!(X.renderOpts.collectedRevalidate>=E.INFINITE_CACHE)&&X.renderOpts.collectedRevalidate,a=void 0===X.renderOpts.collectedExpire||X.renderOpts.collectedExpire>=E.INFINITE_CACHE?!1!==n&&n>0?O.expireTime:void 0:X.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:r.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:n,expire:a}}}}catch(t){throw(null==n?void 0:n.isStale)&&await v.onRequestError(e,t,{routerKind:"App Router",routePath:f,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:W,isOnDemandRevalidate:q})},!1,w),t}},Q=async(r,s)=>{try{var o,d;let r=await v.handleResponse({req:e,nextConfig:O,cacheKey:F,routeKind:n.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:x,isRoutePPREnabled:!1,isOnDemandRevalidate:q,revalidateOnlyGenerated:y,responseGenerator:Z,waitUntil:a.waitUntil,isMinimalMode:G});if(!P)return;if((null==r||null==(o=r.value)?void 0:o.kind)!==R.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==r||null==(d=r.value)?void 0:d.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});G||t.setHeader("x-nextjs-cache",q?"REVALIDATED":r.isMiss?"MISS":r.isStale?"STALE":"HIT"),T&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let i=(0,p.fromNodeOutgoingHttpHeaders)(r.value.headers);G&&P||i.delete(E.NEXT_CACHE_TAGS_HEADER),!r.cacheControl||t.getHeader("Cache-Control")||i.get("Cache-Control")||i.set("Cache-Control",(0,g.getCacheControlHeader)(r.cacheControl)),await (0,_.sendResponse)(V,Y,new Response(r.value.body,{headers:i,status:r.value.status||200}));return}catch(t){if(t instanceof h.NoFallbackError||await v.onRequestError(e,t,{routerKind:"App Router",routePath:H,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:W,isOnDemandRevalidate:q})},!1,w),P)throw t;await (0,_.sendResponse)(V,Y,new Response(null,{status:500}));return}finally{(()=>{if(!r)return;let e=t.statusCode;r.setAttributes({"http.status_code":e,"next.rsc":!1}),e&&e>=500&&(r.setStatus({code:i.SpanStatusCode.ERROR}),r.setAttribute("error.type",e.toString()));let n=j.getRootSpanAttributes();if(!n)return;if(n.get("next.span_type")!==l.BaseServerSpan.handleRequest)return console.warn(`Unexpected root span type '${n.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=n.get("next.route")||H,o=`${$} ${a}`;r.setAttributes({"next.route":a,"http.route":a,"next.span_name":o}),r.updateName(o),s&&s!==r&&(s.setAttribute("http.route",a),s.updateName(o))})()}};if(B&&J)await Q(J,void 0);else{let t=j.getActiveScopeSpan();await j.withPropagatedContext(e.headers,()=>j.trace(l.BaseServerSpan.handleRequest,{spanName:`${$} ${f}`,kind:i.SpanKind.SERVER,attributes:{"http.method":$,"http.target":e.url}},e=>Q(e,t)),void 0,!B)}}e.s(["handler",0,A,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:f,workUnitAsyncStorage:S})},"routeModule",0,v,"serverHooks",0,b,"workAsyncStorage",0,f,"workUnitAsyncStorage",0,S])},92628,e=>{"use strict";var t=e.i(90027),n=e.i(35613);function a(e){return null==e?null:e.length>600?`${e.slice(0,599).trimEnd()}…`:e}function r(e,t){return e.prepare("SELECT name FROM bots WHERE id = ?").get(t)?.name??"Removed Agent"}function i(e,t){return"string"!=typeof t?null:e.prepare("SELECT content FROM messages WHERE id = ?").get(t)?.content??null}function s(e,s){let o=n=>n?(0,t.conversationRef)(e,n):null,d=o(s.origin_conversation_id),u=o(function(e,t){if(t.source_request_id){let n=e.prepare("SELECT source_conversation_id FROM work_requests WHERE id = ?").get(t.source_request_id);if(n?.source_conversation_id)return n.source_conversation_id}let n=e.prepare("SELECT conversation_id FROM session_bindings WHERE id = ?").get(t.source_binding_id);return n?.conversation_id??null}(e,s)),l=o(s.destination_conversation_id),c=[],_=(e,t)=>{if(!e)return;let n=c.find(t=>t.id===e.id);n?n.roles.push(t):c.push({...e,roles:[t]})};_(d,"origin"),_(u,"source"),_(l,"destination");let p=n.EXCHANGE_TERMINAL_STATES.includes(s.state);return{id:s.id,mode:s.mode,state:s.state,terminal:p,can_cancel:!p&&null===s.cancel_requested_at,cancel_requested:null!==s.cancel_requested_at,instruction:s.instruction,source:{agent_id:s.source_agent_id,agent_name:r(e,s.source_agent_id),session_title:(0,t.sessionTitle)(e,s.source_agent_id,s.source_binding_id)??"Session",conversation:u},destination:"continue"===s.mode&&s.destination_agent_id?{agent_id:s.destination_agent_id,agent_name:r(e,s.destination_agent_id),session_title:s.destination_binding_id?(0,t.sessionTitle)(e,s.destination_agent_id,s.destination_binding_id):null,conversation:l}:null,origin:d,links:c,outcome:{answer:a(i(e,s.answer_message_id)),objective:a(function(e){if(!e)return null;try{let t=JSON.parse(e);return"string"==typeof t.objective?t.objective:null}catch{return null}}(s.packet)),reply:a(i(e,function(e,t){let n=e.prepare("SELECT data FROM session_exchange_events WHERE exchange_id = ? AND type = 'destination_replied' ORDER BY sequence DESC LIMIT 1").get(t);try{return n?.data?JSON.parse(n.data).message_id:null}catch{return null}}(e,s.id)))},failure:"failed"===s.state?{code:s.failure_code??"failed",message:s.failure_message??""}:null,created_at:s.created_at,updated_at:s.updated_at,terminal_at:s.terminal_at}}e.s(["exchangeDetail",0,function(e,t){let n=e.prepare("SELECT * FROM session_exchanges WHERE id = ?").get(t.id);return{summary:s(e,n),events:t.events.map(e=>{var t;return{...e,data:(t=e.data)?Object.fromEntries(Object.entries(t).filter(([e])=>!e.endsWith("_id")&&"session_ref"!==e&&"by"!==e)):null}}),packet:t.packet,answer:t.answer?.content??null}},"listExchanges",0,function(e,t){return e.prepare("SELECT * FROM session_exchanges WHERE requester_kind = ? AND requester_id = ? ORDER BY updated_at DESC, created_at DESC, id ASC").all(t.requester.kind,t.requester.id).filter(e=>!t.mode||e.mode===t.mode).filter(e=>!t.state||("active"===t.state?!n.EXCHANGE_TERMINAL_STATES.includes(e.state):e.state===t.state)).filter(e=>!t.agentId||e.source_agent_id===t.agentId||e.destination_agent_id===t.agentId).map(t=>s(e,t)).filter(e=>!t.conversationId||e.links.some(e=>e.id===t.conversationId))}])},90027,e=>{"use strict";var t=e.i(62349);let n=["active","ended","all"],a=["implementation","revision"],r=`
|
|
2
|
-
SELECT b.*, bot.name AS agent_name, bot.agent AS agent_runtime, r.id AS origin_request_id, c.id AS origin_conversation_id,
|
|
3
|
-
c.type AS conversation_type, c.bot_id AS conversation_bot_id, tb.name AS thread_agent_name, g.name AS group_name,
|
|
4
|
-
r.intent AS request_intent, r.execution_kind AS request_kind, r.state AS request_state,
|
|
5
|
-
r.source_conversation_id AS request_conversation_id, r.target_agent_id AS request_target_agent_id,
|
|
6
|
-
sa.launch_snapshot AS source_snapshot, sa.finished_at AS source_finished_at,
|
|
7
|
-
(SELECT MAX(COALESCE(ra.finished_at, ra.started_at)) FROM work_attempts ra WHERE ra.resumed_session_binding_id = b.id) AS resumed_last_at
|
|
8
|
-
FROM session_bindings b
|
|
9
|
-
JOIN bots bot ON bot.id = b.agent_id
|
|
10
|
-
LEFT JOIN work_attempts sa ON sa.id = b.source_attempt_id
|
|
11
|
-
LEFT JOIN work_requests r ON r.id = COALESCE(b.request_id, sa.request_id)
|
|
12
|
-
LEFT JOIN conversations c ON c.id = COALESCE(b.conversation_id, r.source_conversation_id)
|
|
13
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
14
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
15
|
-
`;function i(e,t){let n=e?.[t];return"string"==typeof n&&n.trim().length>0?n:null}function s(e){let t=e.origin_conversation_id;return t?"group"===e.conversation_type?{id:t,kind:"group",label:e.group_name?`Group ${e.group_name}`:"Group thread",thread_agent_id:null}:"bot"===e.conversation_type&&e.conversation_bot_id?{id:t,kind:"direct",label:e.thread_agent_name?`${e.thread_agent_name} thread`:"Agent thread",thread_agent_id:e.thread_agent_name?e.conversation_bot_id:null}:{id:t,kind:"agent_api",label:"Agent API conversation",thread_agent_id:null}:null}function o(e){var n;let r,o=null;try{o=e.source_snapshot?JSON.parse(e.source_snapshot):null}catch{}let d=s(e),u=null===e.released_at?"active":"ended",l=((r=(e.request_intent??"").split("\n").map(e=>e.trim()).find(e=>e.length>0))?r.length>80?`${r.slice(0,79).trimEnd()}…`:r:null)??(d?.kind==="group"?d.label:null)??`${e.agent_name} \xb7 ${n=e.created_at,`${new Date(n).toISOString().slice(0,16).replace("T"," ")} UTC`}`;return{ref:e.id,agent:{id:e.agent_id,name:e.agent_name,adapter:e.adapter,transport:i(o,"transport")},title:l,status:u,resumable:null===e.released_at&&null!==e.request_id&&null!==e.request_kind&&a.includes(e.request_kind)&&e.request_target_agent_id===e.agent_id&&(e.conversation_id??"")===(e.request_conversation_id??"")&&e.adapter===(0,t.resolveAgent)({agent:e.agent_runtime}).agent,created_at:e.created_at,ended_at:e.released_at,last_activity_at:Math.max(e.created_at,e.released_at??0,e.source_finished_at??0,e.resumed_last_at??0),origin:{conversation:d,work_request:e.origin_request_id&&e.request_kind&&e.request_state?{id:e.origin_request_id,execution_kind:e.request_kind,state:e.request_state}:null},context:{workspace:i(o,"cwd"),deck:i(o,"deck")}}}function d(e,t){return t.last_activity_at-e.last_activity_at||t.created_at-e.created_at||(e.ref<t.ref?-1:+(e.ref>t.ref))}function u(e,t,n){return e.prepare(`${r} WHERE b.id = ? AND b.agent_id = ?`).get(n,t)}e.s(["agentExists",0,function(e,t){return!!e.prepare("SELECT 1 FROM bots WHERE id = ?").get(t)},"conversationRef",0,function(e,t){let n=e.prepare(`
|
|
16
|
-
SELECT c.id AS origin_conversation_id, c.type AS conversation_type, c.bot_id AS conversation_bot_id,
|
|
17
|
-
tb.name AS thread_agent_name, g.name AS group_name
|
|
18
|
-
FROM conversations c
|
|
19
|
-
LEFT JOIN bots tb ON tb.id = c.bot_id
|
|
20
|
-
LEFT JOIN groups g ON g.id = c.group_id
|
|
21
|
-
WHERE c.id = ?
|
|
22
|
-
`).get(t);return n?s(n):null},"getAgentSession",0,function(e,t,n){let a=u(e,t,n);if(!a)return;let r=e.prepare(`
|
|
23
|
-
SELECT a.attempt_number, a.kind, a.request_id, a.outcome, a.started_at, a.finished_at,
|
|
24
|
-
CASE WHEN a.id = ? THEN 'source' ELSE 'resume' END AS role
|
|
25
|
-
FROM work_attempts a
|
|
26
|
-
WHERE a.id = ? OR a.resumed_session_binding_id = ?
|
|
27
|
-
ORDER BY a.started_at ASC, a.id ASC
|
|
28
|
-
`).all(a.source_attempt_id,a.source_attempt_id,a.id);return{...o(a),attempts:r}},"isSessionFilter",0,function(e){return"string"==typeof e&&n.includes(e)},"listAgentSessions",0,function(e,t,n="all"){return e.prepare(`${r} WHERE b.agent_id = ? ${"active"===n?"AND b.released_at IS NULL":"ended"===n?"AND b.released_at IS NOT NULL":""}`).all(t).map(o).sort(d)},"sessionDebugExternalId",0,function(e,t,n){return u(e,t,n)?.external_session_id},"sessionTitle",0,function(e,t,n){let a=u(e,t,n);return a?o(a).title:null}])}];
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=_0y3geoj._.js.map
|