superpowers-manager 0.2.0 → 0.4.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 (68) hide show
  1. package/README.md +340 -66
  2. package/dist/adapter-result.js +204 -0
  3. package/dist/adapter.js +690 -0
  4. package/dist/atomic.js +142 -0
  5. package/dist/cli-arguments.js +32 -0
  6. package/dist/cli.js +313 -0
  7. package/dist/codex-harness.js +271 -0
  8. package/dist/codex-json.js +89 -0
  9. package/dist/codex-prepare.js +199 -0
  10. package/dist/codex-presentation.js +259 -0
  11. package/dist/codex-state.js +78 -0
  12. package/dist/commands/context.js +1 -0
  13. package/dist/commands/install.js +291 -0
  14. package/dist/commands/pin.js +79 -0
  15. package/dist/commands/prepare.js +420 -0
  16. package/dist/commands/probe.js +257 -0
  17. package/dist/commands/track-latest.js +44 -0
  18. package/dist/commands/uninstall.js +217 -0
  19. package/dist/commands/unpin.js +95 -0
  20. package/dist/commands/update.js +79 -0
  21. package/dist/domain/fingerprint.js +4 -0
  22. package/dist/domain/refs.js +37 -0
  23. package/dist/effective-selection.js +123 -0
  24. package/dist/generated-plugin.js +748 -0
  25. package/dist/git.js +38 -0
  26. package/dist/harness.js +1 -0
  27. package/dist/hooks.js +290 -0
  28. package/dist/lifecycle.js +135 -0
  29. package/dist/manifest-overlay.js +125 -0
  30. package/dist/provenance.js +111 -0
  31. package/dist/python-json-format.js +83 -0
  32. package/dist/python-json.js +29 -0
  33. package/dist/python-text.js +74 -0
  34. package/dist/safe-path.js +137 -0
  35. package/dist/safety-error.js +10 -0
  36. package/dist/selection-state-cli.js +85 -0
  37. package/dist/selection-store.js +172 -0
  38. package/dist/selection.js +200 -0
  39. package/dist/status.js +24 -0
  40. package/dist/strict-json.js +248 -0
  41. package/dist/upstream-cli.js +110 -0
  42. package/dist/upstream-version.js +40 -0
  43. package/dist/upstream.js +253 -0
  44. package/dist/validate-generated-plugin-cli.js +118 -0
  45. package/dist/validator.js +317 -0
  46. package/dist/workspace.js +139 -0
  47. package/package.json +25 -4
  48. package/bin/superpowers-manager.js +0 -290
  49. package/scripts/adapters/codex/adapter +0 -603
  50. package/scripts/adapters/codex/lib.sh +0 -449
  51. package/scripts/adapters/codex/validate-generated-plugin.py +0 -314
  52. package/scripts/core/adapter.sh +0 -103
  53. package/scripts/core/common.sh +0 -59
  54. package/scripts/core/lifecycle.sh +0 -141
  55. package/scripts/core/provenance.sh +0 -135
  56. package/scripts/core/selection-state.py +0 -414
  57. package/scripts/core/selection.sh +0 -168
  58. package/scripts/core/status.sh +0 -27
  59. package/scripts/core/upstream.sh +0 -280
  60. package/scripts/core/validate-adapter-response.py +0 -284
  61. package/scripts/install +0 -59
  62. package/scripts/pin +0 -51
  63. package/scripts/prepare +0 -117
  64. package/scripts/probe +0 -82
  65. package/scripts/track-latest +0 -30
  66. package/scripts/uninstall +0 -35
  67. package/scripts/unpin +0 -41
  68. package/scripts/update +0 -34
package/scripts/unpin DELETED
@@ -1,41 +0,0 @@
1
- #!/bin/sh
2
- set -eu
3
-
4
- root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
5
- . "$root/scripts/core/common.sh"
6
- . "$root/scripts/core/upstream.sh"
7
- . "$root/scripts/core/selection.sh"
8
-
9
- [ "$#" -eq 0 ] || spw_usage_error 'usage: superpowers-manager unpin'
10
-
11
- state_path=$(spw_selection_state_path)
12
- fallback=$(SUPERPOWERS_REF= spw_config_ref "$root")
13
- removed=false
14
-
15
- if [ -L "$state_path" ]; then
16
- spw_die "selection state path is not a regular file; remove it manually after inspecting: $state_path"
17
- elif [ -e "$state_path" ]; then
18
- if [ ! -f "$state_path" ]; then
19
- spw_die "selection state path is not a regular file; remove it manually after inspecting: $state_path"
20
- fi
21
- if ! rm -f "$state_path"; then
22
- spw_die "cannot remove selection state: $state_path"
23
- fi
24
- removed=true
25
- fi
26
-
27
- if [ -e "$state_path" ] || [ -L "$state_path" ]; then
28
- spw_die "selection state remains after removal attempt: $state_path"
29
- fi
30
-
31
- if [ "$removed" = true ]; then
32
- printf 'removed saved upstream selection; packaged fallback is %s\n' "$fallback"
33
- else
34
- printf 'no saved upstream selection; packaged fallback is %s\n' "$fallback"
35
- fi
36
- if [ -n "${SUPERPOWERS_REF:-}" ]; then
37
- printf '%s\n' 'note: active SUPERPOWERS_REF override remains effective'
38
- fi
39
- if [ -n "${SUPERPOWERS_UPSTREAM_URL:-}" ]; then
40
- printf '%s\n' 'note: active SUPERPOWERS_UPSTREAM_URL override remains effective'
41
- fi
package/scripts/update DELETED
@@ -1,34 +0,0 @@
1
- #!/bin/sh
2
- set -eu
3
-
4
- root=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd)
5
- . "$root/scripts/core/common.sh"
6
- . "$root/scripts/core/lifecycle.sh"
7
-
8
- probe_output=$(sh "$root/scripts/probe" --porcelain)
9
- identity_state=$(spw_probe_field "$probe_output" identity_state)
10
- [ -n "$identity_state" ] || spw_die "probe did not report adapter identity state"
11
- spw_require_no_legacy_state "$identity_state"
12
- status=$(spw_probe_field "$probe_output" status)
13
- update_control=$(spw_probe_field "$probe_output" update_control)
14
- [ -n "$update_control" ] || spw_die "probe did not report adapter update-control capability"
15
-
16
- case "$status" in
17
- current)
18
- spw_require_managed_update_control "$update_control"
19
- printf '%s\n' "$probe_output"
20
- echo "manager is current"
21
- ;;
22
- needs\ prepare)
23
- sh "$root/scripts/prepare"
24
- sh "$root/scripts/install"
25
- ;;
26
- needs\ install)
27
- sh "$root/scripts/install"
28
- ;;
29
- *)
30
- echo "$probe_output"
31
- echo "error: unknown probe status: $status" >&2
32
- exit 1
33
- ;;
34
- esac