-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtypes.ts
More file actions
95 lines (86 loc) · 2.75 KB
/
Copy pathtypes.ts
File metadata and controls
95 lines (86 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/**
* Workspace Types
*
* Workspaces are the top-level organizational unit. Everything (sources, sessions)
* is scoped to a workspace.
*
* Directory structure:
* ~/.craft-agent/workspaces/{slug}/
* ├── config.json - Workspace settings
* ├── sources/ - Data sources (MCP, API, local)
* └── sessions/ - Conversation sessions
*/
import type { PermissionMode } from '../agent/mode-manager.ts';
import type { ThinkingLevel } from '../agent/thinking-levels.ts';
import type { WorkspaceKind } from '@craft-agent/core/types';
/**
* Local MCP server configuration
* Controls whether stdio-based (local subprocess) MCP servers can be spawned.
*/
export interface LocalMcpConfig {
/**
* Whether local (stdio) MCP servers are enabled for this workspace.
* When false, only HTTP-based MCP servers will be used.
* Default: true (can be overridden by CRAFT_LOCAL_MCP_ENABLED env var)
*/
enabled: boolean;
}
/**
* Workspace configuration (stored in config.json)
*/
export interface WorkspaceConfig {
id: string;
name: string;
slug: string; // Folder name (URL-safe)
kind?: WorkspaceKind;
isProtected?: boolean;
pinned?: boolean;
/**
* Default settings for new sessions in this workspace
*/
defaults?: {
model?: string;
/** Default LLM connection for new sessions (slug). Overrides global default. */
defaultLlmConnection?: string;
enabledSourceSlugs?: string[]; // Sources to enable by default
permissionMode?: PermissionMode; // Default permission mode
cyclablePermissionModes?: PermissionMode[]; // Which modes can be cycled with SHIFT+TAB (min 2)
workingDirectory?: string;
thinkingLevel?: ThinkingLevel; // Default thinking level for new sessions (default: 'medium')
colorTheme?: string; // Color theme override for this workspace (preset ID). Undefined = inherit from app default.
};
/**
* Local MCP server configuration.
* Controls whether stdio-based MCP servers can be spawned in this workspace.
* Resolution order: ENV (CRAFT_LOCAL_MCP_ENABLED) > workspace config > default (true)
*/
localMcpServers?: LocalMcpConfig;
createdAt: number;
updatedAt: number;
}
/**
* Workspace creation input
*/
export interface CreateWorkspaceInput {
name: string;
defaults?: WorkspaceConfig['defaults'];
}
/**
* Loaded workspace with resolved sources
*/
export interface LoadedWorkspace {
config: WorkspaceConfig;
sourceSlugs: string[]; // Available source slugs (not fully loaded to save memory)
sessionCount: number; // Number of sessions
}
/**
* Workspace summary for listing (lightweight)
*/
export interface WorkspaceSummary {
slug: string;
name: string;
sourceCount: number;
sessionCount: number;
createdAt: number;
updatedAt: number;
}