@ekkos/cli 0.2.8 → 0.2.10

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 (36) hide show
  1. package/dist/cache/LocalSessionStore.d.ts +34 -21
  2. package/dist/cache/LocalSessionStore.js +169 -53
  3. package/dist/cache/capture.d.ts +19 -11
  4. package/dist/cache/capture.js +243 -76
  5. package/dist/cache/types.d.ts +14 -1
  6. package/dist/commands/doctor.d.ts +10 -0
  7. package/dist/commands/doctor.js +148 -73
  8. package/dist/commands/hooks.d.ts +109 -0
  9. package/dist/commands/hooks.js +668 -0
  10. package/dist/commands/run.d.ts +1 -0
  11. package/dist/commands/run.js +69 -21
  12. package/dist/index.js +42 -1
  13. package/dist/restore/RestoreOrchestrator.d.ts +17 -3
  14. package/dist/restore/RestoreOrchestrator.js +64 -22
  15. package/dist/utils/paths.d.ts +125 -0
  16. package/dist/utils/paths.js +283 -0
  17. package/dist/utils/session-words.json +30 -111
  18. package/package.json +1 -1
  19. package/templates/ekkos-manifest.json +223 -0
  20. package/templates/helpers/json-parse.cjs +101 -0
  21. package/templates/hooks/assistant-response.ps1 +256 -0
  22. package/templates/hooks/assistant-response.sh +124 -64
  23. package/templates/hooks/session-start.ps1 +107 -2
  24. package/templates/hooks/session-start.sh +201 -166
  25. package/templates/hooks/stop.ps1 +124 -3
  26. package/templates/hooks/stop.sh +470 -843
  27. package/templates/hooks/user-prompt-submit.ps1 +107 -22
  28. package/templates/hooks/user-prompt-submit.sh +403 -393
  29. package/templates/project-stubs/session-start.ps1 +63 -0
  30. package/templates/project-stubs/session-start.sh +55 -0
  31. package/templates/project-stubs/stop.ps1 +63 -0
  32. package/templates/project-stubs/stop.sh +55 -0
  33. package/templates/project-stubs/user-prompt-submit.ps1 +63 -0
  34. package/templates/project-stubs/user-prompt-submit.sh +55 -0
  35. package/templates/shared/hooks-enabled.json +22 -0
  36. package/templates/shared/session-words.json +45 -0
