@kody-ade/kody-engine 0.4.218 → 0.4.220

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 (43) hide show
  1. package/README.md +3 -3
  2. package/dist/bin/kody.js +860 -632
  3. package/dist/duties/fix/duty.md +10 -0
  4. package/dist/duties/fix/profile.json +6 -0
  5. package/dist/duties/fix-ci/duty.md +10 -0
  6. package/dist/duties/fix-ci/profile.json +6 -0
  7. package/dist/duties/init/duty.md +10 -0
  8. package/dist/duties/init/profile.json +6 -0
  9. package/dist/duties/merge/duty.md +10 -0
  10. package/dist/duties/merge/profile.json +6 -0
  11. package/dist/duties/preview-build/duty.md +10 -0
  12. package/dist/duties/preview-build/profile.json +6 -0
  13. package/dist/duties/release/duty.md +10 -0
  14. package/dist/duties/release/profile.json +6 -0
  15. package/dist/duties/release-deploy/duty.md +10 -0
  16. package/dist/duties/release-deploy/profile.json +6 -0
  17. package/dist/duties/release-prepare/duty.md +10 -0
  18. package/dist/duties/release-prepare/profile.json +6 -0
  19. package/dist/duties/release-publish/duty.md +10 -0
  20. package/dist/duties/release-publish/profile.json +6 -0
  21. package/dist/duties/resolve/duty.md +10 -0
  22. package/dist/duties/resolve/profile.json +6 -0
  23. package/dist/duties/revert/duty.md +10 -0
  24. package/dist/duties/revert/profile.json +6 -0
  25. package/dist/duties/run/duty.md +10 -0
  26. package/dist/duties/run/profile.json +6 -0
  27. package/dist/duties/sync/duty.md +10 -0
  28. package/dist/duties/sync/profile.json +6 -0
  29. package/dist/duties/worker-ask/duty.md +10 -0
  30. package/dist/duties/worker-ask/profile.json +6 -0
  31. package/dist/executables/duty-scheduler/profile.json +1 -1
  32. package/dist/executables/duty-tick/profile.json +2 -2
  33. package/dist/executables/duty-tick-scripted/profile.json +3 -3
  34. package/dist/executables/goal-scheduler/scheduler.sh +0 -0
  35. package/dist/executables/release-deploy/deploy.sh +0 -0
  36. package/dist/executables/release-prepare/prepare.sh +0 -0
  37. package/dist/executables/release-publish/publish.sh +0 -0
  38. package/dist/executables/resolve/apply-prefer.sh +0 -0
  39. package/dist/executables/revert/revert.sh +0 -0
  40. package/dist/executables/types.ts +11 -3
  41. package/dist/executables/worker-ask/profile.json +1 -1
  42. package/package.json +22 -23
  43. /package/dist/jobs/watch-stale-prs/{prompt.md → duty.md} +0 -0
