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,37 @@
1
+ {
2
+ "name": "gemini-cli-shim",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "bin": {
7
+ "gemini-cli-shim": "./index.js"
8
+ },
9
+ "files": [
10
+ "common",
11
+ "dist",
12
+ "docs",
13
+ "src",
14
+ "tests",
15
+ "index.js",
16
+ "README.md",
17
+ "THIRDPARTY.md",
18
+ "VERSION",
19
+ "rebuild.sh",
20
+ "tsconfig.json"
21
+ ],
22
+ "scripts": {
23
+ "build": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js --banner:js='#!/usr/bin/env node'",
24
+ "test": "bun test",
25
+ "typecheck": "tsc --noEmit",
26
+ "clean": "node -e \"const fs=require('node:fs'); fs.rmSync('dist',{recursive:true,force:true}); fs.rmSync('index.js',{force:true});\""
27
+ },
28
+ "dependencies": {
29
+ "@shims/common": "file:./common"
30
+ },
31
+ "devDependencies": {
32
+ "@types/bun": "latest",
33
+ "@types/node": "^20.19.37",
34
+ "esbuild": "^0.27.0",
35
+ "typescript": "^5.9.3"
36
+ }
37
+ }
@@ -0,0 +1,82 @@
1
+ # opencode-shim
2
+
3
+ A self-contained Hankweave shim package for the OpenCode CLI.
4
+
5
+ This package wraps `opencode run --format json` and translates OpenCode events into the shim JSONL protocol expected by Hankweave and the eval suite.
6
+
7
+ ## What this package contains
8
+
9
+ - `index.js` — drop-in compiled bundle for Hankweave
10
+ - `dist/index.js` — normal build output
11
+ - `src/` — shim source
12
+ - `common/` — vendored `@shims/common`
13
+ - `docs/` — usage, architecture, and validation notes
14
+ - `rebuild.sh` — reinstalls deps, rebuilds, refreshes `VERSION`, and updates `index.js`
15
+
16
+ ## Quick start
17
+
18
+ ```bash
19
+ cd shim
20
+ ./rebuild.sh
21
+
22
+ echo "Say hello" | bun ./index.js --model google/gemini-2.5-flash
23
+ ```
24
+
25
+ ## Requirements
26
+
27
+ - Bun
28
+ - Node.js
29
+ - OpenCode CLI available on PATH, or `OPENCODE_BIN` pointing to the executable
30
+ - Provider auth available to OpenCode, typically via environment variables such as:
31
+ - `GOOGLE_API_KEY`
32
+ - `ANTHROPIC_API_KEY`
33
+ - `OPENAI_API_KEY`
34
+
35
+ ## Common commands
36
+
37
+ ### Rebuild the package
38
+
39
+ ```bash
40
+ ./rebuild.sh
41
+ ```
42
+
43
+ ### Run the shim
44
+
45
+ ```bash
46
+ echo "Summarize this repository" | bun ./index.js --model google/gemini-2.5-flash
47
+ ```
48
+
49
+ ### Run self-test
50
+
51
+ ```bash
52
+ bun ./index.js --self-test
53
+ ```
54
+
55
+ ### Run tests
56
+
57
+ ```bash
58
+ bun test
59
+ bun run typecheck
60
+ ```
61
+
62
+ ## Key behavior
63
+
64
+ - Emits spec-compliant JSONL with `system` first and `result` last
65
+ - Uses OpenCode native sessions by title when `--debug-dir` is not provided
66
+ - Stores shim-managed session mappings only under `<debug-dir>/sessions/` when `--debug-dir` is provided
67
+ - Forces headless permissions via `OPENCODE_CONFIG_CONTENT` without writing `opencode.json` into the workspace
68
+ - Normalizes tool names and emits public `toolu_*` IDs instead of leaking native OpenCode `callID` values
69
+ - Uses adaptive timeouts with a longer busy-step timeout than pre-work idle timeout
70
+ - Requires a terminal OpenCode `step_finish` with `reason: "stop"` before reporting success
71
+ - Includes Gemini/OpenCode retry hardening for empty cached responses and stale-workspace tool paths
72
+ - Accepts `--sandbox`, but OpenCode `run` mode currently has no documented equivalent sandbox flag, so non-`none` values are logged and otherwise ignored
73
+
74
+ ## Documentation
75
+
76
+ - `docs/USAGE.md` — CLI usage and behavior
77
+ - `docs/ARCHITECTURE.md` — code layout and event flow
78
+ - `docs/VALIDATION.md` — test and eval results
79
+
80
+ ## Packaging notes
81
+
82
+ This is a thin subprocess shim. It does **not** bundle the OpenCode CLI itself. The generated `VERSION` file therefore contains `n/a`.
@@ -0,0 +1,32 @@
1
+ # Third-party notices
2
+
3
+ ## Primary SDK dependency
4
+
5
+ This shim is a **thin subprocess wrapper** around the external OpenCode CLI.
6
+
7
+ - Primary bundled SDK dependency: **none**
8
+ - `VERSION`: `n/a`
9
+
10
+ The compiled `index.js` bundle does **not** embed the OpenCode CLI itself. OpenCode must be installed separately and discovered at runtime via PATH or `OPENCODE_BIN`.
11
+
12
+ ## Bundled vendored dependency
13
+
14
+ ### `@shims/common`
15
+
16
+ - Package: `@shims/common`
17
+ - Version: `1.0.0`
18
+ - Source: vendored from the local Hankweave shims workspace into `./common`
19
+ - License metadata: not declared in `common/package.json`
20
+ - Notes: this is a project-local shared utility package used for argument parsing, timeout handling, message typing, and session helpers
21
+
22
+ ## External runtime dependency
23
+
24
+ ### OpenCode CLI
25
+
26
+ - Package/runtime: `opencode`
27
+ - Bundled in `index.js`: **no**
28
+ - License: see the OpenCode npm package and/or source repository
29
+
30
+ ## Full license texts
31
+
32
+ For third-party components, consult the package metadata and source repositories distributed with those dependencies. For OpenCode specifically, use the license text published in the upstream package or repository because the CLI is not bundled into this shim package.
@@ -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
+ }