@kody-ade/kody-engine 0.4.261 → 0.4.263

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.
@@ -0,0 +1,10 @@
1
+ # Agent Factory
2
+
3
+ ## Purpose
4
+
5
+ Create or assemble Kody agency model definitions from an operator request.
6
+
7
+ ## Instructions
8
+
9
+ Use the `agent-factory` implementation for the execution details.
10
+ The capability owns the public action name and review boundary; the implementation owns model reasoning and state-repo PR creation.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-factory",
3
3
  "action": "agent-factory",
4
- "agentAction": "agent-factory",
4
+ "implementation": "agent-factory",
5
5
  "capabilityKind": "act",
6
6
  "describe": "Create or assemble Kody agency model definitions from an operator request."
7
7
  }
@@ -0,0 +1,10 @@
1
+ # Run
2
+
3
+ ## Purpose
4
+
5
+ Implement a GitHub issue end-to-end.
6
+
7
+ ## Instructions
8
+
9
+ Use the `run` implementation for the execution details.
10
+ The capability owns the public action name and the reason this action exists; the implementation owns the method.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run",
3
3
  "action": "run",
4
- "agentAction": "run",
4
+ "implementation": "run",
5
5
  "describe": "Implement a GitHub issue end-to-end."
6
6
  }
@@ -6,7 +6,7 @@ You are Kody's agent factory. Convert the operator request into review-ready Kod
6
6
  - Default branch: {{defaultBranch}}
7
7
  - Issue #{{issue.number}}: {{issue.title}}
8
8
 
9
- {{agentResponsibilityReference}}
9
+ {{capabilityReference}}
10
10
 
11
11
  # Operator Request
12
12
 
@@ -18,7 +18,7 @@ You are Kody's agent factory. Convert the operator request into review-ready Kod
18
18
 
19
19
  # Task
20
20
 
21
- Design the smallest Kody model structure that satisfies the request. You may create or assemble simple agentActions, agentResponsibilities, loops, goals, and agents.
21
+ Design the smallest Kody model structure that satisfies the request. You may create or assemble simple executables, capabilities, loops, goals, and agents.
22
22
 
23
23
  Use the current Kody vocabulary:
24
24
 
@@ -30,8 +30,8 @@ Use the current Kody vocabulary:
30
30
 
31
31
  Use current storage names when producing files:
32
32
 
33
- - agentResponsibility: capability contract, public action ownership, kind, agent, cadence, and output contract
34
- - agentAction: capability implementation
33
+ - capability: capability contract, public action ownership, kind, agent, cadence, and output contract
34
+ - executable: capability implementation
35
35
 
36
36
  # Boundaries
37
37
 
@@ -40,7 +40,7 @@ Use current storage names when producing files:
40
40
  - Do not activate generated definitions yourself.
41
41
  - Do not create a consumer-repo PR.
42
42
  - The deterministic postflight will open a review PR in the configured state repo under the configured state path.
43
- - Put generated file paths relative to the configured state path, for example `agent-actions/...`, `agent-responsibilities/...`, `agents/...`, `goals/...`, or `memory/...`.
43
+ - Put generated file paths relative to the configured state path, for example `executables/...`, `capabilities/...`, `agents/...`, `goals/...`, or `memory/...`.
44
44
  - Produce complete file contents. Do not describe patches.
45
45
  - Prefer a small bundle over a broad framework. Include assumptions in the summary.
46
46
 
@@ -59,7 +59,7 @@ PR_SUMMARY:
59
59
  "summary": "human explanation and assumptions",
60
60
  "files": [
61
61
  {
62
- "path": "agent-actions/example/profile.json",
62
+ "path": "executables/example/profile.json",
63
63
  "content": "{\n \"name\": \"example\"\n}\n"
64
64
  }
65
65
  ]
@@ -76,6 +76,6 @@ If a prior-art block is present above, READ THE DIFFS — those are failed or su
76
76
  - Stay on the current branch (`{{branch}}`). It is already checked out for you.
77
77
  - Do NOT modify files under: `.kody/`, `.kody-engine/`, `.kody-lean/`, `.kody/`, `node_modules/`, `dist/`, `build/`, `.env`, or any `*.log`.
78
78
  - Do NOT post issue comments — the wrapper handles that.
79
- - Pre-existing quality-gate failures: assume they are NOT your responsibility unless your edits touched related code.
79
+ - Pre-existing quality-gate failures: assume they are NOT yours unless your edits touched related code.
80
80
  - Keep the plan and reasoning concise. Long monologues waste turns.
81
81
  {{systemPromptAppend}}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Types shared by the generic executor and agentActions.
