noonsight 0.0.1 → 0.1.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 (114) hide show
  1. package/.claude-plugin/marketplace.json +19 -0
  2. package/.claude-plugin/plugin.json +14 -0
  3. package/README.md +271 -9
  4. package/dist/src/adapters/claude-code/classifier.js +138 -0
  5. package/dist/src/adapters/claude-code/code-edit.js +108 -0
  6. package/dist/src/adapters/claude-code/compat.js +31 -0
  7. package/dist/src/adapters/claude-code/definitions.js +347 -0
  8. package/dist/src/adapters/claude-code/fork.js +132 -0
  9. package/dist/src/adapters/claude-code/hook.js +652 -0
  10. package/dist/src/adapters/claude-code/install.js +186 -0
  11. package/dist/src/adapters/claude-code/launch.js +270 -0
  12. package/dist/src/adapters/claude-code/launcher.js +252 -0
  13. package/dist/src/adapters/claude-code/locations.js +115 -0
  14. package/dist/src/adapters/claude-code/managed.js +75 -0
  15. package/dist/src/adapters/claude-code/plugin-files.js +88 -0
  16. package/dist/src/adapters/claude-code/plugins.js +117 -0
  17. package/dist/src/adapters/claude-code/pointer.js +48 -0
  18. package/dist/src/adapters/claude-code/predict.js +271 -0
  19. package/dist/src/adapters/claude-code/routing.js +88 -0
  20. package/dist/src/adapters/claude-code/settings.js +189 -0
  21. package/dist/src/adapters/claude-code/subagents.js +666 -0
  22. package/dist/src/adapters/claude-code/triggers.js +88 -0
  23. package/dist/src/cli.js +157 -0
  24. package/dist/src/commands/accept.js +115 -0
  25. package/dist/src/commands/check.js +529 -0
  26. package/dist/src/commands/hook.js +73 -0
  27. package/dist/src/commands/init.js +29 -0
  28. package/dist/src/commands/install.js +370 -0
  29. package/dist/src/commands/models.js +213 -0
  30. package/dist/src/commands/receives.js +84 -0
  31. package/dist/src/commands/report.js +386 -0
  32. package/dist/src/commands/resolve.js +32 -0
  33. package/dist/src/commands/run.js +168 -0
  34. package/dist/src/commands/trust.js +70 -0
  35. package/dist/src/commands/usage.js +10 -0
  36. package/dist/src/commands/watch.js +154 -0
  37. package/dist/src/config/create.js +51 -0
  38. package/dist/src/config/json-schema.js +207 -0
  39. package/dist/src/config/load.js +758 -0
  40. package/dist/src/config/paths.js +42 -0
  41. package/dist/src/config/preset-changes.js +190 -0
  42. package/dist/src/config/project.js +354 -0
  43. package/dist/src/config/rewrite.js +112 -0
  44. package/dist/src/core/backtracking.js +330 -0
  45. package/dist/src/core/classify.js +66 -0
  46. package/dist/src/core/normalize.js +24 -0
  47. package/dist/src/core/overlap.js +39 -0
  48. package/dist/src/core/regex-sample.js +278 -0
  49. package/dist/src/core/resolve.js +201 -0
  50. package/dist/src/core/route.js +93 -0
  51. package/dist/src/core/scope.js +77 -0
  52. package/dist/src/core/triggers.js +30 -0
  53. package/dist/src/core/types.js +74 -0
  54. package/dist/src/state/agents.js +200 -0
  55. package/dist/src/state/claims.js +80 -0
  56. package/dist/src/state/files.js +84 -0
  57. package/dist/src/state/installs.js +29 -0
  58. package/dist/src/state/log.js +90 -0
  59. package/dist/src/state/node.js +35 -0
  60. package/dist/src/state/sessions.js +109 -0
  61. package/dist/src/state/triggers.js +57 -0
  62. package/dist/src/version.js +24 -0
  63. package/dist/src/watch/service.js +172 -0
  64. package/dist/src/watch/watcher.js +130 -0
  65. package/dist/src/wording.js +11 -0
  66. package/hooks/hooks.json +118 -0
  67. package/package.json +57 -7
  68. package/presets/claude/SOURCES.md +485 -0
  69. package/presets/claude/preset.json +432 -0
  70. package/presets/claude/rules/fable-5-2/code-ownership.md +1 -0
  71. package/presets/claude/rules/fable-5-2/finish-work.md +1 -0
  72. package/presets/claude/rules/fable-5-2/low-context-report.md +1 -0
  73. package/presets/claude/rules/fable-5-2/progress-updates.md +1 -0
  74. package/presets/claude/rules/haiku-5-5/carry-through.md +1 -0
  75. package/presets/claude/rules/haiku-5-5/search-recent-facts.md +1 -0
  76. package/presets/claude/rules/haiku-5-5/verify-changes.md +1 -0
  77. package/presets/claude/rules/opus-5-5/explore-before-acting.md +1 -0
  78. package/presets/claude/rules/opus-5-5/progress-updates.md +1 -0
  79. package/presets/claude/rules/opus-5-5/unattended-run.md +1 -0
  80. package/presets/claude/rules/sonnet-5-5/carry-through.md +1 -0
  81. package/presets/claude/rules/sonnet-5-5/check-current-facts.md +1 -0
  82. package/presets/claude/rules/sonnet-5-5/ideas-first.md +1 -0
  83. package/presets/claude/rules/sonnet-5-5/no-self-review-rounds.md +1 -0
  84. package/presets/claude/rules/sonnet-5-5/stay-in-scope.md +1 -0
  85. package/presets/claude/rules/sonnet-5-5/verify-changes.md +1 -0
  86. package/presets/claude/versions/1.3.0/preset.json +432 -0
  87. package/presets/claude/versions/1.3.0/rules/fable-5-2/code-ownership.md +1 -0
  88. package/presets/claude/versions/1.3.0/rules/fable-5-2/finish-work.md +1 -0
  89. package/presets/claude/versions/1.3.0/rules/fable-5-2/low-context-report.md +1 -0
  90. package/presets/claude/versions/1.3.0/rules/fable-5-2/progress-updates.md +1 -0
  91. package/presets/claude/versions/1.3.0/rules/haiku-5-5/carry-through.md +1 -0
  92. package/presets/claude/versions/1.3.0/rules/haiku-5-5/search-recent-facts.md +1 -0
  93. package/presets/claude/versions/1.3.0/rules/haiku-5-5/verify-changes.md +1 -0
  94. package/presets/claude/versions/1.3.0/rules/opus-5-5/explore-before-acting.md +1 -0
  95. package/presets/claude/versions/1.3.0/rules/opus-5-5/progress-updates.md +1 -0
  96. package/presets/claude/versions/1.3.0/rules/opus-5-5/unattended-run.md +1 -0
  97. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/carry-through.md +1 -0
  98. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/check-current-facts.md +1 -0
  99. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/ideas-first.md +1 -0
  100. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/no-self-review-rounds.md +1 -0
  101. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/stay-in-scope.md +1 -0
  102. package/presets/claude/versions/1.3.0/rules/sonnet-5-5/verify-changes.md +1 -0
  103. package/schema/noonsight-project.schema.json +394 -0
  104. package/schema/noonsight.schema.json +425 -0
  105. package/schema/preset.schema.json +194 -0
  106. package/scripts/noonsight +68 -0
  107. package/skills/accept/SKILL.md +11 -0
  108. package/skills/check/SKILL.md +11 -0
  109. package/skills/models/SKILL.md +11 -0
  110. package/skills/report/SKILL.md +11 -0
  111. package/skills/resolve/SKILL.md +12 -0
  112. package/skills/setup/SKILL.md +15 -0
  113. package/skills/trust/SKILL.md +12 -0
  114. package/skills/untrust/SKILL.md +12 -0
