@kody-ade/kody-engine 0.4.204-next.7 → 0.4.204-next.9

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
@@ -1483,7 +1483,7 @@ var init_loadCoverageRules = __esm({
1483
1483
  // package.json
1484
1484
  var package_default = {
1485
1485
  name: "@kody-ade/kody-engine",
1486
- version: "0.4.204-next.7",
1486
+ version: "0.4.204-next.9",
1487
1487
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
1488
1488
  license: "MIT",
1489
1489
  type: "module",
@@ -4024,6 +4024,8 @@ var KNOWN_PROFILE_KEYS = /* @__PURE__ */ new Set([
4024
4024
  "name",
4025
4025
  "staff",
4026
4026
  "every",
4027
+ "dutyTools",
4028
+ "mentions",
4027
4029
  "describe",
4028
4030
  "role",
4029
4031
  "kind",
@@ -4107,6 +4109,9 @@ function loadProfile(profilePath) {
4107
4109
  staff: typeof r.staff === "string" && r.staff.trim() ? r.staff.trim() : void 0,
4108
4110
  // Optional recurrence cadence (scheduled duty). Blank → undefined (on-demand).
4109
4111
  every: typeof r.every === "string" && r.every.trim() ? r.every.trim() : void 0,
4112
+ // Locked-toolbox palette + mentions (folder-duty successors to frontmatter).
4113
+ dutyTools: Array.isArray(r.dutyTools) ? r.dutyTools.map((t) => String(t).trim()).filter(Boolean) : void 0,
4114
+ mentions: Array.isArray(r.mentions) ? r.mentions.map((m) => String(m).trim()).filter(Boolean) : void 0,
4110
4115
  role,
4111
4116
  kind,
4112
4117
  schedule: typeof r.schedule === "string" ? r.schedule : void 0,
@@ -10183,6 +10188,26 @@ function humanizeSlug(slug) {
10183
10188
  return slug.split(/[-_]+/).filter((s) => s.length > 0).map((s) => s[0].toUpperCase() + s.slice(1)).join(" ");
10184
10189
  }
10185
10190
 
10191
+ // src/scripts/loadDutyState.ts
10192
+ var loadDutyState = async (ctx, profile, args) => {
10193
+ const jobsDir = String(args?.jobsDir ?? ".kody/duties");
10194
+ const slug = profile.name;
10195
+ const backend = resolveBackend({ config: ctx.config, cwd: ctx.cwd, jobsDir });
10196
+ if (backend.hydrate) await backend.hydrate();
10197
+ const loaded = await backend.load(slug);
10198
+ ctx.data.jobSlug = slug;
10199
+ ctx.data.jobState = loaded;
10200
+ ctx.data.jobStateJson = JSON.stringify(loaded.state, null, 2);
10201
+ const mentions = (profile.mentions ?? []).map((l) => `@${l}`).join(" ");
10202
+ ctx.data.mentions = mentions;
10203
+ const declaredTools = profile.dutyTools ?? [];
10204
+ if (declaredTools.length > 0) {
10205
+ ctx.data.dutyTools = declaredTools;
10206
+ ctx.data.dutyToolsList = declaredTools.map((name) => `- \`${name}\``).join("\n");
10207
+ ctx.data.dutyOperatorMention = mentions;
10208
+ }
10209
+ };
10210
+
10186
10211
  // src/scripts/loadLinkedFinding.ts
10187
10212
  init_issue();
10188
10213
  var FINDING_BODY_MAX_BYTES = 4e3;
@@ -14598,6 +14623,7 @@ var preflightScripts = {
14598
14623
  loadIssueContext,
14599
14624
  loadIssueStateComment,
14600
14625
  loadJobFromFile,
14626
+ loadDutyState,
14601
14627
  loadWorkerAdhoc,
14602
14628
  loadConventions,
14603
14629
  loadCoverageRules,
@@ -57,6 +57,20 @@ export interface Profile {
57
57
  * This is what makes "scheduled" just a field on the one duty shape.
58
58
  */
59
59
  every?: string
60
+ /**
61
+ * Locked-toolbox palette (unified successor to a markdown duty's `tools:`
62
+ * frontmatter). When non-empty, loadDutyState sets ctx.data.dutyTools so the
63
+ * executor spins up the in-process kody-duty MCP server and the agent runs
64
+ * MCP-only (Bash/Read revoked unless also in claudeCode.tools). Absent →
65
+ * normal SDK tools.
66
+ */
67
+ dutyTools?: string[]
68
+ /**
69
+ * GitHub logins (no leading `@`) this duty's output should mention. Rendered
70
+ * to `@a @b` and exposed to the prompt as {{mentions}} (and as the duty-MCP
71
+ * operator mention), mirroring a markdown duty's `mentions:` frontmatter.
72
+ */
73
+ mentions?: string[]
60
74
  /** Cron expression for scheduled profiles (e.g. "0 8 * * MON"). */
61
75
  schedule?: string
62
76
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.204-next.7",
3
+ "version": "0.4.204-next.9",
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",