@kody-ade/kody-engine 0.4.233 → 0.4.234
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 +24 -2
- package/dist/executables/types.ts +59 -0
- package/package.json +23 -22
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.
|
|
18
|
+
version: "0.4.234",
|
|
19
19
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
20
20
|
license: "MIT",
|
|
21
21
|
type: "module",
|
|
@@ -3121,6 +3121,7 @@ function loadProfile(profilePath) {
|
|
|
3121
3121
|
action: typeof r.action === "string" && r.action.trim() ? r.action.trim() : void 0,
|
|
3122
3122
|
executable: execRef,
|
|
3123
3123
|
describe: typeof r.describe === "string" ? r.describe : base.describe,
|
|
3124
|
+
capabilityKind: parseCapabilityKind(profilePath, r.capabilityKind) ?? base.capabilityKind,
|
|
3124
3125
|
staff: typeof r.staff === "string" && r.staff.trim() ? r.staff.trim() : base.staff,
|
|
3125
3126
|
every: typeof r.every === "string" && r.every.trim() ? r.every.trim() : void 0,
|
|
3126
3127
|
dutyTools: parseStringArray(r.dutyTools ?? r.tools) ?? base.dutyTools,
|
|
@@ -3165,6 +3166,7 @@ function loadProfile(profilePath) {
|
|
|
3165
3166
|
action: typeof r.action === "string" && r.action.trim() ? r.action.trim() : void 0,
|
|
3166
3167
|
executable: void 0,
|
|
3167
3168
|
describe: typeof r.describe === "string" ? r.describe : "",
|
|
3169
|
+
capabilityKind: parseCapabilityKind(profilePath, r.capabilityKind),
|
|
3168
3170
|
// Optional persona to run as. Empty/blank string → undefined (no persona).
|
|
3169
3171
|
staff: typeof r.staff === "string" && r.staff.trim() ? r.staff.trim() : void 0,
|
|
3170
3172
|
// Optional recurrence cadence (scheduled duty). Blank → undefined (on-demand).
|
|
@@ -3255,6 +3257,13 @@ function requireString(p, r, key) {
|
|
|
3255
3257
|
}
|
|
3256
3258
|
return v;
|
|
3257
3259
|
}
|
|
3260
|
+
function parseCapabilityKind(p, raw) {
|
|
3261
|
+
if (raw === void 0 || raw === null || raw === "") return void 0;
|
|
3262
|
+
if (typeof raw !== "string" || !VALID_CAPABILITY_KINDS.has(raw)) {
|
|
3263
|
+
throw new ProfileError(p, `"capabilityKind" must be one of: observe | act | verify`);
|
|
3264
|
+
}
|
|
3265
|
+
return raw;
|
|
3266
|
+
}
|
|
3258
3267
|
function parseStringArray(raw) {
|
|
3259
3268
|
if (!Array.isArray(raw)) return void 0;
|
|
3260
3269
|
const values = raw.map((t) => String(t).trim()).filter(Boolean);
|
|
@@ -3331,6 +3340,17 @@ function parseCliTools(p, raw) {
|
|
|
3331
3340
|
if (!Array.isArray(raw)) throw new ProfileError(p, `"cliTools" must be an array or absent`);
|
|
3332
3341
|
const out = [];
|
|
3333
3342
|
for (const [i, item] of raw.entries()) {
|
|
3343
|
+
if (typeof item === "string" && item.trim()) {
|
|
3344
|
+
const name = item.trim();
|
|
3345
|
+
out.push({
|
|
3346
|
+
name,
|
|
3347
|
+
install: { required: false, checkCommand: `command -v ${name}` },
|
|
3348
|
+
verify: `command -v ${name}`,
|
|
3349
|
+
usage: "",
|
|
3350
|
+
allowedUses: []
|
|
3351
|
+
});
|
|
3352
|
+
continue;
|
|
3353
|
+
}
|
|
3334
3354
|
if (!item || typeof item !== "object") {
|
|
3335
3355
|
throw new ProfileError(p, `cliTools[${i}] must be an object`);
|
|
3336
3356
|
}
|
|
@@ -3490,7 +3510,7 @@ function parseScriptList(p, key, raw) {
|
|
|
3490
3510
|
}
|
|
3491
3511
|
return out;
|
|
3492
3512
|
}
|
|
3493
|
-
var VALID_INPUT_TYPES, VALID_PERMISSION_MODES, VALID_ROLES, VALID_CONTAINER_CHILD_TARGETS, VALID_PHASES, KNOWN_PROFILE_KEYS;
|
|
3513
|
+
var VALID_INPUT_TYPES, VALID_PERMISSION_MODES, VALID_ROLES, VALID_CONTAINER_CHILD_TARGETS, VALID_PHASES, VALID_CAPABILITY_KINDS, KNOWN_PROFILE_KEYS;
|
|
3494
3514
|
var init_profile = __esm({
|
|
3495
3515
|
"src/profile.ts"() {
|
|
3496
3516
|
"use strict";
|
|
@@ -3506,6 +3526,7 @@ var init_profile = __esm({
|
|
|
3506
3526
|
VALID_ROLES = /* @__PURE__ */ new Set(["primitive", "orchestrator", "container", "watch", "utility"]);
|
|
3507
3527
|
VALID_CONTAINER_CHILD_TARGETS = /* @__PURE__ */ new Set(["issue", "pr"]);
|
|
3508
3528
|
VALID_PHASES = /* @__PURE__ */ new Set(["research", "planning", "implementing", "reviewing", "shipped", "failed", "idle"]);
|
|
3529
|
+
VALID_CAPABILITY_KINDS = /* @__PURE__ */ new Set(["observe", "act", "verify"]);
|
|
3509
3530
|
KNOWN_PROFILE_KEYS = /* @__PURE__ */ new Set([
|
|
3510
3531
|
"name",
|
|
3511
3532
|
"action",
|
|
@@ -3515,6 +3536,7 @@ var init_profile = __esm({
|
|
|
3515
3536
|
"dutyTools",
|
|
3516
3537
|
"tools",
|
|
3517
3538
|
"mentions",
|
|
3539
|
+
"capabilityKind",
|
|
3518
3540
|
"stage",
|
|
3519
3541
|
"readsFrom",
|
|
3520
3542
|
"writesTo",
|
|
@@ -15,6 +15,8 @@ import type { Phase } from "../state.js"
|
|
|
15
15
|
// Profile shape (mirrors the JSON on disk).
|
|
16
16
|
// ────────────────────────────────────────────────────────────────────────────
|
|
17
17
|
|
|
18
|
+
export type CapabilityKind = "observe" | "act" | "verify"
|
|
19
|
+
|
|
18
20
|
export interface Profile {
|
|
19
21
|
name: string
|
|
20
22
|
/**
|
|
@@ -33,6 +35,11 @@ export interface Profile {
|
|
|
33
35
|
*/
|
|
34
36
|
staff?: string
|
|
35
37
|
describe: string
|
|
38
|
+
/**
|
|
39
|
+
* Author-facing capability promise for a duty/executable. This classifies the
|
|
40
|
+
* shape of result it should return; it does not change executor control flow.
|
|
41
|
+
*/
|
|
42
|
+
capabilityKind?: CapabilityKind
|
|
36
43
|
/**
|
|
37
44
|
* Semantic role — what this executable IS, not when it runs.
|
|
38
45
|
* - primitive: single-step agent executor (flow → agent → verify → commit → PR).
|
|
@@ -390,6 +397,58 @@ export interface OutputContract {
|
|
|
390
397
|
}
|
|
391
398
|
}
|
|
392
399
|
|
|
400
|
+
export interface CapabilityAlert {
|
|
401
|
+
level?: "info" | "warning" | "error"
|
|
402
|
+
message: string
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export interface CapabilitySuggestedAction {
|
|
406
|
+
action: string
|
|
407
|
+
args?: Record<string, unknown>
|
|
408
|
+
reason?: string
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface CapabilityResourceRef {
|
|
412
|
+
type: string
|
|
413
|
+
id?: string | number
|
|
414
|
+
number?: number
|
|
415
|
+
url?: string
|
|
416
|
+
name?: string
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
export interface CapabilityEvidenceItem {
|
|
420
|
+
source?: string
|
|
421
|
+
message: string
|
|
422
|
+
url?: string
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export interface ObserveResult {
|
|
426
|
+
kind: "observe"
|
|
427
|
+
facts?: Record<string, unknown>
|
|
428
|
+
alerts?: CapabilityAlert[]
|
|
429
|
+
suggestedActions?: CapabilitySuggestedAction[]
|
|
430
|
+
evidence?: Record<string, unknown>
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface ActResult {
|
|
434
|
+
kind: "act"
|
|
435
|
+
status: "created" | "changed" | "triggered" | "skipped" | "failed"
|
|
436
|
+
changedResources?: CapabilityResourceRef[]
|
|
437
|
+
createdResources?: CapabilityResourceRef[]
|
|
438
|
+
actionResult?: Record<string, unknown>
|
|
439
|
+
evidence?: Record<string, unknown>
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export interface VerifyResult {
|
|
443
|
+
kind: "verify"
|
|
444
|
+
passed: boolean
|
|
445
|
+
evidence?: CapabilityEvidenceItem[]
|
|
446
|
+
blockers?: string[]
|
|
447
|
+
facts?: Record<string, unknown>
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export type CapabilityResult = ObserveResult | ActResult | VerifyResult
|
|
451
|
+
|
|
393
452
|
// ────────────────────────────────────────────────────────────────────────────
|
|
394
453
|
// Run-time context passed to every script.
|
|
395
454
|
// ────────────────────────────────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.234",
|
|
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,6 +12,26 @@
|
|
|
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
|
+
},
|
|
15
35
|
"dependencies": {
|
|
16
36
|
"@actions/cache": "^6.0.0",
|
|
17
37
|
"@anthropic-ai/claude-agent-sdk": "0.2.119",
|
|
@@ -35,24 +55,5 @@
|
|
|
35
55
|
"url": "git+https://github.com/aharonyaircohen/kody-engine.git"
|
|
36
56
|
},
|
|
37
57
|
"homepage": "https://github.com/aharonyaircohen/kody-engine",
|
|
38
|
-
"bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
|
|
39
|
-
|
|
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
|
-
}
|
|
58
|
+
"bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
|
|
59
|
+
}
|