Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
Initial merge work. Still has issues with needing a new go.mod, and cloud migrations causing an error.
David Weirichb81042ce62cd
diff --git a/app/server/go.mod b/app/server/go.modindex 141e7634..6bc487a4 100644--- a/app/server/go.mod+++ b/app/server/go.mod@@ -8,11 +8,11 @@ require (github.com/gorilla/mux v1.8.1github.com/pkg/errors v0.9.1github.com/plandex/plandex/shared v0.0.0-00010101000000-000000000000- github.com/sashabaranov/go-openai v1.24.0+ github.com/sashabaranov/go-openai v1.27.0)require (- github.com/dlclark/regexp2 v1.11.0 // indirect+ github.com/dlclark/regexp2 v1.11.2 // indirectgithub.com/go-toast/toast v0.0.0-20190211030409-01e6764cf0a4 // indirectgithub.com/godbus/dbus/v5 v5.1.0 // indirectgithub.com/hashicorp/errwrap v1.1.0 // indirect@@ -20,26 +20,27 @@ require (github.com/jmespath/go-jmespath v0.4.0 // indirectgithub.com/mattn/go-colorable v0.1.13 // indirectgithub.com/mattn/go-isatty v0.0.20 // indirect- github.com/mattn/go-runewidth v0.0.15 // indirect+ github.com/mattn/go-runewidth v0.0.16 // indirectgithub.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirectgithub.com/olekukonko/tablewriter v0.0.5 // indirect- github.com/pkoukk/tiktoken-go v0.1.6 // indirect+ github.com/pkoukk/tiktoken-go v0.1.7 // indirectgithub.com/rivo/uniseg v0.4.7 // indirectgithub.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af // indirectgo.uber.org/atomic v1.11.0 // indirect- golang.org/x/image v0.17.0 // indirect- golang.org/x/sys v0.17.0 // indirect+ golang.org/x/image v0.18.0 // indirect+ golang.org/x/sys v0.22.0 // indirect)require (github.com/atotto/clipboard v0.1.4- github.com/aws/aws-sdk-go v1.50.20- github.com/fatih/color v1.16.0- github.com/gen2brain/beeep v0.0.0-20240112042604-c7bb2cd88fea- github.com/golang-migrate/migrate/v4 v4.17.0- github.com/jmoiron/sqlx v1.3.5+ github.com/aws/aws-sdk-go v1.55.3+ github.com/fatih/color v1.17.0+ github.com/gen2brain/beeep v0.0.0-20240516210008-9c006672e7f4+ github.com/golang-migrate/migrate/v4 v4.17.1+ github.com/jmoiron/sqlx v1.4.0github.com/lib/pq v1.10.9- github.com/smacker/go-tree-sitter v0.0.0-20240423010953-8ba036550382+ github.com/smacker/go-tree-sitter v0.0.0-20240625050157-a31a98a7c0f6+ github.com/stripe/stripe-go/v78 v78.12.0)replace github.com/plandex/plandex/shared => ../shareddiff --git a/app/server/go.sum b/app/server/go.sumindex fd9e97ba..f678f0ca 100644--- a/app/server/go.sum+++ b/app/server/go.sum@@ -9,6 +9,8 @@ github.com/aws/aws-sdk-go v1.50.20 h1:xfAnSDVf/azIWTVQXQODp89bubvCS85r70O3nuQ4dngithub.com/aws/aws-sdk-go v1.50.20/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=github.com/aws/aws-sdk-go v1.54.19 h1:tyWV+07jagrNiCcGRzRhdtVjQs7Vy41NwsuOcl0IbVI=github.com/aws/aws-sdk-go v1.54.19/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=+github.com/aws/aws-sdk-go v1.55.3 h1:0B5hOX+mIx7I5XPOrjrHlKSDQV/+ypFZpIHOx5LOk3E=+github.com/aws/aws-sdk-go v1.55.3/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=@@ -79,6 +81,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/Dgithub.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=+github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=+github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=@@ -111,16 +115,22 @@ github.com/sashabaranov/go-openai v1.24.0 h1:4H4Pg8Bl2RH/YSnU8DYumZbuHnnkfioor/dgithub.com/sashabaranov/go-openai v1.24.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=github.com/sashabaranov/go-openai v1.26.3 h1:Tjnh4rcvsSU68f66r05mys+Zou4vo4qyvkne6AIRJPI=github.com/sashabaranov/go-openai v1.26.3/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=+github.com/sashabaranov/go-openai v1.27.0 h1:L3hO6650YUbKrbGUC6yCjsUluhKZ9h1/jcgbTItI8Mo=+github.com/sashabaranov/go-openai v1.27.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=github.com/smacker/go-tree-sitter v0.0.0-20240423010953-8ba036550382 h1:Cb8njhEbNgGk5lQMM/r1FWvrKT+ysH8H0WV9NAIKAu8=github.com/smacker/go-tree-sitter v0.0.0-20240423010953-8ba036550382/go.mod h1:q99oHDsbP0xRwmn7Vmob8gbSMNyvJ83OauXPSuHQuKE=github.com/smacker/go-tree-sitter v0.0.0-20240625050157-a31a98a7c0f6 h1:mtD4ESyObQZnRVxHFcaYp2d7jMBDa4WJRXSB1Vszj+A=github.com/smacker/go-tree-sitter v0.0.0-20240625050157-a31a98a7c0f6/go.mod h1:q99oHDsbP0xRwmn7Vmob8gbSMNyvJ83OauXPSuHQuKE=github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=+github.com/stripe/stripe-go/v78 v78.11.0/go.mod h1:GjncxVLUc1xoIOidFqVwq+y3pYiG7JLVWiVQxTsLrvQ=+github.com/stripe/stripe-go/v78 v78.12.0 h1:YzKjO5Cx1dTfSkqBXzg6GFG7LnRHkZiU0+k0vSF5yt4=+github.com/stripe/stripe-go/v78 v78.12.0/go.mod h1:GjncxVLUc1xoIOidFqVwq+y3pYiG7JLVWiVQxTsLrvQ=github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af h1:6yITBqGTE2lEeTPG04SN9W+iWHCRyHqlVYILiSXziwk=github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af/go.mod h1:4F09kP5F+am0jAwlQLddpoMDM+iewkxxt6nxUQ5nq5o=go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=@@ -131,15 +141,21 @@ golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=+golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg=golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=diff --git a/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.down.sql b/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.down.sqlnew file mode 100644index 00000000..44277e7a--- /dev/null+++ b/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.down.sql@@ -0,0 +1 @@+ALTER TABLE orgs DROP COLUMN stripe_customer_id;\ No newline at end of filediff --git a/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.up.sql b/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.up.sqlnew file mode 100644index 00000000..f0135d49--- /dev/null+++ b/app/server/migrations/2024060700_add_stripe_customer_id_to_orgs.up.sql@@ -0,0 +1,2 @@+ALTER TABLE orgs ADD COLUMN stripe_customer_id VARCHAR(255);+CREATE UNIQUE INDEX orgs_stripe_customer_id_idx ON orgs(stripe_customer_id);\ No newline at end of filediff --git a/app/server/migrations/2024062000_subscription_plans.down.sql b/app/server/migrations/2024062000_subscription_plans.down.sqlnew file mode 100644index 00000000..7767df81--- /dev/null+++ b/app/server/migrations/2024062000_subscription_plans.down.sql@@ -0,0 +1 @@+DROP IF TABLE EXISTS subscription_plans;\ No newline at end of filediff --git a/app/server/migrations/2024062000_subscription_plans.up.sql b/app/server/migrations/2024062000_subscription_plans.up.sqlnew file mode 100644index 00000000..be748730--- /dev/null+++ b/app/server/migrations/2024062000_subscription_plans.up.sql@@ -0,0 +1,8 @@+CREATE TABLE IF NOT EXISTS subscription_plans (+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),+ stripe_price_id VARCHAR(255) NOT NULL,+ name VARCHAR(255) NOT NULL,+ created_at TIMESTAMP NOT NULL DEFAULT NOW()+);++CREATE UNIQUE INDEX subscription_plans_stripe_id_idx ON subscription_plans(stripe_price_id);\ No newline at end of filediff --git a/app/server/migrations/2024062100_subscriptions.down.sql b/app/server/migrations/2024062100_subscriptions.down.sqlnew file mode 100644index 00000000..1145dca2--- /dev/null+++ b/app/server/migrations/2024062100_subscriptions.down.sql@@ -0,0 +1 @@+DROP TABLE IF EXISTS subscriptions;\ No newline at end of filediff --git a/app/server/migrations/2024062100_subscriptions.up.sql b/app/server/migrations/2024062100_subscriptions.up.sqlnew file mode 100644index 00000000..cd4b8d98--- /dev/null+++ b/app/server/migrations/2024062100_subscriptions.up.sql@@ -0,0 +1,11 @@+CREATE TABLE IF NOT EXISTS subscriptions (+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),+ stripe_subscription_id VARCHAR(255) NOT NULL,+ subscription_plan_id UUID NOT NULL REFERENCES subscription_plans(id),+ org_id UUID NOT NULL REFERENCES orgs(id),+ status VARCHAR(255) NOT NULL,+ created_at TIMESTAMP NOT NULL DEFAULT NOW(),+ updated_at TIMESTAMP NOT NULL DEFAULT NOW()+);+CREATE UNIQUE INDEX subscriptions_stripe_subscription_id_idx ON subscriptions(stripe_subscription_id);+CREATE TRIGGER update_subscriptions_modtime BEFORE UPDATE ON subscriptions FOR EACH ROW EXECUTE FUNCTION update_updated_at_column();\ No newline at end of file