@kody-ade/kody-engine 0.4.602 → 0.4.603

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 +34 -1
  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.602",
18
+ version: "0.4.603",
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",
@@ -18450,11 +18450,44 @@ function writeCookieStorageState(targetUrl, setCookies) {
18450
18450
  );
18451
18451
  return { directory, file };
18452
18452
  }
18453
+ function currentStorageStatePath(args) {
18454
+ for (let index = 0; index < args.length; index += 1) {
18455
+ const arg = args[index];
18456
+ if (arg === "--storage-state") return args[index + 1];
18457
+ if (arg.startsWith("--storage-state=")) return arg.slice("--storage-state=".length);
18458
+ }
18459
+ return void 0;
18460
+ }
18461
+ function mergeStorageStates(existingPath, nextPath) {
18462
+ if (existingPath === nextPath || !fs48.existsSync(existingPath)) return;
18463
+ const existing = JSON.parse(fs48.readFileSync(existingPath, "utf-8"));
18464
+ const next = JSON.parse(fs48.readFileSync(nextPath, "utf-8"));
18465
+ const cookies = /* @__PURE__ */ new Map();
18466
+ for (const cookie of [...existing.cookies ?? [], ...next.cookies ?? []]) {
18467
+ cookies.set(`${cookie.name}\0${cookie.domain}\0${cookie.path}`, cookie);
18468
+ }
18469
+ const origins = /* @__PURE__ */ new Map();
18470
+ for (const entry of [...existing.origins ?? [], ...next.origins ?? []]) {
18471
+ const current = origins.get(entry.origin);
18472
+ const localStorage = /* @__PURE__ */ new Map();
18473
+ for (const item of [...current?.localStorage ?? [], ...entry.localStorage ?? []]) {
18474
+ localStorage.set(item.name, item);
18475
+ }
18476
+ origins.set(entry.origin, { origin: entry.origin, localStorage: [...localStorage.values()] });
18477
+ }
18478
+ fs48.writeFileSync(
18479
+ nextPath,
18480
+ JSON.stringify({ cookies: [...cookies.values()], origins: [...origins.values()] }),
18481
+ { mode: 384 }
18482
+ );
18483
+ }
18453
18484
  function configurePlaywright(profile, storageStatePath) {
18454
18485
  const playwright = profile.claudeCode.mcpServers.find((server) => server.name === "playwright");
18455
18486
  if (!playwright) throw new Error("Playwright MCP server is not configured");
18456
18487
  const args = [];
18457
18488
  const currentArgs = playwright.args ?? [];
18489
+ const existingStorageStatePath = currentStorageStatePath(currentArgs);
18490
+ if (existingStorageStatePath) mergeStorageStates(existingStorageStatePath, storageStatePath);
18458
18491
  for (let index = 0; index < currentArgs.length; index += 1) {
18459
18492
  const arg = currentArgs[index];
18460
18493
  if (arg === "--storage-state") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.602",
3
+ "version": "0.4.603",
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",