@kody-ade/kody-engine 0.4.599 → 0.4.601
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/bin/kody.js +27 -26
- package/package.json +1 -1
package/dist/bin/kody.js
CHANGED
|
@@ -15,7 +15,7 @@ var init_package = __esm({
|
|
|
15
15
|
"package.json"() {
|
|
16
16
|
package_default = {
|
|
17
17
|
name: "@kody-ade/kody-engine",
|
|
18
|
-
version: "0.4.
|
|
18
|
+
version: "0.4.601",
|
|
19
19
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
|
|
20
20
|
license: "MIT",
|
|
21
21
|
type: "module",
|
|
@@ -18357,16 +18357,22 @@ function browserOrigin(raw) {
|
|
|
18357
18357
|
}
|
|
18358
18358
|
return parsed.origin;
|
|
18359
18359
|
}
|
|
18360
|
-
async function githubJson(url, token) {
|
|
18361
|
-
const
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
|
|
18368
|
-
|
|
18369
|
-
|
|
18360
|
+
async function githubJson(url, token, checkName) {
|
|
18361
|
+
const retryDelaysMs2 = [250, 750];
|
|
18362
|
+
for (let attempt = 0; attempt <= retryDelaysMs2.length; attempt += 1) {
|
|
18363
|
+
const response = await fetch(url, {
|
|
18364
|
+
headers: {
|
|
18365
|
+
Accept: "application/vnd.github+json",
|
|
18366
|
+
Authorization: `Bearer ${token}`,
|
|
18367
|
+
"X-GitHub-Api-Version": "2022-11-28"
|
|
18368
|
+
}
|
|
18369
|
+
});
|
|
18370
|
+
if (response.ok) return await response.json();
|
|
18371
|
+
const canRetry = response.status >= 500 && response.status <= 599 && attempt < retryDelaysMs2.length;
|
|
18372
|
+
if (!canRetry) throw new Error(`GitHub ${checkName} check returned ${response.status}`);
|
|
18373
|
+
await new Promise((resolve24) => setTimeout(resolve24, retryDelaysMs2[attempt]));
|
|
18374
|
+
}
|
|
18375
|
+
throw new Error(`GitHub ${checkName} check failed`);
|
|
18370
18376
|
}
|
|
18371
18377
|
function writeKodyStorageState(input) {
|
|
18372
18378
|
const directory = fs48.mkdtempSync(path45.join(os7.tmpdir(), "kody-browser-auth-"));
|
|
@@ -18379,15 +18385,15 @@ function writeKodyStorageState(input) {
|
|
|
18379
18385
|
repo: input.repo,
|
|
18380
18386
|
token: input.token,
|
|
18381
18387
|
addedAt: now,
|
|
18382
|
-
isLogin: true
|
|
18383
|
-
user: input.user
|
|
18388
|
+
isLogin: true
|
|
18384
18389
|
};
|
|
18390
|
+
const unresolvedUser = { login: "", avatar_url: "", id: 0 };
|
|
18385
18391
|
const auth = {
|
|
18386
18392
|
repoUrl: input.repoUrl,
|
|
18387
18393
|
owner: input.owner,
|
|
18388
18394
|
repo: input.repo,
|
|
18389
18395
|
token: input.token,
|
|
18390
|
-
user:
|
|
18396
|
+
user: unresolvedUser,
|
|
18391
18397
|
loggedInAt: now,
|
|
18392
18398
|
repos: [repoEntry],
|
|
18393
18399
|
currentRepoIndex: 0
|
|
@@ -18472,24 +18478,19 @@ async function prepareKodyRepositoryBrowserAuth(ctx, profile, input) {
|
|
|
18472
18478
|
let state;
|
|
18473
18479
|
try {
|
|
18474
18480
|
const requested = githubRepositoryParts(repositoryUrl);
|
|
18475
|
-
const
|
|
18476
|
-
|
|
18477
|
-
|
|
18478
|
-
|
|
18479
|
-
|
|
18480
|
-
)
|
|
18481
|
-
]);
|
|
18481
|
+
const repository = await githubJson(
|
|
18482
|
+
`https://api.github.com/repos/${encodeURIComponent(requested.owner)}/${encodeURIComponent(requested.repo)}`,
|
|
18483
|
+
credential.value,
|
|
18484
|
+
"repository"
|
|
18485
|
+
);
|
|
18482
18486
|
const [owner, repo] = repository.full_name.split("/");
|
|
18483
|
-
if (!owner || !repo
|
|
18484
|
-
throw new Error("GitHub returned incomplete identity data");
|
|
18485
|
-
}
|
|
18487
|
+
if (!owner || !repo) throw new Error("GitHub returned incomplete repository data");
|
|
18486
18488
|
state = writeKodyStorageState({
|
|
18487
18489
|
origin: browserOrigin(input.targetUrl),
|
|
18488
18490
|
repoUrl: `https://github.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`,
|
|
18489
18491
|
owner,
|
|
18490
18492
|
repo,
|
|
18491
|
-
token: credential.value
|
|
18492
|
-
user
|
|
18493
|
+
token: credential.value
|
|
18493
18494
|
});
|
|
18494
18495
|
configurePlaywright(profile, state.file);
|
|
18495
18496
|
const authDirectory = state.directory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.601",
|
|
4
4
|
"description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|