hankweave 0.5.7 → 0.6.2

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 (79) hide show
  1. package/README.md +12 -11
  2. package/dist/base-process-manager.d.ts +30 -0
  3. package/dist/budget.d.ts +315 -0
  4. package/dist/checkpoint-git.d.ts +98 -0
  5. package/dist/claude-agent-sdk-manager.d.ts +144 -0
  6. package/dist/claude-log-parser.d.ts +63 -0
  7. package/dist/claude-runtime-extractor.d.ts +73 -0
  8. package/dist/codex-runtime-extractor.d.ts +107 -0
  9. package/dist/codon-runner.d.ts +278 -0
  10. package/dist/config-validation/model-validator.d.ts +16 -0
  11. package/dist/config-validation/sentinel.schema.d.ts +6967 -0
  12. package/dist/config.d.ts +40815 -0
  13. package/dist/cost-tracker.d.ts +72 -0
  14. package/dist/execution-planner.d.ts +62 -0
  15. package/dist/execution-thread.d.ts +71 -0
  16. package/dist/exports/schemas.d.ts +9 -0
  17. package/dist/exports/schemas.js +1019 -0
  18. package/dist/exports/types.d.ts +15 -0
  19. package/dist/exports/types.js +60 -0
  20. package/dist/file-resolver.d.ts +33 -0
  21. package/dist/index.js +380 -293
  22. package/dist/index.js.map +33 -29
  23. package/dist/llm/llm-provider-registry.d.ts +207 -0
  24. package/dist/llm/models-dev-schema.d.ts +679 -0
  25. package/dist/llm/provider-config.d.ts +30 -0
  26. package/dist/prompt-builder.d.ts +75 -0
  27. package/dist/prompt-frontmatter.d.ts +61 -0
  28. package/dist/replay-process-manager.d.ts +82 -0
  29. package/dist/runtime-extractor-base.d.ts +120 -0
  30. package/dist/schemas/event-schemas.d.ts +8389 -0
  31. package/dist/schemas/websocket-log-schemas.d.ts +4502 -0
  32. package/dist/shim-process-manager.d.ts +98 -0
  33. package/dist/shim-runtime-extractor.d.ts +51 -0
  34. package/dist/shims/codex/README.md +129 -0
  35. package/dist/shims/codex/THIRDPARTY.md +18 -0
  36. package/dist/shims/codex/VERSION +1 -0
  37. package/dist/shims/codex/common/package.json +24 -0
  38. package/dist/shims/codex/index.js +1154 -970
  39. package/dist/shims/codex/package.json +46 -0
  40. package/dist/shims/codex/tsup.config.ts +16 -0
  41. package/dist/shims/gemini/README.md +59 -0
  42. package/dist/shims/gemini/THIRDPARTY.md +32 -0
  43. package/dist/shims/gemini/VERSION +1 -0
  44. package/dist/shims/gemini/common/package.json +24 -0
  45. package/dist/shims/gemini/index.js +1359 -30
  46. package/dist/shims/gemini/package.json +37 -0
  47. package/dist/shims/opencode/README.md +82 -0
  48. package/dist/shims/opencode/THIRDPARTY.md +32 -0
  49. package/dist/shims/opencode/VERSION +1 -0
  50. package/dist/shims/opencode/common/package.json +24 -0
  51. package/dist/shims/opencode/index.js +1476 -0
  52. package/dist/shims/opencode/package.json +38 -0
  53. package/dist/shims/pi/README.md +87 -0
  54. package/dist/shims/pi/THIRDPARTY.md +24 -0
  55. package/dist/shims/pi/VERSION +1 -0
  56. package/dist/shims/pi/common/package.json +24 -0
  57. package/dist/shims/pi/index.js +249832 -0
  58. package/dist/shims/pi/package.json +53 -0
  59. package/dist/state-manager.d.ts +161 -0
  60. package/dist/state-transition-guards.d.ts +37 -0
  61. package/dist/telemetry/telemetry-types.d.ts +206 -0
  62. package/dist/typed-event-emitter.d.ts +57 -0
  63. package/dist/types/branded-types.d.ts +15 -0
  64. package/dist/types/budget-types.d.ts +82 -0
  65. package/dist/types/claude-session-schema.d.ts +2430 -0
  66. package/dist/types/error-types.d.ts +44 -0
  67. package/dist/types/input-ai-types.d.ts +1070 -0
  68. package/dist/types/llm-call-types.d.ts +3829 -0
  69. package/dist/types/sentinel-types.d.ts +66 -0
  70. package/dist/types/state-types.d.ts +1099 -0
  71. package/dist/types/tool-types.d.ts +86 -0
  72. package/dist/types/types.d.ts +367 -0
  73. package/dist/types/websocket-log-types.d.ts +7 -0
  74. package/dist/utils.d.ts +452 -0
  75. package/package.json +15 -2
  76. package/schemas/hank.schema.json +158 -3
  77. package/schemas/hankweave.schema.json +17 -1
  78. package/shims/codex/index.js +0 -1583
  79. package/shims/gemini/index.js +0 -31
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "codex-shim",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "description": "Self-contained Hankweave shim for OpenAI Codex via @openai/codex-sdk",
6
+ "type": "module",
7
+ "bin": {
8
+ "codex-shim": "./index.js"
9
+ },
10
+ "files": [
11
+ "index.js",
12
+ "dist",
13
+ "src",
14
+ "tests",
15
+ "common",
16
+ "docs",
17
+ "README.md",
18
+ "rebuild.sh",
19
+ "VERSION",
20
+ "THIRDPARTY.md",
21
+ "tsconfig.json",
22
+ "tsup.config.ts",
23
+ "bun.lock"
24
+ ],
25
+ "engines": {
26
+ "node": ">=18",
27
+ "bun": ">=1.1.0"
28
+ },
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "rebuild": "./rebuild.sh",
32
+ "test": "bun test",
33
+ "typecheck": "tsc --noEmit -p tsconfig.json",
34
+ "clean": "node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true}); fs.rmSync('index.js',{force:true});\""
35
+ },
36
+ "dependencies": {
37
+ "@openai/codex-sdk": "^0.112.0",
38
+ "@shims/common": "file:./common"
39
+ },
40
+ "devDependencies": {
41
+ "@types/bun": "latest",
42
+ "@types/node": "^20.10.0",
43
+ "tsup": "^8.0.1",
44
+ "typescript": "^5.3.0"
45
+ }
46
+ }
@@ -0,0 +1,16 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ format: ["esm"],
6
+ target: "node18",
7
+ platform: "node",
8
+ bundle: true,
9
+ noExternal: ["@shims/common", "@openai/codex-sdk"],
10
+ sourcemap: false,
11
+ clean: true,
12
+ outDir: "dist",
13
+ banner: {
14
+ js: "#!/usr/bin/env node",
15
+ },
16
+ });
@@ -0,0 +1,59 @@
1
+ # gemini-cli-shim
2
+
3
+ A self-contained shim package that wraps a locally installed `gemini` CLI and translates its `stream-json` output into the Hankweave shim JSONL protocol.
4
+
5
+ ## What this package contains
6
+
7
+ - `index.js` — drop-in compiled bundle for Hankweave
8
+ - `dist/index.js` — normal build output
9
+ - `src/` — shim source
10
+ - `common/` — vendored `@shims/common`
11
+ - `docs/` — usage, architecture, validation, and research notes
12
+ - `rebuild.sh` — reinstalls deps, rebuilds, refreshes `VERSION`, and copies the drop-in bundle
13
+
14
+ ## Requirements
15
+
16
+ - Gemini CLI installed and available on `PATH` as `gemini`
17
+ - Gemini CLI already authenticated
18
+ - Bun available for rebuilds (`bun install`, `bun run build`)
19
+
20
+ ## Quick start
21
+
22
+ ```bash
23
+ echo "Say hello" | ./index.js --model gemini-2.5-flash
24
+ ```
25
+
26
+ Resume a prior Gemini-native session:
27
+
28
+ ```bash
29
+ echo "What did I ask earlier?" | ./index.js --model google/gemini-2.5-pro --resume <session-uuid>
30
+ ```
31
+
32
+ Run the environment check:
33
+
34
+ ```bash
35
+ ./index.js --self-test
36
+ ```
37
+
38
+ Rebuild the package:
39
+
40
+ ```bash
41
+ ./rebuild.sh
42
+ ```
43
+
44
+ ## Documentation
45
+
46
+ - `docs/usage.md` — installation assumptions, CLI flags, examples, debug mode
47
+ - `docs/architecture.md` — event translation, retries, JSON repair, session handling
48
+ - `docs/verification.md` — eval-suite and shim-local validation notes
49
+ - `docs/research.md` — implementation research summary
50
+ - `docs/implementation-notes.md` — working notes, edge cases, and issue log
51
+
52
+ ## Notes
53
+
54
+ - The shim uses Gemini's native session UUIDs as shim session IDs.
55
+ - Raw debug files are only written when `--debug-dir` is provided.
56
+ - The shim includes bounded follow-up turns for three observed Gemini CLI failure modes:
57
+ - silent success with no assistant/tool activity
58
+ - early exit during numbered workflows
59
+ - invalid JSON files left on disk after a nominally successful turn
@@ -0,0 +1,32 @@
1
+ # Third-party notices
2
+
3
+ ## Runtime bundle
4
+
5
+ This shim is a thin subprocess wrapper around a locally installed Gemini CLI. It does **not** bundle the Gemini CLI itself or a separate Gemini SDK.
6
+
7
+ - Primary bundled SDK dependency: `n/a`
8
+ - `VERSION`: `n/a`
9
+
10
+ The runtime bundle may include vendored project-internal code from `@shims/common`, which is part of the same shim codebase rather than a third-party SDK.
11
+
12
+ ## Build-time tooling
13
+
14
+ These packages are used to build or type-check the shim package:
15
+
16
+ ### esbuild
17
+
18
+ - Package: `esbuild`
19
+ - Version: `^0.27.0`
20
+ - License: MIT
21
+ - Copyright: Evan Wallace and esbuild contributors
22
+
23
+ ### TypeScript
24
+
25
+ - Package: `typescript`
26
+ - Version: `^5.9.3`
27
+ - License: Apache-2.0
28
+ - Copyright: Microsoft Corp.
29
+
30
+ ## License text
31
+
32
+ Full license text for third-party packages can be found in the corresponding npm package contents or the upstream source repository.
@@ -0,0 +1 @@
1
+ n/a
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@shims/common",
3
+ "version": "1.0.0",
4
+ "description": "Shared utilities for agent shims",
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "exports": {
8
+ ".": "./src/index.ts",
9
+ "./args": "./src/args.ts",
10
+ "./messages": "./src/messages.ts",
11
+ "./tools": "./src/tools.ts",
12
+ "./sessions": "./src/sessions.ts",
13
+ "./timeout": "./src/timeout.ts"
14
+ },
15
+ "scripts": {
16
+ "test": "bun test",
17
+ "typecheck": "tsc --noEmit",
18
+ "clean": "echo 'No build artifacts to clean'"
19
+ },
20
+ "devDependencies": {
21
+ "@types/bun": "latest",
22
+ "typescript": "^5.3.0"
23
+ }
24
+ }