feat(config): default welcome template in jinja2 + sync_interval
This commit is contained in:
parent
19f1795350
commit
d055417377
3 changed files with 43 additions and 5 deletions
|
|
@ -137,6 +137,11 @@ def get_instance_subtitle() -> str:
|
|||
return get_value("instance", "subtitle", default="")
|
||||
|
||||
|
||||
def get_sync_interval() -> str:
|
||||
"""Human-readable refresh cadence shown in the analyst welcome prompt."""
|
||||
return get_value("instance", "sync_interval", default="1 hour")
|
||||
|
||||
|
||||
def get_allowed_domains() -> list:
|
||||
domain = get_value("auth", "allowed_domain", default="")
|
||||
if domain:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,22 @@
|
|||
# {instance_name} — AI Data Analyst
|
||||
{# Default analyst-onboarding welcome prompt for "da analyst setup".
|
||||
Rendered server-side by src/welcome_template.py. Edit this file to change
|
||||
the OSS default; admins override per-instance via /admin/welcome.
|
||||
|
||||
This workspace is connected to {server_url}.
|
||||
Available context (see docs/welcome-template.md for the full reference):
|
||||
instance.name, instance.subtitle
|
||||
server.url, server.hostname
|
||||
sync_interval — string from instance.yaml
|
||||
data_source.type — keboola | bigquery | local
|
||||
tables — list of {name, description, query_mode}
|
||||
metrics.count, metrics.categories
|
||||
marketplaces — list of {slug, name, plugins:[name]}
|
||||
user.email, user.name, user.is_admin, user.groups
|
||||
now, today — datetime / date string
|
||||
#}
|
||||
# {{ instance.name }} — AI Data Analyst
|
||||
|
||||
This workspace is connected to {{ server.url }}.
|
||||
{% if instance.subtitle %}Operated by **{{ instance.subtitle }}**.{% endif %}
|
||||
|
||||
## Rules
|
||||
- Before computing any business metric: run `da metrics show <category>/<name>`
|
||||
|
|
@ -11,8 +27,8 @@ This workspace is connected to {server_url}.
|
|||
- **Personal customizations go in `.claude/CLAUDE.local.md`, NOT here.** This file is regenerated by `da analyst setup --force`; edits here will be lost. CLAUDE.local.md is preserved across regeneration and uploaded on `da sync --upload-only`.
|
||||
|
||||
## Metrics Workflow
|
||||
1. `da metrics list` — find the relevant metric
|
||||
2. `da metrics show revenue/mrr` — read SQL and business rules
|
||||
1. `da metrics list` — find the relevant metric ({{ metrics.count }} available, categories: {{ metrics.categories | join(", ") or "none yet" }})
|
||||
2. `da metrics show <category>/<name>` — read SQL and business rules
|
||||
3. Use the canonical SQL from the metric definition, adapt to the question
|
||||
4. Never invent metric calculations — always check existing definitions first
|
||||
|
||||
|
|
@ -20,7 +36,21 @@ This workspace is connected to {server_url}.
|
|||
- `da sync` — download current data from server
|
||||
- `da sync --docs-only` — just metadata and metrics (fast refresh)
|
||||
- `da sync --upload-only` — upload sessions and local notes to server
|
||||
- Data on the server refreshes every {sync_interval}
|
||||
- Data on the server refreshes every {{ sync_interval }}
|
||||
|
||||
## Available Datasets
|
||||
{% for t in tables -%}
|
||||
- `{{ t.name }}`{% if t.description %} — {{ t.description }}{% endif %}{% if t.query_mode == "remote" %} *(remote, queried on demand)*{% endif %}
|
||||
{% else -%}
|
||||
- _No tables registered yet — ask an admin to register tables in the dashboard._
|
||||
{% endfor %}
|
||||
|
||||
{% if marketplaces -%}
|
||||
## Plugins available to you
|
||||
{% for mp in marketplaces -%}
|
||||
- **{{ mp.name }}** ({{ mp.slug }}): {{ mp.plugins | map(attribute="name") | join(", ") }}
|
||||
{% endfor %}
|
||||
{% endif -%}
|
||||
|
||||
## Remote Queries (BigQuery) — when data isn't on the laptop
|
||||
|
||||
|
|
@ -161,3 +191,5 @@ Run `da sync` to refresh. Rules are pruned automatically when items are revoked.
|
|||
- `user/artifacts/` — analysis outputs, reports, charts
|
||||
- `user/sessions/` — Claude Code session logs
|
||||
- `.claude/CLAUDE.local.md` — your personal notes + workspace customizations. **Never overwritten by `da analyst setup --force`.** Uploaded to the server on `da sync --upload-only`. Put any local-only Claude instructions, project-specific reminders, or temporary notes here — NOT in CLAUDE.md (this file is regenerated from a template).
|
||||
|
||||
_Hello {{ user.name or user.email }} — generated {{ today }}._
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ instance:
|
|||
copyright: "Your Organization"
|
||||
# logo_svg: Full <svg> element for header logo (optional, default: Keboola logo)
|
||||
# Example: '<svg width="120" height="30" viewBox="0 0 100 30" xmlns="http://www.w3.org/2000/svg"><text y="22" font-size="24" fill="#333">Logo</text></svg>'
|
||||
# sync_interval: "1 hour" # Cadence shown in analyst CLAUDE.md (e.g., "1 hour", "30 minutes", "daily")
|
||||
|
||||
# --- Server ---
|
||||
server:
|
||||
|
|
|
|||
Loading…
Reference in a new issue