@kody-ade/kody-engine 0.4.534 → 0.4.535

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 +23 -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.534",
18
+ version: "0.4.535",
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",
@@ -2638,6 +2638,16 @@ function createKodyApiBackendClient(env = process.env) {
2638
2638
  mutation: (fn, args) => callKodyApi("mutation", fn, args, env)
2639
2639
  };
2640
2640
  }
2641
+ async function notifyWorkflowCompleted(notification, env = process.env) {
2642
+ const token = await githubOidcToken(env);
2643
+ const response = await fetch(`${resolveKodyApiUrl(env)}/api/kody/engine/workflow-completed`, {
2644
+ method: "POST",
2645
+ headers: { Authorization: `Bearer ${token}`, "Content-Type": "application/json" },
2646
+ body: JSON.stringify(notification),
2647
+ signal: AbortSignal.timeout(3e4)
2648
+ });
2649
+ if (!response.ok) throw new Error(`Kody workflow completion request failed (${response.status})`);
2650
+ }
2641
2651
  async function readRuntimeSecretFromKody(name, env = process.env) {
2642
2652
  const token = await githubOidcToken(env);
2643
2653
  const response = await fetch(`${resolveKodyApiUrl(env)}/api/kody/engine/secret`, {
@@ -22554,6 +22564,17 @@ async function runJob(job, base) {
22554
22564
  if (valid.workflowRunId && workflowIdentity && base.config && result.workflowState) {
22555
22565
  await writeWorkflowRunState(base.config, base.cwd, workflowIdentity, valid.workflowRunId, result.workflowState);
22556
22566
  }
22567
+ if (valid.workflowRunId && workflowIdentity && hasGitHubActionsIdentity()) {
22568
+ const facts = result.workflowState?.facts ?? {};
22569
+ const pr = typeof facts.pr === "number" ? facts.pr : typeof valid.cliArgs.pr === "number" ? valid.cliArgs.pr : void 0;
22570
+ const headSha = typeof facts.headSha === "string" ? facts.headSha : typeof valid.cliArgs.headSha === "string" ? valid.cliArgs.headSha : void 0;
22571
+ await notifyWorkflowCompleted({
22572
+ workflowId: workflowIdentity,
22573
+ runId: valid.workflowRunId,
22574
+ status: result.exitCode === 0 ? "success" : "failed",
22575
+ ...pr !== void 0 || headSha !== void 0 ? { output: { ...pr !== void 0 ? { pr } : {}, ...headSha ? { headSha } : {} } } : {}
22576
+ });
22577
+ }
22557
22578
  return result;
22558
22579
  }
22559
22580
  if (!profileName) {
@@ -23239,6 +23260,7 @@ var init_job = __esm({
23239
23260
  init_registry();
23240
23261
  init_runIndex();
23241
23262
  init_publishReport();
23263
+ init_kody_api_client();
23242
23264
  init_simpleCapabilityRuntime();
23243
23265
  init_state_backend();
23244
23266
  init_workflowDefinitions();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.534",
3
+ "version": "0.4.535",
4
4
  "description": "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",