@@ -0,0 +1,63 @@
1
+ # ═══════════════════════════════════════════════════════════════════════════
2
+ # ekkOS Project Hook Stub: session-start.ps1
3
+ # EKKOS_MANAGED=1
4
+ # EKKOS_MANIFEST_SHA256=project-stub-v1
5
+ # EKKOS_TEMPLATE_VERSION=1.0.0
6
+ #
7
+ # This is a DELEGATING STUB that:
8
+ # 1. Executes the global hook first
9
+ # 2. Then loads project-specific overrides if present
10
+ #
11
+ # Do not modify this file directly. Customizations go in:
12
+ # <project>\.ekkos\hooks.local.ps1
13
+ # ═══════════════════════════════════════════════════════════════════════════
14
+
15
+ $ErrorActionPreference = 'Stop'
16
+
17
+ # ═══════════════════════════════════════════════════════════════════════════
18
+ # RESOLVE PATHS
19
+ # ═══════════════════════════════════════════════════════════════════════════
20
+
21
+ # Get absolute path to this stub
22
+ $StubPath = $PSScriptRoot
23
+ $StubFile = $MyInvocation.MyCommand.Path
24
+
25
+ # Project root is two levels up from .claude\hooks\
26
+ $ProjectRoot = (Get-Item "$StubPath\..\..").FullName
27
+
28
+ # Global hooks directory
29
+ $GlobalHooksDir = Join-Path $env:USERPROFILE ".claude\hooks"
30
+
31
+ # Global hook path
32
+ $GlobalHook = Join-Path $GlobalHooksDir "session-start.ps1"
33
+
34
+ # Project override file
35
+ $ProjectOverride = Join-Path $ProjectRoot ".ekkos\hooks.local.ps1"
36
+
37
+ # ═══════════════════════════════════════════════════════════════════════════
38
+ # EXECUTE GLOBAL HOOK
39
+ # ═══════════════════════════════════════════════════════════════════════════
40
+
41
+ if (Test-Path $GlobalHook) {
42
+ try {
43
+ # Dot-source the global hook (inherits all env vars and args)
44
+ . $GlobalHook
45
+ } catch {
46
+ Write-Error "[ekkOS] Error executing global hook: $_"
47
+ }
48
+ } else {
49
+ Write-Warning "[ekkOS] Global hook not found: $GlobalHook"
50
+ }
51
+
52
+ # ═══════════════════════════════════════════════════════════════════════════
53
+ # LOAD PROJECT OVERRIDES (optional)
54
+ # ═══════════════════════════════════════════════════════════════════════════
55
+
56
+ if (Test-Path $ProjectOverride) {
57
+ try {
58
+ # Dot-source project-specific customizations
59
+ . $ProjectOverride
60
+ } catch {
61
+ Write-Warning "[ekkOS] Error loading project override: $_"
62
+ }
63
+ }
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env bash
2
+ # ═══════════════════════════════════════════════════════════════════════════
3
+ # ekkOS Project Hook Stub: session-start.sh
4
+ # EKKOS_MANAGED=1
5
+ # EKKOS_MANIFEST_SHA256=project-stub-v1
6
+ # EKKOS_TEMPLATE_VERSION=1.0.0
7
+ #
8
+ # This is a DELEGATING STUB that:
9
+ # 1. Executes the global hook first
10
+ # 2. Then loads project-specific overrides if present
11
+ #
12
+ # Do not modify this file directly. Customizations go in:
13
+ # <project>/.ekkos/hooks.local.sh
14
+ # ═══════════════════════════════════════════════════════════════════════════
15
+ set -euo pipefail
16
+
17
+ # ═══════════════════════════════════════════════════════════════════════════
18
+ # RESOLVE PATHS
19
+ # ═══════════════════════════════════════════════════════════════════════════
20
+
21
+ # Get absolute path to this stub
22
+ STUB_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")"
23
+
24
+ # Project root is two levels up from .claude/hooks/
25
+ PROJECT_ROOT="$(cd "$(dirname "$STUB_PATH")/../.." && pwd)"
26
+
27
+ # Global hooks directory
28
+ GLOBAL_HOOKS_DIR="$HOME/.claude/hooks"
29
+
30
+ # Global hook path
31
+ GLOBAL_HOOK="$GLOBAL_HOOKS_DIR/session-start.sh"
32
+
33
+ # Project override file
34
+ PROJECT_OVERRIDE="$PROJECT_ROOT/.ekkos/hooks.local.sh"
35
+
36
+ # ═══════════════════════════════════════════════════════════════════════════
37
+ # EXECUTE GLOBAL HOOK
38
+ # ═══════════════════════════════════════════════════════════════════════════
39
+
40
+ if [ -f "$GLOBAL_HOOK" ] && [ -x "$GLOBAL_HOOK" ]; then
41
+ # Source the global hook (inherits all env vars and args)
42
+ source "$GLOBAL_HOOK"
43
+ else
44
+ echo "[ekkOS] Warning: Global hook not found: $GLOBAL_HOOK" >&2
45
+ fi
46
+
47
+ # ═══════════════════════════════════════════════════════════════════════════
48
+ # LOAD PROJECT OVERRIDES (optional)
49
+ # ═══════════════════════════════════════════════════════════════════════════
50
+
51
+ if [ -f "$PROJECT_OVERRIDE" ]; then
52
+ # Source project-specific customizations
53
+ # These can override functions or add project-specific behavior
54
+ source "$PROJECT_OVERRIDE"
55
+ fi
@@ -0,0 +1,63 @@
1
+ # ═══════════════════════════════════════════════════════════════════════════
2
+ # ekkOS Project Hook Stub: stop.ps1
3
+ # EKKOS_MANAGED=1
4
+ # EKKOS_MANIFEST_SHA256=project-stub-v1
5
+ # EKKOS_TEMPLATE_VERSION=1.0.0
6
+ #
7
+ # This is a DELEGATING STUB that:
8
+ # 1. Executes the global hook first
9
+ # 2. Then loads project-specific overrides if present
10
+ #
11
+ # Do not modify this file directly. Customizations go in:
12
+ # <project>\.ekkos\hooks.local.ps1
13
+ # ═══════════════════════════════════════════════════════════════════════════
14
+
15
+ $ErrorActionPreference = 'Stop'
16
+
17
+ # ═══════════════════════════════════════════════════════════════════════════
18
+ # RESOLVE PATHS
19
+ # ═══════════════════════════════════════════════════════════════════════════
20
+
21
+ # Get absolute path to this stub
22
+ $StubPath = $PSScriptRoot
23
+ $StubFile = $MyInvocation.MyCommand.Path
24
+
25
+ # Project root is two levels up from .claude\hooks\
26
+ $ProjectRoot = (Get-Item "$StubPath\..\..").FullName
27
+
28
+ # Global hooks directory
29
+ $GlobalHooksDir = Join-Path $env:USERPROFILE ".claude\hooks"
30
+
31
+ # Global hook path
32
+ $GlobalHook = Join-Path $GlobalHooksDir "stop.ps1"
33
+
34
+ # Project override file
35
+ $ProjectOverride = Join-Path $ProjectRoot ".ekkos\hooks.local.ps1"
36
+
37
+ # ═══════════════════════════════════════════════════════════════════════════
38
+ # EXECUTE GLOBAL HOOK
39
+ # ═══════════════════════════════════════════════════════════════════════════
40
+
41
+ if (Test-Path $GlobalHook) {
42
+ try {
43
+ # Dot-source the global hook (inherits all env vars and args)
44
+ . $GlobalHook
45
+ } catch {
46
+ Write-Error "[ekkOS] Error executing global hook: $_"
47
+ }
48
+ } else {
49
+ Write-Warning "[ekkOS] Global hook not found: $GlobalHook"
50
+ }
51
+
52
+ # ═══════════════════════════════════════════════════════════════════════════
53
+ # LOAD PROJECT OVERRIDES (optional)
54
+ # ═══════════════════════════════════════════════════════════════════════════
55
+
56
+ if (Test-Path $ProjectOverride) {
57
+ try {
58
+ # Dot-source project-specific customizations
59
+ . $ProjectOverride
60
+ } catch {
61
+ Write-Warning "[ekkOS] Error loading project override: $_"
62
+ }
63
+ }
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env bash
2
+ # ═══════════════════════════════════════════════════════════════════════════
3
+ # ekkOS Project Hook Stub: stop.sh
4
+ # EKKOS_MANAGED=1
5
+ # EKKOS_MANIFEST_SHA256=project-stub-v1
6
+ # EKKOS_TEMPLATE_VERSION=1.0.0
7
+ #
8
+ # This is a DELEGATING STUB that:
9
+ # 1. Executes the global hook first
10
+ # 2. Then loads project-specific overrides if present
11
+ #
12
+ # Do not modify this file directly. Customizations go in:
13
+ # <project>/.ekkos/hooks.local.sh
14
+ # ═══════════════════════════════════════════════════════════════════════════
15
+ set -euo pipefail
16
+
17
+ # ═══════════════════════════════════════════════════════════════════════════
18
+ # RESOLVE PATHS
19
+ # ═══════════════════════════════════════════════════════════════════════════
20
+
21
+ # Get absolute path to this stub
22
+ STUB_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")"
23
+
24
+ # Project root is two levels up from .claude/hooks/
25
+ PROJECT_ROOT="$(cd "$(dirname "$STUB_PATH")/../.." && pwd)"
26
+
27
+ # Global hooks directory
28
+ GLOBAL_HOOKS_DIR="$HOME/.claude/hooks"
29
+
30
+ # Global hook path
31
+ GLOBAL_HOOK="$GLOBAL_HOOKS_DIR/stop.sh"
32
+
33
+ # Project override file
34
+ PROJECT_OVERRIDE="$PROJECT_ROOT/.ekkos/hooks.local.sh"
35
+
36
+ # ═══════════════════════════════════════════════════════════════════════════
37
+ # EXECUTE GLOBAL HOOK
38
+ # ═══════════════════════════════════════════════════════════════════════════
39
+
40
+ if [ -f "$GLOBAL_HOOK" ] && [ -x "$GLOBAL_HOOK" ]; then
41
+ # Source the global hook (inherits all env vars and args)
42
+ source "$GLOBAL_HOOK"
43
+ else
44
+ echo "[ekkOS] Warning: Global hook not found: $GLOBAL_HOOK" >&2
45
+ fi
46
+
47
+ # ═══════════════════════════════════════════════════════════════════════════
48
+ # LOAD PROJECT OVERRIDES (optional)
49
+ # ═══════════════════════════════════════════════════════════════════════════
50
+
51
+ if [ -f "$PROJECT_OVERRIDE" ]; then
52
+ # Source project-specific customizations
53
+ # These can override functions or add project-specific behavior
54
+ source "$PROJECT_OVERRIDE"
55
+ fi
@@ -0,0 +1,63 @@
1
+ # ═══════════════════════════════════════════════════════════════════════════
2
+ # ekkOS Project Hook Stub: user-prompt-submit.ps1
3
+ # EKKOS_MANAGED=1
4
+ # EKKOS_MANIFEST_SHA256=project-stub-v1
5
+ # EKKOS_TEMPLATE_VERSION=1.0.0
6
+ #
7
+ # This is a DELEGATING STUB that:
8
+ # 1. Executes the global hook first
9
+ # 2. Then loads project-specific overrides if present
10
+ #
11
+ # Do not modify this file directly. Customizations go in:
12
+ # <project>\.ekkos\hooks.local.ps1
13
+ # ═══════════════════════════════════════════════════════════════════════════
14
+
15
+ $ErrorActionPreference = 'Stop'
16
+
17
+ # ═══════════════════════════════════════════════════════════════════════════
18
+ # RESOLVE PATHS
19
+ # ═══════════════════════════════════════════════════════════════════════════
20
+
21
+ # Get absolute path to this stub
22
+ $StubPath = $PSScriptRoot
23
+ $StubFile = $MyInvocation.MyCommand.Path
24
+
25
+ # Project root is two levels up from .claude\hooks\
26
+ $ProjectRoot = (Get-Item "$StubPath\..\..").FullName
27
+
28
+ # Global hooks directory
29
+ $GlobalHooksDir = Join-Path $env:USERPROFILE ".claude\hooks"
30
+
31
+ # Global hook path
32
+ $GlobalHook = Join-Path $GlobalHooksDir "user-prompt-submit.ps1"
33
+
34
+ # Project override file
35
+ $ProjectOverride = Join-Path $ProjectRoot ".ekkos\hooks.local.ps1"
36
+
37
+ # ═══════════════════════════════════════════════════════════════════════════
38
+ # EXECUTE GLOBAL HOOK
39
+ # ═══════════════════════════════════════════════════════════════════════════
40
+
41
+ if (Test-Path $GlobalHook) {
42
+ try {
43
+ # Dot-source the global hook (inherits all env vars and args)
44
+ . $GlobalHook
45
+ } catch {
46
+ Write-Error "[ekkOS] Error executing global hook: $_"
47
+ }
48
+ } else {
49
+ Write-Warning "[ekkOS] Global hook not found: $GlobalHook"
50
+ }
51
+
52
+ # ═══════════════════════════════════════════════════════════════════════════
53
+ # LOAD PROJECT OVERRIDES (optional)
54
+ # ═══════════════════════════════════════════════════════════════════════════
55
+
56
+ if (Test-Path $ProjectOverride) {
57
+ try {
58
+ # Dot-source project-specific customizations
59
+ . $ProjectOverride
60
+ } catch {
61
+ Write-Warning "[ekkOS] Error loading project override: $_"
62
+ }
63
+ }
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env bash
2
+ # ═══════════════════════════════════════════════════════════════════════════
3
+ # ekkOS Project Hook Stub: user-prompt-submit.sh
4
+ # EKKOS_MANAGED=1
5
+ # EKKOS_MANIFEST_SHA256=project-stub-v1
6
+ # EKKOS_TEMPLATE_VERSION=1.0.0
7
+ #
8
+ # This is a DELEGATING STUB that:
9
+ # 1. Executes the global hook first
10
+ # 2. Then loads project-specific overrides if present
11
+ #
12
+ # Do not modify this file directly. Customizations go in:
13
+ # <project>/.ekkos/hooks.local.sh
14
+ # ═══════════════════════════════════════════════════════════════════════════
15
+ set -euo pipefail
16
+
17
+ # ═══════════════════════════════════════════════════════════════════════════
18
+ # RESOLVE PATHS
19
+ # ═══════════════════════════════════════════════════════════════════════════
20
+
21
+ # Get absolute path to this stub
22
+ STUB_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/$(basename "${BASH_SOURCE[0]}")"
23
+
24
+ # Project root is two levels up from .claude/hooks/
25
+ PROJECT_ROOT="$(cd "$(dirname "$STUB_PATH")/../.." && pwd)"
26
+
27
+ # Global hooks directory
28
+ GLOBAL_HOOKS_DIR="$HOME/.claude/hooks"
29
+
30
+ # Global hook path
31
+ GLOBAL_HOOK="$GLOBAL_HOOKS_DIR/user-prompt-submit.sh"
32
+
33
+ # Project override file
34
+ PROJECT_OVERRIDE="$PROJECT_ROOT/.ekkos/hooks.local.sh"
35
+
36
+ # ═══════════════════════════════════════════════════════════════════════════
37
+ # EXECUTE GLOBAL HOOK
38
+ # ═══════════════════════════════════════════════════════════════════════════
39
+
40
+ if [ -f "$GLOBAL_HOOK" ] && [ -x "$GLOBAL_HOOK" ]; then
41
+ # Source the global hook (inherits all env vars and args)
42
+ source "$GLOBAL_HOOK"
43
+ else
44
+ echo "[ekkOS] Warning: Global hook not found: $GLOBAL_HOOK" >&2
45
+ fi
46
+
47
+ # ═══════════════════════════════════════════════════════════════════════════
48
+ # LOAD PROJECT OVERRIDES (optional)
49
+ # ═══════════════════════════════════════════════════════════════════════════
50
+
51
+ if [ -f "$PROJECT_OVERRIDE" ]; then
52
+ # Source project-specific customizations
53
+ # These can override functions or add project-specific behavior
54
+ source "$PROJECT_OVERRIDE"
55
+ fi
@@ -0,0 +1,22 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "updatedAt": "2026-01-18T00:00:00Z",
4
+ "targets": {
5
+ "claude": {
6
+ "user-prompt-submit": true,
7
+ "assistant-response": true,
8
+ "stop": true,
9
+ "session-start": true
10
+ },
11
+ "cursor": {
12
+ "enabled": true
13
+ },
14
+ "windsurf": {
15
+ "enabled": true
16
+ }
17
+ },
18
+ "redaction": {
19
+ "enabled": true,
20
+ "mode": "safe"
21
+ }
22
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "updatedAt": "2026-01-18T00:00:00Z",
4
+ "adjectives": [
5
+ "ace", "big", "blu", "coy", "dex",
6
+ "eco", "fab", "gem", "hex", "ice",
7
+ "jet", "key", "lux", "max", "neo",
8
+ "oak", "pop", "rad", "sky", "top",
9
+ "uno", "vex", "wax", "xen", "zen",
10
+ "hot", "red", "nox", "sol", "vim",
11
+ "ash", "dew", "fog", "glo", "ink",
12
+ "joy", "koi", "lit", "mox", "nix",
13
+ "orb", "pix", "qix", "rox", "sly",
14
+ "tek", "ulu", "vox", "wiz", "zap"
15
+ ],
16
+ "nouns": [
17
+ "ant", "bat", "cat", "dog", "elk",
18
+ "fox", "gnu", "hen", "imp", "jay",
19
+ "kit", "lex", "moo", "nub", "owl",
20
+ "pug", "ram", "sun", "tux", "urn",
21
+ "van", "web", "yak", "zed", "ape",
22
+ "bee", "cod", "doe", "eel", "fin",
23
+ "gup", "hog", "ion", "jab", "keg",
24
+ "log", "mud", "net", "oat", "pod",
25
+ "rye", "sap", "tar", "vat", "wok",
26
+ "box", "cub", "dip", "gem", "hub"
27
+ ],
28
+ "verbs": [
29
+ "ask", "bet", "cut", "dig", "eat",
30
+ "fix", "get", "hit", "jab", "key",
31
+ "let", "mix", "nap", "opt", "pop",
32
+ "run", "set", "tap", "use", "vet",
33
+ "win", "zip", "zap", "add", "bid",
34
+ "dub", "end", "fly", "gig", "hum",
35
+ "jog", "lob", "map", "net", "orb",
36
+ "pay", "rip", "sip", "tag", "vow",
37
+ "wag", "yap", "bow", "cue", "dip",
38
+ "fan", "hop", "jam", "nod", "tug"
39
+ ],
40
+ "rules": {
41
+ "format": "{adj}-{noun}-{verb}",
42
+ "minPerList": 25,
43
+ "maxPerList": 500
44
+ }
45
+ }