@kody-ade/kody-engine 0.4.644 → 0.4.646

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.
Files changed (2) hide show
  1. package/dist/bin/kody.js +44 -17
  2. 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.644",
18
+ version: "0.4.646",
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
  repository: {
@@ -8290,7 +8290,9 @@ import * as os4 from "os";
8290
8290
  import * as path27 from "path";
8291
8291
  async function checkLitellmHealth(url) {
8292
8292
  try {
8293
- const response = await fetch(`${url}/health`, { signal: AbortSignal.timeout(3e3) });
8293
+ const response = await fetch(`${url.replace(/\/+$/, "")}/health/liveliness`, {
8294
+ signal: AbortSignal.timeout(3e3)
8295
+ });
8294
8296
  return response.ok;
8295
8297
  } catch {
8296
8298
  return false;
@@ -19554,6 +19556,18 @@ function appendPrompt(ctx, section) {
19554
19556
  const prompt = typeof ctx.data.prompt === "string" ? ctx.data.prompt.trim() : "";
19555
19557
  ctx.data.prompt = [prompt, section.trim()].filter(Boolean).join("\n\n");
19556
19558
  }
19559
+ function capabilityTargetUrl(ctx) {
19560
+ const input = ctx.data.capabilityInput && typeof ctx.data.capabilityInput === "object" && !Array.isArray(ctx.data.capabilityInput) ? ctx.data.capabilityInput : {};
19561
+ return typeof input.url === "string" ? input.url : typeof input.targetUrl === "string" ? input.targetUrl : typeof input.previewUrl === "string" ? input.previewUrl : "";
19562
+ }
19563
+ async function isolatedAuthAttempt(ctx, attempt) {
19564
+ const previous = ctx.data.qaAuthBlock;
19565
+ ctx.data.qaAuthBlock = "";
19566
+ const ready = await attempt();
19567
+ const message = String(ctx.data.qaAuthBlock ?? "").trim();
19568
+ ctx.data.qaAuthBlock = previous;
19569
+ return { ready, message };
19570
+ }
19557
19571
  var PLAYWRIGHT_SERVER, prepareSimpleCapabilityRuntime;
19558
19572
  var init_prepareSimpleCapabilityRuntime = __esm({
19559
19573
  "src/scripts/prepareSimpleCapabilityRuntime.ts"() {
@@ -19572,21 +19586,29 @@ var init_prepareSimpleCapabilityRuntime = __esm({
19572
19586
  throw new Error("Capability requires the Dashboard user browser session and cannot run in CI");
19573
19587
  }
19574
19588
  configureBrowser(ctx, profile, requirements);
19589
+ const targetUrl = capabilityTargetUrl(ctx);
19590
+ const authAttempts = [];
19575
19591
  if (requirements.qaCredentials) {
19576
19592
  await loadQaContext(ctx, profile);
19577
- const capabilityInput = ctx.data.capabilityInput && typeof ctx.data.capabilityInput === "object" && !Array.isArray(ctx.data.capabilityInput) ? ctx.data.capabilityInput : {};
19578
- const targetUrl = typeof capabilityInput.url === "string" ? capabilityInput.url : typeof capabilityInput.targetUrl === "string" ? capabilityInput.targetUrl : "";
19579
- await prepareEmailPasswordBrowserAuth(ctx, profile, {
19580
- login: String(ctx.data.qaLogin ?? ""),
19581
- targetUrl
19593
+ const missingCredentialsMessage = String(ctx.data.qaAuthBlock ?? "").trim();
19594
+ const emailAuth = await isolatedAuthAttempt(
19595
+ ctx,
19596
+ () => prepareEmailPasswordBrowserAuth(ctx, profile, {
19597
+ login: String(ctx.data.qaLogin ?? ""),
19598
+ targetUrl
19599
+ })
19600
+ );
19601
+ authAttempts.push({
19602
+ ready: emailAuth.ready,
19603
+ message: emailAuth.message || missingCredentialsMessage
19582
19604
  });
19583
- if (requirements.qaAccountCredentials?.length) {
19605
+ if (emailAuth.ready && requirements.qaAccountCredentials?.length) {
19584
19606
  await prepareAccountCredentials(ctx, profile, {
19585
19607
  names: requirements.qaAccountCredentials,
19586
19608
  targetUrl
19587
19609
  });
19588
19610
  }
19589
- if (requirements.qaAccountModelSettings) {
19611
+ if (emailAuth.ready && requirements.qaAccountModelSettings) {
19590
19612
  await prepareAccountModelSettings(ctx, profile, {
19591
19613
  settings: requirements.qaAccountModelSettings,
19592
19614
  targetUrl
@@ -19594,16 +19616,21 @@ var init_prepareSimpleCapabilityRuntime = __esm({
19594
19616
  }
19595
19617
  }
19596
19618
  if (requirements.githubTestToken) {
19597
- const capabilityInput = ctx.data.capabilityInput && typeof ctx.data.capabilityInput === "object" && !Array.isArray(ctx.data.capabilityInput) ? ctx.data.capabilityInput : {};
19598
- const targetUrl = typeof capabilityInput.url === "string" ? capabilityInput.url : typeof capabilityInput.targetUrl === "string" ? capabilityInput.targetUrl : "";
19599
- await prepareKodyRepositoryBrowserAuth(ctx, profile, {
19600
- repositoryUrl: `https://github.com/${ctx.config.github.owner}/${ctx.config.github.repo}`,
19601
- credentialKey: "KODY_TOKEN",
19602
- methodName: "Kody repository QA login",
19603
- targetUrl
19604
- });
19619
+ authAttempts.push(
19620
+ await isolatedAuthAttempt(
19621
+ ctx,
19622
+ () => prepareKodyRepositoryBrowserAuth(ctx, profile, {
19623
+ repositoryUrl: `https://github.com/${ctx.config.github.owner}/${ctx.config.github.repo}`,
19624
+ credentialKey: "E2E_GITHUB_TOKEN",
19625
+ methodName: "Kody repository QA login",
19626
+ targetUrl
19627
+ })
19628
+ )
19629
+ );
19605
19630
  }
19606
19631
  if (requirements.qaCredentials || requirements.githubTestToken) {
19632
+ const successful = authAttempts.filter(({ ready }) => ready);
19633
+ ctx.data.qaAuthBlock = (successful.length ? successful : authAttempts).map(({ message }) => message).filter(Boolean).join("\n\n");
19607
19634
  appendPrompt(
19608
19635
  ctx,
19609
19636
  [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.644",
3
+ "version": "0.4.646",
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
  "repository": {