@@ -0,0 +1,68 @@
1
+ #!/bin/sh
2
+ # The launcher of noonsight's Claude Code plugin: it finds a Node.js 20 or newer and runs the copy of
3
+ # noonsight this plugin holds. The hooks run it as `noonsight hook <event>`, and the plugin's skills as
4
+ # `noonsight <command>`. A Claude Code started from a desktop app may have no `node` on its PATH, so the
5
+ # order is: $NOONSIGHT_NODE, the one an earlier hook recorded, PATH, then the folders Node.js is usually in.
6
+ # A hook never holds or fails the session: without Node.js, only the session's start says so.
7
+
8
+ if [ "$1" = hook ] && [ "${NOONSIGHT_DISABLE:-}" = 1 ]; then
9
+ exit 0
10
+ fi
11
+
12
+ root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) || exit 0
13
+ cli=$root/dist/src/cli.js
14
+ home=${HOME:-}
15
+
16
+ node=
17
+ # Node.js that ran noonsight before, or that the person named: taken without starting it to ask its version.
18
+ trusted() {
19
+ if [ -z "$node" ] && [ -n "$1" ] && [ -x "$1" ] && [ ! -d "$1" ]; then node=$1; fi
20
+ }
21
+ found() {
22
+ if [ -z "$node" ] && [ -n "$1" ] && [ -x "$1" ] && [ ! -d "$1" ] &&
23
+ "$1" -e 'process.exit(parseInt(process.versions.node, 10) >= 20 ? 0 : 1)' </dev/null >/dev/null 2>&1; then
24
+ node=$1
25
+ fi
26
+ }
27
+
28
+ trusted "${NOONSIGHT_NODE:-}"
29
+ if [ -z "$node" ] && [ -r "$home/.local/share/noonsight/node" ]; then
30
+ IFS= read -r recorded <"$home/.local/share/noonsight/node" || :
31
+ trusted "${recorded:-}"
32
+ fi
33
+ if [ -z "$node" ]; then
34
+ found "$(command -v node 2>/dev/null || :)"
35
+ for dir in /opt/homebrew/bin /usr/local/bin /usr/bin "$home/.local/bin" "$home/.volta/bin" /snap/bin; do
36
+ found "$dir/node"
37
+ done
38
+ for dir in \
39
+ "$home/.nvm/versions/node"/*/bin \
40
+ "$home/.asdf/installs/nodejs"/*/bin \
41
+ "$home/.local/share/mise/installs/node"/*/bin \
42
+ "$home/.local/share/fnm/node-versions"/*/installation/bin \
43
+ "$home/Library/Application Support/fnm/node-versions"/*/installation/bin \
44
+ "$home/.nodenv/versions"/*/bin; do
45
+ found "$dir/node"
46
+ done
47
+ fi
48
+
49
+ if [ -z "$node" ]; then
50
+ if [ "$1" != hook ]; then
51
+ echo 'noonsight: no Node.js 20 or newer was found. Install it, or set NOONSIGHT_NODE to its path in "env" of the Claude Code settings.' >&2
52
+ exit 1
53
+ fi
54
+ if [ "${2:-}" = session-start ]; then
55
+ printf '%s\n' '{"systemMessage":"noonsight: the plugin found no Node.js 20 or newer, so it delivered no rules. Install Node.js, or set NOONSIGHT_NODE to its path in \"env\" of the Claude Code settings, then start a new session."}'
56
+ fi
57
+ exit 0
58
+ fi
59
+
60
+ if [ "$1" = hook ]; then
61
+ shift
62
+ # The copy can be deleted under a running session; the session then goes on without it.
63
+ [ -f "$cli" ] || exit 0
64
+ exec "$node" "$cli" hook --install plugin "$@"
65
+ fi
66
+ CLAUDE_PLUGIN_ROOT=$root
67
+ export CLAUDE_PLUGIN_ROOT
68
+ exec "$node" "$cli" "$@"
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Accept the installed preset version of noonsight: list what it changes, then record it in the configuration."
3
+ disable-model-invocation: true
4
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" accept:*)"
5
+ ---
6
+
7
+ Show the output below to the person as it is, with nothing added.
8
+
9
+ ```!
10
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" accept 2>&1 || true
11
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Check the noonsight configuration, what installs its hooks, and the last decision."
3
+ disable-model-invocation: true
4
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" check:*)"
5
+ ---
6
+
7
+ Show the output below to the person as it is, with nothing added.
8
+
9
+ ```!
10
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" check 2>&1 || true
11
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "List the models noonsight declares and their rules, with source and cost."
3
+ disable-model-invocation: true
4
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" models:*)"
5
+ ---
6
+
7
+ Show the output below to the person as it is, with nothing added.
8
+
9
+ ```!
10
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" models 2>&1 || true
11
+ ```
@@ -0,0 +1,11 @@
1
+ ---
2
+ description: "Report from the noonsight decision log how often each rule was delivered, and to which models, scopes and places."
3
+ disable-model-invocation: true
4
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" report:*)"
5
+ ---
6
+
7
+ Show the output below to the person as it is, with nothing added.
8
+
9
+ ```!
10
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" report 2>&1 || true
11
+ ```
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: "Show the rules noonsight gives a model, in a scope and a place."
3
+ argument-hint: "<model> [scope] [place]"
4
+ disable-model-invocation: true
5
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" resolve:*)"
6
+ ---
7
+
8
+ Show the output below to the person as it is, with nothing added.
9
+
10
+ ```!
11
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" resolve $ARGUMENTS 2>&1 || true
12
+ ```
@@ -0,0 +1,15 @@
1
+ ---
2
+ description: "Write the noonsight configuration from the preset when there is none, then check everything."
3
+ disable-model-invocation: true
4
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" init:*), Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" check:*)"
5
+ ---
6
+
7
+ Show the output below to the person as it is, with nothing added.
8
+
9
+ ```!
10
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" init 2>&1 || true
11
+ ```
12
+
13
+ ```!
14
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" check 2>&1 || true
15
+ ```
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: "Apply this project's noonsight configuration to the sessions that run in it."
3
+ argument-hint: "[<dir>]"
4
+ disable-model-invocation: true
5
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" trust:*)"
6
+ ---
7
+
8
+ Show the output below to the person as it is, with nothing added.
9
+
10
+ ```!
11
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" trust $ARGUMENTS 2>&1 || true
12
+ ```
@@ -0,0 +1,12 @@
1
+ ---
2
+ description: "Stop applying this project's noonsight configuration."
3
+ argument-hint: "[<dir>]"
4
+ disable-model-invocation: true
5
+ allowed-tools: "Bash(/bin/sh \"${CLAUDE_PLUGIN_ROOT}/scripts/noonsight\" untrust:*)"
6
+ ---
7
+
8
+ Show the output below to the person as it is, with nothing added.
9
+
10
+ ```!
11
+ /bin/sh "${CLAUDE_PLUGIN_ROOT}/scripts/noonsight" untrust $ARGUMENTS 2>&1 || true
12
+ ```