add version display in UI sidebar + version bump rules
- VERSION file at repo root (0.3.0) - vite.config.ts reads VERSION at build time, injects __OIKOS_VERSION__ - App.svelte shows version in sidebar tooltip + subtle text below logo - AGENTS.md §9: every commit to main MUST bump VERSION (patch=bugfix, minor=new features, major=breaking changes)
This commit is contained in:
14
AGENTS.md
14
AGENTS.md
@@ -203,7 +203,19 @@ wait for the 5-min timer. (This mechanism — and the server-side
|
|||||||
`setup-*.sh` scripts as of 2026-07-12; before that it silently matched
|
`setup-*.sh` scripts as of 2026-07-12; before that it silently matched
|
||||||
nothing, so nothing auto-ran on any client via this path.)
|
nothing, so nothing auto-ran on any client via this path.)
|
||||||
|
|
||||||
## 9. When in doubt
|
## 9. Versioning
|
||||||
|
|
||||||
|
Every commit to `main` **MUST bump the version** in the `VERSION` file at the
|
||||||
|
repo root. The format is semver-ish: `major.minor.patch` (e.g. `0.2.3`).
|
||||||
|
|
||||||
|
Rules:
|
||||||
|
- **patch** (`0.2.2` → `0.2.3`): bugfixes, small tweaks, docs-only changes
|
||||||
|
- **minor** (`0.2.3` → `0.3.0`): new features, new tools, visible functionality
|
||||||
|
- **major** (`0.3.0` → `1.0.0`): breaking changes (API removal, tool retirement)
|
||||||
|
|
||||||
|
The version is shown in the UI sidebar. The `v` prefix is added at build time.
|
||||||
|
|
||||||
|
## 10. When in doubt
|
||||||
|
|
||||||
Use MCP tools: `search_knowledge <query>` for narrative context,
|
Use MCP tools: `search_knowledge <query>` for narrative context,
|
||||||
`get_entity <slug>` for structured data, `get_entity_knowledge <slug>` for
|
`get_entity <slug>` for structured data, `get_entity_knowledge <slug>` for
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
import { Button } from '$lib/components/ui/button'
|
import { Button } from '$lib/components/ui/button'
|
||||||
import { Badge } from '$lib/components/ui/badge'
|
import { Badge } from '$lib/components/ui/badge'
|
||||||
import { Separator } from '$lib/components/ui/separator'
|
import { Separator } from '$lib/components/ui/separator'
|
||||||
|
import { VERSION } from '$lib/version'
|
||||||
import { Toaster } from '$lib/components/ui/sonner'
|
import { Toaster } from '$lib/components/ui/sonner'
|
||||||
import PlusIcon from '@lucide/svelte/icons/plus'
|
import PlusIcon from '@lucide/svelte/icons/plus'
|
||||||
import LayoutDashboardIcon from '@lucide/svelte/icons/layout-dashboard'
|
import LayoutDashboardIcon from '@lucide/svelte/icons/layout-dashboard'
|
||||||
@@ -99,7 +100,7 @@
|
|||||||
<Sidebar.MenuButton
|
<Sidebar.MenuButton
|
||||||
class="data-[slot=sidebar-menu-button]:!p-1.5"
|
class="data-[slot=sidebar-menu-button]:!p-1.5"
|
||||||
onclick={() => navigate('overview')}
|
onclick={() => navigate('overview')}
|
||||||
tooltipContent="Oikos"
|
tooltipContent={`Oikos ${VERSION}`}
|
||||||
>
|
>
|
||||||
{#snippet child({ props })}
|
{#snippet child({ props })}
|
||||||
<button {...props}>
|
<button {...props}>
|
||||||
@@ -112,6 +113,9 @@
|
|||||||
</Sidebar.MenuButton>
|
</Sidebar.MenuButton>
|
||||||
</Sidebar.MenuItem>
|
</Sidebar.MenuItem>
|
||||||
</Sidebar.Menu>
|
</Sidebar.Menu>
|
||||||
|
<div class="group-data-[collapsible=icon]:hidden px-2.5 pb-1">
|
||||||
|
<span class="text-[11px] text-muted-foreground select-none">{VERSION}</span>
|
||||||
|
</div>
|
||||||
<Sidebar.Menu>
|
<Sidebar.Menu>
|
||||||
<Sidebar.MenuItem>
|
<Sidebar.MenuItem>
|
||||||
<Sidebar.MenuButton
|
<Sidebar.MenuButton
|
||||||
|
|||||||
1
web/src/lib/version.ts
Normal file
1
web/src/lib/version.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const VERSION: string = __OIKOS_VERSION__
|
||||||
1
web/src/vite-env.d.ts
vendored
Normal file
1
web/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
declare const __OIKOS_VERSION__: string
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||||
import tailwindcss from '@tailwindcss/vite'
|
import tailwindcss from '@tailwindcss/vite'
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
|
import { readFileSync } from 'fs'
|
||||||
|
|
||||||
|
const version = readFileSync('../VERSION', 'utf-8').trim()
|
||||||
|
|
||||||
// Injects OIKOS_API_TOKEN into proxied /api requests in dev — the API no
|
// Injects OIKOS_API_TOKEN into proxied /api requests in dev — the API no
|
||||||
// longer has a dev-open bypass (plans/2026-07-12-wails-desktop-app.md 0.4),
|
// longer has a dev-open bypass (plans/2026-07-12-wails-desktop-app.md 0.4),
|
||||||
@@ -21,6 +24,9 @@ function authProxy(target: string, rewrite?: (path: string) => string) {
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [tailwindcss(), svelte()],
|
plugins: [tailwindcss(), svelte()],
|
||||||
base: '/',
|
base: '/',
|
||||||
|
define: {
|
||||||
|
__OIKOS_VERSION__: JSON.stringify(`v${version}`),
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: { $lib: '/src/lib' }
|
alias: { $lib: '/src/lib' }
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user