workon 2.1.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/bin/workon +1 -11
- package/dist/cli.js +2364 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +1216 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +280 -0
- package/dist/index.d.ts +280 -0
- package/dist/index.js +1173 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -21
- package/.claude/settings.local.json +0 -11
- package/.cursorindexingignore +0 -3
- package/.history/.gitignore_20250806202718 +0 -30
- package/.history/.gitignore_20250806231444 +0 -32
- package/.history/.gitignore_20250806231450 +0 -32
- package/.history/lib/tmux_20250806233103.js +0 -109
- package/.history/lib/tmux_20250806233219.js +0 -109
- package/.history/lib/tmux_20250806233223.js +0 -109
- package/.history/lib/tmux_20250806233230.js +0 -109
- package/.history/lib/tmux_20250806233231.js +0 -109
- package/.history/lib/tmux_20250807120751.js +0 -190
- package/.history/lib/tmux_20250807120757.js +0 -190
- package/.history/lib/tmux_20250807120802.js +0 -190
- package/.history/lib/tmux_20250807120808.js +0 -190
- package/.history/package_20250807114243.json +0 -43
- package/.history/package_20250807114257.json +0 -43
- package/.history/package_20250807114404.json +0 -43
- package/.history/package_20250807114409.json +0 -43
- package/.history/package_20250807114510.json +0 -43
- package/.history/package_20250807114637.json +0 -43
- package/.vscode/launch.json +0 -20
- package/.vscode/terminals.json +0 -11
- package/CHANGELOG.md +0 -110
- package/CLAUDE.md +0 -100
- package/cli/base.js +0 -16
- package/cli/config/index.js +0 -19
- package/cli/config/list.js +0 -26
- package/cli/config/set.js +0 -19
- package/cli/config/unset.js +0 -26
- package/cli/index.js +0 -184
- package/cli/interactive.js +0 -290
- package/cli/manage.js +0 -413
- package/cli/open.js +0 -414
- package/commands/base.js +0 -105
- package/commands/core/cwd/index.js +0 -86
- package/commands/core/ide/index.js +0 -84
- package/commands/core/web/index.js +0 -109
- package/commands/extensions/claude/index.js +0 -211
- package/commands/extensions/docker/index.js +0 -167
- package/commands/extensions/npm/index.js +0 -208
- package/commands/registry.js +0 -196
- package/demo-colon-syntax.js +0 -57
- package/docs/adr/001-command-centric-architecture.md +0 -304
- package/docs/adr/002-positional-command-arguments.md +0 -402
- package/docs/ideas.md +0 -93
- package/lib/config.js +0 -51
- package/lib/environment/base.js +0 -12
- package/lib/environment/index.js +0 -108
- package/lib/environment/project.js +0 -26
- package/lib/project.js +0 -68
- package/lib/tmux.js +0 -223
- package/lib/validation.js +0 -120
- package/test-architecture.js +0 -145
- package/test-colon-syntax.js +0 -85
- package/test-registry.js +0 -57
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import File from 'phylo';
|
|
2
|
+
|
|
3
|
+
type IdeType = 'vscode' | 'idea' | 'atom' | 'code' | 'subl' | 'vim' | 'emacs';
|
|
4
|
+
interface ClaudeConfig {
|
|
5
|
+
flags?: string[];
|
|
6
|
+
split_terminal?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface NpmConfig {
|
|
9
|
+
command: string;
|
|
10
|
+
watch?: boolean;
|
|
11
|
+
auto_restart?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface DockerConfig {
|
|
14
|
+
compose_file: string;
|
|
15
|
+
services?: string[];
|
|
16
|
+
}
|
|
17
|
+
interface EventsConfig {
|
|
18
|
+
cwd?: boolean;
|
|
19
|
+
ide?: boolean;
|
|
20
|
+
web?: boolean;
|
|
21
|
+
claude?: boolean | ClaudeConfig;
|
|
22
|
+
npm?: boolean | string | NpmConfig;
|
|
23
|
+
docker?: boolean | string | DockerConfig;
|
|
24
|
+
[key: string]: boolean | string | ClaudeConfig | NpmConfig | DockerConfig | undefined;
|
|
25
|
+
}
|
|
26
|
+
interface ProjectConfig {
|
|
27
|
+
name?: string;
|
|
28
|
+
path: string;
|
|
29
|
+
ide?: IdeType;
|
|
30
|
+
homepage?: string;
|
|
31
|
+
events: EventsConfig;
|
|
32
|
+
branch?: string;
|
|
33
|
+
}
|
|
34
|
+
interface ProjectDefaults {
|
|
35
|
+
base: string;
|
|
36
|
+
ide?: IdeType;
|
|
37
|
+
events?: EventsConfig;
|
|
38
|
+
}
|
|
39
|
+
interface AppConfig {
|
|
40
|
+
project_defaults: ProjectDefaults;
|
|
41
|
+
projects: Record<string, ProjectConfig>;
|
|
42
|
+
}
|
|
43
|
+
interface EventMetadata {
|
|
44
|
+
name: string;
|
|
45
|
+
displayName: string;
|
|
46
|
+
description: string;
|
|
47
|
+
category: 'core' | 'development' | 'extension';
|
|
48
|
+
requiresTmux: boolean;
|
|
49
|
+
dependencies: string[];
|
|
50
|
+
}
|
|
51
|
+
interface EventProcessingContext {
|
|
52
|
+
project: Project$1;
|
|
53
|
+
isShellMode: boolean;
|
|
54
|
+
shellCommands: string[];
|
|
55
|
+
}
|
|
56
|
+
interface EventValidation {
|
|
57
|
+
validateConfig(config: unknown): true | string;
|
|
58
|
+
}
|
|
59
|
+
interface EventConfiguration {
|
|
60
|
+
configureInteractive(): Promise<unknown>;
|
|
61
|
+
getDefaultConfig(): unknown;
|
|
62
|
+
}
|
|
63
|
+
interface EventProcessing {
|
|
64
|
+
processEvent(context: EventProcessingContext): Promise<void>;
|
|
65
|
+
generateShellCommand(context: EventProcessingContext): string[];
|
|
66
|
+
}
|
|
67
|
+
interface EventTmux {
|
|
68
|
+
getLayoutPriority(): number;
|
|
69
|
+
contributeToLayout?(enabledCommands: string[]): string;
|
|
70
|
+
}
|
|
71
|
+
interface EventHelp {
|
|
72
|
+
usage: string;
|
|
73
|
+
description: string;
|
|
74
|
+
examples: Array<{
|
|
75
|
+
config: unknown;
|
|
76
|
+
description: string;
|
|
77
|
+
}>;
|
|
78
|
+
}
|
|
79
|
+
interface EventHandler {
|
|
80
|
+
metadata: EventMetadata;
|
|
81
|
+
validation: EventValidation;
|
|
82
|
+
configuration: EventConfiguration;
|
|
83
|
+
processing: EventProcessing;
|
|
84
|
+
tmux?: EventTmux | null;
|
|
85
|
+
help: EventHelp;
|
|
86
|
+
}
|
|
87
|
+
interface Project$1 {
|
|
88
|
+
name: string;
|
|
89
|
+
path: {
|
|
90
|
+
path: string;
|
|
91
|
+
absolutePath(): string;
|
|
92
|
+
};
|
|
93
|
+
ide?: IdeType;
|
|
94
|
+
homepage?: string;
|
|
95
|
+
events: EventsConfig;
|
|
96
|
+
branch?: string;
|
|
97
|
+
base?: {
|
|
98
|
+
path: string;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
interface BaseEnvironment$1 {
|
|
102
|
+
$isProjectEnvironment: false;
|
|
103
|
+
}
|
|
104
|
+
interface ProjectEnvironment$1 {
|
|
105
|
+
$isProjectEnvironment: true;
|
|
106
|
+
project: Project$1;
|
|
107
|
+
}
|
|
108
|
+
type Environment$1 = BaseEnvironment$1 | ProjectEnvironment$1;
|
|
109
|
+
interface Logger {
|
|
110
|
+
debug(...args: unknown[]): void;
|
|
111
|
+
info(...args: unknown[]): void;
|
|
112
|
+
log(...args: unknown[]): void;
|
|
113
|
+
warn(...args: unknown[]): void;
|
|
114
|
+
error(...args: unknown[]): void;
|
|
115
|
+
setLogLevel(level: string): void;
|
|
116
|
+
}
|
|
117
|
+
interface GlobalOptions {
|
|
118
|
+
debug?: boolean;
|
|
119
|
+
shell?: boolean;
|
|
120
|
+
}
|
|
121
|
+
interface OpenOptions extends GlobalOptions {
|
|
122
|
+
dryRun?: boolean;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare class Config {
|
|
126
|
+
private _transient;
|
|
127
|
+
private _store;
|
|
128
|
+
constructor();
|
|
129
|
+
get<T = unknown>(key: string, defaultValue?: T): T | undefined;
|
|
130
|
+
set(key: string, value?: unknown): void;
|
|
131
|
+
has(key: string): boolean;
|
|
132
|
+
delete(key: string): void;
|
|
133
|
+
getProjects(): Record<string, ProjectConfig>;
|
|
134
|
+
getProject(name: string): ProjectConfig | undefined;
|
|
135
|
+
setProject(name: string, config: ProjectConfig): void;
|
|
136
|
+
deleteProject(name: string): void;
|
|
137
|
+
getDefaults(): ProjectDefaults | undefined;
|
|
138
|
+
setDefaults(defaults: ProjectDefaults): void;
|
|
139
|
+
get path(): string;
|
|
140
|
+
get store(): AppConfig;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
declare class Project {
|
|
144
|
+
name: string;
|
|
145
|
+
private _base?;
|
|
146
|
+
private _path?;
|
|
147
|
+
private _ide?;
|
|
148
|
+
private _events;
|
|
149
|
+
private _branch?;
|
|
150
|
+
private _homepage?;
|
|
151
|
+
private _defaults;
|
|
152
|
+
private _initialCfg;
|
|
153
|
+
constructor(name: string, cfg?: Partial<ProjectConfig>, defaults?: ProjectDefaults);
|
|
154
|
+
set base(path: string);
|
|
155
|
+
get base(): ReturnType<typeof File.from> | undefined;
|
|
156
|
+
set ide(cmd: IdeType | undefined);
|
|
157
|
+
get ide(): IdeType | undefined;
|
|
158
|
+
set events(eventCfg: EventsConfig);
|
|
159
|
+
get events(): EventsConfig;
|
|
160
|
+
set path(path: string);
|
|
161
|
+
get path(): ReturnType<typeof File.from>;
|
|
162
|
+
set branch(branch: string | undefined);
|
|
163
|
+
get branch(): string | undefined;
|
|
164
|
+
set homepage(url: string | undefined);
|
|
165
|
+
get homepage(): string | undefined;
|
|
166
|
+
static $isProject: boolean;
|
|
167
|
+
$isProject: boolean;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare class TmuxManager {
|
|
171
|
+
private sessionPrefix;
|
|
172
|
+
isTmuxAvailable(): Promise<boolean>;
|
|
173
|
+
sessionExists(sessionName: string): Promise<boolean>;
|
|
174
|
+
getSessionName(projectName: string): string;
|
|
175
|
+
killSession(sessionName: string): Promise<boolean>;
|
|
176
|
+
createSplitSession(projectName: string, projectPath: string, claudeArgs?: string[]): Promise<string>;
|
|
177
|
+
createThreePaneSession(projectName: string, projectPath: string, claudeArgs?: string[], npmCommand?: string): Promise<string>;
|
|
178
|
+
createTwoPaneNpmSession(projectName: string, projectPath: string, npmCommand?: string): Promise<string>;
|
|
179
|
+
attachToSession(sessionName: string): Promise<void>;
|
|
180
|
+
buildShellCommands(projectName: string, projectPath: string, claudeArgs?: string[]): string[];
|
|
181
|
+
buildThreePaneShellCommands(projectName: string, projectPath: string, claudeArgs?: string[], npmCommand?: string): string[];
|
|
182
|
+
buildTwoPaneNpmShellCommands(projectName: string, projectPath: string, npmCommand?: string): string[];
|
|
183
|
+
private getAttachCommand;
|
|
184
|
+
listWorkonSessions(): Promise<string[]>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
declare class BaseEnvironment {
|
|
188
|
+
$isProjectEnvironment: false;
|
|
189
|
+
}
|
|
190
|
+
declare class ProjectEnvironment {
|
|
191
|
+
$isProjectEnvironment: true;
|
|
192
|
+
project: Project;
|
|
193
|
+
constructor(projectCfg: ProjectConfig & {
|
|
194
|
+
name: string;
|
|
195
|
+
exactName?: string;
|
|
196
|
+
});
|
|
197
|
+
static load(cfg: ProjectConfig & {
|
|
198
|
+
name: string;
|
|
199
|
+
}, defaults?: ProjectDefaults): ProjectEnvironment;
|
|
200
|
+
}
|
|
201
|
+
type Environment = BaseEnvironment | ProjectEnvironment;
|
|
202
|
+
declare class EnvironmentRecognizer {
|
|
203
|
+
private static config;
|
|
204
|
+
private static log;
|
|
205
|
+
private static projects;
|
|
206
|
+
private static configured;
|
|
207
|
+
static configure(config: Config, log: Logger): void;
|
|
208
|
+
static recognize(dir: string | ReturnType<typeof File.from>): Promise<Environment>;
|
|
209
|
+
private static getAllProjects;
|
|
210
|
+
private static getProjectEnvironment;
|
|
211
|
+
private static ensureConfigured;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Event Registry for management of events
|
|
216
|
+
* Uses explicit imports to work with bundled builds
|
|
217
|
+
*/
|
|
218
|
+
declare class EventRegistryClass {
|
|
219
|
+
private _events;
|
|
220
|
+
private _initialized;
|
|
221
|
+
/**
|
|
222
|
+
* Initialize the registry by registering all events
|
|
223
|
+
*/
|
|
224
|
+
initialize(): Promise<void>;
|
|
225
|
+
/**
|
|
226
|
+
* Register all event classes
|
|
227
|
+
*/
|
|
228
|
+
private registerEvents;
|
|
229
|
+
/**
|
|
230
|
+
* Validate if a class is a proper event
|
|
231
|
+
*/
|
|
232
|
+
private isValidEvent;
|
|
233
|
+
/**
|
|
234
|
+
* Get all valid event names from registered events
|
|
235
|
+
*/
|
|
236
|
+
getValidEventNames(): string[];
|
|
237
|
+
/**
|
|
238
|
+
* Get event by name
|
|
239
|
+
*/
|
|
240
|
+
getEventByName(name: string): EventHandler | null;
|
|
241
|
+
/**
|
|
242
|
+
* Get all events for management UI
|
|
243
|
+
*/
|
|
244
|
+
getEventsForManageUI(): Array<{
|
|
245
|
+
name: string;
|
|
246
|
+
value: string;
|
|
247
|
+
description: string;
|
|
248
|
+
}>;
|
|
249
|
+
/**
|
|
250
|
+
* Get events that support tmux integration
|
|
251
|
+
*/
|
|
252
|
+
getTmuxEnabledEvents(): Array<{
|
|
253
|
+
name: string;
|
|
254
|
+
event: EventHandler;
|
|
255
|
+
priority: number;
|
|
256
|
+
}>;
|
|
257
|
+
/**
|
|
258
|
+
* Get all available events with their metadata
|
|
259
|
+
*/
|
|
260
|
+
getAllEvents(): Array<{
|
|
261
|
+
name: string;
|
|
262
|
+
metadata: EventMetadata;
|
|
263
|
+
hasValidation: boolean;
|
|
264
|
+
hasConfiguration: boolean;
|
|
265
|
+
hasProcessing: boolean;
|
|
266
|
+
hasTmux: boolean;
|
|
267
|
+
hasHelp: boolean;
|
|
268
|
+
}>;
|
|
269
|
+
/**
|
|
270
|
+
* Ensure registry is initialized
|
|
271
|
+
*/
|
|
272
|
+
private ensureInitialized;
|
|
273
|
+
/**
|
|
274
|
+
* Clear the registry (useful for testing)
|
|
275
|
+
*/
|
|
276
|
+
clear(): void;
|
|
277
|
+
}
|
|
278
|
+
declare const EventRegistry: EventRegistryClass;
|
|
279
|
+
|
|
280
|
+
export { type AppConfig, BaseEnvironment, type ClaudeConfig, Config, type DockerConfig, type Environment$1 as Environment, EnvironmentRecognizer, type EventConfiguration, type EventHandler, type EventHelp, type EventMetadata, type EventProcessing, type EventProcessingContext, EventRegistry, type EventTmux, type EventValidation, type EventsConfig, type GlobalOptions, type IdeType, type Logger, type NpmConfig, type OpenOptions, Project, type ProjectConfig, type ProjectDefaults, ProjectEnvironment, TmuxManager };
|