Merge remote-tracking branch 'origin/main'

This commit is contained in:
Peter Steinberger
2025-12-20 17:33:00 +01:00
13 changed files with 343 additions and 33 deletions

View File

@@ -5,6 +5,9 @@ enum AgentWorkspace {
private static let logger = Logger(subsystem: "com.steipete.clawdis", category: "workspace")
static let agentsFilename = "AGENTS.md"
static let soulFilename = "SOUL.md"
static let identityFilename = "IDENTITY.md"
static let userFilename = "USER.md"
static let bootstrapFilename = "BOOTSTRAP.md"
private static let templateDirname = "templates"
static let identityStartMarker = "<!-- clawdis:identity:start -->"
static let identityEndMarker = "<!-- clawdis:identity:end -->"
@@ -42,6 +45,21 @@ enum AgentWorkspace {
try self.defaultSoulTemplate().write(to: soulURL, atomically: true, encoding: .utf8)
self.logger.info("Created SOUL.md at \(soulURL.path, privacy: .public)")
}
let identityURL = workspaceURL.appendingPathComponent(self.identityFilename)
if !FileManager.default.fileExists(atPath: identityURL.path) {
try self.defaultIdentityTemplate().write(to: identityURL, atomically: true, encoding: .utf8)
self.logger.info("Created IDENTITY.md at \(identityURL.path, privacy: .public)")
}
let userURL = workspaceURL.appendingPathComponent(self.userFilename)
if !FileManager.default.fileExists(atPath: userURL.path) {
try self.defaultUserTemplate().write(to: userURL, atomically: true, encoding: .utf8)
self.logger.info("Created USER.md at \(userURL.path, privacy: .public)")
}
let bootstrapURL = workspaceURL.appendingPathComponent(self.bootstrapFilename)
if !FileManager.default.fileExists(atPath: bootstrapURL.path) {
try self.defaultBootstrapTemplate().write(to: bootstrapURL, atomically: true, encoding: .utf8)
self.logger.info("Created BOOTSTRAP.md at \(bootstrapURL.path, privacy: .public)")
}
return agentsURL
}
@@ -76,6 +94,11 @@ enum AgentWorkspace {
This folder is the assistant's working directory.
## First run (one-time)
- If BOOTSTRAP.md exists, follow its ritual and delete it once complete.
- Your agent identity lives in IDENTITY.md.
- Your profile lives in USER.md.
## Backup tip (recommended)
If you treat this workspace as the agent's "memory", make it a git repo (ideally private) so identity
and notes are backed up.
@@ -115,6 +138,78 @@ enum AgentWorkspace {
return self.loadTemplate(named: self.soulFilename, fallback: fallback)
}
static func defaultIdentityTemplate() -> String {
let fallback = """
# IDENTITY.md - Agent Identity
- Name:
- Creature:
- Vibe:
- Emoji:
"""
return self.loadTemplate(named: self.identityFilename, fallback: fallback)
}
static func defaultUserTemplate() -> String {
let fallback = """
# USER.md - User Profile
- Name:
- Preferred address:
- Pronouns (optional):
- Timezone (optional):
- Notes:
"""
return self.loadTemplate(named: self.userFilename, fallback: fallback)
}
static func defaultBootstrapTemplate() -> String {
let fallback = """
# BOOTSTRAP.md - First Run Ritual (delete after)
Hello. I was just born.
## Your mission
Start a short, playful conversation and learn:
- Who am I?
- What am I?
- Who are you?
- How should I call you?
## How to ask (cute + helpful)
Say:
"Hello! I was just born. Who am I? What am I? Who are you? How should I call you?"
Then offer suggestions:
- 3-5 name ideas.
- 3-5 creature/vibe combos.
- 5 emoji ideas.
## Write these files
After the user chooses, update:
1) IDENTITY.md
- Name
- Creature
- Vibe
- Emoji
2) USER.md
- Name
- Preferred address
- Pronouns (optional)
- Timezone (optional)
- Notes
3) ~/.clawdis/clawdis.json
Set identity.name, identity.theme, identity.emoji to match IDENTITY.md.
## Cleanup
Delete BOOTSTRAP.md once this is complete.
"""
return self.loadTemplate(named: self.bootstrapFilename, fallback: fallback)
}
private static func loadTemplate(named: String, fallback: String) -> String {
for url in self.templateURLs(named: named) {
if let content = try? String(contentsOf: url, encoding: .utf8) {

View File

@@ -272,10 +272,10 @@ struct GeneralSettings: View {
.opacity(self.isInstallingCLI ? 0 : 1)
if self.isInstallingCLI {
ProgressView()
.controlSize(.small)
.controlSize(.mini)
}
}
.frame(minWidth: 150, minHeight: 24)
.frame(minWidth: 150)
}
.disabled(self.isInstallingCLI)

View File

@@ -95,7 +95,7 @@ struct OnboardingView: View {
case .unconfigured:
[0, 1, 9]
case .local:
[0, 1, 2, 3, 5, 6, 8, 9]
[0, 1, 2, 5, 6, 8, 9]
}
}
@@ -133,9 +133,8 @@ struct OnboardingView: View {
var body: some View {
VStack(spacing: 0) {
GlowingClawdisIcon(size: 156)
.padding(.top, 10)
.padding(.bottom, 2)
GlowingClawdisIcon(size: 156, glowIntensity: 0.28)
.offset(y: 8)
.frame(height: 176)
GeometryReader { _ in
@@ -867,10 +866,10 @@ struct OnboardingView: View {
.opacity(self.installingCLI ? 0 : 1)
if self.installingCLI {
ProgressView()
.controlSize(.small)
.controlSize(.mini)
}
}
.frame(minWidth: 120, minHeight: 28)
.frame(minWidth: 120)
}
.buttonStyle(.borderedProminent)
.disabled(self.installingCLI)
@@ -1485,6 +1484,8 @@ private struct GlowingClawdisIcon: View {
}
var body: some View {
let glowBlurRadius: CGFloat = 18
let glowCanvasSize: CGFloat = self.size + 56
ZStack {
Circle()
.fill(
@@ -1495,9 +1496,11 @@ private struct GlowingClawdisIcon: View {
],
startPoint: .topLeading,
endPoint: .bottomTrailing))
.blur(radius: 22)
.scaleEffect(self.breathe ? 1.12 : 0.95)
.opacity(0.9)
.frame(width: glowCanvasSize, height: glowCanvasSize)
.padding(glowBlurRadius)
.blur(radius: glowBlurRadius)
.scaleEffect(self.breathe ? 1.08 : 0.96)
.opacity(0.84)
Image(nsImage: NSApp.applicationIconImage)
.resizable()
@@ -1506,7 +1509,9 @@ private struct GlowingClawdisIcon: View {
.shadow(color: .black.opacity(0.18), radius: 14, y: 6)
.scaleEffect(self.breathe ? 1.02 : 1.0)
}
.frame(width: self.size + 60, height: self.size + 60)
.frame(
width: glowCanvasSize + (glowBlurRadius * 2),
height: glowCanvasSize + (glowBlurRadius * 2))
.onAppear {
guard self.enableFloating else { return }
withAnimation(Animation.easeInOut(duration: 3.6).repeatForever(autoreverses: true)) {

View File

@@ -38,8 +38,14 @@ struct AgentWorkspaceTests {
let contents = try String(contentsOf: agentsURL, encoding: .utf8)
#expect(contents.contains("# AGENTS.md"))
let identityURL = tmp.appendingPathComponent(AgentWorkspace.identityFilename)
let userURL = tmp.appendingPathComponent(AgentWorkspace.userFilename)
let bootstrapURL = tmp.appendingPathComponent(AgentWorkspace.bootstrapFilename)
#expect(FileManager.default.fileExists(atPath: identityURL.path))
#expect(FileManager.default.fileExists(atPath: userURL.path))
#expect(FileManager.default.fileExists(atPath: bootstrapURL.path))
let second = try AgentWorkspace.bootstrap(workspaceURL: tmp)
#expect(second == agentsURL)
}
}

View File

@@ -14,8 +14,9 @@ struct OnboardingViewSmokeTests {
_ = view.body
}
@Test func pageOrderOmitsWorkspaceStep() {
@Test func pageOrderOmitsWorkspaceAndIdentitySteps() {
let order = OnboardingView.pageOrder(for: .local)
#expect(!order.contains(7))
#expect(!order.contains(3))
}
}