@kody-ade/kody-engine 0.3.60 → 0.3.61

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@kody-ade/kody-engine",
6
- version: "0.3.60",
6
+ version: "0.3.61",
7
7
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
8
8
  license: "MIT",
9
9
  type: "module",
@@ -540,12 +540,35 @@ var CHAT_SYSTEM_PROMPT = [
540
540
  " pytest, go test, cargo, etc., whatever the project uses).",
541
541
  " - standard Unix utilities (curl, jq, sed, awk, find, etc.).",
542
542
  "",
543
- "# How to answer",
544
- "If the user asks about repo content, code, history, issues, PRs, CI status, or",
545
- "anything else knowable from the checkout or GitHub API, INVESTIGATE FIRST with",
546
- "the tools above and answer from what you find. Do not say 'I don't have access'",
547
- "\u2014 if you have not yet tried, try. Only fall back to a limitation statement after",
548
- "a tool actually fails, and in that case quote the failing command and its error.",
543
+ "# Investigate before you answer (HARD RULE)",
544
+ "Do not answer from assumptions, training memory, or what the code 'probably'",
545
+ "does. Before replying to any question about this repo \u2014 its code, behavior,",
546
+ "config, history, issues, PRs, CI, or dependencies \u2014 you MUST first ground the",
547
+ "answer in concrete evidence collected in THIS session.",
548
+ "",
549
+ "Required pre-reply protocol for every non-trivial question:",
550
+ "1. Locate the relevant code with Glob/Grep. Don't guess paths.",
551
+ "2. Read the actual files end-to-end (or the relevant ranges). Read more than",
552
+ " you think you need \u2014 adjacent files, callers, tests, types.",
553
+ "3. If behavior depends on runtime state (CI, PRs, issues, git history), run",
554
+ " the matching `gh` / `git` / shell command and look at the real output.",
555
+ "4. Only after steps 1\u20133 do you compose the reply.",
556
+ "",
557
+ "Every factual claim about this repo in your reply must be backed by something",
558
+ "you actually read or executed in this session. Cite the source inline:",
559
+ "`path/to/file.ts:42`, `git show <sha>`, `gh pr view 123`, etc. If you cannot",
560
+ "produce a citation, you have not investigated enough \u2014 go back to step 1.",
561
+ "",
562
+ "Forbidden phrasings unless preceded by an actual tool failure quoted in your",
563
+ "reply: 'I don't have access', 'I can't see', 'it likely', 'it probably',",
564
+ "'typically this would', 'based on common patterns'. These are tells that you",
565
+ "skipped investigation \u2014 replace them with the result of the investigation.",
566
+ "",
567
+ "Speed is not the goal \u2014 correctness grounded in this specific codebase is.",
568
+ "Spend the tool calls. A short answer with three citations beats a long answer",
569
+ "with zero. If a question is genuinely trivial (greeting, clarification,",
570
+ "definition of a generic term unrelated to this repo), you may answer without",
571
+ "tools \u2014 but err on the side of investigating.",
549
572
  "",
550
573
  "Do not invent file paths, commit SHAs, line numbers, or command output. If you",
551
574
  "cite something concrete, you must have just read or run it in this session."
@@ -1996,7 +2019,7 @@ function parseAgentResult(finalText) {
1996
2019
  };
1997
2020
  }
1998
2021
  const hasDoneMarker = DONE_RE.test(text);
