pi-yandex-bridge 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ {
2
+ "success": true,
3
+ "issues": [
4
+ {
5
+ "type": "file",
6
+ "name": "dist/index.d.ts",
7
+ "file": "dist/index.d.ts"
8
+ }
9
+ ],
10
+ "unusedExports": [],
11
+ "unusedFiles": [
12
+ {
13
+ "type": "file",
14
+ "name": "dist/index.d.ts",
15
+ "file": "dist/index.d.ts"
16
+ }
17
+ ],
18
+ "unusedDeps": [],
19
+ "unlistedDeps": [],
20
+ "summary": "Found 1 issues"
21
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "timestamp": "2026-05-08T21:40:15.448Z"
3
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "signature": "index.ts::🔴 New unresolved imports/deps in modified code (Knip):\n index.ts:29 — unlisted: @earendil-works/pi-ai\n First location: index.ts\n",
3
+ "sessionId": "lens-moxfkr7l-92597cdf"
4
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "timestamp": "2026-05-08T21:37:51.694Z"
3
+ }
@@ -0,0 +1 @@
1
+ null
@@ -0,0 +1,3 @@
1
+ {
2
+ "timestamp": "2026-05-08T21:37:55.621Z"
3
+ }
@@ -0,0 +1,160 @@
1
+ {
2
+ "meta": {
3
+ "timestamp": "2026-05-08T21:36:15.317Z",
4
+ "project": "pi-yandex-bridge",
5
+ "path": "/Users/unitf90/pi-yandex-bridge",
6
+ "totalIssues": 12,
7
+ "fixableCount": 11,
8
+ "refactorNeeded": 1,
9
+ "runners": [
10
+ {
11
+ "name": "ast-grep (design smells)",
12
+ "status": "done",
13
+ "findings": 0,
14
+ "time": "23ms"
15
+ },
16
+ {
17
+ "name": "ast-grep (similar functions)",
18
+ "status": "done",
19
+ "findings": 0,
20
+ "time": "16ms"
21
+ },
22
+ {
23
+ "name": "semantic similarity (Amain)",
24
+ "status": "done",
25
+ "findings": 0,
26
+ "time": "18ms"
27
+ },
28
+ {
29
+ "name": "complexity metrics",
30
+ "status": "done",
31
+ "findings": 1,
32
+ "time": "8ms"
33
+ },
34
+ {
35
+ "name": "tree-sitter patterns",
36
+ "status": "done",
37
+ "findings": 0,
38
+ "time": "1ms"
39
+ },
40
+ {
41
+ "name": "fact rules",
42
+ "status": "done",
43
+ "findings": 1,
44
+ "time": "79ms"
45
+ },
46
+ {
47
+ "name": "TODO scanner",
48
+ "status": "done",
49
+ "findings": 0,
50
+ "time": "2ms"
51
+ },
52
+ {
53
+ "name": "dead code (Knip)",
54
+ "status": "done",
55
+ "findings": 2,
56
+ "time": "291ms"
57
+ },
58
+ {
59
+ "name": "duplicate code (jscpd)",
60
+ "status": "done",
61
+ "findings": 0,
62
+ "time": "480ms"
63
+ },
64
+ {
65
+ "name": "type coverage",
66
+ "status": "done",
67
+ "findings": 1,
68
+ "time": "5.3s"
69
+ },
70
+ {
71
+ "name": "circular deps (Madge)",
72
+ "status": "done",
73
+ "findings": 0,
74
+ "time": "1.8s"
75
+ },
76
+ {
77
+ "name": "production readiness",
78
+ "status": "done",
79
+ "findings": 7,
80
+ "time": "4ms"
81
+ },
82
+ {
83
+ "name": "compiler checks",
84
+ "status": "done",
85
+ "findings": 0,
86
+ "time": "1.6s"
87
+ }
88
+ ],
89
+ "totalTime": "9.6s"
90
+ },
91
+ "project": {
92
+ "type": "node",
93
+ "name": "pi-yandex-bridge",
94
+ "version": "0.1.0",
95
+ "packageManager": "bun",
96
+ "languages": [
97
+ "javascript",
98
+ "typescript"
99
+ ],
100
+ "hasTests": false,
101
+ "hasLinting": false,
102
+ "hasFormatting": false,
103
+ "hasTypeScript": true,
104
+ "configFiles": [
105
+ "package.json",
106
+ "tsconfig.json"
107
+ ],
108
+ "scripts": {
109
+ "build": "tsc"
110
+ }
111
+ },
112
+ "commands": [
113
+ {
114
+ "action": "build",
115
+ "command": "bun run build"
116
+ }
117
+ ],
118
+ "byCategory": {
119
+ "AI Slop": {
120
+ "count": 1,
121
+ "severity": "🟡",
122
+ "fixable": true,
123
+ "falsePositivePrefix": "ai-slop:"
124
+ },
125
+ "Fact Rules": {
126
+ "count": 1,
127
+ "severity": "🟡",
128
+ "fixable": true,
129
+ "falsePositivePrefix": "fact-rules:"
130
+ },
131
+ "Dead Code": {
132
+ "count": 2,
133
+ "severity": "🟡",
134
+ "fixable": true,
135
+ "falsePositivePrefix": "dead-code:"
136
+ },
137
+ "Type Coverage": {
138
+ "count": 1,
139
+ "severity": "ℹ️",
140
+ "fixable": false,
141
+ "falsePositivePrefix": "type-coverage:"
142
+ },
143
+ "Production Readiness": {
144
+ "count": 7,
145
+ "severity": "🟡",
146
+ "fixable": true,
147
+ "falsePositivePrefix": "production-readiness:"
148
+ }
149
+ },
150
+ "howToMarkFalsePositive": {
151
+ "command": "Ignore via AGENTS.md rules or suppress comments",
152
+ "format": "Add to .claude/rules or use biome/oxlint ignore comments",
153
+ "examples": [
154
+ "// biome-ignore lint/suspicious/noConsole: intentional debug",
155
+ "// oxlint-disable-next-line no-console"
156
+ ]
157
+ },
158
+ "sessionFile": "/Users/unitf90/pi-yandex-bridge/.pi-lens/fix-session.json",
159
+ "details": "## Complexity Metrics\n\n**1 file(s) scanned**\n\n### Summary\n\n| Metric | Value |\n|--------|-------|\n| Avg Maintainability Index | 22.8 |\n| Min Maintainability Index | 22.8 |\n| Avg Cognitive Complexity | 67.0 |\n| Max Cognitive Complexity | 67 |\n| Avg Cyclomatic Complexity | 2.0 |\n| Max Nesting Depth | 6 |\n| Total Files | 1 |\n\n### AI Slop Indicators\n\n index.ts:\n ⚠ Maintainability dropped to 22.8 — extract logic into helper functions\n ⚠ Cognitive complexity (67) — simplify logic flow\n\n\n## Fact Rules (Semantic Analysis)\n\n**1 issue(s) across 1 rule(s)**\n\n### 🟡 unsafe-boundary (1)\n\n'<anonymous>' is async, calls 'fetch', has complexity 11, but no try/catch — unhandled rejection risk\n\n| File | Line |\n|------|------|\n| index.ts | 308 |\n\n\n## Dead Code (Knip)\n\n**2 issue(s) found**\n\n| Type | Name | File |\n|------|------|------|\n| file | dist/index.d.ts | dist/index.d.ts |\n| unlisted | @earendil-works/pi-ai | index.ts |\n\n\n## Type Coverage\n\n**99.0% typed** (519/524 identifiers)\n\nType coverage highlights identifiers that resolve to `any` (implicit or explicit). Inferred non-`any` types are treated as typed.\n\n### Top Files by Any-Typed Identifier Count\n\n| File | Any-Typed Count |\n|------|-----------------|\n| /Users/unitf90/pi-yandex-bridge/index.ts | 5 |\n\n\n## Production Readiness\n\n**Score:** 74/100 **Grade:** C\n\n### Code (96/100)\n\n- 1 source files\n- 406 total lines\n- ⚠️ 2 console.log/debug statements\n\n### Tests (25/100)\n\n- 0 test files\n- 0 test cases (approximate)\n- ⚠️ No test files found\n- ⚠️ No test framework configuration detected\n\n### Docs (50/100)\n\n- Found: README\n- Missing: LICENSE (or LICENSE.md), CHANGELOG\n- ⚠️ package.json missing description or author\n- ⚠️ No LICENSE file found\n- ⚠️ No CHANGELOG.md found (recommended)\n\n### Config (100/100)\n\n- Config files: .gitignore, tsconfig.json, package.json\n- ⚠️ .gitignore does not exclude node_modules\n\n### Deploy (100/100)\n\n- Git repository initialized\n- Version: 0.1.0\n- Build script defined\n- Entry: ./dist/index.js\n\n"
160
+ }
@@ -0,0 +1,135 @@
1
+ # Code Review: pi-yandex-bridge
2
+
3
+ **Scanned:** 2026-05-08T21:36:15.317Z
4
+ **Path:** `/Users/unitf90/pi-yandex-bridge`
5
+ **Summary:** 12 issues | 11 fixable | 1 need refactor
6
+ **Total Time:** 9.6s
7
+
8
+ ## Project Info
9
+
10
+ **Type:** node | **Name:** pi-yandex-bridge | **Version:** 0.1.0
11
+ **Package Manager:** bun
12
+ **Languages:** javascript, typescript
13
+
14
+ ### Available Commands
15
+
16
+ | Action | Command |
17
+ |--------|---------|
18
+ | build | `bun run build` |
19
+
20
+ ## Runner Summary
21
+
22
+ | Runner | Status | Findings | Time |
23
+ |--------|--------|----------|------|
24
+ | ast-grep (design smells) | done | 0 | 23ms |
25
+ | ast-grep (similar functions) | done | 0 | 16ms |
26
+ | semantic similarity (Amain) | done | 0 | 18ms |
27
+ | complexity metrics | done | 1 | 8ms |
28
+ | tree-sitter patterns | done | 0 | 1ms |
29
+ | fact rules | done | 1 | 79ms |
30
+ | TODO scanner | done | 0 | 2ms |
31
+ | dead code (Knip) | done | 2 | 291ms |
32
+ | duplicate code (jscpd) | done | 0 | 480ms |
33
+ | type coverage | done | 1 | 5.3s |
34
+ | circular deps (Madge) | done | 0 | 1.8s |
35
+ | production readiness | done | 7 | 4ms |
36
+ | compiler checks | done | 0 | 1.6s |
37
+
38
+ ---
39
+
40
+ ## Complexity Metrics
41
+
42
+ **1 file(s) scanned**
43
+
44
+ ### Summary
45
+
46
+ | Metric | Value |
47
+ |--------|-------|
48
+ | Avg Maintainability Index | 22.8 |
49
+ | Min Maintainability Index | 22.8 |
50
+ | Avg Cognitive Complexity | 67.0 |
51
+ | Max Cognitive Complexity | 67 |
52
+ | Avg Cyclomatic Complexity | 2.0 |
53
+ | Max Nesting Depth | 6 |
54
+ | Total Files | 1 |
55
+
56
+ ### AI Slop Indicators
57
+
58
+ index.ts:
59
+ ⚠ Maintainability dropped to 22.8 — extract logic into helper functions
60
+ ⚠ Cognitive complexity (67) — simplify logic flow
61
+
62
+
63
+ ## Fact Rules (Semantic Analysis)
64
+
65
+ **1 issue(s) across 1 rule(s)**
66
+
67
+ ### 🟡 unsafe-boundary (1)
68
+
69
+ '<anonymous>' is async, calls 'fetch', has complexity 11, but no try/catch — unhandled rejection risk
70
+
71
+ | File | Line |
72
+ |------|------|
73
+ | index.ts | 308 |
74
+
75
+
76
+ ## Dead Code (Knip)
77
+
78
+ **2 issue(s) found**
79
+
80
+ | Type | Name | File |
81
+ |------|------|------|
82
+ | file | dist/index.d.ts | dist/index.d.ts |
83
+ | unlisted | @earendil-works/pi-ai | index.ts |
84
+
85
+
86
+ ## Type Coverage
87
+
88
+ **99.0% typed** (519/524 identifiers)
89
+
90
+ Type coverage highlights identifiers that resolve to `any` (implicit or explicit). Inferred non-`any` types are treated as typed.
91
+
92
+ ### Top Files by Any-Typed Identifier Count
93
+
94
+ | File | Any-Typed Count |
95
+ |------|-----------------|
96
+ | /Users/unitf90/pi-yandex-bridge/index.ts | 5 |
97
+
98
+
99
+ ## Production Readiness
100
+
101
+ **Score:** 74/100 **Grade:** C
102
+
103
+ ### Code (96/100)
104
+
105
+ - 1 source files
106
+ - 406 total lines
107
+ - ⚠️ 2 console.log/debug statements
108
+
109
+ ### Tests (25/100)
110
+
111
+ - 0 test files
112
+ - 0 test cases (approximate)
113
+ - ⚠️ No test files found
114
+ - ⚠️ No test framework configuration detected
115
+
116
+ ### Docs (50/100)
117
+
118
+ - Found: README
119
+ - Missing: LICENSE (or LICENSE.md), CHANGELOG
120
+ - ⚠️ package.json missing description or author
121
+ - ⚠️ No LICENSE file found
122
+ - ⚠️ No CHANGELOG.md found (recommended)
123
+
124
+ ### Config (100/100)
125
+
126
+ - Config files: .gitignore, tsconfig.json, package.json
127
+ - ⚠️ .gitignore does not exclude node_modules
128
+
129
+ ### Deploy (100/100)
130
+
131
+ - Git repository initialized
132
+ - Version: 0.1.0
133
+ - Build script defined
134
+ - Entry: ./dist/index.js
135
+
@@ -0,0 +1,6 @@
1
+ {
2
+ "files": {},
3
+ "turnCycles": 0,
4
+ "maxCycles": 3,
5
+ "lastUpdated": "2026-05-08T21:40:15.449Z"
6
+ }
package/index.ts CHANGED
@@ -232,11 +232,8 @@ async function yandexLogin(
232
232
  ): Promise<OAuthCredentials> {
233
233
  let oauthToken = process.env.YANDEX_OAUTH_TOKEN ?? "";
234
234
  if (!oauthToken) {
235
- oauthToken = await captureOAuthToken((msg) => callbacks.onProgress?.(msg));
236
- } else {
237
- callbacks.onProgress?.(
238
- "[yandex] Using YANDEX_OAUTH_TOKEN from environment.",
239
- );
235
+ callbacks.onAuth({ url: OAUTH_URL });
236
+ oauthToken = await captureOAuthToken();
240
237
  }
241
238
 
242
239
  let folderId = process.env.YANDEX_FOLDER_ID ?? "";
@@ -246,8 +243,6 @@ async function yandexLogin(
246
243
  placeholder: "b1g...",
247
244
  });
