Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
13040b6
Configure CORS in planning server
bfollington Jul 24, 2024
8316bc0
Create gemcraft leptos project
bfollington Jul 24, 2024
77c8468
Deserialize response to struct
bfollington Jul 24, 2024
1ef9164
Checkpoint: CRUD for the gem data + classification with central state
bfollington Jul 25, 2024
5d8edd5
Refactor into modules
bfollington Jul 25, 2024
dd2f4fd
WIP vertex support
bfollington Jul 26, 2024
8d72f11
svg wireframes
bfollington Jul 26, 2024
fd1ad12
Support for Llama 3.1 and GPT4o-mini
bfollington Jul 29, 2024
1034414
Local storage persistence of datagems
bfollington Jul 29, 2024
809e3c9
Fix persistence and tweak gem layout
bfollington Jul 30, 2024
605cdb4
Refactoring
bfollington Jul 30, 2024
de4ff8d
Remove all Tailwind CSS classes from the DataGemEditor component.
Jul 31, 2024
a293ecb
Allow customization of LLM provider per-request
Jul 31, 2024
44d05d9
Move CSS rules from micro_app.rs to the style tag in index.html.
Jul 31, 2024
682945e
Simplify the JSON editor label by removing the `block mb-2 font-bold`…
Jul 31, 2024
df6d041
Add an actions section to the gem editor with options to parameterize…
Jul 31, 2024
59b88e5
Implement Classify as a GemAction and move the handler logic into a f…
Jul 31, 2024
86d1f88
Make "Classify" the default action in the select block
Jul 31, 2024
a2e0d14
Remove the "Classify Data" button as it is superseded by the actions …
Jul 31, 2024
e8992ad
Implement gem classification and hallucination actions in the gem editor
Jul 31, 2024
927c5c0
Move the Hallucinate button underneath the label for the Description …
Jul 31, 2024
14cc96a
Tweak form layout
Jul 31, 2024
536a66f
Implement GemAction Explode by creating a new LLM request to break do…
Jul 31, 2024
d3f7414
Improve the JSON formatting in the request message to the LLM.
Jul 31, 2024
237304e
Implement the `MakeVariations` action by creating a new LLM request t…
Jul 31, 2024
bf804af
Rename GemAction Parameterize to Decompose
Jul 31, 2024
ec8ac5a
Implement GemAction Decompose functionality by creating a new LLM req…
Jul 31, 2024
ba1e50c
Add a delete button to the bottom right corner of the gem form that c…
Jul 31, 2024
222916d
Adjust CSS styles for gem form, button, and toggle layout
Jul 31, 2024
865cfe5
Rename `.classify` to `.primary` and create `.danger` class for destr…
Jul 31, 2024
1042103
Implement deletion
Jul 31, 2024
cae9659
Extract common ceremonial code into utility functions
Jul 31, 2024
590012c
Add `derived_from` field to `DataGem` and populate it when saving gem…
Jul 31, 2024
6673a99
Add default value for missing `derived_from` field when loading `Data…
Jul 31, 2024
c64d395
Implement tab control
Aug 1, 2024
ae59798
Extract styles to main.css file, use comments to divide into function…
Aug 1, 2024
fcf4eb4
Fix Llama output
Aug 1, 2024
cd7d688
New layout + tabs
Aug 1, 2024
4a730bd
App is generating nicely
Aug 1, 2024
f7afaea
Implement new `implement_app` function to generate app ideas from sys…
Aug 1, 2024
3f1e530
Add a button to the Code tab that will invoke llm::implement_app pass…
Aug 1, 2024
80a1ddf
Add an "I'm feeling lucky" button that changes the selection to 2-3 r…
Aug 7, 2024
fee11b3
Aider tweaks
Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
892 changes: 859 additions & 33 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = [
"rust/usuba-compat",
"rust/usuba-bundle",
"rust/verification-svc"
]
, "rust/gemcraft-leptos"]

# See: https://github.com/rust-lang/rust/issues/90148#issuecomment-949194352
resolver = "2"
Expand Down
25 changes: 25 additions & 0 deletions rust/gemcraft-leptos/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "gemcraft-leptos"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
console_error_panic_hook = "0.1.7"
leptos = { version = "0.6.12", features = ["csr", "nightly"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde-wasm-bindgen = "0.6"
wasm-bindgen = "0.2.92"
wasm-bindgen-futures = "0.4.42"
regex = "1.5.4"
uuid = { version = "1.3", features = ["v4"] }
indexed_db_futures = "0.5.0"
js-sys = "0.3.50"
web-sys = "0.3.69"
gloo-storage = "0.3.0"
gloo-utils = "0.2.0"
anyhow = "1.0.71"
quick-xml = "0.22.0"
rand = "0.8.5"
5 changes: 5 additions & 0 deletions rust/gemcraft-leptos/Trunk.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[serve]
# The address to serve on
address = "127.0.0.1"
# The port to serve on
port = 8081
7 changes: 7 additions & 0 deletions rust/gemcraft-leptos/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<link rel="css" data-trunk href="main.css">
</head>
<body></body>
</html>
250 changes: 250 additions & 0 deletions rust/gemcraft-leptos/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
/* Layout */
.app {
display: flex;
flex-direction: row;
}

.app > div {
flex: 1;
}

app > div > pre {
overflow: auto;
max-width: 50%;
}

.columns {
display: flex;
flex-direction: row;
}

.rows {
display: flex;
flex-direction: column;
}

/* Data Gem Styles */
.data-gem {
display: flex;
align-items: center;
gap: 1rem;
}

.data-gem .icon {
font-size: 3rem;
color: #ccc;
border: 1px solid #ccc;
border-radius: 50%;
padding: 0.5rem;
box-sizing: border-box;
width: 5rem;
text-align: center;
height: 5rem;
user-select: none;
}

.gem-list {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
flex-direction: row;
}

.data-gem.small .icon {
font-size: 1.5rem;
color: #ccc;
border: 1px solid #ccc;
border-radius: 50%;
padding: 0.33rem;
box-sizing: border-box;
width: 3rem;
text-align: center;
height: 3rem;
user-select: none;
}

.data-gem .content {
flex-grow: 1;
}

.data-gem .title {
font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
font-size: 1rem;
font-weight: bold;
margin: 0;
}

.data-gem .content-type {
font-size: 0.75rem;
color: #999;
}

/* Form Styles */
form table label {
font-family: monospace;
}

form table td {
vertical-align: top;
padding: 0.5rem;
}

form.gem-form {
border: 1px solid #ccc;
padding: 1rem;
border-radius: 0.25rem;
margin: 0.5rem 0.5rem;
}

/* Button Styles */
button.primary {
background-color: #007bff;
color: #fff;
border: none;
padding: 0.5rem 1rem;
border-radius: 0.25rem;
cursor: pointer;
}

button.danger {
background-color: #dc3545;
color: #fff;
border: none;
padding: 0.5rem 1rem;
border-radius: 0.25rem;
cursor: pointer;
}

/* App Ideas */
.app-ideas {
white-space: pre-wrap;
}

/* Toggle Styles */
.toggle-container {
position: relative;
}

.toggle-input {
display: none;
}

.toggle-label {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
cursor: pointer;
}

.toggle-content {
display: none;
padding: 10px;
}

.toggle-input:checked ~ .toggle-content {
display: block;
}

.toggle-label::after {
content: "\25B8";
display: inline-block;
}

.toggle-input:checked ~ .toggle-label::after {
content: "\25BE";
display: inline-block;
}

/* Gem Dock */
.gem-dock {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

/* Micro App Styles */
.micro-app-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}

.micro-app-item {
border: 1px solid #ccc;
padding: 1rem;
border-radius: 0.5rem;
}

.micro-app-title {
font-size: 1.25rem;
font-weight: bold;
margin: 0;
padding: 0.25rem ;
}

.micro-app-spec {
margin-top: 0.5rem;
}

.micro-app-spec-title {
font-weight: 600;
}

.margin-left {
margin-left: 1rem;
}

.micro-app-tagline {
margin: 0;
font-weight: normal;
font-style: italic;
padding: 0.25rem;
}

.micro-app-spec-content {
margin-top: 2rem;
white-space: pre-wrap;
}

.micro-app-svg {
margin-top: 1rem;
}

/* Tab Control Styles */
.tab-control {
font-family: Arial, sans-serif;
}

.tab-header {
display: flex;
border-bottom: 1px solid #ccc;
}

.tab-button {
padding: 10px 20px;
border: none;
background-color: #f1f1f1;
cursor: pointer;
transition: background-color 0.3s;
}

.tab-button:hover {
background-color: #ddd;
}

.tab-button.active {
background-color: #fff;
border-bottom: 2px solid #007bff;
}

.tab-content {
padding: 20px;
}

.tab-pane {
display: none;
}

.tab-pane.active {
display: block;
}
19 changes: 19 additions & 0 deletions rust/gemcraft-leptos/src/data.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct ClassificationData {
pub title: String,
#[serde(rename = "contentType")]
pub content_type: String,
pub emoji: String,
pub sensitivity: String,
}

#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct DataGem {
pub classification: Option<ClassificationData>,
pub description: String,
pub json_data: String,
#[serde(default)]
pub derived_from: Vec<String>,
}
Loading