openmates 0.12.0-alpha.29 → 0.12.0-alpha.30
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/dist/{chunk-FCSXUBOU.js → chunk-DV72I4CF.js} +4 -107
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +61 -1
- package/dist/index.js +126 -1
- package/package.json +1 -1
|
@@ -22456,97 +22456,6 @@ skill_id: get-posts`,
|
|
|
22456
22456
|
}
|
|
22457
22457
|
};
|
|
22458
22458
|
|
|
22459
|
-
// ../ui/src/demo_chats/data/example_chats/habit-garden-vite-app.ts
|
|
22460
|
-
var habitGardenViteAppChat = {
|
|
22461
|
-
chat_id: "example-habit-garden-vite-app",
|
|
22462
|
-
slug: "habit-garden-vite-app",
|
|
22463
|
-
title: "example_chats.habit_garden_vite_app.title",
|
|
22464
|
-
summary: "example_chats.habit_garden_vite_app.summary",
|
|
22465
|
-
icon: "leaf",
|
|
22466
|
-
category: "software_development",
|
|
22467
|
-
keywords: ["habit tracker", "Vite app", "application preview", "localStorage", "garden visualization"],
|
|
22468
|
-
follow_up_suggestions: [],
|
|
22469
|
-
messages: [
|
|
22470
|
-
{
|
|
22471
|
-
"id": "7dca2b71-761d-4fc6-a93e-2fae55ce2452",
|
|
22472
|
-
"role": "user",
|
|
22473
|
-
"content": "example_chats.habit_garden_vite_app.message_1",
|
|
22474
|
-
"created_at": 1780927590
|
|
22475
|
-
},
|
|
22476
|
-
{
|
|
22477
|
-
"id": "ee694616-9580-4d45-b056-a6835848a47e",
|
|
22478
|
-
"role": "assistant",
|
|
22479
|
-
"content": "example_chats.habit_garden_vite_app.message_2",
|
|
22480
|
-
"created_at": 1780927664,
|
|
22481
|
-
"category": "software_development",
|
|
22482
|
-
"model_name": "Gemini 3.1 Pro"
|
|
22483
|
-
}
|
|
22484
|
-
],
|
|
22485
|
-
embeds: [
|
|
22486
|
-
{
|
|
22487
|
-
"embed_id": "c1c32384-39e9-4d22-b8b5-238acb293f2a",
|
|
22488
|
-
"type": "code",
|
|
22489
|
-
"content": "type: code\napp_id: code\nskill_id: code\nlanguage: javascript\ncode: \"// Get today's date string in YYYY-MM-DD format based on local time\\nconst getTodayStr = () => {\\n const d = new Date();\\n d.setMinutes(d.getMinutes() - d.getTimezoneOffset());\\n return d.toISOString().split('T')[0];\\n};\\n\\nconst todayStr = getTodayStr();\\n\\n// Load habits from LocalStorage or initialize an empty array\\nlet habits = JSON.parse(localStorage.getItem('habitGarden_habits')) || [];\\n\\n// Save state to LocalStorage\\nfunction saveHabits() {\\n localStorage.setItem('habitGarden_habits', JSON.stringify(habits));\\n}\\n\\n// Generate the last 7 days for the garden view\\nfunction getPast7Days() {\\n const days = [];\\n for (let i = 6; i >= 0; i--) {\\n const d = new Date();\\n d.setDate(d.getDate() - i);\\n // Correctly adjust for local timezone\\n d.setMinutes(d.getMinutes() - d.getTimezoneOffset());\\n days.push(d.toISOString().split('T')[0]);\\n }\\n return days;\\n}\\n\\n// Map habit indices to different flowers\\nconst flowerTypes = ['\u{1F33B}', '\u{1F337}', '\u{1F339}', '\u{1F33C}', '\u{1F338}', '\u{1F33A}', '\u{1F3F5}\uFE0F'];\\n\\n// Main Render Function\\nfunction render() {\\n renderTodayList();\\n renderGarden();\\n}\\n\\n// Toggle completion status for today\\nfunction toggleHabitToday(id) {\\n const habit = habits.find(h => h.id === id);\\n if (habit) {\\n habit.records[todayStr] = !habit.records[todayStr];\\n saveHabits();\\n render();\\n }\\n}\\n\\n// Delete a habit entirely\\nfunction deleteHabit(id) {\\n if (confirm('Are you sure you want to uproot this habit forever?')) {\\n habits = habits.filter(h => h.id !== id);\\n saveHabits();\\n render();\\n }\\n}\\n\\n// Render the actionable \\\"Today's Tasks\\\" list\\nfunction renderTodayList() {\\n const container = document.getElementById('today-list');\\n container.innerHTML = '';\\n\\n if (habits.length === 0) {\\n container.innerHTML = '<div class=\\\"empty-state\\\">No seeds planted yet. Add a habit above to start your garden!</div>';\\n return;\\n }\\n\\n habits.forEach(habit => {\\n const isDone = !!habit.records[todayStr];\\n \\n const div = document.createElement('div');\\n div.className = `habit-item ${isDone ? 'done' : ''}`;\\n\\n const label = document.createElement('div');\\n label.className = 'habit-name';\\n label.textContent = habit.name;\\n\\n const actions = document.createElement('div');\\n actions.className = 'action-buttons';\\n \\n const waterBtn = document.createElement('button');\\n waterBtn.className = 'btn-water';\\n waterBtn.textContent = isDone ? 'Undo' : '\u{1F4A7} Water';\\n waterBtn.onclick = () => toggleHabitToday(habit.id);\\n\\n const delBtn = document.createElement('button');\\n delBtn.className = 'btn-delete';\\n delBtn.textContent = '\u2716';\\n delBtn.title = 'Delete Habit';\\n delBtn.onclick = () => deleteHabit(habit.id);\\n\\n actions.appendChild(waterBtn);\\n actions.appendChild(delBtn);\\n\\n div.appendChild(label);\\n div.appendChild(actions);\\n container.appendChild(div);\\n });\\n}\\n\\n// Render the 7-day visualization grid\\nfunction renderGarden() {\\n const container = document.getElementById('garden-container');\\n container.innerHTML = '';\\n\\n if (habits.length === 0) return;\\n\\n const days = getPast7Days();\\n\\n // Create Header for Dates\\n const header = document.createElement('div');\\n header.className = 'day-labels';\\n days.forEach(d => {\\n const span = document.createElement('div');\\n span.className = 'day-label';\\n // Format to MM/DD\\n span.textContent = d.slice(5, 10).replace('-', '/');\\n header.appendChild(span);\\n });\\n container.appendChild(header);\\n\\n // Create Grid\\n const grid = document.createElement('div');\\n grid.className = 'garden-grid';\\n\\n habits.forEach((habit, index) => {\\n const row = document.createElement('div');\\n row.className = 'garden-row';\\n\\n const label = document.createElement('div');\\n label.className = 'garden-label';\\n label.textContent = habit.name;\\n label.title = habit.name;\\n row.appendChild(label);\\n\\n const dayContainer = document.createElement('div');\\n dayContainer.className = 'garden-days';\\n\\n const flowerEmoji = flowerTypes[index % flowerTypes.length];\\n\\n days.forEach(day => {\\n const plot = document.createElement('div');\\n const isDone = habit.records[day];\\n \\n if (isDone) {\\n plot.className = 'garden-plot bloomed';\\n plot.textContent = flowerEmoji;\\n plot.title = `${day}: Bloomed!`;\\n } else {\\n plot.className = 'garden-plot planted';\\n plot.textContent = '\u{1F331}'; // Seedling for missed/unwatered days\\n plot.title = `${day}: Needs watering`;\\n }\\n dayContainer.appendChild(plot);\\n });\\n\\n row.appendChild(dayContainer);\\n grid.appendChild(row);\\n });\\n\\n container.appendChild(grid);\\n}\\n\\n// Event Listeners for Adding Habits\\ndocument.getElementById('add-habit-btn').addEventListener('click', () => {\\n const input = document.getElementById('new-habit-input');\\n const name = input.value.trim();\\n \\n if (name) {\\n habits.push({\\n id: Date.now().toString(),\\n name,\\n records: {} // Format: { \\\"YYYY-MM-DD\\\": true }\\n });\\n saveHabits();\\n input.value = '';\\n render();\\n }\\n});\\n\\ndocument.getElementById('new-habit-input').addEventListener('keypress', (e) => {\\n if (e.key === 'Enter') {\\n document.getElementById('add-habit-btn').click();\\n }\\n});\\n\\n// Kick off initial rendering\\nrender();\\n\"\nfilename: src/main.js\nembed_ref: src-main.js-c1c323\nstatus: finished\nline_count: 190",
|
|
22490
|
-
"parent_embed_id": null,
|
|
22491
|
-
"embed_ids": null
|
|
22492
|
-
},
|
|
22493
|
-
{
|
|
22494
|
-
"embed_id": "4020cf81-f490-4da8-bd42-c4ea456327f3",
|
|
22495
|
-
"type": "application",
|
|
22496
|
-
"content": "type: application\napp_id: code\nskill_id: application\nname: Habit Garden\nframework: web\nruntime: node\nfile_refs[4]{path,embed_id,role}:\n package.json,6205b216-da05-4bf4-8d4c-d4a30e50ba6b,dependency_manifest\n index.html,35a05ba6-a5a5-492e-9785-19d93a24cabf,source\n src/style.css,c175730b-6e35-4e35-b9dd-49eacc1abe81,source\n src/main.js,c1c32384-39e9-4d22-b8b5-238acb293f2a,source\nentrypoints[1]{name,command,port}:\n frontend,npm run dev,5173\nembed_ids: 6205b216-da05-4bf4-8d4c-d4a30e50ba6b|35a05ba6-a5a5-492e-9785-19d93a24cabf|c175730b-6e35-4e35-b9dd-49eacc1abe81|c1c32384-39e9-4d22-b8b5-238acb293f2a\nembed_ref: habit-garden-4020cf\nstatus: finished\nprovenance: example_chat_adjusted",
|
|
22497
|
-
"parent_embed_id": null,
|
|
22498
|
-
"embed_ids": [
|
|
22499
|
-
"6205b216-da05-4bf4-8d4c-d4a30e50ba6b",
|
|
22500
|
-
"35a05ba6-a5a5-492e-9785-19d93a24cabf",
|
|
22501
|
-
"c175730b-6e35-4e35-b9dd-49eacc1abe81",
|
|
22502
|
-
"c1c32384-39e9-4d22-b8b5-238acb293f2a"
|
|
22503
|
-
]
|
|
22504
|
-
},
|
|
22505
|
-
{
|
|
22506
|
-
"embed_id": "c175730b-6e35-4e35-b9dd-49eacc1abe81",
|
|
22507
|
-
"type": "code",
|
|
22508
|
-
"content": `type: code
|
|
22509
|
-
app_id: code
|
|
22510
|
-
skill_id: code
|
|
22511
|
-
language: css
|
|
22512
|
-
code: ":root {\\n --bg-color: #f4fdf4;\\n --card-bg: #ffffff;\\n --text-main: #2c3e50;\\n --text-muted: #7f8c8d;\\n --primary: #27ae60;\\n --primary-hover: #219150;\\n --dirt: #8d6e63;\\n --grass: #c8e6c9;\\n --border-radius: 12px;\\n}\\n\\nbody {\\n font-family: system-ui, -apple-system, BlinkMacSystemFont, \\"Segoe UI\\", Roboto, sans-serif;\\n background-color: var(--bg-color);\\n color: var(--text-main);\\n margin: 0;\\n padding: 20px;\\n line-height: 1.5;\\n}\\n\\n#app {\\n max-width: 700px;\\n margin: 0 auto;\\n background: var(--card-bg);\\n padding: 30px;\\n border-radius: var(--border-radius);\\n box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);\\n}\\n\\nheader {\\n text-align: center;\\n margin-bottom: 30px;\\n}\\n\\nh1 {\\n margin: 0;\\n color: var(--primary-hover);\\n font-size: 2.2rem;\\n}\\n\\nheader p {\\n color: var(--text-muted);\\n margin-top: 5px;\\n}\\n\\nh2 {\\n font-size: 1.2rem;\\n border-bottom: 2px solid var(--bg-color);\\n padding-bottom: 10px;\\n margin-top: 30px;\\n}\\n\\n.add-habit {\\n display: flex;\\n gap: 10px;\\n}\\n\\ninput[type=\\"text\\"] {\\n flex: 1;\\n padding: 12px 16px;\\n border: 2px solid #e0e0e0;\\n border-radius: 8px;\\n font-size: 1rem;\\n outline: none;\\n transition: border-color 0.2s;\\n}\\n\\ninput[type=\\"text\\"]:focus {\\n border-color: var(--primary);\\n}\\n\\nbutton {\\n background-color: var(--primary);\\n color: white;\\n border: none;\\n padding: 12px 20px;\\n border-radius: 8px;\\n cursor: pointer;\\n font-size: 1rem;\\n font-weight: 600;\\n transition: background-color 0.2s, transform 0.1s;\\n}\\n\\nbutton:hover {\\n background-color: var(--primary-hover);\\n}\\n\\nbutton:active {\\n transform: scale(0.98);\\n}\\n\\n/* Today's Tasks List */\\n#today-list {\\n display: flex;\\n flex-direction: column;\\n gap: 10px;\\n}\\n\\n.habit-item {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n padding: 15px;\\n background: #fafafa;\\n border-radius: 8px;\\n border: 1px solid #eee;\\n transition: all 0.2s;\\n}\\n\\n.habit-item.done {\\n background: #e8f5e9;\\n border-color: #c8e6c9;\\n}\\n\\n.habit-name {\\n font-weight: 500;\\n font-size: 1.1rem;\\n}\\n\\n.habit-item.done .habit-name {\\n text-decoration: line-through;\\n color: var(--text-muted);\\n}\\n\\n.action-buttons {\\n display: flex;\\n gap: 8px;\\n}\\n\\n.btn-water {\\n background-color: #3498db;\\n}\\n.btn-water:hover { background-color: #2980b9; }\\n\\n.habit-item.done .btn-water {\\n background-color: #95a5a6;\\n}\\n.habit-item.done .btn-water:hover { background-color: #7f8c8d; }\\n\\n.btn-delete {\\n background-color: #e74c3c;\\n padding: 12px 15px;\\n}\\n.btn-delete:hover { background-color: #c0392b; }\\n\\n/* Garden Grid */\\n.garden-grid {\\n display: flex;\\n flex-direction: column;\\n gap: 15px;\\n margin-top: 15px;\\n overflow-x: auto;\\n padding-bottom: 10px;\\n}\\n\\n.day-labels {\\n display: flex;\\n margin-left: 140px; /* Aligns with plots after the habit label */\\n gap: 8px;\\n}\\n\\n.day-label {\\n width: 45px;\\n text-align: center;\\n font-size: 0.8rem;\\n color: var(--text-muted);\\n font-weight: 500;\\n}\\n\\n.garden-row {\\n display: flex;\\n align-items: center;\\n gap: 15px;\\n}\\n\\n.garden-label {\\n width: 125px;\\n font-weight: 500;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n color: var(--text-main);\\n}\\n\\n.garden-days {\\n display: flex;\\n gap: 8px;\\n}\\n\\n.garden-plot {\\n width: 45px;\\n height: 45px;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n font-size: 24px;\\n border-radius: 8px;\\n cursor: help;\\n transition: transform 0.2s;\\n}\\n\\n.garden-plot:hover {\\n transform: scale(1.1);\\n}\\n\\n.garden-plot.planted {\\n background-color: var(--dirt);\\n box-shadow: inset 0 0 10px rgba(0,0,0,0.1);\\n}\\n\\n.garden-plot.bloomed {\\n background-color: var(--grass);\\n}\\n\\n.empty-state {\\n color: var(--text-muted);\\n font-style: italic;\\n text-align: center;\\n padding: 20px;\\n}\\n"
|
|
22513
|
-
filename: src/style.css
|
|
22514
|
-
embed_ref: src-style.css-c17573
|
|
22515
|
-
status: finished
|
|
22516
|
-
line_count: 222`,
|
|
22517
|
-
"parent_embed_id": null,
|
|
22518
|
-
"embed_ids": null
|
|
22519
|
-
},
|
|
22520
|
-
{
|
|
22521
|
-
"embed_id": "35a05ba6-a5a5-492e-9785-19d93a24cabf",
|
|
22522
|
-
"type": "code",
|
|
22523
|
-
"content": `type: code
|
|
22524
|
-
app_id: code
|
|
22525
|
-
skill_id: code
|
|
22526
|
-
language: html
|
|
22527
|
-
code: "<!doctype html>\\n<html lang=\\"en\\">\\n <head>\\n <meta charset=\\"UTF-8\\" />\\n <meta name=\\"viewport\\" content=\\"width=device-width, initial-scale=1.0\\" />\\n <title>Habit Garden</title>\\n <link rel=\\"stylesheet\\" href=\\"/src/style.css\\" />\\n </head>\\n <body>\\n <div id=\\"app\\">\\n <header>\\n <h1>\u{1F33B} Habit Garden</h1>\\n <p>Plant seeds today, watch them bloom.</p>\\n </header>\\n\\n <main>\\n <section class=\\"add-habit\\">\\n <input type=\\"text\\" id=\\"new-habit-input\\" placeholder=\\"Enter a new habit (e.g., Read 10 pages)...\\" />\\n <button id=\\"add-habit-btn\\">Plant Habit</button>\\n </section>\\n\\n <section class=\\"today-habits\\">\\n <h2>Today's Tasks</h2>\\n <div id=\\"today-list\\"></div>\\n </section>\\n\\n <section class=\\"garden-view\\">\\n <h2>Your Garden (Last 7 Days)</h2>\\n <div id=\\"garden-container\\"></div>\\n </section>\\n </main>\\n </div>\\n \\n <script type=\\"module\\" src=\\"/src/main.js\\"></script>\\n </body>\\n</html>\\n"
|
|
22528
|
-
filename: index.html
|
|
22529
|
-
embed_ref: index.html-35a05b
|
|
22530
|
-
status: finished
|
|
22531
|
-
line_count: 37`,
|
|
22532
|
-
"parent_embed_id": null,
|
|
22533
|
-
"embed_ids": null
|
|
22534
|
-
},
|
|
22535
|
-
{
|
|
22536
|
-
"embed_id": "6205b216-da05-4bf4-8d4c-d4a30e50ba6b",
|
|
22537
|
-
"type": "code",
|
|
22538
|
-
"content": 'type: code\napp_id: code\nskill_id: code\nlanguage: json\ncode: "{\\n \\"name\\": \\"habit-garden\\",\\n \\"private\\": true,\\n \\"version\\": \\"1.0.0\\",\\n \\"type\\": \\"module\\",\\n \\"scripts\\": {\\n \\"dev\\": \\"vite\\",\\n \\"build\\": \\"vite build\\",\\n \\"preview\\": \\"vite preview\\"\\n },\\n \\"devDependencies\\": {\\n \\"vite\\": \\"^5.0.0\\"\\n }\\n}\\n"\nfilename: package.json\nembed_ref: package.json-6205b2\nstatus: finished\nline_count: 15',
|
|
22539
|
-
"parent_embed_id": null,
|
|
22540
|
-
"embed_ids": null
|
|
22541
|
-
}
|
|
22542
|
-
],
|
|
22543
|
-
metadata: {
|
|
22544
|
-
featured: true,
|
|
22545
|
-
order: 2,
|
|
22546
|
-
content_embed_examples: []
|
|
22547
|
-
}
|
|
22548
|
-
};
|
|
22549
|
-
|
|
22550
22459
|
// ../ui/src/demo_chats/data/example_chats/pdf-read-secret-word.ts
|
|
22551
22460
|
var pdfReadSecretWordChat = {
|
|
22552
22461
|
chat_id: "example-pdf-read-secret-word",
|
|
@@ -25503,7 +25412,6 @@ var ALL_EXAMPLE_CHATS = [
|
|
|
25503
25412
|
cancelTestReminderChat,
|
|
25504
25413
|
fediverseActivitypubSocialSearchChat,
|
|
25505
25414
|
mastodonAccountRecentPostsChat,
|
|
25506
|
-
habitGardenViteAppChat,
|
|
25507
25415
|
pdfReadSecretWordChat,
|
|
25508
25416
|
pdfViewPageLayoutChat,
|
|
25509
25417
|
pdfSearchEncryptionChat,
|
|
@@ -28179,7 +28087,10 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
|
|
|
28179
28087
|
text: "Private local personalization"
|
|
28180
28088
|
},
|
|
28181
28089
|
title: {
|
|
28182
|
-
text: "
|
|
28090
|
+
text: "Explore what you can do:"
|
|
28091
|
+
},
|
|
28092
|
+
active_title: {
|
|
28093
|
+
text: "What are your interests?"
|
|
28183
28094
|
},
|
|
28184
28095
|
continue: {
|
|
28185
28096
|
text: "Continue"
|
|
@@ -32953,20 +32864,6 @@ Taking control of a small, self-directed project is often the best antidote to t
|
|
|
32953
32864
|
text: '```json\n{"type": "app_skill_use", "embed_id": "040ef265-5dc8-4512-b443-b52bc86f7a6b", "app_id": "web", "skill_id": "search", "query": "Airbus Beluga and BelugaXL history and usage Europe airplane parts", "provider": "Brave"}\n```\n\n```json\n{"type": "app_skill_use", "embed_id": "f483e089-ff31-472e-9b0d-28f03b92eee1", "app_id": "images", "skill_id": "search", "query": "Airbus BelugaXL transporting airplane parts", "provider": "Brave"}\n```\n\n```json\n{"type": "app_skill_use", "embed_id": "893f5c33-f98b-46e7-b81a-475a94827b35", "app_id": "images", "skill_id": "search", "query": "Airbus Beluga A300-600ST vs BelugaXL A330-743L", "provider": "Brave"}\n```\n\nYes, you\'re exactly right! Airbus used the original NASA-style **Super Guppies** until the 1990s, but they eventually built their own specialized versions to transport massive wings and fuselage sections between their factories across Europe.\n\nThe aircraft you are thinking of is the **Airbus Beluga**. There are two generations:\n\n### 1. Airbus BelugaST (The Original)\nIntroduced in 1995, the **BelugaST** (Super Transporter) was based on the Airbus A300-600. It was designed specifically to replace the aging Super Guppy fleet. For nearly 30 years, it was the workhorse that connected Airbus production sites in France, Germany, the UK, and Spain.\n\n[!](embed:airbus.com-lTo)\n[!](embed:aviationa2z.com-fNJ)\n\n### 2. Airbus BelugaXL (The New Version)\nThe "new version" you mentioned is the **BelugaXL**, which entered service in 2020. Based on the much larger **Airbus A330**, it was built to keep up with the production of the A350 jetliner.\n* **Capacity:** It can carry **two A350 wings** at once, whereas the original Beluga could only carry one.\n* **The "Smile":** It is famous for its "smiling whale" livery, which was chosen by Airbus employees in a company-wide vote.\n\n[!](embed:cnn.com-5jh)\n[!](embed:simpleflying.com-N3v)\n[!](embed:gettyimages.com-8Kw)\n\n### Why are they used?\nAirbus builds different parts of its planes in different countries (e.g., wings in the UK, tails in Spain, fuselages in Germany). Because these parts are too large to fit on trains or standard cargo planes, the Beluga "swallows" them through a massive front-opening door and flies them to final assembly lines in **Toulouse, France**, or **Hamburg, Germany**.\n\nWould you like to see a [video of how they load a wing](https://www.youtube.com/results?search_query=airbus+belugaxl+loading+wing) into the BelugaXL, or are you interested in how it compares to Boeing\'s version, the [Dreamlifter](https://en.wikipedia.org/wiki/Boeing_Dreamlifter)?'
|
|
32954
32865
|
}
|
|
32955
32866
|
},
|
|
32956
|
-
habit_garden_vite_app: {
|
|
32957
|
-
title: {
|
|
32958
|
-
text: "Habit Garden Vite App"
|
|
32959
|
-
},
|
|
32960
|
-
summary: {
|
|
32961
|
-
text: "Build a runnable habit-tracking garden app from generated Vite project files."
|
|
32962
|
-
},
|
|
32963
|
-
message_1: {
|
|
32964
|
-
text: "Create a complete runnable Vite browser app called Habit Garden as a multi-file project. Include package.json, index.html, src/main.js, src/style.css, and any other needed files. The app should let me add habits, mark today's progress, and show a weekly garden visualization. Please return the full project files so OpenMates can preview it as an application."
|
|
32965
|
-
},
|
|
32966
|
-
message_2: {
|
|
32967
|
-
text: 'Here is a complete, runnable Vite project for your **Habit Garden**. It uses vanilla JavaScript, CSS, and HTML. The app stores your habits in the browser\'s `localStorage` so you won\'t lose your progress when you refresh. \n\nEvery habit you add gets assigned a unique flower. When you complete a habit for the day, that flower blooms in your garden grid; if you miss it, it stays a tiny sprout.\n\n### `package.json`\n```json\n{"type": "code", "embed_id": "6205b216-da05-4bf4-8d4c-d4a30e50ba6b"}\n```\n\n\n\n### `index.html`\n```json\n{"type": "code", "embed_id": "35a05ba6-a5a5-492e-9785-19d93a24cabf"}\n```\n\n\n\n### `src/style.css`\n```json\n{"type": "code", "embed_id": "c175730b-6e35-4e35-b9dd-49eacc1abe81"}\n```\n\n```json\n{"type": "application", "embed_id": "4020cf81-f490-4da8-bd42-c4ea456327f3", "app_id": "code", "skill_id": "application"}\n```\n\n\n\n### `src/main.js`\n```json\n{"type": "code", "embed_id": "c1c32384-39e9-4d22-b8b5-238acb293f2a"}\n```\n\n\n\nEnjoy building and watering your digital habits! Let me know if you\'d like to extend it further, for example by adding streaks or customizing the flower types.\n---\n*\u26A0\uFE0F This is educational information only and not professional psychological advice. For mental health concerns, please consult a qualified therapist or counselor. If you\'re experiencing a crisis, contact emergency services or a crisis hotline immediately.*'
|
|
32968
|
-
}
|
|
32969
|
-
},
|
|
32970
32867
|
habit_tracker_onboarding_draft: {
|
|
32971
32868
|
title: {
|
|
32972
32869
|
text: "Habit Tracker Onboarding Draft"
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1093,6 +1093,66 @@ interface DocsSearchResult {
|
|
|
1093
1093
|
|
|
1094
1094
|
declare function defaultCloneBranchForVersion(version: string): string | null;
|
|
1095
1095
|
|
|
1096
|
+
interface OpenMatesOptions {
|
|
1097
|
+
apiKey?: string;
|
|
1098
|
+
apiUrl?: string;
|
|
1099
|
+
}
|
|
1100
|
+
interface ChatCreateOptions {
|
|
1101
|
+
saveToAccount?: boolean;
|
|
1102
|
+
}
|
|
1103
|
+
interface ChatListOptions {
|
|
1104
|
+
limit?: number;
|
|
1105
|
+
offset?: number;
|
|
1106
|
+
}
|
|
1107
|
+
interface EncryptedChatMetadata {
|
|
1108
|
+
id: string;
|
|
1109
|
+
encrypted_title?: string;
|
|
1110
|
+
encrypted_chat_key?: string;
|
|
1111
|
+
updated_at?: string | number;
|
|
1112
|
+
created_at?: string | number;
|
|
1113
|
+
[key: string]: unknown;
|
|
1114
|
+
}
|
|
1115
|
+
interface ChatResponse {
|
|
1116
|
+
content?: string;
|
|
1117
|
+
[key: string]: unknown;
|
|
1118
|
+
}
|
|
1119
|
+
declare class OpenMatesConfigError extends Error {
|
|
1120
|
+
constructor(message: string);
|
|
1121
|
+
}
|
|
1122
|
+
declare class OpenMatesApiError extends Error {
|
|
1123
|
+
readonly status: number;
|
|
1124
|
+
readonly data: unknown;
|
|
1125
|
+
constructor(status: number, data: unknown);
|
|
1126
|
+
}
|
|
1127
|
+
declare class OpenMates {
|
|
1128
|
+
readonly apps: OpenMatesApps;
|
|
1129
|
+
readonly chats: OpenMatesChats;
|
|
1130
|
+
private readonly apiKey?;
|
|
1131
|
+
private readonly apiUrl;
|
|
1132
|
+
constructor(options?: OpenMatesOptions);
|
|
1133
|
+
request<T>(path: string, body?: unknown): Promise<T>;
|
|
1134
|
+
get<T>(path: string): Promise<T>;
|
|
1135
|
+
private headers;
|
|
1136
|
+
private parseResponse;
|
|
1137
|
+
}
|
|
1138
|
+
declare class OpenMatesApps {
|
|
1139
|
+
private readonly client;
|
|
1140
|
+
constructor(client: OpenMates);
|
|
1141
|
+
run<T = unknown>(appId: string, skillId: string, input: unknown): Promise<T>;
|
|
1142
|
+
}
|
|
1143
|
+
declare class OpenMatesChats {
|
|
1144
|
+
private readonly client;
|
|
1145
|
+
constructor(client: OpenMates);
|
|
1146
|
+
create(options?: ChatCreateOptions): Promise<OpenMatesChat>;
|
|
1147
|
+
list(options?: ChatListOptions): Promise<EncryptedChatMetadata[]>;
|
|
1148
|
+
}
|
|
1149
|
+
declare class OpenMatesChat {
|
|
1150
|
+
private readonly client;
|
|
1151
|
+
private readonly saveToAccount;
|
|
1152
|
+
constructor(client: OpenMates, saveToAccount: boolean);
|
|
1153
|
+
send(message: string): Promise<ChatResponse>;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1096
1156
|
declare const ASSISTANT_FEEDBACK_THANKS = "Thanks for the feedback!";
|
|
1097
1157
|
declare const ASSISTANT_FEEDBACK_REPORT_TITLE = "Assistant response quality bad:";
|
|
1098
1158
|
type AssistantFeedbackDecision = {
|
|
@@ -1103,4 +1163,4 @@ type AssistantFeedbackDecision = {
|
|
|
1103
1163
|
};
|
|
1104
1164
|
declare function buildAssistantFeedbackDecision(rating: number): AssistantFeedbackDecision;
|
|
1105
1165
|
|
|
1106
|
-
export { ASSISTANT_FEEDBACK_REPORT_TITLE, ASSISTANT_FEEDBACK_THANKS, type AssistantFeedbackDecision, type AuthMethodsStatus, type BackupCodesResult, type BankTransferOrderDetails, type BankTransferStatus, type CachedChat, type CachedNewChatSuggestion, type ChatListPage, type CliSignupResult, type DecryptedEmbed, type DecryptedMemoryEntry, type DecryptedMessage, type DecryptedNewChatSuggestion, type DocsFile, type DocsFolder, type DocsSearchResult, type DocsTree, type GiftCardBankTransferStatus, INTEREST_TAG_IDS, type InterestTagId, MATE_NAMES, MEMORY_TYPE_REGISTRY, type MemoryFieldDef, type MemoryTypeDef, OpenMatesClient, type OpenMatesClientOptions, type OpenMatesSession, type SyncCache, type TopicPreferencesPayload, type TotpSetupStartResult, buildAssistantFeedbackDecision, defaultCloneBranchForVersion, deriveAppUrl, normalizeInterestTagIds };
|
|
1166
|
+
export { ASSISTANT_FEEDBACK_REPORT_TITLE, ASSISTANT_FEEDBACK_THANKS, type AssistantFeedbackDecision, type AuthMethodsStatus, type BackupCodesResult, type BankTransferOrderDetails, type BankTransferStatus, type CachedChat, type CachedNewChatSuggestion, type ChatCreateOptions, type ChatListOptions, type ChatListPage, type ChatResponse, type CliSignupResult, type DecryptedEmbed, type DecryptedMemoryEntry, type DecryptedMessage, type DecryptedNewChatSuggestion, type DocsFile, type DocsFolder, type DocsSearchResult, type DocsTree, type EncryptedChatMetadata, type GiftCardBankTransferStatus, INTEREST_TAG_IDS, type InterestTagId, MATE_NAMES, MEMORY_TYPE_REGISTRY, type MemoryFieldDef, type MemoryTypeDef, OpenMates, OpenMatesApiError, OpenMatesClient, type OpenMatesClientOptions, OpenMatesConfigError, type OpenMatesOptions, type OpenMatesSession, type SyncCache, type TopicPreferencesPayload, type TotpSetupStartResult, buildAssistantFeedbackDecision, defaultCloneBranchForVersion, deriveAppUrl, normalizeInterestTagIds };
|
package/dist/index.js
CHANGED
|
@@ -11,15 +11,140 @@ import {
|
|
|
11
11
|
getExtForLang,
|
|
12
12
|
normalizeInterestTagIds,
|
|
13
13
|
serializeToYaml
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DV72I4CF.js";
|
|
15
15
|
import "./chunk-AXNRPVLE.js";
|
|
16
|
+
|
|
17
|
+
// src/sdk.ts
|
|
18
|
+
var DEFAULT_API_URL = "https://api.openmates.org";
|
|
19
|
+
var OpenMatesConfigError = class extends Error {
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.name = "OpenMatesConfigError";
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var OpenMatesApiError = class extends Error {
|
|
26
|
+
status;
|
|
27
|
+
data;
|
|
28
|
+
constructor(status, data) {
|
|
29
|
+
super(`OpenMates API request failed with HTTP ${status}`);
|
|
30
|
+
this.name = "OpenMatesApiError";
|
|
31
|
+
this.status = status;
|
|
32
|
+
this.data = data;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var OpenMates = class {
|
|
36
|
+
apps;
|
|
37
|
+
chats;
|
|
38
|
+
apiKey;
|
|
39
|
+
apiUrl;
|
|
40
|
+
constructor(options = {}) {
|
|
41
|
+
this.apiKey = options.apiKey ?? process.env.OPENMATES_API_KEY;
|
|
42
|
+
this.apiUrl = (options.apiUrl ?? DEFAULT_API_URL).replace(/\/$/, "");
|
|
43
|
+
this.apps = new OpenMatesApps(this);
|
|
44
|
+
this.chats = new OpenMatesChats(this);
|
|
45
|
+
}
|
|
46
|
+
async request(path, body) {
|
|
47
|
+
if (!this.apiKey) {
|
|
48
|
+
throw new OpenMatesConfigError("OpenMates API key is required");
|
|
49
|
+
}
|
|
50
|
+
const response = await fetch(`${this.apiUrl}${path}`, {
|
|
51
|
+
method: "POST",
|
|
52
|
+
headers: this.headers(),
|
|
53
|
+
body: body === void 0 ? void 0 : JSON.stringify(body)
|
|
54
|
+
});
|
|
55
|
+
return this.parseResponse(response);
|
|
56
|
+
}
|
|
57
|
+
async get(path) {
|
|
58
|
+
if (!this.apiKey) {
|
|
59
|
+
throw new OpenMatesConfigError("OpenMates API key is required");
|
|
60
|
+
}
|
|
61
|
+
const response = await fetch(`${this.apiUrl}${path}`, {
|
|
62
|
+
method: "GET",
|
|
63
|
+
headers: this.headers(false)
|
|
64
|
+
});
|
|
65
|
+
return this.parseResponse(response);
|
|
66
|
+
}
|
|
67
|
+
headers(hasBody = true) {
|
|
68
|
+
const headers = {
|
|
69
|
+
Accept: "application/json",
|
|
70
|
+
Authorization: `Bearer ${this.apiKey}`,
|
|
71
|
+
"X-OpenMates-SDK": "npm",
|
|
72
|
+
"X-OpenMates-Device-Identity": `${process.platform}:${process.arch}`
|
|
73
|
+
};
|
|
74
|
+
if (hasBody) {
|
|
75
|
+
headers["Content-Type"] = "application/json";
|
|
76
|
+
}
|
|
77
|
+
return headers;
|
|
78
|
+
}
|
|
79
|
+
async parseResponse(response) {
|
|
80
|
+
let data = {};
|
|
81
|
+
try {
|
|
82
|
+
data = await response.json();
|
|
83
|
+
} catch {
|
|
84
|
+
data = {};
|
|
85
|
+
}
|
|
86
|
+
if (!response.ok) {
|
|
87
|
+
throw new OpenMatesApiError(response.status, data);
|
|
88
|
+
}
|
|
89
|
+
return data;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
var OpenMatesApps = class {
|
|
93
|
+
client;
|
|
94
|
+
constructor(client) {
|
|
95
|
+
this.client = client;
|
|
96
|
+
}
|
|
97
|
+
async run(appId, skillId, input) {
|
|
98
|
+
return this.client.request(`/v1/apps/${appId}/skills/${skillId}`, {
|
|
99
|
+
input_data: input,
|
|
100
|
+
parameters: {}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var OpenMatesChats = class {
|
|
105
|
+
client;
|
|
106
|
+
constructor(client) {
|
|
107
|
+
this.client = client;
|
|
108
|
+
}
|
|
109
|
+
async create(options = {}) {
|
|
110
|
+
return new OpenMatesChat(this.client, options.saveToAccount === true);
|
|
111
|
+
}
|
|
112
|
+
async list(options = {}) {
|
|
113
|
+
const params = new URLSearchParams();
|
|
114
|
+
params.set("limit", String(options.limit ?? 10));
|
|
115
|
+
if (options.offset !== void 0) params.set("offset", String(options.offset));
|
|
116
|
+
const query = params.toString();
|
|
117
|
+
const result = await this.client.get(
|
|
118
|
+
`/v1/sdk/chats${query ? `?${query}` : ""}`
|
|
119
|
+
);
|
|
120
|
+
return result.chats;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var OpenMatesChat = class {
|
|
124
|
+
client;
|
|
125
|
+
saveToAccount;
|
|
126
|
+
constructor(client, saveToAccount) {
|
|
127
|
+
this.client = client;
|
|
128
|
+
this.saveToAccount = saveToAccount;
|
|
129
|
+
}
|
|
130
|
+
async send(message) {
|
|
131
|
+
const result = await this.client.request("/v1/sdk/chats", {
|
|
132
|
+
message,
|
|
133
|
+
save_to_account: this.saveToAccount
|
|
134
|
+
});
|
|
135
|
+
return result.response ?? result;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
16
138
|
export {
|
|
17
139
|
ASSISTANT_FEEDBACK_REPORT_TITLE,
|
|
18
140
|
ASSISTANT_FEEDBACK_THANKS,
|
|
19
141
|
INTEREST_TAG_IDS,
|
|
20
142
|
MATE_NAMES,
|
|
21
143
|
MEMORY_TYPE_REGISTRY,
|
|
144
|
+
OpenMates,
|
|
145
|
+
OpenMatesApiError,
|
|
22
146
|
OpenMatesClient,
|
|
147
|
+
OpenMatesConfigError,
|
|
23
148
|
buildAssistantFeedbackDecision,
|
|
24
149
|
defaultCloneBranchForVersion,
|
|
25
150
|
deriveAppUrl,
|