@stigmer/server-slim 3.15.0 → 3.15.2
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/console/404.html +1 -1
- package/console/__next.__PAGE__.txt +2 -2
- package/console/__next._full.txt +14 -14
- package/console/__next._head.txt +4 -4
- package/console/__next._index.txt +9 -9
- package/console/__next._tree.txt +1 -1
- package/console/_next/static/chunks/033ax6lji-tes.js +1 -0
- package/console/_next/static/chunks/{0g4_345f39a55.js → 0cu7jpps89qek.js} +1 -1
- package/console/_next/static/chunks/0dvs3_g88-y3w.js +1 -0
- package/console/_next/static/chunks/{0qvczivzi0fcj.js → 0lbq-rv4._sxd.js} +1 -1
- package/console/_next/static/chunks/{0wb74irrcc7v7.js → 0r4rc1_40gx7f.js} +1 -1
- package/console/_next/static/chunks/0rt0okeappaf0.js +3 -0
- package/console/_next/static/chunks/0ty3ab~a037dh.js +1 -0
- package/console/_next/static/chunks/{0_gajuu~hgnb5.js → 15aq5lnv07h-o.js} +1 -1
- package/console/_not-found/__next._full.txt +14 -14
- package/console/_not-found/__next._head.txt +4 -4
- package/console/_not-found/__next._index.txt +9 -9
- package/console/_not-found/__next._not-found.__PAGE__.txt +3 -3
- package/console/_not-found/__next._not-found.txt +3 -3
- package/console/_not-found/__next._tree.txt +1 -1
- package/console/_not-found.html +1 -1
- package/console/_not-found.txt +14 -14
- package/console/auth/callback/__next._full.txt +16 -16
- package/console/auth/callback/__next._head.txt +4 -4
- package/console/auth/callback/__next._index.txt +9 -9
- package/console/auth/callback/__next._tree.txt +1 -1
- package/console/auth/callback/__next.auth.callback.__PAGE__.txt +4 -4
- package/console/auth/callback/__next.auth.callback.txt +3 -3
- package/console/auth/callback/__next.auth.txt +3 -3
- package/console/auth/callback.html +1 -1
- package/console/auth/callback.txt +16 -16
- package/console/auth/github/callback/__next._full.txt +16 -16
- package/console/auth/github/callback/__next._head.txt +4 -4
- package/console/auth/github/callback/__next._index.txt +9 -9
- package/console/auth/github/callback/__next._tree.txt +1 -1
- package/console/auth/github/callback/__next.auth.github.callback.__PAGE__.txt +4 -4
- package/console/auth/github/callback/__next.auth.github.callback.txt +3 -3
- package/console/auth/github/callback/__next.auth.github.txt +3 -3
- package/console/auth/github/callback/__next.auth.txt +3 -3
- package/console/auth/github/callback.html +1 -1
- package/console/auth/github/callback.txt +16 -16
- package/console/auth/oauth/callback/__next._full.txt +16 -16
- package/console/auth/oauth/callback/__next._head.txt +4 -4
- package/console/auth/oauth/callback/__next._index.txt +9 -9
- package/console/auth/oauth/callback/__next._tree.txt +1 -1
- package/console/auth/oauth/callback/__next.auth.oauth.callback.__PAGE__.txt +4 -4
- package/console/auth/oauth/callback/__next.auth.oauth.callback.txt +3 -3
- package/console/auth/oauth/callback/__next.auth.oauth.txt +3 -3
- package/console/auth/oauth/callback/__next.auth.txt +3 -3
- package/console/auth/oauth/callback.html +1 -1
- package/console/auth/oauth/callback.txt +16 -16
- package/console/chat/__placeholder__/__placeholder__/__next._full.txt +15 -15
- package/console/chat/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/chat/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/chat/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.$d$slug.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__/__next.chat.$d$org.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__/__next.chat.txt +3 -3
- package/console/chat/__placeholder__/__placeholder__.html +1 -1
- package/console/chat/__placeholder__/__placeholder__.txt +15 -15
- package/console/conversations/__next._full.txt +15 -15
- package/console/conversations/__next._head.txt +4 -4
- package/console/conversations/__next._index.txt +9 -9
- package/console/conversations/__next._tree.txt +1 -1
- package/console/conversations/__next.conversations.__PAGE__.txt +3 -3
- package/console/conversations/__next.conversations.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next._full.txt +15 -15
- package/console/conversations/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/conversations/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/conversations/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.__PAGE__.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.$d$key.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.$d$channelId.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__/__next.conversations.txt +3 -3
- package/console/conversations/__placeholder__/__placeholder__.html +1 -1
- package/console/conversations/__placeholder__/__placeholder__.txt +15 -15
- package/console/conversations.html +1 -1
- package/console/conversations.txt +15 -15
- package/console/dashboard/__next._full.txt +15 -15
- package/console/dashboard/__next._head.txt +4 -4
- package/console/dashboard/__next._index.txt +9 -9
- package/console/dashboard/__next._tree.txt +1 -1
- package/console/dashboard/__next.dashboard.__PAGE__.txt +3 -3
- package/console/dashboard/__next.dashboard.txt +3 -3
- package/console/dashboard.html +1 -1
- package/console/dashboard.txt +15 -15
- package/console/executions/__placeholder__/__next._full.txt +14 -14
- package/console/executions/__placeholder__/__next._head.txt +4 -4
- package/console/executions/__placeholder__/__next._index.txt +9 -9
- package/console/executions/__placeholder__/__next._tree.txt +1 -1
- package/console/executions/__placeholder__/__next.executions.$d$id.__PAGE__.txt +2 -2
- package/console/executions/__placeholder__/__next.executions.$d$id.txt +3 -3
- package/console/executions/__placeholder__/__next.executions.txt +3 -3
- package/console/executions/__placeholder__.html +1 -1
- package/console/executions/__placeholder__.txt +14 -14
- package/console/index.html +1 -1
- package/console/index.txt +14 -14
- package/console/invite/__placeholder__/__next._full.txt +16 -16
- package/console/invite/__placeholder__/__next._head.txt +4 -4
- package/console/invite/__placeholder__/__next._index.txt +9 -9
- package/console/invite/__placeholder__/__next._tree.txt +1 -1
- package/console/invite/__placeholder__/__next.invite.$d$token.__PAGE__.txt +3 -3
- package/console/invite/__placeholder__/__next.invite.$d$token.txt +3 -3
- package/console/invite/__placeholder__/__next.invite.txt +3 -3
- package/console/invite/__placeholder__.html +1 -1
- package/console/invite/__placeholder__.txt +16 -16
- package/console/library/__next._full.txt +17 -17
- package/console/library/__next._head.txt +4 -4
- package/console/library/__next._index.txt +9 -9
- package/console/library/__next._tree.txt +1 -1
- package/console/library/__next.library.__PAGE__.txt +3 -3
- package/console/library/__next.library.txt +5 -5
- package/console/library/agents/__next._full.txt +17 -17
- package/console/library/agents/__next._head.txt +4 -4
- package/console/library/agents/__next._index.txt +9 -9
- package/console/library/agents/__next._tree.txt +1 -1
- package/console/library/agents/__next.library.agents.__PAGE__.txt +3 -3
- package/console/library/agents/__next.library.agents.txt +3 -3
- package/console/library/agents/__next.library.txt +5 -5
- package/console/library/agents/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/agents/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/agents/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/agents/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.$d$slug.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.$d$org.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.agents.txt +3 -3
- package/console/library/agents/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/agents/__placeholder__/__placeholder__.html +1 -1
- package/console/library/agents/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/agents/new/__next._full.txt +18 -18
- package/console/library/agents/new/__next._head.txt +4 -4
- package/console/library/agents/new/__next._index.txt +9 -9
- package/console/library/agents/new/__next._tree.txt +1 -1
- package/console/library/agents/new/__next.library.agents.new.__PAGE__.txt +4 -4
- package/console/library/agents/new/__next.library.agents.new.txt +3 -3
- package/console/library/agents/new/__next.library.agents.txt +3 -3
- package/console/library/agents/new/__next.library.txt +5 -5
- package/console/library/agents/new.html +1 -1
- package/console/library/agents/new.txt +18 -18
- package/console/library/agents.html +1 -1
- package/console/library/agents.txt +17 -17
- package/console/library/mcp-servers/__next._full.txt +17 -17
- package/console/library/mcp-servers/__next._head.txt +4 -4
- package/console/library/mcp-servers/__next._index.txt +9 -9
- package/console/library/mcp-servers/__next._tree.txt +1 -1
- package/console/library/mcp-servers/__next.library.mcp-servers.__PAGE__.txt +3 -3
- package/console/library/mcp-servers/__next.library.mcp-servers.txt +3 -3
- package/console/library/mcp-servers/__next.library.txt +5 -5
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.$d$slug.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.$d$org.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.mcp-servers.txt +3 -3
- package/console/library/mcp-servers/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/mcp-servers/__placeholder__/__placeholder__.html +1 -1
- package/console/library/mcp-servers/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/mcp-servers/new/__next._full.txt +18 -18
- package/console/library/mcp-servers/new/__next._head.txt +4 -4
- package/console/library/mcp-servers/new/__next._index.txt +9 -9
- package/console/library/mcp-servers/new/__next._tree.txt +1 -1
- package/console/library/mcp-servers/new/__next.library.mcp-servers.new.__PAGE__.txt +4 -4
- package/console/library/mcp-servers/new/__next.library.mcp-servers.new.txt +3 -3
- package/console/library/mcp-servers/new/__next.library.mcp-servers.txt +3 -3
- package/console/library/mcp-servers/new/__next.library.txt +5 -5
- package/console/library/mcp-servers/new.html +1 -1
- package/console/library/mcp-servers/new.txt +18 -18
- package/console/library/mcp-servers.html +1 -1
- package/console/library/mcp-servers.txt +17 -17
- package/console/library/schedules/__next._full.txt +17 -17
- package/console/library/schedules/__next._head.txt +4 -4
- package/console/library/schedules/__next._index.txt +9 -9
- package/console/library/schedules/__next._tree.txt +1 -1
- package/console/library/schedules/__next.library.schedules.__PAGE__.txt +3 -3
- package/console/library/schedules/__next.library.schedules.txt +3 -3
- package/console/library/schedules/__next.library.txt +5 -5
- package/console/library/schedules/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/schedules/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/schedules/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/schedules/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.$d$slug.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.$d$org.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.schedules.txt +3 -3
- package/console/library/schedules/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/schedules/__placeholder__/__placeholder__.html +1 -1
- package/console/library/schedules/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/schedules/new/__next._full.txt +18 -18
- package/console/library/schedules/new/__next._head.txt +4 -4
- package/console/library/schedules/new/__next._index.txt +9 -9
- package/console/library/schedules/new/__next._tree.txt +1 -1
- package/console/library/schedules/new/__next.library.schedules.new.__PAGE__.txt +4 -4
- package/console/library/schedules/new/__next.library.schedules.new.txt +3 -3
- package/console/library/schedules/new/__next.library.schedules.txt +3 -3
- package/console/library/schedules/new/__next.library.txt +5 -5
- package/console/library/schedules/new.html +1 -1
- package/console/library/schedules/new.txt +18 -18
- package/console/library/schedules.html +1 -1
- package/console/library/schedules.txt +17 -17
- package/console/library/skills/__next._full.txt +17 -17
- package/console/library/skills/__next._head.txt +4 -4
- package/console/library/skills/__next._index.txt +9 -9
- package/console/library/skills/__next._tree.txt +1 -1
- package/console/library/skills/__next.library.skills.__PAGE__.txt +3 -3
- package/console/library/skills/__next.library.skills.txt +3 -3
- package/console/library/skills/__next.library.txt +5 -5
- package/console/library/skills/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/skills/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/skills/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/skills/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.$d$slug.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.$d$org.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.skills.txt +3 -3
- package/console/library/skills/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/skills/__placeholder__/__placeholder__.html +1 -1
- package/console/library/skills/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/skills/new/__next._full.txt +18 -18
- package/console/library/skills/new/__next._head.txt +4 -4
- package/console/library/skills/new/__next._index.txt +9 -9
- package/console/library/skills/new/__next._tree.txt +1 -1
- package/console/library/skills/new/__next.library.skills.new.__PAGE__.txt +4 -4
- package/console/library/skills/new/__next.library.skills.new.txt +3 -3
- package/console/library/skills/new/__next.library.skills.txt +3 -3
- package/console/library/skills/new/__next.library.txt +5 -5
- package/console/library/skills/new.html +1 -1
- package/console/library/skills/new.txt +18 -18
- package/console/library/skills.html +1 -1
- package/console/library/skills.txt +17 -17
- package/console/library/workflows/__next._full.txt +17 -17
- package/console/library/workflows/__next._head.txt +4 -4
- package/console/library/workflows/__next._index.txt +9 -9
- package/console/library/workflows/__next._tree.txt +1 -1
- package/console/library/workflows/__next.library.txt +5 -5
- package/console/library/workflows/__next.library.workflows.__PAGE__.txt +3 -3
- package/console/library/workflows/__next.library.workflows.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/workflows/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/workflows/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.$d$slug.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.$d$org.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__/__next.library.workflows.txt +3 -3
- package/console/library/workflows/__placeholder__/__placeholder__.html +1 -1
- package/console/library/workflows/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/workflows/executions/__next._full.txt +17 -17
- package/console/library/workflows/executions/__next._head.txt +4 -4
- package/console/library/workflows/executions/__next._index.txt +9 -9
- package/console/library/workflows/executions/__next._tree.txt +1 -1
- package/console/library/workflows/executions/__next.library.txt +5 -5
- package/console/library/workflows/executions/__next.library.workflows.executions.__PAGE__.txt +3 -3
- package/console/library/workflows/executions/__next.library.workflows.executions.txt +3 -3
- package/console/library/workflows/executions/__next.library.workflows.txt +3 -3
- package/console/library/workflows/executions.html +1 -1
- package/console/library/workflows/executions.txt +17 -17
- package/console/library/workflows/new/__next._full.txt +18 -18
- package/console/library/workflows/new/__next._head.txt +4 -4
- package/console/library/workflows/new/__next._index.txt +9 -9
- package/console/library/workflows/new/__next._tree.txt +1 -1
- package/console/library/workflows/new/__next.library.txt +5 -5
- package/console/library/workflows/new/__next.library.workflows.new.__PAGE__.txt +4 -4
- package/console/library/workflows/new/__next.library.workflows.new.txt +3 -3
- package/console/library/workflows/new/__next.library.workflows.txt +3 -3
- package/console/library/workflows/new.html +1 -1
- package/console/library/workflows/new.txt +18 -18
- package/console/library/workflows.html +1 -1
- package/console/library/workflows.txt +17 -17
- package/console/library.html +1 -1
- package/console/library.txt +17 -17
- package/console/login/__next._full.txt +17 -17
- package/console/login/__next._head.txt +4 -4
- package/console/login/__next._index.txt +9 -9
- package/console/login/__next._tree.txt +1 -1
- package/console/login/__next.login.__PAGE__.txt +4 -4
- package/console/login/__next.login.txt +3 -3
- package/console/login.html +1 -1
- package/console/login.txt +17 -17
- package/console/oauth/slack/callback/__next._full.txt +16 -16
- package/console/oauth/slack/callback/__next._head.txt +4 -4
- package/console/oauth/slack/callback/__next._index.txt +9 -9
- package/console/oauth/slack/callback/__next._tree.txt +1 -1
- package/console/oauth/slack/callback/__next.oauth.slack.callback.__PAGE__.txt +4 -4
- package/console/oauth/slack/callback/__next.oauth.slack.callback.txt +3 -3
- package/console/oauth/slack/callback/__next.oauth.slack.txt +3 -3
- package/console/oauth/slack/callback/__next.oauth.txt +3 -3
- package/console/oauth/slack/callback.html +1 -1
- package/console/oauth/slack/callback.txt +16 -16
- package/console/sessions/__placeholder__/__next._full.txt +14 -14
- package/console/sessions/__placeholder__/__next._head.txt +4 -4
- package/console/sessions/__placeholder__/__next._index.txt +9 -9
- package/console/sessions/__placeholder__/__next._tree.txt +1 -1
- package/console/sessions/__placeholder__/__next.sessions.$d$id.__PAGE__.txt +2 -2
- package/console/sessions/__placeholder__/__next.sessions.$d$id.txt +3 -3
- package/console/sessions/__placeholder__/__next.sessions.txt +3 -3
- package/console/sessions/__placeholder__.html +1 -1
- package/console/sessions/__placeholder__.txt +14 -14
- package/console/settings/__next._full.txt +18 -18
- package/console/settings/__next._head.txt +4 -4
- package/console/settings/__next._index.txt +9 -9
- package/console/settings/__next._tree.txt +1 -1
- package/console/settings/__next.settings.__PAGE__.txt +4 -4
- package/console/settings/__next.settings.txt +5 -5
- package/console/settings/account-preferences/__next._full.txt +17 -17
- package/console/settings/account-preferences/__next._head.txt +4 -4
- package/console/settings/account-preferences/__next._index.txt +9 -9
- package/console/settings/account-preferences/__next._tree.txt +1 -1
- package/console/settings/account-preferences/__next.settings.account-preferences.__PAGE__.txt +3 -3
- package/console/settings/account-preferences/__next.settings.account-preferences.txt +3 -3
- package/console/settings/account-preferences/__next.settings.txt +5 -5
- package/console/settings/account-preferences.html +1 -1
- package/console/settings/account-preferences.txt +17 -17
- package/console/settings/api-keys/__next._full.txt +17 -17
- package/console/settings/api-keys/__next._head.txt +4 -4
- package/console/settings/api-keys/__next._index.txt +9 -9
- package/console/settings/api-keys/__next._tree.txt +1 -1
- package/console/settings/api-keys/__next.settings.api-keys.__PAGE__.txt +3 -3
- package/console/settings/api-keys/__next.settings.api-keys.txt +3 -3
- package/console/settings/api-keys/__next.settings.txt +5 -5
- package/console/settings/api-keys.html +1 -1
- package/console/settings/api-keys.txt +17 -17
- package/console/settings/billing/__next._full.txt +18 -18
- package/console/settings/billing/__next._head.txt +4 -4
- package/console/settings/billing/__next._index.txt +9 -9
- package/console/settings/billing/__next._tree.txt +1 -1
- package/console/settings/billing/__next.settings.billing.__PAGE__.txt +4 -4
- package/console/settings/billing/__next.settings.billing.txt +3 -3
- package/console/settings/billing/__next.settings.txt +5 -5
- package/console/settings/billing.html +1 -1
- package/console/settings/billing.txt +18 -18
- package/console/settings/channel-apps/__next._full.txt +17 -17
- package/console/settings/channel-apps/__next._head.txt +4 -4
- package/console/settings/channel-apps/__next._index.txt +9 -9
- package/console/settings/channel-apps/__next._tree.txt +1 -1
- package/console/settings/channel-apps/__next.settings.channel-apps.__PAGE__.txt +3 -3
- package/console/settings/channel-apps/__next.settings.channel-apps.txt +3 -3
- package/console/settings/channel-apps/__next.settings.txt +5 -5
- package/console/settings/channel-apps.html +1 -1
- package/console/settings/channel-apps.txt +17 -17
- package/console/settings/cursor-accounts/__next._full.txt +18 -18
- package/console/settings/cursor-accounts/__next._head.txt +4 -4
- package/console/settings/cursor-accounts/__next._index.txt +9 -9
- package/console/settings/cursor-accounts/__next._tree.txt +1 -1
- package/console/settings/cursor-accounts/__next.settings.cursor-accounts.__PAGE__.txt +4 -4
- package/console/settings/cursor-accounts/__next.settings.cursor-accounts.txt +3 -3
- package/console/settings/cursor-accounts/__next.settings.txt +5 -5
- package/console/settings/cursor-accounts.html +1 -1
- package/console/settings/cursor-accounts.txt +18 -18
- package/console/settings/environments/__next._full.txt +17 -17
- package/console/settings/environments/__next._head.txt +4 -4
- package/console/settings/environments/__next._index.txt +9 -9
- package/console/settings/environments/__next._tree.txt +1 -1
- package/console/settings/environments/__next.settings.environments.__PAGE__.txt +3 -3
- package/console/settings/environments/__next.settings.environments.txt +3 -3
- package/console/settings/environments/__next.settings.txt +5 -5
- package/console/settings/environments.html +1 -1
- package/console/settings/environments.txt +17 -17
- package/console/settings/identity-providers/__next._full.txt +17 -17
- package/console/settings/identity-providers/__next._head.txt +4 -4
- package/console/settings/identity-providers/__next._index.txt +9 -9
- package/console/settings/identity-providers/__next._tree.txt +1 -1
- package/console/settings/identity-providers/__next.settings.identity-providers.__PAGE__.txt +3 -3
- package/console/settings/identity-providers/__next.settings.identity-providers.txt +3 -3
- package/console/settings/identity-providers/__next.settings.txt +5 -5
- package/console/settings/identity-providers.html +1 -1
- package/console/settings/identity-providers.txt +17 -17
- package/console/settings/invitations/__next._full.txt +17 -17
- package/console/settings/invitations/__next._head.txt +4 -4
- package/console/settings/invitations/__next._index.txt +9 -9
- package/console/settings/invitations/__next._tree.txt +1 -1
- package/console/settings/invitations/__next.settings.invitations.__PAGE__.txt +3 -3
- package/console/settings/invitations/__next.settings.invitations.txt +3 -3
- package/console/settings/invitations/__next.settings.txt +5 -5
- package/console/settings/invitations.html +1 -1
- package/console/settings/invitations.txt +17 -17
- package/console/settings/members/__next._full.txt +17 -17
- package/console/settings/members/__next._head.txt +4 -4
- package/console/settings/members/__next._index.txt +9 -9
- package/console/settings/members/__next._tree.txt +1 -1
- package/console/settings/members/__next.settings.members.__PAGE__.txt +3 -3
- package/console/settings/members/__next.settings.members.txt +3 -3
- package/console/settings/members/__next.settings.txt +5 -5
- package/console/settings/members.html +1 -1
- package/console/settings/members.txt +17 -17
- package/console/settings/memory/__next._full.txt +17 -17
- package/console/settings/memory/__next._head.txt +4 -4
- package/console/settings/memory/__next._index.txt +9 -9
- package/console/settings/memory/__next._tree.txt +1 -1
- package/console/settings/memory/__next.settings.memory.__PAGE__.txt +3 -3
- package/console/settings/memory/__next.settings.memory.txt +3 -3
- package/console/settings/memory/__next.settings.txt +5 -5
- package/console/settings/memory.html +1 -1
- package/console/settings/memory.txt +17 -17
- package/console/settings/oauth-apps/__next._full.txt +17 -17
- package/console/settings/oauth-apps/__next._head.txt +4 -4
- package/console/settings/oauth-apps/__next._index.txt +9 -9
- package/console/settings/oauth-apps/__next._tree.txt +1 -1
- package/console/settings/oauth-apps/__next.settings.oauth-apps.__PAGE__.txt +3 -3
- package/console/settings/oauth-apps/__next.settings.oauth-apps.txt +3 -3
- package/console/settings/oauth-apps/__next.settings.txt +5 -5
- package/console/settings/oauth-apps.html +1 -1
- package/console/settings/oauth-apps.txt +17 -17
- package/console/settings/org-preferences/__next._full.txt +17 -17
- package/console/settings/org-preferences/__next._head.txt +4 -4
- package/console/settings/org-preferences/__next._index.txt +9 -9
- package/console/settings/org-preferences/__next._tree.txt +1 -1
- package/console/settings/org-preferences/__next.settings.org-preferences.__PAGE__.txt +3 -3
- package/console/settings/org-preferences/__next.settings.org-preferences.txt +3 -3
- package/console/settings/org-preferences/__next.settings.txt +5 -5
- package/console/settings/org-preferences.html +1 -1
- package/console/settings/org-preferences.txt +17 -17
- package/console/settings/org-profile/__next._full.txt +17 -17
- package/console/settings/org-profile/__next._head.txt +4 -4
- package/console/settings/org-profile/__next._index.txt +9 -9
- package/console/settings/org-profile/__next._tree.txt +1 -1
- package/console/settings/org-profile/__next.settings.org-profile.__PAGE__.txt +3 -3
- package/console/settings/org-profile/__next.settings.org-profile.txt +3 -3
- package/console/settings/org-profile/__next.settings.txt +5 -5
- package/console/settings/org-profile.html +1 -1
- package/console/settings/org-profile.txt +17 -17
- package/console/settings/platform-clients/__next._full.txt +17 -17
- package/console/settings/platform-clients/__next._head.txt +4 -4
- package/console/settings/platform-clients/__next._index.txt +9 -9
- package/console/settings/platform-clients/__next._tree.txt +1 -1
- package/console/settings/platform-clients/__next.settings.platform-clients.__PAGE__.txt +3 -3
- package/console/settings/platform-clients/__next.settings.platform-clients.txt +3 -3
- package/console/settings/platform-clients/__next.settings.txt +5 -5
- package/console/settings/platform-clients.html +1 -1
- package/console/settings/platform-clients.txt +17 -17
- package/console/settings/pricing-governance/__next._full.txt +18 -18
- package/console/settings/pricing-governance/__next._head.txt +4 -4
- package/console/settings/pricing-governance/__next._index.txt +9 -9
- package/console/settings/pricing-governance/__next._tree.txt +1 -1
- package/console/settings/pricing-governance/__next.settings.pricing-governance.__PAGE__.txt +4 -4
- package/console/settings/pricing-governance/__next.settings.pricing-governance.txt +3 -3
- package/console/settings/pricing-governance/__next.settings.txt +5 -5
- package/console/settings/pricing-governance.html +1 -1
- package/console/settings/pricing-governance.txt +18 -18
- package/console/settings/provider-standing/__next._full.txt +18 -18
- package/console/settings/provider-standing/__next._head.txt +4 -4
- package/console/settings/provider-standing/__next._index.txt +9 -9
- package/console/settings/provider-standing/__next._tree.txt +1 -1
- package/console/settings/provider-standing/__next.settings.provider-standing.__PAGE__.txt +4 -4
- package/console/settings/provider-standing/__next.settings.provider-standing.txt +3 -3
- package/console/settings/provider-standing/__next.settings.txt +5 -5
- package/console/settings/provider-standing.html +1 -1
- package/console/settings/provider-standing.txt +18 -18
- package/console/settings/usage/__next._full.txt +17 -17
- package/console/settings/usage/__next._head.txt +4 -4
- package/console/settings/usage/__next._index.txt +9 -9
- package/console/settings/usage/__next._tree.txt +1 -1
- package/console/settings/usage/__next.settings.txt +5 -5
- package/console/settings/usage/__next.settings.usage.__PAGE__.txt +3 -3
- package/console/settings/usage/__next.settings.usage.txt +3 -3
- package/console/settings/usage.html +1 -1
- package/console/settings/usage.txt +17 -17
- package/console/settings.html +1 -1
- package/console/settings.txt +18 -18
- package/console/workflows/__next._full.txt +14 -14
- package/console/workflows/__next._head.txt +4 -4
- package/console/workflows/__next._index.txt +9 -9
- package/console/workflows/__next._tree.txt +1 -1
- package/console/workflows/__next.workflows.__PAGE__.txt +2 -2
- package/console/workflows/__next.workflows.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next._full.txt +15 -15
- package/console/workflows/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/workflows/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/workflows/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.$d$slug.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.$d$org.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__/__next.workflows.txt +3 -3
- package/console/workflows/__placeholder__/__placeholder__.html +1 -1
- package/console/workflows/__placeholder__/__placeholder__.txt +15 -15
- package/console/workflows/executions/__next._full.txt +14 -14
- package/console/workflows/executions/__next._head.txt +4 -4
- package/console/workflows/executions/__next._index.txt +9 -9
- package/console/workflows/executions/__next._tree.txt +1 -1
- package/console/workflows/executions/__next.workflows.executions.__PAGE__.txt +2 -2
- package/console/workflows/executions/__next.workflows.executions.txt +3 -3
- package/console/workflows/executions/__next.workflows.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next._full.txt +15 -15
- package/console/workflows/executions/__placeholder__/__next._head.txt +4 -4
- package/console/workflows/executions/__placeholder__/__next._index.txt +9 -9
- package/console/workflows/executions/__placeholder__/__next._tree.txt +1 -1
- package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.__PAGE__.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next.workflows.executions.$d$id.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next.workflows.executions.txt +3 -3
- package/console/workflows/executions/__placeholder__/__next.workflows.txt +3 -3
- package/console/workflows/executions/__placeholder__.html +1 -1
- package/console/workflows/executions/__placeholder__.txt +15 -15
- package/console/workflows/executions.html +1 -1
- package/console/workflows/executions.txt +14 -14
- package/console/workflows.html +1 -1
- package/console/workflows.txt +14 -14
- package/main.js +7 -7
- package/package.json +6 -6
- package/workflow-bundle-agent-execution.js +1 -0
- package/workflow-bundle-schedule.js +1 -0
- package/workflow-bundle-workflow-execution.js +1 -0
- package/console/_next/static/chunks/06d139oapey.-.js +0 -1
- package/console/_next/static/chunks/0n2qydw3oc1oj.js +0 -1
- package/console/_next/static/chunks/0uq41itbafxa3.js +0 -3
- package/console/_next/static/chunks/0xr1dk~mec2dn.js +0 -1
- /package/console/_next/static/{AFZ5DiemTG8Wcz0l7Fw6k → 8wj8rj8lHRqNPvB9OCQPr}/_buildManifest.js +0 -0
- /package/console/_next/static/{AFZ5DiemTG8Wcz0l7Fw6k → 8wj8rj8lHRqNPvB9OCQPr}/_clientMiddlewareManifest.js +0 -0
- /package/console/_next/static/{AFZ5DiemTG8Wcz0l7Fw6k → 8wj8rj8lHRqNPvB9OCQPr}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16715,379185,292270,e=>{"use strict";var t=e.i(475254);let s=(0,t.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,s],16715);var r=e.i(843476),n=e.i(271645),a=e.i(891287),i=e.i(893976),o=e.i(610595),l=e.i(421415),u=e.i(586108),c=e.i(326283),d=e.i(367539),g=e.i(891914),m=e.i(379410);e.s(["CreateOrganizationForm",0,function({onCreated:e,onCancel:t,className:s}){let h=(0,n.useId)(),{create:p,isCreating:f,error:x,clearError:v}=function(){let e=(0,u.useStigmer)(),[t,s]=(0,n.useState)(!1),[r,a]=(0,n.useState)(null),i=(0,n.useCallback)(()=>a(null),[]);return{create:(0,n.useCallback)(async t=>{s(!0),a(null);try{return await e.organization.create(t)}catch(e){throw a((0,c.toError)(e)),e}finally{s(!1)}},[e]),isCreating:t,error:r,clearError:i}}(),[b,y]=(0,n.useState)(""),[k,j]=(0,n.useState)(""),[w,N]=(0,n.useState)(""),S=(0,n.useRef)(!1),C=b.trim(),E=k.length>0||C.length>0?(0,g.validateMessage)(l.ApiResourceMetadataSchema,(0,a.create)(l.ApiResourceMetadataSchema,{...k.length>0&&{slug:k},...C.length>0&&{name:C}})):[],T=k.length>0?(0,g.getFieldError)(E,"slug"):null,A=C.length>0?(0,g.getFieldError)(E,"name"):null,I=""!==C&&k.length>0&&null===T&&null===A&&!f,M=(0,n.useCallback)(e=>{y(e),S.current||j((0,d.generateSlug)(e.trim()))},[]),O=(0,n.useCallback)(e=>{S.current=!0,j(e)},[]),R=(0,n.useCallback)(async t=>{if(t.preventDefault(),I){v();try{let t=await p({name:C,slug:k,org:k,description:w.trim()||void 0});e?.(t)}catch{}}},[I,C,k,w,p,v,e]);return(0,r.jsxs)("form",{onSubmit:R,className:(0,i.cn)("stg:space-y-3",s),children:[(0,r.jsxs)("div",{className:"stg:space-y-2",children:[(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsx)("label",{htmlFor:`${h}-name`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Name"}),(0,r.jsx)("input",{id:`${h}-name`,type:"text",value:b,onChange:e=>M(e.target.value),placeholder:"e.g. Acme Corp",disabled:f,autoFocus:!0,required:!0,maxLength:63,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",A?"stg:border-destructive":"stg:border-input")}),A?(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-destructive",role:"alert",children:A}):(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"A human-readable display name for the organization."})]}),(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsx)("label",{htmlFor:`${h}-slug`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Slug"}),(0,r.jsx)("input",{id:`${h}-slug`,type:"text",value:k,onChange:e=>O(e.target.value),placeholder:"e.g. acme-corp",disabled:f,required:!0,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground stg:font-mono","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",T?"stg:border-destructive":"stg:border-input")}),T?(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-destructive",role:"alert",children:T}):(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"URL-friendly identifier used in resource references. 2–63 characters: lowercase letters, numbers, and hyphens."})]}),(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsxs)("label",{htmlFor:`${h}-desc`,className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:["Description"," ",(0,r.jsx)("span",{className:"stg:text-muted-foreground-subtle",children:"(optional)"})]}),(0,r.jsx)("input",{id:`${h}-desc`,type:"text",value:w,onChange:e=>N(e.target.value),placeholder:"What is this organization for?",disabled:f,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")})]})]}),x&&(0,r.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,o.getUserMessage)(x)}),(0,r.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,r.jsxs)("button",{type:"submit",disabled:!I,className:(0,i.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[f&&(0,r.jsx)(m.SpinnerIcon,{size:12}),"Create organization"]}),t&&(0,r.jsx)("button",{type:"button",onClick:t,disabled:f,className:(0,i.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]})}],379185);let h=(0,t.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["LogOut",0,h],292270)},693079,e=>{"use strict";let t,s,r,n,a,i;var o=e.i(843476),l=e.i(271645),u=e.i(618566);e.i(247167);var c=e.i(363178);function d(e){return(0,o.jsx)(c.ThemeProvider,{...e})}var g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=g;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},h="u"<typeof window||"Deno"in globalThis;function p(){}function f(e,t){return"function"==typeof e?e(t):e}function x(e,t){let{type:s="all",exact:r,fetchStatus:n,predicate:a,queryKey:i,stale:o}=e;if(i){if(r){if(t.queryHash!==b(i,t.options))return!1}else if(!k(t.queryKey,i))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!n||n===t.state.fetchStatus)&&(!a||!!a(t))}function v(e,t){let{exact:s,status:r,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(y(t.options.mutationKey)!==y(a))return!1}else if(!k(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&(!n||!!n(t))}function b(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>N(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function k(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>k(e[s],t[s]))}var j=Object.prototype.hasOwnProperty;function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!S(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function C(e,t,s=0){let r=[...e,t];return s&&r.length>s?r.slice(1):r}function E(e,t,s=0){let r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var T=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==T?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var I=(t=[],s=0,r=e=>{e()},n=e=>{e()},a=function(e){setTimeout(e,0)},{batch:e=>{let i;s++;try{i=e()}finally{let e;--s||(e=t,t=[],e.length&&a(()=>{n(()=>{e.forEach(e=>{r(e)})})}))}return i},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i=e=>{s?t.push(e):a(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{a=e}}),M=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},O=new class extends M{#s;#r;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#n=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#s!==e&&(this.#s=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#s?this.#s:globalThis.document?.visibilityState!=="hidden"}},R=new class extends M{#a=!0;#r;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#r||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#n=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function _(e){return Math.min(1e3*2**e,3e4)}function D(e){return(e??"online")!=="online"||R.isOnline()}var P=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function F(e){let t,s=!1,r=0,n=function(){let e,t,s=new Promise((s,r)=>{e=s,t=r});function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}(),a=()=>O.isFocused()&&("always"===e.networkMode||R.isOnline())&&e.canRun(),i=()=>D(e.networkMode)&&e.canRun(),o=e=>{"pending"===n.status&&(t?.(),n.resolve(e))},l=e=>{"pending"===n.status&&(t?.(),n.reject(e))},u=()=>new Promise(s=>{t=e=>{("pending"!==n.status||a())&&s(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===n.status&&e.onContinue?.()}),c=()=>{let t;if("pending"!==n.status)return;let i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(o).catch(t=>{if("pending"!==n.status)return;let i=e.retry??3*!h,o=e.retryDelay??_,d="function"==typeof o?o(r,t):o,g=!0===i||"number"==typeof i&&r<i||"function"==typeof i&&i(r,t);s||!g?l(t):(r++,e.onFail?.(r,t),new Promise(e=>{m.setTimeout(e,d)}).then(()=>a()?void 0:u()).then(()=>{s?l(t):c()}))})};return{promise:n,status:()=>n.status,cancel:t=>{if("pending"===n.status){let s=new P(t);l(s),e.onCancel?.(s)}},continue:()=>(t?.(),n),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:i,start:()=>(i()?c():u().then(c),n)}}var L=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){var e;this.clearGcTimeout(),"number"==typeof(e=this.gcTime)&&e>=0&&e!==1/0&&(this.#i=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(h?1/0:3e5))}clearGcTimeout(){this.#i&&(m.clearTimeout(this.#i),this.#i=void 0)}},W=class extends L{#o;#l;#u;#c;#d;#g;#m;constructor(e){super(),this.#m=!1,this.#g=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=U(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#g,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=U(this.options);void 0!==e.data&&(this.setState(K(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){var s,r;let n=(s=this.state.data,"function"==typeof(r=this.options).structuralSharing?r.structuralSharing(s,e):!1!==r.structuralSharing?function e(t,s,r=0){if(t===s)return t;if(r>500)return s;let n=w(t)&&w(s);if(!n&&!(N(t)&&N(s)))return s;let a=(n?t:Object.keys(t)).length,i=n?s:Object.keys(s),o=i.length,l=n?Array(o):{},u=0;for(let c=0;c<o;c++){let o=n?c:i[c],d=t[o],g=s[o];if(d===g){l[o]=d,(n?c<a:j.call(t,o))&&u++;continue}if(null===d||null===g||"object"!=typeof d||"object"!=typeof g){l[o]=g;continue}let m=e(d,g,r+1);l[o]=m,m===d&&u++}return a===o&&u===a?t:l}(s,e):e);return this.#h({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#h({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>{var t;return!1!==(t=e.options.enabled,"function"==typeof t?t(this):t)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===T||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===f(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(e||0)-Date.now(),0))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#m?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#h({type:"invalidate"})}async fetch(e,t){let s;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#m=!0,r.signal)})},a=()=>{let e,s=A(this.options,t),r=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#m=!1,this.options.persister)?this.options.persister(s,r,this):s(r)},i=(n(s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),s);this.options.behavior?.onFetch(i,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#h({type:"fetch",meta:i.fetchOptions?.meta}),this.#d=F({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof P&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:()=>{this.#h({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof P){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#h({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#h(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var s;return{...t,...(s=t.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D(this.options.networkMode)?"fetching":"paused",...void 0===s&&{error:null,status:"pending"}}),fetchMeta:e.meta??null};case"success":let r={...t,...K(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),I.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function K(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function U(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var B=class extends M{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,s){let r=t.queryKey,n=t.queryHash??b(r,t),a=this.get(n);return a||(a=new W({client:e,queryKey:r,queryHash:n,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){I.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>x(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>x(e,t)):t}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){I.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){I.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},z=class extends L{#c;#f;#x;#d;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#x=e.mutationCache,this.#f=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#f.includes(e)||(this.#f.push(e),this.clearGcTimeout(),this.#x.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#f=this.#f.filter(t=>t!==e),this.scheduleGc(),this.#x.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#f.length||("pending"===this.state.status?this.scheduleGc():this.#x.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#h({type:"continue"})},s={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=F({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#x.canRun(this)});let r="pending"===this.state.status,n=!this.#d.canStart();try{if(r)t();else{this.#h({type:"pending",variables:e,isPaused:n}),this.#x.config.onMutate&&await this.#x.config.onMutate(e,this,s);let t=await this.options.onMutate?.(e,s);t!==this.state.context&&this.#h({type:"pending",context:t,variables:e,isPaused:n})}let a=await this.#d.start();return await this.#x.config.onSuccess?.(a,e,this.state.context,this,s),await this.options.onSuccess?.(a,e,this.state.context,s),await this.#x.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,e,this.state.context,s),this.#h({type:"success",data:a}),a}catch(t){try{await this.#x.config.onError?.(t,e,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,s)}catch(e){Promise.reject(e)}try{await this.#x.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,s)}catch(e){Promise.reject(e)}throw this.#h({type:"error",error:t}),t}finally{this.#x.runNext(this)}}#h(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),I.batch(()=>{this.#f.forEach(t=>{t.onMutationUpdate(e)}),this.#x.notify({mutation:this,type:"updated",action:e})})}},$=class extends M{constructor(e={}){super(),this.config=e,this.#v=new Set,this.#b=new Map,this.#y=0}#v;#b;#y;build(e,t,s){let r=new z({client:e,mutationCache:this,mutationId:++this.#y,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#v.add(e);let t=q(e);if("string"==typeof t){let s=this.#b.get(t);s?s.push(e):this.#b.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#v.delete(e)){let t=q(e);if("string"==typeof t){let s=this.#b.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#b.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=q(e);if("string"!=typeof t)return!0;{let s=this.#b.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=q(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#b.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){I.batch(()=>{this.#v.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#v.clear(),this.#b.clear()})}getAll(){return Array.from(this.#v)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){return this.getAll().filter(t=>v(e,t))}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return I.batch(()=>Promise.all(e.map(e=>e.continue().catch(p))))}};function q(e){return e.options.scope?.id}function H(e){return{onFetch:(t,s)=>{let r=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,u=async()=>{let s=!1,u=A(t.options,t.fetchOptions),c=async(e,r,n)=>{if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let a=(()=>{var e,a;let i,o,l={client:t.client,queryKey:t.queryKey,pageParam:r,direction:n?"backward":"forward",meta:t.options.meta};return e=()=>t.signal,a=()=>s=!0,o=!1,Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(i??=e(),o||(o=!0,i.aborted?a():i.addEventListener("abort",a,{once:!0})),i)}),l})(),i=await u(a),{maxPages:o}=t.options,l=n?E:C;return{pages:l(e.pages,i,o),pageParams:l(e.pageParams,r,o)}};if(n&&a.length){let e="backward"===n,t={pages:a,pageParams:i},s=(e?function(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}:G)(r,t);o=await c(t,s,e)}else{let t=e??a.length;do{let e=0===l?i[0]??r.initialPageParam:G(r,o);if(l>0&&null==e)break;o=await c(o,e),l++}while(l<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=u}}}function G(e,{pages:t,pageParams:s}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}var V=class{#k;#x;#g;#j;#w;#N;#S;#C;constructor(e={}){this.#k=e.queryCache||new B,this.#x=e.mutationCache||new $,this.#g=e.defaultOptions||{},this.#j=new Map,this.#w=new Map,this.#N=0}mount(){this.#N++,1===this.#N&&(this.#S=O.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onFocus())}),this.#C=R.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onOnline())}))}unmount(){this.#N--,0===this.#N&&(this.#S?.(),this.#S=void 0,this.#C?.(),this.#C=void 0)}isFetching(e){return this.#k.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#x.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#k.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(f(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#k.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),n=this.#k.get(r.queryHash),a=n?.state.data,i="function"==typeof t?t(a):t;if(void 0!==i)return this.#k.build(this,r).setData(i,{...s,manual:!0})}setQueriesData(e,t,s){return I.batch(()=>this.#k.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state}removeQueries(e){let t=this.#k;I.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#k;return I.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(I.batch(()=>this.#k.findAll(e).map(e=>e.cancel(s)))).then(p).catch(p)}invalidateQueries(e,t={}){return I.batch(()=>(this.#k.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(I.batch(()=>this.#k.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(p)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(p)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#k.build(this,t);return s.isStaleByTime(f(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(p).catch(p)}fetchInfiniteQuery(e){return e.behavior=H(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(p).catch(p)}ensureInfiniteQueryData(e){return e.behavior=H(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return R.isOnline()?this.#x.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#k}getMutationCache(){return this.#x}getDefaultOptions(){return this.#g}setDefaultOptions(e){this.#g=e}setQueryDefaults(e,t){this.#j.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#j.values()],s={};return t.forEach(t=>{k(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#w.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#w.values()],s={};return t.forEach(t=>{k(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#g.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=b(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===T&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#g.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#k.clear(),this.#x.clear()}},X=l.createContext(void 0),Q=({client:e,children:t})=>(l.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,o.jsx)(X.Provider,{value:e,children:t})),Y=e.i(531278),J=e.i(610595),Z=e.i(941693),ee=e.i(297629);e.i(67407);var et=e.i(282155),es=e.i(671010),er=e.i(272012),en=e.i(163308),ea=e.i(800692),ei=e.i(472402);function eo(){try{let e=new URL((0,ei.getApiBaseUrl)()).hostname;if("localhost"===e||"127.0.0.1"===e||"::1"===e)return"local"}catch{return"local"}return"cloud"}function el({children:e}){let{accessToken:t,logout:s}=(0,ea.useAuth)(),{resolvedTheme:r}=(0,c.useTheme)(),n=(0,l.useCallback)(()=>t,[t]),a=(0,l.useCallback)(()=>s(),[s]),i=(0,l.useMemo)(()=>new er.Stigmer({baseUrl:(0,ei.getApiBaseUrl)(),getAccessToken:n,onUnauthenticated:a}),[n,a]),u=function(e){let[t,s]=(0,l.useState)(eo),r=(0,l.useMemo)(()=>e,[e]);return(0,l.useEffect)(()=>{if(!r)return;let e=!1;return r.platform.getServerInfo().then(t=>{e||s(t.deploymentMode)},()=>{}),()=>{e=!0}},[r]),t}(i);return(0,o.jsx)(en.StigmerProvider,{client:i,deploymentMode:u,colorMode:"dark"===r?"dark":"light",preset:"monochrome",children:e})}var eu=e.i(846696),ec=e.i(444868);function ed(e){let t=(0,ec.useColorMode)();return(0,o.jsx)(eu.Toaster,{theme:t,position:"top-right",richColors:!0,className:"toaster stg:group",toastOptions:{classNames:{toast:"stg:group toast stg:group-[.toaster]:bg-background stg:group-[.toaster]:text-foreground stg:group-[.toaster]:border-border stg:group-[.toaster]:shadow-lg",description:"stg:group-[.toast]:text-muted-foreground",actionButton:"stg:group-[.toast]:bg-primary stg:group-[.toast]:text-primary-foreground",cancelButton:"stg:group-[.toast]:bg-muted stg:group-[.toast]:text-muted-foreground"}},...e})}var eg=e.i(63209),em=e.i(16715),eh=e.i(607486),ep=e.i(292270),ef=e.i(379185),ex=e.i(707125);let ev=["/invite/"];function eb({children:e}){let t=(0,u.usePathname)(),{state:s,retry:r,refresh:n}=function(e){let{isBypassed:t,isOidcMode:s}=e,{orgs:r,isLoading:n,error:a,retry:i,refresh:o}=(0,ee.useOrg)(),[u,c]=(0,l.useState)(!1),[d,g]=(0,l.useState)(!1);t||u||n||0!==r.length||a||!s||c(!0);let m=u&&0===r.length&&!d;return(0,l.useEffect)(()=>{if(!m)return;let e=setInterval(()=>o(),2e3),t=setTimeout(()=>g(!0),1e4);return()=>{clearInterval(e),clearTimeout(t)}},[m,o]),{state:t?{status:"bypassed"}:m?{status:"provisioning"}:n?{status:"loading"}:a?{status:"error",message:a}:0===r.length?{status:"no-orgs"}:{status:"ready"},retry:i,refresh:o}}({isBypassed:ev.some(e=>t.startsWith(e)),isOidcMode:"oidc"===(0,ex.getRuntimeConfig)().authMode});switch(s.status){case"bypassed":case"ready":return(0,o.jsx)(o.Fragment,{children:e});case"loading":return(0,o.jsx)(ej,{});case"provisioning":return(0,o.jsx)(ek,{});case"error":return(0,o.jsx)(ew,{message:s.message,onRetry:r});case"no-orgs":return(0,o.jsx)(eN,{onRefresh:n})}}function ey(){let{user:e,logout:t}=(0,ea.useAuth)();if(!e)return null;let s=(e.name??e.email).charAt(0).toUpperCase();return(0,o.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-3 p-4",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("div",{className:"bg-muted text-muted-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,o.jsx)("span",{className:"text-xs font-medium",children:s})}),(0,o.jsx)("span",{className:"text-muted-foreground text-sm",children:e.email})]}),(0,o.jsxs)("button",{onClick:t,className:"text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1.5 text-sm transition-colors",children:[(0,o.jsx)(ep.LogOut,{className:"size-3.5"}),"Sign out"]})]})}function ek(){let{user:e}=(0,ea.useAuth)(),t=e?.name??e?.email;return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(ey,{}),(0,o.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[e&&(0,o.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,o.jsx)("span",{className:"text-muted-foreground text-lg font-medium",children:(t??"?").charAt(0).toUpperCase()})}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:t?`Welcome, ${t}!`:"Welcome!"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Setting up your workspace…"})]}),(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-5 animate-spin"})]})]})}function ej(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}function ew({message:e,onRetry:t}){return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center gap-4 p-8",children:[(0,o.jsx)(ey,{}),(0,o.jsx)(eg.AlertCircle,{className:"text-destructive size-8"}),(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Failed to load organizations"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:e}),(0,o.jsxs)("button",{onClick:t,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary-hover",children:[(0,o.jsx)(em.RefreshCw,{className:"size-3"}),"Try again"]})]})}function eN({onRefresh:e}){let t=(0,l.useCallback)(t=>{e(t.metadata?.slug)},[e]);return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(ey,{}),(0,o.jsxs)("div",{className:"w-full max-w-sm space-y-6",children:[(0,o.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,o.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,o.jsx)(eh.Building2,{className:"text-muted-foreground size-6"})}),(0,o.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Welcome to Stigmer"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Create an organization to get started. Organizations are the top-level context that owns your agents, environments, and resources."})]}),(0,o.jsx)(ef.CreateOrganizationForm,{onCreated:t})]})]})}var eS=e.i(910304);async function eC(e,t){try{return{account:await e.identityAccount.whoAmI(),created:!1}}catch(e){if(!(0,eS.isNotFound)(e))throw e}return t?.onProvisioning?.(),{account:await e.identityAccount.provisionMyAccount(),created:!0}}var eE=e.i(586108),eT=e.i(326283);let eA=Object.freeze({status:"ready",account:null});function eI({children:e}){let{state:t,retry:s}=function(e){let{isEnabled:t}=e,s=(0,eE.useStigmer)(),[r,n]=(0,l.useState)(t?{status:"checking"}:eA),a=(0,l.useRef)(0),i=(0,l.useCallback)(async()=>{let e=++a.current;n({status:"checking"});try{let{account:t}=await eC(s,{onProvisioning:()=>{e===a.current&&n({status:"provisioning"})}});if(e!==a.current)return;n({status:"ready",account:t})}catch(t){if(e!==a.current)return;n({status:"error",message:(0,eT.toError)(t).message})}},[s]);return(0,l.useEffect)(()=>{t?i():n(eA)},[t,i]),{state:r,retry:(0,l.useCallback)(()=>{t&&i()},[t,i])}}({isEnabled:"oidc"===(0,ex.getRuntimeConfig)().authMode});switch(t.status){case"ready":return(0,o.jsx)(o.Fragment,{children:e});case"checking":return(0,o.jsx)(eO,{});case"provisioning":return(0,o.jsx)(eR,{});case"error":return(0,o.jsx)(e_,{message:t.message,onRetry:s})}}function eM(){let{user:e,logout:t}=(0,ea.useAuth)();if(!e)return null;let s=(e.name??e.email).charAt(0).toUpperCase();return(0,o.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-3 p-4",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("div",{className:"bg-muted text-muted-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,o.jsx)("span",{className:"text-xs font-medium",children:s})}),(0,o.jsx)("span",{className:"text-muted-foreground text-sm",children:e.email})]}),(0,o.jsxs)("button",{onClick:t,className:"text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1.5 text-sm transition-colors",children:[(0,o.jsx)(ep.LogOut,{className:"size-3.5"}),"Sign out"]})]})}function eO(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}function eR(){let{user:e}=(0,ea.useAuth)(),t=e?.name??e?.email;return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(eM,{}),(0,o.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[e&&(0,o.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,o.jsx)("span",{className:"text-muted-foreground text-lg font-medium",children:(t??"?").charAt(0).toUpperCase()})}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:t?`Welcome, ${t}!`:"Welcome!"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Setting up your account…"})]}),(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-5 animate-spin"})]})]})}function e_({message:e,onRetry:t}){return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center gap-4 p-8",children:[(0,o.jsx)(eM,{}),(0,o.jsx)(eg.AlertCircle,{className:"text-destructive size-8"}),(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Failed to set up your account"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:e}),(0,o.jsxs)("button",{onClick:t,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary-hover",children:[(0,o.jsx)(em.RefreshCw,{className:"size-3"}),"Try again"]})]})}let eD=["/login","/invite/"],eP=["/chat/"],eF=new V({defaultOptions:{queries:{staleTime:3e4,retry:(e,t)=>!!(0,J.isRetryableError)(t)&&e<1,refetchOnWindowFocus:!0},mutations:{retry:!1}}});function eL({children:e}){let t=(0,u.usePathname)(),s=eD.some(e=>t.startsWith(e)),r=eP.some(e=>t.startsWith(e));return s?(0,o.jsx)(o.Fragment,{children:e}):r?(0,o.jsx)(et.AuthProvider,{children:e}):(0,o.jsx)(et.AuthProvider,{children:(0,o.jsx)(l.Suspense,{fallback:(0,o.jsx)(eK,{}),children:(0,o.jsx)(es.AuthGuard,{children:(0,o.jsx)(Q,{client:eF,children:(0,o.jsx)(el,{children:(0,o.jsx)(eI,{children:(0,o.jsx)(Z.FetchCacheProvider,{children:(0,o.jsx)(ee.OrgProvider,{children:(0,o.jsxs)(eb,{children:[e,(0,o.jsx)(ed,{})]})})})})})})})})})}function eW({children:e}){let[t,s]=(0,l.useState)(!1),[r,n]=(0,l.useState)(null);return((0,l.useEffect)(()=>{(0,ex.loadRuntimeConfig)().then(()=>s(!0)).catch(e=>{n(e instanceof Error?e.message:"Failed to load configuration")})},[]),r)?(0,o.jsxs)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3 p-8",children:[(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Configuration Error"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:r})]}):t?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsx)(eK,{})}function eK(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}e.s(["Providers",0,function({children:e}){return(0,o.jsx)(eW,{children:(0,o.jsx)(d,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,o.jsx)(eL,{children:e})})})}],693079)},36634,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(312056);let n=(0,s.createContext)(null),a=/^\/sessions\/(.+)/;function i(e){return"/"===e||a.test(e)}e.s(["SessionNavigationProvider",0,function({children:e}){let{currentPath:o,navigate:l}=(0,r.useAppNavigation)(),u=i(o),c=u?o.match(a)?.[1]??null:null,[d,g]=(0,s.useState)(null),m=(0,s.useRef)(o);(0,s.useEffect)(()=>{let e=m.current;i(e)&&!i(o)&&g(e),m.current=o},[o]);let h=(0,s.useCallback)(e=>{l(`/sessions/${e}`)},[l]),p=(0,s.useCallback)(()=>{l("/")},[l]),f=(0,s.useMemo)(()=>({activeSessionId:c,isSessionZone:u,lastSessionZonePath:d,navigateToSession:h,navigateToHome:p}),[c,u,d,h,p]);return(0,t.jsx)(n.Provider,{value:f,children:e})},"isSessionZonePath",0,i,"useSessionNavigation",0,function(){let e=(0,s.useContext)(n);if(!e)throw Error("useSessionNavigation must be used within <SessionNavigationProvider>");return e}])},936636,e=>{"use strict";var t,s,r,n=e.i(843476),a=e.i(271645),i=e.i(618566),o=e.i(475254);let l=(0,o.default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);var u=e.i(893976),c=e.i(586108),d=e.i(583093);function g(e){let t=(0,c.useStigmer)(),s=e?async()=>{let s=await t.agentExecution.get(e);return s.spec?.sessionId??null}:null,{data:r,isLoading:n,error:a}=(0,d.useFetch)(s,[e,t],null);return{sessionId:r,isLoading:n,error:a}}var m=e.i(102508),h=e.i(36634),p=e.i(635549),f=e.i(846696),x=e.i(275051),v=e.i(615987);function b(){let{account:e}=(0,v.useMyIdentityAccount)();return(0,a.useMemo)(()=>{let t=e?.spec?.preferences;if(!t)return;let s="native"===t.defaultHarness||"cursor"===t.defaultHarness?t.defaultHarness:void 0,r=t.defaultNativeModel||void 0,n=t.defaultCursorModel||void 0,a=t.defaultAutoApprove||void 0;if(s||r||n||a)return{harness:s,nativeModel:r,cursorModel:n,autoApprove:a}},[e])}var y=e.i(891287),k=e.i(217516),j=e.i(196716),w=e.i(727996),N=e.i(254347),S=e.i(590745),C=e.i(55389);let E=/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/;function T(e){let t=e.match(E);return t?{owner:t[1],repo:t[2]}:null}let A={path:"... (tree truncated by GitHub — repository has too many files)",isDirectory:!1,notice:!0};function I(e){let t=(0,a.useCallback)(async t=>{if("git"!==t.type||!t.gitUrl||!e)return null;let s=T(t.gitUrl);if(!s)return null;let r=t.readRef||t.gitBranch||"main",n=`https://api.github.com/repos/${s.owner}/${s.repo}/git/trees/${encodeURIComponent(r)}?recursive=1`,a=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(!a.ok)return null;let i=await a.json(),o=i.tree.filter(e=>"blob"===e.type||"tree"===e.type).map(e=>({path:e.path,isDirectory:"tree"===e.type}));return i.truncated&&o.push(A),o},[e]);if(e)return t}var M=e.i(850429);function O(e){let t=atob(e.replace(/\s/g,""));return Uint8Array.from(t,e=>e.charCodeAt(0))}function R(e,t,s=null){if(function(e){let t=Math.min(e.length,8e3);for(let s=0;s<t;s++)if(0===e[s])return!0;return!1}(e))return{text:null,isBinary:!0,size:t,encoding:"base64",...null!==s&&e.length<=M.MAX_WORKSPACE_IMAGE_READ_BYTES?{bytes:e}:{}};let r=function(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{return null}}(e);if(null===r)return{text:null,isBinary:!1,size:t,encoding:"unknown"};let n=e.length>M.MAX_WORKSPACE_FILE_READ_BYTES;return{text:n?r.slice(0,M.MAX_WORKSPACE_FILE_READ_BYTES):r,isBinary:!1,size:t,encoding:"utf-8",...n?{truncated:!0}:{}}}let _="https://api.github.com/repos";function D(e){let t=(0,a.useCallback)(async(t,s)=>{if("git"!==t.type||!t.gitUrl||!e)return null;let r=T(t.gitUrl);if(!r)return null;let n=t.readRef||t.gitBranch||"main",a=`${_}/${r.owner}/${r.repo}/contents/${s.split("/").map(encodeURIComponent).join("/")}?ref=${encodeURIComponent(n)}`,i=await fetch(a,{headers:{Authorization:`Bearer ${e}`}});if(404===i.status)throw new M.WorkspaceFileNotFoundError(s);if(!i.ok)throw Error(`GitHub content fetch failed for ${s} (HTTP ${i.status})`);let o=await i.json();if(Array.isArray(o))throw Error(`Cannot read "${s}": path is a directory`);return"base64"===o.encoding?R(O(o.content),o.size,(0,M.workspaceImageMimeType)(s)):P(r,o,s,e)},[e]);if(e)return t}async function P(e,t,s,r){if(t.size>0xa00000)return{text:null,isBinary:!1,size:t.size,encoding:"none",truncated:!0};let n=`${_}/${e.owner}/${e.repo}/git/blobs/${t.sha}`,a=await fetch(n,{headers:{Authorization:`Bearer ${r}`}});if(!a.ok)throw Error(`GitHub blob fetch failed for ${t.sha} (HTTP ${a.status})`);let i=await a.json();return R(O(i.content),i.size,(0,M.workspaceImageMimeType)(s))}var F=e.i(433732),L=e.i(597744);function W(e){let t=(0,F.useExecutionTarget)(),s=(0,L.useDeploymentMode)(),r=e?.hasLocalPicker??!1;return(0,a.useMemo)(()=>"cloud"===(t??("local"===s?"local":"cloud"))?{enableGitHub:!0,enableLocal:!1}:{enableGitHub:!r,enableLocal:!0},[t,s,r])}let K={agent:{org:"stigmer",slug:"agent-creator"},skill:{org:"stigmer",slug:"skill-creator"},"mcp-server":{org:"stigmer",slug:"mcp-server-creator"}},U=new Set(Object.keys(K));var B=e.i(297629);let z={agent:"Describe the agent you’d like to build — its purpose, the skills and MCP servers it should use, and any system instructions to guide its behavior.",skill:"Describe the skill you’d like to build — what it does and what instructions it should follow. You can attach a workspace or reference files for additional context.","mcp-server":"Describe the MCP server you’d like to register — its name, connection type (stdio or SSE), startup command or endpoint URL, and any required environment variables."},$={agent:"Add an Agent",skill:"Add a Skill","mcp-server":"Add an MCP Server"},q={agent:"Describe how you’d like to modify this agent…",skill:"Describe how you’d like to modify this skill…","mcp-server":"Describe how you’d like to modify this MCP server…"};function H(){let e=(0,i.useSearchParams)(),t=function(e){var t;let s=null!==(t=e.get("draft"))&&U.has(t)?t:null;if(!s)return null;let r=e.get("editOrg"),n=e.get("editSlug");return r&&n?{draftType:s,editRef:{org:r,slug:n}}:{draftType:s}}(e),s=(0,B.useActiveOrgSlug)(),r=b(),o=(0,C.useGitHubConnection)(s),{enableGitHub:l,enableLocal:u}=W(),d=I(o.token),g=D(o.token),{navigateToSession:m}=(0,h.useSessionNavigation)(),p=t?.draftType??null,v=t?.editRef??null,[E,T]=(0,a.useState)(()=>p),[A,M]=(0,a.useState)(v);null===E&&p&&(T(p),M(v));let O=A??null,R=null!==O,_=e.get("agent"),P=e.get("instance"),[F,L]=(0,a.useState)(()=>G(_)),[H,V]=(0,a.useState)(()=>P??void 0);void 0===F&&_&&(L(G(_)),V(P??void 0));let[X,Q]=(0,a.useState)(()=>E?K[E]:F);void 0===X&&E&&Q(K[E]),void 0===X&&F&&Q(F),(0,a.useEffect)(()=>{(p||_)&&window.history.replaceState({},"","/")},[p,_]);let Y=function(e,t){let s=(0,c.useStigmer)(),r=t?.org??null,n=t?.slug??null,{agent:i}=(0,j.useAgent)("agent"===e?r:null,"agent"===e?n:null),{mcpServer:o}=(0,w.useMcpServer)("mcp-server"===e?r:null,"mcp-server"===e?n:null),{skill:l}=(0,N.useSkill)("skill"===e?r:null,"skill"===e?n:null),[u,d]=(0,a.useState)(void 0),[g,m]=(0,a.useState)(null),h=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!h.current){if("agent"===e&&i){h.current=!0;try{let e=(0,S.serializeManifest)(i),t=i.metadata?.slug??"agent";d([new File([e],`${t}.yaml`,{type:"text/yaml"})])}catch{m("Failed to serialize agent for editing")}}if("mcp-server"===e&&o){h.current=!0;try{let e=(0,S.serializeManifest)(o),t=o.metadata?.slug??"mcp-server";d([new File([e],`${t}.yaml`,{type:"text/yaml"})])}catch{m("Failed to serialize MCP server for editing")}}}},[e,i,o]),(0,a.useEffect)(()=>{if(h.current||"skill"!==e||!l)return;let t=l.status?.artifactStorageKey;if(!t)return;h.current=!0;let r=l.metadata?.slug??"skill";s.skill.getArtifact((0,y.create)(k.GetArtifactRequestSchema,{artifactStorageKey:t})).then(e=>{let t=new ArrayBuffer(e.artifact.byteLength);new Uint8Array(t).set(e.artifact),d([new File([new Blob([t],{type:"application/zip"})],`${r}.zip`,{type:"application/zip"})])}).catch(()=>{m("Failed to download skill package for editing")})},[e,l,s]),{files:u,error:g}}(E,O);(0,a.useEffect)(()=>{Y.error&&f.toast.error(Y.error)},[Y.error]);let J=E?R?q[E]:z[E]:void 0,Z=R?"What would you like to change?":E?$[E]:void 0;return(0,n.jsx)(x.NewSessionViewer,{org:s,onSessionCreated:m,onError:e=>f.toast.error(e),accountDefaults:r,gitHubConnection:l?o:void 0,enableGitHub:l,enableLocal:u,workspaceFileLister:d,workspaceFileReader:g,initialAgentRef:X,initialInstanceId:H,initialAttachments:Y.files,heading:Z,placeholder:J,className:"h-full"})}function G(e){if(!e)return;let t=e.indexOf("/");if(!(t<=0)&&t!==e.length-1)return{org:e.slice(0,t),slug:e.slice(t+1)}}var V=e.i(766895),X=e.i(217127),Q=e.i(170255);e.i(107141);var Y=e.i(352082);function J({id:e}){let t=(0,B.useActiveOrgSlug)(),s=(0,B.useActiveOrgId)(),r=(0,C.useGitHubConnection)(t),{enableGitHub:a,enableLocal:i}=W(),o=I(r.token),l=D(r.token),u=b();return(0,n.jsx)("div",{className:"flex h-full w-full flex-col",children:(0,n.jsx)(V.SessionViewer,{sessionId:e,org:t,accountDefaults:u,gitHubConnection:a?r:void 0,enableGitHub:a,enableLocal:i,workspaceFileLister:o,workspaceFileReader:l,accessSlot:(0,n.jsx)(X.ManageAccessButton,{resource:{kind:Q.ApiResourceKind.session,kindString:"session",id:e,org:s}})})})}var Z=e.i(566022),ee=e.i(735922),et=e.i(910304),es=e.i(205730);let er=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]);function en(e){let t=(0,c.useStigmer)(),s=(0,es.useRunnerAdapter)(),r=(0,F.useExecutionTarget)(),n=(0,a.useRef)(null),i=e?async()=>{try{return await t.workflowExecution.get(e)}catch(e){if((0,et.isNotFound)(e))return null;throw e}}:null,{data:o,isLoading:l,isRefetching:u,error:g,refetch:m}=(0,d.useFetch)(i,[e,t],null,{cacheKey:e?`workflow-execution:${e}`:void 0});return(0,a.useEffect)(()=>{let t=o?.status?.phase,a=o?.metadata?.id;s&&"local"===r&&e&&null!=t&&er.has(t)&&a===e&&n.current!==e&&(n.current=e,s.onWorkflowExecutionTerminated(e).catch(()=>{}))},[o?.status?.phase,o?.metadata?.id,e,s,r]),(0,a.useEffect)(()=>{n.current=null},[e]),{execution:o,isLoading:l,isRefetching:u,error:g,refetch:m}}var ea=e.i(218766),ei=e.i(610595),eo=e.i(326283),el=e.i(868278),eu=e.i(777489),ec=e.i(661438);let ed={stage:"idle"},eg=BigInt(0),em=BigInt(-1),eh={costConsumedMicros:eg,costRemainingMicros:em,tokensConsumed:eg,tokensRemaining:em,thresholdBreached:!1};class ep{_events=[];_streamState=ed;_listeners=new Set;_taskStatesCache=null;_costSummaryCache=null;_totalTasks=0;appendEvents(e){if(0===e.length)return;let t=this._events.length>0?this._events[this._events.length-1].sequenceNumber:eg,s=e.filter(e=>e.sequenceNumber>t);if(0!==s.length){for(let e of(s.sort((e,t)=>e.sequenceNumber<t.sequenceNumber?-1:+(e.sequenceNumber>t.sequenceNumber)),this._events=[...this._events,...s],this._taskStatesCache=null,this._costSummaryCache=null,s))e.eventType===eu.WorkflowEventType.execution_started&&"executionStarted"===e.payload.case&&(this._totalTasks=e.payload.value.totalTasks);this._notify()}}setStreamState(e){var t,s;t=this._streamState,s=e,t.stage===s.stage&&("idle"===t.stage||"error"===t.stage&&"error"===s.stage&&t.executionId===s.executionId&&t.error===s.error||"reconnecting"===t.stage&&"reconnecting"===s.stage&&t.executionId===s.executionId&&t.attempt===s.attempt||"executionId"in t&&"executionId"in s&&t.executionId===s.executionId)||(this._streamState=e,this._notify())}reset(){let e=0===this._events.length&&"idle"===this._streamState.stage;this._events=[],this._streamState=ed,this._taskStatesCache=null,this._costSummaryCache=null,this._totalTasks=0,e||this._notify()}subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)});getEvents=()=>this._events;getStreamState=()=>this._streamState;getLatestSequence=()=>0===this._events.length?eg:this._events[this._events.length-1].sequenceNumber;getTotalTasks=()=>this._totalTasks;getTaskStates=()=>(this._taskStatesCache||(this._taskStatesCache=function(e){let t=new Map;for(let n of e){let e=n.taskName;if(!e)continue;let a=t.get(e),i=n.payload;switch(i.case){case"taskStarted":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"running",durationMs:0,costMicros:a?.costMicros??eg,tokensUsed:a?.tokensUsed??eg,attemptNumber:i.value.attemptNumber,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:a?.currentToolName??"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:i.value.inputSummary??a?.inputSummary??null,outputSummary:null,approvalRequest:null,approvalResolution:null});break;case"taskCompleted":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"completed",durationMs:Number(i.value.durationMs),costMicros:i.value.costMicros,tokensUsed:i.value.tokensUsed,attemptNumber:a?.attemptNumber??1,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:a?.inputSummary??null,outputSummary:i.value.outputSummary??null,approvalRequest:a?.approvalRequest??null,approvalResolution:a?.approvalResolution??null});break;case"taskFailed":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:i.value.willRetry?"retrying":"failed",durationMs:Number(i.value.durationMs),costMicros:a?.costMicros??eg,tokensUsed:a?.tokensUsed??eg,attemptNumber:i.value.attemptNumber,error:i.value.error,childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:a?.inputSummary??null,outputSummary:null,approvalRequest:a?.approvalRequest??null,approvalResolution:a?.approvalResolution??null});break;case"taskSkipped":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"skipped",durationMs:0,costMicros:eg,tokensUsed:eg,attemptNumber:0,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:"",currentToolName:"",messagesCount:0,toolCallsCount:0,inputSummary:null,outputSummary:null,approvalRequest:null,approvalResolution:null});break;case"taskRetrying":a&&t.set(e,{...a,status:"retrying"});break;case"agentCallStarted":a&&t.set(e,{...a,childExecutionId:i.value.childExecutionId||a.childExecutionId,agentSlug:i.value.agentSlug||a.agentSlug});break;case"agentCallProgress":var s,r;a&&t.set(e,{...a,status:(s=a.status,r=i.value.agentPhase,"running"===s?r===ec.ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL?"waiting_approval":"running":"waiting_approval"===s?r===ec.ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL||r===ec.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED?"waiting_approval":"running":s),childExecutionId:i.value.childExecutionId||a.childExecutionId,currentToolName:i.value.currentToolName||a.currentToolName,messagesCount:i.value.messagesCount||a.messagesCount,toolCallsCount:i.value.toolCallsCount||a.toolCallsCount,tokensUsed:i.value.tokensConsumed>eg?i.value.tokensConsumed:a.tokensUsed});break;case"agentCallCompleted":a&&t.set(e,{...a,costMicros:i.value.costMicros,tokensUsed:i.value.tokensConsumed,currentToolName:""});break;case"approvalRequested":a&&t.set(e,{...a,status:"waiting_approval",approvalRequest:i.value,approvalResolution:null});break;case"approvalResolved":a&&t.set(e,{...a,status:"waiting_approval"===a.status?"running":a.status,approvalResolution:i.value})}}return t}(this._events)),this._taskStatesCache);getCostSummary=()=>(this._costSummaryCache||(this._costSummaryCache=function(e){for(let t=e.length-1;t>=0;t--){let s=e[t].payload;if("budgetCheckpoint"===s.case)return{costConsumedMicros:s.value.costConsumedMicros,costRemainingMicros:s.value.costRemainingMicros,tokensConsumed:s.value.tokensConsumed,tokensRemaining:s.value.tokensRemaining,thresholdBreached:s.value.thresholdBreached}}for(let t=e.length-1;t>=0;t--){let s=e[t].payload;if("executionCompleted"===s.case)return{costConsumedMicros:s.value.totalCostMicros,costRemainingMicros:em,tokensConsumed:s.value.totalTokens,tokensRemaining:em,thresholdBreached:!1}}let t=eg,s=eg;for(let r of e)"taskCompleted"===r.payload.case&&(t+=r.payload.value.costMicros,s+=r.payload.value.tokensUsed);return t>eg||s>eg?{costConsumedMicros:t,costRemainingMicros:em,tokensConsumed:s,tokensRemaining:em,thresholdBreached:!1}:eh}(this._events)),this._costSummaryCache);_notify(){for(let e of this._listeners)e()}}let ef=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]);function ex(e,t){let s=(0,c.useStigmer)(),r=(0,a.useRef)(null);t?.store||r.current||(r.current=new ep);let n=t?.store??r.current,[i,o]=(0,a.useState)(0),l=(0,a.useCallback)(()=>{o(e=>e+1)},[]),u=t?.eventTypes,d=t?.executionPhase,g=t?.autoReconnect??!0,m=t?.reconnectOptions,h=(0,a.useRef)(n);h.current=n;let p=(0,a.useRef)(void 0),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{var t;if(!e){n.reset(),p.current=void 0,f.current=null;return}let r=new AbortController,i=h.current,o=void 0!==d&&ef.has(d);return null!==f.current&&f.current!==e&&(i.reset(),p.current=void 0),f.current=e,t=p.current,void 0!==t&&void 0!==d&&ef.has(t)&&!ef.has(d)&&i.reset(),p.current=d,o?(i.setStreamState({stage:"connecting",executionId:e}),(async()=>{try{let t=BigInt(0),n=!0;for(;n&&!r.signal.aborted;){let o=await s.workflowExecution.getEventLog((0,y.create)(ea.GetEventLogRequestSchema,{executionId:e,afterSequence:t,eventTypes:u?[...u]:[],pageSize:500}));if(r.signal.aborted)return;(0,a.startTransition)(()=>{i.appendEvents(o.events)}),n=o.hasMore,t=o.latestSequence}r.signal.aborted||i.setStreamState({stage:"complete",executionId:e})}catch(t){if(r.signal.aborted)return;i.setStreamState({stage:"error",executionId:e,error:(0,eo.toError)(t)})}})()):(i.setStreamState({stage:"connecting",executionId:e}),(async()=>{let t=r.signal,n=m?.maxAttempts??el.DEFAULT_RECONNECT_MAX_ATTEMPTS,o=0;for(;!t.aborted;)try{let r=i.getLatestSequence();for await(let n of s.workflowExecution.subscribeEvents((0,y.create)(ea.SubscribeEventsRequestSchema,{executionId:e,afterSequence:r,eventTypes:u?[...u]:[]}),t)){if(t.aborted)return;o=0,(0,a.startTransition)(()=>{i.appendEvents([n]);let t=i.getStreamState().stage;("connecting"===t||"reconnecting"===t)&&i.setStreamState({stage:"streaming",executionId:e})})}t.aborted||i.setStreamState({stage:"complete",executionId:e});return}catch(r){if(t.aborted)return;let s=(0,eo.toError)(r);if(s.message.includes("UNIMPLEMENTED")||s.message.includes("unimplemented"))return void i.setStreamState({stage:"unsupported",executionId:e});if(!g||!(0,ei.isTransientStreamError)(s)||o>=n)return void i.setStreamState({stage:"error",executionId:e,error:s});o+=1,i.setStreamState({stage:"reconnecting",executionId:e,attempt:o,error:s});try{await (0,el.sleep)((0,el.computeBackoffDelay)(o,m),t)}catch{return}}})()),()=>{r.abort()}},[e,s,i,d]);let x=(0,a.useSyncExternalStore)(n.subscribe,n.getEvents),v=(0,a.useSyncExternalStore)(n.subscribe,n.getTaskStates),b=(0,a.useSyncExternalStore)(n.subscribe,n.getCostSummary),k=(0,a.useSyncExternalStore)(n.subscribe,n.getStreamState),j=(0,a.useSyncExternalStore)(n.subscribe,n.getTotalTasks),w="streaming"===k.stage,N="connecting"===k.stage,S="reconnecting"===k.stage,C="reconnecting"===k.stage?k.attempt:0,E="error"===k.stage?k.error:null;return{events:x,taskStates:v,costSummary:b,streamState:k,totalTasks:j,isStreaming:w,isConnecting:N,isReconnecting:S,reconnectAttempt:C,error:E,reconnect:l}}var ev=e.i(202796),eb=e.i(980213);let ey=new Set(["completed","failed","skipped"]),ek=new Set([Z.WorkflowTaskStatus.WORKFLOW_TASK_COMPLETED,Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED,Z.WorkflowTaskStatus.WORKFLOW_TASK_SKIPPED]);var ej=e.i(945850),ew=e.i(565621),eN=e.i(244686),eS=e.i(267460);let eC=new Set([Z.ExecutionPhase.EXECUTION_PENDING,Z.ExecutionPhase.EXECUTION_IN_PROGRESS]),eE=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]),eT=(0,a.memo)(function({execution:e,streamState:t,costSummary:s,actions:r,onDiagnose:i,isDiagnosing:o,onCompare:l,headerActions:c,className:d}){let g=e.status?.phase??Z.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,m=e.metadata?.name??e.metadata?.id??"Execution",h=e.status?.startedAt??"",p=e.status?.completedAt??"",f=(0,a.useMemo)(()=>{if(!h)return null;let e=new Date(h).getTime(),t=p?new Date(p).getTime():Date.now();return(0,eS.formatDuration)(t-e)},[h,p]),x=(0,a.useMemo)(()=>s.costConsumedMicros<=BigInt(0)?null:(0,eS.formatMicroUsd)(s.costConsumedMicros),[s.costConsumedMicros]),v=eC.has(g),b=g===Z.ExecutionPhase.EXECUTION_PAUSED,y=g===Z.ExecutionPhase.EXECUTION_FAILED,k="streaming"===t.stage||"connecting"===t.stage||"reconnecting"===t.stage;return(0,n.jsxs)("header",{className:(0,u.cn)("stg:flex stg:items-center stg:gap-3 stg:border-b stg:border-border stg:px-4 stg:py-3",d),children:[(0,n.jsx)(eN.WorkflowExecutionPhaseBadge,{phase:g}),(0,n.jsx)("h2",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:m}),f&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:text-muted-foreground",children:f}),x&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:text-muted-foreground",children:x}),k&&(0,n.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1 stg:text-xs stg:text-muted-foreground",children:[(0,n.jsxs)("span",{className:"stg:relative stg:flex stg:h-1.5 stg:w-1.5",children:[(0,n.jsx)("span",{className:"stg:absolute stg:inline-flex stg:h-full stg:w-full stg:animate-ping stg:rounded-full stg:bg-success stg:opacity-75"}),(0,n.jsx)("span",{className:"stg:relative stg:inline-flex stg:h-1.5 stg:w-1.5 stg:rounded-full stg:bg-success"})]}),"Live"]}),(0,n.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[l&&eE.has(g)&&(0,n.jsx)(eA,{label:"Compare with…",onClick:l,disabled:!1}),v&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eA,{label:"Pause",onClick:()=>r.pause(),disabled:r.isSubmitting}),(0,n.jsx)(eA,{label:"Cancel",variant:"destructive",onClick:()=>r.cancel(),disabled:r.isSubmitting})]}),b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eA,{label:"Resume",onClick:()=>r.resume(),disabled:r.isSubmitting}),(0,n.jsx)(eA,{label:"Cancel",variant:"destructive",onClick:()=>r.cancel(),disabled:r.isSubmitting})]}),y&&(0,n.jsxs)(n.Fragment,{children:[i&&(0,n.jsx)(eA,{label:o?"Diagnosing…":"Diagnose",onClick:i,disabled:r.isSubmitting||!!o}),(0,n.jsx)(eA,{label:"Recover",onClick:()=>r.recover(),disabled:r.isSubmitting})]}),c&&(0,n.jsx)("div",{className:"stg:relative stg:flex stg:items-center",children:c})]})]})});function eA({label:e,variant:t,onClick:s,disabled:r}){return(0,n.jsx)("button",{type:"button",onClick:s,disabled:r,className:(0,u.cn)("stg:rounded stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:transition-colors","stg:disabled:pointer-events-none stg:disabled:opacity-50","destructive"===t?"stg:border stg:border-destructive/30 stg:text-destructive stg:hover:bg-destructive/10":"stg:border stg:border-border stg:text-foreground stg:hover:bg-muted"),children:e})}var eI=e.i(59309),eM=e.i(28434),eO=e.i(375954),eR=e.i(574803),e_=e.i(796545),eD=e.i(145995),eP=e.i(839329);let eF={org:"",slug:"workflow-architect"};var eL=e.i(226634),eW=e.i(953520),eK=e.i(163732),eU=e.i(379410);let eB=new Set(["ready","complete","error"]);function ez({executionId:e,org:t,currentWorkflowYaml:s,onApplyFix:r,onClose:i,className:o}){let[l,c]=(0,a.useState)(""),d=(0,a.useRef)(null),g=function(e){let{executionId:t,org:s,autoStart:r=!0,onError:n}=e,[i,o]=(0,a.useState)("idle"),[l,u]=(0,a.useState)(null),[c,d]=(0,a.useState)([]),[g,m]=(0,a.useState)(null),[h,p]=(0,a.useState)(null),f=(0,a.useRef)(s);f.current=s;let x=(0,a.useRef)(t);x.current=t;let v=(0,a.useRef)(n);v.current=n;let b=(0,a.useRef)(null),y=(0,a.useRef)(!1),k=(0,a.useRef)(!1),{create:j}=(0,eI.useCreateSession)(),{create:w}=(0,eM.useCreateAgentExecution)(),N=(0,e_.useConversationStoreRef)(),S=(0,eO.useExecutionStream)(l,{store:N}),C=(0,a.useCallback)(()=>`Diagnose the failed workflow execution \`${x.current}\`.
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,16715,379185,292270,e=>{"use strict";var t=e.i(475254);let s=(0,t.default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,s],16715);var r=e.i(843476),n=e.i(271645),a=e.i(891287),i=e.i(893976),o=e.i(610595),l=e.i(421415),u=e.i(586108),c=e.i(326283),d=e.i(367539),g=e.i(891914),m=e.i(379410);e.s(["CreateOrganizationForm",0,function({onCreated:e,onCancel:t,className:s}){let h=(0,n.useId)(),{create:p,isCreating:f,error:x,clearError:v}=function(){let e=(0,u.useStigmer)(),[t,s]=(0,n.useState)(!1),[r,a]=(0,n.useState)(null),i=(0,n.useCallback)(()=>a(null),[]);return{create:(0,n.useCallback)(async t=>{s(!0),a(null);try{return await e.organization.create(t)}catch(e){throw a((0,c.toError)(e)),e}finally{s(!1)}},[e]),isCreating:t,error:r,clearError:i}}(),[b,y]=(0,n.useState)(""),[k,j]=(0,n.useState)(""),[w,N]=(0,n.useState)(""),S=(0,n.useRef)(!1),C=b.trim(),E=k.length>0||C.length>0?(0,g.validateMessage)(l.ApiResourceMetadataSchema,(0,a.create)(l.ApiResourceMetadataSchema,{...k.length>0&&{slug:k},...C.length>0&&{name:C}})):[],T=k.length>0?(0,g.getFieldError)(E,"slug"):null,A=C.length>0?(0,g.getFieldError)(E,"name"):null,I=""!==C&&k.length>0&&null===T&&null===A&&!f,M=(0,n.useCallback)(e=>{y(e),S.current||j((0,d.generateSlug)(e.trim()))},[]),O=(0,n.useCallback)(e=>{S.current=!0,j(e)},[]),R=(0,n.useCallback)(async t=>{if(t.preventDefault(),I){v();try{let t=await p({name:C,slug:k,org:k,description:w.trim()||void 0});e?.(t)}catch{}}},[I,C,k,w,p,v,e]);return(0,r.jsxs)("form",{onSubmit:R,className:(0,i.cn)("stg:space-y-3",s),children:[(0,r.jsxs)("div",{className:"stg:space-y-2",children:[(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsx)("label",{htmlFor:`${h}-name`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Name"}),(0,r.jsx)("input",{id:`${h}-name`,type:"text",value:b,onChange:e=>M(e.target.value),placeholder:"e.g. Acme Corp",disabled:f,autoFocus:!0,required:!0,maxLength:63,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",A?"stg:border-destructive":"stg:border-input")}),A?(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-destructive",role:"alert",children:A}):(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"A human-readable display name for the organization."})]}),(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsx)("label",{htmlFor:`${h}-slug`,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Slug"}),(0,r.jsx)("input",{id:`${h}-slug`,type:"text",value:k,onChange:e=>O(e.target.value),placeholder:"e.g. acme-corp",disabled:f,required:!0,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground stg:font-mono","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",T?"stg:border-destructive":"stg:border-input")}),T?(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-destructive",role:"alert",children:T}):(0,r.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"URL-friendly identifier used in resource references. 2–63 characters: lowercase letters, numbers, and hyphens."})]}),(0,r.jsxs)("div",{className:"stg:space-y-1",children:[(0,r.jsxs)("label",{htmlFor:`${h}-desc`,className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:["Description"," ",(0,r.jsx)("span",{className:"stg:text-muted-foreground-subtle",children:"(optional)"})]}),(0,r.jsx)("input",{id:`${h}-desc`,type:"text",value:w,onChange:e=>N(e.target.value),placeholder:"What is this organization for?",disabled:f,className:(0,i.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")})]})]}),x&&(0,r.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,o.getUserMessage)(x)}),(0,r.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,r.jsxs)("button",{type:"submit",disabled:!I,className:(0,i.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[f&&(0,r.jsx)(m.SpinnerIcon,{size:12}),"Create organization"]}),t&&(0,r.jsx)("button",{type:"button",onClick:t,disabled:f,className:(0,i.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]})}],379185);let h=(0,t.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);e.s(["LogOut",0,h],292270)},693079,e=>{"use strict";let t,s,r,n,a,i;var o=e.i(843476),l=e.i(271645),u=e.i(618566);e.i(247167);var c=e.i(363178);function d(e){return(0,o.jsx)(c.ThemeProvider,{...e})}var g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=g;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},h="u"<typeof window||"Deno"in globalThis;function p(){}function f(e,t){return"function"==typeof e?e(t):e}function x(e,t){let{type:s="all",exact:r,fetchStatus:n,predicate:a,queryKey:i,stale:o}=e;if(i){if(r){if(t.queryHash!==b(i,t.options))return!1}else if(!k(t.queryKey,i))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!n||n===t.state.fetchStatus)&&(!a||!!a(t))}function v(e,t){let{exact:s,status:r,predicate:n,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(y(t.options.mutationKey)!==y(a))return!1}else if(!k(t.options.mutationKey,a))return!1}return(!r||t.state.status===r)&&(!n||!!n(t))}function b(e,t){return(t?.queryKeyHashFn||y)(e)}function y(e){return JSON.stringify(e,(e,t)=>N(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function k(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>k(e[s],t[s]))}var j=Object.prototype.hasOwnProperty;function w(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function N(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!S(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function C(e,t,s=0){let r=[...e,t];return s&&r.length>s?r.slice(1):r}function E(e,t,s=0){let r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var T=Symbol();function A(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==T?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var I=(t=[],s=0,r=e=>{e()},n=e=>{e()},a=function(e){setTimeout(e,0)},{batch:e=>{let i;s++;try{i=e()}finally{let e;--s||(e=t,t=[],e.length&&a(()=>{n(()=>{e.forEach(e=>{r(e)})})}))}return i},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i=e=>{s?t.push(e):a(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{a=e}}),M=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},O=new class extends M{#s;#r;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#r||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#n=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#s!==e&&(this.#s=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#s?this.#s:globalThis.document?.visibilityState!=="hidden"}},R=new class extends M{#a=!0;#r;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#r||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#n=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};function _(e){return Math.min(1e3*2**e,3e4)}function D(e){return(e??"online")!=="online"||R.isOnline()}var P=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function F(e){let t,s=!1,r=0,n=function(){let e,t,s=new Promise((s,r)=>{e=s,t=r});function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}(),a=()=>O.isFocused()&&("always"===e.networkMode||R.isOnline())&&e.canRun(),i=()=>D(e.networkMode)&&e.canRun(),o=e=>{"pending"===n.status&&(t?.(),n.resolve(e))},l=e=>{"pending"===n.status&&(t?.(),n.reject(e))},u=()=>new Promise(s=>{t=e=>{("pending"!==n.status||a())&&s(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===n.status&&e.onContinue?.()}),c=()=>{let t;if("pending"!==n.status)return;let i=0===r?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(o).catch(t=>{if("pending"!==n.status)return;let i=e.retry??3*!h,o=e.retryDelay??_,d="function"==typeof o?o(r,t):o,g=!0===i||"number"==typeof i&&r<i||"function"==typeof i&&i(r,t);s||!g?l(t):(r++,e.onFail?.(r,t),new Promise(e=>{m.setTimeout(e,d)}).then(()=>a()?void 0:u()).then(()=>{s?l(t):c()}))})};return{promise:n,status:()=>n.status,cancel:t=>{if("pending"===n.status){let s=new P(t);l(s),e.onCancel?.(s)}},continue:()=>(t?.(),n),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:i,start:()=>(i()?c():u().then(c),n)}}var L=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){var e;this.clearGcTimeout(),"number"==typeof(e=this.gcTime)&&e>=0&&e!==1/0&&(this.#i=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(h?1/0:3e5))}clearGcTimeout(){this.#i&&(m.clearTimeout(this.#i),this.#i=void 0)}},W=class extends L{#o;#l;#u;#c;#d;#g;#m;constructor(e){super(),this.#m=!1,this.#g=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=U(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#g,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=U(this.options);void 0!==e.data&&(this.setState(K(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){var s,r;let n=(s=this.state.data,"function"==typeof(r=this.options).structuralSharing?r.structuralSharing(s,e):!1!==r.structuralSharing?function e(t,s,r=0){if(t===s)return t;if(r>500)return s;let n=w(t)&&w(s);if(!n&&!(N(t)&&N(s)))return s;let a=(n?t:Object.keys(t)).length,i=n?s:Object.keys(s),o=i.length,l=n?Array(o):{},u=0;for(let c=0;c<o;c++){let o=n?c:i[c],d=t[o],g=s[o];if(d===g){l[o]=d,(n?c<a:j.call(t,o))&&u++;continue}if(null===d||null===g||"object"!=typeof d||"object"!=typeof g){l[o]=g;continue}let m=e(d,g,r+1);l[o]=m,m===d&&u++}return a===o&&u===a?t:l}(s,e):e);return this.#h({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#h({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(p).catch(p):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>{var t;return!1!==(t=e.options.enabled,"function"==typeof t?t(this):t)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===T||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===f(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(e||0)-Date.now(),0))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#m?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#h({type:"invalidate"})}async fetch(e,t){let s;if("idle"!==this.state.fetchStatus&&this.#d?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#m=!0,r.signal)})},a=()=>{let e,s=A(this.options,t),r=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#m=!1,this.options.persister)?this.options.persister(s,r,this):s(r)},i=(n(s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),s);this.options.behavior?.onFetch(i,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#h({type:"fetch",meta:i.fetchOptions?.meta}),this.#d=F({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof P&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:()=>{this.#h({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{let e=await this.#d.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof P){if(e.silent)return this.#d.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#h({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#h(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var s;return{...t,...(s=t.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:D(this.options.networkMode)?"fetching":"paused",...void 0===s&&{error:null,status:"pending"}}),fetchMeta:e.meta??null};case"success":let r={...t,...K(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),I.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function K(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function U(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var B=class extends M{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,s){let r=t.queryKey,n=t.queryHash??b(r,t),a=this.get(n);return a||(a=new W({client:e,queryKey:r,queryHash:n,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){I.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>x(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>x(e,t)):t}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){I.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){I.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},z=class extends L{#c;#f;#x;#d;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#x=e.mutationCache,this.#f=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#f.includes(e)||(this.#f.push(e),this.clearGcTimeout(),this.#x.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#f=this.#f.filter(t=>t!==e),this.scheduleGc(),this.#x.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#f.length||("pending"===this.state.status?this.scheduleGc():this.#x.remove(this))}continue(){return this.#d?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#h({type:"continue"})},s={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#d=F({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#h({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#h({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#x.canRun(this)});let r="pending"===this.state.status,n=!this.#d.canStart();try{if(r)t();else{this.#h({type:"pending",variables:e,isPaused:n}),this.#x.config.onMutate&&await this.#x.config.onMutate(e,this,s);let t=await this.options.onMutate?.(e,s);t!==this.state.context&&this.#h({type:"pending",context:t,variables:e,isPaused:n})}let a=await this.#d.start();return await this.#x.config.onSuccess?.(a,e,this.state.context,this,s),await this.options.onSuccess?.(a,e,this.state.context,s),await this.#x.config.onSettled?.(a,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(a,null,e,this.state.context,s),this.#h({type:"success",data:a}),a}catch(t){try{await this.#x.config.onError?.(t,e,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,s)}catch(e){Promise.reject(e)}try{await this.#x.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,s)}catch(e){Promise.reject(e)}throw this.#h({type:"error",error:t}),t}finally{this.#x.runNext(this)}}#h(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),I.batch(()=>{this.#f.forEach(t=>{t.onMutationUpdate(e)}),this.#x.notify({mutation:this,type:"updated",action:e})})}},$=class extends M{constructor(e={}){super(),this.config=e,this.#v=new Set,this.#b=new Map,this.#y=0}#v;#b;#y;build(e,t,s){let r=new z({client:e,mutationCache:this,mutationId:++this.#y,options:e.defaultMutationOptions(t),state:s});return this.add(r),r}add(e){this.#v.add(e);let t=q(e);if("string"==typeof t){let s=this.#b.get(t);s?s.push(e):this.#b.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#v.delete(e)){let t=q(e);if("string"==typeof t){let s=this.#b.get(t);if(s)if(s.length>1){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}else s[0]===e&&this.#b.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=q(e);if("string"!=typeof t)return!0;{let s=this.#b.get(t),r=s?.find(e=>"pending"===e.state.status);return!r||r===e}}runNext(e){let t=q(e);if("string"!=typeof t)return Promise.resolve();{let s=this.#b.get(t)?.find(t=>t!==e&&t.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){I.batch(()=>{this.#v.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#v.clear(),this.#b.clear()})}getAll(){return Array.from(this.#v)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){return this.getAll().filter(t=>v(e,t))}notify(e){I.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return I.batch(()=>Promise.all(e.map(e=>e.continue().catch(p))))}};function q(e){return e.options.scope?.id}function H(e){return{onFetch:(t,s)=>{let r=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],i=t.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,u=async()=>{let s=!1,u=A(t.options,t.fetchOptions),c=async(e,r,n)=>{if(s)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let a=(()=>{var e,a;let i,o,l={client:t.client,queryKey:t.queryKey,pageParam:r,direction:n?"backward":"forward",meta:t.options.meta};return e=()=>t.signal,a=()=>s=!0,o=!1,Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(i??=e(),o||(o=!0,i.aborted?a():i.addEventListener("abort",a,{once:!0})),i)}),l})(),i=await u(a),{maxPages:o}=t.options,l=n?E:C;return{pages:l(e.pages,i,o),pageParams:l(e.pageParams,r,o)}};if(n&&a.length){let e="backward"===n,t={pages:a,pageParams:i},s=(e?function(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}:G)(r,t);o=await c(t,s,e)}else{let t=e??a.length;do{let e=0===l?i[0]??r.initialPageParam:G(r,o);if(l>0&&null==e)break;o=await c(o,e),l++}while(l<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=u}}}function G(e,{pages:t,pageParams:s}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,s[r],s):void 0}var V=class{#k;#x;#g;#j;#w;#N;#S;#C;constructor(e={}){this.#k=e.queryCache||new B,this.#x=e.mutationCache||new $,this.#g=e.defaultOptions||{},this.#j=new Map,this.#w=new Map,this.#N=0}mount(){this.#N++,1===this.#N&&(this.#S=O.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onFocus())}),this.#C=R.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#k.onOnline())}))}unmount(){this.#N--,0===this.#N&&(this.#S?.(),this.#S=void 0,this.#C?.(),this.#C=void 0)}isFetching(e){return this.#k.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#x.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),s=this.#k.build(this,t),r=s.state.data;return void 0===r?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(f(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#k.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,s){let r=this.defaultQueryOptions({queryKey:e}),n=this.#k.get(r.queryHash),a=n?.state.data,i="function"==typeof t?t(a):t;if(void 0!==i)return this.#k.build(this,r).setData(i,{...s,manual:!0})}setQueriesData(e,t,s){return I.batch(()=>this.#k.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,s)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#k.get(t.queryHash)?.state}removeQueries(e){let t=this.#k;I.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let s=this.#k;return I.batch(()=>(s.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let s={revert:!0,...t};return Promise.all(I.batch(()=>this.#k.findAll(e).map(e=>e.cancel(s)))).then(p).catch(p)}invalidateQueries(e,t={}){return I.batch(()=>(this.#k.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let s={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(I.batch(()=>this.#k.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,s);return s.throwOnError||(t=t.catch(p)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(p)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let s=this.#k.build(this,t);return s.isStaleByTime(f(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(p).catch(p)}fetchInfiniteQuery(e){return e.behavior=H(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(p).catch(p)}ensureInfiniteQueryData(e){return e.behavior=H(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return R.isOnline()?this.#x.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#k}getMutationCache(){return this.#x}getDefaultOptions(){return this.#g}setDefaultOptions(e){this.#g=e}setQueryDefaults(e,t){this.#j.set(y(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#j.values()],s={};return t.forEach(t=>{k(e,t.queryKey)&&Object.assign(s,t.defaultOptions)}),s}setMutationDefaults(e,t){this.#w.set(y(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#w.values()],s={};return t.forEach(t=>{k(e,t.mutationKey)&&Object.assign(s,t.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#g.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=b(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===T&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#g.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#k.clear(),this.#x.clear()}},X=l.createContext(void 0),Q=({client:e,children:t})=>(l.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,o.jsx)(X.Provider,{value:e,children:t})),Y=e.i(531278),J=e.i(610595),Z=e.i(941693),ee=e.i(297629);e.i(67407);var et=e.i(282155),es=e.i(671010),er=e.i(272012),en=e.i(163308),ea=e.i(800692),ei=e.i(472402),eo=e.i(230374);function el({children:e}){let{accessToken:t,logout:s}=(0,ea.useAuth)(),{resolvedTheme:r}=(0,c.useTheme)(),n=(0,l.useCallback)(()=>t,[t]),a=(0,l.useCallback)(()=>s(),[s]),i=(0,l.useMemo)(()=>new er.Stigmer({baseUrl:(0,ei.getApiBaseUrl)(),getAccessToken:n,onUnauthenticated:a}),[n,a]),{mode:u}=(0,eo.useDeploymentMode)(i);return(0,o.jsx)(en.StigmerProvider,{client:i,deploymentMode:u,colorMode:"dark"===r?"dark":"light",preset:"monochrome",children:e})}var eu=e.i(846696),ec=e.i(444868);function ed(e){let t=(0,ec.useColorMode)();return(0,o.jsx)(eu.Toaster,{theme:t,position:"top-right",richColors:!0,className:"toaster stg:group",toastOptions:{classNames:{toast:"stg:group toast stg:group-[.toaster]:bg-background stg:group-[.toaster]:text-foreground stg:group-[.toaster]:border-border stg:group-[.toaster]:shadow-lg",description:"stg:group-[.toast]:text-muted-foreground",actionButton:"stg:group-[.toast]:bg-primary stg:group-[.toast]:text-primary-foreground",cancelButton:"stg:group-[.toast]:bg-muted stg:group-[.toast]:text-muted-foreground"}},...e})}var eg=e.i(63209),em=e.i(16715),eh=e.i(607486),ep=e.i(292270),ef=e.i(379185);let ex=["/invite/"];function ev({children:e}){let t=(0,u.usePathname)(),{state:s,retry:r,refresh:n}=function(e){let{isBypassed:t}=e,{orgs:s,isLoading:r,error:n,retry:a,refresh:i}=(0,ee.useOrg)();return{state:t?{status:"bypassed"}:r?{status:"loading"}:n?{status:"error",message:n}:0===s.length?{status:"no-orgs"}:{status:"ready"},retry:a,refresh:i}}({isBypassed:ex.some(e=>t.startsWith(e))});switch(s.status){case"bypassed":case"ready":return(0,o.jsx)(o.Fragment,{children:e});case"loading":return(0,o.jsx)(ey,{});case"error":return(0,o.jsx)(ek,{message:s.message,onRetry:r});case"no-orgs":return(0,o.jsx)(ej,{onRefresh:n})}}function eb(){let{user:e,logout:t}=(0,ea.useAuth)();if(!e)return null;let s=(e.name??e.email).charAt(0).toUpperCase();return(0,o.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-3 p-4",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("div",{className:"bg-muted text-muted-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,o.jsx)("span",{className:"text-xs font-medium",children:s})}),(0,o.jsx)("span",{className:"text-muted-foreground text-sm",children:e.email})]}),(0,o.jsxs)("button",{onClick:t,className:"text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1.5 text-sm transition-colors",children:[(0,o.jsx)(ep.LogOut,{className:"size-3.5"}),"Sign out"]})]})}function ey(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}function ek({message:e,onRetry:t}){return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center gap-4 p-8",children:[(0,o.jsx)(eb,{}),(0,o.jsx)(eg.AlertCircle,{className:"text-destructive size-8"}),(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Failed to load organizations"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:e}),(0,o.jsxs)("button",{onClick:t,className:"bg-primary text-primary-foreground hover:bg-primary-hover inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium",children:[(0,o.jsx)(em.RefreshCw,{className:"size-3"}),"Try again"]})]})}function ej({onRefresh:e}){let t=(0,l.useCallback)(t=>{e(t.metadata?.slug)},[e]);return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(eb,{}),(0,o.jsxs)("div",{className:"w-full max-w-sm space-y-6",children:[(0,o.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,o.jsx)("div",{className:"bg-muted flex size-12 items-center justify-center rounded-full",children:(0,o.jsx)(eh.Building2,{className:"text-muted-foreground size-6"})}),(0,o.jsx)("h1",{className:"text-foreground text-lg font-semibold",children:"Welcome to Stigmer"}),(0,o.jsx)("p",{className:"text-muted-foreground text-sm",children:"Create an organization to get started. Organizations are the top-level context that owns your agents, environments, and resources."})]}),(0,o.jsx)(ef.CreateOrganizationForm,{onCreated:t})]})]})}var ew=e.i(910304);async function eN(e,t){try{return{account:await e.identityAccount.whoAmI(),created:!1}}catch(e){if(!(0,ew.isNotFound)(e))throw e}return t?.onProvisioning?.(),{account:await e.identityAccount.provisionMyAccount(),created:!0}}var eS=e.i(586108),eC=e.i(326283);let eE=Object.freeze({status:"ready",account:null});var eT=e.i(707125);function eA({children:e}){let{state:t,retry:s}=function(e){let{isEnabled:t}=e,s=(0,eS.useStigmer)(),[r,n]=(0,l.useState)(t?{status:"checking"}:eE),a=(0,l.useRef)(0),i=(0,l.useCallback)(async()=>{let e=++a.current;n({status:"checking"});try{let{account:t}=await eN(s,{onProvisioning:()=>{e===a.current&&n({status:"provisioning"})}});if(e!==a.current)return;n({status:"ready",account:t})}catch(t){if(e!==a.current)return;n({status:"error",message:(0,eC.toError)(t).message})}},[s]);return(0,l.useEffect)(()=>{t?i():n(eE)},[t,i]),{state:r,retry:(0,l.useCallback)(()=>{t&&i()},[t,i])}}({isEnabled:"oidc"===(0,eT.getRuntimeConfig)().authMode});switch(t.status){case"ready":return(0,o.jsx)(o.Fragment,{children:e});case"checking":return(0,o.jsx)(eM,{});case"provisioning":return(0,o.jsx)(eO,{});case"error":return(0,o.jsx)(eR,{message:t.message,onRetry:s})}}function eI(){let{user:e,logout:t}=(0,ea.useAuth)();if(!e)return null;let s=(e.name??e.email).charAt(0).toUpperCase();return(0,o.jsxs)("div",{className:"absolute top-0 right-0 flex items-center gap-3 p-4",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("div",{className:"bg-muted text-muted-foreground flex size-6 shrink-0 items-center justify-center rounded-full",children:(0,o.jsx)("span",{className:"text-xs font-medium",children:s})}),(0,o.jsx)("span",{className:"text-muted-foreground text-sm",children:e.email})]}),(0,o.jsxs)("button",{onClick:t,className:"text-muted-foreground hover:text-foreground inline-flex cursor-pointer items-center gap-1.5 text-sm transition-colors",children:[(0,o.jsx)(ep.LogOut,{className:"size-3.5"}),"Sign out"]})]})}function eM(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}function eO(){let{user:e}=(0,ea.useAuth)(),t=e?.name??e?.email;return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-8",children:[(0,o.jsx)(eI,{}),(0,o.jsxs)("div",{className:"flex flex-col items-center gap-4 text-center",children:[e&&(0,o.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-muted",children:(0,o.jsx)("span",{className:"text-muted-foreground text-lg font-medium",children:(t??"?").charAt(0).toUpperCase()})}),(0,o.jsxs)("div",{className:"space-y-1.5",children:[(0,o.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:t?`Welcome, ${t}!`:"Welcome!"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Setting up your account…"})]}),(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-5 animate-spin"})]})]})}function eR({message:e,onRetry:t}){return(0,o.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center gap-4 p-8",children:[(0,o.jsx)(eI,{}),(0,o.jsx)(eg.AlertCircle,{className:"text-destructive size-8"}),(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Failed to set up your account"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:e}),(0,o.jsxs)("button",{onClick:t,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary-hover",children:[(0,o.jsx)(em.RefreshCw,{className:"size-3"}),"Try again"]})]})}let e_=["/login","/invite/"],eD=["/chat/"],eP=new V({defaultOptions:{queries:{staleTime:3e4,retry:(e,t)=>!!(0,J.isRetryableError)(t)&&e<1,refetchOnWindowFocus:!0},mutations:{retry:!1}}});function eF({children:e}){let t=(0,u.usePathname)(),s=e_.some(e=>t.startsWith(e)),r=eD.some(e=>t.startsWith(e));return s?(0,o.jsx)(o.Fragment,{children:e}):r?(0,o.jsx)(et.AuthProvider,{children:e}):(0,o.jsx)(et.AuthProvider,{children:(0,o.jsx)(l.Suspense,{fallback:(0,o.jsx)(eW,{}),children:(0,o.jsx)(es.AuthGuard,{children:(0,o.jsx)(Q,{client:eP,children:(0,o.jsx)(el,{children:(0,o.jsx)(eA,{children:(0,o.jsx)(Z.FetchCacheProvider,{children:(0,o.jsx)(ee.OrgProvider,{children:(0,o.jsxs)(ev,{children:[e,(0,o.jsx)(ed,{})]})})})})})})})})})}function eL({children:e}){let[t,s]=(0,l.useState)(!1),[r,n]=(0,l.useState)(null);return((0,l.useEffect)(()=>{(0,eT.loadRuntimeConfig)().then(()=>s(!0)).catch(e=>{n(e instanceof Error?e.message:"Failed to load configuration")})},[]),r)?(0,o.jsxs)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3 p-8",children:[(0,o.jsx)("p",{className:"text-destructive text-sm font-medium",children:"Configuration Error"}),(0,o.jsx)("p",{className:"text-muted-foreground max-w-md text-center text-sm",children:r})]}):t?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsx)(eW,{})}function eW(){return(0,o.jsx)("div",{className:"flex min-h-screen flex-col items-center justify-center gap-3",children:(0,o.jsx)(Y.Loader2,{className:"text-muted-foreground size-8 animate-spin"})})}e.s(["Providers",0,function({children:e}){return(0,o.jsx)(eL,{children:(0,o.jsx)(d,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,o.jsx)(eF,{children:e})})})}],693079)},36634,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(312056);let n=(0,s.createContext)(null),a=/^\/sessions\/(.+)/;function i(e){return"/"===e||a.test(e)}e.s(["SessionNavigationProvider",0,function({children:e}){let{currentPath:o,navigate:l}=(0,r.useAppNavigation)(),u=i(o),c=u?o.match(a)?.[1]??null:null,[d,g]=(0,s.useState)(null),m=(0,s.useRef)(o);(0,s.useEffect)(()=>{let e=m.current;i(e)&&!i(o)&&g(e),m.current=o},[o]);let h=(0,s.useCallback)(e=>{l(`/sessions/${e}`)},[l]),p=(0,s.useCallback)(()=>{l("/")},[l]),f=(0,s.useMemo)(()=>({activeSessionId:c,isSessionZone:u,lastSessionZonePath:d,navigateToSession:h,navigateToHome:p}),[c,u,d,h,p]);return(0,t.jsx)(n.Provider,{value:f,children:e})},"isSessionZonePath",0,i,"useSessionNavigation",0,function(){let e=(0,s.useContext)(n);if(!e)throw Error("useSessionNavigation must be used within <SessionNavigationProvider>");return e}])},936636,e=>{"use strict";var t,s,r,n=e.i(843476),a=e.i(271645),i=e.i(618566),o=e.i(475254);let l=(0,o.default)("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);var u=e.i(893976),c=e.i(586108),d=e.i(583093);function g(e){let t=(0,c.useStigmer)(),s=e?async()=>{let s=await t.agentExecution.get(e);return s.spec?.sessionId??null}:null,{data:r,isLoading:n,error:a}=(0,d.useFetch)(s,[e,t],null);return{sessionId:r,isLoading:n,error:a}}var m=e.i(102508),h=e.i(36634),p=e.i(635549),f=e.i(846696),x=e.i(275051),v=e.i(615987);function b(){let{account:e}=(0,v.useMyIdentityAccount)();return(0,a.useMemo)(()=>{let t=e?.spec?.preferences;if(!t)return;let s="native"===t.defaultHarness||"cursor"===t.defaultHarness?t.defaultHarness:void 0,r=t.defaultNativeModel||void 0,n=t.defaultCursorModel||void 0,a=t.defaultAutoApprove||void 0;if(s||r||n||a)return{harness:s,nativeModel:r,cursorModel:n,autoApprove:a}},[e])}var y=e.i(891287),k=e.i(217516),j=e.i(196716),w=e.i(727996),N=e.i(254347),S=e.i(590745),C=e.i(55389);let E=/github\.com[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/;function T(e){let t=e.match(E);return t?{owner:t[1],repo:t[2]}:null}let A={path:"... (tree truncated by GitHub — repository has too many files)",isDirectory:!1,notice:!0};function I(e){let t=(0,a.useCallback)(async t=>{if("git"!==t.type||!t.gitUrl||!e)return null;let s=T(t.gitUrl);if(!s)return null;let r=t.readRef||t.gitBranch||"main",n=`https://api.github.com/repos/${s.owner}/${s.repo}/git/trees/${encodeURIComponent(r)}?recursive=1`,a=await fetch(n,{headers:{Authorization:`Bearer ${e}`}});if(!a.ok)return null;let i=await a.json(),o=i.tree.filter(e=>"blob"===e.type||"tree"===e.type).map(e=>({path:e.path,isDirectory:"tree"===e.type}));return i.truncated&&o.push(A),o},[e]);if(e)return t}var M=e.i(850429);function O(e){let t=atob(e.replace(/\s/g,""));return Uint8Array.from(t,e=>e.charCodeAt(0))}function R(e,t,s=null){if(function(e){let t=Math.min(e.length,8e3);for(let s=0;s<t;s++)if(0===e[s])return!0;return!1}(e))return{text:null,isBinary:!0,size:t,encoding:"base64",...null!==s&&e.length<=M.MAX_WORKSPACE_IMAGE_READ_BYTES?{bytes:e}:{}};let r=function(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{return null}}(e);if(null===r)return{text:null,isBinary:!1,size:t,encoding:"unknown"};let n=e.length>M.MAX_WORKSPACE_FILE_READ_BYTES;return{text:n?r.slice(0,M.MAX_WORKSPACE_FILE_READ_BYTES):r,isBinary:!1,size:t,encoding:"utf-8",...n?{truncated:!0}:{}}}let _="https://api.github.com/repos";function D(e){let t=(0,a.useCallback)(async(t,s)=>{if("git"!==t.type||!t.gitUrl||!e)return null;let r=T(t.gitUrl);if(!r)return null;let n=t.readRef||t.gitBranch||"main",a=`${_}/${r.owner}/${r.repo}/contents/${s.split("/").map(encodeURIComponent).join("/")}?ref=${encodeURIComponent(n)}`,i=await fetch(a,{headers:{Authorization:`Bearer ${e}`}});if(404===i.status)throw new M.WorkspaceFileNotFoundError(s);if(!i.ok)throw Error(`GitHub content fetch failed for ${s} (HTTP ${i.status})`);let o=await i.json();if(Array.isArray(o))throw Error(`Cannot read "${s}": path is a directory`);return"base64"===o.encoding?R(O(o.content),o.size,(0,M.workspaceImageMimeType)(s)):P(r,o,s,e)},[e]);if(e)return t}async function P(e,t,s,r){if(t.size>0xa00000)return{text:null,isBinary:!1,size:t.size,encoding:"none",truncated:!0};let n=`${_}/${e.owner}/${e.repo}/git/blobs/${t.sha}`,a=await fetch(n,{headers:{Authorization:`Bearer ${r}`}});if(!a.ok)throw Error(`GitHub blob fetch failed for ${t.sha} (HTTP ${a.status})`);let i=await a.json();return R(O(i.content),i.size,(0,M.workspaceImageMimeType)(s))}var F=e.i(433732),L=e.i(597744);function W(e){let t=(0,F.useExecutionTarget)(),s=(0,L.useDeploymentMode)(),r=e?.hasLocalPicker??!1;return(0,a.useMemo)(()=>"cloud"===(t??("local"===s?"local":"cloud"))?{enableGitHub:!0,enableLocal:!1}:{enableGitHub:!r,enableLocal:!0},[t,s,r])}let K={agent:{org:"stigmer",slug:"agent-creator"},skill:{org:"stigmer",slug:"skill-creator"},"mcp-server":{org:"stigmer",slug:"mcp-server-creator"}},U=new Set(Object.keys(K));var B=e.i(297629);let z={agent:"Describe the agent you’d like to build — its purpose, the skills and MCP servers it should use, and any system instructions to guide its behavior.",skill:"Describe the skill you’d like to build — what it does and what instructions it should follow. You can attach a workspace or reference files for additional context.","mcp-server":"Describe the MCP server you’d like to register — its name, connection type (stdio or SSE), startup command or endpoint URL, and any required environment variables."},$={agent:"Add an Agent",skill:"Add a Skill","mcp-server":"Add an MCP Server"},q={agent:"Describe how you’d like to modify this agent…",skill:"Describe how you’d like to modify this skill…","mcp-server":"Describe how you’d like to modify this MCP server…"};function H(){let e=(0,i.useSearchParams)(),t=function(e){var t;let s=null!==(t=e.get("draft"))&&U.has(t)?t:null;if(!s)return null;let r=e.get("editOrg"),n=e.get("editSlug");return r&&n?{draftType:s,editRef:{org:r,slug:n}}:{draftType:s}}(e),s=(0,B.useActiveOrgSlug)(),r=b(),o=(0,C.useGitHubConnection)(s),{enableGitHub:l,enableLocal:u}=W(),d=I(o.token),g=D(o.token),{navigateToSession:m}=(0,h.useSessionNavigation)(),p=t?.draftType??null,v=t?.editRef??null,[E,T]=(0,a.useState)(()=>p),[A,M]=(0,a.useState)(v);null===E&&p&&(T(p),M(v));let O=A??null,R=null!==O,_=e.get("agent"),P=e.get("instance"),[F,L]=(0,a.useState)(()=>G(_)),[H,V]=(0,a.useState)(()=>P??void 0);void 0===F&&_&&(L(G(_)),V(P??void 0));let[X,Q]=(0,a.useState)(()=>E?K[E]:F);void 0===X&&E&&Q(K[E]),void 0===X&&F&&Q(F),(0,a.useEffect)(()=>{(p||_)&&window.history.replaceState({},"","/")},[p,_]);let Y=function(e,t){let s=(0,c.useStigmer)(),r=t?.org??null,n=t?.slug??null,{agent:i}=(0,j.useAgent)("agent"===e?r:null,"agent"===e?n:null),{mcpServer:o}=(0,w.useMcpServer)("mcp-server"===e?r:null,"mcp-server"===e?n:null),{skill:l}=(0,N.useSkill)("skill"===e?r:null,"skill"===e?n:null),[u,d]=(0,a.useState)(void 0),[g,m]=(0,a.useState)(null),h=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{if(!h.current){if("agent"===e&&i){h.current=!0;try{let e=(0,S.serializeManifest)(i),t=i.metadata?.slug??"agent";d([new File([e],`${t}.yaml`,{type:"text/yaml"})])}catch{m("Failed to serialize agent for editing")}}if("mcp-server"===e&&o){h.current=!0;try{let e=(0,S.serializeManifest)(o),t=o.metadata?.slug??"mcp-server";d([new File([e],`${t}.yaml`,{type:"text/yaml"})])}catch{m("Failed to serialize MCP server for editing")}}}},[e,i,o]),(0,a.useEffect)(()=>{if(h.current||"skill"!==e||!l)return;let t=l.status?.artifactStorageKey;if(!t)return;h.current=!0;let r=l.metadata?.slug??"skill";s.skill.getArtifact((0,y.create)(k.GetArtifactRequestSchema,{artifactStorageKey:t})).then(e=>{let t=new ArrayBuffer(e.artifact.byteLength);new Uint8Array(t).set(e.artifact),d([new File([new Blob([t],{type:"application/zip"})],`${r}.zip`,{type:"application/zip"})])}).catch(()=>{m("Failed to download skill package for editing")})},[e,l,s]),{files:u,error:g}}(E,O);(0,a.useEffect)(()=>{Y.error&&f.toast.error(Y.error)},[Y.error]);let J=E?R?q[E]:z[E]:void 0,Z=R?"What would you like to change?":E?$[E]:void 0;return(0,n.jsx)(x.NewSessionViewer,{org:s,onSessionCreated:m,onError:e=>f.toast.error(e),accountDefaults:r,gitHubConnection:l?o:void 0,enableGitHub:l,enableLocal:u,workspaceFileLister:d,workspaceFileReader:g,initialAgentRef:X,initialInstanceId:H,initialAttachments:Y.files,heading:Z,placeholder:J,className:"h-full"})}function G(e){if(!e)return;let t=e.indexOf("/");if(!(t<=0)&&t!==e.length-1)return{org:e.slice(0,t),slug:e.slice(t+1)}}var V=e.i(766895),X=e.i(217127),Q=e.i(170255);e.i(107141);var Y=e.i(352082);function J({id:e}){let t=(0,B.useActiveOrgSlug)(),s=(0,B.useActiveOrgId)(),r=(0,C.useGitHubConnection)(t),{enableGitHub:a,enableLocal:i}=W(),o=I(r.token),l=D(r.token),u=b();return(0,n.jsx)("div",{className:"flex h-full w-full flex-col",children:(0,n.jsx)(V.SessionViewer,{sessionId:e,org:t,accountDefaults:u,gitHubConnection:a?r:void 0,enableGitHub:a,enableLocal:i,workspaceFileLister:o,workspaceFileReader:l,accessSlot:(0,n.jsx)(X.ManageAccessButton,{resource:{kind:Q.ApiResourceKind.session,kindString:"session",id:e,org:s}})})})}var Z=e.i(566022),ee=e.i(735922),et=e.i(910304),es=e.i(205730);let er=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]);function en(e){let t=(0,c.useStigmer)(),s=(0,es.useRunnerAdapter)(),r=(0,F.useExecutionTarget)(),n=(0,a.useRef)(null),i=e?async()=>{try{return await t.workflowExecution.get(e)}catch(e){if((0,et.isNotFound)(e))return null;throw e}}:null,{data:o,isLoading:l,isRefetching:u,error:g,refetch:m}=(0,d.useFetch)(i,[e,t],null,{cacheKey:e?`workflow-execution:${e}`:void 0});return(0,a.useEffect)(()=>{let t=o?.status?.phase,a=o?.metadata?.id;s&&"local"===r&&e&&null!=t&&er.has(t)&&a===e&&n.current!==e&&(n.current=e,s.onWorkflowExecutionTerminated(e).catch(()=>{}))},[o?.status?.phase,o?.metadata?.id,e,s,r]),(0,a.useEffect)(()=>{n.current=null},[e]),{execution:o,isLoading:l,isRefetching:u,error:g,refetch:m}}var ea=e.i(218766),ei=e.i(610595),eo=e.i(326283),el=e.i(868278),eu=e.i(777489),ec=e.i(661438);let ed={stage:"idle"},eg=BigInt(0),em=BigInt(-1),eh={costConsumedMicros:eg,costRemainingMicros:em,tokensConsumed:eg,tokensRemaining:em,thresholdBreached:!1};class ep{_events=[];_streamState=ed;_listeners=new Set;_taskStatesCache=null;_costSummaryCache=null;_totalTasks=0;appendEvents(e){if(0===e.length)return;let t=this._events.length>0?this._events[this._events.length-1].sequenceNumber:eg,s=e.filter(e=>e.sequenceNumber>t);if(0!==s.length){for(let e of(s.sort((e,t)=>e.sequenceNumber<t.sequenceNumber?-1:+(e.sequenceNumber>t.sequenceNumber)),this._events=[...this._events,...s],this._taskStatesCache=null,this._costSummaryCache=null,s))e.eventType===eu.WorkflowEventType.execution_started&&"executionStarted"===e.payload.case&&(this._totalTasks=e.payload.value.totalTasks);this._notify()}}setStreamState(e){var t,s;t=this._streamState,s=e,t.stage===s.stage&&("idle"===t.stage||"error"===t.stage&&"error"===s.stage&&t.executionId===s.executionId&&t.error===s.error||"reconnecting"===t.stage&&"reconnecting"===s.stage&&t.executionId===s.executionId&&t.attempt===s.attempt||"executionId"in t&&"executionId"in s&&t.executionId===s.executionId)||(this._streamState=e,this._notify())}reset(){let e=0===this._events.length&&"idle"===this._streamState.stage;this._events=[],this._streamState=ed,this._taskStatesCache=null,this._costSummaryCache=null,this._totalTasks=0,e||this._notify()}subscribe=e=>(this._listeners.add(e),()=>{this._listeners.delete(e)});getEvents=()=>this._events;getStreamState=()=>this._streamState;getLatestSequence=()=>0===this._events.length?eg:this._events[this._events.length-1].sequenceNumber;getTotalTasks=()=>this._totalTasks;getTaskStates=()=>(this._taskStatesCache||(this._taskStatesCache=function(e){let t=new Map;for(let n of e){let e=n.taskName;if(!e)continue;let a=t.get(e),i=n.payload;switch(i.case){case"taskStarted":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"running",durationMs:0,costMicros:a?.costMicros??eg,tokensUsed:a?.tokensUsed??eg,attemptNumber:i.value.attemptNumber,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:a?.currentToolName??"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:i.value.inputSummary??a?.inputSummary??null,outputSummary:null,approvalRequest:null,approvalResolution:null});break;case"taskCompleted":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"completed",durationMs:Number(i.value.durationMs),costMicros:i.value.costMicros,tokensUsed:i.value.tokensUsed,attemptNumber:a?.attemptNumber??1,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:a?.inputSummary??null,outputSummary:i.value.outputSummary??null,approvalRequest:a?.approvalRequest??null,approvalResolution:a?.approvalResolution??null});break;case"taskFailed":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:i.value.willRetry?"retrying":"failed",durationMs:Number(i.value.durationMs),costMicros:a?.costMicros??eg,tokensUsed:a?.tokensUsed??eg,attemptNumber:i.value.attemptNumber,error:i.value.error,childExecutionId:a?.childExecutionId??"",agentSlug:a?.agentSlug??"",currentToolName:"",messagesCount:a?.messagesCount??0,toolCallsCount:a?.toolCallsCount??0,inputSummary:a?.inputSummary??null,outputSummary:null,approvalRequest:a?.approvalRequest??null,approvalResolution:a?.approvalResolution??null});break;case"taskSkipped":t.set(e,{taskName:e,taskKind:i.value.taskKind,status:"skipped",durationMs:0,costMicros:eg,tokensUsed:eg,attemptNumber:0,error:"",childExecutionId:a?.childExecutionId??"",agentSlug:"",currentToolName:"",messagesCount:0,toolCallsCount:0,inputSummary:null,outputSummary:null,approvalRequest:null,approvalResolution:null});break;case"taskRetrying":a&&t.set(e,{...a,status:"retrying"});break;case"agentCallStarted":a&&t.set(e,{...a,childExecutionId:i.value.childExecutionId||a.childExecutionId,agentSlug:i.value.agentSlug||a.agentSlug});break;case"agentCallProgress":var s,r;a&&t.set(e,{...a,status:(s=a.status,r=i.value.agentPhase,"running"===s?r===ec.ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL?"waiting_approval":"running":"waiting_approval"===s?r===ec.ExecutionPhase.EXECUTION_WAITING_FOR_APPROVAL||r===ec.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED?"waiting_approval":"running":s),childExecutionId:i.value.childExecutionId||a.childExecutionId,currentToolName:i.value.currentToolName||a.currentToolName,messagesCount:i.value.messagesCount||a.messagesCount,toolCallsCount:i.value.toolCallsCount||a.toolCallsCount,tokensUsed:i.value.tokensConsumed>eg?i.value.tokensConsumed:a.tokensUsed});break;case"agentCallCompleted":a&&t.set(e,{...a,costMicros:i.value.costMicros,tokensUsed:i.value.tokensConsumed,currentToolName:""});break;case"approvalRequested":a&&t.set(e,{...a,status:"waiting_approval",approvalRequest:i.value,approvalResolution:null});break;case"approvalResolved":a&&t.set(e,{...a,status:"waiting_approval"===a.status?"running":a.status,approvalResolution:i.value})}}return t}(this._events)),this._taskStatesCache);getCostSummary=()=>(this._costSummaryCache||(this._costSummaryCache=function(e){for(let t=e.length-1;t>=0;t--){let s=e[t].payload;if("budgetCheckpoint"===s.case)return{costConsumedMicros:s.value.costConsumedMicros,costRemainingMicros:s.value.costRemainingMicros,tokensConsumed:s.value.tokensConsumed,tokensRemaining:s.value.tokensRemaining,thresholdBreached:s.value.thresholdBreached}}for(let t=e.length-1;t>=0;t--){let s=e[t].payload;if("executionCompleted"===s.case)return{costConsumedMicros:s.value.totalCostMicros,costRemainingMicros:em,tokensConsumed:s.value.totalTokens,tokensRemaining:em,thresholdBreached:!1}}let t=eg,s=eg;for(let r of e)"taskCompleted"===r.payload.case&&(t+=r.payload.value.costMicros,s+=r.payload.value.tokensUsed);return t>eg||s>eg?{costConsumedMicros:t,costRemainingMicros:em,tokensConsumed:s,tokensRemaining:em,thresholdBreached:!1}:eh}(this._events)),this._costSummaryCache);_notify(){for(let e of this._listeners)e()}}let ef=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]);function ex(e,t){let s=(0,c.useStigmer)(),r=(0,a.useRef)(null);t?.store||r.current||(r.current=new ep);let n=t?.store??r.current,[i,o]=(0,a.useState)(0),l=(0,a.useCallback)(()=>{o(e=>e+1)},[]),u=t?.eventTypes,d=t?.executionPhase,g=t?.autoReconnect??!0,m=t?.reconnectOptions,h=(0,a.useRef)(n);h.current=n;let p=(0,a.useRef)(void 0),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{var t;if(!e){n.reset(),p.current=void 0,f.current=null;return}let r=new AbortController,i=h.current,o=void 0!==d&&ef.has(d);return null!==f.current&&f.current!==e&&(i.reset(),p.current=void 0),f.current=e,t=p.current,void 0!==t&&void 0!==d&&ef.has(t)&&!ef.has(d)&&i.reset(),p.current=d,o?(i.setStreamState({stage:"connecting",executionId:e}),(async()=>{try{let t=BigInt(0),n=!0;for(;n&&!r.signal.aborted;){let o=await s.workflowExecution.getEventLog((0,y.create)(ea.GetEventLogRequestSchema,{executionId:e,afterSequence:t,eventTypes:u?[...u]:[],pageSize:500}));if(r.signal.aborted)return;(0,a.startTransition)(()=>{i.appendEvents(o.events)}),n=o.hasMore,t=o.latestSequence}r.signal.aborted||i.setStreamState({stage:"complete",executionId:e})}catch(t){if(r.signal.aborted)return;i.setStreamState({stage:"error",executionId:e,error:(0,eo.toError)(t)})}})()):(i.setStreamState({stage:"connecting",executionId:e}),(async()=>{let t=r.signal,n=m?.maxAttempts??el.DEFAULT_RECONNECT_MAX_ATTEMPTS,o=0;for(;!t.aborted;)try{let r=i.getLatestSequence();for await(let n of s.workflowExecution.subscribeEvents((0,y.create)(ea.SubscribeEventsRequestSchema,{executionId:e,afterSequence:r,eventTypes:u?[...u]:[]}),t)){if(t.aborted)return;o=0,(0,a.startTransition)(()=>{i.appendEvents([n]);let t=i.getStreamState().stage;("connecting"===t||"reconnecting"===t)&&i.setStreamState({stage:"streaming",executionId:e})})}t.aborted||i.setStreamState({stage:"complete",executionId:e});return}catch(r){if(t.aborted)return;let s=(0,eo.toError)(r);if(s.message.includes("UNIMPLEMENTED")||s.message.includes("unimplemented"))return void i.setStreamState({stage:"unsupported",executionId:e});if(!g||!(0,ei.isTransientStreamError)(s)||o>=n)return void i.setStreamState({stage:"error",executionId:e,error:s});o+=1,i.setStreamState({stage:"reconnecting",executionId:e,attempt:o,error:s});try{await (0,el.sleep)((0,el.computeBackoffDelay)(o,m),t)}catch{return}}})()),()=>{r.abort()}},[e,s,i,d]);let x=(0,a.useSyncExternalStore)(n.subscribe,n.getEvents),v=(0,a.useSyncExternalStore)(n.subscribe,n.getTaskStates),b=(0,a.useSyncExternalStore)(n.subscribe,n.getCostSummary),k=(0,a.useSyncExternalStore)(n.subscribe,n.getStreamState),j=(0,a.useSyncExternalStore)(n.subscribe,n.getTotalTasks),w="streaming"===k.stage,N="connecting"===k.stage,S="reconnecting"===k.stage,C="reconnecting"===k.stage?k.attempt:0,E="error"===k.stage?k.error:null;return{events:x,taskStates:v,costSummary:b,streamState:k,totalTasks:j,isStreaming:w,isConnecting:N,isReconnecting:S,reconnectAttempt:C,error:E,reconnect:l}}var ev=e.i(202796),eb=e.i(980213);let ey=new Set(["completed","failed","skipped"]),ek=new Set([Z.WorkflowTaskStatus.WORKFLOW_TASK_COMPLETED,Z.WorkflowTaskStatus.WORKFLOW_TASK_FAILED,Z.WorkflowTaskStatus.WORKFLOW_TASK_SKIPPED]);var ej=e.i(945850),ew=e.i(565621),eN=e.i(244686),eS=e.i(267460);let eC=new Set([Z.ExecutionPhase.EXECUTION_PENDING,Z.ExecutionPhase.EXECUTION_IN_PROGRESS]),eE=new Set([Z.ExecutionPhase.EXECUTION_COMPLETED,Z.ExecutionPhase.EXECUTION_FAILED,Z.ExecutionPhase.EXECUTION_CANCELLED,Z.ExecutionPhase.EXECUTION_TERMINATED]),eT=(0,a.memo)(function({execution:e,streamState:t,costSummary:s,actions:r,onDiagnose:i,isDiagnosing:o,onCompare:l,headerActions:c,className:d}){let g=e.status?.phase??Z.ExecutionPhase.EXECUTION_PHASE_UNSPECIFIED,m=e.metadata?.name??e.metadata?.id??"Execution",h=e.status?.startedAt??"",p=e.status?.completedAt??"",f=(0,a.useMemo)(()=>{if(!h)return null;let e=new Date(h).getTime(),t=p?new Date(p).getTime():Date.now();return(0,eS.formatDuration)(t-e)},[h,p]),x=(0,a.useMemo)(()=>s.costConsumedMicros<=BigInt(0)?null:(0,eS.formatMicroUsd)(s.costConsumedMicros),[s.costConsumedMicros]),v=eC.has(g),b=g===Z.ExecutionPhase.EXECUTION_PAUSED,y=g===Z.ExecutionPhase.EXECUTION_FAILED,k="streaming"===t.stage||"connecting"===t.stage||"reconnecting"===t.stage;return(0,n.jsxs)("header",{className:(0,u.cn)("stg:flex stg:items-center stg:gap-3 stg:border-b stg:border-border stg:px-4 stg:py-3",d),children:[(0,n.jsx)(eN.WorkflowExecutionPhaseBadge,{phase:g}),(0,n.jsx)("h2",{className:"stg:min-w-0 stg:flex-1 stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:m}),f&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:text-muted-foreground",children:f}),x&&(0,n.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:text-muted-foreground",children:x}),k&&(0,n.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-1 stg:text-xs stg:text-muted-foreground",children:[(0,n.jsxs)("span",{className:"stg:relative stg:flex stg:h-1.5 stg:w-1.5",children:[(0,n.jsx)("span",{className:"stg:absolute stg:inline-flex stg:h-full stg:w-full stg:animate-ping stg:rounded-full stg:bg-success stg:opacity-75"}),(0,n.jsx)("span",{className:"stg:relative stg:inline-flex stg:h-1.5 stg:w-1.5 stg:rounded-full stg:bg-success"})]}),"Live"]}),(0,n.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[l&&eE.has(g)&&(0,n.jsx)(eA,{label:"Compare with…",onClick:l,disabled:!1}),v&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eA,{label:"Pause",onClick:()=>r.pause(),disabled:r.isSubmitting}),(0,n.jsx)(eA,{label:"Cancel",variant:"destructive",onClick:()=>r.cancel(),disabled:r.isSubmitting})]}),b&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eA,{label:"Resume",onClick:()=>r.resume(),disabled:r.isSubmitting}),(0,n.jsx)(eA,{label:"Cancel",variant:"destructive",onClick:()=>r.cancel(),disabled:r.isSubmitting})]}),y&&(0,n.jsxs)(n.Fragment,{children:[i&&(0,n.jsx)(eA,{label:o?"Diagnosing…":"Diagnose",onClick:i,disabled:r.isSubmitting||!!o}),(0,n.jsx)(eA,{label:"Recover",onClick:()=>r.recover(),disabled:r.isSubmitting})]}),c&&(0,n.jsx)("div",{className:"stg:relative stg:flex stg:items-center",children:c})]})]})});function eA({label:e,variant:t,onClick:s,disabled:r}){return(0,n.jsx)("button",{type:"button",onClick:s,disabled:r,className:(0,u.cn)("stg:rounded stg:px-2 stg:py-1 stg:text-xs stg:font-medium stg:transition-colors","stg:disabled:pointer-events-none stg:disabled:opacity-50","destructive"===t?"stg:border stg:border-destructive/30 stg:text-destructive stg:hover:bg-destructive/10":"stg:border stg:border-border stg:text-foreground stg:hover:bg-muted"),children:e})}var eI=e.i(59309),eM=e.i(28434),eO=e.i(375954),eR=e.i(574803),e_=e.i(796545),eD=e.i(145995),eP=e.i(839329);let eF={org:"",slug:"workflow-architect"};var eL=e.i(226634),eW=e.i(953520),eK=e.i(163732),eU=e.i(379410);let eB=new Set(["ready","complete","error"]);function ez({executionId:e,org:t,currentWorkflowYaml:s,onApplyFix:r,onClose:i,className:o}){let[l,c]=(0,a.useState)(""),d=(0,a.useRef)(null),g=function(e){let{executionId:t,org:s,autoStart:r=!0,onError:n}=e,[i,o]=(0,a.useState)("idle"),[l,u]=(0,a.useState)(null),[c,d]=(0,a.useState)([]),[g,m]=(0,a.useState)(null),[h,p]=(0,a.useState)(null),f=(0,a.useRef)(s);f.current=s;let x=(0,a.useRef)(t);x.current=t;let v=(0,a.useRef)(n);v.current=n;let b=(0,a.useRef)(null),y=(0,a.useRef)(!1),k=(0,a.useRef)(!1),{create:j}=(0,eI.useCreateSession)(),{create:w}=(0,eM.useCreateAgentExecution)(),N=(0,e_.useConversationStoreRef)(),S=(0,eO.useExecutionStream)(l,{store:N}),C=(0,a.useCallback)(()=>`Diagnose the failed workflow execution \`${x.current}\`.
|
|
2
2
|
|
|
3
3
|
Analyze the failure root cause using the execution status and event log.
|
|
4
4
|
If this is a workflow definition error, generate a validated fix.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78946,e=>{"use strict";var t=e.i(910304),r=e.i(292558),i=e.i(891287),a=e.i(338300),n=e.i(621559),c=e.i(71268),o=e.i(534125),s=e.i(425285),l=e.i(973955),u=e.i(170255),d=e.i(459153),p=e.i(421415),m=e.i(85849),g=e.i(798525),h=e.i(301218);function v(e){return Object.assign((0,i.create)(l.ToolApprovalPolicySchema),(0,r.stripUndefined)({toolName:e.toolName,message:e.message,fromDestructiveHint:e.fromDestructiveHint}))}function b(e){var t,a,o;let s,u;e.env&&(s=Object.fromEntries(Object.entries(e.env).map(([e,t])=>[e,Object.assign((0,i.create)(n.EnvVarDeclarationSchema),(0,r.stripUndefined)({isSecret:t.isSecret,description:t.description,optional:t.optional}))])));let m=e.pinnedToolApprovals?.map(v),g=e.auth?(t=e.auth,u=(0,i.create)(l.McpServerAuthSchema),(t.oauthAppRef?.slug||t.oauthAppRef?.org)&&(u.oauthAppRef=(0,i.create)(d.ApiResourceReferenceSchema,{...t.oauthAppRef,kind:22})),void 0!==t.targetEnvVar&&(u.targetEnvVar=t.targetEnvVar),void 0!==t.tokenLifetimeHint&&(u.tokenLifetimeHint=t.tokenLifetimeHint),t.scopeHints&&(u.scopeHints=t.scopeHints),void 0!==t.discoveryUrl&&(u.discoveryUrl=t.discoveryUrl),void 0!==t.oauthOnly&&(u.oauthOnly=t.oauthOnly),u):void 0,h=Object.assign((0,i.create)(l.McpServerSpecSchema),(0,r.stripUndefined)({description:e.description,iconUrl:e.iconUrl,tags:e.tags,defaultEnabledTools:e.defaultEnabledTools,env:s,pinnedToolApprovals:m,repositoryUrl:e.repositoryUrl,githubStars:e.githubStars,auth:g}));return e.stdio?h.serverType={case:"stdio",value:(a=e.stdio,Object.assign((0,i.create)(l.StdioServerConfigSchema),(0,r.stripUndefined)({command:a.command,args:a.args,workingDir:a.workingDir})))}:e.http&&(h.serverType={case:"http",value:(o=e.http,Object.assign((0,i.create)(l.HttpServerConfigSchema),(0,r.stripUndefined)({url:o.url,headers:o.headers,queryParams:o.queryParams,timeoutSeconds:o.timeoutSeconds})))}),Object.assign((0,i.create)(c.McpServerSchema),{apiVersion:"agentic.stigmer.ai/v1",kind:"McpServer",metadata:Object.assign((0,i.create)(p.ApiResourceMetadataSchema),{...e.id&&{id:e.id},name:e.name,org:e.org,...e.slug&&{slug:e.slug},...e.labels&&{labels:e.labels},...e.visibility&&{visibility:e.visibility}}),spec:h})}function f(e){return{toolName:e.toolName||void 0,message:e.message||void 0,fromDestructiveHint:e.fromDestructiveHint||void 0}}e.s(["McpServerClient",0,class{command;query;search;constructor(e){this.command=(0,a.createClient)(o.McpServerCommandController,e),this.query=(0,a.createClient)(s.McpServerQueryController,e),this.search=(0,a.createClient)(h.SearchService,e)}async apply(e){try{return await this.command.apply(b(e))}catch(e){throw(0,t.wrapError)(e)}}async create(e){try{return await this.command.create(b(e))}catch(e){throw(0,t.wrapError)(e)}}async update(e){try{return await this.command.update(b(e))}catch(e){throw(0,t.wrapError)(e)}}async delete(e){try{return await this.command.delete((0,i.create)(d.ApiResourceDeleteInputSchema,{resourceId:e.resourceId,versionMessage:e.versionMessage,force:e.force}))}catch(e){throw(0,t.wrapError)(e)}}async updateVisibility(e){try{return await this.command.updateVisibility(e)}catch(e){throw(0,t.wrapError)(e)}}async connect(e){try{return await this.command.connect(e)}catch(e){throw(0,t.wrapError)(e)}}async startConnect(e){try{return await this.command.startConnect(e)}catch(e){throw(0,t.wrapError)(e)}}async initiateOAuthConnect(e){try{return await this.command.initiateOAuthConnect(e)}catch(e){throw(0,t.wrapError)(e)}}async completeOAuthConnect(e){try{return await this.command.completeOAuthConnect(e)}catch(e){throw(0,t.wrapError)(e)}}async disconnectOAuth(e){try{return await this.command.disconnectOAuth(e)}catch(e){throw(0,t.wrapError)(e)}}async setOrgOAuthApp(e){try{return await this.command.setOrgOAuthApp(e)}catch(e){throw(0,t.wrapError)(e)}}async deleteOrgOAuthApp(e){try{return await this.command.deleteOrgOAuthApp(e)}catch(e){throw(0,t.wrapError)(e)}}async get(e){try{return await this.query.get((0,i.create)(d.ApiResourceIdSchema,{value:e}))}catch(e){throw(0,t.wrapError)(e)}}async getByReference(e){try{return await this.query.getByReference((0,i.create)(d.ApiResourceReferenceSchema,{...e,kind:u.ApiResourceKind.mcp_server}))}catch(e){throw(0,t.wrapError)(e)}}async getOAuthGrantStatus(e){try{return await this.query.getOAuthGrantStatus(e)}catch(e){throw(0,t.wrapError)(e)}}async getOrgOAuthApp(e){try{return await this.query.getOrgOAuthApp(e)}catch(e){throw(0,t.wrapError)(e)}}async list(e){try{let t=await this.search.search((0,i.create)(g.SearchRequestSchema,{kinds:[u.ApiResourceKind.mcp_server],query:e.query,org:e.org,excludePublic:e.excludePublic??!1,crossOrgPublic:e.crossOrgPublic??!1,page:e.page?(0,i.create)(m.PageInfoSchema,e.page):void 0}));return{entries:t.entries,totalCount:t.totalCount,totalPages:t.totalPages}}catch(e){throw(0,t.wrapError)(e)}}},"buildMcpServerProto",0,b,"toMcpServerUpdateInput",0,function(e){var t,a,n;let c=e.metadata,o=e.spec??(0,i.create)(l.McpServerSpecSchema);return{id:c?.id||void 0,name:c?.name??"",slug:c?.slug||void 0,org:c?.org??"",labels:c?.labels&&Object.keys(c.labels).length>0?{...c.labels}:void 0,visibility:c?.visibility||void 0,description:o.description||void 0,iconUrl:o.iconUrl||void 0,tags:o.tags?.length?[...o.tags]:void 0,stdio:o.serverType?.case==="stdio"?{command:(t=o.serverType.value).command??"",args:t.args?.length?[...t.args]:void 0,workingDir:t.workingDir||void 0}:void 0,http:o.serverType?.case==="http"?{url:(a=o.serverType.value).url??"",headers:Object.keys(a.headers??{}).length>0?{...a.headers}:void 0,queryParams:Object.keys(a.queryParams??{}).length>0?{...a.queryParams}:void 0,timeoutSeconds:a.timeoutSeconds||void 0}:void 0,defaultEnabledTools:o.defaultEnabledTools?.length?[...o.defaultEnabledTools]:void 0,env:Object.keys(o.env??{}).length>0?Object.fromEntries(Object.entries(o.env).map(([e,t])=>[e,{isSecret:t.isSecret||void 0,description:t.description||void 0,optional:t.optional||void 0}])):void 0,pinnedToolApprovals:o.pinnedToolApprovals?.length?o.pinnedToolApprovals.map(f):void 0,repositoryUrl:o.repositoryUrl||void 0,githubStars:o.githubStars||void 0,auth:o.auth?(n=o.auth,{oauthAppRef:(0,r.toResourceRefInput)(n.oauthAppRef),targetEnvVar:n.targetEnvVar||void 0,tokenLifetimeHint:n.tokenLifetimeHint||void 0,scopeHints:n.scopeHints?.length?[...n.scopeHints]:void 0,discoveryUrl:n.discoveryUrl||void 0,oauthOnly:n.oauthOnly||void 0}):void 0}}])},414385,e=>{"use strict";var t=e.i(274217),r=e.i(265209),i=e.i(57897),a=e.i(971811),n=e.i(95560),c=e.i(577755),o=e.i(647767),s=e.i(606322);let l={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function u(e,t,r){return d((0,i.reflect)(e,t),r?Object.assign(Object.assign({},l),r):l)}function d(e,t){var c,s;let l=function e(t,c){if(t.desc.typeName.startsWith("google.protobuf."))switch(t.desc.typeName){case"google.protobuf.Any":return function(t,r){let c,o;if(""===t.typeUrl)return{};let{registry:s}=r;if(s&&(c=(0,a.anyUnpack)(t,s))&&(o=s.getMessage(c.$typeName)),!o||!c)throw Error(`cannot encode message ${t.$typeName} to JSON: "${t.typeUrl}" is not in the type registry`);let l=(0,i.reflect)(o,c),u=(0,n.hasCustomJsonRepresentation)(o)?{value:e(l,r)}:d(l,r);return u["@type"]=t.typeUrl,u}(t.message,c);case"google.protobuf.Timestamp":return function(e){let t=1e3*Number(e.seconds);if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);if(e.nanos>0x3b9ac9ff)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be greater than 99999999`);let r="Z";if(e.nanos>0){let t=(e.nanos+1e9).toString().substring(1);r="000000"===t.substring(3)?"."+t.substring(0,3)+"Z":"000"===t.substring(6)?"."+t.substring(0,6)+"Z":"."+t+"Z"}return new Date(t).toISOString().replace(".000Z",r)}(t.message);case"google.protobuf.Duration":return function(e){let t=Number(e.seconds),r=e.nanos;if(t>315576e6||t<-315576e6)throw Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);if(t>0&&r<0||t<0&&r>0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos sign must match seconds sign`);let i=e.seconds.toString();if(0!==r){let e=Math.abs(r).toString();"000000"===(e="0".repeat(9-e.length)+e).substring(3)?e=e.substring(0,3):"000"===e.substring(6)&&(e=e.substring(0,6)),i+="."+e,r<0&&0==t&&(i="-"+i)}return i+"s"}(t.message);case"google.protobuf.FieldMask":var o;return(o=t.message).paths.map(e=>{if((0,r.protoSnakeCase)((0,r.protoCamelCase)(e))!==e)throw Error(`cannot encode message ${o.$typeName} to JSON: lowerCamelCase of path name "${e}" is irreversible`);return(0,r.protoCamelCase)(e)}).join(",");case"google.protobuf.Struct":return h(t.message);case"google.protobuf.Value":return v(t.message);case"google.protobuf.ListValue":return b(t.message);default:if((0,n.isWrapperDesc)(t.desc)){let e=t.desc.fields[0];return g(e,t.get(e))}return}}(e,t);if(void 0!==l)return l;let u={};for(let r of e.sortedFields){if(!e.isSet(r)){if(3==r.presence)throw Error(`cannot encode ${r} to JSON: required field not set`);if(!t.alwaysEmitImplicit||2!==r.presence)continue}let i=p(r,e.get(r),t);void 0!==i&&(u[s=r,t.useProtoFieldName?s.name:s.jsonName]=i)}if(t.registry){let r=new Set;for(let{no:i}of null!=(c=e.getUnknown())?c:[])if(!r.has(i)){r.add(i);let a=t.registry.getExtensionFor(e.desc,i);if(!a)continue;let n=(0,o.getExtension)(e.message,a),[c,s]=(0,o.createExtensionContainer)(a,n),l=p(s,c.get(s),t);void 0!==l&&(u[a.jsonName]=l)}}return u}function p(e,t,r){switch(e.fieldKind){case"scalar":return g(e,t);case"message":return d(t,r);case"enum":return m(e.enum,t,r.enumAsInteger);case"list":var i=t,a=r;let n=i.field(),c=[];switch(n.listKind){case"scalar":for(let e of i)c.push(g(n,e));break;case"enum":for(let e of i)c.push(m(n.enum,e,a.enumAsInteger));break;case"message":for(let e of i)c.push(d(e,a))}return a.alwaysEmitImplicit||c.length>0?c:void 0;case"map":var o=t,s=r;let l=o.field(),u={};switch(l.mapKind){case"scalar":for(let[e,t]of o)u[e]=g(l,t);break;case"message":for(let[e,t]of o)u[e]=d(t,s);break;case"enum":for(let[e,t]of o)u[e]=m(l.enum,t,s.enumAsInteger)}return s.alwaysEmitImplicit||o.size>0?u:void 0}}function m(e,t,r){var i;if("number"!=typeof t)throw Error(`cannot encode ${e} to JSON: expected number, got ${(0,s.formatVal)(t)}`);if("google.protobuf.NullValue"==e.typeName)return null;if(r)return t;let a=e.value[t];return null!=(i=null==a?void 0:a.name)?i:t}function g(e,r){var i,a,n,o,l,u;switch(e.scalar){case t.ScalarType.INT32:case t.ScalarType.SFIXED32:case t.ScalarType.SINT32:case t.ScalarType.FIXED32:case t.ScalarType.UINT32:if("number"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(i=(0,s.checkField)(e,r))?void 0:i.message}`);return r;case t.ScalarType.FLOAT:case t.ScalarType.DOUBLE:if("number"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(a=(0,s.checkField)(e,r))?void 0:a.message}`);if(Number.isNaN(r))return"NaN";if(r===1/0)return"Infinity";if(r===-1/0)return"-Infinity";return r;case t.ScalarType.STRING:if("string"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(n=(0,s.checkField)(e,r))?void 0:n.message}`);return r;case t.ScalarType.BOOL:if("boolean"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(o=(0,s.checkField)(e,r))?void 0:o.message}`);return r;case t.ScalarType.UINT64:case t.ScalarType.FIXED64:case t.ScalarType.INT64:case t.ScalarType.SFIXED64:case t.ScalarType.SINT64:if("bigint"==typeof r||"string"==typeof r||"number"==typeof r&&Number.isInteger(r))return r.toString();throw Error(`cannot encode ${e} to JSON: ${null==(l=(0,s.checkField)(e,r))?void 0:l.message}`);case t.ScalarType.BYTES:if(r instanceof Uint8Array)return(0,c.base64Encode)(r);throw Error(`cannot encode ${e} to JSON: ${null==(u=(0,s.checkField)(e,r))?void 0:u.message}`)}}function h(e){let t={};for(let[r,i]of Object.entries(e.fields))t[r]=v(i);return t}function v(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":case"stringValue":return e.kind.value;case"structValue":return h(e.kind.value);case"listValue":return b(e.kind.value);default:throw Error(`${e.$typeName} must have a value`)}}function b(e){return e.values.map(v)}e.s(["toJson",0,u,"toJsonString",0,function(e,t,r){var i;return JSON.stringify(u(e,t,r),null,null!=(i=null==r?void 0:r.prettySpaces)?i:0)}])},798525,301218,e=>{"use strict";var t=e.i(424407),r=e.i(304532),i=e.i(170255),a=e.i(302933),n=e.i(85849),c=e.i(761867),o=e.i(732303);let s=(0,t.fileDesc)("Ch1haS9zdGlnbWVyL3NlYXJjaC92MS9pby5wcm90bxIUYWkuc3RpZ21lci5zZWFyY2gudjEilQIKDVNlYXJjaFJlcXVlc3QSXQoFa2luZHMYASADKA4yPy5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuYXBpcmVzb3VyY2VraW5kLkFwaVJlc291cmNlS2luZEINukgKkgEHIgWCAQIQARIXCgVxdWVyeRgCIAEoCUIIukgFcgMY9AMSKgoDb3JnGAMgASgJQh26SBpyGBg/MhReJHxeW2Etel1bYS16MC05LV0qJBIWCg5leGNsdWRlX3B1YmxpYxgEIAEoCBIuCgRwYWdlGAUgASgLMiAuYWkuc3RpZ21lci5jb21tb25zLnJwYy5QYWdlSW5mbxIYChBjcm9zc19vcmdfcHVibGljGAYgASgIIvQBCg5TZWFyY2hSZXNwb25zZRIzCgdlbnRyaWVzGAEgAygLMiIuYWkuc3RpZ21lci5zZWFyY2gudjEuU2VhcmNoUmVzdWx0Ek4KDmNvdW50c19ieV9raW5kGAIgAygLMjYuYWkuc3RpZ21lci5zZWFyY2gudjEuU2VhcmNoUmVzcG9uc2UuQ291bnRzQnlLaW5kRW50cnkSEwoLdG90YWxfY291bnQYAyABKAUSEwoLdG90YWxfcGFnZXMYBCABKAUaMwoRQ291bnRzQnlLaW5kRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgFOgI4ASKZAwoMU2VhcmNoUmVzdWx0Ek0KBGtpbmQYASABKA4yPy5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuYXBpcmVzb3VyY2VraW5kLkFwaVJlc291cmNlS2luZBIKCgJpZBgCIAEoCRIMCgRuYW1lGAMgASgJEgwKBHNsdWcYBCABKAkSFgoOcXVhbGlmaWVkX3NsdWcYBSABKAkSCwoDb3JnGAYgASgJEhMKC2Rlc2NyaXB0aW9uGAcgASgJEkkKCnZpc2liaWxpdHkYCCABKA4yNS5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VWaXNpYmlsaXR5EgwKBHRhZ3MYCSADKAkSLgoKY3JlYXRlZF9hdBgKIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLgoKdXBkYXRlZF9hdBgLIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASDQoFc2NvcmUYDCABKAISEAoIaWNvbl91cmwYDSABKAliBnByb3RvMw",[i.file_ai_stigmer_commons_apiresource_apiresourcekind_api_resource_kind,a.file_ai_stigmer_commons_apiresource_enum,n.file_ai_stigmer_commons_rpc_pagination,c.file_buf_validate_validate,o.file_google_protobuf_timestamp]),l=(0,r.messageDesc)(s,0);e.s(["SearchRequestSchema",0,l,"file_ai_stigmer_search_v1_io",0,s],798525);var u=e.i(499328),d=e.i(693569);let p=(0,t.fileDesc)("CiBhaS9zdGlnbWVyL3NlYXJjaC92MS9xdWVyeS5wcm90bxIUYWkuc3RpZ21lci5zZWFyY2gudjEyagoNU2VhcmNoU2VydmljZRJZCgZzZWFyY2gSIy5haS5zdGlnbWVyLnNlYXJjaC52MS5TZWFyY2hSZXF1ZXN0GiQuYWkuc3RpZ21lci5zZWFyY2gudjEuU2VhcmNoUmVzcG9uc2UiBNC4GAFiBnByb3RvMw",[d.file_ai_stigmer_commons_rpc_method_options,s]),m=(0,u.serviceDesc)(p,0);e.s(["SearchService",0,m],301218)},992999,e=>{"use strict";var t=e.i(910304),r=e.i(292558),i=e.i(891287),a=e.i(338300),n=e.i(243176),c=e.i(779805),o=e.i(57674),s=e.i(538634),l=e.i(711961),u=e.i(621559),d=e.i(170255),p=e.i(459153),m=e.i(421415),g=e.i(85849),h=e.i(798525),v=e.i(301218);function b(e){return Object.assign((0,i.create)(l.ToolApprovalOverrideSchema),(0,r.stripUndefined)({toolName:e.toolName,requiresApproval:e.requiresApproval,message:e.message}))}function f(e){let t=(0,i.create)(l.McpServerUsageSchema);return(e.mcpServerRef?.slug||e.mcpServerRef?.org)&&(t.mcpServerRef=(0,i.create)(p.ApiResourceReferenceSchema,{...e.mcpServerRef,kind:44})),e.enabledTools&&(t.enabledTools=e.enabledTools),e.toolApprovalOverrides&&(t.toolApprovalOverrides=e.toolApprovalOverrides.map(b)),t}function y(e){return Object.assign((0,i.create)(l.McpAccessSchema),(0,r.stripUndefined)({mcpServer:e.mcpServer,enabledTools:e.enabledTools}))}function A(e){let t=(0,i.create)(l.SubAgentSchema);return void 0!==e.name&&(t.name=e.name),void 0!==e.description&&(t.description=e.description),void 0!==e.instructions&&(t.instructions=e.instructions),e.mcpAccess&&(t.mcpAccess=e.mcpAccess.map(y)),e.skillRefs&&(t.skillRefs=e.skillRefs.map(e=>(0,i.create)(p.ApiResourceReferenceSchema,{...e,kind:43}))),void 0!==e.modelOverride&&(t.modelOverride=e.modelOverride),t}function S(e){let t,a=e.mcpServerUsages?.map(f),c=e.skillRefs?.map(e=>(0,i.create)(p.ApiResourceReferenceSchema,{...e,kind:43})),o=e.subAgents?.map(A);return e.env&&(t=Object.fromEntries(Object.entries(e.env).map(([e,t])=>[e,Object.assign((0,i.create)(u.EnvVarDeclarationSchema),(0,r.stripUndefined)({isSecret:t.isSecret,description:t.description,optional:t.optional}))]))),Object.assign((0,i.create)(n.AgentSchema),{apiVersion:"agentic.stigmer.ai/v1",kind:"Agent",metadata:Object.assign((0,i.create)(m.ApiResourceMetadataSchema),{...e.id&&{id:e.id},name:e.name,org:e.org,...e.slug&&{slug:e.slug},...e.labels&&{labels:e.labels},...e.visibility&&{visibility:e.visibility}}),spec:Object.assign((0,i.create)(l.AgentSpecSchema),(0,r.stripUndefined)({description:e.description,iconUrl:e.iconUrl,instructions:e.instructions,mcpServerUsages:a,skillRefs:c,subAgents:o,env:t}))})}function _(e){return{toolName:e.toolName||void 0,requiresApproval:e.requiresApproval||void 0,message:e.message||void 0}}function E(e){return{mcpServerRef:(0,r.toResourceRefInput)(e.mcpServerRef)??{org:"",slug:""},enabledTools:e.enabledTools?.length?[...e.enabledTools]:void 0,toolApprovalOverrides:e.toolApprovalOverrides?.length?e.toolApprovalOverrides.map(_):void 0}}function V(e){return{mcpServer:e.mcpServer??"",enabledTools:e.enabledTools?.length?[...e.enabledTools]:void 0}}function w(e){return{name:e.name??"",description:e.description||void 0,instructions:e.instructions||void 0,mcpAccess:e.mcpAccess?.length?e.mcpAccess.map(V):void 0,skillRefs:(0,r.toResourceRefInputs)(e.skillRefs),modelOverride:e.modelOverride||void 0}}e.s(["AgentClient",0,class{command;query;search;constructor(e){this.command=(0,a.createClient)(c.AgentCommandController,e),this.query=(0,a.createClient)(s.AgentQueryController,e),this.search=(0,a.createClient)(v.SearchService,e)}async apply(e){try{return await this.command.apply(S(e))}catch(e){throw(0,t.wrapError)(e)}}async create(e){try{return await this.command.create(S(e))}catch(e){throw(0,t.wrapError)(e)}}async update(e){try{return await this.command.update(S(e))}catch(e){throw(0,t.wrapError)(e)}}async updateVisibility(e){try{return await this.command.updateVisibility(e)}catch(e){throw(0,t.wrapError)(e)}}async delete(e){try{return await this.command.delete((0,i.create)(o.AgentIdSchema,{value:e}))}catch(e){throw(0,t.wrapError)(e)}}async get(e){try{return await this.query.get((0,i.create)(o.AgentIdSchema,{value:e}))}catch(e){throw(0,t.wrapError)(e)}}async getByReference(e){try{return await this.query.getByReference((0,i.create)(p.ApiResourceReferenceSchema,{...e,kind:d.ApiResourceKind.agent}))}catch(e){throw(0,t.wrapError)(e)}}async getDefault(e){try{return await this.query.getDefault(e)}catch(e){throw(0,t.wrapError)(e)}}async list(e){try{let t=await this.search.search((0,i.create)(h.SearchRequestSchema,{kinds:[d.ApiResourceKind.agent],query:e.query,org:e.org,excludePublic:e.excludePublic??!1,crossOrgPublic:e.crossOrgPublic??!1,page:e.page?(0,i.create)(g.PageInfoSchema,e.page):void 0}));return{entries:t.entries,totalCount:t.totalCount,totalPages:t.totalPages}}catch(e){throw(0,t.wrapError)(e)}}},"buildAgentProto",0,S,"toAgentUpdateInput",0,function(e){let t=e.metadata,a=e.spec??(0,i.create)(l.AgentSpecSchema);return{id:t?.id||void 0,name:t?.name??"",slug:t?.slug||void 0,org:t?.org??"",labels:t?.labels&&Object.keys(t.labels).length>0?{...t.labels}:void 0,visibility:t?.visibility||void 0,description:a.description||void 0,iconUrl:a.iconUrl||void 0,instructions:a.instructions||void 0,mcpServerUsages:a.mcpServerUsages?.length?a.mcpServerUsages.map(E):void 0,skillRefs:(0,r.toResourceRefInputs)(a.skillRefs),subAgents:a.subAgents?.length?a.subAgents.map(w):void 0,env:Object.keys(a.env??{}).length>0?Object.fromEntries(Object.entries(a.env).map(([e,t])=>[e,{isSecret:t.isSecret||void 0,description:t.description||void 0,optional:t.optional||void 0}])):void 0}}])},960511,e=>{"use strict";var t,r,i,a,n,c,o,s,l,u,d,p,m,g,h,v;e.i(113024);let b=(0,e.i(424407).fileDesc)("CiBhaS9zdGlnbWVyL2JpbGxpbmcvdjEvZW51bS5wcm90bxIVYWkuc3RpZ21lci5iaWxsaW5nLnYxKrYCCg9MZWRnZXJFbnRyeVR5cGUSIQodbGVkZ2VyX2VudHJ5X3R5cGVfdW5zcGVjaWZpZWQQABITCg9wdXJjaGFzZV9jcmVkaXQQARIWChJwcm9tb3Rpb25hbF9jcmVkaXQQAhIPCgt1c2FnZV9kZWJpdBADEhQKEHJlc2VydmF0aW9uX2hvbGQQBBIXChNyZXNlcnZhdGlvbl9yZWxlYXNlEAUSFQoRYWRqdXN0bWVudF9jcmVkaXQQBhIUChBhZGp1c3RtZW50X2RlYml0EAcSEwoPcmVmdW5kX3JldmVyc2FsEAgSEAoMZGlzcHV0ZV9ob2xkEAkSEwoPZGlzcHV0ZV9yZWxlYXNlEAoSEAoMZXhwaXJ5X2RlYml0EAsSGAoUYXV0b19yZWNoYXJnZV9jcmVkaXQQDCpECgpMZWRnZXJWaWV3EhsKF2xlZGdlcl92aWV3X3Vuc3BlY2lmaWVkEAASGQoVbGVkZ2VyX3ZpZXdfc3RhdGVtZW50EAEqZAoPQ3JlZGl0R3JhbnRLaW5kEiEKHWNyZWRpdF9ncmFudF9raW5kX3Vuc3BlY2lmaWVkEAASDQoJcHVyY2hhc2VkEAESDwoLcHJvbW90aW9uYWwQAhIOCgphZGp1c3RtZW50EAMqlQEKFEJpbGxpbmdBY2NvdW50U3RhdHVzEiYKImJpbGxpbmdfYWNjb3VudF9zdGF0dXNfdW5zcGVjaWZpZWQQABIaChZiaWxsaW5nX2FjY291bnRfYWN0aXZlEAESHQoZYmlsbGluZ19hY2NvdW50X3N1c3BlbmRlZBACEhoKFmJpbGxpbmdfYWNjb3VudF9jbG9zZWQQAyqeAQoRUmVzZXJ2YXRpb25TdGF0dXMSIgoecmVzZXJ2YXRpb25fc3RhdHVzX3Vuc3BlY2lmaWVkEAASFgoScmVzZXJ2YXRpb25fYWN0aXZlEAESGQoVcmVzZXJ2YXRpb25fZmluYWxpemVkEAISFwoTcmVzZXJ2YXRpb25fZXhwaXJlZBADEhkKFXJlc2VydmF0aW9uX2NhbmNlbGxlZBAEKocBChZFeGVjdXRpb25CaWxsaW5nU2lnbmFsEigKJGV4ZWN1dGlvbl9iaWxsaW5nX3NpZ25hbF91bnNwZWNpZmllZBAAEhYKEmNvbnRpbnVlX2V4ZWN1dGlvbhABEhcKE2xvd19iYWxhbmNlX3dhcm5pbmcQAhISCg5zdG9wX2V4ZWN1dGlvbhADKrMBChRDcmVkaXRQdXJjaGFzZVN0YXR1cxImCiJjcmVkaXRfcHVyY2hhc2Vfc3RhdHVzX3Vuc3BlY2lmaWVkEAASGwoXY3JlZGl0X3B1cmNoYXNlX3BlbmRpbmcQARIdChljcmVkaXRfcHVyY2hhc2VfY29tcGxldGVkEAISGgoWY3JlZGl0X3B1cmNoYXNlX2ZhaWxlZBADEhsKF2NyZWRpdF9wdXJjaGFzZV9leHBpcmVkEAQqlwEKF0F1dG9SZWNoYXJnZUV2ZW50U3RhdHVzEioKJmF1dG9fcmVjaGFyZ2VfZXZlbnRfc3RhdHVzX3Vuc3BlY2lmaWVkEAASGQoVYXV0b19yZWNoYXJnZV9wZW5kaW5nEAESGwoXYXV0b19yZWNoYXJnZV9zdWNjZWVkZWQQAhIYChRhdXRvX3JlY2hhcmdlX2ZhaWxlZBADYgZwcm90bzM");(l=t||(t={}))[l.ledger_entry_type_unspecified=0]="ledger_entry_type_unspecified",l[l.purchase_credit=1]="purchase_credit",l[l.promotional_credit=2]="promotional_credit",l[l.usage_debit=3]="usage_debit",l[l.reservation_hold=4]="reservation_hold",l[l.reservation_release=5]="reservation_release",l[l.adjustment_credit=6]="adjustment_credit",l[l.adjustment_debit=7]="adjustment_debit",l[l.refund_reversal=8]="refund_reversal",l[l.dispute_hold=9]="dispute_hold",l[l.dispute_release=10]="dispute_release",l[l.expiry_debit=11]="expiry_debit",l[l.auto_recharge_credit=12]="auto_recharge_credit",(u=r||(r={}))[u.unspecified=0]="unspecified",u[u.statement=1]="statement",(d=i||(i={}))[d.credit_grant_kind_unspecified=0]="credit_grant_kind_unspecified",d[d.purchased=1]="purchased",d[d.promotional=2]="promotional",d[d.adjustment=3]="adjustment",(p=a||(a={}))[p.billing_account_status_unspecified=0]="billing_account_status_unspecified",p[p.billing_account_active=1]="billing_account_active",p[p.billing_account_suspended=2]="billing_account_suspended",p[p.billing_account_closed=3]="billing_account_closed",(m=n||(n={}))[m.reservation_status_unspecified=0]="reservation_status_unspecified",m[m.reservation_active=1]="reservation_active",m[m.reservation_finalized=2]="reservation_finalized",m[m.reservation_expired=3]="reservation_expired",m[m.reservation_cancelled=4]="reservation_cancelled",(g=c||(c={}))[g.execution_billing_signal_unspecified=0]="execution_billing_signal_unspecified",g[g.continue_execution=1]="continue_execution",g[g.low_balance_warning=2]="low_balance_warning",g[g.stop_execution=3]="stop_execution",(h=o||(o={}))[h.credit_purchase_status_unspecified=0]="credit_purchase_status_unspecified",h[h.credit_purchase_pending=1]="credit_purchase_pending",h[h.credit_purchase_completed=2]="credit_purchase_completed",h[h.credit_purchase_failed=3]="credit_purchase_failed",h[h.credit_purchase_expired=4]="credit_purchase_expired",(v=s||(s={}))[v.auto_recharge_event_status_unspecified=0]="auto_recharge_event_status_unspecified",v[v.auto_recharge_pending=1]="auto_recharge_pending",v[v.auto_recharge_succeeded=2]="auto_recharge_succeeded",v[v.auto_recharge_failed=3]="auto_recharge_failed",e.s(["BillingAccountStatus",0,a,"LedgerEntryType",0,t,"LedgerView",0,r,"file_ai_stigmer_billing_v1_enum",0,b])},577817,400553,707125,e=>{"use strict";var t=e.i(424407),r=e.i(304532),i=e.i(125322),a=e.i(421415),n=e.i(988158),c=e.i(761867);let o=(0,t.fileDesc)("CidhaS9zdGlnbWVyL2FnZW50aWMvc2Vzc2lvbi92MS9hcGkucHJvdG8SHWFpLnN0aWdtZXIuYWdlbnRpYy5zZXNzaW9uLnYxIqsCCgdTZXNzaW9uEjEKC2FwaV92ZXJzaW9uGAEgASgJQhy6SBlyFwoVYWdlbnRpYy5zdGlnbWVyLmFpL3YxEhwKBGtpbmQYAiABKAlCDrpIC3IJCgdTZXNzaW9uEk0KCG1ldGFkYXRhGAMgASgLMjMuYWkuc3RpZ21lci5jb21tb25zLmFwaXJlc291cmNlLkFwaVJlc291cmNlTWV0YWRhdGFCBrpIA8gBARI4CgRzcGVjGAQgASgLMiouYWkuc3RpZ21lci5hZ2VudGljLnNlc3Npb24udjEuU2Vzc2lvblNwZWMSRgoGc3RhdHVzGAUgASgLMjYuYWkuc3RpZ21lci5jb21tb25zLmFwaXJlc291cmNlLkFwaVJlc291cmNlQXVkaXRTdGF0dXNiBnByb3RvMw",[i.file_ai_stigmer_agentic_session_v1_spec,a.file_ai_stigmer_commons_apiresource_metadata,n.file_ai_stigmer_commons_apiresource_status,c.file_buf_validate_validate]),s=(0,r.messageDesc)(o,0);e.s(["SessionSchema",0,s,"file_ai_stigmer_agentic_session_v1_api",0,o],400553);let l=(0,t.fileDesc)("CiZhaS9zdGlnbWVyL2FnZW50aWMvc2Vzc2lvbi92MS9pby5wcm90bxIdYWkuc3RpZ21lci5hZ2VudGljLnNlc3Npb24udjEiIgoJU2Vzc2lvbklkEhUKBXZhbHVlGAEgASgJQga6SAPIAQEiIAoHQWdlbnRJZBIVCgV2YWx1ZRgBIAEoCUIGukgDyAEBIlsKC1Nlc3Npb25MaXN0EhMKC3RvdGFsX3BhZ2VzGAEgASgFEjcKB2VudHJpZXMYAiADKAsyJi5haS5zdGlnbWVyLmFnZW50aWMuc2Vzc2lvbi52MS5TZXNzaW9uIkoKE0xpc3RTZXNzaW9uc1JlcXVlc3QSEQoJcGFnZV9zaXplGAEgASgFEhIKCnBhZ2VfdG9rZW4YAiABKAkSDAoEdGFncxgDIAMoCSJuCiJMaXN0U2Vzc2lvbnNCeUFnZW50SW5zdGFuY2VSZXF1ZXN0EiEKEWFnZW50X2luc3RhbmNlX2lkGAEgASgJQga6SAPIAQESEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkiYQocTGlzdFNlc3Npb25zQnlDaGFubmVsUmVxdWVzdBIaCgpjaGFubmVsX2lkGAEgASgJQga6SAPIAQESEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkiQgobVXBkYXRlU2Vzc2lvblN1YmplY3RSZXF1ZXN0EhIKAmlkGAEgASgJQga6SAPIAQESDwoHc3ViamVjdBgCIAEoCWIGcHJvdG8z",[o,c.file_buf_validate_validate]),u=(0,r.messageDesc)(l,0),d=(0,r.messageDesc)(l,5);e.s(["ListSessionsByChannelRequestSchema",0,d,"SessionIdSchema",0,u,"file_ai_stigmer_agentic_session_v1_io",0,l],577817);var p=e.i(247167);let m="http://localhost:7234",g="https://api.stigmer.com/",h=null;async function v(){if(h)return h;let e=await b()??{apiUrl:p.default.env.NEXT_PUBLIC_API_URL??m,appUrl:p.default.env.NEXT_PUBLIC_APP_URL??"",authMode:y(p.default.env.NEXT_PUBLIC_AUTH_MODE),oidcIssuer:p.default.env.NEXT_PUBLIC_OIDC_ISSUER??"",oidcClientId:p.default.env.NEXT_PUBLIC_OIDC_CLIENT_ID??"",oidcAudience:p.default.env.NEXT_PUBLIC_OIDC_AUDIENCE??g};return"oidc"===e.authMode&&function(e){let t=[];if(e.oidcIssuer||t.push("oidcIssuer (NEXT_PUBLIC_OIDC_ISSUER)"),e.oidcClientId||t.push("oidcClientId (NEXT_PUBLIC_OIDC_CLIENT_ID)"),e.oidcAudience||t.push("oidcAudience (NEXT_PUBLIC_OIDC_AUDIENCE)"),t.length>0)throw Error(`Auth mode is "oidc" but required fields are missing: ${t.join(", ")}. Check /config.json (container) or NEXT_PUBLIC_* env vars (.env).`)}(e),h=Object.freeze(e)}async function b(){try{let e=await fetch("/config.json");if(!e.ok)return null;let t=await e.json();return{apiUrl:f(t.apiUrl,m),appUrl:f(t.appUrl,""),authMode:y(t.authMode),oidcIssuer:f(t.oidcIssuer,""),oidcClientId:f(t.oidcClientId,""),oidcAudience:f(t.oidcAudience,g)}}catch{return null}}function f(e,t){return"string"==typeof e&&e.length>0?e:t}function y(e){return"oidc"===e?"oidc":"disabled"}e.s(["getRuntimeConfig",0,function(){if(!h)throw Error("getRuntimeConfig() called before loadRuntimeConfig(). Ensure <ConfigGate> wraps the component tree.");return h},"loadRuntimeConfig",0,v],707125)},472402,e=>{"use strict";var t=e.i(707125);e.s(["getApiBaseUrl",0,function(){return(0,t.getRuntimeConfig)().apiUrl},"getAppBaseUrl",0,function(){let e=(0,t.getRuntimeConfig)().appUrl;return e?e.replace(/\/$/,""):window.location.origin}])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78946,e=>{"use strict";var t=e.i(910304),r=e.i(292558),i=e.i(891287),a=e.i(338300),n=e.i(621559),c=e.i(71268),o=e.i(534125),s=e.i(425285),l=e.i(973955),u=e.i(170255),d=e.i(459153),p=e.i(421415),m=e.i(85849),g=e.i(798525),h=e.i(301218);function v(e){return Object.assign((0,i.create)(l.ToolApprovalPolicySchema),(0,r.stripUndefined)({toolName:e.toolName,message:e.message,fromDestructiveHint:e.fromDestructiveHint}))}function b(e){var t,a,o;let s,u;e.env&&(s=Object.fromEntries(Object.entries(e.env).map(([e,t])=>[e,Object.assign((0,i.create)(n.EnvVarDeclarationSchema),(0,r.stripUndefined)({isSecret:t.isSecret,description:t.description,optional:t.optional}))])));let m=e.pinnedToolApprovals?.map(v),g=e.auth?(t=e.auth,u=(0,i.create)(l.McpServerAuthSchema),(t.oauthAppRef?.slug||t.oauthAppRef?.org)&&(u.oauthAppRef=(0,i.create)(d.ApiResourceReferenceSchema,{...t.oauthAppRef,kind:22})),void 0!==t.targetEnvVar&&(u.targetEnvVar=t.targetEnvVar),void 0!==t.tokenLifetimeHint&&(u.tokenLifetimeHint=t.tokenLifetimeHint),t.scopeHints&&(u.scopeHints=t.scopeHints),void 0!==t.discoveryUrl&&(u.discoveryUrl=t.discoveryUrl),void 0!==t.oauthOnly&&(u.oauthOnly=t.oauthOnly),u):void 0,h=Object.assign((0,i.create)(l.McpServerSpecSchema),(0,r.stripUndefined)({description:e.description,iconUrl:e.iconUrl,tags:e.tags,defaultEnabledTools:e.defaultEnabledTools,env:s,pinnedToolApprovals:m,repositoryUrl:e.repositoryUrl,githubStars:e.githubStars,auth:g}));return e.stdio?h.serverType={case:"stdio",value:(a=e.stdio,Object.assign((0,i.create)(l.StdioServerConfigSchema),(0,r.stripUndefined)({command:a.command,args:a.args,workingDir:a.workingDir})))}:e.http&&(h.serverType={case:"http",value:(o=e.http,Object.assign((0,i.create)(l.HttpServerConfigSchema),(0,r.stripUndefined)({url:o.url,headers:o.headers,queryParams:o.queryParams,timeoutSeconds:o.timeoutSeconds})))}),Object.assign((0,i.create)(c.McpServerSchema),{apiVersion:"agentic.stigmer.ai/v1",kind:"McpServer",metadata:Object.assign((0,i.create)(p.ApiResourceMetadataSchema),{...e.id&&{id:e.id},name:e.name,org:e.org,...e.slug&&{slug:e.slug},...e.labels&&{labels:e.labels},...e.visibility&&{visibility:e.visibility}}),spec:h})}function f(e){return{toolName:e.toolName||void 0,message:e.message||void 0,fromDestructiveHint:e.fromDestructiveHint||void 0}}e.s(["McpServerClient",0,class{command;query;search;constructor(e){this.command=(0,a.createClient)(o.McpServerCommandController,e),this.query=(0,a.createClient)(s.McpServerQueryController,e),this.search=(0,a.createClient)(h.SearchService,e)}async apply(e){try{return await this.command.apply(b(e))}catch(e){throw(0,t.wrapError)(e)}}async create(e){try{return await this.command.create(b(e))}catch(e){throw(0,t.wrapError)(e)}}async update(e){try{return await this.command.update(b(e))}catch(e){throw(0,t.wrapError)(e)}}async delete(e){try{return await this.command.delete((0,i.create)(d.ApiResourceDeleteInputSchema,{resourceId:e.resourceId,versionMessage:e.versionMessage,force:e.force}))}catch(e){throw(0,t.wrapError)(e)}}async updateVisibility(e){try{return await this.command.updateVisibility(e)}catch(e){throw(0,t.wrapError)(e)}}async connect(e){try{return await this.command.connect(e)}catch(e){throw(0,t.wrapError)(e)}}async startConnect(e){try{return await this.command.startConnect(e)}catch(e){throw(0,t.wrapError)(e)}}async initiateOAuthConnect(e){try{return await this.command.initiateOAuthConnect(e)}catch(e){throw(0,t.wrapError)(e)}}async completeOAuthConnect(e){try{return await this.command.completeOAuthConnect(e)}catch(e){throw(0,t.wrapError)(e)}}async disconnectOAuth(e){try{return await this.command.disconnectOAuth(e)}catch(e){throw(0,t.wrapError)(e)}}async setOrgOAuthApp(e){try{return await this.command.setOrgOAuthApp(e)}catch(e){throw(0,t.wrapError)(e)}}async deleteOrgOAuthApp(e){try{return await this.command.deleteOrgOAuthApp(e)}catch(e){throw(0,t.wrapError)(e)}}async get(e){try{return await this.query.get((0,i.create)(d.ApiResourceIdSchema,{value:e}))}catch(e){throw(0,t.wrapError)(e)}}async getByReference(e){try{return await this.query.getByReference((0,i.create)(d.ApiResourceReferenceSchema,{...e,kind:u.ApiResourceKind.mcp_server}))}catch(e){throw(0,t.wrapError)(e)}}async getOAuthGrantStatus(e){try{return await this.query.getOAuthGrantStatus(e)}catch(e){throw(0,t.wrapError)(e)}}async getOrgOAuthApp(e){try{return await this.query.getOrgOAuthApp(e)}catch(e){throw(0,t.wrapError)(e)}}async list(e){try{let t=await this.search.search((0,i.create)(g.SearchRequestSchema,{kinds:[u.ApiResourceKind.mcp_server],query:e.query,org:e.org,excludePublic:e.excludePublic??!1,crossOrgPublic:e.crossOrgPublic??!1,page:e.page?(0,i.create)(m.PageInfoSchema,e.page):void 0}));return{entries:t.entries,totalCount:t.totalCount,totalPages:t.totalPages}}catch(e){throw(0,t.wrapError)(e)}}},"buildMcpServerProto",0,b,"toMcpServerUpdateInput",0,function(e){var t,a,n;let c=e.metadata,o=e.spec??(0,i.create)(l.McpServerSpecSchema);return{id:c?.id||void 0,name:c?.name??"",slug:c?.slug||void 0,org:c?.org??"",labels:c?.labels&&Object.keys(c.labels).length>0?{...c.labels}:void 0,visibility:c?.visibility||void 0,description:o.description||void 0,iconUrl:o.iconUrl||void 0,tags:o.tags?.length?[...o.tags]:void 0,stdio:o.serverType?.case==="stdio"?{command:(t=o.serverType.value).command??"",args:t.args?.length?[...t.args]:void 0,workingDir:t.workingDir||void 0}:void 0,http:o.serverType?.case==="http"?{url:(a=o.serverType.value).url??"",headers:Object.keys(a.headers??{}).length>0?{...a.headers}:void 0,queryParams:Object.keys(a.queryParams??{}).length>0?{...a.queryParams}:void 0,timeoutSeconds:a.timeoutSeconds||void 0}:void 0,defaultEnabledTools:o.defaultEnabledTools?.length?[...o.defaultEnabledTools]:void 0,env:Object.keys(o.env??{}).length>0?Object.fromEntries(Object.entries(o.env).map(([e,t])=>[e,{isSecret:t.isSecret||void 0,description:t.description||void 0,optional:t.optional||void 0}])):void 0,pinnedToolApprovals:o.pinnedToolApprovals?.length?o.pinnedToolApprovals.map(f):void 0,repositoryUrl:o.repositoryUrl||void 0,githubStars:o.githubStars||void 0,auth:o.auth?(n=o.auth,{oauthAppRef:(0,r.toResourceRefInput)(n.oauthAppRef),targetEnvVar:n.targetEnvVar||void 0,tokenLifetimeHint:n.tokenLifetimeHint||void 0,scopeHints:n.scopeHints?.length?[...n.scopeHints]:void 0,discoveryUrl:n.discoveryUrl||void 0,oauthOnly:n.oauthOnly||void 0}):void 0}}])},414385,e=>{"use strict";var t=e.i(274217),r=e.i(265209),i=e.i(57897),a=e.i(971811),n=e.i(95560),c=e.i(577755),o=e.i(647767),s=e.i(606322);let l={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function u(e,t,r){return d((0,i.reflect)(e,t),r?Object.assign(Object.assign({},l),r):l)}function d(e,t){var c,s;let l=function e(t,c){if(t.desc.typeName.startsWith("google.protobuf."))switch(t.desc.typeName){case"google.protobuf.Any":return function(t,r){let c,o;if(""===t.typeUrl)return{};let{registry:s}=r;if(s&&(c=(0,a.anyUnpack)(t,s))&&(o=s.getMessage(c.$typeName)),!o||!c)throw Error(`cannot encode message ${t.$typeName} to JSON: "${t.typeUrl}" is not in the type registry`);let l=(0,i.reflect)(o,c),u=(0,n.hasCustomJsonRepresentation)(o)?{value:e(l,r)}:d(l,r);return u["@type"]=t.typeUrl,u}(t.message,c);case"google.protobuf.Timestamp":return function(e){let t=1e3*Number(e.seconds);if(t<Date.parse("0001-01-01T00:00:00Z")||t>Date.parse("9999-12-31T23:59:59Z"))throw Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);if(e.nanos>0x3b9ac9ff)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be greater than 99999999`);let r="Z";if(e.nanos>0){let t=(e.nanos+1e9).toString().substring(1);r="000000"===t.substring(3)?"."+t.substring(0,3)+"Z":"000"===t.substring(6)?"."+t.substring(0,6)+"Z":"."+t+"Z"}return new Date(t).toISOString().replace(".000Z",r)}(t.message);case"google.protobuf.Duration":return function(e){let t=Number(e.seconds),r=e.nanos;if(t>315576e6||t<-315576e6)throw Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);if(t>0&&r<0||t<0&&r>0)throw Error(`cannot encode message ${e.$typeName} to JSON: nanos sign must match seconds sign`);let i=e.seconds.toString();if(0!==r){let e=Math.abs(r).toString();"000000"===(e="0".repeat(9-e.length)+e).substring(3)?e=e.substring(0,3):"000"===e.substring(6)&&(e=e.substring(0,6)),i+="."+e,r<0&&0==t&&(i="-"+i)}return i+"s"}(t.message);case"google.protobuf.FieldMask":var o;return(o=t.message).paths.map(e=>{if((0,r.protoSnakeCase)((0,r.protoCamelCase)(e))!==e)throw Error(`cannot encode message ${o.$typeName} to JSON: lowerCamelCase of path name "${e}" is irreversible`);return(0,r.protoCamelCase)(e)}).join(",");case"google.protobuf.Struct":return h(t.message);case"google.protobuf.Value":return v(t.message);case"google.protobuf.ListValue":return b(t.message);default:if((0,n.isWrapperDesc)(t.desc)){let e=t.desc.fields[0];return g(e,t.get(e))}return}}(e,t);if(void 0!==l)return l;let u={};for(let r of e.sortedFields){if(!e.isSet(r)){if(3==r.presence)throw Error(`cannot encode ${r} to JSON: required field not set`);if(!t.alwaysEmitImplicit||2!==r.presence)continue}let i=p(r,e.get(r),t);void 0!==i&&(u[s=r,t.useProtoFieldName?s.name:s.jsonName]=i)}if(t.registry){let r=new Set;for(let{no:i}of null!=(c=e.getUnknown())?c:[])if(!r.has(i)){r.add(i);let a=t.registry.getExtensionFor(e.desc,i);if(!a)continue;let n=(0,o.getExtension)(e.message,a),[c,s]=(0,o.createExtensionContainer)(a,n),l=p(s,c.get(s),t);void 0!==l&&(u[a.jsonName]=l)}}return u}function p(e,t,r){switch(e.fieldKind){case"scalar":return g(e,t);case"message":return d(t,r);case"enum":return m(e.enum,t,r.enumAsInteger);case"list":var i=t,a=r;let n=i.field(),c=[];switch(n.listKind){case"scalar":for(let e of i)c.push(g(n,e));break;case"enum":for(let e of i)c.push(m(n.enum,e,a.enumAsInteger));break;case"message":for(let e of i)c.push(d(e,a))}return a.alwaysEmitImplicit||c.length>0?c:void 0;case"map":var o=t,s=r;let l=o.field(),u={};switch(l.mapKind){case"scalar":for(let[e,t]of o)u[e]=g(l,t);break;case"message":for(let[e,t]of o)u[e]=d(t,s);break;case"enum":for(let[e,t]of o)u[e]=m(l.enum,t,s.enumAsInteger)}return s.alwaysEmitImplicit||o.size>0?u:void 0}}function m(e,t,r){var i;if("number"!=typeof t)throw Error(`cannot encode ${e} to JSON: expected number, got ${(0,s.formatVal)(t)}`);if("google.protobuf.NullValue"==e.typeName)return null;if(r)return t;let a=e.value[t];return null!=(i=null==a?void 0:a.name)?i:t}function g(e,r){var i,a,n,o,l,u;switch(e.scalar){case t.ScalarType.INT32:case t.ScalarType.SFIXED32:case t.ScalarType.SINT32:case t.ScalarType.FIXED32:case t.ScalarType.UINT32:if("number"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(i=(0,s.checkField)(e,r))?void 0:i.message}`);return r;case t.ScalarType.FLOAT:case t.ScalarType.DOUBLE:if("number"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(a=(0,s.checkField)(e,r))?void 0:a.message}`);if(Number.isNaN(r))return"NaN";if(r===1/0)return"Infinity";if(r===-1/0)return"-Infinity";return r;case t.ScalarType.STRING:if("string"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(n=(0,s.checkField)(e,r))?void 0:n.message}`);return r;case t.ScalarType.BOOL:if("boolean"!=typeof r)throw Error(`cannot encode ${e} to JSON: ${null==(o=(0,s.checkField)(e,r))?void 0:o.message}`);return r;case t.ScalarType.UINT64:case t.ScalarType.FIXED64:case t.ScalarType.INT64:case t.ScalarType.SFIXED64:case t.ScalarType.SINT64:if("bigint"==typeof r||"string"==typeof r||"number"==typeof r&&Number.isInteger(r))return r.toString();throw Error(`cannot encode ${e} to JSON: ${null==(l=(0,s.checkField)(e,r))?void 0:l.message}`);case t.ScalarType.BYTES:if(r instanceof Uint8Array)return(0,c.base64Encode)(r);throw Error(`cannot encode ${e} to JSON: ${null==(u=(0,s.checkField)(e,r))?void 0:u.message}`)}}function h(e){let t={};for(let[r,i]of Object.entries(e.fields))t[r]=v(i);return t}function v(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":case"stringValue":return e.kind.value;case"structValue":return h(e.kind.value);case"listValue":return b(e.kind.value);default:throw Error(`${e.$typeName} must have a value`)}}function b(e){return e.values.map(v)}e.s(["toJson",0,u,"toJsonString",0,function(e,t,r){var i;return JSON.stringify(u(e,t,r),null,null!=(i=null==r?void 0:r.prettySpaces)?i:0)}])},798525,301218,e=>{"use strict";var t=e.i(424407),r=e.i(304532),i=e.i(170255),a=e.i(302933),n=e.i(85849),c=e.i(761867),o=e.i(732303);let s=(0,t.fileDesc)("Ch1haS9zdGlnbWVyL3NlYXJjaC92MS9pby5wcm90bxIUYWkuc3RpZ21lci5zZWFyY2gudjEilQIKDVNlYXJjaFJlcXVlc3QSXQoFa2luZHMYASADKA4yPy5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuYXBpcmVzb3VyY2VraW5kLkFwaVJlc291cmNlS2luZEINukgKkgEHIgWCAQIQARIXCgVxdWVyeRgCIAEoCUIIukgFcgMY9AMSKgoDb3JnGAMgASgJQh26SBpyGBg/MhReJHxeW2Etel1bYS16MC05LV0qJBIWCg5leGNsdWRlX3B1YmxpYxgEIAEoCBIuCgRwYWdlGAUgASgLMiAuYWkuc3RpZ21lci5jb21tb25zLnJwYy5QYWdlSW5mbxIYChBjcm9zc19vcmdfcHVibGljGAYgASgIIvQBCg5TZWFyY2hSZXNwb25zZRIzCgdlbnRyaWVzGAEgAygLMiIuYWkuc3RpZ21lci5zZWFyY2gudjEuU2VhcmNoUmVzdWx0Ek4KDmNvdW50c19ieV9raW5kGAIgAygLMjYuYWkuc3RpZ21lci5zZWFyY2gudjEuU2VhcmNoUmVzcG9uc2UuQ291bnRzQnlLaW5kRW50cnkSEwoLdG90YWxfY291bnQYAyABKAUSEwoLdG90YWxfcGFnZXMYBCABKAUaMwoRQ291bnRzQnlLaW5kRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgFOgI4ASKZAwoMU2VhcmNoUmVzdWx0Ek0KBGtpbmQYASABKA4yPy5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuYXBpcmVzb3VyY2VraW5kLkFwaVJlc291cmNlS2luZBIKCgJpZBgCIAEoCRIMCgRuYW1lGAMgASgJEgwKBHNsdWcYBCABKAkSFgoOcXVhbGlmaWVkX3NsdWcYBSABKAkSCwoDb3JnGAYgASgJEhMKC2Rlc2NyaXB0aW9uGAcgASgJEkkKCnZpc2liaWxpdHkYCCABKA4yNS5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VWaXNpYmlsaXR5EgwKBHRhZ3MYCSADKAkSLgoKY3JlYXRlZF9hdBgKIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASLgoKdXBkYXRlZF9hdBgLIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASDQoFc2NvcmUYDCABKAISEAoIaWNvbl91cmwYDSABKAliBnByb3RvMw",[i.file_ai_stigmer_commons_apiresource_apiresourcekind_api_resource_kind,a.file_ai_stigmer_commons_apiresource_enum,n.file_ai_stigmer_commons_rpc_pagination,c.file_buf_validate_validate,o.file_google_protobuf_timestamp]),l=(0,r.messageDesc)(s,0);e.s(["SearchRequestSchema",0,l,"file_ai_stigmer_search_v1_io",0,s],798525);var u=e.i(499328),d=e.i(693569);let p=(0,t.fileDesc)("CiBhaS9zdGlnbWVyL3NlYXJjaC92MS9xdWVyeS5wcm90bxIUYWkuc3RpZ21lci5zZWFyY2gudjEyagoNU2VhcmNoU2VydmljZRJZCgZzZWFyY2gSIy5haS5zdGlnbWVyLnNlYXJjaC52MS5TZWFyY2hSZXF1ZXN0GiQuYWkuc3RpZ21lci5zZWFyY2gudjEuU2VhcmNoUmVzcG9uc2UiBNC4GAFiBnByb3RvMw",[d.file_ai_stigmer_commons_rpc_method_options,s]),m=(0,u.serviceDesc)(p,0);e.s(["SearchService",0,m],301218)},992999,e=>{"use strict";var t=e.i(910304),r=e.i(292558),i=e.i(891287),a=e.i(338300),n=e.i(243176),c=e.i(779805),o=e.i(57674),s=e.i(538634),l=e.i(711961),u=e.i(621559),d=e.i(170255),p=e.i(459153),m=e.i(421415),g=e.i(85849),h=e.i(798525),v=e.i(301218);function b(e){return Object.assign((0,i.create)(l.ToolApprovalOverrideSchema),(0,r.stripUndefined)({toolName:e.toolName,requiresApproval:e.requiresApproval,message:e.message}))}function f(e){let t=(0,i.create)(l.McpServerUsageSchema);return(e.mcpServerRef?.slug||e.mcpServerRef?.org)&&(t.mcpServerRef=(0,i.create)(p.ApiResourceReferenceSchema,{...e.mcpServerRef,kind:44})),e.enabledTools&&(t.enabledTools=e.enabledTools),e.toolApprovalOverrides&&(t.toolApprovalOverrides=e.toolApprovalOverrides.map(b)),t}function y(e){return Object.assign((0,i.create)(l.McpAccessSchema),(0,r.stripUndefined)({mcpServer:e.mcpServer,enabledTools:e.enabledTools}))}function A(e){let t=(0,i.create)(l.SubAgentSchema);return void 0!==e.name&&(t.name=e.name),void 0!==e.description&&(t.description=e.description),void 0!==e.instructions&&(t.instructions=e.instructions),e.mcpAccess&&(t.mcpAccess=e.mcpAccess.map(y)),e.skillRefs&&(t.skillRefs=e.skillRefs.map(e=>(0,i.create)(p.ApiResourceReferenceSchema,{...e,kind:43}))),void 0!==e.modelOverride&&(t.modelOverride=e.modelOverride),t}function S(e){let t,a=e.mcpServerUsages?.map(f),c=e.skillRefs?.map(e=>(0,i.create)(p.ApiResourceReferenceSchema,{...e,kind:43})),o=e.subAgents?.map(A);return e.env&&(t=Object.fromEntries(Object.entries(e.env).map(([e,t])=>[e,Object.assign((0,i.create)(u.EnvVarDeclarationSchema),(0,r.stripUndefined)({isSecret:t.isSecret,description:t.description,optional:t.optional}))]))),Object.assign((0,i.create)(n.AgentSchema),{apiVersion:"agentic.stigmer.ai/v1",kind:"Agent",metadata:Object.assign((0,i.create)(m.ApiResourceMetadataSchema),{...e.id&&{id:e.id},name:e.name,org:e.org,...e.slug&&{slug:e.slug},...e.labels&&{labels:e.labels},...e.visibility&&{visibility:e.visibility}}),spec:Object.assign((0,i.create)(l.AgentSpecSchema),(0,r.stripUndefined)({description:e.description,iconUrl:e.iconUrl,instructions:e.instructions,mcpServerUsages:a,skillRefs:c,subAgents:o,env:t}))})}function _(e){return{toolName:e.toolName||void 0,requiresApproval:e.requiresApproval||void 0,message:e.message||void 0}}function E(e){return{mcpServerRef:(0,r.toResourceRefInput)(e.mcpServerRef)??{org:"",slug:""},enabledTools:e.enabledTools?.length?[...e.enabledTools]:void 0,toolApprovalOverrides:e.toolApprovalOverrides?.length?e.toolApprovalOverrides.map(_):void 0}}function V(e){return{mcpServer:e.mcpServer??"",enabledTools:e.enabledTools?.length?[...e.enabledTools]:void 0}}function w(e){return{name:e.name??"",description:e.description||void 0,instructions:e.instructions||void 0,mcpAccess:e.mcpAccess?.length?e.mcpAccess.map(V):void 0,skillRefs:(0,r.toResourceRefInputs)(e.skillRefs),modelOverride:e.modelOverride||void 0}}e.s(["AgentClient",0,class{command;query;search;constructor(e){this.command=(0,a.createClient)(c.AgentCommandController,e),this.query=(0,a.createClient)(s.AgentQueryController,e),this.search=(0,a.createClient)(v.SearchService,e)}async apply(e){try{return await this.command.apply(S(e))}catch(e){throw(0,t.wrapError)(e)}}async create(e){try{return await this.command.create(S(e))}catch(e){throw(0,t.wrapError)(e)}}async update(e){try{return await this.command.update(S(e))}catch(e){throw(0,t.wrapError)(e)}}async updateVisibility(e){try{return await this.command.updateVisibility(e)}catch(e){throw(0,t.wrapError)(e)}}async delete(e){try{return await this.command.delete((0,i.create)(o.AgentIdSchema,{value:e}))}catch(e){throw(0,t.wrapError)(e)}}async get(e){try{return await this.query.get((0,i.create)(o.AgentIdSchema,{value:e}))}catch(e){throw(0,t.wrapError)(e)}}async getByReference(e){try{return await this.query.getByReference((0,i.create)(p.ApiResourceReferenceSchema,{...e,kind:d.ApiResourceKind.agent}))}catch(e){throw(0,t.wrapError)(e)}}async getDefault(e){try{return await this.query.getDefault(e)}catch(e){throw(0,t.wrapError)(e)}}async list(e){try{let t=await this.search.search((0,i.create)(h.SearchRequestSchema,{kinds:[d.ApiResourceKind.agent],query:e.query,org:e.org,excludePublic:e.excludePublic??!1,crossOrgPublic:e.crossOrgPublic??!1,page:e.page?(0,i.create)(g.PageInfoSchema,e.page):void 0}));return{entries:t.entries,totalCount:t.totalCount,totalPages:t.totalPages}}catch(e){throw(0,t.wrapError)(e)}}},"buildAgentProto",0,S,"toAgentUpdateInput",0,function(e){let t=e.metadata,a=e.spec??(0,i.create)(l.AgentSpecSchema);return{id:t?.id||void 0,name:t?.name??"",slug:t?.slug||void 0,org:t?.org??"",labels:t?.labels&&Object.keys(t.labels).length>0?{...t.labels}:void 0,visibility:t?.visibility||void 0,description:a.description||void 0,iconUrl:a.iconUrl||void 0,instructions:a.instructions||void 0,mcpServerUsages:a.mcpServerUsages?.length?a.mcpServerUsages.map(E):void 0,skillRefs:(0,r.toResourceRefInputs)(a.skillRefs),subAgents:a.subAgents?.length?a.subAgents.map(w):void 0,env:Object.keys(a.env??{}).length>0?Object.fromEntries(Object.entries(a.env).map(([e,t])=>[e,{isSecret:t.isSecret||void 0,description:t.description||void 0,optional:t.optional||void 0}])):void 0}}])},960511,e=>{"use strict";var t,r,i,a,n,c,o,s,l,u,d,p,m,g,h,v;e.i(113024);let b=(0,e.i(424407).fileDesc)("CiBhaS9zdGlnbWVyL2JpbGxpbmcvdjEvZW51bS5wcm90bxIVYWkuc3RpZ21lci5iaWxsaW5nLnYxKrYCCg9MZWRnZXJFbnRyeVR5cGUSIQodbGVkZ2VyX2VudHJ5X3R5cGVfdW5zcGVjaWZpZWQQABITCg9wdXJjaGFzZV9jcmVkaXQQARIWChJwcm9tb3Rpb25hbF9jcmVkaXQQAhIPCgt1c2FnZV9kZWJpdBADEhQKEHJlc2VydmF0aW9uX2hvbGQQBBIXChNyZXNlcnZhdGlvbl9yZWxlYXNlEAUSFQoRYWRqdXN0bWVudF9jcmVkaXQQBhIUChBhZGp1c3RtZW50X2RlYml0EAcSEwoPcmVmdW5kX3JldmVyc2FsEAgSEAoMZGlzcHV0ZV9ob2xkEAkSEwoPZGlzcHV0ZV9yZWxlYXNlEAoSEAoMZXhwaXJ5X2RlYml0EAsSGAoUYXV0b19yZWNoYXJnZV9jcmVkaXQQDCpECgpMZWRnZXJWaWV3EhsKF2xlZGdlcl92aWV3X3Vuc3BlY2lmaWVkEAASGQoVbGVkZ2VyX3ZpZXdfc3RhdGVtZW50EAEqZAoPQ3JlZGl0R3JhbnRLaW5kEiEKHWNyZWRpdF9ncmFudF9raW5kX3Vuc3BlY2lmaWVkEAASDQoJcHVyY2hhc2VkEAESDwoLcHJvbW90aW9uYWwQAhIOCgphZGp1c3RtZW50EAMqlQEKFEJpbGxpbmdBY2NvdW50U3RhdHVzEiYKImJpbGxpbmdfYWNjb3VudF9zdGF0dXNfdW5zcGVjaWZpZWQQABIaChZiaWxsaW5nX2FjY291bnRfYWN0aXZlEAESHQoZYmlsbGluZ19hY2NvdW50X3N1c3BlbmRlZBACEhoKFmJpbGxpbmdfYWNjb3VudF9jbG9zZWQQAyqeAQoRUmVzZXJ2YXRpb25TdGF0dXMSIgoecmVzZXJ2YXRpb25fc3RhdHVzX3Vuc3BlY2lmaWVkEAASFgoScmVzZXJ2YXRpb25fYWN0aXZlEAESGQoVcmVzZXJ2YXRpb25fZmluYWxpemVkEAISFwoTcmVzZXJ2YXRpb25fZXhwaXJlZBADEhkKFXJlc2VydmF0aW9uX2NhbmNlbGxlZBAEKocBChZFeGVjdXRpb25CaWxsaW5nU2lnbmFsEigKJGV4ZWN1dGlvbl9iaWxsaW5nX3NpZ25hbF91bnNwZWNpZmllZBAAEhYKEmNvbnRpbnVlX2V4ZWN1dGlvbhABEhcKE2xvd19iYWxhbmNlX3dhcm5pbmcQAhISCg5zdG9wX2V4ZWN1dGlvbhADKrMBChRDcmVkaXRQdXJjaGFzZVN0YXR1cxImCiJjcmVkaXRfcHVyY2hhc2Vfc3RhdHVzX3Vuc3BlY2lmaWVkEAASGwoXY3JlZGl0X3B1cmNoYXNlX3BlbmRpbmcQARIdChljcmVkaXRfcHVyY2hhc2VfY29tcGxldGVkEAISGgoWY3JlZGl0X3B1cmNoYXNlX2ZhaWxlZBADEhsKF2NyZWRpdF9wdXJjaGFzZV9leHBpcmVkEAQqlwEKF0F1dG9SZWNoYXJnZUV2ZW50U3RhdHVzEioKJmF1dG9fcmVjaGFyZ2VfZXZlbnRfc3RhdHVzX3Vuc3BlY2lmaWVkEAASGQoVYXV0b19yZWNoYXJnZV9wZW5kaW5nEAESGwoXYXV0b19yZWNoYXJnZV9zdWNjZWVkZWQQAhIYChRhdXRvX3JlY2hhcmdlX2ZhaWxlZBADYgZwcm90bzM");(l=t||(t={}))[l.ledger_entry_type_unspecified=0]="ledger_entry_type_unspecified",l[l.purchase_credit=1]="purchase_credit",l[l.promotional_credit=2]="promotional_credit",l[l.usage_debit=3]="usage_debit",l[l.reservation_hold=4]="reservation_hold",l[l.reservation_release=5]="reservation_release",l[l.adjustment_credit=6]="adjustment_credit",l[l.adjustment_debit=7]="adjustment_debit",l[l.refund_reversal=8]="refund_reversal",l[l.dispute_hold=9]="dispute_hold",l[l.dispute_release=10]="dispute_release",l[l.expiry_debit=11]="expiry_debit",l[l.auto_recharge_credit=12]="auto_recharge_credit",(u=r||(r={}))[u.unspecified=0]="unspecified",u[u.statement=1]="statement",(d=i||(i={}))[d.credit_grant_kind_unspecified=0]="credit_grant_kind_unspecified",d[d.purchased=1]="purchased",d[d.promotional=2]="promotional",d[d.adjustment=3]="adjustment",(p=a||(a={}))[p.billing_account_status_unspecified=0]="billing_account_status_unspecified",p[p.billing_account_active=1]="billing_account_active",p[p.billing_account_suspended=2]="billing_account_suspended",p[p.billing_account_closed=3]="billing_account_closed",(m=n||(n={}))[m.reservation_status_unspecified=0]="reservation_status_unspecified",m[m.reservation_active=1]="reservation_active",m[m.reservation_finalized=2]="reservation_finalized",m[m.reservation_expired=3]="reservation_expired",m[m.reservation_cancelled=4]="reservation_cancelled",(g=c||(c={}))[g.execution_billing_signal_unspecified=0]="execution_billing_signal_unspecified",g[g.continue_execution=1]="continue_execution",g[g.low_balance_warning=2]="low_balance_warning",g[g.stop_execution=3]="stop_execution",(h=o||(o={}))[h.credit_purchase_status_unspecified=0]="credit_purchase_status_unspecified",h[h.credit_purchase_pending=1]="credit_purchase_pending",h[h.credit_purchase_completed=2]="credit_purchase_completed",h[h.credit_purchase_failed=3]="credit_purchase_failed",h[h.credit_purchase_expired=4]="credit_purchase_expired",(v=s||(s={}))[v.auto_recharge_event_status_unspecified=0]="auto_recharge_event_status_unspecified",v[v.auto_recharge_pending=1]="auto_recharge_pending",v[v.auto_recharge_succeeded=2]="auto_recharge_succeeded",v[v.auto_recharge_failed=3]="auto_recharge_failed",e.s(["BillingAccountStatus",0,a,"LedgerEntryType",0,t,"LedgerView",0,r,"file_ai_stigmer_billing_v1_enum",0,b])},577817,400553,707125,e=>{"use strict";var t=e.i(424407),r=e.i(304532),i=e.i(125322),a=e.i(421415),n=e.i(988158),c=e.i(761867);let o=(0,t.fileDesc)("CidhaS9zdGlnbWVyL2FnZW50aWMvc2Vzc2lvbi92MS9hcGkucHJvdG8SHWFpLnN0aWdtZXIuYWdlbnRpYy5zZXNzaW9uLnYxIqsCCgdTZXNzaW9uEjEKC2FwaV92ZXJzaW9uGAEgASgJQhy6SBlyFwoVYWdlbnRpYy5zdGlnbWVyLmFpL3YxEhwKBGtpbmQYAiABKAlCDrpIC3IJCgdTZXNzaW9uEk0KCG1ldGFkYXRhGAMgASgLMjMuYWkuc3RpZ21lci5jb21tb25zLmFwaXJlc291cmNlLkFwaVJlc291cmNlTWV0YWRhdGFCBrpIA8gBARI4CgRzcGVjGAQgASgLMiouYWkuc3RpZ21lci5hZ2VudGljLnNlc3Npb24udjEuU2Vzc2lvblNwZWMSRgoGc3RhdHVzGAUgASgLMjYuYWkuc3RpZ21lci5jb21tb25zLmFwaXJlc291cmNlLkFwaVJlc291cmNlQXVkaXRTdGF0dXNiBnByb3RvMw",[i.file_ai_stigmer_agentic_session_v1_spec,a.file_ai_stigmer_commons_apiresource_metadata,n.file_ai_stigmer_commons_apiresource_status,c.file_buf_validate_validate]),s=(0,r.messageDesc)(o,0);e.s(["SessionSchema",0,s,"file_ai_stigmer_agentic_session_v1_api",0,o],400553);let l=(0,t.fileDesc)("CiZhaS9zdGlnbWVyL2FnZW50aWMvc2Vzc2lvbi92MS9pby5wcm90bxIdYWkuc3RpZ21lci5hZ2VudGljLnNlc3Npb24udjEiIgoJU2Vzc2lvbklkEhUKBXZhbHVlGAEgASgJQga6SAPIAQEiIAoHQWdlbnRJZBIVCgV2YWx1ZRgBIAEoCUIGukgDyAEBIlsKC1Nlc3Npb25MaXN0EhMKC3RvdGFsX3BhZ2VzGAEgASgFEjcKB2VudHJpZXMYAiADKAsyJi5haS5zdGlnbWVyLmFnZW50aWMuc2Vzc2lvbi52MS5TZXNzaW9uIkoKE0xpc3RTZXNzaW9uc1JlcXVlc3QSEQoJcGFnZV9zaXplGAEgASgFEhIKCnBhZ2VfdG9rZW4YAiABKAkSDAoEdGFncxgDIAMoCSJuCiJMaXN0U2Vzc2lvbnNCeUFnZW50SW5zdGFuY2VSZXF1ZXN0EiEKEWFnZW50X2luc3RhbmNlX2lkGAEgASgJQga6SAPIAQESEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkiYQocTGlzdFNlc3Npb25zQnlDaGFubmVsUmVxdWVzdBIaCgpjaGFubmVsX2lkGAEgASgJQga6SAPIAQESEQoJcGFnZV9zaXplGAIgASgFEhIKCnBhZ2VfdG9rZW4YAyABKAkiQgobVXBkYXRlU2Vzc2lvblN1YmplY3RSZXF1ZXN0EhIKAmlkGAEgASgJQga6SAPIAQESDwoHc3ViamVjdBgCIAEoCWIGcHJvdG8z",[o,c.file_buf_validate_validate]),u=(0,r.messageDesc)(l,0),d=(0,r.messageDesc)(l,5);e.s(["ListSessionsByChannelRequestSchema",0,d,"SessionIdSchema",0,u,"file_ai_stigmer_agentic_session_v1_io",0,l],577817);var p=e.i(247167);let m="https://api.stigmer.com/",g=null;async function h(){if(g)return g;let e=await v()??{apiUrl:p.default.env.NEXT_PUBLIC_API_URL??"http://localhost:7234",appUrl:p.default.env.NEXT_PUBLIC_APP_URL??"",authMode:f(p.default.env.NEXT_PUBLIC_AUTH_MODE),oidcIssuer:p.default.env.NEXT_PUBLIC_OIDC_ISSUER??"",oidcClientId:p.default.env.NEXT_PUBLIC_OIDC_CLIENT_ID??"",oidcAudience:p.default.env.NEXT_PUBLIC_OIDC_AUDIENCE??m};return"oidc"===e.authMode&&function(e){if(!e.oidcClientId)throw Error("This server requires sign-in, but no OIDC client is configured for the console. Set STIGMER_OIDC_CONSOLE_CLIENT_ID on the server (or NEXT_PUBLIC_OIDC_CLIENT_ID for a container build) to the public PKCE client you registered for the console at your identity provider.");let t=[];if(e.oidcIssuer||t.push("oidcIssuer (NEXT_PUBLIC_OIDC_ISSUER)"),e.oidcAudience||t.push("oidcAudience (NEXT_PUBLIC_OIDC_AUDIENCE)"),t.length>0)throw Error(`Auth mode is "oidc" but required fields are missing: ${t.join(", ")}. Check /config.json (container) or NEXT_PUBLIC_* env vars (.env).`)}(e),g=Object.freeze(e)}async function v(){try{let e=await fetch("/config.json");if(!e.ok)return null;let t=await e.json();return{apiUrl:b(t.apiUrl,window.location.origin),appUrl:b(t.appUrl,""),authMode:f(t.authMode),oidcIssuer:b(t.oidcIssuer,""),oidcClientId:b(t.oidcClientId,""),oidcAudience:b(t.oidcAudience,m)}}catch{return null}}function b(e,t){return"string"==typeof e&&e.length>0?e:t}function f(e){return"oidc"===e?"oidc":"disabled"}e.s(["getRuntimeConfig",0,function(){if(!g)throw Error("getRuntimeConfig() called before loadRuntimeConfig(). Ensure <ConfigGate> wraps the component tree.");return g},"loadRuntimeConfig",0,h],707125)},472402,e=>{"use strict";var t=e.i(707125);e.s(["getApiBaseUrl",0,function(){return(0,t.getRuntimeConfig)().apiUrl},"getAppBaseUrl",0,function(){let e=(0,t.getRuntimeConfig)().appUrl;return e?e.replace(/\/$/,""):window.location.origin}])}]);
|