1999
- const hasCommitMsg = /^[\s>*_#`~\-]*COMMIT_MSG\s*:/im.test(text);
2022
+ const hasCommitMsg = /^[\s>*_#`~-]*COMMIT_MSG\s*:/im.test(text);
2000
2023
  if (!hasDoneMarker && !hasCommitMsg) {
2001
2024
  return {
2002
2025
  done: false,
@@ -2008,7 +2031,7 @@ function parseAgentResult(finalText) {
2008
2031
  failureReason: "no DONE or FAILED marker in agent output"
2009
2032
  };
2010
2033
  }
2011
- const commitMatch = text.match(/^[\s>*_#`~\-]*COMMIT_MSG[\s>*_#`~\-]*\s*:\s*(.+)$/im);
2034
+ const commitMatch = text.match(/^[\s>*_#`~-]*COMMIT_MSG[\s>*_#`~-]*\s*:\s*(.+)$/im);
2012
2035
  const commitMessage = commitMatch ? stripMarkdownEmphasis(commitMatch[1]) : "";
2013
2036
  const feedbackActions = extractBlock(
2014
2037
  text,
@@ -5865,6 +5888,25 @@ function tryPostPr3(prNumber, body, cwd) {
5865
5888
  }
5866
5889
  }
5867
5890
 
5891
+ // src/scripts/resolvePreviewUrl.ts
5892
+ var DEFAULT_PREVIEW_URL = "http://localhost:3000";
5893
+ var resolvePreviewUrl = async (ctx) => {
5894
+ const fromFlag = typeof ctx.args.previewUrl === "string" ? ctx.args.previewUrl.trim() : "";
5895
+ if (fromFlag.length > 0) {
5896
+ ctx.data.previewUrl = fromFlag;
5897
+ ctx.data.previewUrlSource = "flag";
5898
+ return;
5899
+ }
5900
+ const fromEnv = (process.env.PREVIEW_URL ?? "").trim();
5901
+ if (fromEnv.length > 0) {
5902
+ ctx.data.previewUrl = fromEnv;
5903
+ ctx.data.previewUrlSource = "env";
5904
+ return;
5905
+ }
5906
+ ctx.data.previewUrl = DEFAULT_PREVIEW_URL;
5907
+ ctx.data.previewUrlSource = "default";
5908
+ };
5909
+
5868
5910
  // src/scripts/revertFlow.ts
5869
5911
  import { execFileSync as execFileSync19 } from "child_process";
5870
5912
  var SHA_RE = /^[0-9a-f]{4,40}$/i;
@@ -5934,11 +5976,7 @@ var revertFlow = async (ctx) => {
5934
5976
  const runUrl = getRunUrl();
5935
5977
  const runSuffix = runUrl ? `, run ${runUrl}` : "";
5936
5978
  const shaList = resolved.map((r) => `\`${r.full.slice(0, 7)}\``).join(", ");
5937
- tryPostPr4(
5938
- prNumber,
5939
- `\u2699\uFE0F kody revert started on \`${ctx.data.branch}\`${runSuffix} \u2014 reverting ${shaList}`,
5940
- ctx.cwd
5941
- );
5979
+ tryPostPr4(prNumber, `\u2699\uFE0F kody revert started on \`${ctx.data.branch}\`${runSuffix} \u2014 reverting ${shaList}`, ctx.cwd);
5942
5980
  };
5943
5981
  function buildCommitMessage(resolved) {
5944
5982
  if (resolved.length === 1) {
@@ -5982,25 +6020,6 @@ function tryPostPr4(prNumber, body, cwd) {
5982
6020
  }
5983
6021
  }
5984
6022
 
5985
- // src/scripts/resolvePreviewUrl.ts
5986
- var DEFAULT_PREVIEW_URL = "http://localhost:3000";
5987
- var resolvePreviewUrl = async (ctx) => {
5988
- const fromFlag = typeof ctx.args.previewUrl === "string" ? ctx.args.previewUrl.trim() : "";
5989
- if (fromFlag.length > 0) {
5990
- ctx.data.previewUrl = fromFlag;
5991
- ctx.data.previewUrlSource = "flag";
5992
- return;
5993
- }
5994
- const fromEnv = (process.env.PREVIEW_URL ?? "").trim();
5995
- if (fromEnv.length > 0) {
5996
- ctx.data.previewUrl = fromEnv;
5997
- ctx.data.previewUrlSource = "env";
5998
- return;
5999
- }
6000
- ctx.data.previewUrl = DEFAULT_PREVIEW_URL;
6001
- ctx.data.previewUrlSource = "default";
6002
- };
6003
-
6004
6023
  // src/scripts/reviewFlow.ts
6005
6024
  var reviewFlow = async (ctx) => {
6006
6025
  const prNumber = ctx.args.pr;
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.60",
3
+ "version": "0.3.61",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -12,6 +12,18 @@
12
12
  "templates",
13
13
  "kody.config.schema.json"
14
14
  ],
15
+ "scripts": {
16
+ "kody": "tsx bin/kody.ts",
17
+ "build": "tsup && node scripts/copy-assets.cjs",
18
+ "test": "vitest run tests/unit tests/int --no-coverage",
19
+ "test:e2e": "vitest run tests/e2e --no-coverage",
20
+ "test:all": "vitest run tests --no-coverage",
21
+ "typecheck": "tsc --noEmit",
22
+ "lint": "biome check",
23
+ "lint:fix": "biome check --write",
24
+ "format": "biome format --write",
25
+ "prepublishOnly": "pnpm build"
26
+ },
15
27
  "dependencies": {
16
28
  "@actions/cache": "^6.0.0",
17
29
  "@anthropic-ai/claude-agent-sdk": "0.2.119"
@@ -32,16 +44,5 @@
32
44
  "url": "git+https://github.com/aharonyaircohen/kody-engine.git"
33
45
  },
34
46
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
35
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
36
- "scripts": {
37
- "kody": "tsx bin/kody.ts",
38
- "build": "tsup && node scripts/copy-assets.cjs",
39
- "test": "vitest run tests/unit tests/int --no-coverage",
40
- "test:e2e": "vitest run tests/e2e --no-coverage",
41
- "test:all": "vitest run tests --no-coverage",
42
- "typecheck": "tsc --noEmit",
43
- "lint": "biome check",
44
- "lint:fix": "biome check --write",
45
- "format": "biome format --write"
46
- }
47
- }
47
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
48
+ }