@kody-ade/kody-engine 0.4.205 → 0.4.206

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.
@@ -42,6 +42,14 @@ export interface Profile {
42
42
  * executables differently by category.
43
43
  */
44
44
  role: "primitive" | "orchestrator" | "container" | "watch" | "utility"
45
+ /**
46
+ * A duty is the WHY/WHEN layer: it references an executable (the HOW) by name
47
+ * rather than embedding it. When set, the loader resolves that executable's
48
+ * full profile (claudeCode/scripts/prompt/agents) and overlays this duty's
49
+ * name + staff (WHO) + every (WHEN) + mentions. Absent → this profile IS an
50
+ * executable (defines its own how). executable = how, staff = who, duty = why.
51
+ */
52
+ executable?: string
45
53
  /**
46
54
  * Execution model — orthogonal to `role`.
47
55
  * `oneshot` (default): single invocation on demand.
@@ -429,3 +437,43 @@ export type PostflightScript = (
429
437
 
430
438
  /** A registered script may be either phase; registry looks it up by name. */
431
439
  export type AnyScript = PreflightScript | PostflightScript
440
+
441
+ // ────────────────────────────────────────────────────────────────────────────
442
+ // Job — the unified execution unit (Phase 1 of the job-model migration).
443
+ //
444
+ // A Job is the single thing the engine executes, regardless of how it was
445
+ // triggered. It REFERENCES the reusable nouns — `executable` (how), `persona`
446
+ // (who), `duty` (why, by slug) — and OWNS its `schedule` (when). Two flavors:
447
+ // - "instant" — run once now (an `@kody <verb>` comment or a manual dispatch)
448
+ // - "scheduled" — fired on `schedule` (cron) by the tick path
449
+ //
450
+ // Fields are optional-heavy on purpose: a comment-minted instant job carries
451
+ // `executable` + inline `why`; a cron-minted scheduled job carries `duty` +
452
+ // `schedule` + `persona`. `runJob` (src/job.ts) lowers a Job onto the existing
453
+ // executor; nothing mints Jobs yet — this is an additive seam.
454
+ // ────────────────────────────────────────────────────────────────────────────
455
+
456
+ export type JobFlavor = "instant" | "scheduled"
457
+
458
+ export interface Job {
459
+ /** How: executable (profile) name to run. 0–1; omitted when intent is
460
+ * agent-only with no specific verb. */
461
+ executable?: string
462
+ /** Why (referenced): a duty slug whose intent drives the run. */
463
+ duty?: string
464
+ /** Why (inline): free-text intent, e.g. an `@kody` comment body. Untrusted —
465
+ * fenced where it enters a prompt, not here. */
466
+ why?: string
467
+ /** Who: a staff persona slug. */
468
+ persona?: string
469
+ /** When: cron expression. Set for scheduled jobs, absent for instant. */
470
+ schedule?: string
471
+ /** The issue/PR number this job acts on, when applicable. */
472
+ target?: number
473
+ /** Args passed through to the executable (mirrors DispatchResult.cliArgs). */
474
+ cliArgs: Record<string, unknown>
475
+ /** Run once now ("instant") or on the schedule ("scheduled"). */
476
+ flavor: JobFlavor
477
+ /** Manual force-run (bypass cadence) for a scheduled job. */
478
+ force?: boolean
479
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.205",
3
+ "version": "0.4.206",
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",
@@ -1,28 +0,0 @@
1
- {
2
- "name": "brain-serve",
3
- "role": "utility",
4
- "describe": "Long-lived HTTP server that wraps the Kody chat loop and speaks the Brain SSE protocol. Listens on $PORT (default 8080); auth via $BRAIN_API_KEY. Pairs with the Kody-Dashboard /api/kody/chat/brain proxy. Usage: `kody brain-serve` (runs until SIGINT/SIGTERM).",
5
- "inputs": [],
6
- "claudeCode": {
7
- "model": "inherit",
8
- "permissionMode": "acceptEdits",
9
- "maxTurns": null,
10
- "systemPromptAppend": null,
11
- "tools": [],
12
- "hooks": [],
13
- "skills": [],
14
- "commands": [],
15
- "subagents": [],
16
- "plugins": [],
17
- "mcpServers": []
18
- },
19
- "cliTools": [],
20
- "scripts": {
21
- "preflight": [
22
- {
23
- "script": "brainServe"
24
- }
25
- ],
26
- "postflight": []
27
- }
28
- }
@@ -1,28 +0,0 @@
1
- {
2
- "name": "pool-serve",
3
- "role": "utility",
4
- "describe": "Always-on warm-pool owner, co-located on the kody-litellm machine. Supervises the LiteLLM proxy and serves the pool API the dashboard calls to claim a pre-booted, frozen runner. Listens on $POOL_API_PORT (default 4100); auth via $POOL_API_KEY (derived from $KODY_MASTER_KEY). Usage: `kody pool-serve`.",
5
- "inputs": [],
6
- "claudeCode": {
7
- "model": "inherit",
8
- "permissionMode": "acceptEdits",
9
- "maxTurns": null,
10
- "systemPromptAppend": null,
11
- "tools": [],
12
- "hooks": [],
13
- "skills": [],
14
- "commands": [],
15
- "subagents": [],
16
- "plugins": [],
17
- "mcpServers": []
18
- },
19
- "cliTools": [],
20
- "scripts": {
21
- "preflight": [
22
- {
23
- "script": "poolServe"
24
- }
25
- ],
26
- "postflight": []
27
- }
28
- }
@@ -1,28 +0,0 @@
1
- {
2
- "name": "runner-serve",
3
- "role": "utility",
4
- "describe": "Idle HTTP server for a warm-pool one-shot runner. Boots with no issue, listens on $PORT (default 8080), and on an authed POST /run (X-Api-Key/Bearer $RUNNER_API_KEY) clones the repo and runs `kody run --issue N`, then exits so Fly auto_destroy reclaims the machine. Usage: `kody runner-serve`.",
5
- "inputs": [],
6
- "claudeCode": {
7
- "model": "inherit",
8
- "permissionMode": "acceptEdits",
9
- "maxTurns": null,
10
- "systemPromptAppend": null,
11
- "tools": [],
12
- "hooks": [],
13
- "skills": [],
14
- "commands": [],
15
- "subagents": [],
16
- "plugins": [],
17
- "mcpServers": []
18
- },
19
- "cliTools": [],
20
- "scripts": {
21
- "preflight": [
22
- {
23
- "script": "runnerServe"
24
- }
25
- ],
26
- "postflight": []
27
- }
28
- }
@@ -1,28 +0,0 @@
1
- {
2
- "name": "serve",
3
- "role": "utility",
4
- "describe": "Start a LiteLLM proxy and optionally launch an editor pointed at it. Usage: `kody serve` (proxy only), `kody serve vscode`, `kody serve claude`. Long-lived — Ctrl+C to stop.",
5
- "inputs": [],
6
- "claudeCode": {
7
- "model": "inherit",
8
- "permissionMode": "acceptEdits",
9
- "maxTurns": null,
10
- "systemPromptAppend": null,
11
- "tools": [],
12
- "hooks": [],
13
- "skills": [],
14
- "commands": [],
15
- "subagents": [],
16
- "plugins": [],
17
- "mcpServers": []
18
- },
19
- "cliTools": [],
20
- "scripts": {
21
- "preflight": [
22
- {
23
- "script": "serveFlow"
24
- }
25
- ],
26
- "postflight": []
27
- }
28
- }