@bobobowis/jev-kit 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +240 -2
- package/dist/capabilities.d.ts +33 -0
- package/dist/capabilities.js +81 -0
- package/dist/cli/ask.d.ts +9 -0
- package/dist/cli/ask.js +210 -0
- package/dist/cli/common.d.ts +38 -0
- package/dist/cli/common.js +40 -0
- package/dist/cli/hook.d.ts +3 -0
- package/dist/cli/hook.js +82 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +21 -0
- package/dist/cli/main.d.ts +8 -0
- package/dist/cli/main.js +41 -0
- package/dist/cli/mcp.d.ts +3 -0
- package/dist/cli/mcp.js +47 -0
- package/dist/cli/setup.d.ts +3 -0
- package/dist/cli/setup.js +79 -0
- package/dist/compact/compact-on-demand.d.ts +22 -0
- package/dist/compact/compact-on-demand.js +29 -0
- package/dist/compact/evaluate.d.ts +36 -0
- package/dist/compact/evaluate.js +31 -0
- package/dist/compact/index.d.ts +7 -0
- package/dist/compact/index.js +7 -0
- package/dist/compact/pick-cut-point.d.ts +18 -0
- package/dist/compact/pick-cut-point.js +29 -0
- package/dist/compact/should-compact.d.ts +57 -0
- package/dist/compact/should-compact.js +87 -0
- package/dist/core/client.d.ts +93 -0
- package/dist/core/client.js +295 -0
- package/dist/core/helpers.d.ts +14 -0
- package/dist/core/helpers.js +9 -0
- package/dist/core/mock.d.ts +20 -0
- package/dist/core/mock.js +132 -0
- package/dist/core/types.d.ts +102 -0
- package/dist/core/types.js +82 -0
- package/dist/events/index.d.ts +44 -0
- package/dist/events/index.js +77 -0
- package/dist/files/ask-file-bool.d.ts +12 -0
- package/dist/files/ask-file-bool.js +15 -0
- package/dist/files/ask-file-choice.d.ts +10 -0
- package/dist/files/ask-file-choice.js +17 -0
- package/dist/files/ask-file-score.d.ts +12 -0
- package/dist/files/ask-file-score.js +15 -0
- package/dist/files/ask-files.d.ts +23 -0
- package/dist/files/ask-files.js +56 -0
- package/dist/files/ask.d.ts +12 -0
- package/dist/files/ask.js +28 -0
- package/dist/files/assemble.d.ts +52 -0
- package/dist/files/assemble.js +129 -0
- package/dist/files/decide.d.ts +10 -0
- package/dist/files/decide.js +1 -0
- package/dist/files/index.d.ts +14 -0
- package/dist/files/index.js +14 -0
- package/dist/files/pick-first.d.ts +16 -0
- package/dist/files/pick-first.js +24 -0
- package/dist/files/prune.d.ts +13 -0
- package/dist/files/prune.js +87 -0
- package/dist/files/read-state.d.ts +17 -0
- package/dist/files/read-state.js +47 -0
- package/dist/guards/bash-gate.d.ts +29 -0
- package/dist/guards/bash-gate.js +35 -0
- package/dist/guards/index.d.ts +6 -0
- package/dist/guards/index.js +6 -0
- package/dist/guards/result-screen.d.ts +20 -0
- package/dist/guards/result-screen.js +31 -0
- package/dist/guards/write-gate.d.ts +18 -0
- package/dist/guards/write-gate.js +44 -0
- package/dist/hooks/handle.d.ts +62 -0
- package/dist/hooks/handle.js +48 -0
- package/dist/hooks/harness.d.ts +40 -0
- package/dist/hooks/harness.js +116 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/state.d.ts +8 -0
- package/dist/hooks/state.js +25 -0
- package/dist/hooks/transcript.d.ts +8 -0
- package/dist/hooks/transcript.js +52 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/ledger.d.ts +22 -0
- package/dist/ledger.js +26 -0
- package/dist/mcp/server.d.ts +28 -0
- package/dist/mcp/server.js +124 -0
- package/dist/policy/index.d.ts +17 -0
- package/dist/policy/index.js +30 -0
- package/dist/setup/index.d.ts +67 -0
- package/dist/setup/index.js +209 -0
- package/dist/tools/ask-jev.d.ts +7 -0
- package/dist/tools/ask-jev.js +42 -0
- package/dist/tools/compact-tool.d.ts +2 -0
- package/dist/tools/compact-tool.js +33 -0
- package/dist/tools/description.d.ts +5 -0
- package/dist/tools/description.js +20 -0
- package/dist/tools/file-tools.d.ts +7 -0
- package/dist/tools/file-tools.js +127 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.js +10 -0
- package/dist/tools/run-command.d.ts +7 -0
- package/dist/tools/run-command.js +27 -0
- package/dist/tools/sets.d.ts +9 -0
- package/dist/tools/sets.js +32 -0
- package/dist/tools/types.d.ts +51 -0
- package/dist/tools/types.js +4 -0
- package/package.json +96 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Jev tool, defined once for every harness: pi registers it, the MCP server lists it, the CLI
|
|
3
|
+
* runs it. The name, description, parameters, and payload are the same wherever it appears.
|
|
4
|
+
*/
|
|
5
|
+
import type { Decider } from "../events/index.ts";
|
|
6
|
+
import type { CompactAction } from "../compact/should-compact.ts";
|
|
7
|
+
import type { Evaluation, TurnInput } from "../compact/evaluate.ts";
|
|
8
|
+
/** The subset of JSON Schema the tools use. */
|
|
9
|
+
export interface JsonSchema {
|
|
10
|
+
type?: "object" | "string" | "boolean" | "array" | "number" | "integer";
|
|
11
|
+
description?: string;
|
|
12
|
+
properties?: Record<string, JsonSchema>;
|
|
13
|
+
required?: string[];
|
|
14
|
+
items?: JsonSchema;
|
|
15
|
+
additionalProperties?: boolean | JsonSchema;
|
|
16
|
+
}
|
|
17
|
+
export interface CompactionSource {
|
|
18
|
+
/** The session as the harness sees it, or null when it has no history to offer. */
|
|
19
|
+
input(): TurnInput | null | Promise<TurnInput | null>;
|
|
20
|
+
/** How the agent can act on a tier under this harness. */
|
|
21
|
+
action: CompactAction;
|
|
22
|
+
/** Told about every evaluation, so a harness can keep injecting the latest tier. */
|
|
23
|
+
onEvaluation?(evaluation: Evaluation): void;
|
|
24
|
+
}
|
|
25
|
+
export interface ToolContext {
|
|
26
|
+
/** The directory the agent works in. Paths resolve here and may not leave it. */
|
|
27
|
+
cwd: string;
|
|
28
|
+
harness: string;
|
|
29
|
+
decide: Decider;
|
|
30
|
+
report(kind: string, payload: Record<string, unknown>): void;
|
|
31
|
+
/** Level 7 only. */
|
|
32
|
+
compaction?: CompactionSource;
|
|
33
|
+
}
|
|
34
|
+
export interface ToolResult {
|
|
35
|
+
/** What the agent reads. */
|
|
36
|
+
text: string;
|
|
37
|
+
/** The structured result, when the call succeeded. */
|
|
38
|
+
payload?: unknown;
|
|
39
|
+
isError?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface JevTool {
|
|
42
|
+
name: string;
|
|
43
|
+
label: string;
|
|
44
|
+
description: string;
|
|
45
|
+
parameters: JsonSchema;
|
|
46
|
+
execute(params: Record<string, unknown>, ctx: ToolContext): Promise<ToolResult>;
|
|
47
|
+
}
|
|
48
|
+
export declare const ok: (payload: unknown) => ToolResult;
|
|
49
|
+
export declare const fail: (text: string) => ToolResult;
|
|
50
|
+
export declare const object: (properties: Record<string, JsonSchema>, required?: string[]) => JsonSchema;
|
|
51
|
+
export declare const str: (description?: string) => JsonSchema;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const ok = (payload) => ({ text: JSON.stringify(payload, null, 2), payload });
|
|
2
|
+
export const fail = (text) => ({ text, isError: true });
|
|
3
|
+
export const object = (properties, required = Object.keys(properties)) => ({ type: "object", properties, required });
|
|
4
|
+
export const str = (description) => (description ? { type: "string", description } : { type: "string" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,99 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobobowis/jev-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Jev, TypeSafe AI's System One decision model, as a typed client, guards, file reads, agent tools, hooks, an MCP server, and a CLI. Zero runtime dependencies.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "bobobowis",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/bobobowis/ten-levels-of-jev.git",
|
|
11
|
+
"directory": "packages/jev-kit"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/bobobowis/ten-levels-of-jev/tree/main/packages/jev-kit#readme",
|
|
14
|
+
"bugs": "https://github.com/bobobowis/ten-levels-of-jev/issues",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"jev",
|
|
17
|
+
"typesafe",
|
|
18
|
+
"llm",
|
|
19
|
+
"classifier",
|
|
20
|
+
"decision",
|
|
21
|
+
"guardrails",
|
|
22
|
+
"claude-code",
|
|
23
|
+
"codex",
|
|
24
|
+
"mcp",
|
|
25
|
+
"hooks",
|
|
26
|
+
"agents"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22.18"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./policy": {
|
|
40
|
+
"types": "./dist/policy/index.d.ts",
|
|
41
|
+
"default": "./dist/policy/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./events": {
|
|
44
|
+
"types": "./dist/events/index.d.ts",
|
|
45
|
+
"default": "./dist/events/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./files": {
|
|
48
|
+
"types": "./dist/files/index.d.ts",
|
|
49
|
+
"default": "./dist/files/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./ledger": {
|
|
52
|
+
"types": "./dist/ledger.d.ts",
|
|
53
|
+
"default": "./dist/ledger.js"
|
|
54
|
+
},
|
|
55
|
+
"./guards": {
|
|
56
|
+
"types": "./dist/guards/index.d.ts",
|
|
57
|
+
"default": "./dist/guards/index.js"
|
|
58
|
+
},
|
|
59
|
+
"./compact": {
|
|
60
|
+
"types": "./dist/compact/index.d.ts",
|
|
61
|
+
"default": "./dist/compact/index.js"
|
|
62
|
+
},
|
|
63
|
+
"./tools": {
|
|
64
|
+
"types": "./dist/tools/index.d.ts",
|
|
65
|
+
"default": "./dist/tools/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./hooks": {
|
|
68
|
+
"types": "./dist/hooks/index.d.ts",
|
|
69
|
+
"default": "./dist/hooks/index.js"
|
|
70
|
+
},
|
|
71
|
+
"./setup": {
|
|
72
|
+
"types": "./dist/setup/index.d.ts",
|
|
73
|
+
"default": "./dist/setup/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./capabilities": {
|
|
76
|
+
"types": "./dist/capabilities.d.ts",
|
|
77
|
+
"default": "./dist/capabilities.js"
|
|
78
|
+
},
|
|
79
|
+
"./package.json": "./package.json"
|
|
80
|
+
},
|
|
81
|
+
"bin": {
|
|
82
|
+
"jev": "./dist/cli/index.js"
|
|
83
|
+
},
|
|
84
|
+
"files": [
|
|
85
|
+
"dist",
|
|
86
|
+
"README.md",
|
|
87
|
+
"LICENSE"
|
|
88
|
+
],
|
|
89
|
+
"devDependencies": {
|
|
90
|
+
"@types/node": "^24.0.0",
|
|
91
|
+
"typescript": "~5.9.3"
|
|
92
|
+
},
|
|
93
|
+
"scripts": {
|
|
94
|
+
"build": "tsc -b tsconfig.build.json",
|
|
95
|
+
"pretest": "tsc -b tsconfig.build.json",
|
|
96
|
+
"test": "node --test \"tests/**/*.test.ts\"",
|
|
97
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
98
|
+
}
|
|
6
99
|
}
|