@stigmer/server-slim 3.40.0 → 3.40.1
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/01hep6fbspt.0.js +1 -0
- package/console/_next/static/chunks/05uzu4-_sp1yp.js +1 -0
- package/console/_next/static/chunks/{12i_a9yn.gms7.js → 072g980hrxnyl.js} +1 -1
- package/console/_next/static/chunks/0rh6tj~41xah0.js +34 -0
- package/console/_next/static/chunks/0s7rm5b3t2blp.js +1 -0
- package/console/_next/static/chunks/0xy23zns071f6.js +1 -0
- package/console/_next/static/chunks/161o._k~z2-bu.js +1 -0
- 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/desktop/billing/__next._full.txt +16 -16
- package/console/desktop/billing/__next._head.txt +4 -4
- package/console/desktop/billing/__next._index.txt +9 -9
- package/console/desktop/billing/__next._tree.txt +1 -1
- package/console/desktop/billing/__next.desktop.billing.__PAGE__.txt +4 -4
- package/console/desktop/billing/__next.desktop.billing.txt +3 -3
- package/console/desktop/billing/__next.desktop.txt +3 -3
- package/console/desktop/billing.html +1 -1
- package/console/desktop/billing.txt +16 -16
- 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 +15 -15
- 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 +15 -15
- 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/plugins/__next._full.txt +17 -17
- package/console/library/plugins/__next._head.txt +4 -4
- package/console/library/plugins/__next._index.txt +9 -9
- package/console/library/plugins/__next._tree.txt +1 -1
- package/console/library/plugins/__next.library.plugins.__PAGE__.txt +3 -3
- package/console/library/plugins/__next.library.plugins.txt +3 -3
- package/console/library/plugins/__next.library.txt +5 -5
- package/console/library/plugins/__placeholder__/__placeholder__/__next._full.txt +17 -17
- package/console/library/plugins/__placeholder__/__placeholder__/__next._head.txt +4 -4
- package/console/library/plugins/__placeholder__/__placeholder__/__next._index.txt +9 -9
- package/console/library/plugins/__placeholder__/__placeholder__/__next._tree.txt +1 -1
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.__PAGE__.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.$d$slug.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.$d$org.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.plugins.txt +3 -3
- package/console/library/plugins/__placeholder__/__placeholder__/__next.library.txt +5 -5
- package/console/library/plugins/__placeholder__/__placeholder__.html +1 -1
- package/console/library/plugins/__placeholder__/__placeholder__.txt +17 -17
- package/console/library/plugins/upload/__next._full.txt +18 -18
- package/console/library/plugins/upload/__next._head.txt +4 -4
- package/console/library/plugins/upload/__next._index.txt +9 -9
- package/console/library/plugins/upload/__next._tree.txt +1 -1
- package/console/library/plugins/upload/__next.library.plugins.txt +3 -3
- package/console/library/plugins/upload/__next.library.plugins.upload.__PAGE__.txt +4 -4
- package/console/library/plugins/upload/__next.library.plugins.upload.txt +3 -3
- package/console/library/plugins/upload/__next.library.txt +5 -5
- package/console/library/plugins/upload.html +1 -1
- package/console/library/plugins/upload.txt +18 -18
- package/console/library/plugins.html +1 -1
- package/console/library/plugins.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 +16 -16
- 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 +16 -16
- package/console/marketplace/__next._full.txt +15 -15
- package/console/marketplace/__next._head.txt +4 -4
- package/console/marketplace/__next._index.txt +9 -9
- package/console/marketplace/__next._tree.txt +1 -1
- package/console/marketplace/__next.marketplace.__PAGE__.txt +3 -3
- package/console/marketplace/__next.marketplace.txt +3 -3
- package/console/marketplace.html +1 -1
- package/console/marketplace.txt +15 -15
- 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 +18 -18
- 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 +18 -18
- 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/licenses/__next._full.txt +18 -18
- package/console/settings/licenses/__next._head.txt +4 -4
- package/console/settings/licenses/__next._index.txt +9 -9
- package/console/settings/licenses/__next._tree.txt +1 -1
- package/console/settings/licenses/__next.settings.licenses.__PAGE__.txt +4 -4
- package/console/settings/licenses/__next.settings.licenses.txt +3 -3
- package/console/settings/licenses/__next.settings.txt +5 -5
- package/console/settings/licenses.html +1 -1
- package/console/settings/licenses.txt +18 -18
- 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/plans/__next._full.txt +18 -18
- package/console/settings/plans/__next._head.txt +4 -4
- package/console/settings/plans/__next._index.txt +9 -9
- package/console/settings/plans/__next._tree.txt +1 -1
- package/console/settings/plans/__next.settings.plans.__PAGE__.txt +4 -4
- package/console/settings/plans/__next.settings.plans.txt +3 -3
- package/console/settings/plans/__next.settings.txt +5 -5
- package/console/settings/plans.html +1 -1
- package/console/settings/plans.txt +18 -18
- 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/teams/__next._full.txt +17 -17
- package/console/settings/teams/__next._head.txt +4 -4
- package/console/settings/teams/__next._index.txt +9 -9
- package/console/settings/teams/__next._tree.txt +1 -1
- package/console/settings/teams/__next.settings.teams.__PAGE__.txt +3 -3
- package/console/settings/teams/__next.settings.teams.txt +3 -3
- package/console/settings/teams/__next.settings.txt +5 -5
- package/console/settings/teams.html +1 -1
- package/console/settings/teams.txt +17 -17
- 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 +2 -2
- package/package.json +6 -6
- package/console/_next/static/chunks/01t5bq-0-a_i1.js +0 -1
- package/console/_next/static/chunks/034-2xp~e539n.js +0 -1
- package/console/_next/static/chunks/0lq22-4n7_uyt.js +0 -34
- package/console/_next/static/chunks/0m94l3p58m6us.js +0 -1
- package/console/_next/static/chunks/0ruvic3m1tid0.js +0 -1
- package/console/_next/static/chunks/0vx4g_lnlck8u.js +0 -1
- /package/console/_next/static/{HRj8nfJ74nB80EJaNY136 → 8QW0GR8B_i8LjUXDFgwS7}/_buildManifest.js +0 -0
- /package/console/_next/static/{HRj8nfJ74nB80EJaNY136 → 8QW0GR8B_i8LjUXDFgwS7}/_clientMiddlewareManifest.js +0 -0
- /package/console/_next/static/{HRj8nfJ74nB80EJaNY136 → 8QW0GR8B_i8LjUXDFgwS7}/_ssgManifest.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stigmer/server-slim",
|
|
3
|
-
"version": "3.40.
|
|
3
|
+
"version": "3.40.1",
|
|
4
4
|
"description": "Self-contained build of the Stigmer TypeScript control plane, launched by the stigmer CLI's local stack",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"@grpc/grpc-js": "^1.14.4"
|
|
12
12
|
},
|
|
13
13
|
"optionalDependencies": {
|
|
14
|
-
"@stigmer/server-slim-darwin-arm64": "3.40.
|
|
15
|
-
"@stigmer/server-slim-darwin-x64": "3.40.
|
|
16
|
-
"@stigmer/server-slim-linux-x64": "3.40.
|
|
17
|
-
"@stigmer/server-slim-linux-arm64": "3.40.
|
|
18
|
-
"@stigmer/server-slim-win32-x64": "3.40.
|
|
14
|
+
"@stigmer/server-slim-darwin-arm64": "3.40.1",
|
|
15
|
+
"@stigmer/server-slim-darwin-x64": "3.40.1",
|
|
16
|
+
"@stigmer/server-slim-linux-x64": "3.40.1",
|
|
17
|
+
"@stigmer/server-slim-linux-arm64": "3.40.1",
|
|
18
|
+
"@stigmer/server-slim-win32-x64": "3.40.1"
|
|
19
19
|
},
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52595,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976);function n({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 3v10M3 8h10"})})}function i({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4M12.667 4v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4"})})}function a(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["InlineEditKeyValue",0,function({value:e,onSave:o,keyLabel:g="Key",showValue:l=!1,valueLabel:d="Value",showSecretToggle:c=!1,showOptionalToggle:u=!1,showDescription:x=!1,editing:m,onEditingChange:p,disabled:h,isSaving:f,error:v,className:b}){let[j,N]=(0,s.useState)(!1),y=m??j,k=(0,s.useCallback)(e=>{N(e),p?.(e)},[p]);(0,s.useEffect)(()=>{void 0!==m&&N(m)},[m]);let[C,S]=(0,s.useState)([...e]);(0,s.useCallback)(()=>{S([...e]),k(!0)},[e,k]);let w=(0,s.useCallback)(()=>{k(!1),S([...e])},[e,k]),O=(0,s.useCallback)(async()=>{let e=C.filter(e=>e.key.trim());await o(e)&&k(!1)},[C,o,k]),A=(0,s.useCallback)((e,t)=>{S(s=>s.map((s,r)=>r===e?{...s,...t}:s))},[]),E=(0,s.useCallback)(e=>{S(t=>t.filter((t,s)=>s!==e))},[]),L=(0,s.useCallback)(()=>{S(e=>[...e,{key:"",value:"",isSecret:!1,description:""}])},[]);return h||!y?(0,t.jsx)("div",{className:(0,r.cn)("stg:flex stg:flex-col",b),children:e.length>0?(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:e.map(e=>(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3 stg:px-3 stg:py-2.5",children:[(0,t.jsx)("code",{className:"stg:shrink-0 stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e.key}),l&&(0,t.jsx)("span",{className:"stg:min-w-0 stg:break-all stg:font-mono stg:text-xs stg:text-muted-foreground",children:e.value}),c&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",children:e.isSecret?"secret":"config"}),u&&e.optional&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground-subtle",children:"optional"}),e.description&&(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:e.description})]},e.key))}):(0,t.jsx)("p",{className:"stg:px-3 stg:py-3 stg:text-xs stg:text-muted-foreground stg:italic",children:"No entries"})}):(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-3",b),children:[C.map((e,s)=>(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:rounded-md stg:border stg:border-border stg:bg-muted-faint stg:p-2.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-1 stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("input",{type:"text",value:e.key,onChange:e=>A(s,{key:e.target.value}),placeholder:g,className:(0,r.cn)("stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:font-mono stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring")}),l&&(0,t.jsx)("input",{type:"text",value:e.value,onChange:e=>A(s,{value:e.target.value}),placeholder:d,className:(0,r.cn)("stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:font-mono stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring")}),x&&(0,t.jsx)("input",{type:"text",value:e.description??"",onChange:e=>A(s,{description:e.target.value}),placeholder:"Description",className:(0,r.cn)("stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:text-xs stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring")}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-3",children:[c&&(0,t.jsxs)("label",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-muted-foreground stg:cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.isSecret??!1,onChange:e=>A(s,{isSecret:e.target.checked}),className:"stg:size-3.5 stg:rounded stg:border-border"}),"Secret"]}),u&&(0,t.jsxs)("label",{className:"stg:inline-flex stg:items-center stg:gap-1.5 stg:text-xs stg:text-muted-foreground stg:cursor-pointer",children:[(0,t.jsx)("input",{type:"checkbox",checked:e.optional??!1,onChange:e=>A(s,{optional:e.target.checked}),className:"stg:size-3.5 stg:rounded stg:border-border"}),"Optional"]})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>E(s),"aria-label":`Remove ${e.key||"entry"}`,className:(0,r.cn)("stg:mt-1 stg:inline-flex stg:size-6 stg:items-center stg:justify-center stg:rounded-md stg:text-muted-foreground","stg:hover:bg-destructive-subtle stg:hover:text-destructive","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(i,{className:"stg:size-3.5"})})]},s)),(0,t.jsxs)("button",{type:"button",onClick:L,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border stg:border-dashed stg:border-border stg:text-muted-foreground","stg:hover:border-muted-foreground stg:hover:text-foreground stg:hover:bg-muted-subtle","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:transition-colors"),children:[(0,t.jsx)(n,{className:"stg:size-3"}),"Add entry"]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-1.5",children:[(0,t.jsx)("button",{type:"button",onClick:w,disabled:f,className:(0,r.cn)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,t.jsxs)("button",{type:"button",onClick:O,disabled:f,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:[f&&(0,t.jsx)(a,{}),"Save changes"]})]}),v&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:v})]})}])},81346,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976);function n({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function i({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m3 8.5 3.5 3.5 6.5-8"})})}function a({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}function o({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1.5"}),(0,t.jsx)("circle",{cx:"5.5",cy:"5.5",r:"1"}),(0,t.jsx)("path",{d:"m14 10.5-3-3L4 14"})]})}function g(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["InlineEditImage",0,function({value:e,onSave:l,fallback:d,size:c="md",disabled:u,isSaving:x,error:m,className:p}){let[h,f]=(0,s.useState)(!1),[v,b]=(0,s.useState)(e),[j,N]=(0,s.useState)(null),y=(0,s.useRef)(null);(0,s.useEffect)(()=>{h&&(b(e),N(null),requestAnimationFrame(()=>y.current?.focus()))},[h,e]);let k=(0,s.useCallback)(async()=>{let t=v.trim();t===e?f(!1):t&&!function(e){try{return new URL(e),!0}catch{return!1}}(t)?N("Enter a valid URL"):await l(t)&&f(!1)},[v,e,l]),C=(0,s.useCallback)(()=>{f(!1),b(e),N(null)},[e]),S=(0,s.useCallback)(e=>{"Enter"===e.key?(e.preventDefault(),k()):"Escape"===e.key&&C()},[k,C]),w="sm"===c?"stg:size-6":"stg:size-8",O=j||m;return u||!h?(0,t.jsx)("div",{className:(0,r.cn)("stg:group/inline-edit stg:inline-flex",p),children:(0,t.jsxs)("button",{type:"button",onClick:()=>{u||f(!0)},disabled:u,className:(0,r.cn)("stg:relative stg:rounded-md stg:p-0.5 stg:transition-colors",!u&&"stg:hover:bg-accent-hover stg:cursor-pointer","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),"aria-label":"Change icon",children:[e?(0,t.jsx)("img",{src:e,alt:"",className:(0,r.cn)(w,"stg:shrink-0 stg:rounded stg:object-cover")}):d??(0,t.jsx)(o,{className:(0,r.cn)(w,"stg:text-muted-foreground")}),!u&&(0,t.jsx)("span",{className:"stg:absolute stg:-bottom-0.5 stg:-right-0.5 stg:flex stg:size-4 stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100",children:(0,t.jsx)(n,{className:"stg:size-2.5"})})]})}):(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-1",p),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("input",{ref:y,type:"url",value:v,onChange:e=>{b(e.target.value),N(null)},onKeyDown:S,disabled:x,placeholder:"https://example.com/icon.png",className:(0,r.cn)("stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50",O&&"stg:border-destructive")}),(0,t.jsx)("button",{type:"button",onClick:k,disabled:x,"aria-label":"Save",className:(0,r.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:x?(0,t.jsx)(g,{}):(0,t.jsx)(i,{className:"stg:size-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:C,disabled:x,"aria-label":"Cancel",className:(0,r.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,t.jsx)(a,{className:"stg:size-3.5"})}),v&&(0,t.jsx)("button",{type:"button",onClick:()=>b(""),disabled:x,"aria-label":"Clear",className:"stg:text-xs stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground",children:"Clear"})]}),O&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:O})]})}])},674542,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),n=e.i(610595),i=e.i(17616),a=e.i(336973),o=e.i(498931),g=e.i(727996),l=e.i(586108),d=e.i(326283),c=e.i(78946),u=e.i(862645),x=e.i(153158),m=e.i(168197),p=e.i(844533),h=e.i(801731),f=e.i(793907),v=e.i(388894),b=e.i(651424),j=e.i(379410);function N({providerName:e,vendorDocsUrl:i,onSubmit:a,onCancel:o,isSubmitting:g,error:l,className:d}){let[c,u]=(0,s.useState)(""),[x,m]=(0,s.useState)(""),[p,h]=(0,s.useState)(!1),f=(0,s.useId)(),v=`${f}-client-id`,b=`${f}-client-secret`,S=c.trim().length>0&&x.trim().length>0,w=(0,s.useCallback)(async e=>{e.preventDefault(),S&&!g&&await a(c.trim(),x.trim())},[S,g,a,c,x]);return(0,t.jsxs)("form",{onSubmit:w,className:(0,r.cn)("stg:flex stg:flex-col stg:gap-4",d),children:[(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsxs)("p",{className:"stg:text-sm stg:text-foreground",children:["Register an OAuth app with"," ",(0,t.jsx)("span",{className:"stg:font-medium",children:e})," and enter your credentials below."]}),i&&(0,t.jsxs)("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:text-primary stg:underline stg:decoration-primary/40 stg:underline-offset-2 stg:hover:decoration-primary",children:[e," OAuth app registration",(0,t.jsx)(y,{className:"stg:size-3 stg:shrink-0"})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-3",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("label",{htmlFor:v,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Client ID"}),(0,t.jsx)("input",{id:v,type:"text",value:c,onChange:e=>u(e.target.value),disabled:g,required:!0,"aria-required":!0,autoComplete:"off",autoFocus:!0,placeholder:"e.g. 1234567890abcdef",className:(0,r.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-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,t.jsx)("label",{htmlFor:b,className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Client Secret"}),(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("input",{id:b,type:p?"text":"password",value:x,onChange:e=>m(e.target.value),disabled:g,required:!0,"aria-required":!0,autoComplete:"off",placeholder:"Your client secret",className:(0,r.cn)("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:pr-8 stg:text-xs stg:text-foreground","stg:placeholder:text-muted-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50")}),(0,t.jsx)("button",{type:"button",onClick:()=>h(e=>!e),disabled:g,className:(0,r.cn)("stg:absolute stg:right-2 stg:top-1/2 stg:-translate-y-1/2","stg:text-muted-foreground stg:hover:text-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":p?"Hide client secret":"Show client secret",tabIndex:-1,children:p?(0,t.jsx)(C,{}):(0,t.jsx)(k,{})})]})]})]}),l&&(0,t.jsx)("div",{role:"alert",className:"stg:rounded-md stg:border stg:border-destructive/30 stg:bg-destructive-subtle stg:px-2.5 stg:py-2 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(l)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-2",children:[(0,t.jsx)("button",{type:"button",onClick:o,disabled:g,className:(0,r.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"}),(0,t.jsxs)("button",{type:"submit",disabled:!S||g,className:(0,r.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:[g&&(0,t.jsx)(j.SpinnerIcon,{size:12}),"Save"]})]})]})}function y({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6 3.5H3.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V10"}),(0,t.jsx)("path",{d:"M9.5 2.5h4v4"}),(0,t.jsx)("path",{d:"M13.5 2.5 8 8"})]})}function k(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"2"})]})}function C(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6.59 6.59a2 2 0 0 0 2.82 2.82"}),(0,t.jsx)("path",{d:"M10.73 10.73A6.5 6.5 0 0 1 8 12.5c-4 0-6.5-4.5-6.5-4.5a11.5 11.5 0 0 1 3.77-3.73"}),(0,t.jsx)("path",{d:"M5.71 3.56A6.3 6.3 0 0 1 8 3.5c4 0 6.5 4.5 6.5 4.5a11.5 11.5 0 0 1-1.28 1.73"}),(0,t.jsx)("path",{d:"M2 2l12 12"})]})}var S=e.i(170255),w=e.i(476007),O=e.i(188482),A=e.i(468806),E=e.i(351240),L=e.i(758960),M=e.i(484763),T=e.i(927056),D=e.i(668093),B=e.i(652337),H=e.i(244990),z=e.i(261722),P=e.i(81346);function I({value:e,options:n,onSave:i,disabled:a,isSaving:o,error:g,className:l}){let[d,c]=(0,s.useState)(!1),u=(0,s.useRef)(null),x=n.find(t=>t.value===e)?.label??e;(0,s.useEffect)(()=>{if(!d)return;let e=e=>{u.current&&!u.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]);let m=(0,s.useCallback)(async t=>{t===e?c(!1):await i(t)&&c(!1)},[e,i]);return a||!d?(0,t.jsx)("div",{className:(0,r.cn)("stg:group/inline-edit",l),children:(0,t.jsxs)("button",{type:"button",onClick:()=>{a||c(!0)},disabled:a,className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-left stg:transition-colors",!a&&"stg:hover:bg-accent-hover stg:cursor-pointer","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("span",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-xs stg:font-medium stg:text-foreground",children:x}),!a&&(0,t.jsx)(R,{className:"stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})}):(0,t.jsxs)("div",{ref:u,className:(0,r.cn)("stg:flex stg:flex-col stg:gap-1",l),children:[(0,t.jsx)("div",{className:"stg:rounded-lg stg:border stg:border-border stg:bg-background stg:p-1",role:"radiogroup",children:n.map(s=>(0,t.jsxs)("button",{type:"button",role:"radio","aria-checked":s.value===e,disabled:o,onClick:()=>m(s.value),className:(0,r.cn)("stg:flex stg:w-full stg:items-start stg:gap-2 stg:rounded-md stg:px-2.5 stg:py-1.5 stg:text-left stg:transition-colors",s.value===e?"stg:bg-muted-subtle stg:text-foreground":"stg:hover:bg-accent-hover stg:text-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,t.jsx)("div",{className:(0,r.cn)("stg:mt-0.5 stg:flex stg:size-4 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:border",s.value===e?"stg:border-primary stg:bg-primary":"stg:border-muted-foreground"),children:s.value===e&&(0,t.jsx)("div",{className:"stg:size-1.5 stg:rounded-full stg:bg-primary-foreground"})}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("span",{className:"stg:text-sm stg:font-medium",children:s.label}),s.description&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:s.description})]}),o&&s.value!==e&&(0,t.jsx)(U,{})]},s.value))}),g&&(0,t.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:g})]})}function R({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 6 4 4 4-4"})})}function U(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}var _=e.i(52595),V=e.i(292420),W=e.i(473489);function $({isConnecting:e,connectionError:i,connectionErrorMessage:o,onConnect:g,onClearConnectionError:l,hasDiscoveredTools:d,isOAuthStranded:c,credentialsLoading:u,oauthPhase:x,authMode:m,isOAuthConnected:p,connectionHealth:h,canDisconnect:v,onDisconnect:b,isDisconnecting:j,disconnectError:N,onClearDisconnectError:y,serverName:k,accessTokenExpiresAt:C,tokenLifetimeHint:S,isVendorApprovalPending:w,isVendorApprovalBlocked:O,vendorApprovalDocsUrl:A,canBringOwnApp:E,isOrgOAuthApp:L,onBringOwnApp:M,onRemoveOrgApp:T,isRemovingOrgApp:D,removeOrgAppError:B,onClearRemoveOrgAppError:H,manualEntrySupported:z,manualOverride:P,onManualOverride:I,onBackToOAuth:R,onCancelOAuth:U}){let[_,V]=(0,s.useState)("idle"),[W,q]=(0,s.useState)("idle"),K="initiating"===x||"awaiting-callback"===x||"completing"===x||"connecting"===x,X="oauth"===m&&!p&&!P,Y=h===a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED,Z=O&&X&&!L,J=e||K||j||D,Q=K?F(x):e?"Connecting...":L&&X?"Sign in with your app":X||Y?"Sign in to connect":c?"Discover tools":d?"Reconnect":"Connect",G=K||e?(0,t.jsx)(eN,{}):X||Y?(0,t.jsx)(eh,{className:"stg:size-3.5"}):d?(0,t.jsx)(eu,{className:"stg:size-3.5"}):(0,t.jsx)(ec,{className:"stg:size-3.5"}),ee=(()=>{if("oauth"===m&&p){if(c)return"Signed in — tools not discovered yet";let e=function(e,t,s){switch(e){case a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_HEALTHY:{let e=function(e){if(e===BigInt(0))return null;let t=e-BigInt(Math.floor(Date.now()/1e3));if(t<=BigInt(0))return"Token expired";let s=Number(t/BigInt(60));if(s<1)return"Expires in <1 min";if(s<60)return`Expires in ${s} min`;let r=Math.floor(s/60);if(r<24)return`Expires in ${r}h ${s%60}m`;let n=Math.floor(r/24);return`Expires in ${n}d`}(t);if(e)return`Tokens refresh automatically \u00B7 ${e}`;let r=s&&"never"!==s?` \u00B7 Session lasts ~${s}`:"";return`Tokens refresh automatically${r}`}case a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED_REFRESHABLE:return"Will refresh automatically on next use";case a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED:return"Token expired — sign in again to reconnect";default:return"Not connected yet"}}(h,C,S);return L?`${e} \u00B7 Using your OAuth app`:e}return L&&X?"Using your OAuth app":P?"Entering token manually":d?"Connected":"Not connected yet"})(),et=function(e,t){if(t)return{pillClass:"stg:bg-amber-500/10 stg:text-amber-600 stg:dark:text-amber-400",dotClass:"stg:bg-amber-500",label:"Pending approval"};switch(e){case a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_HEALTHY:return{pillClass:"stg:bg-success/10 stg:text-success",dotClass:"stg:bg-success",label:"Connected"};case a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED_REFRESHABLE:return{pillClass:"stg:bg-amber-500/10 stg:text-amber-600 stg:dark:text-amber-400",dotClass:"stg:bg-amber-500",label:"Token expired"};case a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED:return{pillClass:"stg:bg-destructive-subtle stg:text-destructive",dotClass:"stg:bg-destructive",label:"Re-auth needed"};default:return{pillClass:"stg:bg-muted stg:text-muted-foreground",dotClass:"stg:bg-muted-foreground",label:"Not connected"}}}(h,w&&!p),es=L&&!J&&"idle"===W;return"confirming"===_||"disconnecting"===_?(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsxs)("p",{className:"stg:flex-1 stg:text-xs stg:text-foreground",children:["Remove OAuth credentials for ",(0,t.jsx)("span",{className:"stg:font-medium",children:k}),"? You can reconnect at any time."]}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:j,onClick:async()=>{V("disconnecting");try{await b(),V("idle")}catch{V("confirming")}},className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[j&&(0,t.jsx)(eN,{}),"Disconnect"]}),(0,t.jsx)("button",{type:"button",disabled:j,onClick:()=>{V("idle"),y()},className:(0,r.cn)("stg:inline-flex stg:items-center stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]}),N&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:border-t stg:border-destructive/20 stg:bg-destructive-subtle stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(N)}),(0,t.jsx)("button",{type:"button",onClick:y,className:"stg:shrink-0 stg:text-xs stg:text-destructive-muted stg:hover:text-destructive","aria-label":"Dismiss error",children:"Dismiss"})]})]}):"confirming"===W||"removing"===W?(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsxs)("p",{className:"stg:flex-1 stg:text-xs stg:text-foreground",children:["Remove your custom OAuth app for"," ",(0,t.jsx)("span",{className:"stg:font-medium",children:k}),"? The server will revert to the platform's OAuth app."]}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:D,onClick:async()=>{q("removing");try{await T(),q("idle")}catch{q("confirming")}},className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[D&&(0,t.jsx)(eN,{}),"Remove"]}),(0,t.jsx)("button",{type:"button",disabled:D,onClick:()=>{q("idle"),H()},className:(0,r.cn)("stg:inline-flex stg:items-center stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:"Cancel"})]})]}),B&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:border-t stg:border-destructive/20 stg:bg-destructive-subtle stg:px-3 stg:py-2",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:(0,n.getUserMessage)(B)}),(0,t.jsx)("button",{type:"button",onClick:H,className:"stg:shrink-0 stg:text-xs stg:text-destructive-muted stg:hover:text-destructive","aria-label":"Dismiss error",children:"Dismiss"})]})]}):(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:px-3 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:["oauth"===m&&!P&&(0,t.jsxs)("span",{className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-full stg:px-2 stg:py-0.5 stg:text-[10px] stg:font-medium",et.pillClass),children:[(0,t.jsx)("span",{className:(0,r.cn)("stg:size-1.5 stg:rounded-full",et.dotClass),"aria-hidden":"true"}),et.label]}),(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:Z?"OAuth sign-in is pending vendor approval":ee}),v&&!J&&!P&&"idle"===_&&(0,t.jsx)("button",{type:"button",onClick:()=>V("confirming"),className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Disconnect"}),es&&(0,t.jsx)("button",{type:"button",onClick:()=>q("confirming"),className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Remove custom app"})]}),(0,t.jsxs)("button",{type:"button",onClick:g,disabled:J||u||Z,"data-cursor-target":"connect-button",className:(0,r.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium",X||Y?"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover":"stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[G,Q]})]}),"awaiting-callback"===x&&(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:border-t stg:border-border stg:px-3 stg:py-1.5",children:(0,t.jsx)("button",{type:"button",onClick:U,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Cancel sign-in"})}),Z&&(0,t.jsx)(f.VendorApprovalBlockedNotice,{blocked:!0,pending:w,manualEntrySupported:z,canBringOwnApp:E,docsUrl:A,onBringOwnApp:M,className:"stg:border-t stg:border-amber-500/20"}),"oauth"===m&&!p&&!K&&!e&&(P||z||E)&&(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:gap-3 stg:border-t stg:border-border stg:px-3 stg:py-1.5",children:P?(0,t.jsx)("button",{type:"button",onClick:R,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:w?"Back to OAuth status":"Sign in with OAuth instead"}):(0,t.jsxs)(t.Fragment,{children:[z&&(0,t.jsx)("button",{type:"button",onClick:I,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Enter token manually"}),E&&!O&&(0,t.jsx)("button",{type:"button",onClick:M,className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:"Use your own OAuth app"})]})}),i&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:border-t stg:border-destructive/20 stg:bg-destructive-subtle stg:px-3 stg:py-2",role:"alert",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-destructive"}),(0,t.jsx)("p",{className:"stg:flex-1 stg:text-xs stg:text-destructive",children:o??(0,n.getUserMessage)(i)}),(0,t.jsxs)("div",{className:"stg:flex stg:shrink-0 stg:items-center stg:gap-2",children:[(0,n.isRetryableError)(i)&&(0,t.jsx)("button",{type:"button",onClick:()=>{l(),g()},className:"stg:text-xs stg:font-medium stg:text-destructive stg:underline stg:underline-offset-2 stg:hover:no-underline",children:"Try again"}),(0,t.jsx)("button",{type:"button",onClick:l,className:"stg:text-xs stg:text-destructive-muted stg:hover:text-destructive","aria-label":"Dismiss error",children:"Dismiss"})]})]})]})}function F(e){switch(e){case"initiating":return"Starting sign-in...";case"awaiting-callback":return"Waiting for authorization...";case"completing":return"Completing sign-in...";case"connecting":return"Discovering tools...";default:return"Connecting..."}}function q({message:e}){return(0,t.jsxs)("div",{role:"alert",className:"stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-destructive/30 stg:bg-destructive-subtle stg:px-4 stg:py-3",children:[(0,t.jsx)(ed,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0 stg:text-destructive"}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-destructive",children:"Invalid Configuration"}),(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-destructive-muted",children:e})]})]})}function K({state:e}){switch(e){case o.ValidationState.valid:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{}),(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1 stg:text-emerald-600 stg:dark:text-emerald-400",children:[(0,t.jsx)(el,{className:"stg:size-3"}),"Valid"]})]});case o.ValidationState.invalid:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{}),(0,t.jsx)("span",{className:"stg:text-destructive",children:"Invalid"})]});default:return null}}let X=[{value:"http",label:"HTTP",description:"Connect via HTTP/SSE endpoint"},{value:"stdio",label:"Stdio",description:"Launch a local process with stdin/stdout"}];function Y({serverType:e,editable:r,isSaving:n,saveMcpField:i}){let[a,o]=(0,s.useState)(!1),[g,l]=(0,s.useState)(!1),d=(0,s.useMemo)(()=>{if(e?.case!=="http")return null;let t=e.value;return{url:t.url,headers:t.headers&&Object.keys(t.headers).length>0?{...t.headers}:void 0,queryParams:t.queryParams&&Object.keys(t.queryParams).length>0?{...t.queryParams}:void 0,timeoutSeconds:t.timeoutSeconds||void 0}},[e]),c=(0,s.useCallback)(async e=>{if(!i)return!1;if("http"===e){let e=await i("http",{url:""});return e&&await i("stdio",void 0),e}let t=await i("stdio",{command:""});return t&&await i("http",void 0),t},[i]),u=(0,s.useMemo)(()=>d?.headers?Object.entries(d.headers).map(([e,t])=>({key:e,value:t})):[],[d?.headers]),x=(0,s.useMemo)(()=>d?.queryParams?Object.entries(d.queryParams).map(([e,t])=>({key:e,value:t})):[],[d?.queryParams]),m=(0,s.useCallback)(async e=>{if(!i||!d)return!1;let t={};for(let s of e)s.key.trim()&&(t[s.key.trim()]=s.value);return i("http",{...d,headers:Object.keys(t).length>0?t:void 0})},[i,d]),p=(0,s.useCallback)(async e=>{if(!i||!d)return!1;let t={};for(let s of e)s.key.trim()&&(t[s.key.trim()]=s.value);return i("http",{...d,queryParams:Object.keys(t).length>0?t:void 0})},[i,d]);return(0,t.jsxs)(B.Section,{title:"Server Configuration",children:[(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2 stg:p-3",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Type"}),r&&i?(0,t.jsx)(I,{value:e?.case??"http",options:X,onSave:c,isSaving:n}):(0,t.jsx)("span",{className:"stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:font-mono stg:text-xs stg:font-medium stg:text-foreground",children:e?.case??"none"})]}),e?.case==="stdio"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Command"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:`${e.value.command}${e.value.args.length>0?` ${e.value.args.join(" ")}`:""}`,onSave:async e=>{let t=e.trim().split(/\s+/);return i("stdio",{command:t[0]||"",args:t.slice(1)})},isSaving:n,placeholder:"e.g. npx -y @modelcontextprotocol/server"}):(0,t.jsxs)("code",{className:"stg:font-mono stg:text-sm stg:text-foreground",children:[e.value.command,e.value.args.length>0&&` ${e.value.args.join(" ")}`]})]}),(r||e.value.workingDir)&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Working Dir"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:e.value.workingDir??"",onSave:async t=>i("stdio",{command:e.value.command,args:[...e.value.args],workingDir:t||void 0}),isSaving:n,placeholder:"/path/to/working/dir"}):(0,t.jsx)("code",{className:"stg:font-mono stg:text-xs stg:text-foreground",children:e.value.workingDir})]})]}),e?.case==="http"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"URL"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:e.value.url,onSave:async e=>i("http",{...d,url:e}),isSaving:n,placeholder:"https://example.com/mcp"}):(0,t.jsx)("code",{className:"stg:break-all stg:font-mono stg:text-sm stg:text-foreground",children:e.value.url})]}),(r||e.value.timeoutSeconds>0)&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Timeout"}),r&&i?(0,t.jsx)(H.InlineEditText,{value:e.value.timeoutSeconds>0?String(e.value.timeoutSeconds):"",onSave:async e=>i("http",{...d,timeoutSeconds:e?Number(e):void 0}),isSaving:n,placeholder:"30",validate:e=>e&&(isNaN(Number(e))||0>Number(e))?"Must be a positive number":null}):(0,t.jsxs)("span",{className:"stg:text-xs stg:text-foreground",children:[e.value.timeoutSeconds,"s"]})]})]})]}),e?.case==="http"&&(r||u.length>0)&&(0,t.jsx)(Z,{title:"Headers",count:u.length,rows:u,editable:r,isSaving:n,editing:a,onEditingChange:o,onSave:m,keyLabel:"Header name"}),e?.case==="http"&&(r||x.length>0)&&(0,t.jsx)(Z,{title:"Query Parameters",count:x.length,rows:x,editable:r,isSaving:n,editing:g,onEditingChange:l,onSave:p,keyLabel:"Parameter name"})]})}function Z({title:e,count:s,rows:r,editable:n,isSaving:i,editing:a,onEditingChange:o,onSave:g,keyLabel:l}){return(0,t.jsxs)("div",{className:"stg:border-t stg:border-border",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:px-3 stg:py-2",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:e}),s>0&&(0,t.jsx)("span",{className:"stg:inline-flex stg:min-w-[1.25rem] stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:px-1 stg:py-px stg:text-[10px] stg:font-medium stg:leading-none stg:text-muted-foreground",children:s})]}),n&&(0,t.jsx)("button",{type:"button",onClick:()=>o(!a),className:"stg:text-[11px] stg:text-muted-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:text-foreground stg:hover:decoration-foreground",children:a?"Done":"Edit"})]}),n&&a?(0,t.jsx)(_.InlineEditKeyValue,{value:[...r],onSave:g,isSaving:i,editing:a,onEditingChange:o,keyLabel:l,showValue:!0,valueLabel:"Value"}):(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:r.map(e=>(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:px-3 stg:py-1.5",children:[(0,t.jsx)("code",{className:"stg:shrink-0 stg:font-mono stg:text-xs stg:font-medium stg:text-foreground",children:e.key}),(0,t.jsx)("span",{className:"stg:min-w-0 stg:break-all stg:font-mono stg:text-xs stg:text-muted-foreground",children:function(e){let s;if(!J.test(e))return e;J.lastIndex=0;let r=[],n=0;for(;null!==(s=J.exec(e));)s.index>n&&r.push(e.slice(n,s.index)),r.push((0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)("span",{className:"stg:inline-flex stg:items-center stg:gap-0.5 stg:rounded stg:bg-primary-subtle stg:px-1 stg:py-px stg:text-[10px] stg:font-medium stg:text-primary"}),children:s[0]}),(0,t.jsx)(O.TooltipContent,{side:"top",children:`Resolved from environment variable: ${s[1]}`})]},s.index)),n=s.index+s[0].length;return n<e.length&&r.push(e.slice(n)),(0,t.jsx)(t.Fragment,{children:r})}(e.value)})]},e.key))})]})}let J=/\$\{([^}]+)\}/g;function Q({spec:e}){return(0,t.jsx)(B.Section,{title:"Source",children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-2 stg:p-3",children:[e.repositoryUrl&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Repository"}),(0,t.jsxs)("a",{href:e.repositoryUrl,target:"_blank",rel:"noopener noreferrer",className:"stg:inline-flex stg:items-center stg:gap-1 stg:break-all stg:font-mono stg:text-xs stg:text-foreground stg:underline stg:decoration-muted-foreground/40 stg:underline-offset-2 stg:hover:decoration-foreground",children:[e.repositoryUrl,(0,t.jsx)(ef,{className:"stg:size-3 stg:shrink-0"})]})]}),e.githubStars>0&&(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-xs stg:font-medium stg:text-muted-foreground",children:"Stars"}),(0,t.jsx)("span",{className:"stg:text-xs stg:text-foreground",children:e.githubStars.toLocaleString()})]})]})})}function G({templates:e}){return 0===e.length?null:(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:e.map(e=>(0,t.jsxs)("div",{className:"stg:px-3 stg:py-2.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:text-sm stg:font-medium stg:text-foreground",children:e.name}),(0,t.jsx)("code",{className:"stg:font-mono stg:text-[10px] stg:text-muted-foreground",children:e.uriTemplate})]}),e.description&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:e.description})]},e.uriTemplate||e.name))})}function ee({data:e,oauthTargetEnvVar:r,editable:n,isSaving:i,saveMcpField:a}){let o=Object.entries(e).sort(([e],[t])=>e.localeCompare(t)),g=(0,s.useMemo)(()=>o.map(([e,t])=>({key:e,value:"",isSecret:t.isSecret,description:t.description,optional:t.optional})),[o]),l=(0,s.useCallback)(async e=>{if(!a)return!1;let t={};for(let s of e)s.key.trim()&&(t[s.key.trim()]={isSecret:s.isSecret||void 0,description:s.description||void 0,optional:s.optional||void 0});return a("env",Object.keys(t).length>0?t:void 0)},[a]),[d,c]=(0,s.useState)(!1);return(0,t.jsx)(B.Section,{title:"Environment Variables",count:o.length,onEdit:n?()=>c(e=>!e):void 0,children:n?(0,t.jsx)(_.InlineEditKeyValue,{value:g,onSave:l,isSaving:i,editing:d,onEditingChange:c,showSecretToggle:!0,showOptionalToggle:!0,showDescription:!0,keyLabel:"Variable name"}):(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:o.map(([e,s])=>{let n=e===r;return(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3 stg:px-3 stg:py-2",children:[(0,t.jsx)("code",{className:"stg:shrink-0 stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",children:s.isSecret?"secret":"config"}),n&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-primary-subtle stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-primary",children:"oauth"}),s.optional&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground-subtle",children:"optional"}),s.description&&(0,t.jsx)("span",{className:"stg:text-xs stg:text-muted-foreground",children:s.description})]},e)})})})}function et({tags:e,editable:s}){return(0,t.jsx)(B.Section,{title:"Tags",count:e.length,children:(0,t.jsxs)("div",{className:"stg:flex stg:flex-wrap stg:gap-1.5 stg:p-3",children:[e.map(e=>(0,t.jsx)("span",{className:"stg:rounded-full stg:bg-muted stg:px-2.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:e},e)),s&&0===e.length&&(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground stg:italic",children:"No tags"})]})})}function es({tools:e,isOAuthStranded:n,onDiscover:i,isDiscovering:a}){let[o,g]=(0,s.useState)(""),[l,d]=(0,s.useState)(null),c=(0,s.useMemo)(()=>{if(!o.trim())return e;let t=o.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.description?.toLowerCase().includes(t))},[e,o]);if(0===e.length)return(0,t.jsxs)("div",{className:"stg:px-3 stg:py-8 stg:text-center",children:[(0,t.jsx)(ec,{className:"stg:mx-auto stg:mb-2 stg:size-6 stg:text-muted-foreground-faint"}),n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Signed in, but tools haven't been discovered yet."}),(0,t.jsxs)("button",{type:"button",onClick:i,disabled:a,className:(0,r.cn)("stg:mt-3 stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2.5 stg:py-1 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-50"),children:[a&&(0,t.jsx)(eN,{}),a?"Discovering tools...":"Discover tools"]})]}):(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:"Connect to this MCP server to discover its available tools."})]});let u=o.trim().length>0;return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:pb-2",children:[(0,t.jsxs)("div",{className:"stg:relative stg:flex-1",children:[(0,t.jsx)(ev,{className:"stg:pointer-events-none stg:absolute stg:left-2 stg:top-1/2 stg:size-3.5 stg:-translate-y-1/2 stg:text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:o,onChange:e=>g(e.target.value),placeholder:"Search tools…","aria-label":"Search tools",className:"stg:w-full stg:rounded-md stg:border stg:border-border stg:bg-background stg:py-1.5 stg:pl-7 stg:pr-7 stg:text-xs stg:text-foreground stg:placeholder:text-muted-foreground stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"}),u&&(0,t.jsx)("button",{type:"button",onClick:()=>g(""),"aria-label":"Clear search",className:"stg:absolute stg:right-2 stg:top-1/2 stg:-translate-y-1/2 stg:text-muted-foreground stg:hover:text-foreground",children:(0,t.jsx)(eb,{className:"stg:size-3"})})]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[10px] stg:text-muted-foreground",children:u?`${c.length} of ${e.length}`:e.length})]}),0===c.length?(0,t.jsx)("div",{className:"stg:px-3 stg:py-6 stg:text-center",children:(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["No tools matching “",o,"”"]})}):(0,t.jsx)("div",{className:"stg:max-h-96 stg:overflow-y-auto",children:(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:c.map(e=>{let s=l===e.name,n=null!=e.inputSchema&&Object.keys(e.inputSchema).length>0;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{type:"button",onClick:()=>d(s?null:e.name),className:"stg:flex stg:w-full stg:items-start stg:gap-2 stg:px-3 stg:py-2.5 stg:text-left stg:transition-colors stg:hover:bg-muted-faint","aria-expanded":s,children:[(0,t.jsx)(ej,{className:(0,r.cn)("stg:mt-0.5 stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:transition-transform",s&&"stg:rotate-90")}),(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsx)("code",{className:"stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e.name}),e.description&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:e.description})]}),n&&(0,t.jsx)("span",{className:"stg:mt-0.5 stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-muted-foreground",children:"schema"})]}),s&&n&&(0,t.jsx)("div",{className:"stg:border-t stg:border-border stg:bg-muted-faint stg:px-3 stg:py-2",children:(0,t.jsx)("pre",{className:"stg:max-h-64 stg:overflow-auto stg:whitespace-pre-wrap stg:break-words stg:rounded stg:border stg:border-border stg:bg-background stg:p-2 stg:font-mono stg:text-[11px] stg:text-foreground",children:JSON.stringify(e.inputSchema,null,2)})})]},e.name)})})})]})}function er({pinnedPolicies:e,classifiedPolicies:r,hasDiscoveredTools:n,isOAuthStranded:i}){let[a,o]=(0,s.useState)(""),g=e.length+r.length,l=g>0,d=(0,s.useMemo)(()=>{if(!a.trim())return e;let t=a.toLowerCase();return e.filter(e=>e.toolName.toLowerCase().includes(t)||e.message?.toLowerCase().includes(t))},[e,a]),c=(0,s.useMemo)(()=>{if(!a.trim())return r;let e=a.toLowerCase();return r.filter(t=>t.toolName.toLowerCase().includes(e)||t.message?.toLowerCase().includes(e))},[r,a]),u=d.length+c.length,x=a.trim().length>0;return l?(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:px-3 stg:pb-2",children:[(0,t.jsxs)("div",{className:"stg:relative stg:flex-1",children:[(0,t.jsx)(ev,{className:"stg:pointer-events-none stg:absolute stg:left-2 stg:top-1/2 stg:size-3.5 stg:-translate-y-1/2 stg:text-muted-foreground"}),(0,t.jsx)("input",{type:"text",value:a,onChange:e=>o(e.target.value),placeholder:"Search policies…","aria-label":"Search policies",className:"stg:w-full stg:rounded-md stg:border stg:border-border stg:bg-background stg:py-1.5 stg:pl-7 stg:pr-7 stg:text-xs stg:text-foreground stg:placeholder:text-muted-foreground stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"}),x&&(0,t.jsx)("button",{type:"button",onClick:()=>o(""),"aria-label":"Clear search",className:"stg:absolute stg:right-2 stg:top-1/2 stg:-translate-y-1/2 stg:text-muted-foreground stg:hover:text-foreground",children:(0,t.jsx)(eb,{className:"stg:size-3"})})]}),(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[10px] stg:text-muted-foreground",children:x?`${u} of ${g}`:g})]}),0===u?(0,t.jsx)("div",{className:"stg:px-3 stg:py-6 stg:text-center",children:(0,t.jsxs)("p",{className:"stg:text-xs stg:text-muted-foreground",children:["No policies matching “",a,"”"]})}):(0,t.jsxs)("div",{className:"stg:max-h-96 stg:overflow-y-auto",children:[d.length>0&&(0,t.jsx)(en,{icon:(0,t.jsx)(em,{className:"stg:size-3.5"}),label:"Pinned",policies:d}),c.length>0&&(0,t.jsx)(en,{icon:(0,t.jsx)(ep,{className:"stg:size-3.5"}),label:"Auto-classified",policies:c})]})]}):(0,t.jsxs)("div",{className:"stg:px-3 stg:py-8 stg:text-center",children:[(0,t.jsx)(ex,{className:"stg:mx-auto stg:mb-2 stg:size-6 stg:text-muted-foreground-faint"}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:n?"No approval policies yet. Reconnect to reclassify tools.":i?"Signed in — discover tools to auto-classify approval policies.":"Connect to discover tools and auto-classify approval policies."})]})}function en({icon:e,label:s,policies:r}){return(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:border-b stg:border-border stg:bg-muted-faint stg:px-3 stg:py-1.5",children:[(0,t.jsx)("span",{className:"stg:text-muted-foreground",children:e}),(0,t.jsx)("span",{className:"stg:text-[10px] stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:s}),(0,t.jsxs)("span",{className:"stg:text-[10px] stg:text-muted-foreground",children:["(",r.length,")"]})]}),(0,t.jsx)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:r.map(e=>(0,t.jsxs)("div",{className:"stg:px-3 stg:py-2.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("code",{className:"stg:font-mono stg:text-sm stg:font-medium stg:text-foreground",children:e.toolName}),(0,t.jsxs)("span",{className:"stg:inline-flex stg:items-center stg:gap-1 stg:rounded stg:bg-amber-500/10 stg:px-1.5 stg:py-0.5 stg:text-[10px] stg:font-medium stg:text-amber-600 stg:dark:text-amber-400",children:[(0,t.jsx)(ex,{className:"stg:size-2.5"}),"requires approval"]})]}),e.message&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-xs stg:text-muted-foreground",children:e.message})]},e.toolName))})]})}function ei(){return(0,t.jsx)("span",{className:"stg:shrink-0","aria-hidden":"true",children:"·"})}function ea({className:e}){return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-6",e),"aria-busy":"true","aria-label":"Loading MCP server details",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:[(0,t.jsx)("div",{className:"stg:mt-1 stg:size-6 stg:shrink-0 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsxs)("div",{className:"stg:flex-1 stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-5 stg:w-48 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-3 stg:w-64 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:h-4 stg:w-full stg:max-w-md stg:animate-pulse stg:rounded stg:bg-muted"})]})]}),[24,48,16,12].map((e,s)=>(0,t.jsxs)("div",{className:"stg:space-y-2",children:[(0,t.jsx)("div",{className:"stg:h-3 stg:w-28 stg:animate-pulse stg:rounded stg:bg-muted"}),(0,t.jsx)("div",{className:"stg:animate-pulse stg:rounded-lg stg:border stg:border-border stg:bg-muted-faint",style:{height:`${4*e}px`}})]},s))]})}function eo({className:e}){return(0,t.jsxs)("div",{role:"status",className:(0,r.cn)("stg:flex stg:flex-col stg:items-center stg:gap-2 stg:py-12 stg:text-center",e),children:[(0,t.jsx)(eg,{className:"stg:size-10 stg:text-muted-foreground-faint"}),(0,t.jsx)("p",{className:"stg:text-sm stg:font-medium stg:text-muted-foreground",children:"MCP Server not found"}),(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground-subtle",children:"This MCP server doesn't exist or you don't have access to it."})]})}function eg({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"12",height:"5",rx:"1"}),(0,t.jsx)("rect",{x:"2",y:"9",width:"12",height:"5",rx:"1"}),(0,t.jsx)("circle",{cx:"5",cy:"4.5",r:"0.75",fill:"currentColor",stroke:"none"}),(0,t.jsx)("circle",{cx:"5",cy:"11.5",r:"0.75",fill:"currentColor",stroke:"none"})]})}function el({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m3 8.5 3.5 3.5 6.5-8"})})}function ed({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5 1 14h14L8 1.5Z"}),(0,t.jsx)("path",{d:"M8 6v3.5"}),(0,t.jsx)("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor",stroke:"none"})]})}function ec({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6.5 6.5 4.25 4.25"}),(0,t.jsx)("path",{d:"m9.5 9.5 2.25 2.25"}),(0,t.jsx)("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1"}),(0,t.jsx)("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1"}),(0,t.jsx)("path",{d:"m6.5 9.5-3 3"}),(0,t.jsx)("path",{d:"m9.5 6.5 3-3"})]})}function eu({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2.5 8a5.5 5.5 0 0 1 9.36-3.92"}),(0,t.jsx)("path",{d:"M13.5 8a5.5 5.5 0 0 1-9.36 3.92"}),(0,t.jsx)("path",{d:"M12 2v3h-3"}),(0,t.jsx)("path",{d:"M4 14v-3h3"})]})}function ex({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 1.5 2.5 4v4c0 3.31 2.35 6.4 5.5 7 3.15-.6 5.5-3.69 5.5-7V4L8 1.5Z"})})}function em({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M9.5 2.5 13.5 6.5"}),(0,t.jsx)("path",{d:"M5 7 3 14l7-2"}),(0,t.jsx)("path",{d:"m5 7 2-2 4.5-1 1.5 1.5-1 4.5-2 2z"})]})}function ep({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.41 1.41M11.54 11.54l1.41 1.41M3.05 12.95l1.41-1.41M11.54 4.46l1.41-1.41"})})}function eh({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("rect",{x:"1.5",y:"5",width:"13",height:"8",rx:"1.5"}),(0,t.jsx)("path",{d:"M4.5 5V3.5a3.5 3.5 0 0 1 7 0V5"}),(0,t.jsx)("circle",{cx:"8",cy:"9.5",r:"1.25"})]})}function ef({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 8.667v4A1.333 1.333 0 0 1 10.667 14H3.333A1.333 1.333 0 0 1 2 12.667V5.333A1.333 1.333 0 0 1 3.333 4h4"}),(0,t.jsx)("path",{d:"M10 2h4v4"}),(0,t.jsx)("path",{d:"M6.667 9.333 14 2"})]})}function ev({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,t.jsx)("path",{d:"m10.5 10.5 3 3"})]})}function eb({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}function ej({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"m6 4 4 4-4 4"})})}function eN(){return(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}e.s(["McpServerDetailView",0,function({org:e,slug:r,mcpServerState:f,onResourceLoad:j,defaultCapabilityTab:y="tools",defaultShowCredentialForm:k=!1,credentialPoolValues:C,activeOrg:O,primaryAction:I,actions:R,onPluginClick:U,editable:_=!1,onResourceUpdated:F,className:X}){let Z=(0,g.useMcpServer)(f?null:e,f?null:r),{mcpServer:J,isLoading:en,error:el,refetch:ed}=f??Z,ec=(0,W.useManagingPlugin)(J?.metadata?.labels),eu=_&&null===ec.plugin,{update:ex,isUpdating:em}=function(){let e=(0,l.useStigmer)(),[t,r]=(0,s.useState)(!1),[n,i]=(0,s.useState)(null),a=(0,s.useCallback)(()=>i(null),[]);return{update:(0,s.useCallback)(async t=>{r(!0),i(null);try{return await e.mcpServer.update(t)}catch(e){throw i((0,d.toError)(e)),e}finally{r(!1)}},[e]),isUpdating:t,error:n,clearError:a}}(),ep=(0,s.useCallback)(async(e,t)=>{if(!J)return!1;let s=(0,c.toMcpServerUpdateInput)(J);s[e]=t;try{let e=await ex(s);return F?.(e),ed(),!0}catch{return!1}},[J,ex,F,ed]),eh=(0,x.useMcpServerCredentials)(O??e,J??null),ef=(0,u.useMcpServerConnect)(),ev=(0,m.useMcpServerOAuthConnect)(),eb=(0,v.useDisconnectOAuth)(),ej=(0,b.useOrgOAuthApp)(J?.metadata?.id??null,O??e),[eN,ey]=(0,s.useState)(k),[ek,eC]=(0,s.useState)(!1),[eS,ew]=(0,s.useState)(y),eO=(0,s.useRef)(j);eO.current=j,(0,s.useEffect)(()=>{J?.metadata?.name&&eO.current?.({name:J.metadata.name,id:J.metadata.id})},[J]);let eA=(0,s.useCallback)(async()=>{if(!J?.metadata?.id)return;let t=Object.keys(J.spec?.env??{});try{await ev.startOAuth(J.metadata.id,O??e,t),eh.refetch(),ed()}catch{eh.refetch(),ed()}},[J,ev,eh,ed]),eE="oauth"===eh.authMode&&"connecting"===ev.failedPhase,eL=(0,s.useCallback)(async()=>{if(!J?.metadata?.id)return;if("oauth"===eh.authMode&&!eh.isOAuthConnected&&!eh.manualOverride&&!eE)return void eA();if(!eh.isReady&&!eE)return void ey(!0);let t=Object.keys(J.spec?.env??{});try{await ef.connect(J.metadata.id,O??e,void 0,t),ev.clearError(),ed()}catch{}},[J,eh.authMode,eh.isOAuthConnected,eh.manualOverride,eh.isReady,eE,ef,ev.clearError,ed,eA,O,e]),eM=(0,s.useCallback)(async(t,s)=>{try{if(s.saveForFuture&&(await eh.saveCredentials(t),eh.refetch()),J?.metadata?.id){let s=Object.keys(J.spec?.env??{}),r=O??e;await ef.connect(J.metadata.id,r,t,s),ed()}ey(!1)}catch{}},[eh,J,ef,ed]),eT=(0,s.useCallback)(async()=>{if(J?.metadata?.id)try{await eb.disconnect(J.metadata.id,O??e),eh.refetch(),ed()}catch{}},[J,eb,eh,ed,O,e]),eD=(0,s.useCallback)(e=>{e||(eC(!1),ej.clearErrors())},[ej]),eB=(0,s.useCallback)(async(e,t)=>{await ej.setOrgOAuthApp(e,t),eC(!1),ej.refetch(),eh.refetch(),ed()},[ej,eh,ed]),eH=(0,s.useCallback)(async()=>{await ej.deleteOrgOAuthApp(),ej.refetch(),eh.refetch(),ed()},[ej,eh,ed]),ez=J?.spec,eP=J?.status,eI=ez&&(ez.repositoryUrl||ez.githubStars>0),eR=eP?.audit?.specAudit,eU=eP?.discoveredCapabilities,e_=ez?.pinnedToolApprovals??[],eV=eP?.toolApprovals??[],eW=e_.length+eV.length,e$=eU?.tools??[],eF=eU?.resourceTemplates??[],eq=e$.length>0,eK="oauth"===eh.authMode&&eh.isOAuthConnected&&eh.connectionHealth!==a.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_TOKEN_EXPIRED&&!eq,eX=(0,s.useMemo)(()=>{let e=[{id:"tools",label:"Tools",badge:e$.length},{id:"policies",label:"Policies",badge:eW}];return eF.length>0&&e.push({id:"resources",label:"Resources",badge:eF.length}),e},[e$.length,eW,eF.length]),eY=ef.error??ev.error,eZ=ef.error?(0,n.getUserMessage)(ef.error):ev.error?(0,m.getOAuthConnectErrorMessage)(ev.error,ev.failedPhase):null,eJ=(0,s.useCallback)(()=>{ef.clearError(),ev.clearError()},[ef,ev]),eQ=(0,M.useManageAccess)({resource:J?.metadata?{kind:S.ApiResourceKind.mcp_server,kindString:"mcp_server",id:J.metadata.id,org:J.metadata.org,name:J.metadata.name}:null,visibility:J?.metadata?{kind:"mcpServer",current:J.metadata.visibility,org:J.metadata.org,onChanged:ed}:void 0});if(en)return(0,t.jsx)(ea,{className:X});if(el)return(0,t.jsx)(w.ErrorMessage,{error:el,retry:ed,className:X});if(!J)return(0,t.jsx)(eo,{className:X});let eG=J.metadata,e0=eU?.lastDiscoveredAt?(0,i.timestampDate)(eU.lastDiscoveredAt):null,e1={name:eG?.name||eG?.slug||"Untitled",nameElement:eu&&ep?(0,t.jsx)(H.InlineEditText,{value:eG?.name||"",onSave:e=>ep("name",e),isSaving:em,variant:"heading",placeholder:"Server name",validate:e=>e.trim()?null:"Name is required"}):void 0,id:eG?.id||"",org:eG?.org,slug:eG?.slug,qualifiedSlug:eG?.slug?eG.org?`${eG.org}/${eG.slug}`:eG.slug:void 0,icon:eu&&ep?(0,t.jsx)(P.InlineEditImage,{value:ez?.iconUrl??"",onSave:e=>ep("iconUrl",e||void 0),isSaving:em,fallback:(0,t.jsx)(eg,{className:"stg:size-6 stg:text-muted-foreground"}),size:"md"}):ez?.iconUrl?void 0:(0,t.jsx)(eg,{className:"stg:size-6 stg:text-muted-foreground"}),iconUrl:eu?void 0:ez?.iconUrl||void 0,createdAt:eR?.createdAt?(0,i.timestampDate)(eR.createdAt):null,updatedAt:eR?.updatedAt?(0,i.timestampDate)(eR.updatedAt):null},e5=eG?(0,t.jsx)(L.VisibilityBadge,{visibility:eG.visibility,onClick:eQ.action?eQ.open:void 0}):void 0,e3=eQ.action?[...R??[],eQ.action]:R,e2=(0,t.jsxs)(t.Fragment,{children:[eP&&(0,t.jsx)(K,{state:eP.validationState}),e0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{}),(0,t.jsxs)("span",{children:["Discovered ",e0.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]})]})]}),e6=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(V.ManagedByPluginNotice,{plugin:ec.plugin,onPluginClick:U}),eP?.validationState===o.ValidationState.invalid&&eP.validationMessage?(0,t.jsx)(q,{message:eP.validationMessage}):null]});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(D.ResourceDetailShell,{header:e1,visibilityControl:e5,headerMetaExtra:e2,headerBanner:e6,primaryAction:I,actions:e3,className:X,children:[(eu||ez?.description)&&(0,t.jsx)(B.Section,{title:"Description",children:eu&&ep?(0,t.jsx)("div",{className:"stg:max-h-20 stg:overflow-y-auto stg:p-3",children:(0,t.jsx)(z.InlineEditTextarea,{value:ez?.description||"",onSave:e=>ep("description",e||void 0),isSaving:em,placeholder:"Add a description",minRows:2})}):(0,t.jsx)("div",{className:"stg:p-3",children:(0,t.jsx)("pre",{className:"stg:whitespace-pre-wrap stg:break-words stg:text-sm stg:text-foreground stg:font-sans",children:ez?.description})})}),eI&&(0,t.jsx)(Q,{spec:ez}),(eu||ez?.serverType.case)&&(0,t.jsx)(Y,{serverType:ez?.serverType,editable:eu,isSaving:em,saveMcpField:ep}),(eu||ez?.env&&Object.keys(ez.env).length>0)&&(0,t.jsx)(ee,{data:ez?.env??{},oauthTargetEnvVar:eh.oauthTargetEnvVar,editable:eu,isSaving:em,saveMcpField:ep}),(0,t.jsxs)(B.Section,{title:"Connection",scrollTarget:"mcp-connection",children:[(0,t.jsx)(p.StdioSandboxNotice,{serverType:ez?.serverType,className:"stg:mb-3"}),(0,t.jsx)(h.OAuthRequiredNotice,{oauthOnly:ez?.auth?.oauthOnly,className:"stg:mb-3"}),(0,t.jsx)($,{manualEntrySupported:eh.manualEntrySupported,isConnecting:ef.isConnecting||ev.isInProgress,connectionError:eY,connectionErrorMessage:eZ,onConnect:eL,onClearConnectionError:eJ,hasDiscoveredTools:eq,isOAuthStranded:eK,credentialsLoading:eh.isLoading,oauthPhase:ev.phase,authMode:eh.authMode,isOAuthConnected:eh.isOAuthConnected,connectionHealth:eh.connectionHealth,canDisconnect:eh.canDisconnect,onDisconnect:eT,isDisconnecting:eb.isDisconnecting,disconnectError:eb.error,onClearDisconnectError:eb.clearError,serverName:J?.metadata?.name??r,accessTokenExpiresAt:eh.accessTokenExpiresAt,tokenLifetimeHint:eh.tokenLifetimeHint,isVendorApprovalPending:eh.isVendorApprovalPending,isVendorApprovalBlocked:eh.isVendorApprovalBlocked,vendorApprovalDocsUrl:eh.vendorApprovalDocsUrl,canBringOwnApp:eh.canBringOwnApp,isOrgOAuthApp:eh.isOrgOAuthApp,onBringOwnApp:()=>eC(!0),onRemoveOrgApp:eH,isRemovingOrgApp:ej.isDeleting,removeOrgAppError:ej.deleteError,onClearRemoveOrgAppError:ej.clearErrors,manualOverride:eh.manualOverride,onManualOverride:()=>{eh.setManualOverride(!0),ey(!0)},onBackToOAuth:()=>{eh.setManualOverride(!1),ey(!1)},onCancelOAuth:ev.clearError}),eN&&eh.missingVariables.length>0&&(0,t.jsx)("div",{className:"stg:border-b stg:border-border stg:p-4","data-cursor-target":"credential-form",children:(0,t.jsx)(E.EnvVarForm,{title:"Credentials Required",description:'Enter the credentials needed to connect to this MCP server. Toggle "Save for future runs" to persist them in your personal environment, or leave it off for one-time use.',variables:eh.missingVariables,onSubmit:(e,t)=>eM(e,t),onCancel:()=>ey(!1),isSubmitting:eh.isSaving,poolValues:C,className:"stg:w-full stg:max-w-md"})})]}),(0,t.jsxs)(A.DialogShell,{open:ek,onOpenChange:eD,width:"md",className:"stg:p-6","aria-label":"Use your own OAuth app",children:[(0,t.jsx)("h3",{className:"stg:mb-4 stg:text-base stg:font-semibold stg:text-foreground",children:"Use your own OAuth app"}),(0,t.jsx)(N,{providerName:J?.metadata?.name??r,vendorDocsUrl:eh.vendorApprovalDocsUrl,onSubmit:eB,onCancel:()=>{eC(!1),ej.clearErrors()},isSubmitting:ej.isSetting,error:ej.setError})]}),(0,t.jsx)(B.Section,{title:"Capabilities",scrollTarget:"mcp-capabilities",children:(0,t.jsxs)(T.Tabs,{tabs:eX,activeTab:eS,onTabChange:e=>ew(e),"aria-label":"MCP server capabilities",children:["tools"===eS&&(0,t.jsx)(es,{tools:e$,isOAuthStranded:eK,onDiscover:eL,isDiscovering:ef.isConnecting||ev.isInProgress}),"policies"===eS&&(0,t.jsx)(er,{pinnedPolicies:e_,classifiedPolicies:eV,hasDiscoveredTools:eq,isOAuthStranded:eK}),"resources"===eS&&(0,t.jsx)(G,{templates:eF})]})}),(eu||ez&&ez.tags.length>0)&&(0,t.jsx)(et,{tags:ez?.tags??[],editable:eu})]}),eQ.dialog]})},"oauthPhaseLabel",0,F],674542)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,10337,t=>{"use strict";var e=t.i(843476),s=t.i(271645),n=t.i(893976),r=t.i(468806);t.s(["ConfirmDialog",0,function({state:t,onConfirm:i,onCancel:a}){let g=(0,s.useCallback)(t=>{t||a()},[a]);if(!t)return null;let o="destructive"===t.variant;return(0,e.jsx)(r.DialogShell,{open:!0,onOpenChange:g,width:"sm","aria-label":t.title,children:(0,e.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-4 stg:p-6",children:[(0,e.jsxs)("div",{className:"stg:flex stg:flex-col stg:gap-1.5",children:[(0,e.jsx)("h3",{className:"stg:text-base stg:font-semibold stg:text-foreground",children:t.title}),(0,e.jsx)("p",{className:"stg:text-sm stg:text-muted-foreground",children:t.description})]}),(0,e.jsxs)("div",{className:"stg:flex stg:justify-end stg:gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:a,className:(0,n.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:border stg:border-input stg:bg-background stg:text-foreground","stg:hover:bg-accent stg:hover:text-accent-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:t.cancelLabel??"Cancel"}),(0,e.jsx)("button",{type:"button",onClick:i,className:(0,n.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring",o?"stg:bg-destructive stg:text-destructive-foreground stg:hover:bg-destructive-hover":"stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover"),children:t.confirmLabel??"Confirm"})]})]})})}])},966205,t=>{"use strict";var e=t.i(271645);t.s(["useConfirmAction",0,function(){let[t,s]=(0,e.useState)(null),n=(0,e.useCallback)(t=>new Promise(e=>{s({...t,resolve:e})}),[]),r=(0,e.useCallback)(()=>{t?.resolve(!0),s(null)},[t]),i=(0,e.useCallback)(()=>{t?.resolve(!1),s(null)},[t]);return(0,e.useMemo)(()=>({confirmState:t,confirm:n,handleConfirm:r,handleCancel:i}),[t,n,r,i])}])},678745,t=>{"use strict";let e=(0,t.i(475254).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);t.s(["default",0,e])},845132,678784,916624,t=>{"use strict";var e=t.i(843476),s=t.i(893976),n=t.i(704077),r=t.i(678745);t.s(["CheckIcon",()=>r.default],678784);var r=r,i=t.i(364354);function a(t){return(0,e.jsx)(n.Menu.Root,{...t})}function g(t){return(0,e.jsx)(n.Menu.Trigger,{...t})}function o({align:t="start",alignOffset:r=0,side:a="bottom",sideOffset:g=4,className:l,...c}){let d=(0,i.useStigmerPortalContainer)();return(0,e.jsx)(n.Menu.Portal,{container:d,children:(0,e.jsx)(n.Menu.Positioner,{className:"stg:isolate stg:z-50 stg:outline-none",align:t,alignOffset:r,side:a,sideOffset:g,children:(0,e.jsx)(n.Menu.Popup,{className:(0,s.cn)("stg:bg-popover stg:text-popover-foreground stg:ring-foreground/10","stg:data-[side=bottom]:slide-in-from-top-2 stg:data-[side=inline-end]:slide-in-from-left-2 stg:data-[side=inline-start]:slide-in-from-right-2 stg:data-[side=left]:slide-in-from-right-2 stg:data-[side=right]:slide-in-from-left-2 stg:data-[side=top]:slide-in-from-bottom-2","stg:data-open:animate-in stg:data-open:fade-in-0 stg:data-open:zoom-in-95","stg:data-closed:animate-out stg:data-closed:fade-out-0 stg:data-closed:zoom-out-95","stg:z-50 stg:max-h-(--available-height) stg:w-(--anchor-width) stg:min-w-32 stg:origin-(--transform-origin) stg:overflow-x-hidden stg:overflow-y-auto stg:rounded-lg stg:p-1 stg:shadow-md stg:ring-1 stg:duration-100 stg:outline-none stg:data-closed:overflow-hidden",l),...c})})})}function l({className:t,variant:r="default",...i}){return(0,e.jsx)(n.Menu.Item,{"data-variant":r,className:(0,s.cn)("stg:focus:bg-accent stg:focus:text-accent-foreground stg:not-data-[variant=destructive]:focus:**:text-accent-foreground","stg:data-[variant=destructive]:text-destructive stg:data-[variant=destructive]:focus:bg-destructive-subtle stg:data-[variant=destructive]:focus:text-destructive stg:data-[variant=destructive]:*:[svg]:text-destructive","stg:relative stg:flex stg:cursor-default stg:items-center stg:gap-1.5 stg:rounded-md stg:px-1.5 stg:py-1 stg:text-sm stg:outline-hidden stg:select-none","stg:data-disabled:pointer-events-none stg:data-disabled:opacity-50","stg:[&_svg]:pointer-events-none stg:[&_svg]:shrink-0 stg:[&_svg:not([class*='size-'])]:size-4",t),...i})}function c({className:t,...r}){return(0,e.jsx)(n.Menu.Separator,{className:(0,s.cn)("stg:bg-border stg:-mx-1 stg:my-1 stg:h-px",t),...r})}function d({className:t,...s}){return(0,e.jsx)("div",{role:"group",className:t,...s})}function u({className:t,...n}){return(0,e.jsx)("span",{className:(0,s.cn)("stg:text-muted-foreground stg:block stg:px-1.5 stg:py-1 stg:text-[11px] stg:font-medium stg:uppercase stg:tracking-wider stg:select-none",t),...n})}t.s(["Menu",0,a,"MenuContent",0,o,"MenuGroup",0,d,"MenuItem",0,l,"MenuLabel",0,u,"MenuRadioGroup",0,function(t){return(0,e.jsx)(n.Menu.RadioGroup,{...t})},"MenuRadioItem",0,function({className:t,children:i,...a}){return(0,e.jsxs)(n.Menu.RadioItem,{className:(0,s.cn)("stg:focus:bg-accent stg:focus:text-accent-foreground stg:focus:**:text-accent-foreground","stg:relative stg:flex stg:cursor-default stg:items-center stg:gap-1.5 stg:rounded-md stg:py-1 stg:pr-8 stg:pl-1.5 stg:text-sm stg:outline-hidden stg:select-none","stg:data-disabled:pointer-events-none stg:data-disabled:opacity-50","stg:[&_svg]:pointer-events-none stg:[&_svg]:shrink-0 stg:[&_svg:not([class*='size-'])]:size-4",t),...a,children:[(0,e.jsx)("span",{className:"stg:pointer-events-none stg:absolute stg:right-2 stg:flex stg:items-center stg:justify-center",children:(0,e.jsx)(n.Menu.RadioItemIndicator,{children:(0,e.jsx)(r.default,{})})}),i]})},"MenuSeparator",0,c,"MenuTrigger",0,g],916624);let x=Object.assign(function({children:t}){return(0,e.jsx)(a,{children:t})},{Trigger:function({children:t,className:n,"aria-label":r="Actions"}){return(0,e.jsx)(g,{className:(0,s.cn)("stg:inline-flex stg:items-center stg:justify-center stg:rounded-md stg:p-1","stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:data-popup-open:bg-accent stg:data-popup-open:text-foreground",n),"aria-label":r,children:t})},Content:function({children:t,align:n="end",className:r}){return(0,e.jsx)(o,{align:n,className:(0,s.cn)("stg:min-w-44",r),children:t})},Item:function({children:t,onSelect:n,icon:r,shortcut:i,variant:a="default",disabled:g,className:o}){return(0,e.jsxs)(l,{variant:a,disabled:g,onClick:n,className:(0,s.cn)("stg:justify-between",o),children:[(0,e.jsxs)("span",{className:"stg:flex stg:items-center stg:gap-2",children:[r,(0,e.jsx)("span",{children:t})]}),i&&(0,e.jsx)("kbd",{className:"stg:ml-auto stg:text-[11px] stg:tracking-widest stg:text-muted-foreground-subtle",children:i})]})},Separator:function({className:t}){return(0,e.jsx)(c,{className:t})},Group:function({children:t,label:s,className:n}){return(0,e.jsxs)(d,{className:n,children:[s&&(0,e.jsx)(u,{children:s}),t]})}});t.s(["ActionMenu",0,x],845132)},266442,t=>{"use strict";var e=t.i(843476),s=t.i(893976),n=t.i(188482);let r={ready:"Ready",running:"Running",pending:"Pending",degraded:"Degraded",failed:"Failed",disabled:"Disabled",draft:"Draft"};t.s(["StatusBadge",0,function({phase:t,label:i,tooltip:a,className:g}){let o=i??r[t],l=(0,e.jsxs)("span",{className:(0,s.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-full stg:px-2 stg:py-0.5 stg:text-[11px] stg:font-medium stg:leading-none",function(t){switch(t){case"ready":return"stg:bg-[var(--stgm-status-ready-subtle)] stg:text-[var(--stgm-status-ready)]";case"running":return"stg:bg-[var(--stgm-status-running-subtle)] stg:text-[var(--stgm-status-running)]";case"pending":return"stg:bg-[var(--stgm-status-pending-subtle)] stg:text-[var(--stgm-status-pending)]";case"degraded":return"stg:bg-[var(--stgm-status-degraded-subtle)] stg:text-[var(--stgm-status-degraded)]";case"failed":return"stg:bg-[var(--stgm-status-failed-subtle)] stg:text-[var(--stgm-status-failed)]";case"disabled":return"stg:bg-[var(--stgm-status-disabled-subtle)] stg:text-[var(--stgm-status-disabled)]";case"draft":return"stg:bg-[var(--stgm-status-draft-subtle)] stg:text-[var(--stgm-status-draft)]"}}(t),g),children:[(0,e.jsx)("span",{className:(0,s.cn)("stg:size-1.5 stg:shrink-0 stg:rounded-full",function(t){switch(t){case"ready":return"stg:bg-[var(--stgm-status-ready)]";case"running":return"stg:bg-[var(--stgm-status-running)]";case"pending":return"stg:bg-[var(--stgm-status-pending)]";case"degraded":return"stg:bg-[var(--stgm-status-degraded)]";case"failed":return"stg:bg-[var(--stgm-status-failed)]";case"disabled":return"stg:bg-[var(--stgm-status-disabled)]";case"draft":return"stg:bg-[var(--stgm-status-draft)]"}}(t)),"aria-hidden":"true"}),o]});return a?(0,e.jsxs)(n.Tooltip,{children:[(0,e.jsx)(n.TooltipTrigger,{render:(0,e.jsx)("span",{className:"stg:inline-flex"}),children:l}),(0,e.jsx)(n.TooltipContent,{side:"top",children:a})]}):l}])},476007,t=>{"use strict";var e=t.i(843476),s=t.i(271645),n=t.i(610595),r=t.i(893976);let i={auth:"Authentication required",permission:"Access denied","not-found":"Not found",validation:"Invalid request",server:"Server error",unavailable:"Service unavailable",cancelled:"Request cancelled",unknown:"Something went wrong"};function a({className:t}){return(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:[(0,e.jsx)("path",{d:"M7.13 2.5a1 1 0 0 1 1.74 0l5.5 9.5A1 1 0 0 1 13.5 13.5h-11a1 1 0 0 1-.87-1.5l5.5-9.5z"}),(0,e.jsx)("path",{d:"M8 6v3"}),(0,e.jsx)("circle",{cx:"8",cy:"11",r:"0.5",fill:"currentColor",stroke:"none"})]})}function g({className:t}){return(0,e.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:[(0,e.jsx)("path",{d:"M8 1.5l5 2v4c0 3.5-2.5 5.5-5 6.5-2.5-1-5-3-5-6.5v-4l5-2z"}),(0,e.jsx)("path",{d:"M6 6.5l4 4M10 6.5l-4 4"})]})}function o({className:t}){return(0,e.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:(0,e.jsx)("path",{d:"M4 6l4 4 4-4"})})}function l({className:t}){return(0,e.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":"true",children:[(0,e.jsx)("path",{d:"M2 6.5h4v-4"}),(0,e.jsx)("path",{d:"M3.5 11.5a5.5 5.5 0 1 0 .5-6l-2 1"})]})}t.s(["ErrorMessage",0,function({error:t,title:c,retry:d,className:u}){let[x,m]=(0,s.useState)(!1);if(!t)return null;let f=(0,n.classifyError)(t),h=(0,n.getUserMessage)(t),p=(0,n.getRpcMetadata)(t),b=(0,n.isRetryableError)(t);return(0,e.jsx)("div",{role:"alert",className:(0,r.cn)("stg:bg-destructive-subtle stg:border-destructive/20 stg:text-destructive stg:rounded-lg stg:border stg:p-4",u),children:(0,e.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-3",children:["auth"===f||"permission"===f?(0,e.jsx)(g,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}):(0,e.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,e.jsxs)("div",{className:"stg:min-w-0 stg:flex-1 stg:space-y-1",children:[(0,e.jsx)("p",{className:"stg:text-sm stg:font-medium",children:c??i[f]}),(0,e.jsx)("p",{className:"stg:text-destructive-muted stg:text-sm",children:h}),p&&(0,e.jsxs)("div",{className:"stg:pt-1",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>m(t=>!t),className:"stg:text-destructive-muted stg:hover:text-destructive-muted stg:inline-flex stg:items-center stg:gap-1 stg:text-xs stg:transition-colors",children:[(0,e.jsx)(o,{className:(0,r.cn)("stg:size-3 stg:transition-transform",x&&"stg:rotate-180")}),"Technical details"]}),x&&(0,e.jsxs)("dl",{className:"stg:text-destructive-muted stg:mt-1.5 stg:space-y-0.5 stg:font-mono stg:text-xs",children:[(0,e.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,e.jsx)("dt",{className:"stg:shrink-0",children:"Method:"}),(0,e.jsx)("dd",{className:"stg:truncate",children:p.method})]}),(0,e.jsxs)("div",{className:"stg:flex stg:gap-2",children:[(0,e.jsx)("dt",{className:"stg:shrink-0",children:"Path:"}),(0,e.jsx)("dd",{className:"stg:truncate",children:p.path})]})]})]})]}),d&&b&&(0,e.jsxs)("button",{type:"button",onClick:d,className:(0,r.cn)("stg:inline-flex stg:shrink-0 stg:items-center stg:gap-1.5 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5 stg:text-xs stg:font-medium","stg:border-destructive/20 stg:text-destructive stg:hover:bg-destructive-subtle","stg:transition-colors"),children:[(0,e.jsx)(l,{className:"stg:size-3"}),"Retry"]})]})})}])},193799,t=>{"use strict";var e=t.i(271645);t.s(["useCopyFeedback",0,function(){let[t,s]=(0,e.useState)(!1),n=(0,e.useRef)(null);(0,e.useEffect)(()=>()=>{null!==n.current&&clearTimeout(n.current)},[]);let r=(0,e.useCallback)(async t=>{try{await navigator.clipboard.writeText(t)}catch{return!1}return s(!0),null!==n.current&&clearTimeout(n.current),n.current=setTimeout(()=>s(!1),2e3),!0},[]);return(0,e.useMemo)(()=>({copy:r,copied:t}),[r,t])}])},927056,t=>{"use strict";var e=t.i(843476),s=t.i(271645),n=t.i(893976);t.s(["Tabs",0,function({tabs:t,activeTab:r,onTabChange:i,children:a,"aria-label":g,className:o}){let l=(0,s.useId)(),c=(0,s.useRef)(new Map),d=t=>`${l}-tab-${t}`,u=t=>`${l}-panel-${t}`,x=(0,s.useCallback)(t=>{c.current.get(t)?.focus(),i(t)},[i]),m=(0,s.useCallback)(e=>{let s=t.findIndex(t=>t.id===r);if(-1===s)return;let n=null;switch(e.key){case"ArrowRight":n=(s+1)%t.length;break;case"ArrowLeft":n=(s-1+t.length)%t.length;break;case"Home":n=0;break;case"End":n=t.length-1;break;default:return}e.preventDefault(),x(t[n].id)},[t,r,x]);return(0,e.jsxs)("div",{className:(0,n.cn)("stg:flex stg:flex-col",o),children:[(0,e.jsx)("div",{role:"tablist","aria-label":g,onKeyDown:m,className:"stg:flex stg:border-b stg:border-border",children:t.map(t=>{let s=t.id===r;return(0,e.jsxs)("button",{ref:e=>{e?c.current.set(t.id,e):c.current.delete(t.id)},id:d(t.id),role:"tab",type:"button","aria-selected":s,"aria-controls":u(t.id),tabIndex:s?0:-1,onClick:()=>i(t.id),"data-cursor-target":`tab-${t.id}`,className:(0,n.cn)("stg:relative stg:inline-flex stg:items-center stg:gap-1.5 stg:px-3 stg:py-2 stg:text-xs stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-1",s?"stg:text-foreground":"stg:text-muted-foreground stg:hover:text-foreground"),children:[t.icon,t.label,null!=t.badge&&t.badge>0&&(0,e.jsx)("span",{"aria-hidden":"true",className:(0,n.cn)("stg:inline-flex stg:min-w-[1.25rem] stg:items-center stg:justify-center stg:rounded-full stg:px-1 stg:py-px stg:text-[10px] stg:font-medium stg:leading-none",s?"stg:bg-primary-subtle stg:text-primary":"stg:bg-muted stg:text-muted-foreground"),children:t.badge}),s&&(0,e.jsx)("span",{className:"stg:absolute stg:inset-x-0 stg:-bottom-px stg:h-0.5 stg:bg-primary","aria-hidden":"true"})]},t.id)})}),(0,e.jsx)("div",{id:u(r),role:"tabpanel","aria-labelledby":d(r),tabIndex:0,className:"stg:min-h-0 stg:flex-1 stg:pt-4 stg:focus-visible:outline-none",children:a})]})}])},107141,t=>{"use strict";var e=t.i(271645),s=t.i(618566);let n="__placeholder__";t.s(["useStaticRouteParam",0,function(t,r=1){let i=(0,s.useParams)()[t];return(0,e.useMemo)(()=>{if(i!==n)return i;let t=window.location.pathname.split("/").filter(Boolean),e=t[t.length-r];return e&&e!==n?e:null},[i,r])}])},668093,652337,t=>{"use strict";var e=t.i(843476),s=t.i(893976),n=t.i(266442),r=t.i(927056),i=t.i(271645),a=t.i(845132);function g({primaryAction:t,actions:n,className:r}){let i=null!=n&&n.length>0;return t||i?(0,e.jsxs)("div",{className:(0,s.cn)("stg:flex stg:items-center stg:gap-2",r),children:[t&&(0,e.jsxs)("button",{type:"button",onClick:t.onAction,disabled:t.disabled,className:(0,s.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:[t.icon,t.label]}),i&&(0,e.jsx)(o,{actions:n})]}):null}function o({actions:t}){var s;let n=(s=t,(0,i.useMemo)(()=>{let t=new Map;for(let e of s){let s=e.group??"__default",n=t.get(s);n?n.push(e):t.set(s,[e])}return Array.from(t.entries()).map(([t,e])=>({key:t,items:e}))},[s]));return(0,e.jsxs)(a.ActionMenu,{children:[(0,e.jsx)(a.ActionMenu.Trigger,{"aria-label":"More actions",children:(0,e.jsx)(l,{className:"stg:size-4"})}),(0,e.jsx)(a.ActionMenu.Content,{children:n.map((t,s)=>(0,e.jsxs)(a.ActionMenu.Group,{children:[s>0&&(0,e.jsx)(a.ActionMenu.Separator,{}),t.items.map(t=>(0,e.jsx)(a.ActionMenu.Item,{icon:t.icon,shortcut:t.shortcut,variant:t.variant,disabled:t.disabled,onSelect:t.onAction,children:t.label},t.id))]},t.key))})]})}function l({className:t}){return(0,e.jsxs)("svg",{className:t,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[(0,e.jsx)("circle",{cx:"8",cy:"3",r:"1.25"}),(0,e.jsx)("circle",{cx:"8",cy:"8",r:"1.25"}),(0,e.jsx)("circle",{cx:"8",cy:"13",r:"1.25"})]})}function c({header:t,visibilityControl:s,metaExtra:r}){let{name:i,nameElement:a,org:g,slug:o,qualifiedSlug:l,description:x,iconUrl:m,icon:f,createdAt:h,updatedAt:p,status:b,statusLabel:v}=t,j=o&&o!==i&&!l;return(0,e.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-start stg:gap-3",children:[m?(0,e.jsx)("img",{src:m,alt:"",className:"stg:mt-0.5 stg:size-8 stg:shrink-0 stg:rounded stg:object-cover"}):f?(0,e.jsx)("span",{className:"stg:mt-1 stg:shrink-0",children:f}):null,(0,e.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,e.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[a??(0,e.jsx)("h2",{className:"stg:truncate stg:text-lg stg:font-semibold stg:text-foreground",children:i}),j&&(0,e.jsx)("code",{className:"stg:shrink-0 stg:rounded stg:bg-muted stg:px-1.5 stg:py-0.5 stg:text-xs stg:font-medium stg:text-muted-foreground",children:o}),b&&(0,e.jsx)(n.StatusBadge,{phase:b,label:v}),s]}),l&&(0,e.jsx)("span",{className:"stg:mt-0.5 stg:block stg:truncate stg:font-mono stg:text-xs stg:text-muted-foreground",children:l}),(0,e.jsxs)("div",{className:"stg:mt-0.5 stg:flex stg:flex-wrap stg:items-center stg:gap-x-1.5 stg:text-xs stg:text-muted-foreground",children:[g&&(0,e.jsx)("span",{children:g}),r,h&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(d,{}),(0,e.jsxs)("span",{children:["Created ",u(h)]})]}),p&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(d,{}),(0,e.jsxs)("span",{children:["Updated ",u(p)]})]})]}),x&&(0,e.jsx)("p",{className:"stg:mt-2 stg:text-sm stg:text-muted-foreground",children:x})]})]})}function d(){return(0,e.jsx)("span",{className:"stg:shrink-0","aria-hidden":"true",children:"·"})}function u(t){return t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function x({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}t.s(["ResourceDetailShell",0,function({header:t,visibilityControl:n,headerMetaExtra:i,headerBanner:a,primaryAction:o,actions:l,tabs:d,activeTab:u,onTabChange:x,tabsAriaLabel:m,children:f,className:h}){let p=null!=d&&d.length>0;return(0,e.jsxs)("div",{className:(0,s.cn)("stg:flex stg:flex-col stg:gap-6",h),children:[a,(0,e.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-4",children:[(0,e.jsx)(c,{header:t,visibilityControl:n,metaExtra:i}),(0,e.jsx)(g,{primaryAction:o,actions:l,className:"stg:shrink-0"})]}),p&&u&&x?(0,e.jsx)(r.Tabs,{tabs:d,activeTab:u,onTabChange:x,"aria-label":m,children:f}):f]})}],668093),t.s(["Section",0,function({title:t,count:n,headerActions:r,onEdit:i,scrollTarget:a,children:g,className:o}){return(0,e.jsxs)("section",{className:o,"data-scroll-target":a,children:[(0,e.jsxs)("div",{className:"stg:mb-2 stg:flex stg:items-center stg:gap-2",children:[(0,e.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:uppercase stg:tracking-wider stg:text-muted-foreground",children:t}),null!=n&&n>0&&(0,e.jsx)("span",{className:"stg:inline-flex stg:size-5 stg:items-center stg:justify-center stg:rounded-full stg:bg-muted stg:text-[10px] stg:font-semibold stg:text-muted-foreground",children:n}),(r||i)&&(0,e.jsxs)("div",{className:"stg:ml-auto stg:flex stg:items-center stg:gap-1",children:[r,i&&(0,e.jsx)("button",{type:"button",onClick:i,"aria-label":`Edit ${t.toLowerCase()}`,className:(0,s.cn)("stg:inline-flex stg:size-6 stg:items-center stg:justify-center stg:rounded-md stg:text-muted-foreground","stg:hover:bg-accent-hover stg:hover:text-foreground","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring","stg:transition-colors"),children:(0,e.jsx)(x,{className:"stg:size-3.5"})})]})]}),(0,e.jsx)("div",{className:"stg:overflow-hidden stg:rounded-lg stg:border stg:border-border",children:g})]})}],652337)},261722,t=>{"use strict";var e=t.i(843476),s=t.i(271645),n=t.i(893976);function r({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function i(){return(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}t.s(["InlineEditTextarea",0,function({value:t,onSave:a,placeholder:g="Click to edit",validate:o,minRows:l=3,disabled:c,isSaving:d,error:u,className:x}){let[m,f]=(0,s.useState)(!1),[h,p]=(0,s.useState)(t),[b,v]=(0,s.useState)(null),j=(0,s.useRef)(null);(0,s.useEffect)(()=>{m&&(p(t),v(null),requestAnimationFrame(()=>{let t=j.current;t&&(t.focus(),t.selectionStart=t.value.length)}))},[m,t]),(0,s.useEffect)(()=>{let t=j.current;t&&(t.style.height="auto",t.style.height=`${t.scrollHeight}px`)},[h,m]);let y=(0,s.useCallback)(async()=>{if(h===t)return void f(!1);if(o){let t=o(h);if(t)return void v(t)}await a(h)&&f(!1)},[h,t,o,a]),k=(0,s.useCallback)(()=>{f(!1),p(t),v(null)},[t]),N=(0,s.useCallback)(t=>{"Enter"===t.key&&(t.ctrlKey||t.metaKey)?(t.preventDefault(),y()):"Escape"===t.key&&k()},[y,k]),w=b||u;return c||!m?(0,e.jsx)("div",{className:(0,n.cn)("stg:group/inline-edit",x),children:(0,e.jsx)("button",{type:"button",onClick:()=>{c||f(!0)},disabled:c,className:(0,n.cn)("stg:w-full stg:rounded-md stg:px-2 stg:py-1.5 stg:text-left stg:transition-colors",!c&&"stg:hover:bg-accent-hover stg:cursor-pointer",c&&"stg:cursor-default","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:(0,e.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:gap-2",children:[(0,e.jsx)("pre",{className:(0,n.cn)("stg:min-w-0 stg:whitespace-pre-wrap stg:break-words stg:font-mono stg:text-sm stg:text-foreground",!t&&"stg:text-muted-foreground stg:italic stg:font-sans"),children:t||g}),!c&&(0,e.jsx)(r,{className:"stg:mt-0.5 stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})})}):(0,e.jsxs)("div",{className:(0,n.cn)("stg:flex stg:flex-col stg:gap-1.5",x),children:[(0,e.jsx)("textarea",{ref:j,value:h,onChange:t=>{p(t.target.value),v(null)},onKeyDown:N,disabled:d,placeholder:g,rows:l,className:(0,n.cn)("stg:w-full stg:resize-y stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-3 stg:py-2 stg:font-mono stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50",w&&"stg:border-destructive")}),(0,e.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,e.jsx)("span",{className:"stg:text-[10px] stg:text-muted-foreground",children:d?"Saving...":"Ctrl+Enter to save, Escape to cancel"}),(0,e.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,e.jsx)("button",{type:"button",onClick:k,disabled:d,className:(0,n.cn)("stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:"Cancel"}),(0,e.jsxs)("button",{type:"button",onClick:y,disabled:d,className:(0,n.cn)("stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:[d&&(0,e.jsx)(i,{}),"Save"]})]})]}),w&&(0,e.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:w})]})}])},484763,t=>{"use strict";var e=t.i(843476),s=t.i(271645),n=t.i(981922),r=t.i(213149);t.s(["useManageAccess",0,function({resource:t,visibility:i,extraSection:a,label:g="Manage access"}){let[o,l]=(0,s.useState)(!1),{allowed:c}=(0,n.useCheckPermission)(t?{kind:t.kindString,id:t.id}:null,"can_view_access"),d=(0,s.useCallback)(()=>l(!0),[]);return{action:t&&c?{id:"manage-access",label:g,group:"sharing",onAction:d}:null,dialog:t?(0,e.jsx)(r.ManageAccessDialog,{open:o,onOpenChange:l,resource:t,visibility:i,extraSection:a}):null,open:d,isOpen:o}}])},141249,t=>{"use strict";var e=t.i(843476);t.s(["PluginIcon",0,function({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M6 2.5a1.5 1.5 0 0 1 3 0V4h2.5A1.5 1.5 0 0 1 13 5.5V8h-1.5a1.5 1.5 0 0 0 0 3H13v2.5a1.5 1.5 0 0 1-1.5 1.5H9v-1.5a1.5 1.5 0 0 0-3 0V15H3.5A1.5 1.5 0 0 1 2 13.5V11h1.5a1.5 1.5 0 0 0 0-3H2V5.5A1.5 1.5 0 0 1 3.5 4H6V2.5Z"})})}])},292420,t=>{"use strict";var e=t.i(843476),s=t.i(893976),n=t.i(141249);t.s(["ManagedByPluginNotice",0,function({plugin:t,onPluginClick:r,className:i}){if(null===t)return null;let a=t.metadata,g=a?.name||a?.slug||"a plugin",o=a?{org:a.org,slug:a.slug}:null;return(0,e.jsxs)("div",{role:"note",className:(0,s.cn)("stg:flex stg:items-start stg:gap-2 stg:rounded-md stg:border stg:border-border stg:bg-muted stg:px-3 stg:py-2 stg:text-sm stg:text-foreground",i),children:[(0,e.jsx)(n.PluginIcon,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0 stg:text-muted-foreground"}),(0,e.jsxs)("p",{children:["Installed by the plugin"," ",r&&o?(0,e.jsx)("button",{type:"button",onClick:()=>r(o),className:"stg:cursor-pointer stg:font-medium stg:underline stg:decoration-dotted stg:underline-offset-2 stg:hover:text-primary",children:g}):(0,e.jsx)("span",{className:"stg:font-medium",children:g}),". To change it, change the plugin and push it again; to customise, compose your own agent over its skills and servers."]})]})}])},473489,t=>{"use strict";var e=t.i(271645),s=t.i(910304),n=t.i(586108),r=t.i(583093);let i="stigmer.ai/plugin";t.s(["PLUGIN_LABEL",0,i,"useManagingPlugin",0,function(t){let a=(0,n.useStigmer)(),g=t?.[i]??null,{data:o,isLoading:l}=(0,r.useFetch)(g?async()=>{try{return await a.plugin.get(g)}catch(t){if((0,s.isNotFound)(t))return null;throw t}}:null,[g,a],null);return(0,e.useMemo)(()=>({plugin:o,isLoading:l}),[o,l])}])},244990,t=>{"use strict";var e=t.i(843476),s=t.i(271645),n=t.i(893976);function r({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M11.5 1.5a2.121 2.121 0 0 1 3 3L5 14l-4 1 1-4Z"})})}function i({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,e.jsx)("path",{d:"m3 8.5 3.5 3.5 6.5-8"})})}function a({className:t}){return(0,e.jsx)("svg",{className:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,e.jsx)("path",{d:"m4 4 8 8M12 4l-8 8"})})}function g(){return(0,e.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",className:"stg:animate-spin","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M8 2a6 6 0 1 0 6 6"})})}t.s(["InlineEditText",0,function({value:t,onSave:o,placeholder:l="Click to edit",validate:c,variant:d="default",disabled:u,isSaving:x,error:m,className:f}){let[h,p]=(0,s.useState)(!1),[b,v]=(0,s.useState)(t),[j,y]=(0,s.useState)(null),k=(0,s.useRef)(null);(0,s.useEffect)(()=>{h&&(v(t),y(null),requestAnimationFrame(()=>k.current?.focus()))},[h,t]);let N=(0,s.useCallback)(async()=>{let e=b.trim();if(e===t)return void p(!1);if(c){let t=c(e);if(t)return void y(t)}await o(e)&&p(!1)},[b,t,c,o]),w=(0,s.useCallback)(()=>{p(!1),v(t),y(null)},[t]),C=(0,s.useCallback)(t=>{"Enter"===t.key?(t.preventDefault(),N()):"Escape"===t.key&&w()},[N,w]),M=j||m;return u||!h?(0,e.jsx)("div",{className:(0,n.cn)("stg:group/inline-edit",f),children:(0,e.jsxs)("button",{type:"button",onClick:()=>{u||p(!0)},disabled:u,className:(0,n.cn)("stg:inline-flex stg:w-full stg:items-center stg:gap-1.5 stg:rounded-md stg:px-1.5 stg:py-0.5 stg:text-left stg:transition-colors",!u&&"stg:hover:bg-accent-hover stg:cursor-pointer",u&&"stg:cursor-default","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-inset stg:focus-visible:ring-ring"),children:[(0,e.jsx)("span",{className:(0,n.cn)("stg:min-w-0 stg:truncate","heading"===d?"stg:text-lg stg:font-semibold stg:text-foreground":"stg:text-sm stg:text-foreground",!t&&"stg:text-muted-foreground stg:italic"),children:t||l}),!u&&(0,e.jsx)(r,{className:"stg:size-3 stg:shrink-0 stg:text-muted-foreground stg:opacity-0 stg:transition-opacity stg:group-hover/inline-edit:opacity-100"})]})}):(0,e.jsxs)("div",{className:(0,n.cn)("stg:flex stg:flex-col stg:gap-1",f),children:[(0,e.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,e.jsx)("input",{ref:k,type:"text",value:b,onChange:t=>{v(t.target.value),y(null)},onKeyDown:C,disabled:x,placeholder:l,className:(0,n.cn)("stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-input-bg stg:px-2 stg:py-1 stg:text-sm stg:text-foreground","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring","stg:disabled:opacity-50","heading"===d&&"stg:text-lg stg:font-semibold",M&&"stg:border-destructive")}),(0,e.jsx)("button",{type:"button",onClick:N,disabled:x,"aria-label":"Save",className:(0,n.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:x?(0,e.jsx)(g,{}):(0,e.jsx)(i,{className:"stg:size-3.5"})}),(0,e.jsx)("button",{type:"button",onClick:w,disabled:x,"aria-label":"Cancel",className:(0,n.cn)("stg:inline-flex stg:size-7 stg:items-center stg:justify-center stg:rounded-md","stg:border stg:border-border stg:bg-background stg:text-foreground stg:hover:bg-accent stg:hover:text-accent-foreground","stg:disabled:opacity-50","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring"),children:(0,e.jsx)(a,{className:"stg:size-3.5"})})]}),M&&(0,e.jsx)("p",{className:"stg:px-1 stg:text-xs stg:text-destructive",role:"alert",children:M})]})}])}]);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,630983,e=>{"use strict";var t=e.i(843476),s=e.i(893976);function a({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6.25"}),(0,t.jsx)("path",{d:"M8 7v4"}),(0,t.jsx)("circle",{cx:"8",cy:"5",r:"0.5",fill:"currentColor",stroke:"none"})]})}e.s(["CloudFeatureNotice",0,function({children:e,className:r}){return(0,t.jsxs)("div",{role:"status",className:(0,s.cn)("stg:bg-muted-subtle stg:text-muted-foreground stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-transparent stg:px-4 stg:py-3",r),children:[(0,t.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsx)("p",{className:"stg:text-xs stg:leading-relaxed",children:e})]})}])},543727,914118,582688,e=>{"use strict";var t=e.i(843476);function s({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M5.04 15.17a2.52 2.52 0 1 1-2.52-2.52h2.52v2.52zM6.31 15.17a2.52 2.52 0 0 1 5.04 0v6.31a2.52 2.52 0 1 1-5.04 0v-6.31zM8.83 5.04a2.52 2.52 0 1 1 2.52-2.52v2.52H8.83zM8.83 6.31a2.52 2.52 0 0 1 0 5.04H2.52a2.52 2.52 0 1 1 0-5.04h6.31zM18.96 8.83a2.52 2.52 0 1 1 2.52 2.52h-2.52V8.83zM17.69 8.83a2.52 2.52 0 0 1-5.04 0V2.52a2.52 2.52 0 1 1 5.04 0v6.31zM15.17 18.96a2.52 2.52 0 1 1-2.52 2.52v-2.52h2.52zM15.17 17.69a2.52 2.52 0 0 1 0-5.04h6.31a2.52 2.52 0 1 1 0 5.04h-6.31z"})})}function a({className:e}){return(0,t.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"})})}e.s(["SlackMarkIcon",0,s],914118),e.s(["WhatsAppMarkIcon",0,a],582688);let r=[{id:"slack",label:"Slack",Icon:s,installStyle:"redirect",supportsMessageTemplates:!1,supportsStaffReplies:!1,timelineIncludesCustomerMessages:!1},{id:"whatsapp",label:"WhatsApp",Icon:a,installStyle:"direct",supportsMessageTemplates:!0,supportsStaffReplies:!0,timelineIncludesCustomerMessages:!0}];e.s(["CHANNEL_PROVIDERS",0,r,"channelProviderOf",0,function(e){return r.find(t=>t.id===e)??null}],543727)},699187,e=>{"use strict";var t=e.i(891287),s=e.i(109623),a=e.i(586108),r=e.i(583093);e.s(["useChannelAppList",0,function(e){let n=(0,a.useStigmer)(),{data:i,isLoading:l,isRefetching:o,error:c,refetch:d}=(0,r.useFetch)(e?()=>n.channelapp.listByOrg((0,t.create)(s.ListChannelAppsByOrgInputSchema,{org:e})).then(e=>[...e.entries]):null,[e,n],[]);return{channelApps:i,isLoading:l,isRefetching:o,error:c,refetch:d}}])},507768,e=>{"use strict";var t=e.i(843476),s=e.i(271645),a=e.i(893976),r=e.i(610595),n=e.i(17616),i=e.i(543727),l=e.i(699187);function o({org:e,onEdit:s,onRefetchRef:n,className:i}){let{channelApps:d,isLoading:g,error:p,refetch:u}=(0,l.useChannelAppList)(e);return(n&&n(u),g)?(0,t.jsx)("div",{className:(0,a.cn)("stg:space-y-2",i),"aria-busy":"true","aria-label":"Loading channel apps",children:Array.from({length:2},(e,s)=>(0,t.jsx)("div",{className:"stg:bg-muted-subtle stg:h-14 stg:animate-pulse stg:rounded-lg"},s))}):p?(0,t.jsx)("p",{className:(0,a.cn)("stg:text-destructive stg:text-xs",i),role:"alert",children:(0,r.getUserMessage)(p)}):0===d.length?(0,t.jsx)("p",{className:(0,a.cn)("stg:text-muted-foreground stg:py-4 stg:text-center stg:text-xs",i),children:"No channel apps registered yet."}):(0,t.jsx)("div",{className:(0,a.cn)("stg:space-y-2",i),role:"list","aria-label":"Channel apps",children:d.map(e=>(0,t.jsx)(c,{channelApp:e,onEdit:s?()=>s(e):void 0},e.metadata?.id??""))})}function c({channelApp:e,onEdit:s}){let r=e.metadata?.name??"",l=e.spec?.providerConfig?.case,o=(0,i.channelProviderOf)(l),g=e.spec?.providerConfig?.case==="slack"?e.spec.providerConfig.value.clientId:e.spec?.providerConfig?.case==="whatsapp"?e.spec.providerConfig.value.appId:void 0,p=e.status?.audit?.specAudit?.createdAt;return(0,t.jsxs)("div",{role:"listitem",className:(0,a.cn)("stg:border-border stg:bg-card stg:flex stg:items-center stg:gap-3 stg:rounded-lg stg:border stg:px-3 stg:py-2.5"),children:[(0,t.jsxs)("div",{className:"stg:min-w-0 stg:flex-1",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:font-medium stg:text-foreground",children:r}),(0,t.jsx)("span",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:o?.label??l??""})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-baseline stg:gap-2",children:[g&&(0,t.jsx)("span",{className:"stg:truncate stg:font-mono stg:text-[0.65rem] stg:text-muted-foreground",children:g}),p&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.65rem] stg:text-muted-foreground",children:(0,n.timestampDate)(p).toLocaleDateString()})]})]}),s&&(0,t.jsx)("button",{type:"button",onClick:s,"aria-label":`Edit ${r}`,className:(0,a.cn)("stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover","stg:shrink-0 stg:rounded-md stg:p-1.5 stg:transition-colors"),children:(0,t.jsx)(d,{})})]})}function d(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M11.5 2.5a1.4 1.4 0 0 1 2 2L5 13l-3 1 1-3 8.5-8.5z"})})}var g=e.i(869803),p=e.i(586108),u=e.i(326283);let m=["app_mentions:read","assistant:write","chat:write","im:history"],h=["app_home_opened","app_mention","app_uninstalled","assistant_thread_context_changed","assistant_thread_started","message.im","tokens_revoked"];function x(e){let t=e??window.location.origin;return`${t.replace(/\/+$/,"")}/oauth/slack/callback`}function f(e){let t=e.description??"Chat with your organization's Stigmer agent without leaving Slack.",s=e.webhookUrl?` event_subscriptions:
|
|
2
|
-
request_url: "${e.webhookUrl}"
|
|
3
|
-
bot_events:
|
|
4
|
-
${h.map(e=>` - ${e}`).join("\n")}
|
|
5
|
-
`:"";return`display_information:
|
|
6
|
-
name: ${e.name}
|
|
7
|
-
description: ${t}
|
|
8
|
-
|
|
9
|
-
features:
|
|
10
|
-
app_home:
|
|
11
|
-
home_tab_enabled: false
|
|
12
|
-
messages_tab_enabled: true
|
|
13
|
-
messages_tab_read_only_enabled: false
|
|
14
|
-
bot_user:
|
|
15
|
-
display_name: ${e.name}
|
|
16
|
-
always_online: true
|
|
17
|
-
assistant_view:
|
|
18
|
-
assistant_description: ${t}
|
|
19
|
-
suggested_prompts: []
|
|
20
|
-
|
|
21
|
-
oauth_config:
|
|
22
|
-
redirect_urls:
|
|
23
|
-
- "${e.redirectUrl}"
|
|
24
|
-
scopes:
|
|
25
|
-
bot:
|
|
26
|
-
${m.map(e=>` - ${e}`).join("\n")}
|
|
27
|
-
|
|
28
|
-
settings:
|
|
29
|
-
${s} interactivity:
|
|
30
|
-
is_enabled: false
|
|
31
|
-
org_deploy_enabled: false
|
|
32
|
-
socket_mode_enabled: false
|
|
33
|
-
token_rotation_enabled: false
|
|
34
|
-
`}let b=["messages"];function v(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}var y=e.i(364802),j=e.i(193799);function k({id:e,label:s,value:r,onChange:n,placeholder:i,hint:l,type:o="text",disabled:c,required:d}){return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("label",{htmlFor:e,className:"stg:text-xs stg:font-medium stg:text-foreground",children:s}),(0,t.jsx)("input",{id:e,type:o,value:r,onChange:e=>n(e.target.value),placeholder:i,disabled:c,required:d,className:(0,a.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")}),l&&(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:l})]})}function N({label:e,value:s,copyTargetId:r}){let{copied:n,copy:i}=w(s);return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:e}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)(y.TruncatedText,{text:s,className:(0,a.cn)("stg:min-w-0 stg:flex-1 stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle","stg:px-2 stg:py-1.5 stg:font-mono stg:text-[0.65rem] stg:text-foreground")}),(0,t.jsx)(S,{copied:n,onCopy:i,copyTargetId:r})]})]})}function C({label:e,value:s,copyTargetId:r}){let{copied:n,copy:i}=w(s);return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:e}),(0,t.jsx)(S,{copied:n,onCopy:i,copyTargetId:r})]}),(0,t.jsx)("pre",{className:(0,a.cn)("stg:max-h-40 stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-muted-subtle","stg:px-2.5 stg:py-2 stg:font-mono stg:text-[0.65rem] stg:leading-relaxed stg:text-foreground"),children:s})]})}function S({copied:e,onCopy:s,copyTargetId:r}){return(0,t.jsx)("button",{type:"button",onClick:s,"data-cursor-target":r,className:(0,a.cn)("stg:shrink-0 stg:rounded-md stg:border stg:border-border stg:px-2 stg:py-1 stg:text-[0.65rem] stg:font-medium stg:transition-colors",e?"stg:text-success":"stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover"),"aria-live":"polite",children:e?"Copied":"Copy"})}function w(e){let{copy:t,copied:a}=(0,j.useCopyFeedback)();return{copied:a,copy:(0,s.useCallback)(()=>{t(e)},[t,e])}}var A=e.i(379410);function I({org:e,consoleOrigin:n,onCreated:i,onCancel:l,className:o}){let c=(0,s.useId)(),{create:d,isCreating:g,error:m,clearError:h}=function(){let e=(0,p.useStigmer)(),[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>n(null),[]);return{create:(0,s.useCallback)(async t=>{a(!0),n(null);try{return await e.channelapp.create(t)}catch(e){throw n((0,u.toError)(e)),e}finally{a(!1)}},[e]),isCreating:t,error:r,clearError:i}}(),[b,y]=(0,s.useState)("slack"),[j,N]=(0,s.useState)(""),[C,S]=(0,s.useState)(""),[w,T]=(0,s.useState)(""),[U,D]=(0,s.useState)(""),[L,R]=(0,s.useState)(""),[q,E]=(0,s.useState)(""),[z,B]=(0,s.useState)(""),[F,O]=(0,s.useState)(v),V=j.trim(),W=(0,s.useMemo)(()=>f({name:V||"Your Bot Name",redirectUrl:x(n)}),[V,n]),P="slack"===b?""!==C.trim()&&""!==w.trim()&&""!==U.trim():""!==L.trim()&&""!==q.trim()&&""!==z.trim()&&""!==F.trim(),H=""!==V&&P&&!g,K=(0,s.useCallback)(async t=>{if(t.preventDefault(),H){h();try{let t=await d({name:V,org:e,..."slack"===b?{slack:{clientId:C.trim(),clientSecret:w.trim(),signingSecret:U.trim()}}:{whatsapp:{appId:L.trim(),appSecret:q.trim(),accessToken:z.trim(),verifyToken:F.trim()}}});i?.(t,"whatsapp"===b?{verifyToken:F.trim()}:{})}catch{}}},[H,V,e,b,C,w,U,L,q,z,F,d,h,i]);return(0,t.jsxs)("form",{onSubmit:K,className:(0,a.cn)("stg:space-y-4",o),children:[(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)(_,{value:b,onChange:y,disabled:g}),(0,t.jsx)(k,{id:`${c}-name`,label:"Name",value:j,onChange:N,placeholder:"slack"===b?"e.g. Acme Support Bot":"e.g. Acme WhatsApp",hint:"slack"===b?"The bot name your workspace will @mention":"Names the app in Stigmer — pick something that identifies the Meta app",disabled:g,required:!0}),"slack"===b?(0,t.jsx)(M,{manifest:W,clientId:C,onClientIdChange:S,clientSecret:w,onClientSecretChange:T,signingSecret:U,onSigningSecretChange:D,disabled:g}):(0,t.jsx)($,{appId:L,onAppIdChange:R,appSecret:q,onAppSecretChange:E,accessToken:z,onAccessTokenChange:B,verifyToken:F,onVerifyTokenChange:O,disabled:g})]}),m&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(m)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!H,className:(0,a.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:[g&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Register channel app"]}),l&&(0,t.jsx)("button",{type:"button",onClick:l,disabled:g,className:(0,a.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"})]})]})}function _({value:e,onChange:r,disabled:n}){let l=(0,s.useId)();return(0,t.jsxs)("fieldset",{className:g.UNSTYLED_FIELDSET,children:[(0,t.jsx)("legend",{className:"stg:mb-1.5 stg:block stg:text-xs stg:font-medium stg:text-foreground",children:"Provider"}),(0,t.jsx)("div",{role:"radiogroup",className:"stg:flex stg:gap-1.5",children:i.CHANNEL_PROVIDERS.map(s=>{let i=e===s.id;return(0,t.jsxs)("label",{htmlFor:`stgm-chapp-provider-${s.id}`,className:(0,a.cn)("stg:flex stg:flex-1 stg:cursor-pointer stg:items-center stg:gap-2 stg:rounded-md stg:border stg:px-2.5 stg:py-1.5",i?"stg:border-ring stg:bg-accent":"stg:border-border stg:hover:bg-accent-hover",n&&"stg:pointer-events-none stg:opacity-50"),children:[(0,t.jsx)("input",{id:`stgm-chapp-provider-${s.id}`,type:"radio",name:`${l}-provider`,checked:i,onChange:()=>r(s.id),disabled:n,className:"stg:accent-current"}),(0,t.jsx)(s.Icon,{className:"stg:size-3.5 stg:shrink-0 stg:text-foreground"}),(0,t.jsx)("span",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:s.label})]},s.id)})})]})}function M({manifest:e,clientId:a,onClientIdChange:r,clientSecret:n,onClientSecretChange:i,signingSecret:l,onSigningSecretChange:o,disabled:c}){let d=(0,s.useId)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"1. Create the Slack app"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On"," ",(0,t.jsx)("a",{href:"https://api.slack.com/apps?new_app=1",target:"_blank",rel:"noreferrer",className:"stg:text-primary stg:hover:text-foreground stg:underline stg:transition-colors",children:"api.slack.com/apps"}),", choose ",(0,t.jsx)("span",{className:"stg:font-medium",children:"From a manifest"})," and paste this. Event subscriptions come after the next step — the webhook URL is minted when this form is saved."]}),(0,t.jsx)(C,{label:"Slack app manifest",value:e,copyTargetId:"stgm-chapp-manifest-copy"})]}),(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"2. Paste the app's credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["From the app's ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Basic Information"})," page. They are encrypted at rest and never shown again."]}),(0,t.jsx)(k,{id:`${d}-client-id`,label:"Client ID",value:a,onChange:r,placeholder:"1234567890.0987654321",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${d}-client-secret`,label:"Client secret",value:n,onChange:i,placeholder:"Client secret",type:"password",disabled:c,required:!0}),(0,t.jsx)(k,{id:`${d}-signing-secret`,label:"Signing secret",value:l,onChange:o,placeholder:"Signing secret",type:"password",hint:"Verifies that webhook events really come from your app",disabled:c,required:!0})]})]})}function $({appId:e,onAppIdChange:a,appSecret:r,onAppSecretChange:n,accessToken:i,onAccessTokenChange:l,verifyToken:o,onVerifyTokenChange:c,disabled:d}){let g=(0,s.useId)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"stg:space-y-1.5",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"1. Create the Meta app"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On"," ",(0,t.jsx)("a",{href:"https://developers.facebook.com/apps",target:"_blank",rel:"noreferrer",className:"stg:text-primary stg:hover:text-foreground stg:underline stg:transition-colors",children:"developers.facebook.com"}),", create a ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Business"}),"-type app and add the ",(0,t.jsx)("span",{className:"stg:font-medium",children:"WhatsApp"})," product. The webhook setup comes after the next step — the webhook URL is minted when this form is saved."]})]}),(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"2. Paste the app's credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["The app ID and secret are on ",(0,t.jsx)("span",{className:"stg:font-medium",children:"App settings → Basic"}),"; mint a long-lived system-user access token with WhatsApp permissions in Meta Business settings. The secrets are encrypted at rest and never shown again."]}),(0,t.jsx)(k,{id:`${g}-app-id`,label:"App ID",value:e,onChange:a,placeholder:"1234567890123456",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${g}-app-secret`,label:"App secret",value:r,onChange:n,placeholder:"App secret",type:"password",hint:"Verifies that webhook events really come from your app",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${g}-access-token`,label:"Access token",value:i,onChange:l,placeholder:"Long-lived system-user access token",type:"password",hint:"Sends messages on behalf of your WhatsApp Business account",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${g}-verify-token`,label:"Verify token",value:o,onChange:c,placeholder:"Verify token",hint:"Generated for you — you'll paste this same value into Meta's webhook configuration after registering. Replace it if your Meta app already has one.",disabled:d,required:!0})]})]})}var T=e.i(857897);function U(){let e=(0,p.useStigmer)(),[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>n(null),[]);return{update:(0,s.useCallback)(async t=>{a(!0),n(null);try{return await e.channelapp.update(t)}catch(e){throw n((0,u.toError)(e)),e}finally{a(!1)}},[e]),isUpdating:t,error:r,clearError:i}}function D({channelApp:e,consoleOrigin:n,createHandoff:i,onUpdated:l,onDeleted:o,onBack:c,className:d}){let{deleteApp:g,isDeleting:m,error:h}=function(){let e=(0,p.useStigmer)(),[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(null),i=(0,s.useCallback)(()=>n(null),[]);return{deleteApp:(0,s.useCallback)(async t=>{a(!0),n(null);try{return await e.channelapp.delete({resourceId:t})}catch(e){throw n((0,u.toError)(e)),e}finally{a(!1)}},[e]),isDeleting:t,error:r,clearError:i}}(),[x,f]=(0,s.useState)(!1),b=e.metadata?.id??"",v=e.metadata?.name??"",y=e.spec?.providerConfig?.case,j=(0,s.useCallback)(async()=>{try{await g(b),o?.()}catch{}finally{f(!1)}},[g,b,o]);return(0,t.jsxs)("div",{className:(0,a.cn)("stg:space-y-5",d),children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between",children:[(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("h3",{className:"stg:truncate stg:text-sm stg:font-semibold stg:text-foreground",children:v}),(0,t.jsx)("p",{className:"stg:font-mono stg:text-[0.65rem] stg:text-muted-foreground",children:b})]}),c&&(0,t.jsx)("button",{type:"button",onClick:c,className:"stg:text-muted-foreground stg:hover:text-foreground stg:shrink-0 stg:text-xs stg:transition-colors",children:"← Back"})]}),"slack"===y?(0,t.jsx)(L,{channelApp:e,consoleOrigin:n,onUpdated:l}):"whatsapp"===y?(0,t.jsx)(R,{channelApp:e,createHandoff:i,onUpdated:l}):null,(0,t.jsxs)("section",{className:"stg:border-t stg:border-border stg:pt-3","aria-label":"Danger zone",children:[h&&(0,t.jsx)("p",{className:"stg:text-destructive stg:mb-2 stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(h)}),x?(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-foreground",children:"Delete this channel app? Channels installing through it must be disconnected first."}),(0,t.jsxs)("button",{type:"button",onClick:j,disabled:m,className:(0,a.cn)("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-2.5 stg:py-1 stg:text-xs stg:font-medium","stg:bg-destructive stg:text-destructive-foreground stg:hover:opacity-90","stg:disabled:pointer-events-none stg:disabled:opacity-40"),children:[m&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Delete"]}),(0,t.jsx)("button",{type:"button",onClick:()=>f(!1),disabled:m,className:"stg:text-muted-foreground stg:hover:text-foreground stg:text-xs stg:transition-colors",children:"Keep"})]}):(0,t.jsx)("button",{type:"button",onClick:()=>f(!0),className:"stg:text-destructive stg:text-xs stg:font-medium stg:hover:opacity-80",children:"Delete channel app"})]})]})}function L({channelApp:e,consoleOrigin:n,onUpdated:i}){let l=(0,s.useId)(),o=(0,p.useStigmer)(),{update:c,isUpdating:d,error:g,clearError:u}=U(),m=e.spec?.providerConfig?.case==="slack"?e.spec.providerConfig.value:void 0,[h,b]=(0,s.useState)(m?.clientId??""),[v,y]=(0,s.useState)(m?.clientSecret??""),[j,S]=(0,s.useState)(m?.signingSecret??""),w=e.metadata?.id??"",I=e.metadata?.name??"",_=(0,s.useMemo)(()=>{var e;return e=o.baseUrl,`${e.replace(/\/+$/,"")}/webhook/slack/${w}`},[o.baseUrl,w]),M=(0,s.useMemo)(()=>x(n),[n]),$=(0,s.useMemo)(()=>f({name:I,redirectUrl:M,webhookUrl:_}),[I,M,_]),D=""!==h.trim()&&""!==v.trim()&&""!==j.trim()&&!d,R=(0,s.useCallback)(async t=>{if(t.preventDefault(),D){u();try{let t=await c({...(0,T.toChannelAppUpdateInput)(e),slack:{clientId:h.trim(),clientSecret:v.trim(),signingSecret:j.trim()}});i?.(t)}catch{}}},[D,u,c,e,h,v,j,i]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"stg:space-y-2","aria-label":"Finish setup in Slack",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Finish setup in Slack"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On the app's ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Event Subscriptions"})," page, enable events and set the request URL below (Slack verifies it immediately). The completed manifest is also available for review or re-paste."]}),(0,t.jsx)(N,{label:"Events request URL",value:_,copyTargetId:"stgm-chapp-webhook-copy"}),(0,t.jsx)(N,{label:"OAuth redirect URL",value:M}),(0,t.jsx)(C,{label:"Completed app manifest",value:$})]}),(0,t.jsxs)("form",{onSubmit:R,className:"stg:space-y-3","aria-label":"Credentials",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["Secrets show as ",(0,t.jsx)("code",{className:"stg:font-mono",children:"***REDACTED***"}),"; leave a field untouched to keep its stored value, or paste a new one to rotate it."]}),(0,t.jsx)(k,{id:`${l}-client-id`,label:"Client ID",value:h,onChange:b,placeholder:"1234567890.0987654321",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${l}-client-secret`,label:"Client secret",value:v,onChange:y,placeholder:"Client secret",type:"password",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${l}-signing-secret`,label:"Signing secret",value:j,onChange:S,placeholder:"Signing secret",type:"password",disabled:d,required:!0}),g&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(g)}),(0,t.jsxs)("button",{type:"submit",disabled:!D,className:(0,a.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:[d&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Save credentials"]})]})]})}function R({channelApp:e,createHandoff:n,onUpdated:i}){let l=(0,s.useId)(),o=(0,p.useStigmer)(),{update:c,isUpdating:d,error:g,clearError:u}=U(),m=e.spec?.providerConfig?.case==="whatsapp"?e.spec.providerConfig.value:void 0,[h,x]=(0,s.useState)(m?.appId??""),[f,v]=(0,s.useState)(m?.appSecret??""),[y,j]=(0,s.useState)(m?.accessToken??""),[C,S]=(0,s.useState)(m?.verifyToken??""),w=e.metadata?.id??"";e.metadata?.name;let I=(0,s.useMemo)(()=>{var e;return e=o.baseUrl,`${e.replace(/\/+$/,"")}/webhook/whatsapp/${w}`},[o.baseUrl,w]),_=""!==h.trim()&&""!==f.trim()&&""!==y.trim()&&""!==C.trim()&&!d,M=(0,s.useCallback)(async t=>{if(t.preventDefault(),_){u();try{let t=await c({...(0,T.toChannelAppUpdateInput)(e),whatsapp:{appId:h.trim(),appSecret:f.trim(),accessToken:y.trim(),verifyToken:C.trim()}});i?.(t)}catch{}}},[_,u,c,e,h,f,y,C,i]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("section",{className:"stg:space-y-2","aria-label":"Finish setup in Meta",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Finish setup in Meta"}),(0,t.jsxs)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:["On the app's ",(0,t.jsx)("span",{className:"stg:font-medium",children:"WhatsApp → Configuration"})," page, set the callback URL and verify token below, click ",(0,t.jsx)("span",{className:"stg:font-medium",children:"Verify and save"})," ","(Meta verifies immediately), then subscribe to the"," ",(0,t.jsx)("span",{className:"stg:font-medium",children:b.join(", ")})," ","webhook field."]}),(0,t.jsx)(N,{label:"Callback URL",value:I,copyTargetId:"stgm-chapp-webhook-copy"}),n?.verifyToken?(0,t.jsx)(N,{label:"Verify token",value:n.verifyToken,copyTargetId:"stgm-chapp-verify-token-copy"}):(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Verify token"}),(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:"Shown once at registration. If you no longer have it, paste a new one below and update Meta's webhook configuration to match."})]})]}),(0,t.jsxs)("form",{onSubmit:M,className:"stg:space-y-3","aria-label":"Credentials",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Credentials"}),(0,t.jsxs)("p",{className:"stg:-mt-2 stg:text-[0.65rem] stg:text-muted-foreground",children:["Secrets show as ",(0,t.jsx)("code",{className:"stg:font-mono",children:"***REDACTED***"}),"; leave a field untouched to keep its stored value, or paste a new one to rotate it."]}),(0,t.jsx)(k,{id:`${l}-app-id`,label:"App ID",value:h,onChange:x,placeholder:"1234567890123456",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${l}-app-secret`,label:"App secret",value:f,onChange:v,placeholder:"App secret",type:"password",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${l}-access-token`,label:"Access token",value:y,onChange:j,placeholder:"Long-lived system-user access token",type:"password",disabled:d,required:!0}),(0,t.jsx)(k,{id:`${l}-verify-token`,label:"Verify token",value:C,onChange:S,placeholder:"Verify token",type:"password",hint:"Rotating it? Update Meta's webhook configuration to the same value.",disabled:d,required:!0}),g&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,r.getUserMessage)(g)}),(0,t.jsxs)("button",{type:"submit",disabled:!_,className:(0,a.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:[d&&(0,t.jsx)(A.SpinnerIcon,{size:12}),"Save credentials"]})]})]})}var q=e.i(597744),E=e.i(630983),z=e.i(297629);e.s(["ChannelAppsSection",0,function(){let e=(0,s.useId)(),a=(0,z.useActiveOrgSlug)(),r="cloud"===(0,q.useDeploymentMode)(),[n,i]=(0,s.useState)({phase:"idle"}),l=(0,s.useRef)(null),c=(0,s.useCallback)(e=>{l.current=e},[]),d=(0,s.useCallback)((e,t)=>{l.current?.(),i({phase:"editing",channelApp:e,createHandoff:t})},[]),g=(0,s.useCallback)(()=>{l.current?.(),i({phase:"idle"})},[]),p=(0,s.useCallback)(()=>{l.current?.(),i({phase:"idle"})},[]);return(0,t.jsxs)("section",{"aria-labelledby":e,children:[(0,t.jsxs)("div",{className:"stg:mb-3 stg:flex stg:items-center stg:justify-between",children:[(0,t.jsx)("h2",{id:e,className:"stg:text-foreground stg:text-sm stg:font-semibold",children:"Channel Apps"}),r&&a&&"idle"===n.phase&&(0,t.jsx)("button",{type:"button",onClick:()=>i({phase:"creating"}),className:"stg:text-primary stg:hover:text-foreground stg:text-xs stg:font-medium stg:transition-colors",children:"+ New channel app"})]}),(0,t.jsx)("p",{className:"stg:text-muted-foreground stg:mb-4 stg:text-xs",children:"Your own provider apps for serving agent channels. A Slack app gives the bot your name and icon, and lets multiple agents serve the same workspace — one per app. A Meta app is how WhatsApp channels connect — every WhatsApp channel installs through one."}),r?"creating"===n.phase?(0,t.jsx)("div",{className:"stg:border-border stg:bg-card stg:rounded-lg stg:border stg:p-4",children:(0,t.jsx)(I,{org:a,onCreated:d,onCancel:()=>i({phase:"idle"})})}):"editing"===n.phase?(0,t.jsx)("div",{className:"stg:border-border stg:bg-card stg:rounded-lg stg:border stg:p-4",children:(0,t.jsx)(D,{channelApp:n.channelApp,createHandoff:n.createHandoff,onUpdated:g,onDeleted:p,onBack:()=>i({phase:"idle"})})}):(0,t.jsx)(o,{org:a,onEdit:e=>i({phase:"editing",channelApp:e}),onRefetchRef:c}):(0,t.jsx)(E.CloudFeatureNotice,{children:"Channel apps are not available in local mode. Channel installs require Stigmer Cloud."})]})}],507768)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,367539,e=>{"use strict";e.s(["generateSlug",0,function(e){return e.toLowerCase().replace(/[ .]/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"")},"generateSlugSuffix",0,function(){return crypto.randomUUID().replace(/-/g,"").slice(0,8)}])},348990,e=>{"use strict";var t=e.i(271645),r=e.i(891287),s=e.i(95265),n=e.i(586108),a=e.i(583093);e.s(["useEnvironmentList",0,function(e,o){let i=(0,n.useStigmer)(),l=(0,t.useRef)(o);o!==l.current&&JSON.stringify(o)!==JSON.stringify(l.current)&&(l.current=o);let u=l.current,c=e?async()=>{let t=await i.environment.list((0,r.create)(s.ListEnvironmentsRequestSchema,{org:e,labels:u??{}}));return{environments:t.items,totalCount:t.totalCount}}:null,{data:d,isLoading:g,isRefetching:h,error:p,refetch:m}=(0,a.useFetch)(c,[e,u,i],{environments:[],totalCount:0});return{environments:d.environments,totalCount:d.totalCount,isLoading:g,isRefetching:h,error:p,refetch:m}}])},207344,e=>{"use strict";var t=e.i(271645),r=e.i(891287),s=e.i(95265),n=e.i(621559),a=e.i(586108),o=e.i(367539),i=e.i(326283),l=e.i(348990);let u={"stigmer.ai/personal":"true"};e.s(["usePersonalEnvironment",0,function(e){let c=(0,a.useStigmer)(),{environments:d,isLoading:g,error:h,refetch:p}=(0,l.useEnvironmentList)(e,u),m=(0,t.useMemo)(()=>d[0]??null,[d]),[v,f]=(0,t.useState)(!1),[b,x]=(0,t.useState)(null),S=(0,t.useRef)(m);S.current=m;let y=(0,t.useRef)(g);y.current=g;let w=(0,t.useCallback)(async t=>{if(S.current)return S.current;if(!e)throw Error("usePersonalEnvironment: cannot call getOrCreate when org is null.");if(y.current)throw Error("usePersonalEnvironment: cannot call getOrCreate while the environment list is loading. Wait for isLoading to become false before calling getOrCreate().");f(!0),x(null);try{let r;t&&Object.keys(t).length>0&&(r=t);let s=await c.environment.create({name:"Personal Environment",slug:`env-personal-${(0,o.generateSlugSuffix)()}`,org:e,labels:u,data:r});return S.current=s,p(),s}catch(e){throw x((0,i.toError)(e)),e}finally{f(!1)}},[e,c,p]),k=(0,t.useCallback)(async e=>{let t=S.current;if(!t)throw Error("usePersonalEnvironment: personal environment does not exist. Call getOrCreate() before addVariables().");f(!0),x(null);try{let a=Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(0,r.create)(n.EnvironmentValueSchema,{value:t.value,isSecret:t.isSecret,description:t.description})])),o=(0,r.create)(s.UpdateEnvironmentVariablesRequestSchema,{environmentId:t.metadata.id,variables:a}),i=await c.environment.updateVariables(o);return p(),i}catch(e){throw x((0,i.toError)(e)),e}finally{f(!1)}},[c,p]),A=(0,t.useCallback)(async e=>{let t=S.current;if(!t)throw Error("usePersonalEnvironment: personal environment does not exist. Call getOrCreate() before removeVariables().");f(!0),x(null);try{let n=(0,r.create)(s.RemoveEnvironmentVariablesRequestSchema,{environmentId:t.metadata.id,keys:e}),a=await c.environment.removeVariables(n);return p(),a}catch(e){throw x((0,i.toError)(e)),e}finally{f(!1)}},[c,p]);return{environment:m,isLoading:g,error:b??h,refetch:p,getOrCreate:w,addVariables:k,removeVariables:A,isMutating:v}}])},521557,e=>{"use strict";e.s(["isUnimplemented",0,function(e){if(!e||"object"!=typeof e)return!1;if("connectCode"in e&&12===e.connectCode)return!0;let t=e.message??"";return t.includes("[unimplemented]")||t.includes("UNIMPLEMENTED")}])},903198,e=>{"use strict";let t="stigmer:oauth:callback",r="stigmer:oauth:broadcast";function s(e){try{e?.close()}catch{}}e.s(["OAUTH_BROADCAST_CHANNEL",0,r,"OAUTH_CALLBACK_MESSAGE_TYPE",0,t,"closeOAuthPopup",0,s,"openOAuthPopup",0,function(){let e=window.screenX+(window.outerWidth-600)/2,t=window.screenY+(window.outerHeight-700)/2;return window.open("about:blank","stigmer_oauth",`width=600,height=700,left=${e},top=${t},popup=yes`)},"popupBlockedError",0,function(){return Error("Your browser blocked the authentication popup. Please allow popups for this site and try again.")},"waitForOAuthCallback",0,function(e,n,a){return new Promise((o,i)=>{let l,u,c=!1,d=null,g=!1;function h(e){if(!c){c=!0,l&&clearTimeout(l),u&&clearInterval(u),window.removeEventListener("message",m);try{d?.close()}catch{}e instanceof Error?i(e):o(e)}}function p(e){if(e?.type===t){if(e.state!==n)return void h(Error("OAuth state mismatch — the callback did not match the initiated flow. Please try again."));if(!e.code)return void h(Error("No authorization code received from the OAuth provider."));h({code:e.code,state:e.state})}}function m(e){e.origin===window.location.origin&&p(e.data)}a(()=>{h(Error("OAuth flow was cancelled.")),s(e)}),window.addEventListener("message",m);try{d=new BroadcastChannel(r),g=!0,d.onmessage=e=>{p(e.data)}}catch{}l=setTimeout(()=>{h(Error("OAuth authentication timed out. Ensure your callback page renders <OAuthCallbackHandler /> from @stigmer/react at the URL configured as your OAuth redirect URI.")),s(e)},12e4);let v=null;u=setInterval(()=>{!g&&(e.closed?null===v?v=Date.now():Date.now()-v>5e3&&h(Error("The authentication window was closed before completing sign-in.")):v=null)},500)})}])},230849,4144,e=>{"use strict";var t=e.i(271645);e.s(["useScrollShadows",0,function(){let e=(0,t.useRef)(null),[r,s]=(0,t.useState)(!1),[n,a]=(0,t.useState)(!1),o=(0,t.useCallback)(()=>{let t=e.current;t&&(s(t.scrollTop>0),a(t.scrollTop+t.clientHeight<t.scrollHeight-1))},[]);return(0,t.useEffect)(()=>{let t=e.current;if(!t)return;t.addEventListener("scroll",o,{passive:!0});let r=new ResizeObserver(o);return r.observe(t),o(),()=>{t.removeEventListener("scroll",o),r.disconnect()}},[o]),{scrollRef:e,canScrollUp:r,canScrollDown:n}}],230849);var r=e.i(843476);e.s(["ScrollFade",0,function({position:e}){let t="top"===e;return(0,r.jsx)("div",{className:["stg:pointer-events-none stg:absolute stg:inset-x-0 stg:z-10 stg:h-3",t?"stg:top-0":"stg:bottom-0"].join(" "),style:{background:t?"linear-gradient(to bottom, var(--color-popover, hsl(0 0% 9%)), transparent)":"linear-gradient(to top, var(--color-popover, hsl(0 0% 9%)), transparent)"},"aria-hidden":"true"})}],4144)},351240,e=>{"use strict";var t=e.i(843476),r=e.i(271645),s=e.i(893976),n=e.i(230849),a=e.i(4144),o=e.i(379410);function i(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"2"})]})}function l(){return(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M6.59 6.59a2 2 0 0 0 2.82 2.82"}),(0,t.jsx)("path",{d:"M10.73 10.73A6.5 6.5 0 0 1 8 12.5c-4 0-6.5-4.5-6.5-4.5a11.5 11.5 0 0 1 3.77-3.73"}),(0,t.jsx)("path",{d:"M5.71 3.56A6.3 6.3 0 0 1 8 3.5c4 0 6.5 4.5 6.5 4.5a11.5 11.5 0 0 1-1.28 1.73"}),(0,t.jsx)("path",{d:"M2 2l12 12"})]})}e.s(["EnvVarForm",0,function({variables:e,onSubmit:u,onCancel:c,isSubmitting:d,disabled:g,title:h,description:p,submitLabel:m,cancelLabel:v="Back",defaultSaveForFuture:f=!0,hideSaveToggle:b=!1,poolValues:x,className:S,ariaLabel:y}){let[w,k]=(0,r.useState)(()=>Object.fromEntries(e.map(e=>{let t=x?.(e.key);return[e.key,t?.value??""]}))),[A]=(0,r.useState)(()=>{if(!x)return new Set;let t=new Set;for(let r of e)x(r.key)&&t.add(r.key);return t}),[O,E]=(0,r.useState)(new Set),[j,C]=(0,r.useState)(f),N=(0,r.useRef)(null),I=(0,n.useScrollShadows)(),M=(0,r.useId)(),P=`${M}-save-toggle`,R=g||d,L=e.every(e=>w[e.key]?.trim()!==""),T=(0,r.useCallback)((e,t)=>{k(r=>({...r,[e]:t}))},[]),U=(0,r.useCallback)(e=>{E(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},[]),_=(0,r.useCallback)(t=>{if(t.preventDefault(),!L||R)return;let r={};for(let t of e)r[t.key]={value:w[t.key],isSecret:t.isSecret,...t.description&&{description:t.description}};u(r,{saveForFuture:j})},[L,R,w,e,u,j]),V=y??(h?`Configure ${h}`:"Configure environment variables"),D=m??(j?"Save":"Use once");return(0,t.jsxs)("form",{onSubmit:_,className:(0,s.cn)("stg:w-72 stg:space-y-3",S),"aria-label":V,children:[h&&(0,t.jsxs)("div",{className:"stg:space-y-0.5",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:h}),p&&(0,t.jsx)("p",{className:"stg:text-[0.65rem] stg:text-muted-foreground",children:p})]}),(0,t.jsxs)("div",{className:"stg:relative",children:[I.canScrollUp&&(0,t.jsx)(a.ScrollFade,{position:"top"}),(0,t.jsx)("div",{ref:I.scrollRef,className:"stg:max-h-64 stg:space-y-2.5 stg:overflow-y-auto",children:e.map((e,r)=>{let n=`${M}-env-${e.key}`,a=e.description?`${n}-desc`:void 0,o=O.has(e.key);return(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsxs)("label",{htmlFor:n,className:"stg:flex stg:items-baseline stg:gap-1.5 stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:[(0,t.jsx)("span",{className:"stg:font-mono",children:e.key}),e.isSecret&&(0,t.jsx)("span",{className:"stg:text-[0.55rem] stg:uppercase stg:tracking-wider stg:text-muted-foreground-subtle",children:"secret"})]}),(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("input",{ref:0===r?N:void 0,id:n,type:e.isSecret&&!o?"password":"text",value:w[e.key],onChange:t=>T(e.key,t.target.value),disabled:R,required:!0,"aria-required":!0,"aria-describedby":a,autoComplete:"off",autoFocus:0===r,className:(0,s.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-2 stg:focus-visible:ring-ring","stg:disabled:pointer-events-none stg:disabled:opacity-50",e.isSecret&&"stg:pr-8")}),e.isSecret&&(0,t.jsx)("button",{type:"button",onClick:()=>U(e.key),disabled:R,className:(0,s.cn)("stg:absolute stg:right-2 stg:top-1/2 stg:-translate-y-1/2","stg:text-muted-foreground stg:hover:text-foreground","stg:disabled:pointer-events-none stg:disabled:opacity-50"),"aria-label":o?`Hide ${e.key}`:`Show ${e.key}`,tabIndex:-1,children:o?(0,t.jsx)(l,{}):(0,t.jsx)(i,{})})]}),e.description&&(0,t.jsx)("p",{id:a,className:"stg:text-[0.6rem] stg:leading-relaxed stg:text-muted-foreground-subtle",children:e.description}),A.has(e.key)&&(0,t.jsx)("p",{className:"stg:text-[0.55rem] stg:text-primary-muted",children:"Pre-filled from session variables"})]},e.key)})}),I.canScrollDown&&(0,t.jsx)(a.ScrollFade,{position:"bottom"})]}),!b&&(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:gap-2 stg:pt-0.5",children:[(0,t.jsx)("button",{id:P,type:"button",role:"switch","aria-checked":j,onClick:()=>C(e=>!e),disabled:R,className:(0,s.cn)("stg:relative stg:mt-0.5 stg:inline-flex stg:h-4 stg:w-7 stg:shrink-0 stg:cursor-pointer stg:rounded-full stg:transition-colors","stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring stg:focus-visible:ring-offset-2","stg:disabled:pointer-events-none stg:disabled:opacity-50",j?"stg:bg-primary":"stg:bg-input"),children:(0,t.jsx)("span",{className:(0,s.cn)("stg:pointer-events-none stg:block stg:h-3 stg:w-3 stg:translate-y-0.5 stg:rounded-full stg:bg-background stg:shadow-sm stg:ring-0 stg:transition-transform",j?"stg:translate-x-3.5":"stg:translate-x-0.5")})}),(0,t.jsxs)("label",{htmlFor:P,className:"stg:cursor-pointer stg:select-none stg:space-y-0.5",children:[(0,t.jsx)("span",{className:"stg:block stg:text-[0.65rem] stg:font-medium stg:text-muted-foreground",children:"Save for future runs"}),!j&&(0,t.jsx)("span",{className:"stg:block stg:text-[0.6rem] stg:leading-relaxed stg:text-muted-foreground-subtle",children:"These values will only be used for this run."})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-end stg:gap-2 stg:pt-1",children:[c&&(0,t.jsx)("button",{type:"button",onClick:c,disabled:R,className:(0,s.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:v}),(0,t.jsxs)("button",{type:"submit",disabled:!L||R,"data-cursor-target":"env-form-submit",className:(0,s.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:[d&&(0,t.jsx)(o.SpinnerIcon,{size:12}),D]})]})]})}])},793907,e=>{"use strict";var t=e.i(843476),r=e.i(893976);function s({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M8 1.5 1 14h14L8 1.5Z"}),(0,t.jsx)("path",{d:"M8 6v3.5"}),(0,t.jsx)("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor",stroke:"none"})]})}function n({className:e}){return(0,t.jsxs)("svg",{className:e,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M12 8.667v4A1.333 1.333 0 0 1 10.667 14H3.333A1.333 1.333 0 0 1 2 12.667V5.333A1.333 1.333 0 0 1 3.333 4h4"}),(0,t.jsx)("path",{d:"M10 2h4v4"}),(0,t.jsx)("path",{d:"M6.667 9.333 14 2"})]})}e.s(["VendorApprovalBlockedNotice",0,function({blocked:e,pending:a,manualEntrySupported:o,canBringOwnApp:i,docsUrl:l,onBringOwnApp:u,compact:c,className:d}){if(!e)return null;let g=a?"The platform's OAuth app is awaiting vendor approval.":"The platform's OAuth app was not approved by the vendor.",h=i?o?"You can use your own OAuth app or enter a token manually.":"You can use your own OAuth app.":o?"You can still connect by entering your own token manually.":"OAuth sign-in is temporarily unavailable for this server.",p=i&&u,m=!!l&&!i;return c?(0,t.jsxs)("div",{className:(0,r.cn)("stg:text-[0.65rem] stg:text-amber-700 stg:dark:text-amber-300",d),children:[(0,t.jsxs)("p",{children:[g," ",h]}),p&&(0,t.jsx)("button",{type:"button",onClick:u,className:"stg:mt-1 stg:inline-flex stg:items-center stg:gap-1 stg:rounded stg:bg-amber-600 stg:px-2 stg:py-0.5 stg:text-[0.6rem] stg:font-medium stg:text-white stg:hover:bg-amber-700 stg:dark:bg-amber-500 stg:dark:text-amber-950 stg:dark:hover:bg-amber-400",children:"Use your own OAuth app"}),m&&(0,t.jsx)("a",{href:l??void 0,target:"_blank",rel:"noopener noreferrer",className:"stg:underline stg:decoration-amber-600/40 stg:underline-offset-2 stg:hover:decoration-amber-600 stg:dark:decoration-amber-400/40 stg:dark:hover:decoration-amber-400",children:"Learn how to bring your own token"})]}):(0,t.jsxs)("div",{role:"status",className:(0,r.cn)("stg:flex stg:items-start stg:gap-2 stg:bg-amber-500/5 stg:px-3 stg:py-2",d),children:[(0,t.jsx)(s,{className:"stg:mt-0.5 stg:size-3.5 stg:shrink-0 stg:text-amber-600 stg:dark:text-amber-400"}),(0,t.jsxs)("div",{className:"stg:flex-1 stg:text-xs stg:text-amber-700 stg:dark:text-amber-300",children:[(0,t.jsxs)("p",{children:[g," ",h]}),p&&(0,t.jsx)("button",{type:"button",onClick:u,"data-cursor-target":"byoa-cta-button",className:"stg:mt-1.5 stg:inline-flex stg:items-center stg:gap-1 stg:rounded-md stg:bg-amber-600 stg:px-2.5 stg:py-1 stg:text-[11px] stg:font-medium stg:text-white stg:hover:bg-amber-700 stg:dark:bg-amber-500 stg:dark:text-amber-950 stg:dark:hover:bg-amber-400",children:"Use your own OAuth app"}),m&&(0,t.jsxs)("a",{href:l??void 0,target:"_blank",rel:"noopener noreferrer",className:"stg:mt-1 stg:inline-flex stg:items-center stg:gap-1 stg:underline stg:decoration-amber-600/40 stg:underline-offset-2 stg:hover:decoration-amber-600 stg:dark:decoration-amber-400/40 stg:dark:hover:decoration-amber-400",children:["Learn how to bring your own token",(0,t.jsx)(n,{className:"stg:size-3 stg:shrink-0"})]})]})]})}])},20883,e=>{"use strict";var t=e.i(939910),r=e.i(167937),s=e.i(498931),n=e.i(910304);class a extends Error{mcpServerId;constructor(e,t){super(`the connect of MCP server '${e}' is still running server-side after ${Math.round(t/1e3)}s — it will persist its result on its own; re-read the server to observe the outcome`),this.name="ConnectStillRunningError",this.mcpServerId=e}}async function o(e,o,l){let u,c=l?.pollIntervalMs??2500,d=Math.min(l?.deadlineMs??39e5,39e5);try{u=await e.startConnect(o)}catch(t){if(!(0,n.isUnimplemented)(t))throw t;return i(e,o,d)}l?.onStarted?.(u);let g=Date.now()+d;for(;;){if(Date.now()>=g)throw new a(o.mcpServerId,d);await function(e){return new Promise(t=>setTimeout(t,e))}(Math.min(c,Math.max(1,g-Date.now())));let i=await e.get(o.mcpServerId),l=i.status?.connectStatus;if(l?.phase===s.ConnectPhase.succeeded)return i;if(l?.phase===s.ConnectPhase.failed)throw function(e,s){let a=t.Code[e];return(0,n.wrapError)(new r.ConnectError(s,"number"==typeof a?a:t.Code.Unknown))}(l.failureCode,l.failureMessage)}}async function i(e,t,r){let s,n=e.connect(t);n.catch(()=>{});let o=new Promise((e,n)=>{s=setTimeout(()=>n(new a(t.mcpServerId,r)),r)});try{return await Promise.race([n,o])}finally{void 0!==s&&clearTimeout(s)}}e.s(["connectAndWait",0,o])},139666,e=>{"use strict";let t="STIGMER_SERVER_ADDRESS",r="STIGMER_API_KEY",s=new Set([t,r]);async function n(e){var s;let n=await e.getAuthCredential();return s=e.baseUrl,{[t]:{value:function(e){try{let t=new URL(e),r=t.hostname,s=t.port||("https:"===t.protocol?"443":"80");return`${r}:${s}`}catch{return e}}(s),isSecret:!1,description:"Auto-resolved from the current Stigmer connection."},[r]:{value:n||"unused",isSecret:!0,description:"Auto-resolved from the current Stigmer auth context."}}}async function a(e,t){let r=t instanceof Set?t:new Set(t);if(![...s].some(e=>r.has(e)))return{};let a=await n(e),o={};for(let[e,t]of Object.entries(a))r.has(e)&&(o[e]=t);return o}e.s(["SYSTEM_ENV_VAR_KEYS",0,s,"resolveDeclaredSystemEnvVars",0,a,"resolveSystemEnvVarValues",0,n])},168197,e=>{"use strict";var t=e.i(271645),r=e.i(891287),s=e.i(20883),n=e.i(610595),a=e.i(336973),o=e.i(586108),i=e.i(139666),l=e.i(326283),u=e.i(903198);e.s(["getOAuthConnectErrorMessage",0,function(e,t){let r=(0,n.getUserMessage)(e);return"connecting"===t?`Signed in successfully, but tool discovery failed: ${r}`:r},"useMcpServerOAuthConnect",0,function(){let e=(0,o.useStigmer)(),[n,c]=(0,t.useState)("idle"),[d,g]=(0,t.useState)(null),[h,p]=(0,t.useState)(null),m=(0,t.useRef)(null),v=(0,t.useRef)(null),f=(0,t.useRef)(!1),b=(0,t.useRef)("idle"),x=(0,t.useCallback)(e=>{b.current=e,c(e)},[]);(0,t.useEffect)(()=>()=>{v.current?.()},[]);let S=(0,t.useCallback)(()=>{(v.current||m.current)&&(f.current=!0,v.current?.(),(0,u.closeOAuthPopup)(m.current),m.current=null,v.current=null),x("idle"),g(null),p(null)},[x]);return{startOAuth:(0,t.useCallback)(async(t,n,o)=>{x("initiating"),g(null),p(null),f.current=!1,v.current?.();let c=(0,u.openOAuthPopup)();if(!c){let e=(0,u.popupBlockedError)();throw g(e),p("initiating"),x("idle"),e}m.current=c;try{let l=await e.mcpServer.initiateOAuthConnect((0,r.create)(a.InitiateOAuthConnectInputSchema,{mcpServerId:t,org:n}));c.location.href=l.authorizationUrl,x("awaiting-callback");let{code:d,state:g}=await (0,u.waitForOAuthCallback)(c,l.state,e=>{v.current=e});x("completing"),await e.mcpServer.completeOAuthConnect((0,r.create)(a.CompleteOAuthConnectInputSchema,{mcpServerId:t,authorizationCode:d,state:g})),x("connecting");let h=o?await (0,i.resolveDeclaredSystemEnvVars)(e,o):{},p={};for(let[e,t]of Object.entries(h))p[e]={value:t.value,isSecret:t.isSecret??!1};let m=(0,r.create)(a.ConnectInputSchema,{mcpServerId:t,org:n,...Object.keys(p).length>0?{runtimeEnv:p}:{}}),f=await (0,s.connectAndWait)(e.mcpServer,m);return x("done"),f}catch(t){let e=(0,l.toError)(t);throw f.current||(g(e),p(b.current),x("idle"),(0,u.closeOAuthPopup)(c)),f.current=!1,e}finally{m.current=null,v.current=null}},[e,x]),isInProgress:"idle"!==n&&"done"!==n,phase:n,error:d,failedPhase:h,clearError:S}}])},862645,e=>{"use strict";var t=e.i(271645),r=e.i(891287),s=e.i(336973),n=e.i(20883),a=e.i(586108),o=e.i(139666),i=e.i(326283);e.s(["useMcpServerConnect",0,function(){let e=(0,a.useStigmer)(),[l,u]=(0,t.useState)(!1),[c,d]=(0,t.useState)(null),g=(0,t.useCallback)(()=>d(null),[]);return{connect:(0,t.useCallback)(async(t,a,l,c)=>{u(!0),d(null);try{let i={...c?await (0,o.resolveDeclaredSystemEnvVars)(e,c):{},...l??{}},u={};for(let[e,t]of Object.entries(i))u[e]={value:t.value,isSecret:t.isSecret??!1};let d=(0,r.create)(s.ConnectInputSchema,{mcpServerId:t,org:a,...Object.keys(u).length>0?{runtimeEnv:u}:{}});return await (0,n.connectAndWait)(e.mcpServer,d)}catch(t){let e=(0,i.toError)(t);throw d(e),e}finally{u(!1)}},[e]),isConnecting:l,error:c,clearError:g}}])},727996,288270,651424,153158,e=>{"use strict";var t=e.i(910304),r=e.i(586108),s=e.i(583093);e.s(["useMcpServer",0,function(e,n){let a=(0,r.useStigmer)(),{data:o,isLoading:i,isRefetching:l,error:u,refetch:c}=(0,s.useFetch)(e&&n?async()=>{try{return await a.mcpServer.getByReference({org:e,slug:n})}catch(e){if((0,t.isNotFound)(e))return null;throw e}}:null,[e,n,a],null);return{mcpServer:o,isLoading:i,isRefetching:l,error:u,refetch:c}}],727996);var n=e.i(271645),a=e.i(498931),o=e.i(437241),i=e.i(207344);function l(e,t,r){let s=[];for(let[n,a]of Object.entries(e))!t.has(n)&&(r?.has(n)||s.push({key:n,isSecret:a.isSecret,...a.description&&{description:a.description},...a.optional&&{optional:!0}}));return s}e.s(["diffEnv",0,l],288270);var u=e.i(139666),c=e.i(891287),d=e.i(336973);let g={connected:!1,accessTokenExpiresAt:BigInt(0),targetEnvVar:"",authMethod:"",connectionHealth:d.OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_UNSPECIFIED};var h=e.i(521557),p=e.i(326283);let m={isSupported:!1,hasOverride:!1,oauthAppId:null,clientId:null},v={isSupported:!1,hasOverride:!1,oauthAppId:null,clientId:null},f={...m,isLoading:!1,isRefetching:!1,error:null,refetch:()=>{},setOrgOAuthApp:()=>Promise.resolve(""),isSetting:!1,setError:null,deleteOrgOAuthApp:()=>Promise.resolve(!1),isDeleting:!1,deleteError:null,clearErrors:()=>{}};function b(e,t){let a=(0,r.useStigmer)(),{data:o,isLoading:i,isRefetching:l,error:u,refetch:g}=(0,s.useFetch)(e&&t?async()=>{try{let r=await a.mcpServer.getOrgOAuthApp((0,c.create)(d.GetOrgOAuthAppInputSchema,{resourceId:e,org:t}));return{isSupported:!0,hasOverride:r.hasOverride,oauthAppId:r.oauthAppId||null,clientId:r.clientId||null}}catch(e){if((0,h.isUnimplemented)(e))return v;throw e}}:null,[e,t,a],m,{cacheKey:`org-oauth-app:${t}:${e}`}),[b,x]=(0,n.useState)(!1),[S,y]=(0,n.useState)(null),[w,k]=(0,n.useState)(!1),[A,O]=(0,n.useState)(null),E=(0,n.useCallback)(()=>{y(null),O(null)},[]),j=(0,n.useCallback)(async(r,s)=>{if(!e||!t)throw Error("useOrgOAuthApp: resourceId and org are required for setOrgOAuthApp");x(!0),y(null);try{return(await a.mcpServer.setOrgOAuthApp((0,c.create)(d.SetOrgOAuthAppInputSchema,{resourceId:e,org:t,clientId:r,clientSecret:s}))).oauthAppId}catch(t){let e=(0,p.toError)(t);throw y(e),e}finally{x(!1)}},[a,e,t]),C=(0,n.useCallback)(async()=>{if(!e||!t)throw Error("useOrgOAuthApp: resourceId and org are required for deleteOrgOAuthApp");k(!0),O(null);try{return(await a.mcpServer.deleteOrgOAuthApp((0,c.create)(d.DeleteOrgOAuthAppInputSchema,{resourceId:e,org:t}))).deleted}catch(t){let e=(0,p.toError)(t);throw O(e),e}finally{k(!1)}},[a,e,t]);return e&&t?{...o,isLoading:i,isRefetching:l,error:u,refetch:g,setOrgOAuthApp:j,isSetting:b,setError:S,deleteOrgOAuthApp:C,isDeleting:w,deleteError:A,clearErrors:E}:{...f,refetch:g,clearErrors:E}}e.s(["useOrgOAuthApp",0,b],651424),e.s(["useMcpServerCredentials",0,function(e,t){let h=(0,i.usePersonalEnvironment)(e),[p,m]=(0,n.useState)(!1),v=t?.spec?.auth,f=v?"oauth":"manual",x=v?.targetEnvVar||null,S=v?.tokenLifetimeHint||null,y=!v?.oauthOnly,w=p&&y,k=t?.status?.oauthStatus,A="oauth"===f&&k?.vendorApprovalStatus===o.VendorApprovalStatus.PENDING,O="oauth"===f&&(k?.vendorApprovalStatus===o.VendorApprovalStatus.PENDING||k?.vendorApprovalStatus===o.VendorApprovalStatus.REJECTED),E=k?.vendorApprovalDocsUrl||null,j=!!v?.oauthAppRef?.slug,C=b("oauth"===f&&j?t?.metadata?.id??null:null,e),N=C.hasOverride,I=C.isLoading||null!==C.error||j&&!e,M="oauth"!==f||I?a.OAuthAppSource.OAUTH_APP_SOURCE_UNSPECIFIED:N?a.OAuthAppSource.OAUTH_APP_SOURCE_ORG_OVERRIDE:j?a.OAuthAppSource.OAUTH_APP_SOURCE_PLATFORM:a.OAuthAppSource.OAUTH_APP_SOURCE_NONE,P="oauth"===f&&j&&!N&&C.isSupported,R=function(e,t){let n=(0,r.useStigmer)(),{data:a,isLoading:o,isRefetching:i,error:l,refetch:u}=(0,s.useFetch)(e&&t?async()=>{let r=await n.mcpServer.getOAuthGrantStatus((0,c.create)(d.GetOAuthGrantStatusInputSchema,{resourceId:e,org:t}));return{connected:r.connected,accessTokenExpiresAt:r.accessTokenExpiresAt,targetEnvVar:r.targetEnvVar,authMethod:r.authMethod,connectionHealth:r.connectionHealth}}:null,[e,t,n],g);return{...a,isLoading:o,isRefetching:i,error:l,refetch:u}}("oauth"===f?t?.metadata?.id??null:null,"oauth"===f?e:null),L="oauth"===f&&R.connected,T=(0,n.useMemo)(()=>new Set(Object.keys(h.environment?.spec?.data??{})),[h.environment]),U=(0,n.useMemo)(()=>{if(!t)return[];let e=t.spec?.env;return e&&0!==Object.keys(e).length?l(e,T).filter(e=>!u.SYSTEM_ENV_VAR_KEYS.has(e.key)):[]},[t,T]),_=(0,n.useMemo)(()=>U.filter(e=>!e.optional),[U]),V=(0,n.useMemo)(()=>!x||w?_:_.filter(e=>e.key!==x),[_,x,w]),D=!h.isLoading&&!R.isLoading&&0===V.length&&("manual"===f||w||L),H=(0,n.useCallback)(async e=>{await h.getOrCreate(),await h.addVariables(e)},[h]),$=(0,n.useCallback)(()=>{h.refetch(),R.refetch(),C.refetch()},[h,R,C]);return{authMode:f,oauthTargetEnvVar:x,isOAuthConnected:L,connectionHealth:R.connectionHealth,canDisconnect:L,accessTokenExpiresAt:R.accessTokenExpiresAt,tokenLifetimeHint:S,isVendorApprovalPending:A,isVendorApprovalBlocked:O,vendorApprovalDocsUrl:E,effectiveOAuthSource:M,isOrgOAuthApp:N,canBringOwnApp:P,manualEntrySupported:y,missingVariables:V,isReady:D,isLoading:h.isLoading||R.isLoading||C.isLoading,error:h.error??R.error??C.error,saveCredentials:H,isSaving:h.isMutating,refetch:$,manualOverride:w,setManualOverride:m}}],153158)},844533,801731,e=>{"use strict";var t=e.i(843476),r=e.i(893976),s=e.i(597744);function n({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M2 5.5 8 2.5l6 3-6 3-6-3Z"}),(0,t.jsx)("path",{d:"M2 5.5v5l6 3 6-3v-5"}),(0,t.jsx)("path",{d:"M8 8.5v5"})]})}function a({className:e}){return(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"5",cy:"11",r:"2.5"}),(0,t.jsx)("path",{d:"M6.8 9.2 13 3"}),(0,t.jsx)("path",{d:"M11 5l1.5 1.5"}),(0,t.jsx)("path",{d:"M9 7l1.5 1.5"})]})}e.s(["StdioSandboxNotice",0,function({serverType:e,className:a}){var o;return(o=(0,s.useDeploymentMode)(),"cloud"!==o||e?.case!=="stdio")?null:(0,t.jsxs)("div",{role:"status",className:(0,r.cn)("stg:bg-muted-subtle stg:text-muted-foreground stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-transparent stg:px-4 stg:py-3",a),children:[(0,t.jsx)(n,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsx)("p",{className:"stg:text-xs stg:leading-relaxed",children:"This stdio server runs only on local runners — it won't be available to sessions on Stigmer-managed cloud compute. Run the session on a local runner (desktop app or CLI) to use it, or choose a remote (HTTP) server instead."})]})}],844533),e.s(["OAuthRequiredNotice",0,function({oauthOnly:e,className:s}){return e?(0,t.jsxs)("div",{role:"status",className:(0,r.cn)("stg:bg-muted-subtle stg:text-muted-foreground stg:flex stg:items-start stg:gap-2.5 stg:rounded-lg stg:border stg:border-transparent stg:px-4 stg:py-3",s),children:[(0,t.jsx)(a,{className:"stg:mt-0.5 stg:size-4 stg:shrink-0"}),(0,t.jsx)("p",{className:"stg:text-xs stg:leading-relaxed",children:"This server requires OAuth. Sign in to connect — its hosted endpoint rejects manually-entered API tokens, so a pasted token won't work here."})]}):null}],801731)},388894,e=>{"use strict";var t=e.i(271645),r=e.i(891287),s=e.i(336973),n=e.i(586108),a=e.i(326283);e.s(["useDisconnectOAuth",0,function(){let e=(0,n.useStigmer)(),[o,i]=(0,t.useState)(!1),[l,u]=(0,t.useState)(null),c=(0,t.useCallback)(()=>u(null),[]);return{disconnect:(0,t.useCallback)(async(t,n)=>{i(!0),u(null);try{return(await e.mcpServer.disconnectOAuth((0,r.create)(s.DisconnectOAuthInputSchema,{resourceId:t,org:n}))).disconnected}catch(e){throw u((0,a.toError)(e)),e}finally{i(!1)}},[e]),isDisconnecting:o,error:l,clearError:c}}])}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,691444,e=>{"use strict";var t=e.i(430182);let s={[t.IamRole.iam_role_unspecified]:"unspecified",[t.IamRole.owner]:"owner",[t.IamRole.admin]:"admin",[t.IamRole.member]:"member",[t.IamRole.viewer]:"viewer",[t.IamRole.participant]:"participant"},r={owner:t.IamRole.owner,admin:t.IamRole.admin,member:t.IamRole.member,viewer:t.IamRole.viewer,participant:t.IamRole.participant},i={[t.IamRole.iam_role_unspecified]:"Unspecified",[t.IamRole.owner]:"Owner",[t.IamRole.admin]:"Admin",[t.IamRole.member]:"Member",[t.IamRole.viewer]:"Viewer",[t.IamRole.participant]:"Participant"},n={[t.IamRole.iam_role_unspecified]:"",[t.IamRole.owner]:"Full access including delete and access management",[t.IamRole.admin]:"Edit access and member management",[t.IamRole.member]:"Standard access to organization resources",[t.IamRole.viewer]:"Read-only access",[t.IamRole.participant]:"Reply to customers and manage conversation takeover"};e.s(["iamRoleDescription",0,function(e){return n[e]??""},"iamRoleDisplayName",0,function(e){return i[e]??"Unknown"},"iamRoleFromString",0,function(e){return r[e]},"iamRoleToString",0,function(e){return s[e]??"unspecified"}])},818094,e=>{"use strict";var t=e.i(170255),s=e.i(430182);let r=new Map([[t.ApiResourceKind.identity_provider,[s.IamRole.viewer]],[t.ApiResourceKind.oauth_app,[s.IamRole.viewer]],[t.ApiResourceKind.platform_client,[s.IamRole.viewer]],[t.ApiResourceKind.team,[s.IamRole.member]],[t.ApiResourceKind.organization,[s.IamRole.owner,s.IamRole.admin,s.IamRole.member,s.IamRole.viewer]],[t.ApiResourceKind.agent,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.session,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.skill,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.mcp_server,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.agent_instance,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.agent_share,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.agent_channel,[s.IamRole.owner,s.IamRole.viewer,s.IamRole.participant]],[t.ApiResourceKind.channel_app,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.workflow,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.workflow_instance,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.workflow_execution,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.environment,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.artifact,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.schedule,[s.IamRole.owner,s.IamRole.viewer]],[t.ApiResourceKind.plugin,[s.IamRole.owner,s.IamRole.viewer]]]),i=new Map([[t.ApiResourceKind.agent,[s.IamRole.viewer]],[t.ApiResourceKind.skill,[s.IamRole.viewer]],[t.ApiResourceKind.mcp_server,[s.IamRole.viewer]],[t.ApiResourceKind.agent_instance,[s.IamRole.viewer]],[t.ApiResourceKind.agent_channel,[s.IamRole.viewer,s.IamRole.participant]],[t.ApiResourceKind.workflow,[s.IamRole.viewer]],[t.ApiResourceKind.workflow_instance,[s.IamRole.viewer]],[t.ApiResourceKind.workflow_execution,[s.IamRole.viewer]],[t.ApiResourceKind.schedule,[s.IamRole.viewer]],[t.ApiResourceKind.plugin,[s.IamRole.viewer]]]),n=Object.freeze([]);e.s(["getGrantableRoles",0,function(e){return r.get(e)??n},"getTeamGrantableRoles",0,function(e){return i.get(e)??n},"hasGrantableRoles",0,function(e){let t=r.get(e);return void 0!==t&&t.length>0},"hasTeamGrantableRoles",0,function(e){let t=i.get(e);return void 0!==t&&t.length>0},"isRoleGrantable",0,function(e,t){let s=r.get(e);return void 0!==s&&s.includes(t)},"isRoleTeamGrantable",0,function(e,t){let s=i.get(e);return void 0!==s&&s.includes(t)}],818094)},146312,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),i=e.i(869803),n=e.i(818094),a=e.i(691444);let l=[];e.s(["RoleSelector",0,function({kind:e,onSelect:o,selected:c,defaultRole:d,disabled:g=!1,granteeKind:u="identity_account",omitRoles:m,className:p}){let x=(0,s.useId)(),{options:h,selected:f,select:b}=function(e,t,r="identity_account",i=l){let[o,c]=(0,s.useState)(t??null),d=(0,s.useMemo)(()=>{if(null===e)return[];let t=new Set(i);return("team"===r?(0,n.getTeamGrantableRoles)(e):(0,n.getGrantableRoles)(e)).filter(e=>!t.has(e)).map(e=>({role:e,label:(0,a.iamRoleDisplayName)(e),description:(0,a.iamRoleDescription)(e),value:(0,a.iamRoleToString)(e)}))},[e,r,i]),g=(0,s.useMemo)(()=>null!==o?(0,a.iamRoleToString)(o):"",[o]),u=(0,s.useCallback)(e=>c(e),[]),m=(0,s.useCallback)(()=>c(null),[]);return(0,s.useMemo)(()=>({options:d,selected:o,selectedValue:g,select:u,clear:m,hasOptions:d.length>0}),[d,o,g,u,m])}(e,d,u,m),v=void 0!==c?c:f;return 0===h.length?null:(0,t.jsxs)("fieldset",{className:(0,r.cn)(i.UNSTYLED_FIELDSET,"stg:space-y-1.5",p),children:[(0,t.jsx)("legend",{className:"stg:text-xs stg:font-medium stg:text-foreground",children:"Role"}),(0,t.jsx)("div",{className:"stg:flex stg:flex-wrap stg:gap-2",children:h.map(e=>{let s=v===e.role;return(0,t.jsxs)("label",{className:(0,r.cn)("stg:inline-flex stg:cursor-pointer stg:flex-col stg:rounded-md stg:border stg:px-3 stg:py-1.5 stg:text-xs stg:transition-colors",s?"stg:border-primary stg:bg-primary-subtle stg:text-primary stg:font-medium":"stg:border-input stg:bg-background stg:text-muted-foreground stg:hover:border-border stg:hover:text-foreground",g&&"stg:pointer-events-none stg:opacity-50"),children:[(0,t.jsx)("input",{type:"radio",name:x,value:e.value,checked:s,disabled:g,onChange:()=>{var t;b(t=e.role),o?.(t)},className:"stg:sr-only"}),(0,t.jsx)("span",{children:e.label}),(0,t.jsx)("span",{className:"stg:text-[0.625rem] stg:text-muted-foreground stg:font-normal stg:mt-0.5",children:e.description})]},e.value)})})]})}],146312)},3422,11493,554212,e=>{"use strict";var t=e.i(424407),s=e.i(304532),r=e.i(421415),i=e.i(988158),n=e.i(761867);let a=(0,t.fileDesc)("CiFhaS9zdGlnbWVyL2lhbS90ZWFtL3YxL3NwZWMucHJvdG8SFmFpLnN0aWdtZXIuaWFtLnRlYW0udjEiKQoIVGVhbVNwZWMSHQoLZGVzY3JpcHRpb24YASABKAlCCLpIBXIDGPQDYgZwcm90bzM",[n.file_buf_validate_validate]),l=(0,s.messageDesc)(a,0);e.s(["TeamSpecSchema",0,l,"file_ai_stigmer_iam_team_v1_spec",0,a],11493);let o=(0,t.fileDesc)("CiBhaS9zdGlnbWVyL2lhbS90ZWFtL3YxL2FwaS5wcm90bxIWYWkuc3RpZ21lci5pYW0udGVhbS52MSKXAgoEVGVhbRItCgthcGlfdmVyc2lvbhgBIAEoCUIYukgVchMKEWlhbS5zdGlnbWVyLmFpL3YxEhkKBGtpbmQYAiABKAlCC7pICHIGCgRUZWFtEk0KCG1ldGFkYXRhGAMgASgLMjMuYWkuc3RpZ21lci5jb21tb25zLmFwaXJlc291cmNlLkFwaVJlc291cmNlTWV0YWRhdGFCBrpIA8gBARIuCgRzcGVjGAQgASgLMiAuYWkuc3RpZ21lci5pYW0udGVhbS52MS5UZWFtU3BlYxJGCgZzdGF0dXMYBSABKAsyNi5haS5zdGlnbWVyLmNvbW1vbnMuYXBpcmVzb3VyY2UuQXBpUmVzb3VyY2VBdWRpdFN0YXR1c2IGcHJvdG8z",[r.file_ai_stigmer_commons_apiresource_metadata,i.file_ai_stigmer_commons_apiresource_status,a,n.file_buf_validate_validate]),c=(0,s.messageDesc)(o,0);e.s(["TeamSchema",0,c,"file_ai_stigmer_iam_team_v1_api",0,o],554212);let d=(0,t.fileDesc)("Ch9haS9zdGlnbWVyL2lhbS90ZWFtL3YxL2lvLnByb3RvEhZhaS5zdGlnbWVyLmlhbS50ZWFtLnYxIjYKBVRlYW1zEi0KB2VudHJpZXMYASADKAsyHC5haS5zdGlnbWVyLmlhbS50ZWFtLnYxLlRlYW0iKwoTTGlzdFRlYW1zQnlPcmdJbnB1dBIUCgNvcmcYASABKAlCB7pIBHICEAFiBnByb3RvMw",[o,n.file_buf_validate_validate]),g=(0,s.messageDesc)(d,1);e.s(["ListTeamsByOrgInputSchema",0,g,"file_ai_stigmer_iam_team_v1_io",0,d],3422)},884561,e=>{"use strict";var t=e.i(891287),s=e.i(170255),r=e.i(267872),i=e.i(632897);let n=s.ApiResourceKind[s.ApiResourceKind.identity_account],a=s.ApiResourceKind[s.ApiResourceKind.team],l="member";function o(e){return{kind:"identity_account",id:e}}function c(e){return{kind:"team",id:e}}e.s(["granteeFromView",0,function(e){if(e.id){if(e.kind===n&&""===e.relation)return o(e.id);if(e.kind===a&&e.relation===l)return c(e.id)}},"granteeKey",0,function(e){return`${e.kind}:${e.id}`},"granteeRef",0,function(e){switch(e.kind){case"identity_account":return(0,t.create)(i.ApiResourceRefSchema,{kind:n,id:e.id});case"team":return(0,t.create)(i.ApiResourceRefSchema,{kind:a,id:e.id,relation:l});default:return e}},"isPlatformClientAccount",0,function(e){return e.kind===n&&e.identityOrigin?.provisioningMode===r.IdentityAccountProvisioningMode.platform_client},"personGrantee",0,o,"teamGrantee",0,c])},564035,288441,890079,e=>{"use strict";var t=e.i(891287),s=e.i(452026),r=e.i(632897),i=e.i(586108),n=e.i(583093);e.s(["useResourceAccess",0,function(e,a){let l=(0,i.useStigmer)(),o=e?.kind??null,c=e?.id??null,d=a?.includeInherited??!1,{data:g,isLoading:u,isRefetching:m,error:p,refetch:x}=(0,n.useFetch)(o&&c?()=>{let e=(0,t.create)(s.ListResourceAccessInputSchema,{resource:(0,t.create)(r.ApiResourceRefSchema,{kind:o,id:c}),includeInherited:d});return l.iamPolicy.listResourceAccessByPrincipal(e).then(e=>[...e.entries])}:null,[o,c,d,l],[]);return{members:g,isLoading:u,isRefetching:m,error:p,refetch:x}}],564035);var a=e.i(271645),l=e.i(326283);e.s(["useCreateIamPolicy",0,function(){let e=(0,i.useStigmer)(),[t,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)(null),o=(0,a.useCallback)(()=>n(null),[]);return{create:(0,a.useCallback)(async t=>{s(!0),n(null);try{return await e.iamPolicy.create(t)}catch(e){throw n((0,l.toError)(e)),e}finally{s(!1)}},[e]),isCreating:t,error:r,clearError:o}}],288441),e.s(["useDeleteIamPolicy",0,function(){let e=(0,i.useStigmer)(),[t,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)(null),o=(0,a.useCallback)(()=>n(null),[]);return{remove:(0,a.useCallback)(async t=>{s(!0),n(null);try{return await e.iamPolicy.delete(t)}catch(e){throw n((0,l.toError)(e)),e}finally{s(!1)}},[e]),isDeleting:t,error:r,clearError:o}}],890079)},32011,e=>{"use strict";var t=e.i(843476),s=e.i(893976),r=e.i(188482);function i(e){return e?.identityOrigin?.providerDisplayName??""}e.s(["ProviderBadge",0,function({principal:e,className:n}){let a=i(e);return a?(0,t.jsxs)(r.Tooltip,{children:[(0,t.jsx)(r.TooltipTrigger,{render:(0,t.jsx)("span",{className:(0,s.cn)("stg:inline-flex stg:items-center stg:rounded stg:px-1.5 stg:py-0.5 stg:text-[0.6rem] stg:font-medium","stg:bg-muted-subtle stg:text-muted-foreground",n)}),children:a}),(0,t.jsx)(r.TooltipContent,{side:"top",children:`Identity provider: ${a}`})]}):null},"providerLabel",0,i])},14606,e=>{"use strict";let t=(0,e.i(475254).default)("users-round",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);e.s(["UsersRound",0,t],14606)},681094,e=>{"use strict";var t=e.i(271645),s=e.i(891287),r=e.i(170255),i=e.i(632897),n=e.i(818094),a=e.i(884561),l=e.i(691444),o=e.i(597744),c=e.i(326283),d=e.i(564035),g=e.i(288441),u=e.i(890079);e.s(["useShareFlow",0,function(e){let m=(0,t.useMemo)(()=>e?{kind:e.kind,id:e.id}:null,[e?.kind,e?.id]),{members:p,isLoading:x,isRefetching:h,error:f,refetch:b}=(0,d.useResourceAccess)(m),v=e?.resourceKind??null,{roles:R,hasRoles:w}=(0,t.useMemo)(()=>null===v?{roles:[],hasRoles:!1}:{roles:(0,n.getGrantableRoles)(v),hasRoles:(0,n.hasGrantableRoles)(v)},[v]),y=(0,o.useResourceAvailable)(r.ApiResourceKind.team),j=(0,t.useMemo)(()=>null===v?[]:(0,n.getTeamGrantableRoles)(v),[v]),k=y&&j.length>0,{create:I,isCreating:S,error:N,clearError:A}=(0,g.useCreateIamPolicy)(),{remove:_}=(0,u.useDeleteIamPolicy)(),[C,K]=(0,t.useState)(!1),[M,G]=(0,t.useState)(null),L=(0,t.useRef)(e);L.current=e;let T=(0,t.useRef)(p);T.current=p;let B=(0,t.useCallback)(async(e,t)=>{let r=L.current;r&&(await I((0,s.create)(i.IamPolicySpecSchema,{principal:(0,a.granteeRef)(e),resource:(0,s.create)(i.ApiResourceRefSchema,{kind:r.kind,id:r.id}),relation:(0,l.iamRoleToString)(t)})),b())},[I,b]),W=(0,t.useCallback)(async e=>{let t=L.current;if(!t)return;let r=(0,a.granteeKey)(e),n=T.current.filter(e=>{let t=e.principal?(0,a.granteeFromView)(e.principal):void 0;return void 0!==t&&(0,a.granteeKey)(t)===r}).flatMap(e=>e.roles).filter(e=>!e.isInherited&&e.role?.code).map(e=>e.role?.code??"");K(!0),G(null);try{for(let r of new Set(n))await _((0,s.create)(i.IamPolicySpecSchema,{principal:(0,a.granteeRef)(e),resource:(0,s.create)(i.ApiResourceRefSchema,{kind:t.kind,id:t.id}),relation:r}))}catch(e){throw G((0,c.toError)(e)),e}finally{K(!1),b()}},[_,b]),F=(0,t.useCallback)(()=>{A(),G(null)},[A]);return(0,t.useMemo)(()=>({accessList:p,isLoading:x,isRefetching:h,fetchError:f,grantableRoles:R,hasGrantableRoles:w,teamGrantableRoles:j,canShareWithTeams:k,grant:B,isGranting:S,grantError:N,revoke:W,isRevoking:C,revokeError:M,refetch:b,clearErrors:F}),[p,x,h,f,R,w,j,k,B,S,N,W,C,M,b,F])}],681094)},540279,9531,982943,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),i=e.i(884561),n=e.i(14606);function a({kind:e,name:s,className:i}){return(0,t.jsx)("div",{className:(0,r.cn)("stg:flex stg:h-6 stg:w-6 stg:shrink-0 stg:items-center stg:justify-center stg:rounded-full stg:bg-avatar stg:text-[0.6rem] stg:font-medium stg:text-muted-foreground",i),"aria-hidden":"true",children:"team"===e?(0,t.jsx)(n.UsersRound,{className:"stg:h-3.5 stg:w-3.5"}):(s[0]??"?").toUpperCase()})}var l=e.i(590150);function o(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}e.s(["AccessRow",0,function({entry:e,grantGate:n,onRemove:c,isRemoving:d,showRoles:g=!0}){let u=e.principal,m=u?(0,i.granteeFromView)(u):void 0,p=m?.kind==="team",x=u?.name||u?.email||u?.id||"Unknown",h=[...new Set(e.roles.map(e=>e.role?.name||e.role?.code).filter(Boolean))].join(", "),f=p?"Team":u?.email&&u.name?u.email:"",b=(0,s.useCallback)(async()=>{if(m)try{await c(m)}catch{}},[m,c]);return(0,t.jsxs)("li",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:rounded-md stg:px-2 stg:py-1.5 stg:hover:bg-accent-hover stg:group",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2 stg:min-w-0",children:[(0,t.jsx)(a,{kind:p?"team":"identity_account",name:u?.name||u?.email||"?"}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-foreground stg:truncate",children:x}),f&&(0,t.jsx)("p",{className:"stg:text-[0.6rem] stg:text-muted-foreground stg:truncate",children:f})]})]}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5 stg:shrink-0",children:[g&&(0,t.jsx)("span",{className:"stg:text-[0.6rem] stg:text-muted-foreground stg:capitalize",children:h||"—"}),m&&(0,t.jsx)(l.PermissionGate,{resource:n,relation:"can_grant_access",children:(0,t.jsx)("button",{type:"button",onClick:b,disabled:d,"aria-label":`Remove ${x}'s access`,className:(0,r.cn)("stg:rounded stg:p-0.5 stg:text-muted-foreground stg:opacity-0 stg:group-hover:opacity-100 stg:focus-visible:opacity-100","stg:hover:text-destructive stg:hover:bg-destructive-subtle","stg:disabled:pointer-events-none stg:disabled:opacity-50","stg:transition-opacity"),children:(0,t.jsx)(o,{})})})]})]})},"accessEntryKey",0,function(e){let t=e.principal;return t?`${t.kind}:${t.id}#${t.relation}`:"unknown"}],540279);var c=e.i(610595),d=e.i(869803),g=e.i(32011),u=e.i(891287),m=e.i(3422),p=e.i(586108),x=e.i(583093);let h=[];function f(e){let t=(0,p.useStigmer)(),{data:r,isLoading:i,isRefetching:n,error:a,refetch:l}=(0,x.useFetch)(e?()=>t.team.listByOrg((0,u.create)(m.ListTeamsByOrgInputSchema,{org:e})).then(e=>[...e.entries]):null,[e,t],h);return(0,s.useMemo)(()=>({teams:r,isLoading:i,isRefetching:n,error:a,refetch:l}),[r,i,n,a,l])}e.s(["useTeamList",0,f],9531);var b=e.i(564035);function v({label:e,count:r,children:i}){let n=(0,s.useId)();return 0===r?null:(0,t.jsxs)("li",{role:"presentation",children:[(0,t.jsx)("div",{id:n,className:"stg:px-2.5 stg:pt-1.5 stg:pb-1 stg:text-[0.6rem] stg:font-medium stg:uppercase stg:tracking-wide stg:text-muted-foreground",children:e}),(0,t.jsx)("ul",{role:"group","aria-labelledby":n,className:d.UNSTYLED_LIST,children:i})]})}function R({candidate:e}){let s="team"===e.kind?e.description:e.email!==e.name?e.email:"";return s?(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-[0.6rem] stg:text-muted-foreground",children:s}):null}function w({value:e}){return"team"===e.kind?(0,t.jsx)("span",{className:"stg:block stg:truncate stg:text-[0.6rem] stg:text-muted-foreground",children:"Team"}):(0,t.jsx)(R,{candidate:e})}function y(){return(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8"})})}e.s(["PrincipalPicker",0,function({orgId:e,value:n,onChange:l,includeTeams:o=!1,excludeGrantees:u,disabled:m=!1,label:p,autoFocus:x=!0,className:h}){let j=(0,s.useId)(),{people:k,teams:I,isLoading:S,error:N}=function({orgId:e,includeTeams:t}){let r=(0,b.useResourceAccess)(e?{kind:"organization",id:e}:null),n=f(t?e:null),a=(0,s.useMemo)(()=>{let e=new Map;for(let t of r.members){let s=t.principal,r=s?(0,i.granteeFromView)(s):void 0;!s||r?.kind!=="identity_account"||e.has(r.id)||e.set(r.id,{kind:"identity_account",grantee:(0,i.personGrantee)(r.id),name:s.name||s.email||s.id,email:s.email,view:s})}return[...e.values()]},[r.members]),l=(0,s.useMemo)(()=>t?n.teams.flatMap(e=>{let t=e.metadata?.id;return t?[{kind:"team",grantee:(0,i.teamGrantee)(t),name:e.metadata?.name||t,description:e.spec?.description??"",team:e}]:[]}):[],[t,n.teams]),o=r.isLoading||t&&n.isLoading,c=r.error??(t?n.error:null);return(0,s.useMemo)(()=>({people:a,teams:l,isLoading:o,error:c}),[a,l,o,c])}({orgId:e||null,includeTeams:o}),[A,_]=(0,s.useState)(""),[C,K]=(0,s.useState)(!1),[M,G]=(0,s.useState)(0),L=(0,s.useRef)(null),T=(0,s.useMemo)(()=>new Set((u??[]).map(i.granteeKey)),[u]),B=(0,s.useCallback)(e=>T.has((0,i.granteeKey)(e.grantee)),[T]),W=(0,s.useMemo)(()=>{let e=new Map;for(let t of k){let s=t.email.toLowerCase();s&&e.set(s,(e.get(s)??0)+1)}return new Set([...e.entries()].filter(([,e])=>e>1).map(([e])=>e))},[k]),{matchingPeople:F,matchingTeams:P}=(0,s.useMemo)(()=>{let e=A.trim().toLowerCase();return{matchingPeople:e?k.filter(t=>t.name.toLowerCase().includes(e)||t.email.toLowerCase().includes(e)):k,matchingTeams:e?I.filter(t=>t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)):I}},[k,I,A]),Y=(0,s.useMemo)(()=>[...P,...F],[F,P]),D=(0,s.useCallback)(e=>{B(e)||(l(e),_(""),K(!1))},[B,l]),V=(0,s.useCallback)(e=>{if("ArrowDown"===e.key)e.preventDefault(),K(!0),G(e=>Math.min(e+1,Y.length-1));else if("ArrowUp"===e.key)e.preventDefault(),G(e=>Math.max(e-1,0));else if("Enter"===e.key){e.preventDefault();let t=Y[M];t&&D(t)}else"Escape"===e.key&&K(!1)},[Y,M,D]),z=p??(o?"Person or team":"Person");if(n)return(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-1",h),children:[(0,t.jsx)("span",{className:"stg:block stg:text-xs stg:font-medium stg:text-foreground",children:z}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:justify-between stg:gap-2 stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5",children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-2",children:[(0,t.jsx)(a,{kind:n.kind,name:n.name}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:text-foreground",children:n.name}),"identity_account"===n.kind&&(0,t.jsx)(g.ProviderBadge,{principal:n.view})]}),(0,t.jsx)(w,{value:n})]})]}),(0,t.jsx)("button",{type:"button",onClick:()=>l(null),disabled:m,"aria-label":"team"===n.kind?"Clear selected team":"Clear selected person",className:(0,r.cn)("stg:shrink-0 stg:rounded stg:p-0.5 stg:text-muted-foreground","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:disabled:pointer-events-none stg:disabled:opacity-50"),children:(0,t.jsx)(y,{})})]})]});let E=(e,s)=>{var n,l;let o=B(e),c=s===M;return(0,t.jsxs)("li",{role:"option","aria-selected":c,"aria-disabled":o,onMouseEnter:()=>G(s),onMouseDown:t=>{t.preventDefault(),D(e)},className:(0,r.cn)("stg:flex stg:items-center stg:justify-between stg:gap-2 stg:px-2.5 stg:py-1.5",o?"stg:cursor-not-allowed stg:opacity-50":"stg:cursor-pointer",c&&!o&&"stg:bg-accent-hover"),children:[(0,t.jsxs)("div",{className:"stg:flex stg:min-w-0 stg:items-center stg:gap-2",children:[(0,t.jsx)(a,{kind:e.kind,name:e.name}),(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-1.5",children:[(0,t.jsx)("span",{className:"stg:truncate stg:text-xs stg:text-foreground",children:e.name}),"identity_account"===e.kind&&(n=e,l=W,!!(0,g.providerLabel)(n.view)&&(n.view.identityOrigin?.providerDisplayName!=="Stigmer"||!!n.email&&l.has(n.email.toLowerCase())))&&(0,t.jsx)(g.ProviderBadge,{principal:e.view})]}),(0,t.jsx)(R,{candidate:e})]})]}),o&&(0,t.jsx)("span",{className:"stg:shrink-0 stg:text-[0.6rem] stg:text-muted-foreground",children:"Has access"})]},(0,i.granteeKey)(e.grantee))},U=0===Y.length;return(0,t.jsxs)("div",{className:(0,r.cn)("stg:space-y-1",h),children:[(0,t.jsx)("label",{htmlFor:`${j}-input`,className:"stg:block stg:text-xs stg:font-medium stg:text-foreground",children:z}),(0,t.jsxs)("div",{className:"stg:relative",children:[(0,t.jsx)("input",{id:`${j}-input`,ref:L,type:"text",role:"combobox","aria-expanded":C,"aria-controls":j,"aria-autocomplete":"list",autoComplete:"off",value:A,onChange:e=>{_(e.target.value),K(!0),G(0)},onFocus:()=>K(!0),onBlur:()=>{window.setTimeout(()=>K(!1),120)},onKeyDown:V,placeholder:o?"Search people or teams":"Search by name or email",disabled:m||S,autoFocus:x,className:(0,r.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")}),C&&(0,t.jsxs)("ul",{id:j,role:"listbox","aria-label":o?"People and teams":"Organization members",className:(0,r.cn)(d.UNSTYLED_LIST,"stg:absolute stg:z-10 stg:mt-1 stg:max-h-56 stg:w-full stg:overflow-auto stg:rounded-md stg:border stg:border-border stg:bg-popover stg:py-1 stg:shadow-md"),children:[S&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-xs stg:text-muted-foreground",children:o?"Loading people and teams…":"Loading members…"}),!S&&N&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-[0.65rem] stg:text-destructive",role:"alert",children:(0,c.getUserMessage)(N)}),!S&&!N&&U&&(0,t.jsx)("li",{className:"stg:px-2.5 stg:py-2 stg:text-xs stg:text-muted-foreground",children:A.trim()?"No one matches your search.":"No one to share with."}),!S&&!N&&!U&&!o&&F.map((e,t)=>E(e,t)),!S&&!N&&!U&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{label:"Teams",count:P.length,children:P.map((e,t)=>E(e,t))}),(0,t.jsx)(v,{label:"People",count:F.length,children:F.map((e,t)=>E(e,P.length+t))})]})]})]})]})}],982943)},213149,e=>{"use strict";var t=e.i(843476),s=e.i(271645),r=e.i(893976),i=e.i(468806),n=e.i(170255),a=e.i(818094),l=e.i(597744),o=e.i(610595),c=e.i(884561),d=e.i(869803),g=e.i(681094),u=e.i(540279),m=e.i(891287),p=e.i(632897),x=e.i(691444),h=e.i(288441),f=e.i(146312),b=e.i(982943),v=e.i(379410);function R({resourceKind:e,resourceKindString:i,resourceId:n,orgId:l,includeTeams:d=!1,excludeGrantees:g,onGranted:u,onCancel:w,className:y}){let{create:j,isCreating:k,error:I,clearError:S}=(0,h.useCreateIamPolicy)(),[N,A]=(0,s.useState)(null),[_,C]=(0,s.useState)(null),K=(0,s.useCallback)(t=>{A(t),C(s=>null===s||null===t||("team"===t.kind?(0,a.isRoleTeamGrantable)(e,s):(0,a.isRoleGrantable)(e,s))?s:null)},[e]),M=null!==N&&null!==_&&!k,G=(0,s.useCallback)(async e=>{if(e.preventDefault(),M&&null!==_&&null!==N){S();try{let e=(0,m.create)(p.IamPolicySpecSchema,{principal:(0,c.granteeRef)(N.grantee),resource:(0,m.create)(p.ApiResourceRefSchema,{kind:i,id:n}),relation:(0,x.iamRoleToString)(_)}),t=await j(e);u?.(t)}catch{}}},[M,_,N,i,n,j,S,u]);return(0,t.jsxs)("form",{onSubmit:G,className:(0,r.cn)("stg:space-y-3",y),children:[(0,t.jsxs)("div",{className:"stg:space-y-3",children:[(0,t.jsx)(b.PrincipalPicker,{orgId:l,value:N,onChange:K,includeTeams:d,excludeGrantees:g,disabled:k}),(0,t.jsx)(f.RoleSelector,{kind:e,granteeKind:N?.kind??"identity_account",selected:_,onSelect:C,disabled:k})]}),I&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,o.getUserMessage)(I)}),(0,t.jsxs)("div",{className:"stg:flex stg:items-center stg:gap-2",children:[(0,t.jsxs)("button",{type:"submit",disabled:!M,className:(0,r.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:[k&&(0,t.jsx)(v.SpinnerIcon,{size:12}),"Grant access"]}),w&&(0,t.jsx)("button",{type:"button",onClick:w,disabled:k,className:(0,r.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"})]})]})}var w=e.i(590150);function y({resource:e,resourceKindString:i,resourceKind:n,orgId:a,className:m}){let{accessList:p,isLoading:x,fetchError:h,revoke:f,isRevoking:b,revokeError:v,refetch:j,hasGrantableRoles:k,canShareWithTeams:I}=(0,g.useShareFlow)(e),S=(0,l.useDeploymentMode)(),[N,A]=(0,s.useState)(!1),_=(0,s.useMemo)(()=>p.flatMap(e=>{let t=e.principal?(0,c.granteeFromView)(e.principal):void 0;return t?[t]:[]}),[p]);if("local"===S&&"organization"!==e.kind)return(0,t.jsxs)("p",{className:(0,r.cn)("stg:text-xs stg:text-muted-foreground",m),children:["This edition does not share ",i.replaceAll("_"," "),"s with individual people. Sharing with specific people is available in Stigmer Enterprise and Cloud."]});let C={kind:i,id:e.id};return(0,t.jsxs)("div",{className:(0,r.cn)("stg:flex stg:flex-col stg:gap-4",m),children:[(0,t.jsxs)("div",{className:"stg:space-y-1",children:[(0,t.jsx)("p",{className:"stg:text-xs stg:text-muted-foreground",children:x?"Loading access list...":`${p.length} with access`}),h&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,o.getUserMessage)(h)}),!x&&p.length>0&&(0,t.jsx)("ul",{className:(0,r.cn)(d.UNSTYLED_LIST,"stg:space-y-1 stg:mt-2"),"aria-label":"Who has access",children:p.map(e=>(0,t.jsx)(u.AccessRow,{entry:e,grantGate:C,onRemove:f,isRemoving:b},(0,u.accessEntryKey)(e)))}),v&&(0,t.jsx)("p",{className:"stg:text-destructive stg:text-[0.65rem]",role:"alert",children:(0,o.getUserMessage)(v)})]}),k&&(0,t.jsx)(w.PermissionGate,{resource:C,relation:"can_grant_access",children:(0,t.jsx)("div",{className:"stg:border-t stg:border-border stg:pt-3",children:N?(0,t.jsx)(R,{resourceKind:n,resourceKindString:i,resourceId:e.id,orgId:a,includeTeams:I,excludeGrantees:_,onGranted:()=>{A(!1),j()},onCancel:()=>A(!1)}):(0,t.jsx)("button",{type:"button",onClick:()=>A(!0),className:(0,r.cn)("stg:w-full stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:text-center","stg:border stg:border-dashed stg:border-border","stg:text-muted-foreground stg:hover:text-foreground stg:hover:border-border-prominent","stg:hover:bg-accent-hover stg:transition-colors"),children:I?"+ Add people or teams":"+ Add people"})})})]})}var j=e.i(388023);function k({title:e,description:s,children:r}){return(0,t.jsxs)("section",{className:"stg:px-6 stg:py-4",children:[(0,t.jsx)("h3",{className:"stg:text-xs stg:font-medium stg:text-muted-foreground",children:e}),s&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:text-[0.65rem] stg:text-muted-foreground",children:s}),(0,t.jsx)("div",{className:"stg:mt-2.5",children:r})]})}function I(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}e.s(["ManageAccessDialog",0,function({open:e,onOpenChange:o,resource:c,visibility:d,extraSection:g}){let u=(0,s.useId)(),m=(0,s.useCallback)(()=>{o(!1)},[o]),p=(0,a.hasGrantableRoles)(c.kind),x=(0,l.useResourceAvailable)(n.ApiResourceKind.team)&&(0,a.hasTeamGrantableRoles)(c.kind)?"People and teams with access":"People with access";return(0,t.jsx)(i.DialogShell,{open:e,onOpenChange:o,width:"md","aria-labelledby":u,children:e&&(0,t.jsxs)("div",{className:"stg:flex stg:flex-col",children:[(0,t.jsxs)("div",{className:"stg:flex stg:items-start stg:justify-between stg:border-b stg:border-border stg:px-6 stg:py-4",children:[(0,t.jsxs)("div",{className:"stg:min-w-0",children:[(0,t.jsx)("h2",{id:u,className:"stg:text-base stg:font-semibold stg:text-foreground",children:"Manage access"}),c.name&&(0,t.jsx)("p",{className:"stg:mt-0.5 stg:truncate stg:text-xs stg:text-muted-foreground",children:c.name})]}),(0,t.jsx)("button",{type:"button",onClick:m,"aria-label":"Close",className:(0,r.cn)("stg:rounded-md stg:p-1 stg:text-muted-foreground","stg:hover:text-foreground stg:hover:bg-accent-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring"),children:(0,t.jsx)(I,{})})]}),(0,t.jsxs)("div",{className:"stg:flex stg:flex-col stg:divide-y stg:divide-border",children:[d&&(0,t.jsx)(k,{title:"General access",description:"Who can find and open this resource.",children:(0,t.jsx)(j.ResourceVisibilityControl,{kind:d.kind,resourceId:c.id,visibility:d.current,org:d.org,onChanged:d.onChanged})}),p&&(0,t.jsx)(k,{title:x,children:(0,t.jsx)(y,{resource:{kind:c.kindString,id:c.id,resourceKind:c.kind},resourceKindString:c.kindString,resourceKind:c.kind,orgId:c.org})}),g&&(0,t.jsx)(k,{title:g.title,description:g.description,children:g.content})]}),(0,t.jsx)("div",{className:"stg:flex stg:items-center stg:justify-end stg:border-t stg:border-border stg:px-6 stg:py-3",children:(0,t.jsx)("button",{type:"button",onClick:m,className:(0,r.cn)("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-sm stg:font-medium","stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover","stg:focus:outline-none stg:focus:ring-2 stg:focus:ring-ring stg:focus:ring-offset-2"),children:"Done"})})]})})}],213149)}]);
|