mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-21 22:44:00 +00:00
## Stack Context This is the frontend half of the Company Brain Skills feature. The harness is implemented in supermemoryai/mono#2611. ## What? Add Skills settings with separate Org-wide and Personal sections, Markdown upload autofill, scoped creation and editing, approval controls, and server-driven permissions. ## Why? Members need a focused way to manage their private playbooks while admins create and approve organization-wide guidance. ## Related - Harness: https://github.com/supermemoryai/mono/pull/2611 --- **Session Details** - Session: [View Session](https://supermemory.us1.vorflux.com/agent-sessions/d8c77451-8f55-47ab-a182-5c98da616263) - Requested by: Sreeram Sreedhar (sreeram@supermemory.com) - Address comments on this PR. Add `(aside)` to your comment to have me ignore it.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
// Sections under the /configure route.
|
|
// "tools" is the "Integrations" section, slugged to avoid clashing with /integrations.
|
|
export const CONFIGURE_SECTIONS = [
|
|
"tools",
|
|
"models",
|
|
"workspace-prompt",
|
|
"proactivity",
|
|
"automations",
|
|
"skills",
|
|
] as const
|
|
|
|
export type ConfigureSection = (typeof CONFIGURE_SECTIONS)[number]
|
|
|
|
export const DEFAULT_CONFIGURE_SECTION: ConfigureSection = "tools"
|
|
|
|
export function isConfigureSection(slug: string): slug is ConfigureSection {
|
|
return (CONFIGURE_SECTIONS as readonly string[]).includes(slug)
|
|
}
|
|
|
|
export function configureSectionToPath(section: ConfigureSection): string {
|
|
return section === DEFAULT_CONFIGURE_SECTION
|
|
? "/configure"
|
|
: `/configure/${section}`
|
|
}
|
|
|
|
export function pathToConfigureSection(
|
|
pathname: string,
|
|
): ConfigureSection | null {
|
|
const trimmed = pathname.replace(/\/$/, "")
|
|
if (trimmed === "/configure") return DEFAULT_CONFIGURE_SECTION
|
|
const slug = trimmed.match(/^\/configure\/([^/]+)$/)?.[1]
|
|
if (slug && isConfigureSection(slug)) return slug
|
|
return null
|
|
}
|
|
|
|
export function isConfigurePath(pathname: string): boolean {
|
|
return pathToConfigureSection(pathname) !== null
|
|
}
|