@bendyline/gilde 0.3.6 → 0.3.7
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/authoring/chat-models/muse-glimmer-30b-q4.json +29 -3
- package/authoring/chat-models/nemotron3.5-bolt-e4b-q4.json +29 -3
- package/authoring/chat-models/qwen3.8-27b-q2.json +21 -5
- package/authoring/chat-models/qwen3.8-27b-q3.json +21 -5
- package/authoring/chat-models/qwen3.8-27b-q4.json +21 -5
- package/authoring/chat-models/qwen3.8-27b-q6.json +26 -6
- package/authoring/chat-models/qwen3.8-27b-q8.json +27 -6
- package/authoring/chat-models/qwen3.8-flash-next-q2.json +6 -3
- package/authoring/page-demo-bootstrap.js +96 -23
- package/data/chat-models/index.json +1 -1
- package/data/chat-models/mu/muse-glimmer-30b-q4/manifest.json +25 -2
- package/data/chat-models/mu/muse-glimmer-30b-q4/versions/1.0.3/manifest.json +31 -0
- package/data/chat-models/ne/nemotron3.5-bolt-e4b-q4/manifest.json +21 -4
- package/data/chat-models/ne/nemotron3.5-bolt-e4b-q4/versions/1.0.2/manifest.json +26 -0
- package/data/chat-models/qw/qwen3.8-27b-q2/manifest.json +20 -3
- package/data/chat-models/qw/qwen3.8-27b-q2/versions/1.0.1/manifest.json +31 -0
- package/data/chat-models/qw/qwen3.8-27b-q3/manifest.json +23 -6
- package/data/chat-models/qw/qwen3.8-27b-q3/versions/1.0.2/manifest.json +31 -0
- package/data/chat-models/qw/qwen3.8-27b-q4/manifest.json +20 -3
- package/data/chat-models/qw/qwen3.8-27b-q4/versions/1.0.6/manifest.json +128 -0
- package/data/chat-models/qw/qwen3.8-27b-q6/manifest.json +25 -9
- package/data/chat-models/qw/qwen3.8-27b-q6/versions/1.0.4/manifest.json +138 -0
- package/data/chat-models/qw/qwen3.8-27b-q8/manifest.json +20 -3
- package/data/chat-models/qw/qwen3.8-27b-q8/versions/1.0.3/manifest.json +148 -0
- package/data/chat-models/qw/qwen3.8-flash-next-q2/manifest.json +5 -2
- package/data/chat-models/qw/qwen3.8-flash-next-q2/versions/1.0.4/manifest.json +47 -0
- package/data/chat-models/raw-index.json +1 -1
- package/data/project-types/bo/books-and-close/versions/1.1.0/about.md +16 -0
- package/data/project-types/bo/books-and-close/versions/1.1.0/close.json +8 -0
- package/data/project-types/bo/books-and-close/versions/1.1.0/ledger.json +5 -0
- package/data/project-types/bo/books-and-close/versions/1.1.0/manifest.json +496 -0
- package/data/project-types/bo/books-and-close/versions/1.1.0/mission.md +5 -0
- package/data/project-types/bo/books-and-close/versions/1.1.0/pages/books/application.js +417 -0
- package/data/project-types/bo/books-and-close/versions/1.1.0/pages/books/demo-chat.js +515 -0
- package/data/project-types/bo/books-and-close/versions/1.1.0/pages/books/index.html +880 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/about.md +13 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/assets.json +11 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/campaign.json +13 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/manifest.json +610 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/mission.md +6 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/pages/campaign/application.js +439 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/pages/campaign/demo-chat.js +290 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/pages/campaign/index.html +624 -0
- package/data/project-types/ca/campaign-room/versions/1.1.0/results.json +4 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/about.md +7 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/care.json +4 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/manifest.json +232 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/meds.json +8 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/mission.md +7 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/pages/dashboard/application.js +186 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/pages/dashboard/demo-chat.js +224 -0
- package/data/project-types/ca/caregiving-binder/versions/1.2.0/pages/dashboard/index.html +365 -0
- package/data/project-types/ca/cash-flow-planner/versions/1.1.0/about.md +15 -0
- package/data/project-types/ca/cash-flow-planner/versions/1.1.0/cashflow.json +11 -0
- package/data/project-types/ca/cash-flow-planner/versions/1.1.0/manifest.json +443 -0
- package/data/project-types/ca/cash-flow-planner/versions/1.1.0/mission.md +6 -0
- package/data/project-types/ca/cash-flow-planner/versions/1.1.0/pages/forecast/application.js +441 -0
- package/data/project-types/ca/cash-flow-planner/versions/1.1.0/pages/forecast/demo-chat.js +517 -0
- package/data/project-types/ca/cash-flow-planner/versions/1.1.0/pages/forecast/index.html +848 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/about.md +13 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/manifest.json +376 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/milestones.json +10 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/mission.md +5 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/pages/delivery/application.js +272 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/pages/delivery/demo-chat.js +185 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/pages/delivery/index.html +593 -0
- package/data/project-types/cl/client-delivery/versions/1.1.0/projects.json +10 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/about.md +12 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/evidence.json +4 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/manifest.json +361 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/mission.md +5 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/obligations.json +9 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/pages/register/application.js +292 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/pages/register/demo-chat.js +156 -0
- package/data/project-types/co/compliance-register/versions/1.1.0/pages/register/index.html +406 -0
- package/data/project-types/co/content-studio/versions/1.1.0/about.md +12 -0
- package/data/project-types/co/content-studio/versions/1.1.0/calendar.json +10 -0
- package/data/project-types/co/content-studio/versions/1.1.0/manifest.json +541 -0
- package/data/project-types/co/content-studio/versions/1.1.0/mission.md +6 -0
- package/data/project-types/co/content-studio/versions/1.1.0/pages/studio/application.js +413 -0
- package/data/project-types/co/content-studio/versions/1.1.0/pages/studio/demo-chat.js +247 -0
- package/data/project-types/co/content-studio/versions/1.1.0/pages/studio/index.html +486 -0
- package/data/project-types/co/content-studio/versions/1.1.0/pieces.json +12 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/about.md +15 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/actions.json +9 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/feedback.json +4 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/manifest.json +512 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/mission.md +6 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/pages/voice/application.js +303 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/pages/voice/demo-chat.js +276 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/pages/voice/index.html +832 -0
- package/data/project-types/cu/customer-voice/versions/1.1.0/themes.json +8 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/about.md +20 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/manifest.json +70 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/mission.md +4 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/analytics.js +63 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/application.js +118 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/dashboard.css +94 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/dashboard.js +177 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/datasets.js +44 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/demo-chat.js +181 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/demo.js +27 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/index.html +142 -0
- package/data/project-types/da/data-analysis/versions/1.1.0/pages/insights.js +136 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/about.md +6 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/manifest.json +95 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/mission.md +3 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/pages/gallery/application.js +124 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/pages/gallery/demo-chat.js +236 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/pages/gallery/index.html +238 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/schemes/index.json +9 -0
- package/data/project-types/de/design-scheme/versions/1.1.0/schemes/warm-dusk.json +4 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/about.md +14 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/budget.json +5 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/event.json +12 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/guests.json +9 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/manifest.json +785 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/mission.md +7 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/pages/desk/application.js +1114 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/pages/desk/demo-chat.js +229 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/pages/desk/index.html +864 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/vendors.json +10 -0
- package/data/project-types/ev/event-desk/versions/1.1.0/venues.json +11 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/about.md +7 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/budget.json +5 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/guests.json +10 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/manifest.json +260 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/mission.md +6 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/pages/dashboard/application.js +234 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/pages/dashboard/demo-chat.js +231 -0
- package/data/project-types/ev/event-planner/versions/1.1.0/pages/dashboard/index.html +322 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/about.md +8 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/craftbooks/training-recap.json +34 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/manifest.json +249 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/mission.md +7 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/pages/dashboard/application.js +148 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/pages/dashboard/demo-chat.js +253 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/pages/dashboard/index.html +419 -0
- package/data/project-types/fi/fitness-coach/versions/1.2.0/training.json +6 -0
- package/data/project-types/fl/flashcards/versions/1.3.0/about.md +8 -0
- package/data/project-types/fl/flashcards/versions/1.3.0/deck.json +7 -0
- package/data/project-types/fl/flashcards/versions/1.3.0/manifest.json +243 -0
- package/data/project-types/fl/flashcards/versions/1.3.0/mission.md +6 -0
- package/data/project-types/fl/flashcards/versions/1.3.0/pages/review/application.js +147 -0
- package/data/project-types/fl/flashcards/versions/1.3.0/pages/review/demo-chat.js +331 -0
- package/data/project-types/fl/flashcards/versions/1.3.0/pages/review/index.html +635 -0
- package/data/project-types/fr/freelance-office/versions/1.1.0/about.md +6 -0
- package/data/project-types/fr/freelance-office/versions/1.1.0/invoices.json +9 -0
- package/data/project-types/fr/freelance-office/versions/1.1.0/manifest.json +215 -0
- package/data/project-types/fr/freelance-office/versions/1.1.0/mission.md +6 -0
- package/data/project-types/fr/freelance-office/versions/1.1.0/pages/dashboard/application.js +194 -0
- package/data/project-types/fr/freelance-office/versions/1.1.0/pages/dashboard/demo-chat.js +244 -0
- package/data/project-types/fr/freelance-office/versions/1.1.0/pages/dashboard/index.html +275 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.1.0/about.md +7 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.1.0/donations.json +7 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.1.0/manifest.json +175 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.1.0/mission.md +6 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.1.0/pages/dashboard/application.js +158 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.1.0/pages/dashboard/demo-chat.js +171 -0
- package/data/project-types/fu/fundraiser-hq/versions/1.1.0/pages/dashboard/index.html +247 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/about.md +14 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/manifest.json +549 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/mission.md +6 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/opportunities.json +12 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/pages/grants/application.js +370 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/pages/grants/demo-chat.js +197 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/pages/grants/index.html +501 -0
- package/data/project-types/gr/grants-and-proposals/versions/1.1.0/requirements.json +8 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/about.md +20 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/candidates.json +12 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/feedback.json +4 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/manifest.json +428 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/mission.md +5 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/pages/desk/application.js +345 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/pages/desk/demo-chat.js +231 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/pages/desk/index.html +523 -0
- package/data/project-types/hi/hiring-desk/versions/1.1.0/roles.json +10 -0
- package/data/project-types/ho/household-budget/versions/1.1.0/about.md +6 -0
- package/data/project-types/ho/household-budget/versions/1.1.0/ledger.json +5 -0
- package/data/project-types/ho/household-budget/versions/1.1.0/manifest.json +191 -0
- package/data/project-types/ho/household-budget/versions/1.1.0/mission.md +5 -0
- package/data/project-types/ho/household-budget/versions/1.1.0/pages/dashboard/application.js +176 -0
- package/data/project-types/ho/household-budget/versions/1.1.0/pages/dashboard/demo-chat.js +207 -0
- package/data/project-types/ho/household-budget/versions/1.1.0/pages/dashboard/index.html +291 -0
- package/data/project-types/ho/household-manual/versions/1.1.0/about.md +7 -0
- package/data/project-types/ho/household-manual/versions/1.1.0/manifest.json +236 -0
- package/data/project-types/ho/household-manual/versions/1.1.0/mission.md +8 -0
- package/data/project-types/ho/household-manual/versions/1.1.0/pages/dashboard/application.js +196 -0
- package/data/project-types/ho/household-manual/versions/1.1.0/pages/dashboard/demo-chat.js +178 -0
- package/data/project-types/ho/household-manual/versions/1.1.0/pages/dashboard/index.html +327 -0
- package/data/project-types/ho/household-manual/versions/1.1.0/systems.json +8 -0
- package/data/project-types/im/image-feed/versions/1.1.0/about.md +21 -0
- package/data/project-types/im/image-feed/versions/1.1.0/manifest.json +330 -0
- package/data/project-types/im/image-feed/versions/1.1.0/mission.md +10 -0
- package/data/project-types/im/image-feed/versions/1.1.0/pages/gallery/application.js +111 -0
- package/data/project-types/im/image-feed/versions/1.1.0/pages/gallery/demo-chat.js +269 -0
- package/data/project-types/im/image-feed/versions/1.1.0/pages/gallery/index.html +899 -0
- package/data/project-types/im/image-feed/versions/1.1.0/posts/index.json +4 -0
- package/data/project-types/im/image-feed/versions/1.1.0/style-guide.md +24 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/about.md +12 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/items.json +9 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/manifest.json +381 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/mission.md +6 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/orders.json +10 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/pages/stock/application.js +320 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/pages/stock/demo-chat.js +200 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/pages/stock/index.html +398 -0
- package/data/project-types/in/inventory-reorder/versions/1.1.0/pages/stock/rules.js +665 -0
- package/data/project-types/index.json +1 -1
- package/data/project-types/jo/job-hunt/versions/1.1.0/about.md +10 -0
- package/data/project-types/jo/job-hunt/versions/1.1.0/activity.json +4 -0
- package/data/project-types/jo/job-hunt/versions/1.1.0/manifest.json +296 -0
- package/data/project-types/jo/job-hunt/versions/1.1.0/mission.md +9 -0
- package/data/project-types/jo/job-hunt/versions/1.1.0/pages/dashboard/application.js +240 -0
- package/data/project-types/jo/job-hunt/versions/1.1.0/pages/dashboard/demo-chat.js +176 -0
- package/data/project-types/jo/job-hunt/versions/1.1.0/pages/dashboard/index.html +424 -0
- package/data/project-types/jo/job-hunt/versions/1.1.0/pipeline.json +6 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/about.md +8 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/manifest.json +245 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/mission.md +4 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/pages/dashboard/application.js +118 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/pages/dashboard/demo-chat.js +439 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/pages/dashboard/index.html +503 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/progress.json +10 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/reviews.json +3 -0
- package/data/project-types/la/language-trainer/versions/1.2.0/scenarios.json +84 -0
- package/data/project-types/li/life-binder/versions/1.1.0/about.md +7 -0
- package/data/project-types/li/life-binder/versions/1.1.0/documents.json +145 -0
- package/data/project-types/li/life-binder/versions/1.1.0/manifest.json +206 -0
- package/data/project-types/li/life-binder/versions/1.1.0/mission.md +6 -0
- package/data/project-types/li/life-binder/versions/1.1.0/pages/dashboard/application.js +172 -0
- package/data/project-types/li/life-binder/versions/1.1.0/pages/dashboard/demo-chat.js +184 -0
- package/data/project-types/li/life-binder/versions/1.1.0/pages/dashboard/index.html +287 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/about.md +10 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/manifest.json +245 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/menu.json +5 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/mission.md +5 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/pages/dashboard/application.js +243 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/pages/dashboard/demo-chat.js +139 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/pages/dashboard/index.html +253 -0
- package/data/project-types/me/meal-planner/versions/1.1.0/pantry.json +9 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/about.md +14 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/hires.json +8 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/manifest.json +325 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/mission.md +5 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/pages/plans/application.js +248 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/pages/plans/demo-chat.js +188 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/pages/plans/index.html +439 -0
- package/data/project-types/ne/new-hire-onboarding/versions/1.1.0/tasks.json +8 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/about.md +7 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/chapters.json +10 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/manifest.json +233 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/mission.md +7 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/pages/dashboard/application.js +225 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/pages/dashboard/demo-chat.js +283 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/pages/dashboard/index.html +342 -0
- package/data/project-types/no/novel-writing-room/versions/1.1.0/sessions.json +6 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/about.md +15 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/manifest.json +614 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/mission.md +3 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/pages/quotes/application.js +386 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/pages/quotes/demo-chat.js +263 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/pages/quotes/index.html +941 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/quotes.json +10 -0
- package/data/project-types/qu/quotes-and-bids/versions/1.1.0/rates.json +8 -0
- package/data/project-types/raw-index.json +1 -1
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/about.md +10 -0
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/activity.json +4 -0
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/deals.json +12 -0
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/manifest.json +450 -0
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/mission.md +3 -0
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/pages/pipeline/application.js +270 -0
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/pages/pipeline/demo-chat.js +219 -0
- package/data/project-types/sa/sales-pipeline/versions/1.1.0/pages/pipeline/index.html +710 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/about.md +13 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/availability.json +8 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/manifest.json +544 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/mission.md +5 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/pages/roster/application.js +418 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/pages/roster/demo-chat.js +218 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/pages/roster/index.html +466 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/pages/roster/rules.js +878 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/rules.json +4 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/shifts.json +8 -0
- package/data/project-types/sh/shift-roster/versions/1.1.0/staff.json +8 -0
- package/data/project-types/so/social-feed/versions/1.1.0/about.md +19 -0
- package/data/project-types/so/social-feed/versions/1.1.0/manifest.json +348 -0
- package/data/project-types/so/social-feed/versions/1.1.0/mission.md +10 -0
- package/data/project-types/so/social-feed/versions/1.1.0/pages/dashboard/application.js +119 -0
- package/data/project-types/so/social-feed/versions/1.1.0/pages/dashboard/demo-chat.js +321 -0
- package/data/project-types/so/social-feed/versions/1.1.0/pages/dashboard/index.html +837 -0
- package/data/project-types/so/social-feed/versions/1.1.0/posts/index.json +4 -0
- package/data/project-types/so/social-feed/versions/1.1.0/voice-guide.md +22 -0
- package/data/project-types/so/sop-library/versions/1.1.0/about.md +15 -0
- package/data/project-types/so/sop-library/versions/1.1.0/manifest.json +347 -0
- package/data/project-types/so/sop-library/versions/1.1.0/mission.md +4 -0
- package/data/project-types/so/sop-library/versions/1.1.0/pages/library/application.js +235 -0
- package/data/project-types/so/sop-library/versions/1.1.0/pages/library/demo-chat.js +184 -0
- package/data/project-types/so/sop-library/versions/1.1.0/pages/library/index.html +529 -0
- package/data/project-types/so/sop-library/versions/1.1.0/sops/index.json +10 -0
- package/data/project-types/su/support-desk/versions/1.1.0/about.md +15 -0
- package/data/project-types/su/support-desk/versions/1.1.0/manifest.json +395 -0
- package/data/project-types/su/support-desk/versions/1.1.0/mission.md +5 -0
- package/data/project-types/su/support-desk/versions/1.1.0/pages/desk/application.js +274 -0
- package/data/project-types/su/support-desk/versions/1.1.0/pages/desk/demo-chat.js +206 -0
- package/data/project-types/su/support-desk/versions/1.1.0/pages/desk/index.html +588 -0
- package/data/project-types/su/support-desk/versions/1.1.0/tickets.json +10 -0
- package/data/project-types/te/team-goals/versions/1.1.0/about.md +12 -0
- package/data/project-types/te/team-goals/versions/1.1.0/actions.json +8 -0
- package/data/project-types/te/team-goals/versions/1.1.0/checkins.json +4 -0
- package/data/project-types/te/team-goals/versions/1.1.0/goals.json +9 -0
- package/data/project-types/te/team-goals/versions/1.1.0/keyresults.json +8 -0
- package/data/project-types/te/team-goals/versions/1.1.0/manifest.json +528 -0
- package/data/project-types/te/team-goals/versions/1.1.0/mission.md +5 -0
- package/data/project-types/te/team-goals/versions/1.1.0/pages/goals/application.js +347 -0
- package/data/project-types/te/team-goals/versions/1.1.0/pages/goals/demo-chat.js +206 -0
- package/data/project-types/te/team-goals/versions/1.1.0/pages/goals/index.html +547 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/about.md +15 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/completions.json +4 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/courses.json +8 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/manifest.json +428 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/mission.md +5 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/pages/tracker/application.js +299 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/pages/tracker/demo-chat.js +225 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/pages/tracker/index.html +555 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/people.json +8 -0
- package/data/project-types/tr/training-tracker/versions/1.1.0/quizzes.json +8 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/about.md +7 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/journal.json +4 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/manifest.json +296 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/mission.md +4 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/packing.json +8 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/pages/dashboard/application.js +176 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/pages/dashboard/demo-chat.js +264 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/pages/dashboard/index.html +373 -0
- package/data/project-types/tr/trip-planner/versions/1.1.0/trip.json +8 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/about.md +15 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/contracts.json +10 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/manifest.json +545 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/mission.md +5 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/pages/desk/application.js +323 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/pages/desk/demo-chat.js +236 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/pages/desk/index.html +540 -0
- package/data/project-types/ve/vendor-contracts/versions/1.1.0/vendors.json +8 -0
- package/package.json +1 -1
- package/schemas/chat-model-identity.schema.json +184 -0
- package/schemas/chat-model-version.schema.json +19 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
// App-owned composition; platform components come from the Gezel host.
|
|
2
|
+
(function(){
|
|
3
|
+
'use strict';
|
|
4
|
+
var config={
|
|
5
|
+
"title": "Listening to customers",
|
|
6
|
+
"description": "Log a review or survey answer, agree an action, or ask what customers are saying.",
|
|
7
|
+
"load": "loadVoice",
|
|
8
|
+
"placeholder": "Paste a review, or ask",
|
|
9
|
+
"tabs": [
|
|
10
|
+
{
|
|
11
|
+
"id": "home",
|
|
12
|
+
"label": "Home",
|
|
13
|
+
"sections": [
|
|
14
|
+
".tiles",
|
|
15
|
+
"#themes-section",
|
|
16
|
+
"#replies-section"
|
|
17
|
+
],
|
|
18
|
+
"actions": [
|
|
19
|
+
"log_feedback",
|
|
20
|
+
"add_action",
|
|
21
|
+
"set_action_status"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "feedback",
|
|
26
|
+
"label": "Feedback",
|
|
27
|
+
"sections": [
|
|
28
|
+
"#import-section",
|
|
29
|
+
"#feedback-section"
|
|
30
|
+
],
|
|
31
|
+
"actions": [
|
|
32
|
+
"log_feedback"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "actions",
|
|
37
|
+
"label": "Actions",
|
|
38
|
+
"sections": [
|
|
39
|
+
"#actions-section"
|
|
40
|
+
],
|
|
41
|
+
"actions": [
|
|
42
|
+
"add_action",
|
|
43
|
+
"set_action_status"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"filter": {
|
|
48
|
+
"container": "#feedback-section .table-wrap",
|
|
49
|
+
"selector": "tbody tr",
|
|
50
|
+
"label": "Find feedback",
|
|
51
|
+
"placeholder": "Words, name or source"
|
|
52
|
+
},
|
|
53
|
+
"actions": [
|
|
54
|
+
{
|
|
55
|
+
"tool": "log_feedback",
|
|
56
|
+
"pageTool": "page_log_feedback",
|
|
57
|
+
"title": "Log feedback",
|
|
58
|
+
"fields": [
|
|
59
|
+
{
|
|
60
|
+
"name": "text",
|
|
61
|
+
"label": "What they said",
|
|
62
|
+
"required": true,
|
|
63
|
+
"multiline": true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "source",
|
|
67
|
+
"label": "Where",
|
|
68
|
+
"required": true,
|
|
69
|
+
"options": [
|
|
70
|
+
{
|
|
71
|
+
"value": "google",
|
|
72
|
+
"label": "Google"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"value": "yelp",
|
|
76
|
+
"label": "Yelp"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"value": "tripadvisor",
|
|
80
|
+
"label": "Tripadvisor"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"value": "survey",
|
|
84
|
+
"label": "Survey"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"value": "email",
|
|
88
|
+
"label": "Email"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"value": "social",
|
|
92
|
+
"label": "Social"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"value": "in-person",
|
|
96
|
+
"label": "In person"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"value": "other",
|
|
100
|
+
"label": "Other"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "stars",
|
|
106
|
+
"label": "Stars",
|
|
107
|
+
"options": [
|
|
108
|
+
"5",
|
|
109
|
+
"4",
|
|
110
|
+
"3",
|
|
111
|
+
"2",
|
|
112
|
+
"1"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"name": "author",
|
|
117
|
+
"label": "Name, as written"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "themes",
|
|
121
|
+
"label": "Themes",
|
|
122
|
+
"placeholder": "Slow weekend service"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "receivedAt",
|
|
126
|
+
"label": "Date",
|
|
127
|
+
"type": "date"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"description": "A review, survey answer or comment, word for word."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"tool": "add_action",
|
|
134
|
+
"pageTool": "page_add_action",
|
|
135
|
+
"title": "Add an action",
|
|
136
|
+
"fields": [
|
|
137
|
+
{
|
|
138
|
+
"name": "title",
|
|
139
|
+
"label": "Action",
|
|
140
|
+
"required": true,
|
|
141
|
+
"placeholder": "Add a second barista on weekend mornings"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "theme",
|
|
145
|
+
"label": "For the theme",
|
|
146
|
+
"options": [],
|
|
147
|
+
"records": {
|
|
148
|
+
"path": "themes.json",
|
|
149
|
+
"list": "records",
|
|
150
|
+
"labelFields": [
|
|
151
|
+
"fields.name"
|
|
152
|
+
],
|
|
153
|
+
"where": {
|
|
154
|
+
"field": "status",
|
|
155
|
+
"not": [
|
|
156
|
+
"retired"
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "owner",
|
|
163
|
+
"label": "Owner"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "dueAt",
|
|
167
|
+
"label": "Due",
|
|
168
|
+
"type": "date"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"description": "Something the café will change because of what customers said."
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"tool": "set_action_status",
|
|
175
|
+
"pageTool": "page_set_action_status",
|
|
176
|
+
"title": "Update an action",
|
|
177
|
+
"submitLabel": "Update",
|
|
178
|
+
"fields": [
|
|
179
|
+
{
|
|
180
|
+
"name": "id",
|
|
181
|
+
"label": "Action",
|
|
182
|
+
"required": true,
|
|
183
|
+
"options": [],
|
|
184
|
+
"records": {
|
|
185
|
+
"path": "actions.json",
|
|
186
|
+
"list": "records",
|
|
187
|
+
"labelFields": [
|
|
188
|
+
"fields.title"
|
|
189
|
+
],
|
|
190
|
+
"where": {
|
|
191
|
+
"field": "status",
|
|
192
|
+
"not": [
|
|
193
|
+
"done"
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "status",
|
|
200
|
+
"label": "Now",
|
|
201
|
+
"required": true,
|
|
202
|
+
"options": [
|
|
203
|
+
{
|
|
204
|
+
"value": "doing",
|
|
205
|
+
"label": "Doing"
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"value": "done",
|
|
209
|
+
"label": "Done"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"name": "note",
|
|
215
|
+
"label": "Note"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"description": "Mark it underway or done."
|
|
219
|
+
}
|
|
220
|
+
]
|
|
221
|
+
};
|
|
222
|
+
// Shared app composition v2 (the Gezel app UX guide). On hosts with page components version 2,
|
|
223
|
+
// actions are keys that open dialogs, settings are inline forms, and config.tabs groups the page into
|
|
224
|
+
// Home, noun and Settings tabs. Older hosts keep the expandable forms and an "On this page" list.
|
|
225
|
+
function boot(){
|
|
226
|
+
var api=window.gezel,kit=api&&api.ui.components,main=document.querySelector('main');if(!api||!main)return;
|
|
227
|
+
var handles=[],stops=[],stopped=false,forms=[],revision=0,byTool={};
|
|
228
|
+
// An action's key is its id when two forms share one tool, otherwise its tool.
|
|
229
|
+
function keyOf(action){return action.id||action.tool;}
|
|
230
|
+
(config.actions||[]).forEach(function(action){byTool[keyOf(action)]=action;});
|
|
231
|
+
var problem=document.createElement('p');problem.className='app-problem';problem.hidden=true;problem.setAttribute('role','status');main.prepend(problem);
|
|
232
|
+
function error(e){problem.hidden=false;problem.textContent='Could not refresh this view. '+(e.message||'Try again.');}
|
|
233
|
+
if(!kit||!kit.appLayout){problem.hidden=false;problem.textContent='Update Gezel to use the fullscreen conversation and page controls.';return;}
|
|
234
|
+
var layout=kit.appLayout(main,{title:config.title,description:config.description,chat:config.chat===false?false:{lockRecipient:!config.crew,showAddress:!!config.crew,showThreads:false,placeholder:config.placeholder||'Talk with your companion…',attachments:!!config.attachments,dictation:!!config.dictation}});handles.push(layout);
|
|
235
|
+
var modern=kit.version>=2&&typeof kit.tabs==='function';
|
|
236
|
+
document.documentElement.toggleAttribute('data-app-legacy',!modern);
|
|
237
|
+
function valueAt(object,path){return path.split('.').reduce(function(value,key){return value==null?undefined:value[key];},object);}
|
|
238
|
+
// People read dates, not ISO strings: "2026-11-12" becomes "Thu, Nov 12" in choice labels.
|
|
239
|
+
function shown(value){if(typeof value!=='string'||!/^\d{4}-\d{2}-\d{2}$/.test(value))return value;var date=new Date(value+'T12:00:00');return isFinite(date)?date.toLocaleDateString(undefined,{weekday:'short',month:'short',day:'numeric'}):value;}
|
|
240
|
+
// A choice list may leave out finished records: {field:'status', not:['done']} or {field, in:[...]}.
|
|
241
|
+
function included(record,where){if(!where)return true;var value=valueAt(record,where.field);if(where.in&&where.in.indexOf(value)<0)return false;if(where.not&&where.not.indexOf(value)>=0)return false;return true;}
|
|
242
|
+
function mountForm(mount,action,options){
|
|
243
|
+
var fields=action.fields.map(function(f){return Object.assign({},f);});
|
|
244
|
+
var form={action:action,fields:fields,last:'',inline:!!options&&options.presentation==='inline'};
|
|
245
|
+
form.handle=kit.actionForm(mount,Object.assign({title:action.title,description:action.description,buttonLabel:action.buttonLabel,successMessage:action.successMessage,tool:action.pageTool,fields:fields,mapInput:action.mapInput,submitLabel:action.submitLabel||'Save',onSaved:async function(){window.dispatchEvent(new Event('gezel-app-data-changed'));if(form.inline)setTimeout(function(){void refreshCurrent(form);},0);}},options||{}));
|
|
246
|
+
handles.push(form.handle);forms.push(form);return form;
|
|
247
|
+
}
|
|
248
|
+
function recordPaths(){return Array.from(new Set(forms.flatMap(function(form){return form.fields.filter(function(f){return f.records;}).map(function(f){return f.records.path;});})));}
|
|
249
|
+
async function refreshChoices(){var current=++revision;try{var paths=recordPaths();var docs=await Promise.all(paths.map(function(path){return api.data.read(path);}));if(stopped||revision!==current)return;forms.forEach(function(form){form.fields.forEach(function(field){if(!field.records)return;var spec=field.records,doc=docs[paths.indexOf(spec.path)],records=(valueAt(doc,spec.list)||[]).filter(function(record){return included(record,spec.where);});field.options=records.map(function(record){return {value:record.id,label:spec.labelFields.map(function(path){return shown(valueAt(record,path));}).filter(Boolean).join(' · ')};});});var next=JSON.stringify(form.fields);if(next!==form.last){form.last=next;form.handle.update({fields:form.fields});}});}catch(e){error(e);}}
|
|
250
|
+
// A settings form shows what is saved now: action.current = {path, fields: {formField: 'data.path'}}. A form being edited is left alone.
|
|
251
|
+
// The form just saved refreshes after its save settles (it ignores resets while busy), even though focus is still on its Save key.
|
|
252
|
+
async function refreshCurrent(saved){try{await Promise.all(forms.filter(function(form){return form.inline&&form.action.current&&form.handle.reset&&(!saved||form===saved);}).map(async function(form){var spec=form.action.current,doc=await api.data.read(spec.path);if(stopped||form!==saved&&form.handle.element.matches(':focus-within'))return;var values={};Object.keys(spec.fields).forEach(function(name){var value=valueAt(doc,spec.fields[name]);if(value!==undefined&&value!==null)values[name]=value;});form.handle.reset(values);}));}catch(e){error(e);}}
|
|
253
|
+
function headerEnd(){var heading=main.querySelector('h1'),sub=heading&&heading.nextElementSibling&&heading.nextElementSibling.tagName==='P'?heading.nextElementSibling:null;return config.headerEnd?main.querySelector(config.headerEnd):sub||heading;}
|
|
254
|
+
function insertAfterHeader(node){var anchor=headerEnd();if(anchor)anchor.after(node);else main.prepend(node);}
|
|
255
|
+
// Keys for the given tools, the first (or the named one) drawn as the view's one primary.
|
|
256
|
+
function actionBar(tools,primary){var row=document.createElement('div');row.className='app-actionbar';tools=(tools||[]).filter(function(tool){return byTool[tool];});if(primary===undefined)primary=tools[0];tools.forEach(function(tool){var mount=document.createElement('div');row.append(mount);mountForm(mount,byTool[tool],{presentation:'dialog',primary:tool===primary});});row.hidden=!tools.length;return row;}
|
|
257
|
+
if(!modern)buildLegacy();else if(config.tabs)buildTabs();else insertAfterHeader(actionBar(config.bar||(config.actions||[]).filter(function(action){return !action.rowOnly;}).map(keyOf),config.primary));
|
|
258
|
+
if(modern)buildRowDialogs();
|
|
259
|
+
void refreshChoices();void refreshCurrent();
|
|
260
|
+
// Pages announce their own edits; a demo's watches fire only for the sample conversation, so listen as well.
|
|
261
|
+
function dataChanged(){void refreshChoices();void refreshCurrent();}
|
|
262
|
+
window.addEventListener('gezel-app-data-changed',dataChanged);stops.push(function(){window.removeEventListener('gezel-app-data-changed',dataChanged);});
|
|
263
|
+
recordPaths().forEach(function(path){stops.push(api.data.watch(path,refreshChoices));});
|
|
264
|
+
Array.from(new Set(forms.filter(function(form){return form.inline&&form.action.current;}).map(function(form){return form.action.current.path;}))).forEach(function(path){stops.push(api.data.watch(path,function(){void refreshCurrent();}));});
|
|
265
|
+
// config.filter: {container, selector, label, placeholder?, minItems?}, or the older [container, selector, label].
|
|
266
|
+
var filter=Array.isArray(config.filter)?{container:config.filter[0],selector:config.filter[1],label:config.filter[2]}:config.filter;
|
|
267
|
+
if(filter&&kit.collectionFilter){var container=document.querySelector(filter.container);if(container){var search=document.createElement('div');search.className='app-search';container.before(search);handles.push(kit.collectionFilter(search,{container:container,selector:filter.selector,label:filter.label,placeholder:filter.placeholder,minItems:filter.minItems===undefined?8:filter.minItems}));}}
|
|
268
|
+
function buildTabs(){
|
|
269
|
+
var bar=document.createElement('div'),last=bar,specs=[];bar.className='app-tabs';insertAfterHeader(bar);
|
|
270
|
+
config.tabs.forEach(function(tab){
|
|
271
|
+
var panel=document.createElement('div');panel.className='app-panel';panel.id='app-panel-'+tab.id;last.after(panel);last=panel;
|
|
272
|
+
if((tab.actions||[]).length)panel.append(actionBar(tab.actions,tab.primary));
|
|
273
|
+
var settings=(tab.settings||[]).filter(function(tool){return byTool[tool];});
|
|
274
|
+
if(settings.length){var box=document.createElement('div');box.className='app-settings';panel.append(box);settings.forEach(function(tool){var mount=document.createElement('div');box.append(mount);mountForm(mount,byTool[tool],{presentation:'inline',clearOnSave:false,submitLabel:byTool[tool].submitLabel||'Save changes'});});}
|
|
275
|
+
(tab.sections||[]).forEach(function(selector){main.querySelectorAll(selector).forEach(function(node){if(!node.closest('.app-panel'))panel.append(node);});});
|
|
276
|
+
specs.push({id:tab.id,label:tab.label,panel:panel,count:tab.badge});
|
|
277
|
+
});
|
|
278
|
+
var tabs=kit.tabs(bar,{label:config.tabsLabel||'App sections',tabs:specs.map(function(spec){return {id:spec.id,label:spec.label,panel:spec.panel};})});handles.push(tabs);
|
|
279
|
+
// A tab's badge mirrors a count the page already shows (tab.badge is that element's selector), so the two never disagree.
|
|
280
|
+
var shown='';
|
|
281
|
+
function badges(){var next=specs.map(function(spec){var node=spec.count?document.querySelector(spec.count):null,text=node?node.textContent.trim():'';return {id:spec.id,label:spec.label,panel:spec.panel,badge:/^[1-9][0-9]*$/.test(text)?text:''};}),key=next.map(function(tab){return tab.badge;}).join('|');if(key!==shown){shown=key;tabs.update({tabs:next});}}
|
|
282
|
+
if(specs.some(function(spec){return spec.count;})){var observer=new MutationObserver(badges);observer.observe(main,{subtree:true,childList:true,characterData:true});stops.push(function(){observer.disconnect();});badges();}
|
|
283
|
+
window.appTabs={select:function(id){tabs.select(id);}};
|
|
284
|
+
}
|
|
285
|
+
// Any action can open from a record: <button data-app-action="tool" data-app-values='{"id":"…"}'>. These dialogs sit
|
|
286
|
+
// outside the tab panels, so a hidden tab never hides one.
|
|
287
|
+
function buildRowDialogs(){
|
|
288
|
+
var box=document.createElement('div'),openers={};box.className='app-dialogs';main.append(box);
|
|
289
|
+
(config.actions||[]).forEach(function(action){var mount=document.createElement('div');box.append(mount);openers[keyOf(action)]=mountForm(mount,action,{presentation:'dialog',trigger:false});});
|
|
290
|
+
main.addEventListener('click',function(event){var target=event.target.closest&&event.target.closest('[data-app-action]');var form=target&&openers[target.getAttribute('data-app-action')];if(!form)return;event.preventDefault();var values={};try{values=JSON.parse(target.getAttribute('data-app-values')||'{}');}catch(_){}form.handle.open(values);});
|
|
291
|
+
}
|
|
292
|
+
function buildLegacy(){
|
|
293
|
+
var actions=document.createElement('div');actions.className='app-actions';actions.hidden=!(config.actions||[]).length;
|
|
294
|
+
var anchor=main.querySelector('h1');if(anchor){var after=anchor.nextElementSibling;after?after.after(actions):anchor.after(actions);}else main.prepend(actions);
|
|
295
|
+
(config.actions||[]).forEach(function(action){var mount=document.createElement('div');actions.append(mount);mountForm(mount,action);});
|
|
296
|
+
var skip='dialog,[role=dialog]'+(config.navExclude?','+config.navExclude:'');
|
|
297
|
+
var headings=Array.from(main.querySelectorAll('h2')).filter(function(h){return h.textContent.trim()&&!h.closest(skip);});
|
|
298
|
+
if(headings.length>1&&headings.length<10){var nav=document.createElement('nav');nav.className='app-section-nav';nav.setAttribute('aria-label','On this page');headings.forEach(function(h,index){if(!h.id)h.id='app-section-'+index;var id=h.id,label=Array.from(h.childNodes).filter(function(n){return n.nodeType===3;}).map(function(n){return n.data;}).join('').trim()||h.textContent.trim(),link=document.createElement('a');link.href='#'+id;link.textContent=label;link.onclick=function(event){var target=document.getElementById(id);if(target){event.preventDefault();target.scrollIntoView({block:'start'});}};nav.append(link);});actions.before(nav);}
|
|
299
|
+
}
|
|
300
|
+
window.addEventListener('pagehide',function(){stopped=true;revision++;stops.forEach(function(stop){stop();});handles.reverse().forEach(function(handle){handle.destroy();});},{once:true});
|
|
301
|
+
}
|
|
302
|
+
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',boot,{once:true});else boot();
|
|
303
|
+
})();
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
// The standalone demo's sample conversation. In Gezel, the researcher's
|
|
2
|
+
// replies come from the model the person chooses; here they are scripted,
|
|
3
|
+
// and every change goes through the same tools the crew calls.
|
|
4
|
+
window.demoChat = (function () {
|
|
5
|
+
'use strict';
|
|
6
|
+
var DAY = 86400000;
|
|
7
|
+
var SOURCE_LABEL = { google: 'Google', yelp: 'Yelp', tripadvisor: 'Tripadvisor', survey: 'survey', email: 'email', social: 'social', 'in-person': 'in-person', other: 'other' };
|
|
8
|
+
// What a comment is about, by its words; `key` finds the board's theme, `name` starts one.
|
|
9
|
+
var HINTS = [
|
|
10
|
+
{ re: /\b(wait|waited|line|slow|minutes|queue)\b/i, key: 'slow', name: 'Slow weekend service', kind: 'problem', title: 'Cut the weekend wait' },
|
|
11
|
+
{ re: /\b(friendly|kind|remembered|lovely|staff|team)\b/i, key: 'friendly', name: 'Friendly staff', kind: 'praise', title: 'Thank the team for the kind words' },
|
|
12
|
+
{ re: /\b(croissants?|pastr\w*|sold out|gone by)\b/i, key: 'sell out', name: 'Pastries sell out early', kind: 'problem', title: 'Bake a second batch of almond croissants at 10' },
|
|
13
|
+
{ re: /\b(croissants?|pastr\w*|baking|baked)\b/i, key: 'people love', name: 'Pastries people love', kind: 'praise', title: 'Feature the almond croissant on the menu board' },
|
|
14
|
+
{ re: /\b(oat milk|charge|price|expensive|steep)\b/i, key: 'oat milk', name: 'Oat milk charge', kind: 'problem', title: 'Decide on the oat milk charge' },
|
|
15
|
+
{ re: /\b(seats?|seating|outlets?|window|plugs?)\b/i, key: 'seating', name: 'Seating and outlets', kind: 'request', title: 'Add more seats and outlets' },
|
|
16
|
+
{ re: /\b(opened|opening|open earlier|hours|6:30|commuters?)\b/i, key: 'opening', name: 'Earlier opening hours', kind: 'request', title: 'Try opening at 6:30 on weekdays' },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
function pad(n) { return n < 10 ? '0' + n : String(n); }
|
|
20
|
+
function iso(ms) { var d = new Date(ms); return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()); }
|
|
21
|
+
function niceDate(day) { return new Date(String(day).slice(0, 10) + 'T12:00:00').toLocaleDateString('en-US', { month: 'long', day: 'numeric' }); }
|
|
22
|
+
function daysAgo(day) { return Math.round((Date.parse(iso(Date.now()) + 'T00:00:00') - Date.parse(String(day).slice(0, 10) + 'T00:00:00')) / DAY); }
|
|
23
|
+
function short(text, n) { var t = String(text || '').trim(); return t.length > n ? t.slice(0, n - 1).trim() + '…' : t; }
|
|
24
|
+
function first(name) { return String(name || '').trim().split(/\s+/)[0] || ''; }
|
|
25
|
+
|
|
26
|
+
// The log folded the way the store folds it: entries with their latest themes and replies.
|
|
27
|
+
function state(ctx) {
|
|
28
|
+
return Promise.all([ctx.read('feedback.json'), ctx.read('themes.json'), ctx.read('actions.json')]).then(function (v) {
|
|
29
|
+
var byId = {}, list = [];
|
|
30
|
+
((v[0] && v[0].events) || []).forEach(function (e) {
|
|
31
|
+
var d = e.data || {};
|
|
32
|
+
if (/^(review|survey|comment)$/.test(e.kind) && d.id && !byId[d.id]) {
|
|
33
|
+
var entry = { id: d.id, text: e.note || '', source: d.source, rating: d.rating || null, author: d.author || '', day: d.day, themes: (d.themes || []).slice(), replyNeeded: !!d.replyNeeded, reply: '', posted: false };
|
|
34
|
+
byId[d.id] = entry; list.push(entry); return;
|
|
35
|
+
}
|
|
36
|
+
var t = byId[d.feedbackId];
|
|
37
|
+
if (!t) return;
|
|
38
|
+
if (e.kind === 'tagged' || (e.kind === 'edited' && d.themes)) t.themes = (d.themes || []).slice();
|
|
39
|
+
if (e.kind === 'reply') { t.reply = e.note || t.reply; if (d.posted) t.posted = true; }
|
|
40
|
+
if (e.kind === 'replied') t.posted = true;
|
|
41
|
+
});
|
|
42
|
+
var themes = ((v[1] && v[1].records) || []).filter(function (t) { return t.status !== 'retired'; });
|
|
43
|
+
return { list: list, themes: themes, actions: (v[2] && v[2].records) || [] };
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function themeName(s, id) { var t = s.themes.find(function (x) { return x.id === id; }); return t ? t.fields.name : id; }
|
|
47
|
+
function counts(s, id) {
|
|
48
|
+
var hits = s.list.filter(function (e) { return e.themes.indexOf(id) >= 0; });
|
|
49
|
+
var recent = hits.filter(function (e) { var d = daysAgo(e.day); return d >= 0 && d < 30; }).length;
|
|
50
|
+
var before = hits.filter(function (e) { var d = daysAgo(e.day); return d >= 30 && d < 60; }).length;
|
|
51
|
+
return { recent: recent, before: before, latest: hits.sort(function (a, b) { return String(b.day).localeCompare(String(a.day)); })[0] };
|
|
52
|
+
}
|
|
53
|
+
function trendWords(c) {
|
|
54
|
+
return !c.recent && !c.before ? 'quiet' : !c.before ? 'new this month' : c.recent > c.before ? 'up from ' + c.before + ' the month before' : c.recent < c.before ? 'down from ' + c.before + ' the month before' : 'the same as the month before';
|
|
55
|
+
}
|
|
56
|
+
// The theme a comment belongs to: an existing one when the words point there, or a new name.
|
|
57
|
+
// Stars decide the side: a glowing review never lands in a complaint, nor a one-star one in praise.
|
|
58
|
+
function themeFor(s, text, rating) {
|
|
59
|
+
var hint = HINTS.find(function (h) {
|
|
60
|
+
if (rating >= 4 && h.kind === 'problem') return false;
|
|
61
|
+
if (rating && rating <= 2 && h.kind === 'praise') return false;
|
|
62
|
+
return h.re.test(text);
|
|
63
|
+
});
|
|
64
|
+
if (!hint) return null;
|
|
65
|
+
var theme = s.themes.find(function (t) { return t.fields.name.toLowerCase().indexOf(hint.key) >= 0; });
|
|
66
|
+
return { name: theme ? theme.fields.name : hint.name, id: theme ? theme.id : null, kind: hint.kind, title: hint.title };
|
|
67
|
+
}
|
|
68
|
+
function owed(s) {
|
|
69
|
+
return s.list.filter(function (e) { return e.replyNeeded && !e.posted; }).sort(function (a, b) { return String(a.day).localeCompare(String(b.day)); });
|
|
70
|
+
}
|
|
71
|
+
function who(e) { return (SOURCE_LABEL[e.source] || e.source) + (e.rating ? ', ' + e.rating + ' of 5' : '') + (e.author ? ', from ' + e.author : ''); }
|
|
72
|
+
// “Carla M.’s Yelp review (2 of 5)” or “the survey answer (3 of 5)”.
|
|
73
|
+
function reviewName(e) {
|
|
74
|
+
var kind = e.source === 'survey' ? 'survey answer' : /^(google|yelp|tripadvisor|social)$/.test(e.source) ? SOURCE_LABEL[e.source] + ' review' : SOURCE_LABEL[e.source] + ' comment';
|
|
75
|
+
return (e.author ? e.author + '’s ' : 'the ') + kind + (e.rating ? ' (' + e.rating + ' of 5)' : '');
|
|
76
|
+
}
|
|
77
|
+
function sentence(text) { return /[.!?]$/.test(text) ? text : text + '.'; }
|
|
78
|
+
function pickEntry(list, text) {
|
|
79
|
+
var words = text.toLowerCase().match(/[a-z]{4,}/g) || [];
|
|
80
|
+
var best = null, score = 0;
|
|
81
|
+
list.forEach(function (e) {
|
|
82
|
+
var hay = (e.author + ' ' + e.source + ' ' + e.text).toLowerCase();
|
|
83
|
+
var hits = words.filter(function (w) { return hay.indexOf(w) >= 0 || hay.indexOf(w.replace(/s$/, '')) >= 0; }).length;
|
|
84
|
+
if (hits > score) { best = e; score = hits; }
|
|
85
|
+
});
|
|
86
|
+
return best;
|
|
87
|
+
}
|
|
88
|
+
function gerund(title) {
|
|
89
|
+
var words = title.split(' '), verb = words[0].toLowerCase();
|
|
90
|
+
verb = /[^e]e$/.test(verb) ? verb.slice(0, -1) + 'ing' : verb + 'ing';
|
|
91
|
+
return [verb].concat(words.slice(1)).join(' ');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function status(ctx) {
|
|
95
|
+
return ctx.invoke('voice_status', {}, 'Read the feedback').then(function () { return state(ctx); }).then(function (s) {
|
|
96
|
+
var month = s.list.filter(function (e) { var d = daysAgo(e.day); return d >= 0 && d < 30; });
|
|
97
|
+
var rated = month.filter(function (e) { return e.rating; });
|
|
98
|
+
var ranked = s.themes.map(function (t) { return { t: t, c: counts(s, t.id) }; }).sort(function (a, b) { return b.c.recent - a.c.recent; });
|
|
99
|
+
var unsorted = s.list.filter(function (e) { return !e.themes.length; }).length;
|
|
100
|
+
return 'In the last 30 days: ' + month.length + ' pieces of feedback' + (rated.length ? ', averaging ' + (Math.round((rated.reduce(function (n, e) { return n + e.rating; }, 0) / rated.length) * 10) / 10) + ' stars' : '') + '. By theme:\n' +
|
|
101
|
+
ranked.map(function (r) {
|
|
102
|
+
return '- **' + r.t.fields.name + '** (' + r.t.fields.kind + '): ' + r.c.recent + (r.c.recent === 1 ? ' mention, ' : ' mentions, ') + trendWords(r.c) + (r.c.latest ? '. Latest: “' + short(r.c.latest.text, 70) + '”' : '');
|
|
103
|
+
}).join('\n') +
|
|
104
|
+
'\n\n' + (ranked[0] && ranked[0].c.recent > ranked[0].c.before ? 'The one to act on is ' + ranked[0].t.fields.name.toLowerCase() + '. ' : '') +
|
|
105
|
+
(unsorted ? unsorted + (unsorted === 1 ? ' new piece isn’t' : ' new pieces aren’t') + ' sorted yet, and ' : '') + owed(s).length + ' reviews still need a reply.';
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function sortNew(ctx) {
|
|
110
|
+
return state(ctx).then(function (s) {
|
|
111
|
+
var unsorted = s.list.filter(function (e) { return !e.themes.length; });
|
|
112
|
+
if (!unsorted.length) return 'Everything is already sorted into themes.';
|
|
113
|
+
var groups = {}, left = [];
|
|
114
|
+
unsorted.forEach(function (e) {
|
|
115
|
+
var t = themeFor(s, e.text, e.rating);
|
|
116
|
+
if (!t) { left.push(e); return; }
|
|
117
|
+
(groups[t.name] = groups[t.name] || { theme: t, items: [] }).items.push(e);
|
|
118
|
+
});
|
|
119
|
+
var names = Object.keys(groups);
|
|
120
|
+
return names.reduce(function (chain, name) {
|
|
121
|
+
var g = groups[name];
|
|
122
|
+
return chain.then(function () {
|
|
123
|
+
return ctx.invoke('tag_feedback', { id: g.items.map(function (e) { return e.id; }).join(', '), themes: name, kind: g.theme.kind }, g.items.map(function (e) { return e.id; }).join(', ') + ': ' + name);
|
|
124
|
+
});
|
|
125
|
+
}, Promise.resolve()).then(function () { return state(ctx); }).then(function (after) {
|
|
126
|
+
var lines = names.map(function (name) {
|
|
127
|
+
var g = groups[name], t = after.themes.find(function (x) { return x.fields.name === name; }), c = t ? counts(after, t.id) : { recent: 0, before: 0 };
|
|
128
|
+
return '- **' + name + '**: ' + g.items.map(function (e) { return '“' + short(e.text, 60) + '” (' + who(e) + ')'; }).join('; ') + '. Now ' + c.recent + ' this month, ' + trendWords(c) + '.';
|
|
129
|
+
});
|
|
130
|
+
return 'Sorted ' + (unsorted.length - left.length) + ' new ' + (unsorted.length - left.length === 1 ? 'piece' : 'pieces') + ':\n' + lines.join('\n') +
|
|
131
|
+
(left.length ? '\n\n' + left.length + ' didn’t fit a theme; tell me what to call it.' : '') +
|
|
132
|
+
(groups['Slow weekend service'] ? '\n\nThat makes the weekend wait the clearest problem on the board.' : '');
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function draftReply(ctx, text) {
|
|
138
|
+
return state(ctx).then(function (s) {
|
|
139
|
+
var e = pickEntry(owed(s), text) || owed(s)[0];
|
|
140
|
+
if (!e) return 'No review is waiting on a reply right now.';
|
|
141
|
+
var t = e.themes[0] ? themeName(s, e.themes[0]) : '';
|
|
142
|
+
var hint = HINTS.find(function (h) { return h.re.test(e.text); });
|
|
143
|
+
var action = s.actions.find(function (a) { return a.status !== 'done' && e.themes.indexOf(a.fields.theme) >= 0; });
|
|
144
|
+
var sorry = /slow|wait/i.test(t) || (hint && hint.key === 'slow') ? 'I’m sorry about the wait; that is far too long.' : /oat|charge/i.test(t) ? 'You’re right to ask about the oat milk charge.' : 'I’m sorry your visit fell short.';
|
|
145
|
+
var reply = (first(e.author) ? first(e.author) + ', thank' : 'Thank') + ' you for telling us. ' + sorry + ' ' +
|
|
146
|
+
(action ? 'We’re ' + gerund(action.fields.title).replace(/^./, function (c) { return c.toLowerCase(); }) + ', so it should be better on your next visit. ' : 'We’re looking at what went wrong. ') +
|
|
147
|
+
'We hope you’ll give us another try.\n\nThe Harbor Street Café team';
|
|
148
|
+
return ctx.invoke('save_reply', { id: e.id, reply: reply }, 'Reply to ' + e.id).then(function () {
|
|
149
|
+
return 'Drafted a reply to ' + reviewName(e) + ':\n\n' + reply + '\n\n' + (action ? 'I mentioned the action already under way, ' + action.fields.title.toLowerCase() + ', and nothing that isn’t on the list. ' : 'I didn’t promise a fix, because no action is on the list yet. ') +
|
|
150
|
+
'It’s saved on the review; post it on ' + (SOURCE_LABEL[e.source] || e.source) + ', then press Mark replied.';
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function markReplied(ctx, text) {
|
|
156
|
+
return state(ctx).then(function (s) {
|
|
157
|
+
var e = pickEntry(owed(s), text);
|
|
158
|
+
if (!e) return 'Which reply did you post? Name the reviewer, like “I posted the reply to Nadia”.';
|
|
159
|
+
return ctx.invoke('save_reply', { id: e.id, posted: true }, e.id + ': replied').then(function () { return state(ctx); }).then(function (after) {
|
|
160
|
+
var left = owed(after);
|
|
161
|
+
return 'Marked ' + reviewName(e) + ' replied. ' + (left.length ? left.length + (left.length === 1 ? ' reply is' : ' replies are') + ' still owed, oldest first: ' + sentence(left.map(function (x) { return x.author || SOURCE_LABEL[x.source]; }).join(', ')) : 'Every review that needs a reply has one.');
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function addAction(ctx, text) {
|
|
167
|
+
return state(ctx).then(function (s) {
|
|
168
|
+
var t = themeFor(s, text, 0);
|
|
169
|
+
if (!t) return 'Which theme is the action for? Say something like “make the oat milk charge an action for Priya”.';
|
|
170
|
+
var owner = (text.match(/\bfor\s+([A-Z][a-z]+)\b/) || [])[1];
|
|
171
|
+
var due = iso(Date.now() + 14 * DAY);
|
|
172
|
+
return ctx.invoke('add_action', { title: t.title, theme: t.name, owner: owner, dueAt: due }, t.title).then(function () { return state(ctx); }).then(function (after) {
|
|
173
|
+
var theme = after.themes.find(function (x) { return x.fields.name === t.name; });
|
|
174
|
+
var c = theme ? counts(after, theme.id) : { recent: 0, before: 0 };
|
|
175
|
+
return 'Added **' + t.title + '**' + (owner ? ' for ' + owner : '') + ', due ' + niceDate(due) + ', against ' + t.name.toLowerCase() + ' (' + c.recent + ' this month, ' + trendWords(c) + '). Its count stays on the board, so you’ll see whether the change lands.';
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function moveAction(ctx, text, status) {
|
|
181
|
+
return state(ctx).then(function (s) {
|
|
182
|
+
var words = text.toLowerCase().match(/[a-z]{4,}/g) || [];
|
|
183
|
+
var best = null, score = 0;
|
|
184
|
+
s.actions.filter(function (a) { return a.status !== 'done'; }).forEach(function (a) {
|
|
185
|
+
var hay = (a.fields.title + ' ' + (a.fields.owner || '') + ' ' + themeName(s, a.fields.theme)).toLowerCase();
|
|
186
|
+
var hits = words.filter(function (w) { return hay.indexOf(w) >= 0; }).length;
|
|
187
|
+
if (hits > score) { best = a; score = hits; }
|
|
188
|
+
});
|
|
189
|
+
if (!best) return 'Which action? Open ones: ' + sentence(s.actions.filter(function (a) { return a.status !== 'done'; }).map(function (a) { return a.fields.title.toLowerCase(); }).join('; ') || 'none');
|
|
190
|
+
return ctx.invoke('set_action_status', { id: best.id, status: status, note: text.trim() }, best.fields.title + ': ' + status).then(function () { return state(ctx); }).then(function (after) {
|
|
191
|
+
var c = best.fields.theme ? counts(after, best.fields.theme) : null;
|
|
192
|
+
return (status === 'done' ? 'Marked **' + best.fields.title + '** done.' : 'Marked **' + best.fields.title + '** under way.') +
|
|
193
|
+
(c ? ' ' + themeName(after, best.fields.theme) + ' has ' + c.recent + (c.recent === 1 ? ' mention' : ' mentions') + ' this month, ' + trendWords(c) + '; I’ll watch whether it settles.' : '');
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function logIt(ctx, text) {
|
|
199
|
+
var words = (text.match(/[“"]([^”"]+)[”"]/) || [])[1];
|
|
200
|
+
if (!words) return Promise.resolve('Paste the customer’s words in quotes and say where it came from, like: log a Google review, “Lovely staff”, 5 stars.');
|
|
201
|
+
words = words.trim().replace(/[,.;]+$/, '') + (/[.!?]$/.test(words.trim()) ? '' : '.');
|
|
202
|
+
var lower = text.toLowerCase();
|
|
203
|
+
var rating = Number((lower.match(/\b([1-5])\s*(?:stars?|of 5|\/5)/) || [])[1]) || undefined;
|
|
204
|
+
var source = /survey/.test(lower) ? 'survey' : /google/.test(lower) ? 'google' : /yelp/.test(lower) ? 'yelp' : /email/.test(lower) ? 'email' : /in person|counter/.test(lower) ? 'in-person' : 'other';
|
|
205
|
+
return state(ctx).then(function (s) {
|
|
206
|
+
var t = themeFor(s, words, rating || 0);
|
|
207
|
+
var input = { text: words, source: source, rating: rating };
|
|
208
|
+
if (t) { input.themes = t.name; input.kind = t.kind; }
|
|
209
|
+
return ctx.invoke('log_feedback', input, short(words, 40)).then(function (out) {
|
|
210
|
+
var id = ((out && out.summary || '').match(/\bfb-\d+/) || [])[0];
|
|
211
|
+
if (!t) return 'Logged it' + (id ? ' as ' + id : '') + '. It doesn’t fit a theme yet; I’ll sort it with the next batch.';
|
|
212
|
+
return state(ctx).then(function (after) {
|
|
213
|
+
var theme = after.themes.find(function (x) { return x.fields.name.toLowerCase() === t.name.toLowerCase(); });
|
|
214
|
+
var c = theme ? counts(after, theme.id) : { recent: 1, before: 0 };
|
|
215
|
+
return 'Logged it' + (id ? ' as ' + id : '') + ' under ' + (t.id ? '**' + t.name + '**' : 'a new theme, **' + t.name + '**') + '. ' +
|
|
216
|
+
(t.id ? 'That makes ' + c.recent + ' this month, ' + trendWords(c) + '.' : 'One mention so far; I’ll flag it if more customers ask.');
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function owedReport(ctx) {
|
|
223
|
+
return ctx.invoke('voice_status', {}, 'Read the feedback').then(function () { return state(ctx); }).then(function (s) {
|
|
224
|
+
var list = owed(s);
|
|
225
|
+
if (!list.length) return 'No replies owed. Every public review of three stars or fewer has one.';
|
|
226
|
+
return list.length + (list.length === 1 ? ' review needs' : ' reviews need') + ' a reply, oldest first:\n' + list.map(function (e) {
|
|
227
|
+
return '- **' + who(e) + '** (' + niceDate(e.day) + '): “' + short(e.text, 110) + '”' + (e.reply ? ', reply drafted, not posted' : '');
|
|
228
|
+
}).join('\n');
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return {
|
|
233
|
+
name: 'Yara',
|
|
234
|
+
role: 'Researcher',
|
|
235
|
+
greeting: 'Hello, I’m Yara. I read everything Harbor Street Café’s customers say. Slow weekend service is the theme on the rise this month, two new reviews aren’t sorted yet, and three still need a reply.',
|
|
236
|
+
suggestions: [
|
|
237
|
+
'What are customers saying this month?',
|
|
238
|
+
'Sort the new reviews into themes',
|
|
239
|
+
'Draft a reply to Carla’s Yelp review',
|
|
240
|
+
'Make the oat milk charge an action for Priya',
|
|
241
|
+
'Log a survey answer: “Wish you opened at 6:30 for commuters,” 4 stars',
|
|
242
|
+
],
|
|
243
|
+
respond: function (text, ctx) {
|
|
244
|
+
var lower = text.toLowerCase();
|
|
245
|
+
if (/\b(import|csv|spreadsheet|upload)\b/.test(lower)) return 'Add the CSV under **All feedback**, in Import reviews from a spreadsheet. I read every row: the review, and the date, stars, name and source when the columns are there. Rows already in the log are skipped, and the new ones arrive unsorted, ready for me to sort into themes.';
|
|
246
|
+
if (/[“"]/.test(text) && /\b(log|add|survey|review|said|wrote)\b/.test(lower)) return logIt(ctx, text);
|
|
247
|
+
if (/\b(sort|tag|group|categori[sz]e)\b/.test(lower)) return sortNew(ctx);
|
|
248
|
+
if (/\b(posted|replied|sent the reply)\b/.test(lower)) return markReplied(ctx, text);
|
|
249
|
+
if (/\b(draft|reply to|respond to|write back|answer)\b/.test(lower)) return draftReply(ctx, text);
|
|
250
|
+
if (/\b(action|barista|batch)\b/.test(lower) && /\b(done|finished|complete|completed)\b/.test(lower)) return moveAction(ctx, text, 'done');
|
|
251
|
+
if (/\b(action|barista|batch)\b/.test(lower) && /\b(started|under way|underway|doing)\b/.test(lower)) return moveAction(ctx, text, 'doing');
|
|
252
|
+
if (/\b(action|to-?do|assign)\b/.test(lower)) return addAction(ctx, text);
|
|
253
|
+
if (/\b(need|needs|owe|owed)\b.{0,20}\brepl/.test(lower)) return owedReport(ctx);
|
|
254
|
+
if (/\b(saying|say|themes?|trends?|this month|this week|summary|complain|happy)\b/.test(lower)) return status(ctx);
|
|
255
|
+
return null;
|
|
256
|
+
},
|
|
257
|
+
reactions: {
|
|
258
|
+
page_import_reviews: function (input, output) {
|
|
259
|
+
var line = output && output.summary ? output.summary.split('. ')[0] + '.' : 'Imported.';
|
|
260
|
+
return line + ' Ask me to sort the new rows into themes when you’re ready.';
|
|
261
|
+
},
|
|
262
|
+
page_mark_replied: function (input, output) {
|
|
263
|
+
return output && typeof output.repliesNeeded === 'number' ? 'Marked replied. ' + (output.repliesNeeded ? output.repliesNeeded + ' still to go.' : 'That was the last one owed.') : 'Marked replied.';
|
|
264
|
+
},
|
|
265
|
+
page_log_feedback: function (input) {
|
|
266
|
+
return input.themes ? 'Logged under ' + input.themes + '.' : 'Logged. I’ll sort it into a theme with the next batch.';
|
|
267
|
+
},
|
|
268
|
+
page_add_action: function (input) {
|
|
269
|
+
return 'On the list: ' + input.title + '. I’ll keep an eye on whether its theme quiets down.';
|
|
270
|
+
},
|
|
271
|
+
page_set_action_status: function (input, output) {
|
|
272
|
+
return output && output.summary ? output.summary.split('. ')[0] + '.' : 'Updated.';
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
})();
|