@kody-ade/kody-engine 0.4.393 → 0.4.394

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 +53 -2
  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.392",
18
+ version: "0.4.394",
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",
@@ -3931,6 +3931,32 @@ function createStateBackendFromEnv(env = process.env, client) {
3931
3931
  meta,
3932
3932
  updatedAt
3933
3933
  });
3934
+ },
3935
+ async listIntents(tenantId) {
3936
+ const result = await transport.query(anyApi.intents.list, { tenantId: requireTenant(tenantId) });
3937
+ return Array.isArray(result) ? result : [];
3938
+ },
3939
+ async getIntent(tenantId, intentId) {
3940
+ const result = await transport.query(anyApi.intents.get, {
3941
+ tenantId: requireTenant(tenantId),
3942
+ intentId: requireNonEmpty(intentId, "intentId")
3943
+ });
3944
+ return result ?? null;
3945
+ },
3946
+ async saveIntent(tenantId, intentId, intent, updatedAt) {
3947
+ await transport.mutation(anyApi.intents.save, {
3948
+ tenantId: requireTenant(tenantId),
3949
+ intentId: requireNonEmpty(intentId, "intentId"),
3950
+ intent,
3951
+ updatedAt
3952
+ });
3953
+ },
3954
+ async appendIntentDecision(tenantId, intentId, decision) {
3955
+ await transport.mutation(anyApi.intents.appendDecision, {
3956
+ tenantId: requireTenant(tenantId),
3957
+ intentId: requireNonEmpty(intentId, "intentId"),
3958
+ decision
3959
+ });
3934
3960
  }
3935
3961
  };
3936
3962
  }
@@ -15010,6 +15036,30 @@ function listCompanyIntents(config, cwd) {
15010
15036
  }
15011
15037
  return records.sort((a, b) => a.intent.priority - b.intent.priority || a.id.localeCompare(b.id));
15012
15038
  }
15039
+ function backendTenant2(config) {
15040
+ const owner = config.github?.owner?.trim() || process.env.GITHUB_REPOSITORY?.split("/")[0]?.trim();
15041
+ const repo = config.github?.repo?.trim() || process.env.GITHUB_REPOSITORY?.split("/")[1]?.trim();
15042
+ return owner && repo ? `${owner}/${repo}` : null;
15043
+ }
15044
+ function backendEnabled2(config) {
15045
+ return Boolean(process.env.CONVEX_URL?.trim() && process.env.KODY_SERVICE_KEY?.trim() && backendTenant2(config));
15046
+ }
15047
+ function backendRequired2() {
15048
+ return process.env.GITHUB_ACTIONS === "true";
15049
+ }
15050
+ async function listCompanyIntentsAsync(config, cwd) {
15051
+ const tenantId = backendTenant2(config);
15052
+ if (backendEnabled2(config) && tenantId) {
15053
+ const records = await createStateBackendFromEnv().listIntents(tenantId);
15054
+ return records.filter((record) => isCompanyIntentId(record.intentId)).map((record) => ({
15055
+ id: record.intentId,
15056
+ path: `convex:intents/${record.intentId}`,
15057
+ intent: normalizeCompanyIntent(`convex:intents/${record.intentId}`, record.intent)
15058
+ })).sort((a, b) => a.intent.priority - b.intent.priority || a.id.localeCompare(b.id));
15059
+ }
15060
+ if (backendRequired2()) throw new Error("Convex backend is required for company intents in GitHub Actions");
15061
+ return listCompanyIntents(config, cwd);
15062
+ }
15013
15063
  async function listCompanyPortfolio(config, cwd) {
15014
15064
  const goals = [];
15015
15065
  for (const id of await listGoalStateIdsAsync(config, cwd)) {
@@ -15075,6 +15125,7 @@ var init_companyIntent = __esm({
15075
15125
  "use strict";
15076
15126
  init_state2();
15077
15127
  init_stateStore();
15128
+ init_state_backend();
15078
15129
  init_stateRepo();
15079
15130
  SLUG_RE = /^[a-z][a-z0-9-]{0,63}$/;
15080
15131
  }
@@ -15087,7 +15138,7 @@ var init_loadCompanyIntents = __esm({
15087
15138
  "use strict";
15088
15139
  init_companyIntent();
15089
15140
  loadCompanyIntents = async (ctx) => {
15090
- const intents = listCompanyIntents(ctx.config, ctx.cwd);
15141
+ const intents = await listCompanyIntentsAsync(ctx.config, ctx.cwd);
15091
15142
  const active = intents.filter((record) => record.intent.status === "active");
15092
15143
  ctx.data.companyIntents = intents;
15093
15144
  ctx.data.companyActiveIntents = active;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.393",
3
+ "version": "0.4.394",
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",