Skip to content

Commit 8a372fa

Browse files
authored
Merge pull request #80 from coasys/feature/space-templates
Feature: Space Templates
2 parents 489a229 + 06479de commit 8a372fa

47 files changed

Lines changed: 1633 additions & 576 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/rules/we-schema.mdc

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ when `relative` is enabled.
502502
- AudioInput
503503
Props: title: string | undefined, artist: string | undefined, audioUrl: string | FileData | undefined, duration: number | undefined, albumArt: string | undefined, onChange: (property: string, value: unknown) => void, isSelected: () => boolean
504504
- BlockComposer (DesignSystemElement)
505-
Props: visibility?: Visibility, overflowX?: Overflow, overflowY?: Overflow, scrollbarWidth?: ScrollbarWidth, scrollbarGutter?: ScrollbarGutter, editorState?: any, onSave?: ((json: SerializedBlockNode) => void), onReady?: ((api: { save: () => void; }) => void)
505+
Props: visibility?: Visibility, overflowX?: Overflow, overflowY?: Overflow, scrollbarWidth?: ScrollbarWidth, scrollbarGutter?: ScrollbarGutter, editorState?: any, perspective?: PerspectiveProxy | null, onSave?: ((json: SerializedBlockNode) => void), onReady?: ((api: { save: () => void; }) => void)
506506
- BlockPlaceholder
507507
Props: icon: string, label: string, hint?: string, accept?: string, onFileDrop?: ((file: File) => void), onClick?: (() => void)
508508
- BlockRenderer (DesignSystemElement)
@@ -620,7 +620,7 @@ Not schema-renderable — used directly in application code.
620620
Renders a list of messages with a text input, anchored to a screen edge.
621621
Supports streaming indicator, auto-scroll, and header/close controls.
622622
Includes template context header with fork/fresh actions and name+icon picker.
623-
Props: open: boolean, side?: "left" | "right", width?: string, position?: "fixed" | "absolute", zIndex?: number, messages: ChatMessage[], loading?: boolean, streamingContent?: string, placeholder?: string, onSend: (message: string) => void, disabled?: boolean, title?: string, onClose?: (() => void), apiKeyConfigured?: boolean, onSetApiKey?: ((key: string) => void), templateName?: string, templateIcon?: string, isReadOnly?: boolean, hasPendingChanges?: boolean, onFork?: (() => void), onStartFresh?: (() => void), pickerOpen?: boolean, pickerAction?: "fork" | "fresh", pickerDefaultName?: string, pickerDefaultIcon?: string, onPickerConfirm?: ((name: string, icon: string) => void), onPickerCancel?: (() => void), mode?: "chat" | "code", schemaJson?: string, onModeChange?: ((mode: "chat" | "code") => void), onSchemaEdit?: ((json: string) => void), canUndo?: boolean, canRedo?: boolean, onUndo?: (() => void), onRedo?: (() => void), sessions?: SessionInfo[], activeSessionId?: string | null, onNewChat?: (() => void), onSwitchSession?: ((sessionId: string) => void), onDeleteSession?: ((sessionId: string) => void), operationLoading?: string | null
623+
Props: open: boolean, side?: "left" | "right", width?: string, position?: "fixed" | "absolute", zIndex?: number, messages: ChatMessage[], loading?: boolean, streamingContent?: string, placeholder?: string, onSend: (message: string) => void, disabled?: boolean, title?: string, onClose?: (() => void), apiKeyConfigured?: boolean, onSetApiKey?: ((key: string) => void), templateName?: string, templateIcon?: string, isReadOnly?: boolean, hasPendingChanges?: boolean, onFork?: (() => void), onStartFresh?: (() => void), pickerOpen?: boolean, pickerAction?: "fork" | "fresh", pickerDefaultName?: string, pickerDefaultIcon?: string, pickerShowDestination?: boolean, onPickerConfirm?: ((name: string, icon: string, destination: "personal" | "space") => void), onPickerCancel?: (() => void), mode?: "chat" | "code", schemaJson?: string, onModeChange?: ((mode: "chat" | "code") => void), onSchemaEdit?: ((json: string) => void), canUndo?: boolean, canRedo?: boolean, onUndo?: (() => void), onRedo?: (() => void), sessions?: SessionInfo[], activeSessionId?: string | null, onNewChat?: (() => void), onSwitchSession?: ((sessionId: string) => void), onDeleteSession?: ((sessionId: string) => void), operationLoading?: string | null
624624
- CollapsibleSidebar
625625
Props: header?: JSX.Element, footer?: JSX.Element, items: CollapsibleSidebarItem[], footerItems?: CollapsibleSidebarItem[], side?: "left" | "right", position?: "fixed" | "absolute" | "static", zIndex?: number, collapsedWidth?: string, expandedWidth?: string, defaultExpanded?: boolean, expandOnHover?: boolean, transitionDuration?: number, bg?: string, border?: string, padding?: string, gap?: string, centerItems?: boolean, itemColor?: string, itemColorHover?: string, itemColorActive?: string, itemBg?: string, itemBgHover?: string, itemBgActive?: string, itemPadding?: string, itemGap?: string, badgeBg?: string, badgeColor?: string, iconSize?: IconSize, onItemClick?: ((item: CollapsibleSidebarItem) => void), onExpandedChange?: ((expanded: boolean) => void)
626626
- GraphWidget — 2D force-directed graph visualization using D3-force layout and Canvas rendering.
@@ -822,9 +822,11 @@ AgentSettings extends Ad4mModel:
822822
- perspectiveOrder: string [we://perspective_order]
823823
- globalSpaceJoined: boolean = false [we://global_space_joined]
824824
- globalSpaceUrl: string [we://global_space_url]
825+
- useSpaceTemplate: boolean = true [we://use_space_template]
825826
Relations:
826827
- installedTemplates: HasMany → Template [we://installed_template]
827828
- installedThemes: HasMany → Theme [we://installed_theme]
829+
- spaceTemplatePreferences: HasMany → SpaceTemplatePreference [we://space_template_preference]
828830

829831
AudioBlock extends WeNode:
830832
Fields:
@@ -850,6 +852,7 @@ ChatMessage extends WeNode:
850852
ChatSession extends WeNode:
851853
Fields:
852854
- name: string [we://name]
855+
- templateId: string [we://template_id]
853856
Relations:
854857
- messages: HasMany → ChatMessage [we://chat_message]
855858

@@ -966,9 +969,15 @@ Space extends WeNode:
966969
- discovery: string = 'hidden' [we://discovery]
967970
- avatar: string [we://image]
968971
- coverImage: string [we://thumbnail]
972+
- defaultTemplateId: string [we://default_template_id]
969973
Relations:
970974
- location: HasOne [we://location]
971975

976+
SpaceTemplatePreference extends WeNode:
977+
Fields:
978+
- spaceUrl: string [we://space_url]
979+
- preference: string [we://preference]
980+
972981
TagBlock extends WeNode:
973982
Fields:
974983
- name: string (required) [we://name]
@@ -990,9 +999,8 @@ Template extends WeNode:
990999
- name: string [we://name]
9911000
- origin: string [we://origin]
9921001
- version: number = 1 [we://version]
1002+
- slug: string [we://slug]
9931003
- schema: string = null [we://template_schema]
994-
Relations:
995-
- chatSessions: HasMany → ChatSession [we://chat_session]
9961004

9971005
TextBlock extends WeNode:
9981006
Fields:
@@ -1054,12 +1062,14 @@ AdamStore:
10541062
- creatingSpace: boolean (true while a new space is being created)
10551063
- agents: AgentProfileSummary[] — cache of all fetched agent profiles (did, firstName, lastName, handle, bio, avatar, coverImage, location)
10561064
- ownAgent: AgentProfileSummary | undefined — reactive accessor for the current user's own profile (derived from agents cache)
1065+
- orderedSidebarItems: array of sidebar items in user-defined order (uuid, name, avatar, spaceId) — personal + shared spaces merged
10571066
- Actions:
10581067
- navigate(to: string, options?): navigates to a route
10591068
- addNewSpace(space: Space): adds a new space
10601069
- createSpace(name: string, description: string, shared: boolean, imageFile?: File): creates a new space with full setup
1061-
- setCurrentPerspective(uuid: string): sets the current perspective, registers its SHACL models as dynamic model classes, and populates currentPerspectiveModels
1062-
- removePerspective(): unknown
1070+
- switchPerspective(uuid: string): switches to a perspective by UUID, registers its SHACL models as dynamic model classes, and populates currentPerspectiveModels
1071+
- removePerspective(uuid: string): removes a perspective by UUID
1072+
- reorderPerspectives(newOrder: string[]): reorders the sidebar items by UUID array
10631073
- login(password: string): logs in the agent with password
10641074
- logout(): locks the agent and returns to login screen
10651075
- fetchAgent(did: string): fetches and caches an agent's profile from their public AD4M perspective
@@ -1084,10 +1094,15 @@ ThemeStore:
10841094

10851095
TemplateStore:
10861096
- State:
1087-
- templates: array of TemplateSchema objects (user-facing templates)
1097+
- personalTemplates: array of TemplateSchema objects — user's installed custom templates (excludes core and space templates)
1098+
- spaceTemplates: array of TemplateSchema objects — templates loaded from the current space perspective
1099+
- coreTemplates: array of TemplateSchema objects — built-in system templates (always available)
1100+
- allTemplates: array of TemplateSchema objects — union of core + personal + space templates
10881101
- shellTemplates: array of TemplateSchema objects (static system pages: profile, settings, tests)
10891102
- currentTemplate: TemplateSchema (the active template)
10901103
- operationLoading: unknown
1104+
- activeShellView: string | null (id of the currently open shell overlay: 'profile' | 'settings' | 'schema-tests' | 'landing-page' | null)
1105+
- templateManagementList: TemplateManagementItem[] — flat list of all templates with management metadata (id, name, icon, description, isCore, isInstalled, isDefault)
10911106
- Actions:
10921107
- updateTemplate(newTemplate: TemplateSchema): updates the current template
10931108
- switchTemplate(newTemplateId: string): switches to another template
@@ -1096,6 +1111,8 @@ TemplateStore:
10961111
- toggleInstalled(): unknown
10971112
- setDefaultTemplate(): unknown
10981113
- deleteTemplate(): unknown
1114+
- openShellView(id: string): opens a shell overlay by id ('profile' | 'settings' | 'schema-tests' | 'landing-page')
1115+
- closeShellView(): closes the currently open shell overlay
10991116

11001117
SpaceStore:
11011118
- State:
@@ -1110,7 +1127,7 @@ SpaceStore:
11101127
- updateSpaceImage(field: "avatar" | "coverImage", imageFile: File): uploads and sets the space avatar or cover image
11111128
- createSignalType(config: Partial<SignalType>): creates a new signal type in the community; slug auto-derived from name if blank
11121129
- upsertSignal(nodeId: string, signalTypeId: string, value: number): adds or updates a signal on a node; value=0 deletes it
1113-
- navigateToSpace(spaceId: string): navigates to a space by perspective UUID
1130+
- navigateToSpace(spaceId: string, view?: string): navigates to a space — accepts a perspective UUID or a neighbourhood CID (sharedUrl without the neighbourhood:// prefix); pre-loads space templates before switching so the template and data arrive together
11141131

11151132
AiStore:
11161133
- State:
@@ -1140,6 +1157,7 @@ AiStore:
11401157
- handleSchemaPrompt(prompt: string): generates a schema from a prompt
11411158
- sendMessage(): unknown
11421159
- close(): unknown
1160+
- toggle(): toggles the AI chat panel open/closed
11431161
- setApiKey(): unknown
11441162
- startFork(): unknown
11451163
- startFresh(): unknown
@@ -1153,6 +1171,14 @@ AiStore:
11531171
- undo(): undoes the last schema edit
11541172
- redo(): redoes the last undone schema edit
11551173

1174+
AppStore:
1175+
- State:
1176+
- apps: RegisteredApp[] — list of registered external apps (id, name, image)
1177+
- activeAppId: string | null — id of the currently active app, or null if none
1178+
- Actions:
1179+
- activateApp(id: string): activates an app and switches to its view
1180+
- deactivateApp(): deactivates the current app and returns to the template view
1181+
11561182
---
11571183

11581184
## Store Usage Patterns

0 commit comments

Comments
 (0)