@kody-ade/kody-engine 0.4.272 → 0.4.273

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 +42 -6
  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.272",
18
+ version: "0.4.273",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -19675,7 +19675,15 @@ async function runCi(argv) {
19675
19675
  let manualWorkflowDispatch = false;
19676
19676
  let forceRunAction = null;
19677
19677
  let forceRunCliArgs = {};
19678
- if (!args.issueNumber && !autoFallback && eventName === "workflow_dispatch" && dispatchEventPath && fs45.existsSync(dispatchEventPath)) {
19678
+ const envForceAction = (process.env.KODY_FORCE_ACTION ?? "").trim();
19679
+ const envForceMessage = (process.env.KODY_FORCE_MESSAGE ?? "").trim();
19680
+ if (!args.issueNumber && !autoFallback && envForceAction) {
19681
+ forceRunAction = envForceAction;
19682
+ if (envForceAction === "goal-manager" && envForceMessage) {
19683
+ forceRunCliArgs = { goal: envForceMessage };
19684
+ }
19685
+ }
19686
+ if (!args.issueNumber && !autoFallback && !forceRunAction && eventName === "workflow_dispatch" && dispatchEventPath && fs45.existsSync(dispatchEventPath)) {
19679
19687
  try {
19680
19688
  const evt = JSON.parse(fs45.readFileSync(dispatchEventPath, "utf-8"));
19681
19689
  const issueInput = parseInt(String(evt?.inputs?.issue_number ?? ""), 10);
@@ -22446,6 +22454,9 @@ function parseJob(body) {
22446
22454
  }
22447
22455
  if (typeof b.ref === "string" && b.ref.trim()) job.ref = b.ref.trim();
22448
22456
  if (typeof b.model === "string" && b.model.trim()) job.model = b.model.trim();
22457
+ if (typeof b.reasoningEffort === "string" && b.reasoningEffort.trim()) job.reasoningEffort = b.reasoningEffort.trim();
22458
+ if (typeof b.action === "string" && b.action.trim()) job.action = b.action.trim();
22459
+ if (typeof b.message === "string" && b.message.trim()) job.message = b.message.trim();
22449
22460
  if (typeof b.sessionId === "string" && b.sessionId.trim()) job.sessionId = b.sessionId.trim();
22450
22461
  if (typeof b.dashboardUrl === "string" && b.dashboardUrl.trim()) job.dashboardUrl = b.dashboardUrl.trim();
22451
22462
  if (b.allSecrets && (typeof b.allSecrets === "object" || typeof b.allSecrets === "string")) {
@@ -22462,14 +22473,18 @@ async function defaultRunJob(job) {
22462
22473
  const allSecrets = typeof job.allSecrets === "string" ? job.allSecrets : JSON.stringify(job.allSecrets ?? {});
22463
22474
  const interactive = job.mode === "interactive";
22464
22475
  const scheduled = job.mode === "scheduled";
22476
+ const runMode = interactive ? "interactive" : scheduled ? "scheduled" : "issue";
22465
22477
  const childEnv = {
22466
22478
  ...process.env,
22467
22479
  REPO: job.repo,
22468
22480
  REF: branch,
22469
22481
  GITHUB_TOKEN: job.githubToken,
22482
+ KODY_RUN_MODE: runMode,
22470
22483
  // Scheduled mode drives the engine down the same path GitHub Actions' cron
22471
22484
  // takes (runScheduledFanOut → due capabilities/goals). Bare `kody` routes on this.
22472
22485
  ...scheduled ? { GITHUB_EVENT_NAME: "schedule" } : {},
22486
+ ...job.action ? { KODY_FORCE_ACTION: job.action } : {},
22487
+ ...job.message ? { KODY_FORCE_MESSAGE: job.message } : {},
22473
22488
  // GITHUB_REPOSITORY + GH_TOKEN are normally injected by GitHub Actions.
22474
22489
  // The engine's interactive mode needs GITHUB_REPOSITORY to resolve the
22475
22490
  // configured state repo and persist chat.ready / events (the durable signal
@@ -22477,13 +22492,14 @@ async function defaultRunJob(job) {
22477
22492
  // and the session never appears "ready". GH_TOKEN auths the `gh` CLI.
22478
22493
  GITHUB_REPOSITORY: job.repo,
22479
22494
  GH_TOKEN: job.githubToken,
22480
- // Issue mode bakes ISSUE_NUMBER `kody run --issue N`. Interactive mode
22481
- // leaves it empty and sets SESSION_ID so the engine boots a chat session.
22495
+ // Issue mode carries ISSUE_NUMBER. Interactive mode leaves it empty and
22496
+ // sets SESSION_ID so the engine boots a chat session.
22482
22497
  ISSUE_NUMBER: interactive || scheduled ? "" : String(job.issueNumber),
22483
22498
  ALL_SECRETS: allSecrets,
22484
22499
  SESSION_ID: job.sessionId ?? "",
22485
22500
  DASHBOARD_URL: job.dashboardUrl ?? "",
22486
22501
  MODEL: job.model ?? "",
22502
+ REASONING_EFFORT: job.reasoningEffort ?? "",
22487
22503
  ...interactive && job.idleExitMs ? { KODY_IDLE_EXIT_MS: String(job.idleExitMs) } : {},
22488
22504
  ...interactive && job.hardCapMs ? { KODY_HARD_CAP_MS: String(job.hardCapMs) } : {}
22489
22505
  };
@@ -22509,11 +22525,10 @@ async function defaultRunJob(job) {
22509
22525
  const authorEmail = process.env.GIT_AUTHOR_EMAIL ?? "kody-bot@users.noreply.github.com";
22510
22526
  await run("git", ["config", "user.name", authorName], workdir);
22511
22527
  await run("git", ["config", "user.email", authorEmail], workdir);
22512
- const runArgs = interactive || scheduled ? [] : ["run", "--issue", String(job.issueNumber)];
22513
22528
  const jobDesc = interactive ? `interactive session ${job.sessionId}` : scheduled ? "scheduled fan-out" : `running issue #${job.issueNumber}`;
22514
22529
  process.stdout.write(`[runner-serve] job ${job.jobId}: ${jobDesc}
22515
22530
  `);
22516
- const runCode = await run("kody", runArgs, workdir);
22531
+ const runCode = await run("kody", [], workdir);
22517
22532
  process.stdout.write(`[runner-serve] job ${job.jobId}: finished (exit ${runCode})
22518
22533
  `);
22519
22534
  process.exit(runCode);
@@ -22903,6 +22918,25 @@ function formatMs(ms) {
22903
22918
  }
22904
22919
 
22905
22920
  // src/entry.ts
22921
+ function envRunMode(env = process.env) {
22922
+ const result = { command: "help", errors: [] };
22923
+ const mode = (env.KODY_RUN_MODE ?? "").trim().toLowerCase();
22924
+ if (!mode) return null;
22925
+ if (mode === "chat" || mode === "interactive") {
22926
+ return { ...result, command: "chat", chatArgv: [] };
22927
+ }
22928
+ if (mode === "ci" || mode === "scheduled" || mode === "manual") {
22929
+ return { ...result, command: "ci", ciArgv: [] };
22930
+ }
22931
+ if (mode === "issue") {
22932
+ const issue = (env.ISSUE_NUMBER ?? "").trim();
22933
+ if (!issue) {
22934
+ return { ...result, errors: ["KODY_RUN_MODE=issue requires ISSUE_NUMBER"] };
22935
+ }
22936
+ return { ...result, command: "ci", ciArgv: ["--issue", issue] };
22937
+ }
22938
+ return { ...result, errors: [`unknown KODY_RUN_MODE: ${mode}`] };
22939
+ }
22906
22940
  var HELP_TEXT = `kody-engine \u2014 single-session autonomous engineer
22907
22941
 
22908
22942
  Usage:
@@ -22939,6 +22973,8 @@ Exit codes:
22939
22973
  function parseArgs(argv) {
22940
22974
  const result = { command: "help", errors: [] };
22941
22975
  if (argv.length === 0) {
22976
+ const mode = envRunMode();
22977
+ if (mode) return mode;
22942
22978
  if (process.env.SESSION_ID) return { ...result, command: "chat", chatArgv: [] };
22943
22979
  if (process.env.GITHUB_EVENT_NAME) return { ...result, command: "ci", ciArgv: [] };
22944
22980
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.272",
3
+ "version": "0.4.273",
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",