@symerian/symi 3.0.17 → 3.0.19
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/dist/{audio-preflight-CBDFctZN.js → audio-preflight-BfmZbg4Y.js} +4 -4
- package/dist/{audio-preflight-gsZSpG-6.js → audio-preflight-DcuC-liM.js} +4 -4
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +8 -8
- package/dist/bundled/session-memory/handler.js +7 -7
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chrome-nPMY1XTJ.js → chrome-Bo7cbvFK.js} +5 -5
- package/dist/{chrome-BjVab8gM.js → chrome-DYp18Q0t.js} +5 -5
- package/dist/{deliver-D-QFqm31.js → deliver-ChSIbiMM.js} +1 -1
- package/dist/{deliver-B4-bcot9.js → deliver-DEgRQM4J.js} +1 -1
- package/dist/extensionAPI.js +7 -7
- package/dist/{image-CDwtQjmt.js → image-Bx-hvoNJ.js} +1 -1
- package/dist/{image-CcS-vzTA.js → image-CQl_mjWk.js} +1 -1
- package/dist/llm-slug-generator.js +7 -7
- package/dist/{manager-BnEdHzmO.js → manager-D_pn0urG.js} +1 -1
- package/dist/{manager-09r0qPze.js → manager-YQxK2t0C.js} +1 -1
- package/dist/{pi-embedded-CWsY69-4.js → pi-embedded-CLw_ZzEZ.js} +16 -16
- package/dist/{pi-embedded-helpers-BBMy-lqr.js → pi-embedded-helpers-B5I53aw6.js} +4 -4
- package/dist/{pi-embedded-helpers-ChEYbgVj.js → pi-embedded-helpers-sUAEIC9X.js} +4 -4
- package/dist/plugin-sdk/{accounts-BfyWsC_i.js → accounts-CWFytwbR.js} +3 -3
- package/dist/plugin-sdk/{active-listener-DcJW7xAT.js → active-listener-BkZ4jHrL.js} +2 -2
- package/dist/plugin-sdk/{agent-scope-ChbGV6of.js → agent-scope-C9gfY_Gk.js} +2 -2
- package/dist/plugin-sdk/{audio-preflight-D3GtNLqW.js → audio-preflight-HKbdzXLZ.js} +21 -21
- package/dist/plugin-sdk/{bindings-CN2Qmefj.js → bindings-BaKIqPPy.js} +2 -2
- package/dist/plugin-sdk/{channel-web-DTyqujjA.js → channel-web-D5nWiTH1.js} +18 -18
- package/dist/plugin-sdk/{chrome-BKzAKr3K.js → chrome-klTSnz-9.js} +3 -3
- package/dist/plugin-sdk/{chunk-DhDkBujV.js → chunk-BbrYSny_.js} +1 -1
- package/dist/plugin-sdk/{command-format-CVrYFyZS.js → command-format-BN6tyZt6.js} +1 -1
- package/dist/plugin-sdk/{commands-registry-17yfZkHZ.js → commands-registry-CTzKKtY6.js} +4 -4
- package/dist/plugin-sdk/{config-7wk65zKC.js → config-Crv2qEdJ.js} +9 -9
- package/dist/plugin-sdk/{consolidate-exbAW0ml.js → consolidate-DT1QH65Q.js} +2 -2
- package/dist/plugin-sdk/{deliver-TxAcw7J5.js → deliver-7rOvAlrc.js} +12 -12
- package/dist/plugin-sdk/{diagnostic-Debx4frd.js → diagnostic-0nsxhWp7.js} +1 -1
- package/dist/plugin-sdk/{fs-safe-wBYbAkJF.js → fs-safe-DfWYBeWF.js} +1 -1
- package/dist/plugin-sdk/{gemini-auth-7U2pm2Ky.js → gemini-auth-C0N0_u49.js} +1 -1
- package/dist/plugin-sdk/{image-BtDVmYA5.js → image-WOSl2apK.js} +4 -4
- package/dist/plugin-sdk/index.js +43 -43
- package/dist/plugin-sdk/{ir-CKMvRrGW.js → ir-9J84MTls.js} +4 -4
- package/dist/plugin-sdk/{local-roots-c_gaPs01.js → local-roots-OLRDbvyY.js} +3 -3
- package/dist/plugin-sdk/{login-DUym1Jy0.js → login-C7x4q0i2.js} +7 -7
- package/dist/plugin-sdk/{login-qr-B-WBdvrX.js → login-qr-Dv5_MoAW.js} +9 -9
- package/dist/plugin-sdk/{manager-B71SCzos.js → manager-C83tK17x.js} +8 -8
- package/dist/plugin-sdk/{manifest-registry-Dnic6Chh.js → manifest-registry-CJMV-PI7.js} +1 -1
- package/dist/plugin-sdk/{markdown-tables-Dur7OTlM.js → markdown-tables-DXNKz5y_.js} +1 -1
- package/dist/plugin-sdk/{message-channel-BrAhJJV_.js → message-channel-aGy1HbQQ.js} +1 -1
- package/dist/plugin-sdk/{model-selection-B9qaVQSJ.js → model-selection-C-3-tpe7.js} +4 -4
- package/dist/plugin-sdk/{outbound-DB1wDM8b.js → outbound-DquCeSy5.js} +6 -6
- package/dist/plugin-sdk/{pi-auth-json-ZO118hoy.js → pi-auth-json-D9PDCXGn.js} +1 -1
- package/dist/plugin-sdk/{pi-embedded-helpers-s_U0Un7j.js → pi-embedded-helpers-D3ygfH7l.js} +16 -16
- package/dist/plugin-sdk/{plugins-DF81oSaI.js → plugins-DOwnSg9D.js} +4 -4
- package/dist/plugin-sdk/{pw-ai-CTwP02uv.js → pw-ai-rlengLjb.js} +8 -8
- package/dist/plugin-sdk/{qmd-manager-CBaSGant.js → qmd-manager-BzxFjRFa.js} +4 -4
- package/dist/plugin-sdk/{registry-CZVURNhF.js → registry-5iFfixlB.js} +2 -2
- package/dist/plugin-sdk/{replies-hwRbkU3z.js → replies-BXOzO_H5.js} +7 -7
- package/dist/plugin-sdk/{reply-prefix-CaXmzZlx.js → reply-prefix-INAKTqCU.js} +1 -1
- package/dist/plugin-sdk/{resolve-outbound-target-fxVSOBmk.js → resolve-outbound-target-DvbxHtqp.js} +2 -2
- package/dist/plugin-sdk/{resolve-route-ClCyiOeu.js → resolve-route-URXlY3AK.js} +3 -3
- package/dist/plugin-sdk/{runner-Cq5jvwQ7.js → runner-Bv0_DWoH.js} +9 -9
- package/dist/plugin-sdk/{session-B_TkB65Y.js → session-C3r8l7ou.js} +4 -4
- package/dist/plugin-sdk/{skill-commands-0LF9HTGr.js → skill-commands-KjLUGIdZ.js} +5 -5
- package/dist/plugin-sdk/{skills-BIT_O7J0.js → skills-BrsD4L5c.js} +7 -7
- package/dist/plugin-sdk/{sqlite-Bx5Y5U5X.js → sqlite-CjW7ME1H.js} +1 -1
- package/dist/plugin-sdk/{subsystem-CXqYeDy-.js → subsystem-DcOg1xJr.js} +1 -1
- package/dist/plugin-sdk/{synthesis-DtsYAj1E.js → synthesis-CY7YAasV.js} +38 -38
- package/dist/plugin-sdk/{target-errors-B8mokOeH.js → target-errors-BVWJGWFq.js} +2 -2
- package/dist/plugin-sdk/{thinking-Ca0DhqzO.js → thinking-CtsTDPOi.js} +3 -3
- package/dist/plugin-sdk/{tokens-CvlONEqh.js → tokens-8lqOTZCB.js} +1 -1
- package/dist/plugin-sdk/{tool-images-DpBaWEHT.js → tool-images-Cl_rGIUZ.js} +2 -2
- package/dist/plugin-sdk/{tool-loop-detection-BOvUFa0f.js → tool-loop-detection-Da4WUT_P.js} +2 -2
- package/dist/plugin-sdk/{unified-runner-CnM7lyNd.js → unified-runner-nwMnsZyj.js} +60 -60
- package/dist/plugin-sdk/web-BlweOZDp.js +54 -0
- package/dist/plugin-sdk/{whatsapp-actions-CvnfsFJm.js → whatsapp-actions-DpfaGYs7.js} +21 -21
- package/dist/{pw-ai-BW8_KeDf.js → pw-ai-BqxJG-Wh.js} +1 -1
- package/dist/{pw-ai-j9IE1K0-.js → pw-ai-C-NSGye0.js} +1 -1
- package/dist/{runner-8ALr2UII.js → runner-COGFTeDw.js} +1 -1
- package/dist/{runner-C4-9kFdR.js → runner-DhCi2lT1.js} +1 -1
- package/dist/{synthesis-Cph3LhA1.js → synthesis-CXZu24Vx.js} +7 -7
- package/dist/{synthesis-Cus0A2dL.js → synthesis-DrPxcMlQ.js} +7 -7
- package/dist/{unified-runner-CX80YMTk.js → unified-runner-iByUazvW.js} +16 -16
- package/dist/{web-ChozvJ7I.js → web-EsMQBIYf.js} +7 -7
- package/dist/{web-DFlsbXmQ.js → web-PPg5y6xI.js} +7 -7
- package/package.json +1 -1
- package/dist/plugin-sdk/web-CIPJBHAU.js +0 -54
- package/extensions/copilot-proxy/README.md +0 -24
- package/extensions/copilot-proxy/index.ts +0 -154
- package/extensions/copilot-proxy/node_modules/.bin/symi +0 -21
- package/extensions/copilot-proxy/package.json +0 -15
- package/extensions/copilot-proxy/symi.plugin.json +0 -9
- package/extensions/device-pair/index.ts +0 -642
- package/extensions/device-pair/symi.plugin.json +0 -20
- package/extensions/diagnostics-otel/index.ts +0 -15
- package/extensions/diagnostics-otel/node_modules/.bin/acorn +0 -21
- package/extensions/diagnostics-otel/node_modules/.bin/symi +0 -21
- package/extensions/diagnostics-otel/package.json +0 -27
- package/extensions/diagnostics-otel/src/service.test.ts +0 -290
- package/extensions/diagnostics-otel/src/service.ts +0 -666
- package/extensions/diagnostics-otel/symi.plugin.json +0 -8
- package/extensions/google-antigravity-auth/README.md +0 -24
- package/extensions/google-antigravity-auth/index.ts +0 -424
- package/extensions/google-antigravity-auth/node_modules/.bin/symi +0 -21
- package/extensions/google-antigravity-auth/package.json +0 -15
- package/extensions/google-antigravity-auth/symi.plugin.json +0 -9
- package/extensions/google-gemini-cli-auth/README.md +0 -35
- package/extensions/google-gemini-cli-auth/index.ts +0 -75
- package/extensions/google-gemini-cli-auth/node_modules/.bin/symi +0 -21
- package/extensions/google-gemini-cli-auth/oauth.test.ts +0 -162
- package/extensions/google-gemini-cli-auth/oauth.ts +0 -636
- package/extensions/google-gemini-cli-auth/package.json +0 -15
- package/extensions/google-gemini-cli-auth/symi.plugin.json +0 -9
- package/extensions/learning-loop/index.ts +0 -159
- package/extensions/learning-loop/node_modules/.bin/symi +0 -21
- package/extensions/learning-loop/package.json +0 -18
- package/extensions/learning-loop/src/analytics/gateway-methods.ts +0 -230
- package/extensions/learning-loop/src/analytics/metrics-aggregator.ts +0 -153
- package/extensions/learning-loop/src/capture/run-tracker.ts +0 -181
- package/extensions/learning-loop/src/capture/serializer.ts +0 -74
- package/extensions/learning-loop/src/db.ts +0 -583
- package/extensions/learning-loop/src/feedback/explicit-feedback.ts +0 -58
- package/extensions/learning-loop/src/feedback/implicit-signals.ts +0 -89
- package/extensions/learning-loop/src/graph/edge-inference.ts +0 -189
- package/extensions/learning-loop/src/graph/graph-retrieval.ts +0 -144
- package/extensions/learning-loop/src/graph/graph-store.ts +0 -183
- package/extensions/learning-loop/src/hooks.ts +0 -244
- package/extensions/learning-loop/src/injection/cache.ts +0 -73
- package/extensions/learning-loop/src/injection/context-injector.ts +0 -104
- package/extensions/learning-loop/src/injection/prompt-builder.ts +0 -43
- package/extensions/learning-loop/src/learning/embedding-bridge.ts +0 -54
- package/extensions/learning-loop/src/learning/learning-extractor.ts +0 -217
- package/extensions/learning-loop/src/learning/learning-store.ts +0 -158
- package/extensions/learning-loop/src/learning/retrieval.ts +0 -87
- package/extensions/learning-loop/src/math/confidence-intervals.ts +0 -62
- package/extensions/learning-loop/src/math/ewma.ts +0 -51
- package/extensions/learning-loop/src/math/weighted-scorer.ts +0 -42
- package/extensions/learning-loop/src/schema.ts +0 -176
- package/extensions/learning-loop/src/scoring/normalization.ts +0 -32
- package/extensions/learning-loop/src/scoring/quality-engine.ts +0 -78
- package/extensions/learning-loop/src/scoring/signal-extractors.ts +0 -155
- package/extensions/learning-loop/src/test/context-injector.test.ts +0 -142
- package/extensions/learning-loop/src/test/fixes.test.ts +0 -1286
- package/extensions/learning-loop/src/test/graph.test.ts +0 -711
- package/extensions/learning-loop/src/test/integration.test.ts +0 -312
- package/extensions/learning-loop/src/test/learning-store.test.ts +0 -191
- package/extensions/learning-loop/src/test/math.test.ts +0 -148
- package/extensions/learning-loop/src/test/quality-engine.test.ts +0 -231
- package/extensions/learning-loop/src/test/run-tracker.test.ts +0 -143
- package/extensions/learning-loop/src/types.ts +0 -281
- package/extensions/learning-loop/symi.plugin.json +0 -46
- package/extensions/llm-task/README.md +0 -97
- package/extensions/llm-task/index.ts +0 -6
- package/extensions/llm-task/package.json +0 -12
- package/extensions/llm-task/src/llm-task-tool.test.ts +0 -138
- package/extensions/llm-task/src/llm-task-tool.ts +0 -249
- package/extensions/llm-task/symi.plugin.json +0 -21
- package/extensions/memory-lancedb/config.ts +0 -161
- package/extensions/memory-lancedb/index.test.ts +0 -330
- package/extensions/memory-lancedb/index.ts +0 -670
- package/extensions/memory-lancedb/node_modules/.bin/arrow2csv +0 -21
- package/extensions/memory-lancedb/node_modules/.bin/openai +0 -21
- package/extensions/memory-lancedb/node_modules/.bin/symi +0 -21
- package/extensions/memory-lancedb/package.json +0 -20
- package/extensions/memory-lancedb/symi.plugin.json +0 -71
- package/extensions/minimax-portal-auth/README.md +0 -33
- package/extensions/minimax-portal-auth/index.ts +0 -161
- package/extensions/minimax-portal-auth/node_modules/.bin/symi +0 -21
- package/extensions/minimax-portal-auth/oauth.ts +0 -247
- package/extensions/minimax-portal-auth/package.json +0 -15
- package/extensions/minimax-portal-auth/symi.plugin.json +0 -9
- package/extensions/model-equalizer/index.ts +0 -80
- package/extensions/model-equalizer/skills/model-equalizer/SKILL.md +0 -58
- package/extensions/model-equalizer/src/detection.ts +0 -62
- package/extensions/model-equalizer/src/enhancer.ts +0 -63
- package/extensions/model-equalizer/src/test/detection.test.ts +0 -218
- package/extensions/model-equalizer/src/test/enhancer.test.ts +0 -137
- package/extensions/model-equalizer/src/test/integration.test.ts +0 -185
- package/extensions/model-equalizer/src/types.ts +0 -24
- package/extensions/model-equalizer/symi.plugin.json +0 -12
- package/extensions/phone-control/index.ts +0 -421
- package/extensions/phone-control/symi.plugin.json +0 -10
- package/extensions/pipeline/README.md +0 -75
- package/extensions/pipeline/SKILL.md +0 -97
- package/extensions/pipeline/index.ts +0 -18
- package/extensions/pipeline/package.json +0 -11
- package/extensions/pipeline/src/pipeline-tool.test.ts +0 -345
- package/extensions/pipeline/src/pipeline-tool.ts +0 -266
- package/extensions/pipeline/src/windows-spawn.test.ts +0 -148
- package/extensions/pipeline/src/windows-spawn.ts +0 -193
- package/extensions/pipeline/symi.plugin.json +0 -10
- package/extensions/qwen-portal-auth/README.md +0 -24
- package/extensions/qwen-portal-auth/index.ts +0 -134
- package/extensions/qwen-portal-auth/oauth.ts +0 -190
- package/extensions/qwen-portal-auth/symi.plugin.json +0 -9
- package/extensions/talk-voice/index.ts +0 -150
- package/extensions/talk-voice/symi.plugin.json +0 -10
- package/extensions/thread-ownership/index.test.ts +0 -180
- package/extensions/thread-ownership/index.ts +0 -133
- package/extensions/thread-ownership/symi.plugin.json +0 -28
- package/skills/1password/SKILL.md +0 -71
- package/skills/1password/references/cli-examples.md +0 -29
- package/skills/1password/references/get-started.md +0 -17
- package/skills/apple-notes/SKILL.md +0 -78
- package/skills/apple-reminders/SKILL.md +0 -119
- package/skills/bear-notes/SKILL.md +0 -108
- package/skills/blogwatcher/SKILL.md +0 -70
- package/skills/blucli/SKILL.md +0 -48
- package/skills/bluebubbles/SKILL.md +0 -132
- package/skills/camsnap/SKILL.md +0 -46
- package/skills/canvas/SKILL.md +0 -204
- package/skills/connect-email/SKILL.md +0 -142
- package/skills/document-generation/SKILL.md +0 -83
- package/skills/eightctl/SKILL.md +0 -51
- package/skills/food-order/SKILL.md +0 -49
- package/skills/gemini/SKILL.md +0 -44
- package/skills/gh-issues/SKILL.md +0 -865
- package/skills/gifgrep/SKILL.md +0 -80
- package/skills/github/SKILL.md +0 -164
- package/skills/gog/SKILL.md +0 -117
- package/skills/goplaces/SKILL.md +0 -53
- package/skills/healthcheck/SKILL.md +0 -246
- package/skills/himalaya/SKILL.md +0 -258
- package/skills/himalaya/references/configuration.md +0 -184
- package/skills/himalaya/references/message-composition.md +0 -199
- package/skills/imsg/SKILL.md +0 -122
- package/skills/long-task/SKILL.md +0 -58
- package/skills/long-task/scripts/detach-task.sh +0 -187
- package/skills/nano-banana-pro/SKILL.md +0 -59
- package/skills/nano-banana-pro/scripts/generate_image.py +0 -184
- package/skills/nano-pdf/SKILL.md +0 -39
- package/skills/notion/SKILL.md +0 -173
- package/skills/obsidian/SKILL.md +0 -82
- package/skills/openai-image-gen/SKILL.md +0 -90
- package/skills/openai-image-gen/scripts/gen.py +0 -240
- package/skills/openai-whisper/SKILL.md +0 -39
- package/skills/openai-whisper-api/SKILL.md +0 -53
- package/skills/openai-whisper-api/scripts/transcribe.sh +0 -85
- package/skills/openhue/SKILL.md +0 -113
- package/skills/oracle/SKILL.md +0 -126
- package/skills/ordercli/SKILL.md +0 -79
- package/skills/peekaboo/SKILL.md +0 -191
- package/skills/reactions-extensive/SKILL.md +0 -30
- package/skills/reactions-minimal/SKILL.md +0 -31
- package/skills/safe-edit/SKILL.md +0 -51
- package/skills/sag/SKILL.md +0 -88
- package/skills/sherpa-onnx-tts/SKILL.md +0 -104
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +0 -178
- package/skills/songsee/SKILL.md +0 -50
- package/skills/sonoscli/SKILL.md +0 -66
- package/skills/spotify-player/SKILL.md +0 -65
- package/skills/symihub/SKILL.md +0 -78
- package/skills/things-mac/SKILL.md +0 -87
- package/skills/tmux/SKILL.md +0 -153
- package/skills/tmux/scripts/find-sessions.sh +0 -112
- package/skills/tmux/scripts/wait-for-text.sh +0 -83
- package/skills/trello/SKILL.md +0 -96
- package/skills/video-frames/SKILL.md +0 -47
- package/skills/video-frames/scripts/frame.sh +0 -81
- package/skills/voice-call/SKILL.md +0 -46
- package/skills/wacli/SKILL.md +0 -73
- package/skills/weather/SKILL.md +0 -113
- package/skills/xurl/SKILL.md +0 -462
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { createHash, randomBytes } from "node:crypto";
|
|
2
|
-
import { createServer } from "node:http";
|
|
3
|
-
import {
|
|
4
|
-
buildOauthProviderAuthResult,
|
|
5
|
-
emptyPluginConfigSchema,
|
|
6
|
-
isWSL2Sync,
|
|
7
|
-
type SymiPluginApi,
|
|
8
|
-
type ProviderAuthContext,
|
|
9
|
-
} from "symi/plugin-sdk";
|
|
10
|
-
|
|
11
|
-
// OAuth constants - decoded from pi-ai's base64 encoded values to stay in sync
|
|
12
|
-
const decode = (s: string) => Buffer.from(s, "base64").toString();
|
|
13
|
-
const CLIENT_ID = decode(
|
|
14
|
-
"MTA3MTAwNjA2MDU5MS10bWhzc2luMmgyMWxjcmUyMzV2dG9sb2poNGc0MDNlcC5hcHBzLmdvb2dsZXVzZXJjb250ZW50LmNvbQ==",
|
|
15
|
-
);
|
|
16
|
-
const CLIENT_SECRET = decode("R09DU1BYLUs1OEZXUjQ4NkxkTEoxbUxCOHNYQzR6NnFEQWY=");
|
|
17
|
-
const REDIRECT_URI = "http://localhost:51121/oauth-callback";
|
|
18
|
-
const AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
|
|
19
|
-
const TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
20
|
-
const DEFAULT_PROJECT_ID = "rising-fact-p41fc";
|
|
21
|
-
const DEFAULT_MODEL = "google-antigravity/claude-opus-4-6-thinking";
|
|
22
|
-
|
|
23
|
-
const SCOPES = [
|
|
24
|
-
"https://www.googleapis.com/auth/cloud-platform",
|
|
25
|
-
"https://www.googleapis.com/auth/userinfo.email",
|
|
26
|
-
"https://www.googleapis.com/auth/userinfo.profile",
|
|
27
|
-
"https://www.googleapis.com/auth/cclog",
|
|
28
|
-
"https://www.googleapis.com/auth/experimentsandconfigs",
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
const CODE_ASSIST_ENDPOINTS = [
|
|
32
|
-
"https://cloudcode-pa.googleapis.com",
|
|
33
|
-
"https://daily-cloudcode-pa.sandbox.googleapis.com",
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
const RESPONSE_PAGE = `<!DOCTYPE html>
|
|
37
|
-
<html lang="en">
|
|
38
|
-
<head>
|
|
39
|
-
<meta charset="utf-8" />
|
|
40
|
-
<title>Symi Antigravity OAuth</title>
|
|
41
|
-
</head>
|
|
42
|
-
<body>
|
|
43
|
-
<main>
|
|
44
|
-
<h1>Authentication complete</h1>
|
|
45
|
-
<p>You can return to the terminal.</p>
|
|
46
|
-
</main>
|
|
47
|
-
</body>
|
|
48
|
-
</html>`;
|
|
49
|
-
|
|
50
|
-
function generatePkce(): { verifier: string; challenge: string } {
|
|
51
|
-
const verifier = randomBytes(32).toString("hex");
|
|
52
|
-
const challenge = createHash("sha256").update(verifier).digest("base64url");
|
|
53
|
-
return { verifier, challenge };
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function shouldUseManualOAuthFlow(isRemote: boolean): boolean {
|
|
57
|
-
return isRemote || isWSL2Sync();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function buildAuthUrl(params: { challenge: string; state: string }): string {
|
|
61
|
-
const url = new URL(AUTH_URL);
|
|
62
|
-
url.searchParams.set("client_id", CLIENT_ID);
|
|
63
|
-
url.searchParams.set("response_type", "code");
|
|
64
|
-
url.searchParams.set("redirect_uri", REDIRECT_URI);
|
|
65
|
-
url.searchParams.set("scope", SCOPES.join(" "));
|
|
66
|
-
url.searchParams.set("code_challenge", params.challenge);
|
|
67
|
-
url.searchParams.set("code_challenge_method", "S256");
|
|
68
|
-
url.searchParams.set("state", params.state);
|
|
69
|
-
url.searchParams.set("access_type", "offline");
|
|
70
|
-
url.searchParams.set("prompt", "consent");
|
|
71
|
-
return url.toString();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function parseCallbackInput(input: string): { code: string; state: string } | { error: string } {
|
|
75
|
-
const trimmed = input.trim();
|
|
76
|
-
if (!trimmed) {
|
|
77
|
-
return { error: "No input provided" };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
try {
|
|
81
|
-
const url = new URL(trimmed);
|
|
82
|
-
const code = url.searchParams.get("code");
|
|
83
|
-
const state = url.searchParams.get("state");
|
|
84
|
-
if (!code) {
|
|
85
|
-
return { error: "Missing 'code' parameter in URL" };
|
|
86
|
-
}
|
|
87
|
-
if (!state) {
|
|
88
|
-
return { error: "Missing 'state' parameter in URL" };
|
|
89
|
-
}
|
|
90
|
-
return { code, state };
|
|
91
|
-
} catch {
|
|
92
|
-
return { error: "Paste the full redirect URL (not just the code)." };
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async function startCallbackServer(params: { timeoutMs: number }) {
|
|
97
|
-
const redirect = new URL(REDIRECT_URI);
|
|
98
|
-
const port = redirect.port ? Number(redirect.port) : 51121;
|
|
99
|
-
|
|
100
|
-
let settled = false;
|
|
101
|
-
let resolveCallback: (url: URL) => void;
|
|
102
|
-
let rejectCallback: (err: Error) => void;
|
|
103
|
-
|
|
104
|
-
const callbackPromise = new Promise<URL>((resolve, reject) => {
|
|
105
|
-
resolveCallback = (url) => {
|
|
106
|
-
if (settled) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
settled = true;
|
|
110
|
-
resolve(url);
|
|
111
|
-
};
|
|
112
|
-
rejectCallback = (err) => {
|
|
113
|
-
if (settled) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
settled = true;
|
|
117
|
-
reject(err);
|
|
118
|
-
};
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
const timeout = setTimeout(() => {
|
|
122
|
-
rejectCallback(new Error("Timed out waiting for OAuth callback"));
|
|
123
|
-
}, params.timeoutMs);
|
|
124
|
-
timeout.unref?.();
|
|
125
|
-
|
|
126
|
-
const server = createServer((request, response) => {
|
|
127
|
-
if (!request.url) {
|
|
128
|
-
response.writeHead(400, { "Content-Type": "text/plain" });
|
|
129
|
-
response.end("Missing URL");
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
const url = new URL(request.url, `${redirect.protocol}//${redirect.host}`);
|
|
134
|
-
if (url.pathname !== redirect.pathname) {
|
|
135
|
-
response.writeHead(404, { "Content-Type": "text/plain" });
|
|
136
|
-
response.end("Not found");
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
response.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
141
|
-
response.end(RESPONSE_PAGE);
|
|
142
|
-
resolveCallback(url);
|
|
143
|
-
|
|
144
|
-
setImmediate(() => {
|
|
145
|
-
server.close();
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
await new Promise<void>((resolve, reject) => {
|
|
150
|
-
const onError = (err: Error) => {
|
|
151
|
-
server.off("error", onError);
|
|
152
|
-
reject(err);
|
|
153
|
-
};
|
|
154
|
-
server.once("error", onError);
|
|
155
|
-
server.listen(port, "127.0.0.1", () => {
|
|
156
|
-
server.off("error", onError);
|
|
157
|
-
resolve();
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
return {
|
|
162
|
-
waitForCallback: () => callbackPromise,
|
|
163
|
-
close: () =>
|
|
164
|
-
new Promise<void>((resolve) => {
|
|
165
|
-
server.close(() => resolve());
|
|
166
|
-
}),
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
async function exchangeCode(params: {
|
|
171
|
-
code: string;
|
|
172
|
-
verifier: string;
|
|
173
|
-
}): Promise<{ access: string; refresh: string; expires: number }> {
|
|
174
|
-
const response = await fetch(TOKEN_URL, {
|
|
175
|
-
method: "POST",
|
|
176
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
177
|
-
body: new URLSearchParams({
|
|
178
|
-
client_id: CLIENT_ID,
|
|
179
|
-
client_secret: CLIENT_SECRET,
|
|
180
|
-
code: params.code,
|
|
181
|
-
grant_type: "authorization_code",
|
|
182
|
-
redirect_uri: REDIRECT_URI,
|
|
183
|
-
code_verifier: params.verifier,
|
|
184
|
-
}),
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
if (!response.ok) {
|
|
188
|
-
const text = await response.text();
|
|
189
|
-
throw new Error(`Token exchange failed: ${text}`);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const data = (await response.json()) as {
|
|
193
|
-
access_token?: string;
|
|
194
|
-
refresh_token?: string;
|
|
195
|
-
expires_in?: number;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
const access = data.access_token?.trim();
|
|
199
|
-
const refresh = data.refresh_token?.trim();
|
|
200
|
-
const expiresIn = data.expires_in ?? 0;
|
|
201
|
-
|
|
202
|
-
if (!access) {
|
|
203
|
-
throw new Error("Token exchange returned no access_token");
|
|
204
|
-
}
|
|
205
|
-
if (!refresh) {
|
|
206
|
-
throw new Error("Token exchange returned no refresh_token");
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const expires = Date.now() + expiresIn * 1000 - 5 * 60 * 1000;
|
|
210
|
-
return { access, refresh, expires };
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
async function fetchUserEmail(accessToken: string): Promise<string | undefined> {
|
|
214
|
-
try {
|
|
215
|
-
const response = await fetch("https://www.googleapis.com/oauth2/v1/userinfo?alt=json", {
|
|
216
|
-
headers: { Authorization: `Bearer ${accessToken}` },
|
|
217
|
-
});
|
|
218
|
-
if (!response.ok) {
|
|
219
|
-
return undefined;
|
|
220
|
-
}
|
|
221
|
-
const data = (await response.json()) as { email?: string };
|
|
222
|
-
return data.email;
|
|
223
|
-
} catch {
|
|
224
|
-
return undefined;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
async function fetchProjectId(accessToken: string): Promise<string> {
|
|
229
|
-
const headers = {
|
|
230
|
-
Authorization: `Bearer ${accessToken}`,
|
|
231
|
-
"Content-Type": "application/json",
|
|
232
|
-
"User-Agent": "google-api-nodejs-client/9.15.1",
|
|
233
|
-
"X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1",
|
|
234
|
-
"Client-Metadata": JSON.stringify({
|
|
235
|
-
ideType: "IDE_UNSPECIFIED",
|
|
236
|
-
platform: "PLATFORM_UNSPECIFIED",
|
|
237
|
-
pluginType: "GEMINI",
|
|
238
|
-
}),
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
for (const endpoint of CODE_ASSIST_ENDPOINTS) {
|
|
242
|
-
try {
|
|
243
|
-
const response = await fetch(`${endpoint}/v1internal:loadCodeAssist`, {
|
|
244
|
-
method: "POST",
|
|
245
|
-
headers,
|
|
246
|
-
body: JSON.stringify({
|
|
247
|
-
metadata: {
|
|
248
|
-
ideType: "IDE_UNSPECIFIED",
|
|
249
|
-
platform: "PLATFORM_UNSPECIFIED",
|
|
250
|
-
pluginType: "GEMINI",
|
|
251
|
-
},
|
|
252
|
-
}),
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
if (!response.ok) {
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
const data = (await response.json()) as {
|
|
259
|
-
cloudaicompanionProject?: string | { id?: string };
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
if (typeof data.cloudaicompanionProject === "string") {
|
|
263
|
-
return data.cloudaicompanionProject;
|
|
264
|
-
}
|
|
265
|
-
if (
|
|
266
|
-
data.cloudaicompanionProject &&
|
|
267
|
-
typeof data.cloudaicompanionProject === "object" &&
|
|
268
|
-
data.cloudaicompanionProject.id
|
|
269
|
-
) {
|
|
270
|
-
return data.cloudaicompanionProject.id;
|
|
271
|
-
}
|
|
272
|
-
} catch {
|
|
273
|
-
// ignore
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return DEFAULT_PROJECT_ID;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
async function loginAntigravity(params: {
|
|
281
|
-
isRemote: boolean;
|
|
282
|
-
openUrl: (url: string) => Promise<void>;
|
|
283
|
-
prompt: (message: string) => Promise<string>;
|
|
284
|
-
note: (message: string, title?: string) => Promise<void>;
|
|
285
|
-
log: (message: string) => void;
|
|
286
|
-
progress: { update: (msg: string) => void; stop: (msg?: string) => void };
|
|
287
|
-
}): Promise<{
|
|
288
|
-
access: string;
|
|
289
|
-
refresh: string;
|
|
290
|
-
expires: number;
|
|
291
|
-
email?: string;
|
|
292
|
-
projectId: string;
|
|
293
|
-
}> {
|
|
294
|
-
const { verifier, challenge } = generatePkce();
|
|
295
|
-
const state = randomBytes(16).toString("hex");
|
|
296
|
-
const authUrl = buildAuthUrl({ challenge, state });
|
|
297
|
-
|
|
298
|
-
let callbackServer: Awaited<ReturnType<typeof startCallbackServer>> | null = null;
|
|
299
|
-
const needsManual = shouldUseManualOAuthFlow(params.isRemote);
|
|
300
|
-
if (!needsManual) {
|
|
301
|
-
try {
|
|
302
|
-
callbackServer = await startCallbackServer({ timeoutMs: 5 * 60 * 1000 });
|
|
303
|
-
} catch {
|
|
304
|
-
callbackServer = null;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
if (!callbackServer) {
|
|
309
|
-
await params.note(
|
|
310
|
-
[
|
|
311
|
-
"Open the URL in your local browser.",
|
|
312
|
-
"After signing in, copy the full redirect URL and paste it back here.",
|
|
313
|
-
"",
|
|
314
|
-
`Auth URL: ${authUrl}`,
|
|
315
|
-
`Redirect URI: ${REDIRECT_URI}`,
|
|
316
|
-
].join("\n"),
|
|
317
|
-
"Google Antigravity OAuth",
|
|
318
|
-
);
|
|
319
|
-
// Output raw URL below the box for easy copying (fixes #1772)
|
|
320
|
-
params.log("");
|
|
321
|
-
params.log("Copy this URL:");
|
|
322
|
-
params.log(authUrl);
|
|
323
|
-
params.log("");
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
if (!needsManual) {
|
|
327
|
-
params.progress.update("Opening Google sign-in…");
|
|
328
|
-
try {
|
|
329
|
-
await params.openUrl(authUrl);
|
|
330
|
-
} catch {
|
|
331
|
-
// ignore
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
let code = "";
|
|
336
|
-
let returnedState = "";
|
|
337
|
-
|
|
338
|
-
if (callbackServer) {
|
|
339
|
-
params.progress.update("Waiting for OAuth callback…");
|
|
340
|
-
const callback = await callbackServer.waitForCallback();
|
|
341
|
-
code = callback.searchParams.get("code") ?? "";
|
|
342
|
-
returnedState = callback.searchParams.get("state") ?? "";
|
|
343
|
-
await callbackServer.close();
|
|
344
|
-
} else {
|
|
345
|
-
params.progress.update("Waiting for redirect URL…");
|
|
346
|
-
const input = await params.prompt("Paste the redirect URL: ");
|
|
347
|
-
const parsed = parseCallbackInput(input);
|
|
348
|
-
if ("error" in parsed) {
|
|
349
|
-
throw new Error(parsed.error);
|
|
350
|
-
}
|
|
351
|
-
code = parsed.code;
|
|
352
|
-
returnedState = parsed.state;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (!code) {
|
|
356
|
-
throw new Error("Missing OAuth code");
|
|
357
|
-
}
|
|
358
|
-
if (returnedState !== state) {
|
|
359
|
-
throw new Error("OAuth state mismatch. Please try again.");
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
params.progress.update("Exchanging code for tokens…");
|
|
363
|
-
const tokens = await exchangeCode({ code, verifier });
|
|
364
|
-
const email = await fetchUserEmail(tokens.access);
|
|
365
|
-
const projectId = await fetchProjectId(tokens.access);
|
|
366
|
-
|
|
367
|
-
params.progress.stop("Antigravity OAuth complete");
|
|
368
|
-
return { ...tokens, email, projectId };
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
const antigravityPlugin = {
|
|
372
|
-
id: "google-antigravity-auth",
|
|
373
|
-
name: "Google Antigravity Auth",
|
|
374
|
-
description: "OAuth flow for Google Antigravity (Cloud Code Assist)",
|
|
375
|
-
configSchema: emptyPluginConfigSchema(),
|
|
376
|
-
register(api: SymiPluginApi) {
|
|
377
|
-
api.registerProvider({
|
|
378
|
-
id: "google-antigravity",
|
|
379
|
-
label: "Google Antigravity",
|
|
380
|
-
docsPath: "/providers/models",
|
|
381
|
-
aliases: ["antigravity"],
|
|
382
|
-
auth: [
|
|
383
|
-
{
|
|
384
|
-
id: "oauth",
|
|
385
|
-
label: "Google OAuth",
|
|
386
|
-
hint: "PKCE + localhost callback",
|
|
387
|
-
kind: "oauth",
|
|
388
|
-
run: async (ctx: ProviderAuthContext) => {
|
|
389
|
-
const spin = ctx.prompter.progress("Starting Antigravity OAuth…");
|
|
390
|
-
try {
|
|
391
|
-
const result = await loginAntigravity({
|
|
392
|
-
isRemote: ctx.isRemote,
|
|
393
|
-
openUrl: ctx.openUrl,
|
|
394
|
-
prompt: async (message) => String(await ctx.prompter.text({ message })),
|
|
395
|
-
note: ctx.prompter.note,
|
|
396
|
-
log: (message) => ctx.runtime.log(message),
|
|
397
|
-
progress: spin,
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
return buildOauthProviderAuthResult({
|
|
401
|
-
providerId: "google-antigravity",
|
|
402
|
-
defaultModel: DEFAULT_MODEL,
|
|
403
|
-
access: result.access,
|
|
404
|
-
refresh: result.refresh,
|
|
405
|
-
expires: result.expires,
|
|
406
|
-
email: result.email,
|
|
407
|
-
credentialExtra: { projectId: result.projectId },
|
|
408
|
-
notes: [
|
|
409
|
-
"Antigravity uses Google Cloud project quotas.",
|
|
410
|
-
"Enable Gemini for Google Cloud on your project if requests fail.",
|
|
411
|
-
],
|
|
412
|
-
});
|
|
413
|
-
} catch (err) {
|
|
414
|
-
spin.stop("Antigravity OAuth failed");
|
|
415
|
-
throw err;
|
|
416
|
-
}
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
],
|
|
420
|
-
});
|
|
421
|
-
},
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
export default antigravityPlugin;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/symi/projects/symi/node_modules:/home/symi/projects/node_modules:/home/symi/node_modules:/home/node_modules:/node_modules:/home/symi/projects/symi/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/symi/projects/symi/node_modules:/home/symi/projects/node_modules:/home/symi/node_modules:/home/node_modules:/node_modules:/home/symi/projects/symi/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../@symerian/symi/symi.mjs" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@symerian/symi/symi.mjs" "$@"
|
|
21
|
-
fi
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@symi/google-antigravity-auth",
|
|
3
|
-
"version": "3.0.9",
|
|
4
|
-
"private": true,
|
|
5
|
-
"description": "Symi Google Antigravity OAuth provider plugin",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"devDependencies": {
|
|
8
|
-
"@symerian/symi": "workspace:*"
|
|
9
|
-
},
|
|
10
|
-
"symi": {
|
|
11
|
-
"extensions": [
|
|
12
|
-
"./index.ts"
|
|
13
|
-
]
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Google Gemini CLI Auth (Symi plugin)
|
|
2
|
-
|
|
3
|
-
OAuth provider plugin for **Gemini CLI** (Google Code Assist).
|
|
4
|
-
|
|
5
|
-
## Enable
|
|
6
|
-
|
|
7
|
-
Bundled plugins are disabled by default. Enable this one:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
symi plugins enable google-gemini-cli-auth
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Restart the Gateway after enabling.
|
|
14
|
-
|
|
15
|
-
## Authenticate
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
symi models auth login --provider google-gemini-cli --set-default
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Requirements
|
|
22
|
-
|
|
23
|
-
Requires the Gemini CLI to be installed (credentials are extracted automatically):
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
brew install gemini-cli
|
|
27
|
-
# or: npm install -g @google/gemini-cli
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Env vars (optional)
|
|
31
|
-
|
|
32
|
-
Override auto-detected credentials with:
|
|
33
|
-
|
|
34
|
-
- `SYMI_GEMINI_OAUTH_CLIENT_ID` / `GEMINI_CLI_OAUTH_CLIENT_ID`
|
|
35
|
-
- `SYMI_GEMINI_OAUTH_CLIENT_SECRET` / `GEMINI_CLI_OAUTH_CLIENT_SECRET`
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buildOauthProviderAuthResult,
|
|
3
|
-
emptyPluginConfigSchema,
|
|
4
|
-
type SymiPluginApi,
|
|
5
|
-
type ProviderAuthContext,
|
|
6
|
-
} from "symi/plugin-sdk";
|
|
7
|
-
import { loginGeminiCliOAuth } from "./oauth.js";
|
|
8
|
-
|
|
9
|
-
const PROVIDER_ID = "google-gemini-cli";
|
|
10
|
-
const PROVIDER_LABEL = "Gemini CLI OAuth";
|
|
11
|
-
const DEFAULT_MODEL = "google-gemini-cli/gemini-3-pro-preview";
|
|
12
|
-
const ENV_VARS = [
|
|
13
|
-
"SYMI_GEMINI_OAUTH_CLIENT_ID",
|
|
14
|
-
"SYMI_GEMINI_OAUTH_CLIENT_SECRET",
|
|
15
|
-
"GEMINI_CLI_OAUTH_CLIENT_ID",
|
|
16
|
-
"GEMINI_CLI_OAUTH_CLIENT_SECRET",
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
const geminiCliPlugin = {
|
|
20
|
-
id: "google-gemini-cli-auth",
|
|
21
|
-
name: "Google Gemini CLI Auth",
|
|
22
|
-
description: "OAuth flow for Gemini CLI (Google Code Assist)",
|
|
23
|
-
configSchema: emptyPluginConfigSchema(),
|
|
24
|
-
register(api: SymiPluginApi) {
|
|
25
|
-
api.registerProvider({
|
|
26
|
-
id: PROVIDER_ID,
|
|
27
|
-
label: PROVIDER_LABEL,
|
|
28
|
-
docsPath: "/providers/models",
|
|
29
|
-
aliases: ["gemini-cli"],
|
|
30
|
-
envVars: ENV_VARS,
|
|
31
|
-
auth: [
|
|
32
|
-
{
|
|
33
|
-
id: "oauth",
|
|
34
|
-
label: "Google OAuth",
|
|
35
|
-
hint: "PKCE + localhost callback",
|
|
36
|
-
kind: "oauth",
|
|
37
|
-
run: async (ctx: ProviderAuthContext) => {
|
|
38
|
-
const spin = ctx.prompter.progress("Starting Gemini CLI OAuth…");
|
|
39
|
-
try {
|
|
40
|
-
const result = await loginGeminiCliOAuth({
|
|
41
|
-
isRemote: ctx.isRemote,
|
|
42
|
-
openUrl: ctx.openUrl,
|
|
43
|
-
log: (msg) => ctx.runtime.log(msg),
|
|
44
|
-
note: ctx.prompter.note,
|
|
45
|
-
prompt: async (message) => String(await ctx.prompter.text({ message })),
|
|
46
|
-
progress: spin,
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
spin.stop("Gemini CLI OAuth complete");
|
|
50
|
-
return buildOauthProviderAuthResult({
|
|
51
|
-
providerId: PROVIDER_ID,
|
|
52
|
-
defaultModel: DEFAULT_MODEL,
|
|
53
|
-
access: result.access,
|
|
54
|
-
refresh: result.refresh,
|
|
55
|
-
expires: result.expires,
|
|
56
|
-
email: result.email,
|
|
57
|
-
credentialExtra: { projectId: result.projectId },
|
|
58
|
-
notes: ["If requests fail, set GOOGLE_CLOUD_PROJECT or GOOGLE_CLOUD_PROJECT_ID."],
|
|
59
|
-
});
|
|
60
|
-
} catch (err) {
|
|
61
|
-
spin.stop("Gemini CLI OAuth failed");
|
|
62
|
-
await ctx.prompter.note(
|
|
63
|
-
"Trouble with OAuth? Ensure your Google account has Gemini CLI access.",
|
|
64
|
-
"OAuth help",
|
|
65
|
-
);
|
|
66
|
-
throw err;
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export default geminiCliPlugin;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
-
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
-
basedir=`cygpath -w "$basedir"`
|
|
8
|
-
fi
|
|
9
|
-
;;
|
|
10
|
-
esac
|
|
11
|
-
|
|
12
|
-
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/home/symi/projects/symi/node_modules:/home/symi/projects/node_modules:/home/symi/node_modules:/home/node_modules:/node_modules:/home/symi/projects/symi/node_modules/.pnpm/node_modules"
|
|
14
|
-
else
|
|
15
|
-
export NODE_PATH="/home/symi/projects/symi/node_modules:/home/symi/projects/node_modules:/home/symi/node_modules:/home/node_modules:/node_modules:/home/symi/projects/symi/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
-
fi
|
|
17
|
-
if [ -x "$basedir/node" ]; then
|
|
18
|
-
exec "$basedir/node" "$basedir/../@symerian/symi/symi.mjs" "$@"
|
|
19
|
-
else
|
|
20
|
-
exec node "$basedir/../@symerian/symi/symi.mjs" "$@"
|
|
21
|
-
fi
|