@gamaze/hicortex 0.7.1 → 0.10.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.
Files changed (49) hide show
  1. package/README.md +57 -39
  2. package/dist/claude-md.d.ts +9 -21
  3. package/dist/claude-md.js +9 -241
  4. package/dist/cli.d.ts +3 -2
  5. package/dist/cli.js +29 -11
  6. package/dist/consolidate.js +0 -7
  7. package/dist/db.js +24 -0
  8. package/dist/embedder.d.ts +11 -0
  9. package/dist/embedder.js +27 -0
  10. package/dist/extensions.d.ts +41 -88
  11. package/dist/extensions.js +36 -61
  12. package/dist/features.d.ts +21 -25
  13. package/dist/features.js +47 -83
  14. package/dist/hermes-transcript-reader.d.ts +27 -0
  15. package/dist/hermes-transcript-reader.js +134 -0
  16. package/dist/index.d.ts +16 -4
  17. package/dist/index.js +252 -344
  18. package/dist/init.d.ts +41 -1
  19. package/dist/init.js +545 -190
  20. package/dist/lesson-selection.d.ts +62 -0
  21. package/dist/lesson-selection.js +159 -0
  22. package/dist/lessons-context.d.ts +17 -0
  23. package/dist/lessons-context.js +96 -0
  24. package/dist/llm.d.ts +42 -29
  25. package/dist/llm.js +89 -270
  26. package/dist/mcp-server.d.ts +0 -1
  27. package/dist/mcp-server.js +404 -86
  28. package/dist/nightly.d.ts +9 -6
  29. package/dist/nightly.js +197 -357
  30. package/dist/oc-transcript-reader.d.ts +20 -0
  31. package/dist/oc-transcript-reader.js +61 -0
  32. package/dist/pi-transcript-reader.d.ts +1 -0
  33. package/dist/status.js +22 -2
  34. package/dist/storage.d.ts +7 -1
  35. package/dist/storage.js +28 -7
  36. package/dist/transcript-reader.d.ts +19 -0
  37. package/dist/transcript-reader.js +17 -3
  38. package/dist/types.d.ts +10 -0
  39. package/dist/uninstall.js +31 -1
  40. package/hermes-plugin/hicortex/README.md +77 -0
  41. package/hermes-plugin/hicortex/__init__.py +17 -0
  42. package/hermes-plugin/hicortex/client.py +162 -0
  43. package/hermes-plugin/hicortex/config.py +105 -0
  44. package/hermes-plugin/hicortex/plugin.yaml +12 -0
  45. package/hermes-plugin/hicortex/provider.py +432 -0
  46. package/openclaw.plugin.json +17 -44
  47. package/package.json +7 -5
  48. package/dist/pro-loader.d.ts +0 -33
  49. package/dist/pro-loader.js +0 -187
package/dist/init.d.ts CHANGED
@@ -11,9 +11,49 @@
11
11
  * Actions:
12
12
  * - Install persistent daemon (launchd/systemd)
13
13
  * - Register MCP server in CC settings
14
- * - Inject CLAUDE.md learnings block
14
+ * - Install CC SessionStart hook for query-time lessons
15
+ * - Strip old static CLAUDE.md learnings block if present
15
16
  * - Install CC custom commands (/learn, /hicortex-activate)
16
17
  */
18
+ /**
19
+ * Parse a KEY=VALUE env file (e.g. ~/.hermes/.env or ~/.claude/settings.json env block).
20
+ * Handles: comments (#), quoted values, empty lines.
21
+ * Exported for testability.
22
+ */
23
+ export declare function parseEnvFile(content: string): Record<string, string>;
24
+ /**
25
+ * Generate a random auth token in the format hctx-<32 hex chars>.
26
+ * Exported for testability.
27
+ */
28
+ export declare function generateAuthToken(): string;
29
+ /**
30
+ * Ensure a server-mode auth token exists in config.json.
31
+ * Generates and saves one if absent. Never overwrites an existing token.
32
+ * Returns the token (existing or newly generated).
33
+ * Exported for testability.
34
+ */
35
+ export declare function persistAuthToken(configPath: string): {
36
+ token: string;
37
+ generated: boolean;
38
+ };
39
+ /**
40
+ * Install (or verify) the CC SessionStart hook that runs `hicortex lessons-context`.
41
+ * The hook fetches lessons from the configured server at session start and injects
42
+ * them as context — replacing the old static CLAUDE.md block.
43
+ *
44
+ * Idempotent: skips if a SessionStart hook containing "lessons-context" already exists.
45
+ * Uses JSON.parse/JSON.stringify to safely merge into ~/.claude/settings.json.
46
+ *
47
+ * @param settingsPath Override for the settings.json path (used in tests; defaults to CC_SETTINGS).
48
+ */
49
+ export declare function installSessionStartHook(settingsPath?: string): void;
17
50
  export declare function runInit(options?: {
18
51
  serverUrl?: string;
19
52
  }): Promise<void>;
53
+ /**
54
+ * Resolve the nightly hour (0–23, local time) for the generated schedule.
55
+ * Priority: `nightlyHour` in ~/.hicortex/config.json → mode default.
56
+ * Defaults: client 02:00, server 03:00 — staggered so that in mixed fleets
57
+ * clients push their sessions before the server's capture + consolidation run.
58
+ */
59
+ export declare function resolveNightlyHour(mode: "server" | "client", configDir?: string): number;