Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ impl ClawMode {
// Local desktop/system control is delegated to the ComputerUse
// agent/tool instead of being surfaced as a ControlHub domain.
"ControlHub".to_string(),
"InitMiniApp".to_string(),
],
}
}
Expand Down Expand Up @@ -79,3 +80,16 @@ impl Agent for ClawMode {
false
}
}

#[cfg(test)]
mod tests {
use super::ClawMode;
use crate::agentic::agents::Agent;

#[test]
fn claw_mode_includes_init_miniapp_in_default_tools() {
assert!(ClawMode::new()
.default_tools()
.contains(&"InitMiniApp".to_string()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ impl CoworkMode {
"WebSearch".to_string(),
"WebFetch".to_string(),
"ControlHub".to_string(),
"InitMiniApp".to_string(),
],
}
}
Expand Down Expand Up @@ -95,3 +96,16 @@ impl Agent for CoworkMode {
false
}
}

#[cfg(test)]
mod tests {
use super::CoworkMode;
use crate::agentic::agents::Agent;

#[test]
fn cowork_mode_includes_init_miniapp_in_default_tools() {
assert!(CoworkMode::new()
.default_tools()
.contains(&"InitMiniApp".to_string()));
}
}
4 changes: 0 additions & 4 deletions src/web-ui/src/app/scenes/my-agent/identityDocument.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ describe('identityDocument frontmatter helpers', () => {
vibe: 'Calm',
emoji: '🙂',
body: '# Body\n\nHello',
modelPrimary: '',
modelFast: '',
});

expect(serialized).toBe([
Expand Down Expand Up @@ -86,8 +84,6 @@ describe('identityDocument frontmatter helpers', () => {
vibe: 'Calm',
emoji: '🙂',
body: '# Body\n\nHello',
modelPrimary: '',
modelFast: '',
});
});
});
17 changes: 0 additions & 17 deletions src/web-ui/src/app/scenes/my-agent/identityDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ export interface IdentityDocument {
vibe: string;
emoji: string;
body: string;
/** Override for primary model slot. Empty string = inherit from template. */
modelPrimary?: string;
/** Override for fast model slot. Empty string = inherit from template. */
modelFast?: string;
}

export const EMPTY_IDENTITY_DOCUMENT: IdentityDocument = {
Expand All @@ -18,17 +14,13 @@ export const EMPTY_IDENTITY_DOCUMENT: IdentityDocument = {
vibe: '',
emoji: '',
body: '',
modelPrimary: '',
modelFast: '',
};

const FRONTMATTER_FIELDS: Array<keyof Omit<IdentityDocument, 'body'>> = [
'name',
'creature',
'vibe',
'emoji',
'modelPrimary',
'modelFast',
];

export interface MarkdownFrontmatterSections {
Expand Down Expand Up @@ -108,8 +100,6 @@ export function parseIdentityDocument(content: string): IdentityDocument {
vibe: normalizeShortField(parsed.vibe),
emoji: normalizeShortField(parsed.emoji),
body: sections.body,
modelPrimary: normalizeShortField(parsed.modelPrimary),
modelFast: normalizeShortField(parsed.modelFast),
};
}

Expand All @@ -120,16 +110,9 @@ export function serializeIdentityDocument(document: IdentityDocument): string {
vibe: normalizeShortField(document.vibe),
emoji: normalizeShortField(document.emoji),
body: normalizeLineEndings(document.body || '').replace(/^\n+/, '').trimEnd(),
modelPrimary: normalizeShortField(document.modelPrimary ?? ''),
modelFast: normalizeShortField(document.modelFast ?? ''),
};

const optionalFields = new Set<keyof Omit<IdentityDocument, 'body'>>(['modelPrimary', 'modelFast']);
const frontmatter = FRONTMATTER_FIELDS
.filter((field) => {
if (optionalFields.has(field)) return !!normalized[field];
return true;
})
.map((field) => {
const value = normalized[field];
return value ? `${field}: ${serializeScalar(value)}` : `${field}:`;
Expand Down
6 changes: 3 additions & 3 deletions src/web-ui/src/app/scenes/profile/nurseryStore.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { create } from 'zustand';

export type NurseryPage = 'gallery' | 'template' | 'assistant';
export type NurseryPage = 'gallery' | 'defaults' | 'assistant';

interface NurseryStoreState {
page: NurseryPage;
activeWorkspaceId: string | null;
openGallery: () => void;
openTemplate: () => void;
openDefaults: () => void;
openAssistant: (workspaceId: string) => void;
}

export const useNurseryStore = create<NurseryStoreState>((set) => ({
page: 'gallery',
activeWorkspaceId: null,
openGallery: () => set({ page: 'gallery', activeWorkspaceId: null }),
openTemplate: () => set({ page: 'template', activeWorkspaceId: null }),
openDefaults: () => set({ page: 'defaults', activeWorkspaceId: null }),
openAssistant: (workspaceId) => set({ page: 'assistant', activeWorkspaceId: workspaceId }),
}));
4 changes: 0 additions & 4 deletions src/web-ui/src/app/scenes/profile/views/AssistantCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const AssistantCard: React.FC<AssistantCardProps> = ({ workspace, onClick, onNew
const emoji = identity?.emoji?.trim() ?? '';
const creature = identity?.creature?.trim() || '';
const vibe = identity?.vibe?.trim() || '';
const modelPrimary = identity?.modelPrimary?.trim() || '';
const modelFast = identity?.modelFast?.trim() || '';

const gradient = getCardGradient(workspace.id || name);

Expand Down Expand Up @@ -67,8 +65,6 @@ const AssistantCard: React.FC<AssistantCardProps> = ({ workspace, onClick, onNew
</div>
<div className="assistant-card__badges">
{creature && <Badge variant="neutral">{creature}</Badge>}
{modelPrimary && <Badge variant="accent">{modelPrimary}</Badge>}
{modelFast && <Badge variant="neutral">{modelFast}</Badge>}
</div>
</div>
</div>
Expand Down
Loading
Loading