2
+ * Types shared by the generic executor and executables.
3
3
  *
4
4
  * The executor reads a Profile, validates the user's CLI args against
5
5
  * Profile.inputs, then runs the declared preflight scripts → agent →
@@ -20,50 +20,49 @@ export type CapabilityKind = "observe" | "act" | "verify"
20
20
  export interface Profile {
21
21
  name: string
22
22
  /**
23
- * Public action name owned by a agentResponsibility. A user may type `@kody <action>`;
24
- * dispatch resolves that action to the agentResponsibility, then the agentResponsibility selects the
25
- * implementation agentAction. Absent → the agentResponsibility slug/name is the action.
23
+ * Public action name owned by a capability. A user may type `@kody <action>`;
24
+ * dispatch resolves that action to the capability, then the capability selects the
25
+ * implementation executable. Absent → the capability slug/name is the action.
26
26
  */
27
27
  action?: string
28
28
  /**
29
- * Optional agent this agentAction runs *as*. When set, the executor
29
+ * Optional agent this executable runs *as*. When set, the executor
30
30
  * loads hydrated `.kody/agents/<agent>.md` and injects that agent (authoritative
31
- * identity) ahead of the agentAction's own system-prompt append. This is the
32
- * unification hook: a "agentResponsibility" is just an agentAction + an agent. Absent →
31
+ * identity) ahead of the executable's own system-prompt append. This is the
32
+ * unification hook: a "capability" is just an executable + an agent. Absent →
33
33
  * runs with no agent (unchanged legacy behaviour). A declared-but-missing
34
34
  * agent file is fatal at run time (see src/agents.ts).
35
35
  */
36
36
  agent?: string
37
37
  describe: string
38
38
  /**
39
- * Author-facing capability promise for a agentResponsibility/agentAction. This classifies the
39
+ * Author-facing capability promise for a capability/executable. This classifies the
40
40
  * shape of result it should return; it does not change executor control flow.
41
41
  */
42
42
  capabilityKind?: CapabilityKind
43
43
  /**
44
- * Semantic role — what this agentAction IS, not when it runs.
44
+ * Semantic role — what this executable IS, not when it runs.
45
45
  * - primitive: single-step agent executor (flow → agent → verify → commit → PR).
46
46
  * - orchestrator: no-agent, drives primitives via a postflight transition table
47
47
  * (comment-based, one GHA run per step).
48
48
  * - container: no-agent, runs declared `children` sequentially in-process
49
49
  * (one GHA run for the whole flow). Routing is done by per-child
50
50
  * `next` maps over action types — no @kody comments dispatched.
51
- * - watch: scheduled observer that inspects repo state and may trigger other agentActions.
51
+ * - watch: scheduled observer that inspects repo state and may trigger other executables.
52
52
  * - utility: no-agent, one-off administrative work (scaffolding, release, etc.).
53
53
  *
54
54
  * Roles enforce shape at profile-load time and let help/dispatch treat
55
- * agentActions differently by category.
55
+ * executables differently by category.
56
56
  */
57
57
  role: "primitive" | "orchestrator" | "container" | "watch" | "utility"
58
58
  /**
59
- * A agentResponsibility is the capability contract storage layer: it references
60
- * an agentAction implementation by name rather than embedding it. When set,
61
- * loader resolves the agentAction's full profile (claudeCode/scripts/prompt/agents)
62
- * and overlays agentResponsibility name + agent (who) + mentions. Absent -> this
63
- * profile IS an agentAction implementation. Intent = why, agent = who,
64
- * capability = how, agentAction = implementation.
59
+ * Capability contract profiles can point at a separate implementation by name.
60
+ * `executable` remains a legacy alias while old assets migrate.
65
61
  */
66
- agentAction?: string
62
+ implementation?: string
63
+ executable?: string
64
+ implementations?: string[]
65
+ executables?: string[]
67
66
  /**
68
67
  * Execution model — orthogonal to `role`.
69
68
  * `oneshot` (default): single invocation on demand.
@@ -72,23 +71,23 @@ export interface Profile {
72
71
  */
73
72
  kind: "oneshot" | "scheduled"
74
73
  /**
75
- * Locked-toolbox palette (unified successor to a markdown agentResponsibility's `tools:`
76
- * metadata). When non-empty, loadAgentResponsibilityState sets ctx.data.agentResponsibilityTools so the
77
- * executor spins up the in-process kody-agentResponsibility MCP server and the agent runs
74
+ * Locked-toolbox palette (unified successor to a markdown capability's `tools:`
75
+ * metadata). When non-empty, loadCapabilityState sets ctx.data.capabilityTools so the
76
+ * executor spins up the in-process kody-capability MCP server and the agent runs
78
77
  * MCP-only (Bash/Read revoked unless also in claudeCode.tools). Absent →
79
78
  * normal SDK tools.
80
79
  */
81
- agentResponsibilityTools?: string[]
80
+ capabilityTools?: string[]
82
81
  /**
83
- * GitHub logins (no leading `@`) this agentResponsibility's output should mention. Rendered
84
- * to `@a @b` and exposed to the prompt as {{mentions}} (and as the agentResponsibility-MCP
85
- * operator mention), mirroring a markdown agentResponsibility's `mentions:` metadata.
82
+ * GitHub logins (no leading `@`) this capability's output should mention. Rendered
83
+ * to `@a @b` and exposed to the prompt as {{mentions}} (and as the capability-MCP
84
+ * operator mention), mirroring a markdown capability's `mentions:` metadata.
86
85
  */
87
86
  mentions?: string[]
88
87
  /** Cron expression for scheduled profiles (e.g. "0 8 * * MON"). */
89
88
  schedule?: string
90
89
  /**
91
- * Task-state phase label emitted when this agentAction completes successfully.
90
+ * Task-state phase label emitted when this executable completes successfully.
92
91
  * Failing actions always set phase to "failed" regardless. Omitted → "idle".
93
92
  * Lets state.ts stay generic — phase semantics live on the profile.
94
93
  */
@@ -104,7 +103,7 @@ export interface Profile {
104
103
  *
105
104
  * Lifecycles exist to consolidate orchestration boilerplate (label,
106
105
  * context loading, verify, commit, comment) that recurs across many
107
- * agentActions. Per-agentAction specifics still go in `scripts.preflight`
106
+ * executables. Per-executable specifics still go in `scripts.preflight`
108
107
  * and `scripts.postflight` — the lifecycle wraps them, it doesn't
109
108
  * replace them.
110
109
  */
@@ -120,14 +119,14 @@ export interface Profile {
120
119
  }
121
120
  outputContract?: OutputContract
122
121
  /**
123
- * Declared artifacts consumed by this agentAction. The resolveArtifacts
122
+ * Declared artifacts consumed by this executable. The resolveArtifacts
124
123
  * preflight loads each into ctx.data.artifacts[name] from the task-state
125
- * comment. If `required: true` and the artifact is absent, the agentAction
124
+ * comment. If `required: true` and the artifact is absent, the executable
126
125
  * fails fast.
127
126
  */
128
127
  inputArtifacts: InputArtifactSpec[]
129
128
  /**
130
- * Declared artifacts produced by this agentAction. The persistArtifacts
129
+ * Declared artifacts produced by this executable. The persistArtifacts
131
130
  * postflight reads the named source field from ctx.data and writes an
132
131
  * Artifact entry into the task state's `artifacts` map.
133
132
  */
@@ -168,16 +167,16 @@ export interface Profile {
168
167
  * preflight runs. composePrompt prefers these over a fresh disk read so the
169
168
  * template survives working-tree churn from runFlow's branch setup — on the CI
170
169
  * runner a branch checkout can drop the tracked-but-ignore-negated
171
- * `.kody/agent-actions/<name>/` dir, and reading prompt.md afterwards fails with
170
+ * `.kody/executables/<name>/` dir, and reading prompt.md afterwards fails with
172
171
  * ENOENT even though profile.json (read here, earlier) loaded fine.
173
172
  */
174
173
  promptTemplates?: Record<string, string>
175
174
  /**
176
175
  * Subagent markdown captured (by declared name) at load time, BEFORE any
177
176
  * task branch switch — same rationale as promptTemplates. loadSubagents
178
- * prefers this snapshot so a agentResponsibility's `agents/` surviving only on the default
179
- * checkout (e.g. `.kody/agent-responsibilities/<slug>/agents/` absent on a PR branch) doesn't
180
- * crash a PR-targeted agentResponsibility. Populated by captureSubagentTemplates.
177
+ * prefers this snapshot so a capability's `agents/` surviving only on the default
178
+ * checkout (e.g. `.kody/capabilities/<slug>/agents/` absent on a PR branch) doesn't
179
+ * crash a PR-targeted capability. Populated by captureSubagentTemplates.
181
180
  */
182
181
  subagentTemplates?: Record<string, string>
183
182
  }
@@ -193,7 +192,7 @@ export interface Profile {
193
192
  * - no match → container aborts
194
193
  */
195
194
  export interface ContainerChild {
196
- /** Name of the agentAction to invoke (must resolve via the registry). */
195
+ /** Name of the executable to invoke (must resolve via the registry). */
197
196
  exec: string
198
197
  /**
199
198
  * Where to source the target identifier from when invoking this child.
@@ -214,7 +213,7 @@ export interface ContainerChild {
214
213
  export interface InputArtifactSpec {
215
214
  /** Artifact name (the key in state.artifacts). */
216
215
  name: string
217
- /** If true, the agentAction fails when this artifact is missing from state. */
216
+ /** If true, the executable fails when this artifact is missing from state. */
218
217
  required?: boolean
219
218
  }
220
219
 
@@ -295,7 +294,7 @@ export interface ClaudeCodeSpec {
295
294
  /**
296
295
  * Opt-in: expose an in-process `submit_state` tool the agent calls to
297
296
  * persist its next state, instead of relying on a trailing fenced
298
- * `kody-job-next-state` block it must remember to emit. Used by agent-responsibility-tick.
297
+ * `kody-job-next-state` block it must remember to emit. Used by capability-tick.
299
298
  * The fenced block stays supported as a fallback. Default false.
300
299
  */
301
300
  enableSubmitTool?: boolean
@@ -305,7 +304,7 @@ export interface ClaudeCodeSpec {
305
304
  * first attempt). Set to 0 or omit to use the default.
306
305
  */
307
306
  verifyAttempts?: number | null
308
- /** SDK built-in tools this agentAction is allowed to use (capability pack). */
307
+ /** SDK built-in tools this executable is allowed to use (capability pack). */
309
308
  tools: string[]
310
309
  /**
311
310
  * Names of bundled hook configs to load (from src/plugins/hooks/<name>.json).
@@ -353,7 +352,7 @@ export interface ScriptEntry {
353
352
  */
354
353
  script?: string
355
354
  /**
356
- * Filename of a shell script colocated with the agentAction
355
+ * Filename of a shell script colocated with the executable
357
356
  * (e.g. "apply-prefer.sh"). Resolved relative to the profile's
358
357
  * directory. Invoked via `bash <path> <with-args>` with ctx.args
359
358
  * exposed as env vars (KODY_ARG_<UPPER_NAME>=<value>). A stdout
@@ -472,8 +471,8 @@ export interface Context {
472
471
  */
473
472
  nextDispatch?: {
474
473
  action?: string
475
- agentResponsibility?: string
476
- agentAction?: string
474
+ capability?: string
475
+ executable?: string
477
476
  cliArgs: Record<string, unknown>
478
477
  saveReport?: boolean
479
478
  }
@@ -482,8 +481,8 @@ export interface Context {
482
481
  /** Where to return after nextJob succeeds. Used by task-jobs to keep draining pending work. */
483
482
  afterNextJob?: {
484
483
  action?: string
485
- agentResponsibility?: string
486
- agentAction?: string
484
+ capability?: string
485
+ executable?: string
487
486
  cliArgs: Record<string, unknown>
488
487
  saveReport?: boolean
489
488
  }
@@ -518,8 +517,8 @@ export type AnyScript = PreflightScript | PostflightScript
518
517
  // Job — the unified work request (task-state jobs collect run attempts).
519
518
  //
520
519
  // A Job is the required work the engine tries to execute, regardless of how it
521
- // was triggered. It must reference an agentResponsibility/action capability
522
- // contract. The agentAction is only the selected implementation detail, never a
520
+ // was triggered. It must reference an capability/action capability
521
+ // contract. The executable is only the selected implementation detail, never a
523
522
  // standalone request.
524
523
  // Task state stores this durable job separately from individual run attempts.
525
524
  // Two flavors:
@@ -527,18 +526,18 @@ export type AnyScript = PreflightScript | PostflightScript
527
526
  // - "scheduled" — fired on `schedule` (cron) by the tick path
528
527
  //
529
528
  // `runJob` (src/job.ts) lowers a Job onto the private executor after resolving
530
- // the agentResponsibility, and seeds both stable job metadata and per-run metadata.
529
+ // the capability, and seeds both stable job metadata and per-run metadata.
531
530
  // ────────────────────────────────────────────────────────────────────────────
532
531
 
533
532
  export type JobFlavor = "instant" | "scheduled"
534
533
 
535
534
  export interface Job {
536
- /** Public action the user/operator invoked. Mirrors the agentResponsibility action. */
535
+ /** Public action the user/operator invoked. Mirrors the capability action. */
537
536
  action?: string
538
- /** How: implementation profile selected by the agentResponsibility. Not valid by itself. */
539
- agentAction?: string
540
- /** Why (referenced): a agentResponsibility slug whose intent drives the run. */
541
- agentResponsibility?: string
537
+ /** How: implementation profile selected by the capability. Not valid by itself. */
538
+ executable?: string
539
+ /** Why (referenced): a capability slug whose intent drives the run. */
540
+ capability?: string
542
541
  /** Why (inline): free-text intent, e.g. an `@kody` comment body. Untrusted —
543
542
  * fenced where it enters a prompt, not here. */
544
543
  why?: string
@@ -548,7 +547,7 @@ export interface Job {
548
547
  schedule?: string
549
548
  /** The issue/PR number this job acts on, when applicable. */
550
549
  target?: number
551
- /** Args passed through to the agentAction (mirrors DispatchResult.cliArgs). */
550
+ /** Args passed through to the executable (mirrors DispatchResult.cliArgs). */
552
551
  cliArgs: Record<string, unknown>
553
552
  /** Run once now ("instant") or on the schedule ("scheduled"). */
554
553
  flavor: JobFlavor
@@ -7,7 +7,7 @@
7
7
  "hooks": [
8
8
  {
9
9
  "type": "command",
10
- "command": "node -e 'process.stderr.write(\"kody read-only mode: this agentAction does not modify files; do not call Write/Edit/NotebookEdit\\n\");process.exit(2)'"
10
+ "command": "node -e 'process.stderr.write(\"kody read-only mode: this executable does not modify files; do not call Write/Edit/NotebookEdit\\n\");process.exit(2)'"
11
11
  }
12
12
  ]
13
13
  }
@@ -84,9 +84,9 @@
84
84
  "enum": ["off", "low", "medium", "high"],
85
85
  "description": "Default thinking effort for the Claude Agent SDK. Maps to maxThinkingTokens. 'off' (default) skips the thinking block entirely — no reasoning preamble, no extra tokens. 'low'/'medium'/'high' enable extended thinking with budgets 2_048/10_000/32_000. Overridable per-session via the REASONING_EFFORT env var or the dashboard's chat-level thinking dropdown."
86
86
  },
87
- "perAgentAction": {
87
+ "perExecutable": {
88
88
  "type": "object",
89
- "description": "Optional provider/model override by agentAction name.",
89
+ "description": "Optional provider/model override by executable name.",
90
90
  "additionalProperties": {
91
91
  "type": "string",
92
92
  "pattern": "^[^/]+/.+$"
@@ -120,22 +120,22 @@
120
120
  }
121
121
  }
122
122
  },
123
- "defaultAgentAction": {
123
+ "defaultExecutable": {
124
124
  "type": "string",
125
- "description": "AgentAction used for bare @kody comments on issues.",
125
+ "description": "Executable used for bare @kody comments on issues.",
126
126
  "default": "run"
127
127
  },
128
- "defaultPrAgentAction": {
128
+ "defaultPrExecutable": {
129
129
  "type": "string",
130
- "description": "Optional agentAction used for bare @kody comments on PRs. Leave unset to require explicit PR commands."
130
+ "description": "Optional executable used for bare @kody comments on PRs. Leave unset to require explicit PR commands."
131
131
  },
132
132
  "onPullRequest": {
133
133
  "type": "string",
134
- "description": "Optional agentAction to run on pull_request opened, synchronize, or reopened events."
134
+ "description": "Optional executable to run on pull_request opened, synchronize, or reopened events."
135
135
  },
136
136
  "aliases": {
137
137
  "type": "object",
138
- "description": "Comment subcommand aliases, mapping typed word to agentAction name.",
138
+ "description": "Comment subcommand aliases, mapping typed word to executable name.",
139
139
  "additionalProperties": {
140
140
  "type": "string"
141
141
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.261",
4
- "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative agentAction profiles.",
3
+ "version": "0.4.263",
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",
7
7
  "bin": {
@@ -1,10 +0,0 @@
1
- # Agent Factory
2
-
3
- ## Purpose
4
-
5
- Create or assemble Kody agency model definitions from an operator request.
6
-
7
- ## Instructions
8
-
9
- Use the `agent-factory` agentAction for the implementation details.
10
- The agentResponsibility owns the public action name and review boundary; the agentAction owns model reasoning and state-repo PR creation.
@@ -1,10 +0,0 @@
1
- # Run
2
-
3
- ## Purpose
4
-
5
- Implement a GitHub issue end-to-end.
6
-
7
- ## Instructions
8
-
9
- Use the `run` agentAction for the implementation details.
10
- The agentResponsibility owns the public action name and the reason this action exists; the agentAction owns the method.