248
245
  }
249
-
250
- callbacks.onProgress?.("[yandex] Exchanging OAuth token for IAM token…");
251
246
  const iam = await exchangeOAuthForIam(oauthToken);
252
247
 
253
248
  return {
@@ -321,12 +316,16 @@ export default async function (pi: ExtensionAPI) {
321
316
  );
322
317
 
323
318
  try {
319
+ const ac = new AbortController();
320
+ const timer = setTimeout(() => ac.abort(), 5_000);
324
321
  const res = await fetch(`${AI_BASE_URL}/models`, {
325
322
  headers: {
326
323
  Authorization: `Bearer ${apiKey}`,
327
324
  "OpenAI-Project": folderId,
328
325
  },
326
+ signal: ac.signal,
329
327
  });
328
+ clearTimeout(timer);
330
329
  if (res.ok) {
331
330
  const payload = (await res.json()) as { data: Array<{ id: string }> };
332
331
  for (const { id } of payload.data) modelIds.add(id);
@@ -367,10 +366,6 @@ export default async function (pi: ExtensionAPI) {
367
366
  api: "openai-responses",
368
367
  models,
369
368
  } satisfies ProviderConfig);
370
-
371
- console.log(
372
- `[yandex] Registered ${models.length} model(s) with static API key.`,
373
- );
374
369
  } else {
375
370
  // OAuth path — seed models from auth.json if folderId is already stored.
376
371
  let storedFolderId: string | undefined;
@@ -395,8 +390,6 @@ export default async function (pi: ExtensionAPI) {
395
390
  buildModels(credentials.folderId as string),
396
391
  },
397
392
  } satisfies ProviderConfig);
398
-
399
- console.log("[yandex] Registered with OAuth.");
400
393
  }
401
394
 
402
395
  pi.registerCommand("yalogin", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-yandex-bridge",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Pi Coding Agent provider bridge for Yandex Cloud AI (YandexGPT)",
5
5
  "main": "./dist/index.js",
6
6
  "type": "module",
@@ -21,11 +21,13 @@
21
21
  "publishConfig": {
22
22
  "access": "public"
23
23
  },
24
+ "author": "unitf90",
24
25
  "peerDependencies": {
25
26
  "@earendil-works/pi-coding-agent": "*"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@earendil-works/pi-coding-agent": "latest",
30
+ "@earendil-works/pi-ai": "latest",
29
31
  "typescript": "^5"
30
32
  },
31
33
  "license": "MIT"