@vfarcic/dot-ai 1.21.0 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/providers/copilot-token-exchanger.d.ts +1 -2
- package/dist/core/providers/copilot-token-exchanger.d.ts.map +1 -1
- package/dist/core/providers/copilot-token-exchanger.js +4 -4
- package/dist/core/providers/vercel-provider.js +1 -1
- package/dist/tools/operate-analysis.d.ts.map +1 -1
- package/dist/tools/operate-analysis.js +8 -21
- package/package.json +4 -3
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
* (api.github.com/copilot_internal/v2/token) can return 404 for some account
|
|
8
8
|
* types, so it is intentionally NOT used here.
|
|
9
9
|
*
|
|
10
|
-
* Supported token types (
|
|
10
|
+
* Supported token types (PATs / ghp_* and github_pat_* are NOT accepted):
|
|
11
11
|
* gho_* OAuth token (recommended — via `gh auth login`)
|
|
12
|
-
* github_pat_* Fine-grained PAT (needs Copilot Requests permission)
|
|
13
12
|
* ghu_* GitHub App installation token
|
|
14
13
|
*
|
|
15
14
|
* Token resolution priority:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot-token-exchanger.d.ts","sourceRoot":"","sources":["../../../src/core/providers/copilot-token-exchanger.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"copilot-token-exchanger.d.ts","sourceRoot":"","sources":["../../../src/core/providers/copilot-token-exchanger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAOH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,OAAO,IAAI,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,aAAa,CAAC,EAAE,MAAM,GACrB,yBAAyB,CAwB3B;AAID,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC"}
|
|
@@ -8,9 +8,8 @@
|
|
|
8
8
|
* (api.github.com/copilot_internal/v2/token) can return 404 for some account
|
|
9
9
|
* types, so it is intentionally NOT used here.
|
|
10
10
|
*
|
|
11
|
-
* Supported token types (
|
|
11
|
+
* Supported token types (PATs / ghp_* and github_pat_* are NOT accepted):
|
|
12
12
|
* gho_* OAuth token (recommended — via `gh auth login`)
|
|
13
|
-
* github_pat_* Fine-grained PAT (needs Copilot Requests permission)
|
|
14
13
|
* ghu_* GitHub App installation token
|
|
15
14
|
*
|
|
16
15
|
* Token resolution priority:
|
|
@@ -25,7 +24,7 @@
|
|
|
25
24
|
*/
|
|
26
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
26
|
exports.makeCopilotCredentialResolver = makeCopilotCredentialResolver;
|
|
28
|
-
const SUPPORTED_PREFIXES = ['gho_', '
|
|
27
|
+
const SUPPORTED_PREFIXES = ['gho_', 'ghu_'];
|
|
29
28
|
function isSupported(token) {
|
|
30
29
|
return SUPPORTED_PREFIXES.some((p) => token.startsWith(p));
|
|
31
30
|
}
|
|
@@ -51,7 +50,8 @@ function makeCopilotCredentialResolver(overrideToken) {
|
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
throw new Error('No supported GitHub token found for Copilot. ' +
|
|
54
|
-
'Set GITHUB_COPILOT_TOKEN (gho_
|
|
53
|
+
'Set GITHUB_COPILOT_TOKEN (gho_* or ghu_*). ' +
|
|
54
|
+
'Personal access tokens (github_pat_* and ghp_*) are not supported by api.githubcopilot.com. ' +
|
|
55
55
|
'GH_TOKEN and GITHUB_TOKEN are also checked in that order.');
|
|
56
56
|
},
|
|
57
57
|
};
|
|
@@ -173,7 +173,7 @@ class VercelProvider {
|
|
|
173
173
|
return; // Early return - model instance already set
|
|
174
174
|
case 'copilot': {
|
|
175
175
|
// PRD #587: GitHub Copilot provider
|
|
176
|
-
// Uses the raw GitHub token (gho_
|
|
176
|
+
// Uses the raw GitHub token (gho_* or ghu_*) directly as a
|
|
177
177
|
// Bearer credential against api.githubcopilot.com — no token-exchange step.
|
|
178
178
|
//
|
|
179
179
|
// Routing (mirrors Hermes Agent):
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operate-analysis.d.ts","sourceRoot":"","sources":["../../src/tools/operate-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"operate-analysis.d.ts","sourceRoot":"","sources":["../../src/tools/operate-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIhD,OAAO,EAEL,kBAAkB,EAElB,eAAe,EAKhB,MAAM,WAAW,CAAC;AAwBnB;;GAEG;AACH,UAAU,qBAAqB;IAC7B,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,eAAe,CAAC;QACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,gBAAgB,EAAE;YAChB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;YAC7B,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,KAAK,EAAE;YACL,KAAK,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;YACjC,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,EACzD,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,qBAAqB,CAAC,CA2DhC"}
|
|
@@ -5,6 +5,7 @@ const mcp_client_registry_1 = require("../core/mcp-client-registry");
|
|
|
5
5
|
const ai_provider_factory_1 = require("../core/ai-provider-factory");
|
|
6
6
|
const shared_prompt_loader_1 = require("../core/shared-prompt-loader");
|
|
7
7
|
const visualization_1 = require("../core/visualization");
|
|
8
|
+
const platform_utils_1 = require("../core/platform-utils");
|
|
8
9
|
const operate_1 = require("./operate");
|
|
9
10
|
/**
|
|
10
11
|
* Analyzes user intent and generates operational proposal using AI tool loop
|
|
@@ -171,28 +172,14 @@ async function executeToolLoop(systemPrompt, userMessage, logger, pluginManager,
|
|
|
171
172
|
*/
|
|
172
173
|
function parseAIResponse(response, logger) {
|
|
173
174
|
logger.debug('Parsing AI response');
|
|
174
|
-
// Try to extract JSON from code block first (Claude format)
|
|
175
|
-
const jsonMatch = response.match(/```json\n([\s\S]+?)\n```/);
|
|
176
|
-
let jsonContent;
|
|
177
|
-
if (jsonMatch) {
|
|
178
|
-
jsonContent = jsonMatch[1];
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
// Fallback: try to parse raw JSON response (Gemini format)
|
|
182
|
-
// Look for JSON object starting with { and ending with }
|
|
183
|
-
const rawJsonMatch = response.match(/^\s*(\{[\s\S]*\})\s*$/);
|
|
184
|
-
if (rawJsonMatch) {
|
|
185
|
-
jsonContent = rawJsonMatch[1];
|
|
186
|
-
logger.debug('Parsing raw JSON response (no code block wrapper)');
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
const truncatedResponse = response.substring(0, 500);
|
|
190
|
-
logger.error(`AI response not valid JSON. Response: ${truncatedResponse}`);
|
|
191
|
-
throw new Error('AI did not return structured JSON response. Expected JSON object or ```json code block.');
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
175
|
try {
|
|
195
|
-
|
|
176
|
+
// Robustly extract the JSON object from the AI response. Reuses the shared
|
|
177
|
+
// extractor (platform-utils), also used by recommend/schema/evaluators: it
|
|
178
|
+
// handles ```json / ``` code fences AND tolerates prose before or after the
|
|
179
|
+
// JSON object. Previously a stray sentence the model appended inside the
|
|
180
|
+
// ```json block made JSON.parse fail with "Unexpected non-whitespace
|
|
181
|
+
// character after JSON" — an intermittent operate flake.
|
|
182
|
+
const parsed = (0, platform_utils_1.extractJsonFromAIResponse)(response);
|
|
196
183
|
// Validate required fields
|
|
197
184
|
if (!parsed.analysis || typeof parsed.analysis !== 'string') {
|
|
198
185
|
throw new Error('AI response missing required "analysis" field (string)');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
|
|
5
5
|
"mcpName": "io.github.vfarcic/dot-ai",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"@ai-sdk/openai": "^3.0.41",
|
|
116
116
|
"@ai-sdk/openai-compatible": "^2.0.35",
|
|
117
117
|
"@ai-sdk/xai": "^3.0.67",
|
|
118
|
-
"@grpc/grpc-js": "^1.14.
|
|
118
|
+
"@grpc/grpc-js": "^1.14.4",
|
|
119
119
|
"@grpc/proto-loader": "^0.8.0",
|
|
120
120
|
"@kubernetes/client-node": "^1.3.0",
|
|
121
121
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
@@ -139,7 +139,8 @@
|
|
|
139
139
|
"overrides": {
|
|
140
140
|
"express-rate-limit": "^8.2.2",
|
|
141
141
|
"fast-uri": ">=3.1.2",
|
|
142
|
-
"protobufjs": "^8.2.0"
|
|
142
|
+
"protobufjs": "^8.2.0",
|
|
143
|
+
"esbuild": "^0.28.1"
|
|
143
144
|
},
|
|
144
145
|
"optionalDependencies": {
|
|
145
146
|
"@rollup/rollup-linux-x64-gnu": "4.60.3"
|