@@ -0,0 +1,10 @@
1
+ # Fix
2
+
3
+ ## Purpose
4
+
5
+ Apply review feedback to an existing PR.
6
+
7
+ ## Instructions
8
+
9
+ Use the `fix` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "fix",
3
+ "action": "fix",
4
+ "executable": "fix",
5
+ "describe": "Apply review feedback to an existing PR."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Fix Ci
2
+
3
+ ## Purpose
4
+
5
+ Fix a failing CI workflow on an existing PR.
6
+
7
+ ## Instructions
8
+
9
+ Use the `fix-ci` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "fix-ci",
3
+ "action": "fix-ci",
4
+ "executable": "fix-ci",
5
+ "describe": "Fix a failing CI workflow on an existing PR."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Init
2
+
3
+ ## Purpose
4
+
5
+ Install Kody engine files in a repo.
6
+
7
+ ## Instructions
8
+
9
+ Use the `init` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "init",
3
+ "action": "init",
4
+ "executable": "init",
5
+ "describe": "Install Kody engine files in a repo."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Merge
2
+
3
+ ## Purpose
4
+
5
+ Self-gating squash merge of a PR.
6
+
7
+ ## Instructions
8
+
9
+ Use the `merge` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "merge",
3
+ "action": "merge",
4
+ "executable": "merge",
5
+ "describe": "Self-gating squash merge of a PR."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Preview Build
2
+
3
+ ## Purpose
4
+
5
+ Build and publish a per-PR preview.
6
+
7
+ ## Instructions
8
+
9
+ Use the `preview-build` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "preview-build",
3
+ "action": "preview-build",
4
+ "executable": "preview-build",
5
+ "describe": "Build and publish a per-PR preview."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Release
2
+
3
+ ## Purpose
4
+
5
+ Run the release flow.
6
+
7
+ ## Instructions
8
+
9
+ Use the `release` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "release",
3
+ "action": "release",
4
+ "executable": "release",
5
+ "describe": "Run the release flow."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Release Deploy
2
+
3
+ ## Purpose
4
+
5
+ Deploy or promote a release.
6
+
7
+ ## Instructions
8
+
9
+ Use the `release-deploy` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "release-deploy",
3
+ "action": "release-deploy",
4
+ "executable": "release-deploy",
5
+ "describe": "Deploy or promote a release."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Release Prepare
2
+
3
+ ## Purpose
4
+
5
+ Prepare a release PR.
6
+
7
+ ## Instructions
8
+
9
+ Use the `release-prepare` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "release-prepare",
3
+ "action": "release-prepare",
4
+ "executable": "release-prepare",
5
+ "describe": "Prepare a release PR."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Release Publish
2
+
3
+ ## Purpose
4
+
5
+ Publish a prepared release.
6
+
7
+ ## Instructions
8
+
9
+ Use the `release-publish` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "release-publish",
3
+ "action": "release-publish",
4
+ "executable": "release-publish",
5
+ "describe": "Publish a prepared release."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Resolve
2
+
3
+ ## Purpose
4
+
5
+ Resolve merge conflicts on an existing PR.
6
+
7
+ ## Instructions
8
+
9
+ Use the `resolve` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "resolve",
3
+ "action": "resolve",
4
+ "executable": "resolve",
5
+ "describe": "Resolve merge conflicts on an existing PR."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Revert
2
+
3
+ ## Purpose
4
+
5
+ Revert one or more commits on a PR branch.
6
+
7
+ ## Instructions
8
+
9
+ Use the `revert` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "revert",
3
+ "action": "revert",
4
+ "executable": "revert",
5
+ "describe": "Revert one or more commits on a PR branch."
6
+ }
@@ -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` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "run",
3
+ "action": "run",
4
+ "executable": "run",
5
+ "describe": "Implement a GitHub issue end-to-end."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Sync
2
+
3
+ ## Purpose
4
+
5
+ Merge the base branch into a PR branch.
6
+
7
+ ## Instructions
8
+
9
+ Use the `sync` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "sync",
3
+ "action": "sync",
4
+ "executable": "sync",
5
+ "describe": "Merge the base branch into a PR branch."
6
+ }
@@ -0,0 +1,10 @@
1
+ # Worker Ask
2
+
3
+ ## Purpose
4
+
5
+ Run a staff member once against an inline request.
6
+
7
+ ## Instructions
8
+
9
+ Use the `worker-ask` executable for the implementation details.
10
+ The duty owns the public action name and the reason this action exists; the executable owns the method.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "worker-ask",
3
+ "action": "worker-ask",
4
+ "executable": "worker-ask",
5
+ "describe": "Run a staff member once against an inline request."
6
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duty-scheduler",
3
3
  "role": "watch",
4
- "describe": "Scheduled: for every duty file under .kody/duties/, invoke duty-tick once. No agent on the scheduler itself.",
4
+ "describe": "Scheduled: for every duty folder under .kody/duties/, invoke duty-tick once. No agent on the scheduler itself.",
5
5
  "kind": "scheduled",
6
6
  "schedule": "*/5 * * * *",
7
7
  "inputs": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duty-tick",
3
3
  "role": "primitive",
4
- "describe": "One classifier tick for one duty file: read intent + state, decide and execute via gh, emit next state.",
4
+ "describe": "One classifier tick for one duty folder: read intent + state, decide and execute via gh, emit next state.",
5
5
  "kind": "oneshot",
6
6
  "inputs": [
7
7
  {
@@ -9,7 +9,7 @@
9
9
  "flag": "--duty",
10
10
  "type": "string",
11
11
  "required": true,
12
- "describe": "Duty slug — basename (without .md) of the file under .kody/duties/."
12
+ "describe": "Duty slug — folder name under .kody/duties/."
13
13
  },
14
14
  {
15
15
  "name": "force",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duty-tick-scripted",
3
3
  "role": "utility",
4
- "describe": "Deterministic duty tick: runs the slug's `tickScript:` (declared in duty frontmatter), parses next-state from its stdout, persists. No agent.",
4
+ "describe": "Deterministic duty tick: runs the slug's `tickScript:` (declared in the duty profile), parses next-state from its stdout, persists. No agent.",
5
5
  "kind": "oneshot",
6
6
  "inputs": [
7
7
  {
@@ -9,13 +9,13 @@
9
9
  "flag": "--duty",
10
10
  "type": "string",
11
11
  "required": true,
12
- "describe": "Duty slug — basename (without .md) of the file under .kody/duties/."
12
+ "describe": "Duty slug — folder name under .kody/duties/."
13
13
  },
14
14
  {
15
15
  "name": "force",
16
16
  "flag": "--force",
17
17
  "type": "bool",
18
- "describe": "Accepted for parity with `duty-tick`. Scripted ticks have no agent cadence guard to bypass — the dispatcher already gated on frontmatter `every:`. Forwarded to the script via env if it cares."
18
+ "describe": "Accepted for parity with `duty-tick`. Scripted ticks have no agent cadence guard to bypass — the dispatcher already gated on profile `every`. Forwarded to the script via env if it cares."
19
19
  }
20
20
  ],
21
21
  "claudeCode": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -17,6 +17,12 @@ import type { Phase } from "../state.js"
17
17
 
18
18
  export interface Profile {
19
19
  name: string
20
+ /**
21
+ * Public action name owned by a duty. A user may type `@kody <action>`;
22
+ * dispatch resolves that action to the duty, then the duty selects the
23
+ * implementation executable. Absent → the duty slug/name is the action.
24
+ */
25
+ action?: string
20
26
  /**
21
27
  * Optional staff member this executable runs *as*. When set, the executor
22
28
  * loads `.kody/staff/<staff>.md` and injects that persona (authoritative
@@ -59,7 +65,7 @@ export interface Profile {
59
65
  kind: "oneshot" | "scheduled"
60
66
  /**
61
67
  * Recurrence cadence for a duty that runs on a timer (unified successor to a
62
- * markdown duty's `every:` frontmatter). One of the ScheduleEvery values
68
+ * markdown duty's `every:` metadata). One of the ScheduleEvery values
63
69
  * ("15m".."7d" | "manual"). Present → the duty-scheduler fires a one-shot run
64
70
  * when due (no target). Absent → on-demand only (runs against an issue/PR).
65
71
  * This is what makes "scheduled" just a field on the one duty shape.
@@ -67,7 +73,7 @@ export interface Profile {
67
73
  every?: string
68
74
  /**
69
75
  * Locked-toolbox palette (unified successor to a markdown duty's `tools:`
70
- * frontmatter). When non-empty, loadDutyState sets ctx.data.dutyTools so the
76
+ * metadata). When non-empty, loadDutyState sets ctx.data.dutyTools so the
71
77
  * executor spins up the in-process kody-duty MCP server and the agent runs
72
78
  * MCP-only (Bash/Read revoked unless also in claudeCode.tools). Absent →
73
79
  * normal SDK tools.
@@ -76,7 +82,7 @@ export interface Profile {
76
82
  /**
77
83
  * GitHub logins (no leading `@`) this duty's output should mention. Rendered
78
84
  * to `@a @b` and exposed to the prompt as {{mentions}} (and as the duty-MCP
79
- * operator mention), mirroring a markdown duty's `mentions:` frontmatter.
85
+ * operator mention), mirroring a markdown duty's `mentions:` metadata.
80
86
  */
81
87
  mentions?: string[]
82
88
  /** Cron expression for scheduled profiles (e.g. "0 8 * * MON"). */
@@ -462,6 +468,8 @@ export type AnyScript = PreflightScript | PostflightScript
462
468
  export type JobFlavor = "instant" | "scheduled"
463
469
 
464
470
  export interface Job {
471
+ /** Public action the user/operator invoked. Mirrors the duty action. */
472
+ action?: string
465
473
  /** How: executable (profile) name to run. 0–1; omitted when intent is
466
474
  * agent-only with no specific verb. */
467
475
  executable?: string
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "worker-ask",
3
3
  "role": "primitive",
4
- "describe": "Ad-hoc one-shot: run a staff persona against an inline message + context (from a dashboard @staff mention). Stateless — no duty file, no state, no commit. Replies into the originating thread.",
4
+ "describe": "Ad-hoc one-shot: run a staff persona against an inline message + context (from a dashboard @staff mention). Stateless — no duty folder, no state, no commit. Replies into the originating thread.",
5
5
  "kind": "oneshot",
6
6
  "inputs": [
7
7
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.218",
3
+ "version": "0.4.220",
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",
@@ -12,26 +12,6 @@
12
12
  "templates",
13
13
  "kody.config.schema.json"
14
14
  ],
15
- "scripts": {
16
- "kody:run": "tsx bin/kody.ts",
17
- "serve": "tsx bin/kody.ts serve",
18
- "serve:vscode": "tsx bin/kody.ts serve vscode",
19
- "serve:claude": "tsx bin/kody.ts serve claude",
20
- "build": "tsup && node scripts/copy-assets.cjs",
21
- "check:modularity": "tsx scripts/check-script-modularity.ts",
22
- "pretest": "pnpm check:modularity",
23
- "test": "vitest run tests/unit tests/int --coverage",
24
- "posttest": "tsx scripts/check-coverage-floor.ts",
25
- "test:smoke": "vitest run tests/smoke --no-coverage",
26
- "test:e2e": "vitest run tests/e2e --no-coverage",
27
- "test:all": "vitest run tests --no-coverage",
28
- "typecheck": "tsc --noEmit",
29
- "lint": "biome check",
30
- "lint:fix": "biome check --write",
31
- "format": "biome format --write",
32
- "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner",
33
- "prepublishOnly": "pnpm typecheck && vitest run tests/unit tests/int --no-coverage && pnpm build"
34
- },
35
15
  "dependencies": {
36
16
  "@actions/cache": "^6.0.0",
37
17
  "@anthropic-ai/claude-agent-sdk": "0.2.119",
@@ -55,5 +35,24 @@
55
35
  "url": "git+https://github.com/aharonyaircohen/kody-engine.git"
56
36
  },
57
37
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
58
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
59
- }
38
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
39
+ "scripts": {
40
+ "kody:run": "tsx bin/kody.ts",
41
+ "serve": "tsx bin/kody.ts serve",
42
+ "serve:vscode": "tsx bin/kody.ts serve vscode",
43
+ "serve:claude": "tsx bin/kody.ts serve claude",
44
+ "build": "tsup && node scripts/copy-assets.cjs",
45
+ "check:modularity": "tsx scripts/check-script-modularity.ts",
46
+ "pretest": "pnpm check:modularity",
47
+ "test": "vitest run tests/unit tests/int --coverage",
48
+ "posttest": "tsx scripts/check-coverage-floor.ts",
49
+ "test:smoke": "vitest run tests/smoke --no-coverage",
50
+ "test:e2e": "vitest run tests/e2e --no-coverage",
51
+ "test:all": "vitest run tests --no-coverage",
52
+ "typecheck": "tsc --noEmit",
53
+ "lint": "biome check",
54
+ "lint:fix": "biome check --write",
55
+ "format": "biome format --write",
56
+ "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner"
57
+ }
58
+ }