zevairouter 1.0.33 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/cli/app/.next-cli-build/BUILD_ID +1 -1
- package/cli/app/.next-cli-build/app-path-routes-manifest.json +1 -1
- package/cli/app/.next-cli-build/build-manifest.json +2 -2
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/api/init/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/cancel/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/[jobId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/latest/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/antigravity/bulk-import/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/[jobId]/cancel/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/[jobId]/manual/[workerId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/[jobId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/latest/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/autoclaw/bulk-import/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/callback.html +1 -1
- package/cli/app/.next-cli-build/server/app/callback.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.html +1 -1
- package/cli/app/.next-cli-build/server/app/index.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/landing.html +1 -1
- package/cli/app/.next-cli-build/server/app/landing.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app/login.html +1 -1
- package/cli/app/.next-cli-build/server/app/login.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
- package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
- package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
- package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/app-paths-manifest.json +1 -1
- package/cli/app/.next-cli-build/server/chunks/1396.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/1939.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/3110.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/5949.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/6896.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/7153.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8242.js +2 -2
- package/cli/app/.next-cli-build/server/chunks/8590.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/8895.js +7 -1
- package/cli/app/.next-cli-build/server/chunks/891.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9326.js +1 -1
- package/cli/app/.next-cli-build/server/chunks/9489.js +1 -1
- package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
- package/cli/app/.next-cli-build/server/middleware.js +1 -1
- package/cli/app/.next-cli-build/server/pages/404.html +1 -1
- package/cli/app/.next-cli-build/server/pages/500.html +1 -1
- package/cli/app/.next-cli-build/static/chunks/{1321-6c12abb13c279b74.js → 1321-003c18d34f8bf26a.js} +1 -1
- package/cli/app/.next-cli-build/static/chunks/523-9807fa9a0746de61.js +3 -0
- package/cli/app/package.json +1 -1
- package/cli/app/src/lib/oauth/services/bulkImportBrowserEngine.js +17 -2
- package/cli/package.json +1 -1
- package/open-sse/handlers/chatCore.js +8 -1
- package/open-sse/rtk/ponytail.js +91 -0
- package/open-sse/rtk/ponytailPrompts.js +44 -0
- package/open-sse/utils/proxyFetch.js +3 -2
- package/package.json +1 -1
- package/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js +67 -0
- package/src/lib/db/repos/settingsRepo.js +2 -0
- package/src/lib/oauth/services/bulkImportBrowserEngine.js +17 -2
- package/src/lib/oauth/services/kiroGoogleAutomation.js +20 -12
- package/src/sse/handlers/chat.js +2 -0
- package/cli/app/.next-cli-build/static/chunks/523-afe352c06592ae73.js +0 -3
- /package/cli/app/.next-cli-build/static/{f1u5fynk7pHdbkB9PVUND → FGw-I-CGGpfd2854oBF1w}/_buildManifest.js +0 -0
- /package/cli/app/.next-cli-build/static/{f1u5fynk7pHdbkB9PVUND → FGw-I-CGGpfd2854oBF1w}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[523],{80523:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>b});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059),c=s(73006);let d=["zh-CN","zh-TW"],m=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}];async function x(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(5e3)})).ok}catch{return!1}}async function u(...e){let t=e.filter(Boolean).map(x);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}let h=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],p=[{id:"lite",label:"Lite",desc:"Suggest lazier alternative"},{id:"full",label:"Full",desc:"Enforce the ladder, shortest diff"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, one-liner or bust"}];function b({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[v,k]=(0,l.useState)(!1),[w,N]=(0,l.useState)(""),[C,S]=(0,l.useState)(null),[T,E]=(0,l.useState)(null),[P,_]=(0,l.useState)(!1),[$,A]=(0,l.useState)(!0),[O,U]=(0,l.useState)(!0),[I,D]=(0,l.useState)(!1),[F,L]=(0,l.useState)(!0),[R,W]=(0,l.useState)(!1),[q,K]=(0,l.useState)("full"),[z,J]=(0,l.useState)(!1),[M,H]=(0,l.useState)("full"),[B,Z]=(0,l.useState)("en"),[G,Q]=(0,l.useState)(!0),[Y,V]=(0,l.useState)(!1),[X,ee]=(0,l.useState)(!1),[et,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)(""),[en,er]=(0,l.useState)(!1),[ei,eo]=(0,l.useState)(""),[ec,ed]=(0,l.useState)(null),[em,ex]=(0,l.useState)(!1),[eu,eh]=(0,l.useState)(!1),[ep,eb]=(0,l.useState)(!1),[ey,ef]=(0,l.useState)(!1),[eg,ej]=(0,l.useState)(""),[ev,ek]=(0,l.useState)(!1),[ew,eN]=(0,l.useState)(""),[eC,eS]=(0,l.useState)(null),[eT,eE]=(0,l.useState)(""),[eP,e_]=(0,l.useState)(""),[e$,eA]=(0,l.useState)(null),[eO,eU]=(0,l.useState)(!1),[eI,eD]=(0,l.useState)([]),[eF,eL]=(0,l.useState)(""),[eR,eW]=(0,l.useState)(!1),[eq,eK]=(0,l.useState)(!1),[ez,eJ]=(0,l.useState)(!1),eM=(0,l.useRef)(null),eH=(0,l.useRef)(0),eB=(0,l.useRef)(0),eZ=(0,l.useRef)(!1),eG=(0,l.useRef)(!1),eQ=(0,l.useRef)(!1),eY=(0,l.useRef)(!1),[eV,eX]=(0,l.useState)(!1),[e0,e1]=(0,l.useState)(!1),[e5,e2]=(0,l.useState)(new Set),[e4,e3]=(0,l.useState)(!1);(0,l.useEffect)(()=>{e3(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]),(0,l.useEffect)(()=>(Z((0,c.kk)()),(0,c.oQ)(()=>Z((0,c.kk)()))),[]);let e8=d.includes(B),e6=e8?h:h.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=h.find(e=>e.id===q);e?.wenyan&&!e8&&(K("ultra"),to({cavemanLevel:"ultra"}))},[e8,q]);let{copied:e7,copy:e9}=(0,o.C)(),te=!$||!O,tt=$?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,l.useEffect)(()=>{eM.current&&(eM.current.scrollTop=eM.current.scrollHeight)},[eI]),(0,l.useEffect)(()=>{tc(),tl()},[]),(0,l.useEffect)(()=>{if(!(Y||ep))return;let e=!Y||X,t=!ep||ey,s=()=>{document.hidden||ta()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||ta()},5e3);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[Y,ep,X,ey]),(0,l.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(Y&&(et||ea)){let e=await u(ea,et);eZ.current=e,e?(eH.current=0,ee(!0),eQ.current||(eQ.current=!0,eX(!0))):(eH.current+=1,eH.current>=5&&ee(!1))}else eZ.current=!1;if(ep&&eg){let e=await x(eg);eG.current=e,e?(eB.current=0,ef(!0),eY.current||(eY.current=!0,e1(!0))):(eB.current+=1,eB.current>=5&&ef(!1))}else eG.current=!1}};if(!(Y&&(et||ea)||ep&&eg))return;e();let t=!ep||ey;if((!Y||X)&&t)return;let s=setInterval(e,1e4);return()=>clearInterval(s)},[Y,et,ea,ep,eg,X,ey]);let ts=(0,l.useCallback)((e,t,s,a,l,n)=>{t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=5&&a(!1))},[]),ta=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";es(a),el(t.tunnel?.publicUrl||""),V(s),ts(null,eZ,eH,ee,eQ,eX);let l=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,n=t.tailscale?.tunnelUrl||"";ej(n),eb(l),ts(null,eG,eB,ef,eY,e1)}catch{}},tl=async()=>{Q(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();_(t.requireApiKey||!1),A(!1!==t.requireLogin),U(t.hasPassword||!1),D(t.tunnelDashboardAccess||!1),L(!1!==t.rtkEnabled),W(!!t.cavemanEnabled),K(t.cavemanLevel||"full"),J(!!t.ponytailEnabled),H(t.ponytailLevel||"full")}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";es(a),el(e.tunnel?.publicUrl||""),V(s),ts(null,eZ,eH,ee,eQ,eX);let l=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,n=e.tailscale?.tunnelUrl||"";ej(n),eb(l),ts(null,eG,eB,ef,eY,e1)}}catch(e){console.log("Error loading settings:",e)}finally{Q(!1)}},tn=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&D(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},tr=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&_(e)}catch(e){console.log("Error updating requireApiKey:",e)}},ti=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&L(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},to=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},tc=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},td=async(...e)=>{er(!0),eo("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=Date.now();for(;Date.now()-s<3e5;){if(await new Promise(e=>setTimeout(e,2e3)),await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return V(!0),er(!1),eo(""),!0;if((Date.now()-s)%1e4<2e3)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return ed({type:"error",message:"Tunnel process stopped unexpectedly."}),er(!1),eo(""),!1}}catch{}}return ed({type:"error",message:"Tunnel created but not reachable. Please try again."}),er(!1),eo(""),!1},tm=async()=>{ex(!1),er(!0),ed(null),eo("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?eo(`Downloading cloudflared... ${s.download.progress}%`):e&&eo("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void ed({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void ed({type:"error",message:"No tunnel URL returned"});es(a),el(s.publicUrl||""),await td(s.publicUrl,a)}catch(e){ed({type:"error",message:e.message})}finally{e=!1,er(!1),eo("")}},tx=async()=>{er(!0),ed(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(V(!1),es(""),eh(!1),ed({type:"success",message:"Tunnel disabled"})):ed({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){ed({type:"error",message:e.message})}finally{er(!1)}},tu=async()=>{eA(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return eA(t.installed),t}}catch{}return eA(!1),{installed:!1}},th=async()=>{eU(!0),eS(null),eD([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:eF})});eL("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)eD(e=>[...e.slice(-50),a.message]);else if("done"===s){eA(!0),eU(!1),eK(!1),tf();return}else"error"===s&&eS({type:"error",message:a.error||"Install failed"})}}}catch(e){eS({type:"error",message:e.message})}finally{eU(!1)}},tp=async e=>{eN("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},tb=(e,t)=>{eE(e),e_(t)},ty=()=>{eE(""),e_("")},tf=async()=>{eK(!1),eW(!0),ek(!0),eS(null),eN("Connecting..."),ty();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ej(t.tunnelUrl||"");let e=await tp(t.tunnelUrl);eb(!0),eS(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){tb(t.authUrl,"Open Login Page"),eN('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){ty(),eN("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ej(t.tunnelUrl||"");let e=await tp(t.tunnelUrl);eb(!0),eS(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await tg(t.enableUrl):eS({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}ty(),eS({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await tg(t.enableUrl);eS({type:"error",message:t.error||"Failed to connect"})}catch(e){eS({type:"error",message:e.message})}finally{ek(!1),eW(!1),eN(""),ty()}},tg=async e=>{tb(e,"Open Funnel Settings"),eN('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ty(),ej(t.tunnelUrl||"");let e=await tp(t.tunnelUrl);eb(!0),eS(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){ty(),eS({type:"error",message:t.error});return}}catch{}}ty(),eS({type:"error",message:"Timed out waiting for Funnel to be enabled."})},tj=async()=>{ek(!0),eS(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(eb(!1),ej(""),eJ(!1),eS({type:"success",message:"Tailscale disabled"})):eS({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){eS({type:"error",message:e.message})}finally{ek(!1)}},tv=async()=>{eS(null),eD([]);let e=await tu();e?.installed&&e?.hasCachedPassword?tf():eK(!0)},tk=async()=>{if(w.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:w})}),t=await e.json();e.ok&&(S(t.key),await tc(),N(""),k(!1))}catch(e){console.log("Error creating key:",e)}},tw=async e=>{E({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{E(null);try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),e2(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}}})},tN=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},[tC,tS]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{tS(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(y,{label:"Local",url:tC,copyId:"local_url",copied:e7,onCopy:e9}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${Y?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),Y&&!en&&X?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${ea||et}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e9(`${ea||et}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===e7?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eh(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!Y||en||X?en?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ei||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{er(!1),eo("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ec?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ec.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ex(!0),children:"Enable"})]}):G?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>Q(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{te?ed({type:"error",message:`Security required: ${tt}`}):P?ex(!0):ed({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eV?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>eh(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ep?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ep&&!ev&&ey?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${eg}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>e9(`${eg}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===e7?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eJ(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ep||ev||ey?ev||eR?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ew||"Connecting..."]}),eT&&(0,a.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(eT,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:eP||"Open"}),(0,a.jsx)("button",{onClick:()=>{ek(!1),eW(!1),eN(""),ty()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):eC?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),eC.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:tv,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{te?eS({type:"error",message:`Security required: ${tt}`}):tv()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),e0?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>eJ(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),te&&!Y&&!ep&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(j,{message:tt,action:{label:"Open settings",href:"/dashboard/profile"}})}),(Y||ep)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!P&&(0,a.jsx)(j,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!$||!O)&&(0,a.jsx)(j,{message:$?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:$?"Change password":"Enable",href:"/dashboard/profile"}})]}),(Y||ep)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:I,onChange:()=>tn(!I)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(g,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(i.Zp,{id:"rtk",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"bolt"}),"Token Saver"]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,a.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,a.jsx)(i.lM,{checked:F,onChange:()=>ti(!F)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,a.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[R&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:e6.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;K(t=e.id),to({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,a.jsx)("p",{className:"text-xs text-primary",children:h.find(e=>e.id===q)?.desc})]}),(0,a.jsx)(i.lM,{checked:R,onChange:()=>{var e;W(e=!R),to({cavemanEnabled:e})}})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("p",{className:"font-medium",children:["Lazy code style"," ",(0,a.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"YAGNI ladder → shortest diff, minimal code"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:p.map(e=>(0,a.jsx)("button",{onClick:()=>{var t;H(t=e.id),to({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${M===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,a.jsx)("p",{className:"text-xs text-primary",children:p.find(e=>e.id===M)?.desc})]}),(0,a.jsx)(i.lM,{checked:z,onChange:()=>{var e;J(e=!z),to({ponytailEnabled:e})}})]})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>k(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(i.lM,{checked:P,onChange:()=>tr(!P)})]}),e4&&!P&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(j,{message:"Endpoint is exposed without an API key."})}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>k(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-center justify-between py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono",children:e5.has(e.id)?e.key:(t=e.key)?t.length>8?t.slice(0,8)+"...":t:""}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void e2(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",title:e5.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e5.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>e9(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:e7===e.id?"check":"content_copy"})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?E({title:"Pause API Key",message:`Pause API key "${e.name}"?
|
|
2
|
+
|
|
3
|
+
This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{E(null),tN(e.id,t)}}):tN(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>tw(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:v,title:"Create API Key",onClose:()=>{k(!1),N("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:w,onChange:e=>N(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tk,fullWidth:!0,disabled:!w.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{k(!1),N("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!C,title:"API Key Created",onClose:()=>S(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:C||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===e7?"check":"content_copy",onClick:()=>e9(C,"created_key"),children:"created_key"===e7?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>S(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:em,title:"Enable Tunnel",onClose:()=>ex(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local ZevaiRouter to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:m.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tm,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>ex(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eu,title:"Disable Tunnel",onClose:()=>!en&&eh(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tx,fullWidth:!0,disabled:en,variant:"danger",children:en?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>eh(!1),variant:"ghost",fullWidth:!0,disabled:en,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eq,title:"Tailscale Funnel",onClose:()=>{eO||(eK(!1),eL(""),eS(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===e$&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===e$&&!eO&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:th,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>eK(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eO&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),eI.length>0&&(0,a.jsx)("div",{ref:eM,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:eI.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===e$&&!eO&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:()=>tf(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>eK(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eC&&(0,a.jsx)(f,{status:eC})]})}),(0,a.jsx)(i.aF,{isOpen:ez,title:"Disable Tailscale",onClose:()=>!ev&&eJ(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tj,fullWidth:!0,disabled:ev,variant:"danger",children:ev?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>eJ(!1),variant:"ghost",fullWidth:!0,disabled:ev,children:"Cancel"})]})]})}),(0,a.jsx)(i.uo,{isOpen:!!T,onClose:()=>E(null),onConfirm:T?.onConfirm,title:T?.title||"Confirm",message:T?.message,variant:"danger"})]})}function y({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function f({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function g({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function j({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}b.propTypes={machineId:r().string.isRequired}}}]);
|
package/cli/app/package.json
CHANGED
|
@@ -58,13 +58,29 @@ const STEALTH_INIT_SCRIPT = `
|
|
|
58
58
|
};
|
|
59
59
|
`;
|
|
60
60
|
|
|
61
|
+
function getStealthUserAgent(browserVersion) {
|
|
62
|
+
const ver = browserVersion || "131.0.0.0";
|
|
63
|
+
// Match the UA platform string to the actual OS so Google doesn't flag a
|
|
64
|
+
// mismatch between the User-Agent header and navigator.platform / other
|
|
65
|
+
// client-side signals that leak the real OS.
|
|
66
|
+
const platform = typeof process !== "undefined" ? process.platform : "linux";
|
|
67
|
+
if (platform === "darwin") {
|
|
68
|
+
return `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${ver} Safari/537.36`;
|
|
69
|
+
}
|
|
70
|
+
if (platform === "win32") {
|
|
71
|
+
return `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${ver} Safari/537.36`;
|
|
72
|
+
}
|
|
73
|
+
// Linux (the VPS default)
|
|
74
|
+
return `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${ver} Safari/537.36`;
|
|
75
|
+
}
|
|
76
|
+
|
|
61
77
|
function wrapBrowserWithStealth(browser) {
|
|
62
78
|
const origNewContext = browser.newContext.bind(browser);
|
|
63
79
|
browser.newContext = async function (options = {}) {
|
|
64
80
|
// Fix HeadlessChrome in User-Agent — Google detects this server-side
|
|
65
81
|
if (!options.userAgent) {
|
|
66
82
|
const ver = browser.version ? browser.version() : "131.0.0.0";
|
|
67
|
-
options.userAgent =
|
|
83
|
+
options.userAgent = getStealthUserAgent(ver);
|
|
68
84
|
}
|
|
69
85
|
const ctx = await origNewContext(options);
|
|
70
86
|
await ctx.addInitScript(STEALTH_INIT_SCRIPT);
|
|
@@ -113,7 +129,6 @@ async function launchChromium({ proxyUrl } = {}) {
|
|
|
113
129
|
}
|
|
114
130
|
|
|
115
131
|
const options = {
|
|
116
|
-
channel: "chrome",
|
|
117
132
|
headless: true,
|
|
118
133
|
args: [
|
|
119
134
|
"--disable-blink-features=AutomationControlled",
|
package/cli/package.json
CHANGED
|
@@ -19,6 +19,7 @@ import { handleStreamingResponse, buildOnStreamComplete } from "./chatCore/strea
|
|
|
19
19
|
import { detectClientTool, isNativePassthrough } from "../utils/clientDetector.js";
|
|
20
20
|
import { dedupeTools } from "../utils/toolDeduper.js";
|
|
21
21
|
import { injectCaveman } from "../rtk/caveman.js";
|
|
22
|
+
import { injectPonytail } from "../rtk/ponytail.js";
|
|
22
23
|
import { injectContextFiles } from "../context/injectContext.js";
|
|
23
24
|
import { compressMessages, formatRtkLog } from "../rtk/index.js";
|
|
24
25
|
|
|
@@ -29,7 +30,7 @@ import { compressMessages, formatRtkLog } from "../rtk/index.js";
|
|
|
29
30
|
* @param {object} options.credentials - Provider credentials
|
|
30
31
|
* @param {string} options.sourceFormatOverride - Override detected source format (e.g. "openai-responses")
|
|
31
32
|
*/
|
|
32
|
-
export async function handleChatCore({ body, modelInfo, credentials, log, onCredentialsRefreshed, onRequestSuccess, onDisconnect, clientRawRequest, connectionId, userAgent, apiKey, ccFilterNaming, rtkEnabled, cavemanEnabled, cavemanLevel, contextInjectionEnabled, sourceFormatOverride, providerThinking }) {
|
|
33
|
+
export async function handleChatCore({ body, modelInfo, credentials, log, onCredentialsRefreshed, onRequestSuccess, onDisconnect, clientRawRequest, connectionId, userAgent, apiKey, ccFilterNaming, rtkEnabled, cavemanEnabled, cavemanLevel, contextInjectionEnabled, ponytailEnabled, ponytailLevel, sourceFormatOverride, providerThinking }) {
|
|
33
34
|
const { provider, model } = modelInfo;
|
|
34
35
|
const requestStartTime = Date.now();
|
|
35
36
|
|
|
@@ -138,6 +139,12 @@ export async function handleChatCore({ body, modelInfo, credentials, log, onCred
|
|
|
138
139
|
log?.debug?.("CAVEMAN", `${cavemanLevel} | ${finalFormat}`);
|
|
139
140
|
}
|
|
140
141
|
|
|
142
|
+
// Ponytail: inject lazy-senior-dev coding style
|
|
143
|
+
if (ponytailEnabled && ponytailLevel) {
|
|
144
|
+
injectPonytail(translatedBody, finalFormat, ponytailLevel);
|
|
145
|
+
log?.debug?.("PONYTAIL", `${ponytailLevel} | ${finalFormat}`);
|
|
146
|
+
}
|
|
147
|
+
|
|
141
148
|
// Context injection: prepend user-authored context files (soul.md, agent.md…)
|
|
142
149
|
if (contextInjectionEnabled) {
|
|
143
150
|
try {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Ponytail injector: appends a "lazy senior dev" instruction into the system message
|
|
2
|
+
// of the final request body, just before it is dispatched to the provider executor.
|
|
3
|
+
// Mirrors caveman.js injection pattern exactly.
|
|
4
|
+
|
|
5
|
+
import { FORMATS } from "../translator/formats.js";
|
|
6
|
+
import { PONYTAIL_PROMPTS } from "./ponytailPrompts.js";
|
|
7
|
+
|
|
8
|
+
const SEP = "\n\n";
|
|
9
|
+
|
|
10
|
+
export function injectPonytail(body, format, level) {
|
|
11
|
+
const prompt = PONYTAIL_PROMPTS[level];
|
|
12
|
+
if (!body || !prompt) return;
|
|
13
|
+
|
|
14
|
+
switch (format) {
|
|
15
|
+
case FORMATS.CLAUDE:
|
|
16
|
+
injectClaudeSystem(body, prompt);
|
|
17
|
+
return;
|
|
18
|
+
case FORMATS.GEMINI:
|
|
19
|
+
case FORMATS.GEMINI_CLI:
|
|
20
|
+
case FORMATS.VERTEX:
|
|
21
|
+
case FORMATS.ANTIGRAVITY:
|
|
22
|
+
injectGeminiSystem(body, prompt);
|
|
23
|
+
return;
|
|
24
|
+
default:
|
|
25
|
+
injectMessagesSystem(body, prompt);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function injectMessagesSystem(body, prompt) {
|
|
30
|
+
if (typeof body.instructions === "string") {
|
|
31
|
+
body.instructions = body.instructions
|
|
32
|
+
? `${body.instructions}${SEP}${prompt}`
|
|
33
|
+
: prompt;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const arr = Array.isArray(body.messages) ? body.messages
|
|
38
|
+
: Array.isArray(body.input) ? body.input
|
|
39
|
+
: null;
|
|
40
|
+
if (!arr) return;
|
|
41
|
+
|
|
42
|
+
const idx = arr.findIndex(m => m && (m.role === "system" || m.role === "developer"));
|
|
43
|
+
if (idx >= 0) {
|
|
44
|
+
appendToOpenAIMessage(arr[idx], prompt);
|
|
45
|
+
} else {
|
|
46
|
+
arr.unshift({ role: "system", content: prompt });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function appendToOpenAIMessage(msg, prompt) {
|
|
51
|
+
if (typeof msg.content === "string") {
|
|
52
|
+
msg.content = `${msg.content}${SEP}${prompt}`;
|
|
53
|
+
} else if (Array.isArray(msg.content)) {
|
|
54
|
+
msg.content.push({ type: "input_text", text: prompt });
|
|
55
|
+
} else {
|
|
56
|
+
msg.content = prompt;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function injectClaudeSystem(body, prompt) {
|
|
61
|
+
if (typeof body.system === "string" && body.system.length > 0) {
|
|
62
|
+
body.system = `${body.system}${SEP}${prompt}`;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (Array.isArray(body.system)) {
|
|
66
|
+
const block = { type: "text", text: prompt };
|
|
67
|
+
let lastCacheIdx = -1;
|
|
68
|
+
for (let i = body.system.length - 1; i >= 0; i--) {
|
|
69
|
+
if (body.system[i]?.cache_control) { lastCacheIdx = i; break; }
|
|
70
|
+
}
|
|
71
|
+
if (lastCacheIdx >= 0) {
|
|
72
|
+
body.system.splice(lastCacheIdx, 0, block);
|
|
73
|
+
} else {
|
|
74
|
+
body.system.push(block);
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
body.system = prompt;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function injectGeminiSystem(body, prompt) {
|
|
82
|
+
const target = body.request && typeof body.request === "object" ? body.request : body;
|
|
83
|
+
const useSnake = Object.prototype.hasOwnProperty.call(target, "system_instruction");
|
|
84
|
+
const key = useSnake ? "system_instruction" : "systemInstruction";
|
|
85
|
+
const sys = target[key];
|
|
86
|
+
if (sys && Array.isArray(sys.parts)) {
|
|
87
|
+
sys.parts.push({ text: prompt });
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
target[key] = { parts: [{ text: prompt }] };
|
|
91
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Ponytail intensity-level prompts injected into system message to enforce lazy-senior-dev coding.
|
|
2
|
+
// Adapted from ponytail skill (https://github.com/DietrichGebert/ponytail).
|
|
3
|
+
|
|
4
|
+
export const PONYTAIL_LEVELS = {
|
|
5
|
+
LITE: "lite",
|
|
6
|
+
FULL: "full",
|
|
7
|
+
ULTRA: "ultra",
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const SHARED_LADDER = "Before writing code, stop at the first rung that holds: 1) Does this need to exist? Skip if speculative (YAGNI). 2) Already in codebase? Reuse it. 3) Stdlib does it? Use stdlib. 4) Native platform feature? Use it (CSS over JS, <input type=\"date\"> over picker lib, DB constraint over app code). 5) Installed dependency? Use it, never add new ones for what a few lines do. 6) One line? Write one line. 7) Only then: minimum code that works.";
|
|
11
|
+
|
|
12
|
+
const SHARED_RULES = "No unrequested abstractions. No boilerplate 'for later'. Deletion over addition. Fewest files. Shortest working diff. Mark simplifications: // ponytail: [reason]. Bug fix = root cause fix, not symptom patch.";
|
|
13
|
+
|
|
14
|
+
const SHARED_SAFETY = "Never simplify away: input validation at trust boundaries, error handling preventing data loss, security measures, accessibility, anything explicitly requested. User insists on full version → build it.";
|
|
15
|
+
|
|
16
|
+
const SHARED_PERSISTENCE = "ACTIVE EVERY RESPONSE. No drift back to over-building. Still active if unsure.";
|
|
17
|
+
|
|
18
|
+
export const PONYTAIL_PROMPTS = {
|
|
19
|
+
[PONYTAIL_LEVELS.LITE]: [
|
|
20
|
+
"You are a lazy senior dev. Build what's asked, but name the lazier alternative in one line. User picks.",
|
|
21
|
+
SHARED_LADDER,
|
|
22
|
+
SHARED_SAFETY,
|
|
23
|
+
"Output: code first, then one line naming what could be simpler.",
|
|
24
|
+
SHARED_PERSISTENCE,
|
|
25
|
+
].join(" "),
|
|
26
|
+
|
|
27
|
+
[PONYTAIL_LEVELS.FULL]: [
|
|
28
|
+
"You are a lazy senior dev. The best code is the code never written. Enforce the ladder — stdlib and native first, shortest diff, shortest explanation.",
|
|
29
|
+
SHARED_LADDER,
|
|
30
|
+
SHARED_RULES,
|
|
31
|
+
SHARED_SAFETY,
|
|
32
|
+
"Output: code first, then at most 3 short lines: what was skipped, when to add it. Pattern: [code] → skipped: [X], add when [Y].",
|
|
33
|
+
SHARED_PERSISTENCE,
|
|
34
|
+
].join(" "),
|
|
35
|
+
|
|
36
|
+
[PONYTAIL_LEVELS.ULTRA]: [
|
|
37
|
+
"You are a YAGNI extremist. Deletion before addition. Ship the one-liner and challenge the rest of the requirement. The laziest solution that actually works.",
|
|
38
|
+
SHARED_LADDER,
|
|
39
|
+
SHARED_RULES,
|
|
40
|
+
SHARED_SAFETY,
|
|
41
|
+
"Output: one-liner or minimal code, then challenge: 'Do you actually need [X]?' No essays.",
|
|
42
|
+
SHARED_PERSISTENCE,
|
|
43
|
+
].join(" "),
|
|
44
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fetch as undiciFetch } from "undici";
|
|
1
2
|
import { Readable } from "stream";
|
|
2
3
|
import { MEMORY_CONFIG } from "../config/runtimeConfig.js";
|
|
3
4
|
import { dbg } from "./debugLog.js";
|
|
@@ -316,7 +317,7 @@ export async function proxyAwareFetch(url, options = {}, proxyOptions = null) {
|
|
|
316
317
|
// Proxy resolves DNS externally (not affected by /etc/hosts) — use proxy directly
|
|
317
318
|
try {
|
|
318
319
|
const dispatcher = await getDispatcher(proxyUrl);
|
|
319
|
-
return await
|
|
320
|
+
return await undiciFetch(url, { ...options, dispatcher });
|
|
320
321
|
} catch (proxyError) {
|
|
321
322
|
if (proxyOptions?.strictProxy === true) {
|
|
322
323
|
throw new Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${proxyError.message}`);
|
|
@@ -337,7 +338,7 @@ export async function proxyAwareFetch(url, options = {}, proxyOptions = null) {
|
|
|
337
338
|
if (proxyUrl) {
|
|
338
339
|
try {
|
|
339
340
|
const dispatcher = await getDispatcher(proxyUrl);
|
|
340
|
-
return await
|
|
341
|
+
return await undiciFetch(url, { ...options, dispatcher });
|
|
341
342
|
} catch (proxyError) {
|
|
342
343
|
// If strictProxy is enabled, fail hard instead of falling back to direct
|
|
343
344
|
if (proxyOptions?.strictProxy === true) {
|
package/package.json
CHANGED
|
@@ -61,6 +61,12 @@ const CAVEMAN_LEVELS = [
|
|
|
61
61
|
{ id: "wenyan", label: "文 Full", desc: "Maximum 文言文, 80-90% reduction", wenyan: true },
|
|
62
62
|
{ id: "wenyan-ultra", label: "文 Ultra", desc: "Extreme classical compression", wenyan: true },
|
|
63
63
|
];
|
|
64
|
+
|
|
65
|
+
const PONYTAIL_LEVELS = [
|
|
66
|
+
{ id: "lite", label: "Lite", desc: "Suggest lazier alternative" },
|
|
67
|
+
{ id: "full", label: "Full", desc: "Enforce the ladder, shortest diff" },
|
|
68
|
+
{ id: "ultra", label: "Ultra", desc: "YAGNI extremist, one-liner or bust" },
|
|
69
|
+
];
|
|
64
70
|
export default function APIPageClient({ machineId }) {
|
|
65
71
|
const [keys, setKeys] = useState([]);
|
|
66
72
|
const [loading, setLoading] = useState(true);
|
|
@@ -76,6 +82,8 @@ export default function APIPageClient({ machineId }) {
|
|
|
76
82
|
const [rtkEnabled, setRtkEnabledState] = useState(true);
|
|
77
83
|
const [cavemanEnabled, setCavemanEnabled] = useState(false);
|
|
78
84
|
const [cavemanLevel, setCavemanLevel] = useState("full");
|
|
85
|
+
const [ponytailEnabled, setPonytailEnabled] = useState(false);
|
|
86
|
+
const [ponytailLevel, setPonytailLevel] = useState("full");
|
|
79
87
|
const [locale, setLocale] = useState("en");
|
|
80
88
|
|
|
81
89
|
// Cloudflare Tunnel state
|
|
@@ -275,6 +283,8 @@ export default function APIPageClient({ machineId }) {
|
|
|
275
283
|
setRtkEnabledState(data.rtkEnabled !== false);
|
|
276
284
|
setCavemanEnabled(!!data.cavemanEnabled);
|
|
277
285
|
setCavemanLevel(data.cavemanLevel || "full");
|
|
286
|
+
setPonytailEnabled(!!data.ponytailEnabled);
|
|
287
|
+
setPonytailLevel(data.ponytailLevel || "full");
|
|
278
288
|
}
|
|
279
289
|
if (statusRes.ok) {
|
|
280
290
|
const data = await statusRes.json();
|
|
@@ -359,6 +369,16 @@ export default function APIPageClient({ machineId }) {
|
|
|
359
369
|
patchSetting({ cavemanLevel: level });
|
|
360
370
|
};
|
|
361
371
|
|
|
372
|
+
const handlePonytailEnabled = (value) => {
|
|
373
|
+
setPonytailEnabled(value);
|
|
374
|
+
patchSetting({ ponytailEnabled: value });
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
const handlePonytailLevel = (level) => {
|
|
378
|
+
setPonytailLevel(level);
|
|
379
|
+
patchSetting({ ponytailLevel: level });
|
|
380
|
+
};
|
|
381
|
+
|
|
362
382
|
const fetchData = async () => {
|
|
363
383
|
try {
|
|
364
384
|
const keysRes = await fetch("/api/keys");
|
|
@@ -1131,6 +1151,53 @@ export default function APIPageClient({ machineId }) {
|
|
|
1131
1151
|
/>
|
|
1132
1152
|
</div>
|
|
1133
1153
|
</div>
|
|
1154
|
+
<div className="flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap">
|
|
1155
|
+
<div className="min-w-0 flex-1">
|
|
1156
|
+
<p className="font-medium">
|
|
1157
|
+
Lazy code style{" "}
|
|
1158
|
+
<a
|
|
1159
|
+
href="https://github.com/DietrichGebert/ponytail"
|
|
1160
|
+
target="_blank"
|
|
1161
|
+
rel="noreferrer"
|
|
1162
|
+
className="text-xs font-normal text-primary underline hover:opacity-80"
|
|
1163
|
+
>
|
|
1164
|
+
(Ponytail)
|
|
1165
|
+
</a>
|
|
1166
|
+
</p>
|
|
1167
|
+
<p className="text-sm text-text-muted">
|
|
1168
|
+
YAGNI ladder → shortest diff, minimal code
|
|
1169
|
+
</p>
|
|
1170
|
+
</div>
|
|
1171
|
+
<div className="flex items-center gap-3 shrink-0">
|
|
1172
|
+
{ponytailEnabled && (
|
|
1173
|
+
<div className="flex flex-col items-end gap-1">
|
|
1174
|
+
<div className="flex items-center gap-1.5">
|
|
1175
|
+
{PONYTAIL_LEVELS.map((lvl) => (
|
|
1176
|
+
<button
|
|
1177
|
+
key={lvl.id}
|
|
1178
|
+
onClick={() => handlePonytailLevel(lvl.id)}
|
|
1179
|
+
className={`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${
|
|
1180
|
+
ponytailLevel === lvl.id
|
|
1181
|
+
? "bg-primary text-white border-primary"
|
|
1182
|
+
: "bg-transparent border-border text-text-muted hover:bg-surface-2"
|
|
1183
|
+
}`}
|
|
1184
|
+
title={lvl.desc}
|
|
1185
|
+
>
|
|
1186
|
+
{lvl.label}
|
|
1187
|
+
</button>
|
|
1188
|
+
))}
|
|
1189
|
+
</div>
|
|
1190
|
+
<p className="text-xs text-primary">
|
|
1191
|
+
{PONYTAIL_LEVELS.find((lvl) => lvl.id === ponytailLevel)?.desc}
|
|
1192
|
+
</p>
|
|
1193
|
+
</div>
|
|
1194
|
+
)}
|
|
1195
|
+
<Toggle
|
|
1196
|
+
checked={ponytailEnabled}
|
|
1197
|
+
onChange={() => handlePonytailEnabled(!ponytailEnabled)}
|
|
1198
|
+
/>
|
|
1199
|
+
</div>
|
|
1200
|
+
</div>
|
|
1134
1201
|
</Card>
|
|
1135
1202
|
|
|
1136
1203
|
{/* API Keys */}
|
|
@@ -58,13 +58,29 @@ const STEALTH_INIT_SCRIPT = `
|
|
|
58
58
|
};
|
|
59
59
|
`;
|
|
60
60
|
|
|
61
|
+
function getStealthUserAgent(browserVersion) {
|
|
62
|
+
const ver = browserVersion || "131.0.0.0";
|
|
63
|
+
// Match the UA platform string to the actual OS so Google doesn't flag a
|
|
64
|
+
// mismatch between the User-Agent header and navigator.platform / other
|
|
65
|
+
// client-side signals that leak the real OS.
|
|
66
|
+
const platform = typeof process !== "undefined" ? process.platform : "linux";
|
|
67
|
+
if (platform === "darwin") {
|
|
68
|
+
return `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${ver} Safari/537.36`;
|
|
69
|
+
}
|
|
70
|
+
if (platform === "win32") {
|
|
71
|
+
return `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${ver} Safari/537.36`;
|
|
72
|
+
}
|
|
73
|
+
// Linux (the VPS default)
|
|
74
|
+
return `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${ver} Safari/537.36`;
|
|
75
|
+
}
|
|
76
|
+
|
|
61
77
|
function wrapBrowserWithStealth(browser) {
|
|
62
78
|
const origNewContext = browser.newContext.bind(browser);
|
|
63
79
|
browser.newContext = async function (options = {}) {
|
|
64
80
|
// Fix HeadlessChrome in User-Agent — Google detects this server-side
|
|
65
81
|
if (!options.userAgent) {
|
|
66
82
|
const ver = browser.version ? browser.version() : "131.0.0.0";
|
|
67
|
-
options.userAgent =
|
|
83
|
+
options.userAgent = getStealthUserAgent(ver);
|
|
68
84
|
}
|
|
69
85
|
const ctx = await origNewContext(options);
|
|
70
86
|
await ctx.addInitScript(STEALTH_INIT_SCRIPT);
|
|
@@ -113,7 +129,6 @@ async function launchChromium({ proxyUrl } = {}) {
|
|
|
113
129
|
}
|
|
114
130
|
|
|
115
131
|
const options = {
|
|
116
|
-
channel: "chrome",
|
|
117
132
|
headless: true,
|
|
118
133
|
args: [
|
|
119
134
|
"--disable-blink-features=AutomationControlled",
|
|
@@ -1387,6 +1387,10 @@ export async function runGoogleAccountAutomation({
|
|
|
1387
1387
|
} else {
|
|
1388
1388
|
reportStep("submitting_email", "Submitting email");
|
|
1389
1389
|
await clickFirstVisible(page, NEXT_BUTTON_SELECTORS);
|
|
1390
|
+
// Wait for the page to transition away from the email step so the
|
|
1391
|
+
// polling loop doesn't immediately re-detect the disappearing email
|
|
1392
|
+
// field and type the email value into the password input.
|
|
1393
|
+
await page.waitForTimeout(2_500);
|
|
1390
1394
|
}
|
|
1391
1395
|
}
|
|
1392
1396
|
|
|
@@ -1465,29 +1469,33 @@ export async function runGoogleAccountAutomation({
|
|
|
1465
1469
|
continue;
|
|
1466
1470
|
}
|
|
1467
1471
|
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
+
// Check password BEFORE email — after submitting the email the password
|
|
1473
|
+
// page loads and during the transition the old email input can briefly
|
|
1474
|
+
// remain visible; if we checked email first we'd re-type the email
|
|
1475
|
+
// address into whatever field is focused (often the password input).
|
|
1476
|
+
const passwordInput = await getFirstVisibleLocator(page, PASSWORD_INPUT_SELECTOR);
|
|
1477
|
+
if (passwordInput) {
|
|
1478
|
+
reportStep("entering_password", "Entering Google password");
|
|
1479
|
+
const filled = await fillInputResilient(passwordInput, password);
|
|
1472
1480
|
if (filled) {
|
|
1473
|
-
reportStep("
|
|
1481
|
+
reportStep("submitting_password", "Submitting password");
|
|
1474
1482
|
await clickFirstVisible(page, NEXT_BUTTON_SELECTORS);
|
|
1475
1483
|
} else {
|
|
1476
|
-
reportStep("
|
|
1484
|
+
reportStep("password_fill_failed", "Could not fill the Google password field; retrying loop");
|
|
1477
1485
|
}
|
|
1478
1486
|
await page.waitForTimeout(700);
|
|
1479
1487
|
continue;
|
|
1480
1488
|
}
|
|
1481
1489
|
|
|
1482
|
-
const
|
|
1483
|
-
if (
|
|
1484
|
-
reportStep("
|
|
1485
|
-
const filled = await fillInputResilient(
|
|
1490
|
+
const nextEmailInput = await getFirstVisibleLocator(page, EMAIL_INPUT_SELECTOR);
|
|
1491
|
+
if (nextEmailInput) {
|
|
1492
|
+
reportStep("entering_email", "Entering Google email");
|
|
1493
|
+
const filled = await fillInputResilient(nextEmailInput, email);
|
|
1486
1494
|
if (filled) {
|
|
1487
|
-
reportStep("
|
|
1495
|
+
reportStep("submitting_email", "Submitting email");
|
|
1488
1496
|
await clickFirstVisible(page, NEXT_BUTTON_SELECTORS);
|
|
1489
1497
|
} else {
|
|
1490
|
-
reportStep("
|
|
1498
|
+
reportStep("email_fill_failed", "Could not fill the Google email field; retrying loop");
|
|
1491
1499
|
}
|
|
1492
1500
|
await page.waitForTimeout(700);
|
|
1493
1501
|
continue;
|
package/src/sse/handlers/chat.js
CHANGED
|
@@ -228,6 +228,8 @@ async function handleSingleModelChat(body, modelStr, clientRawRequest = null, re
|
|
|
228
228
|
rtkEnabled: !!chatSettings.rtkEnabled,
|
|
229
229
|
cavemanEnabled: !!chatSettings.cavemanEnabled,
|
|
230
230
|
cavemanLevel: chatSettings.cavemanLevel || "full",
|
|
231
|
+
ponytailEnabled: !!chatSettings.ponytailEnabled,
|
|
232
|
+
ponytailLevel: chatSettings.ponytailLevel || "full",
|
|
231
233
|
contextInjectionEnabled: !!chatSettings.contextInjectionEnabled,
|
|
232
234
|
providerThinking,
|
|
233
235
|
// Detect source format by endpoint + body
|