@zalom/plastic 1.0.0-alpha.3 → 1.0.0-alpha.4

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.
package/hooks/hooks.json CHANGED
@@ -62,17 +62,6 @@
62
62
  }
63
63
  ]
64
64
  }
65
- ],
66
- "statusLine": [
67
- {
68
- "matcher": "",
69
- "hooks": [
70
- {
71
- "type": "command",
72
- "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/statusline\""
73
- }
74
- ]
75
- }
76
65
  ]
77
66
  }
78
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zalom/plastic",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.4",
4
4
  "description": "Intent-driven idea development system for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -150,11 +150,22 @@ active_deprecations = deprecations.select do |dep|
150
150
  !dismissed.include?(dep["id"])
151
151
  end
152
152
 
153
+ # --- Check for available updates (from previous session's check) ---
154
+
155
+ update_notice = nil
156
+ cache_file = "#{store_root}/.cache/update-check.json"
157
+ if File.exist?(cache_file)
158
+ cache = JSON.parse(File.read(cache_file)) rescue {}
159
+ if cache["updateAvailable"]
160
+ update_notice = "Plastic update available: #{cache["current"]} -> #{cache["latest"]} — run /plastic:update"
161
+ end
162
+ end
163
+
153
164
  # --- Early exit if nothing to show ---
154
165
 
155
166
  all_active = active + project_active
156
167
  all_future = future + project_future
157
- exit 0 if all_active.empty? && stale.empty? && all_future.empty? && active_deprecations.empty?
168
+ exit 0 if all_active.empty? && stale.empty? && all_future.empty? && active_deprecations.empty? && update_notice.nil?
158
169
 
159
170
  # --- Build context ---
160
171
 
@@ -215,6 +226,10 @@ if active_deprecations.any?
215
226
  end
216
227
  end
217
228
 
229
+ if update_notice
230
+ parts.unshift("! #{update_notice}\n")
231
+ end
232
+
218
233
  payload = {
219
234
  "hookSpecificOutput" => {
220
235
  "hookEventName" => "SessionStart",
@@ -365,17 +365,19 @@ def merge_claude_hooks(settings_path)
365
365
  end
366
366
 
367
367
  def purge_stale_plastic_hooks(hooks)
368
- stale = ->(cmd) { cmd.to_s.match?(/ruby\s+.*plastic-/) || cmd.to_s.match?(/plastic-[a-z-]+\.rb/) }
368
+ plastic_cmd = ->(cmd) { cmd.to_s.include?("plastic-") }
369
+
370
+ hooks.delete("statusLine")
369
371
 
370
372
  hooks.each do |event, groups|
371
373
  next unless groups.is_a?(Array)
372
374
 
373
375
  hooks[event] = groups.map do |group|
374
376
  if group.is_a?(Hash) && group["hooks"].is_a?(Array)
375
- group["hooks"].reject! { |h| stale.call(h["command"]) }
377
+ group["hooks"].reject! { |h| plastic_cmd.call(h["command"]) }
376
378
  group unless group["hooks"].empty?
377
379
  elsif group.is_a?(Hash) && group["command"]
378
- stale.call(group["command"]) ? nil : group
380
+ plastic_cmd.call(group["command"]) ? nil : group
379
381
  else
380
382
  group
381
383
  end