aidp 0.17.0 → 0.18.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.
- checksums.yaml +4 -4
- data/README.md +69 -0
- data/lib/aidp/analyze/kb_inspector.rb +2 -3
- data/lib/aidp/analyze/progress.rb +5 -10
- data/lib/aidp/cli/mcp_dashboard.rb +1 -1
- data/lib/aidp/cli.rb +64 -29
- data/lib/aidp/config.rb +9 -14
- data/lib/aidp/execute/progress.rb +5 -8
- data/lib/aidp/execute/prompt_manager.rb +128 -1
- data/lib/aidp/execute/repl_macros.rb +555 -0
- data/lib/aidp/execute/work_loop_runner.rb +108 -1
- data/lib/aidp/harness/ai_decision_engine.rb +376 -0
- data/lib/aidp/harness/capability_registry.rb +273 -0
- data/lib/aidp/harness/config_loader.rb +2 -2
- data/lib/aidp/harness/config_schema.rb +305 -1
- data/lib/aidp/harness/configuration.rb +452 -0
- data/lib/aidp/harness/enhanced_runner.rb +23 -8
- data/lib/aidp/harness/error_handler.rb +12 -5
- data/lib/aidp/harness/provider_factory.rb +0 -2
- data/lib/aidp/harness/provider_manager.rb +4 -19
- data/lib/aidp/harness/runner.rb +9 -3
- data/lib/aidp/harness/state/persistence.rb +9 -10
- data/lib/aidp/harness/state/workflow_state.rb +3 -2
- data/lib/aidp/harness/state_manager.rb +33 -97
- data/lib/aidp/harness/status_display.rb +22 -12
- data/lib/aidp/harness/thinking_depth_manager.rb +335 -0
- data/lib/aidp/harness/ui/enhanced_tui.rb +3 -4
- data/lib/aidp/harness/user_interface.rb +11 -6
- data/lib/aidp/harness/zfc_condition_detector.rb +395 -0
- data/lib/aidp/init/devcontainer_generator.rb +274 -0
- data/lib/aidp/init/runner.rb +37 -10
- data/lib/aidp/init.rb +1 -0
- data/lib/aidp/jobs/background_runner.rb +7 -1
- data/lib/aidp/logger.rb +1 -1
- data/lib/aidp/message_display.rb +9 -2
- data/lib/aidp/prompt_optimization/context_composer.rb +286 -0
- data/lib/aidp/prompt_optimization/optimizer.rb +335 -0
- data/lib/aidp/prompt_optimization/prompt_builder.rb +309 -0
- data/lib/aidp/prompt_optimization/relevance_scorer.rb +256 -0
- data/lib/aidp/prompt_optimization/source_code_fragmenter.rb +308 -0
- data/lib/aidp/prompt_optimization/style_guide_indexer.rb +240 -0
- data/lib/aidp/prompt_optimization/template_indexer.rb +250 -0
- data/lib/aidp/provider_manager.rb +0 -2
- data/lib/aidp/providers/anthropic.rb +20 -1
- data/lib/aidp/providers/base.rb +4 -4
- data/lib/aidp/providers/codex.rb +1 -1
- data/lib/aidp/providers/cursor.rb +1 -1
- data/lib/aidp/providers/gemini.rb +1 -1
- data/lib/aidp/providers/github_copilot.rb +1 -1
- data/lib/aidp/providers/opencode.rb +1 -1
- data/lib/aidp/setup/wizard.rb +299 -4
- data/lib/aidp/skills/wizard/prompter.rb +2 -2
- data/lib/aidp/utils/devcontainer_detector.rb +166 -0
- data/lib/aidp/version.rb +1 -1
- data/lib/aidp/watch/build_processor.rb +72 -6
- data/lib/aidp/watch/plan_generator.rb +1 -1
- data/lib/aidp/watch/repository_client.rb +15 -10
- data/lib/aidp/workflows/guided_agent.rb +2 -312
- data/lib/aidp/workstream_executor.rb +8 -2
- data/lib/aidp.rb +0 -1
- data/templates/aidp.yml.example +128 -0
- metadata +14 -2
- data/lib/aidp/providers/macos_ui.rb +0 -102
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "base"
|
|
4
|
-
require_relative "../debug_mixin"
|
|
5
|
-
|
|
6
|
-
module Aidp
|
|
7
|
-
module Providers
|
|
8
|
-
class MacOSUI < Base
|
|
9
|
-
include Aidp::DebugMixin
|
|
10
|
-
|
|
11
|
-
def self.available?
|
|
12
|
-
RUBY_PLATFORM.include?("darwin")
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def name
|
|
16
|
-
"macos"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def send(prompt:, session: nil)
|
|
20
|
-
raise "macOS UI not available on this platform" unless self.class.available?
|
|
21
|
-
|
|
22
|
-
debug_provider("macos", "Starting Cursor interaction", {prompt_length: prompt.length})
|
|
23
|
-
|
|
24
|
-
# Try to use Cursor's chat interface via AppleScript
|
|
25
|
-
result = interact_with_cursor(prompt)
|
|
26
|
-
|
|
27
|
-
if result[:success]
|
|
28
|
-
debug_log("✅ Successfully sent prompt to Cursor", level: :info)
|
|
29
|
-
result[:response]
|
|
30
|
-
else
|
|
31
|
-
debug_log("❌ Failed to interact with Cursor: #{result[:error]}", level: :warn)
|
|
32
|
-
# No interactive fallback - would hang AIDP's automation workflow
|
|
33
|
-
raise "Cursor interaction failed and no non-interactive fallback available: #{result[:error]}"
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
private
|
|
38
|
-
|
|
39
|
-
def interact_with_cursor(prompt)
|
|
40
|
-
# Create a temporary script file for the prompt with proper encoding
|
|
41
|
-
temp_file = "/tmp/aidp_cursor_prompt.txt"
|
|
42
|
-
File.write(temp_file, prompt, encoding: "UTF-8")
|
|
43
|
-
|
|
44
|
-
# AppleScript to interact with Cursor - use properly escaped prompt to avoid injection
|
|
45
|
-
escaped_prompt = escape_for_applescript(prompt)
|
|
46
|
-
script = <<~APPLESCRIPT
|
|
47
|
-
tell application "Cursor"
|
|
48
|
-
activate
|
|
49
|
-
end tell
|
|
50
|
-
|
|
51
|
-
delay 1
|
|
52
|
-
|
|
53
|
-
tell application "System Events"
|
|
54
|
-
-- Open chat panel (Cmd+L)
|
|
55
|
-
keystroke "l" using command down
|
|
56
|
-
delay 2
|
|
57
|
-
|
|
58
|
-
-- Type the prompt (properly escaped)
|
|
59
|
-
keystroke "#{escaped_prompt}"
|
|
60
|
-
delay 1
|
|
61
|
-
|
|
62
|
-
-- Send the message (Enter)
|
|
63
|
-
keystroke (ASCII character 13)
|
|
64
|
-
delay 3
|
|
65
|
-
|
|
66
|
-
-- Try to get response (this is tricky without accessibility permissions)
|
|
67
|
-
-- For now, we'll just return success
|
|
68
|
-
return "Prompt sent to Cursor chat"
|
|
69
|
-
end tell
|
|
70
|
-
APPLESCRIPT
|
|
71
|
-
|
|
72
|
-
begin
|
|
73
|
-
# Use Open3 to safely execute AppleScript without shell injection
|
|
74
|
-
require "open3"
|
|
75
|
-
|
|
76
|
-
# Write AppleScript to temporary file to avoid command line issues
|
|
77
|
-
script_file = "/tmp/aidp_cursor_script.scpt"
|
|
78
|
-
File.write(script_file, script, encoding: "UTF-8")
|
|
79
|
-
|
|
80
|
-
stdout, stderr, status = Open3.capture3("osascript", script_file)
|
|
81
|
-
|
|
82
|
-
if status.success?
|
|
83
|
-
{success: true, response: stdout.strip}
|
|
84
|
-
else
|
|
85
|
-
{success: false, error: stderr.strip}
|
|
86
|
-
end
|
|
87
|
-
rescue => e
|
|
88
|
-
{success: false, error: e.message}
|
|
89
|
-
ensure
|
|
90
|
-
File.delete(temp_file) if File.exist?(temp_file)
|
|
91
|
-
File.delete(script_file) if File.exist?(script_file)
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def escape_for_applescript(text)
|
|
96
|
-
# Escape special characters for AppleScript
|
|
97
|
-
# Must escape backslashes first to avoid double-escaping
|
|
98
|
-
text.gsub("\\", "\\\\").gsub('"', '\\"').gsub("'", "\\'").gsub("\n", "\\n")
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
end
|