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,15 @@
1
+ /**
2
+ * Public type exports for external consumers (e.g., hw-tracing).
3
+ *
4
+ * Exports TypeScript types for:
5
+ * - State management (state.json)
6
+ * - Codon execution states
7
+ * - Hank configuration
8
+ * - Execution planning
9
+ * - Branded types
10
+ */
11
+ export type { ExecutionCodonEntry } from "../execution-planner.js";
12
+ export { CodonId, EventId, RunId, SessionId } from "../types/branded-types.js";
13
+ export type { CodonExecution, CodonStatus, CompletedCodon, CompletingSentinelsCodon, FailedCodon, FailureReason, HankweaveState, InitializingCodon, PreparingCodon, Run, RunningCodon, SentinelState, SkippedCodon, StartingCodon, StartingConditions, TokenUsage, } from "../types/state-types.js";
14
+ export { getCodonCost, getCodonTokens, isTerminalCodonStatus, } from "../types/state-types.js";
15
+ export type { Codon, CodonConfig, HankFile, HankMeta, HankweaveConfig, Loop, RigSetupItem, RigShellCommand, } from "../types/types.js";
@@ -0,0 +1,60 @@
1
+ // server/types/branded-types.ts
2
+ var CodonId = (id) => id;
3
+ var SessionId = (id) => id;
4
+ var RunId = (id) => id;
5
+ var EventId = (id) => id;
6
+ // server/types/state-types.ts
7
+ function isTerminalCodonStatus(status) {
8
+ return status === "completed" || status === "failed" || status === "skipped";
9
+ }
10
+ function getCodonCost(codon) {
11
+ switch (codon.status) {
12
+ case "completed":
13
+ return codon.finalCost;
14
+ case "failed":
15
+ return codon.partialCost;
16
+ case "skipped":
17
+ return 0;
18
+ case "running":
19
+ return codon.currentCost;
20
+ case "completing-sentinels":
21
+ return codon.currentCost;
22
+ default:
23
+ return 0;
24
+ }
25
+ }
26
+ function getCodonTokens(codon) {
27
+ switch (codon.status) {
28
+ case "completed":
29
+ return codon.finalTokens;
30
+ case "failed":
31
+ return codon.partialTokens;
32
+ case "skipped":
33
+ return {
34
+ inputTokens: 0,
35
+ outputTokens: 0,
36
+ cacheCreationTokens: 0,
37
+ cacheReadTokens: 0
38
+ };
39
+ case "running":
40
+ return codon.currentTokens;
41
+ case "completing-sentinels":
42
+ return codon.currentTokens;
43
+ default:
44
+ return {
45
+ inputTokens: 0,
46
+ outputTokens: 0,
47
+ cacheCreationTokens: 0,
48
+ cacheReadTokens: 0
49
+ };
50
+ }
51
+ }
52
+ export {
53
+ isTerminalCodonStatus,
54
+ getCodonTokens,
55
+ getCodonCost,
56
+ SessionId,
57
+ RunId,
58
+ EventId,
59
+ CodonId
60
+ };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Unified file resolver that applies gitignore rules consistently
3
+ * across watching, checkpointing, and cleanup systems.
4
+ */
5
+ export declare class UnifiedFileResolver {
6
+ private ignoreCache;
7
+ /**
8
+ * Resolve files matching the given patterns while respecting gitignore rules.
9
+ *
10
+ * @param projectPath - The root directory to search from
11
+ * @param patterns - Array of glob patterns to match
12
+ * @returns Array of resolved file paths relative to projectPath
13
+ */
14
+ resolveFiles(projectPath: string, patterns: string[]): Promise<string[]>;
15
+ /**
16
+ * Get combined ignore rules for a project by parsing all .gitignore files.
17
+ * Results are cached per project path.
18
+ */
19
+ private getIgnoreRules;
20
+ /**
21
+ * Find all .gitignore files in the project directory tree.
22
+ */
23
+ private findGitignoreFiles;
24
+ /**
25
+ * Parse a .gitignore file and return its rules.
26
+ */
27
+ private parseGitignoreFile;
28
+ /**
29
+ * Clear the ignore cache for a specific project or all projects.
30
+ */
31
+ clearCache(projectPath?: string): void;
32
+ }
33
+ export declare const fileResolver: UnifiedFileResolver;