@sylphx/flow 1.0.1 → 1.0.3
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/CHANGELOG.md +12 -0
- package/package.json +10 -9
- package/src/commands/codebase-command.ts +168 -0
- package/src/commands/flow-command.ts +1137 -0
- package/src/commands/flow-orchestrator.ts +296 -0
- package/src/commands/hook-command.ts +444 -0
- package/src/commands/init-command.ts +92 -0
- package/src/commands/init-core.ts +322 -0
- package/src/commands/knowledge-command.ts +161 -0
- package/src/commands/run-command.ts +120 -0
- package/src/components/benchmark-monitor.tsx +331 -0
- package/src/components/reindex-progress.tsx +261 -0
- package/src/composables/functional/index.ts +14 -0
- package/src/composables/functional/useEnvironment.ts +171 -0
- package/src/composables/functional/useFileSystem.ts +139 -0
- package/src/composables/index.ts +5 -0
- package/src/composables/useEnv.ts +13 -0
- package/src/composables/useRuntimeConfig.ts +27 -0
- package/src/composables/useTargetConfig.ts +45 -0
- package/src/config/ai-config.ts +376 -0
- package/src/config/constants.ts +35 -0
- package/src/config/index.ts +27 -0
- package/src/config/rules.ts +43 -0
- package/src/config/servers.ts +371 -0
- package/src/config/targets.ts +126 -0
- package/src/core/agent-loader.ts +141 -0
- package/src/core/agent-manager.ts +174 -0
- package/src/core/ai-sdk.ts +603 -0
- package/src/core/app-factory.ts +381 -0
- package/src/core/builtin-agents.ts +9 -0
- package/src/core/command-system.ts +550 -0
- package/src/core/config-system.ts +550 -0
- package/src/core/connection-pool.ts +390 -0
- package/src/core/di-container.ts +155 -0
- package/src/core/error-handling.ts +519 -0
- package/src/core/formatting/bytes.test.ts +115 -0
- package/src/core/formatting/bytes.ts +64 -0
- package/src/core/functional/async.ts +313 -0
- package/src/core/functional/either.ts +109 -0
- package/src/core/functional/error-handler.ts +135 -0
- package/src/core/functional/error-types.ts +311 -0
- package/src/core/functional/index.ts +19 -0
- package/src/core/functional/option.ts +142 -0
- package/src/core/functional/pipe.ts +189 -0
- package/src/core/functional/result.ts +204 -0
- package/src/core/functional/validation.ts +138 -0
- package/src/core/headless-display.ts +96 -0
- package/src/core/index.ts +6 -0
- package/src/core/installers/file-installer.ts +303 -0
- package/src/core/installers/mcp-installer.ts +213 -0
- package/src/core/interfaces/index.ts +22 -0
- package/src/core/interfaces/repository.interface.ts +91 -0
- package/src/core/interfaces/service.interface.ts +133 -0
- package/src/core/interfaces.ts +129 -0
- package/src/core/loop-controller.ts +200 -0
- package/src/core/result.ts +351 -0
- package/src/core/rule-loader.ts +147 -0
- package/src/core/rule-manager.ts +240 -0
- package/src/core/service-config.ts +252 -0
- package/src/core/session-service.ts +121 -0
- package/src/core/state-detector.ts +389 -0
- package/src/core/storage-factory.ts +115 -0
- package/src/core/stream-handler.ts +288 -0
- package/src/core/target-manager.ts +161 -0
- package/src/core/type-utils.ts +427 -0
- package/src/core/unified-storage.ts +456 -0
- package/src/core/upgrade-manager.ts +300 -0
- package/src/core/validation/limit.test.ts +155 -0
- package/src/core/validation/limit.ts +46 -0
- package/src/core/validation/query.test.ts +44 -0
- package/src/core/validation/query.ts +20 -0
- package/src/db/auto-migrate.ts +322 -0
- package/src/db/base-database-client.ts +144 -0
- package/src/db/cache-db.ts +218 -0
- package/src/db/cache-schema.ts +75 -0
- package/src/db/database.ts +70 -0
- package/src/db/index.ts +252 -0
- package/src/db/memory-db.ts +153 -0
- package/src/db/memory-schema.ts +29 -0
- package/src/db/schema.ts +289 -0
- package/src/db/session-repository.ts +733 -0
- package/src/domains/codebase/index.ts +5 -0
- package/src/domains/codebase/tools.ts +139 -0
- package/src/domains/index.ts +8 -0
- package/src/domains/knowledge/index.ts +10 -0
- package/src/domains/knowledge/resources.ts +537 -0
- package/src/domains/knowledge/tools.ts +174 -0
- package/src/domains/utilities/index.ts +6 -0
- package/src/domains/utilities/time/index.ts +5 -0
- package/src/domains/utilities/time/tools.ts +291 -0
- package/src/index.ts +211 -0
- package/src/services/agent-service.ts +273 -0
- package/src/services/claude-config-service.ts +252 -0
- package/src/services/config-service.ts +258 -0
- package/src/services/evaluation-service.ts +271 -0
- package/src/services/functional/evaluation-logic.ts +296 -0
- package/src/services/functional/file-processor.ts +273 -0
- package/src/services/functional/index.ts +12 -0
- package/src/services/index.ts +13 -0
- package/src/services/mcp-service.ts +432 -0
- package/src/services/memory.service.ts +476 -0
- package/src/services/search/base-indexer.ts +156 -0
- package/src/services/search/codebase-indexer-types.ts +38 -0
- package/src/services/search/codebase-indexer.ts +647 -0
- package/src/services/search/embeddings-provider.ts +455 -0
- package/src/services/search/embeddings.ts +316 -0
- package/src/services/search/functional-indexer.ts +323 -0
- package/src/services/search/index.ts +27 -0
- package/src/services/search/indexer.ts +380 -0
- package/src/services/search/knowledge-indexer.ts +422 -0
- package/src/services/search/semantic-search.ts +244 -0
- package/src/services/search/tfidf.ts +559 -0
- package/src/services/search/unified-search-service.ts +888 -0
- package/src/services/smart-config-service.ts +385 -0
- package/src/services/storage/cache-storage.ts +487 -0
- package/src/services/storage/drizzle-storage.ts +581 -0
- package/src/services/storage/index.ts +15 -0
- package/src/services/storage/lancedb-vector-storage.ts +494 -0
- package/src/services/storage/memory-storage.ts +268 -0
- package/src/services/storage/separated-storage.ts +467 -0
- package/src/services/storage/vector-storage.ts +13 -0
- package/src/shared/agents/index.ts +63 -0
- package/src/shared/files/index.ts +99 -0
- package/src/shared/index.ts +32 -0
- package/src/shared/logging/index.ts +24 -0
- package/src/shared/processing/index.ts +153 -0
- package/src/shared/types/index.ts +25 -0
- package/src/targets/claude-code.ts +574 -0
- package/src/targets/functional/claude-code-logic.ts +185 -0
- package/src/targets/functional/index.ts +6 -0
- package/src/targets/opencode.ts +529 -0
- package/src/types/agent.types.ts +32 -0
- package/src/types/api/batch.ts +108 -0
- package/src/types/api/errors.ts +118 -0
- package/src/types/api/index.ts +55 -0
- package/src/types/api/requests.ts +76 -0
- package/src/types/api/responses.ts +180 -0
- package/src/types/api/websockets.ts +85 -0
- package/src/types/api.types.ts +9 -0
- package/src/types/benchmark.ts +49 -0
- package/src/types/cli.types.ts +87 -0
- package/src/types/common.types.ts +35 -0
- package/src/types/database.types.ts +510 -0
- package/src/types/mcp-config.types.ts +448 -0
- package/src/types/mcp.types.ts +69 -0
- package/src/types/memory-types.ts +63 -0
- package/src/types/provider.types.ts +28 -0
- package/src/types/rule.types.ts +24 -0
- package/src/types/session.types.ts +214 -0
- package/src/types/target-config.types.ts +295 -0
- package/src/types/target.types.ts +140 -0
- package/src/types/todo.types.ts +25 -0
- package/src/types.ts +40 -0
- package/src/utils/advanced-tokenizer.ts +191 -0
- package/src/utils/agent-enhancer.ts +114 -0
- package/src/utils/ai-model-fetcher.ts +19 -0
- package/src/utils/async-file-operations.ts +516 -0
- package/src/utils/audio-player.ts +345 -0
- package/src/utils/cli-output.ts +266 -0
- package/src/utils/codebase-helpers.ts +211 -0
- package/src/utils/console-ui.ts +79 -0
- package/src/utils/database-errors.ts +140 -0
- package/src/utils/debug-logger.ts +49 -0
- package/src/utils/error-handler.ts +53 -0
- package/src/utils/file-operations.ts +310 -0
- package/src/utils/file-scanner.ts +259 -0
- package/src/utils/functional/array.ts +355 -0
- package/src/utils/functional/index.ts +15 -0
- package/src/utils/functional/object.ts +279 -0
- package/src/utils/functional/string.ts +281 -0
- package/src/utils/functional.ts +543 -0
- package/src/utils/help.ts +20 -0
- package/src/utils/immutable-cache.ts +106 -0
- package/src/utils/index.ts +78 -0
- package/src/utils/jsonc.ts +158 -0
- package/src/utils/logger.ts +396 -0
- package/src/utils/mcp-config.ts +249 -0
- package/src/utils/memory-tui.ts +414 -0
- package/src/utils/models-dev.ts +91 -0
- package/src/utils/notifications.ts +169 -0
- package/src/utils/object-utils.ts +51 -0
- package/src/utils/parallel-operations.ts +487 -0
- package/src/utils/paths.ts +143 -0
- package/src/utils/process-manager.ts +155 -0
- package/src/utils/prompts.ts +120 -0
- package/src/utils/search-tool-builder.ts +214 -0
- package/src/utils/secret-utils.ts +179 -0
- package/src/utils/security.ts +537 -0
- package/src/utils/session-manager.ts +168 -0
- package/src/utils/session-title.ts +87 -0
- package/src/utils/settings.ts +182 -0
- package/src/utils/simplified-errors.ts +410 -0
- package/src/utils/sync-utils.ts +159 -0
- package/src/utils/target-config.ts +570 -0
- package/src/utils/target-utils.ts +394 -0
- package/src/utils/template-engine.ts +94 -0
- package/src/utils/test-audio.ts +71 -0
- package/src/utils/todo-context.ts +46 -0
- package/src/utils/token-counter.ts +288 -0
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -59554
- package/dist/lancedb.linux-x64-gnu-b7f0jgsz.node +0 -0
- package/dist/lancedb.linux-x64-musl-tgcv22rx.node +0 -0
- package/dist/shared/chunk-25dwp0dp.js +0 -89
- package/dist/shared/chunk-3pjb6063.js +0 -208
- package/dist/shared/chunk-4d6ydpw7.js +0 -2854
- package/dist/shared/chunk-4wjcadjk.js +0 -225
- package/dist/shared/chunk-5j4w74t6.js +0 -30
- package/dist/shared/chunk-5j8m3dh3.js +0 -58
- package/dist/shared/chunk-5thh3qem.js +0 -91
- package/dist/shared/chunk-6g9xy73m.js +0 -252
- package/dist/shared/chunk-7eq34c42.js +0 -23
- package/dist/shared/chunk-c2gwgx3r.js +0 -115
- package/dist/shared/chunk-cjd3mk4c.js +0 -1320
- package/dist/shared/chunk-g5cv6703.js +0 -368
- package/dist/shared/chunk-hpkhykhq.js +0 -574
- package/dist/shared/chunk-m2322pdk.js +0 -122
- package/dist/shared/chunk-nd5fdvaq.js +0 -26
- package/dist/shared/chunk-pgd3m6zf.js +0 -108
- package/dist/shared/chunk-qk8n91hw.js +0 -494
- package/dist/shared/chunk-rkkn8szp.js +0 -16855
- package/dist/shared/chunk-t16rfxh0.js +0 -61
- package/dist/shared/chunk-t4fbfa5v.js +0 -19
- package/dist/shared/chunk-t77h86w6.js +0 -276
- package/dist/shared/chunk-v0ez4aef.js +0 -71
- package/dist/shared/chunk-v29j2r3s.js +0 -32051
- package/dist/shared/chunk-vfbc6ew5.js +0 -765
- package/dist/shared/chunk-vmeqwm1c.js +0 -204
- package/dist/shared/chunk-x66eh37x.js +0 -137
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
UpgradeManager
|
|
3
|
-
} from "./chunk-3pjb6063.js";
|
|
4
|
-
import"./chunk-7eq34c42.js";
|
|
5
|
-
import {
|
|
6
|
-
targetManager
|
|
7
|
-
} from "./chunk-vmeqwm1c.js";
|
|
8
|
-
import"./chunk-qk8n91hw.js";
|
|
9
|
-
import"./chunk-nd5fdvaq.js";
|
|
10
|
-
import"./chunk-cjd3mk4c.js";
|
|
11
|
-
import"./chunk-t16rfxh0.js";
|
|
12
|
-
import"./chunk-hpkhykhq.js";
|
|
13
|
-
import {
|
|
14
|
-
__require,
|
|
15
|
-
__toESM
|
|
16
|
-
} from "./chunk-5j4w74t6.js";
|
|
17
|
-
|
|
18
|
-
// src/commands/flow-orchestrator.ts
|
|
19
|
-
import chalk from "chalk";
|
|
20
|
-
async function checkUpgrades(state, options) {
|
|
21
|
-
if (options.initOnly || options.runOnly)
|
|
22
|
-
return;
|
|
23
|
-
if (await UpgradeManager.isUpgradeAvailable()) {
|
|
24
|
-
console.log(chalk.yellow(`\uD83D\uDCE6 Sylphx Flow update available: ${state.version} → ${state.latestVersion}
|
|
25
|
-
`));
|
|
26
|
-
const { default: inquirer } = await import("inquirer");
|
|
27
|
-
const { upgrade } = await inquirer.prompt([
|
|
28
|
-
{
|
|
29
|
-
type: "confirm",
|
|
30
|
-
name: "upgrade",
|
|
31
|
-
message: "Upgrade Sylphx Flow now?",
|
|
32
|
-
default: true
|
|
33
|
-
}
|
|
34
|
-
]);
|
|
35
|
-
if (upgrade) {
|
|
36
|
-
options.upgrade = true;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (state.target && state.targetVersion && state.targetLatestVersion && state.targetVersion !== state.targetLatestVersion) {
|
|
40
|
-
const isOutdated = compareVersions(state.targetVersion, state.targetLatestVersion) < 0;
|
|
41
|
-
if (isOutdated) {
|
|
42
|
-
console.log(chalk.yellow(`\uD83D\uDCE6 ${state.target} update available: ${state.targetVersion} → ${state.targetLatestVersion}
|
|
43
|
-
`));
|
|
44
|
-
const { default: inquirer } = await import("inquirer");
|
|
45
|
-
const { upgradeTarget } = await inquirer.prompt([
|
|
46
|
-
{
|
|
47
|
-
type: "confirm",
|
|
48
|
-
name: "upgradeTarget",
|
|
49
|
-
message: `Upgrade ${state.target} now?`,
|
|
50
|
-
default: true
|
|
51
|
-
}
|
|
52
|
-
]);
|
|
53
|
-
if (upgradeTarget) {
|
|
54
|
-
options.upgradeTarget = true;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function compareVersions(v1, v2) {
|
|
60
|
-
const parts1 = v1.split(".").map(Number);
|
|
61
|
-
const parts2 = v2.split(".").map(Number);
|
|
62
|
-
for (let i = 0;i < Math.max(parts1.length, parts2.length); i++) {
|
|
63
|
-
const p1 = parts1[i] || 0;
|
|
64
|
-
const p2 = parts2[i] || 0;
|
|
65
|
-
if (p1 !== p2) {
|
|
66
|
-
return p1 - p2;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
async function checkComponentIntegrity(state, options) {
|
|
72
|
-
if (!state.initialized || options.clean || options.initOnly)
|
|
73
|
-
return;
|
|
74
|
-
if (options.quick)
|
|
75
|
-
return;
|
|
76
|
-
const missing = [];
|
|
77
|
-
if (!state.components.agents.installed)
|
|
78
|
-
missing.push("agents");
|
|
79
|
-
if (!state.components.rules.installed)
|
|
80
|
-
missing.push("rules");
|
|
81
|
-
if (state.target !== "opencode" && !state.components.hooks.installed) {
|
|
82
|
-
missing.push("hooks");
|
|
83
|
-
}
|
|
84
|
-
if (!state.components.mcp.installed)
|
|
85
|
-
missing.push("mcp");
|
|
86
|
-
if (state.target !== "opencode" && !state.components.outputStyles.installed) {
|
|
87
|
-
missing.push("output styles");
|
|
88
|
-
}
|
|
89
|
-
if (!state.components.slashCommands.installed)
|
|
90
|
-
missing.push("slash commands");
|
|
91
|
-
if (missing.length === 0)
|
|
92
|
-
return;
|
|
93
|
-
console.log(chalk.yellow(`
|
|
94
|
-
⚠️ Missing components detected: ${missing.join(", ")}
|
|
95
|
-
`));
|
|
96
|
-
const { default: inquirer } = await import("inquirer");
|
|
97
|
-
const { repair } = await inquirer.prompt([
|
|
98
|
-
{
|
|
99
|
-
type: "confirm",
|
|
100
|
-
name: "repair",
|
|
101
|
-
message: "Install missing components now?",
|
|
102
|
-
default: true
|
|
103
|
-
}
|
|
104
|
-
]);
|
|
105
|
-
if (repair) {
|
|
106
|
-
options.repair = true;
|
|
107
|
-
console.log(chalk.cyan(`
|
|
108
|
-
\uD83D\uDD27 Repairing components...
|
|
109
|
-
`));
|
|
110
|
-
} else {
|
|
111
|
-
console.log(chalk.dim(`Skipping repair. Components may not work correctly.
|
|
112
|
-
`));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
async function selectTarget(state, options) {
|
|
116
|
-
if (options.clean) {
|
|
117
|
-
const targetId = await targetManager.promptForTargetSelection();
|
|
118
|
-
console.log(chalk.green(`✅ Selected target: ${targetId}`));
|
|
119
|
-
return targetId;
|
|
120
|
-
}
|
|
121
|
-
return options.target || state.target;
|
|
122
|
-
}
|
|
123
|
-
async function initializeProject(targetId, options) {
|
|
124
|
-
if (options.runOnly && !options.clean)
|
|
125
|
-
return;
|
|
126
|
-
console.log(chalk.cyan.bold(`━ Initializing Project
|
|
127
|
-
`));
|
|
128
|
-
const { runInit } = await import("./chunk-v0ez4aef.js");
|
|
129
|
-
const initOptions = {
|
|
130
|
-
target: targetId,
|
|
131
|
-
verbose: options.verbose,
|
|
132
|
-
dryRun: options.dryRun,
|
|
133
|
-
clear: options.clean || false,
|
|
134
|
-
mcp: options.mcp !== false,
|
|
135
|
-
agents: options.agents !== false,
|
|
136
|
-
rules: options.rules !== false,
|
|
137
|
-
outputStyles: options.outputStyles !== false,
|
|
138
|
-
slashCommands: options.slashCommands !== false,
|
|
139
|
-
hooks: options.hooks !== false,
|
|
140
|
-
helpOption: () => {}
|
|
141
|
-
};
|
|
142
|
-
try {
|
|
143
|
-
await runInit(initOptions);
|
|
144
|
-
if (!options.dryRun) {
|
|
145
|
-
console.log(chalk.green.bold(`
|
|
146
|
-
✓ Initialization complete
|
|
147
|
-
`));
|
|
148
|
-
} else {
|
|
149
|
-
console.log(chalk.dim(`
|
|
150
|
-
✓ Dry run complete - skipping execution
|
|
151
|
-
`));
|
|
152
|
-
}
|
|
153
|
-
} catch (error) {
|
|
154
|
-
console.error(chalk.red.bold(`
|
|
155
|
-
✗ Initialization failed:`), error);
|
|
156
|
-
throw error;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
async function launchTarget(targetId, prompt, options, state) {
|
|
160
|
-
if (options.initOnly)
|
|
161
|
-
return;
|
|
162
|
-
const resolvedTarget = await targetManager.resolveTarget({
|
|
163
|
-
target: targetId || state.target,
|
|
164
|
-
allowSelection: false
|
|
165
|
-
});
|
|
166
|
-
console.log(chalk.cyan.bold(`━ Launching ${resolvedTarget}
|
|
167
|
-
`));
|
|
168
|
-
const { getTargetsWithCommandSupport } = await import("./chunk-qk8n91hw.js");
|
|
169
|
-
const supportedTargets = getTargetsWithCommandSupport().map((t) => t.id);
|
|
170
|
-
if (!supportedTargets.includes(resolvedTarget)) {
|
|
171
|
-
console.log(chalk.red.bold(`✗ Unsupported target platform
|
|
172
|
-
`));
|
|
173
|
-
console.log(chalk.yellow(`Target '${resolvedTarget}' does not support agent execution.`));
|
|
174
|
-
console.log(chalk.cyan(`Supported platforms: ${supportedTargets.join(", ")}
|
|
175
|
-
`));
|
|
176
|
-
throw new Error(`Unsupported target: ${resolvedTarget}`);
|
|
177
|
-
}
|
|
178
|
-
if (resolvedTarget === "claude-code") {
|
|
179
|
-
await setupClaudeCode(options);
|
|
180
|
-
}
|
|
181
|
-
await executeCommand(resolvedTarget, prompt, options);
|
|
182
|
-
}
|
|
183
|
-
async function setupClaudeCode(options) {
|
|
184
|
-
const { SmartConfigService } = await import("./chunk-g5cv6703.js");
|
|
185
|
-
const { ConfigService } = await import("./chunk-x66eh37x.js");
|
|
186
|
-
if (!await ConfigService.hasInitialSetup()) {
|
|
187
|
-
console.log(chalk.cyan(`
|
|
188
|
-
\uD83D\uDD11 First-time setup for Claude Code:
|
|
189
|
-
`));
|
|
190
|
-
await SmartConfigService.initialSetup();
|
|
191
|
-
console.log(chalk.green(`
|
|
192
|
-
✅ Claude Code setup complete!
|
|
193
|
-
`));
|
|
194
|
-
}
|
|
195
|
-
const runtimeChoices = await SmartConfigService.selectRuntimeChoices({
|
|
196
|
-
selectProvider: options.selectProvider,
|
|
197
|
-
selectAgent: options.selectAgent,
|
|
198
|
-
useDefaults: options.useDefaults,
|
|
199
|
-
provider: options.provider,
|
|
200
|
-
agent: options.agent
|
|
201
|
-
});
|
|
202
|
-
await SmartConfigService.setupEnvironment(runtimeChoices.provider);
|
|
203
|
-
options.agent = runtimeChoices.agent;
|
|
204
|
-
}
|
|
205
|
-
async function executeCommand(targetId, prompt, options) {
|
|
206
|
-
const agent = options.agent || "coder";
|
|
207
|
-
const verbose = options.verbose || false;
|
|
208
|
-
if (verbose || options.runOnly) {
|
|
209
|
-
console.log(`\uD83E\uDD16 Agent: ${agent}`);
|
|
210
|
-
console.log(`\uD83C\uDFAF Target: ${targetId}`);
|
|
211
|
-
if (prompt) {
|
|
212
|
-
console.log(`\uD83D\uDCAC Prompt: ${prompt}
|
|
213
|
-
`);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
const { runCommand } = await import("./chunk-5j8m3dh3.js");
|
|
217
|
-
await runCommand({ target: targetId, agent, prompt, verbose });
|
|
218
|
-
}
|
|
219
|
-
export {
|
|
220
|
-
selectTarget,
|
|
221
|
-
launchTarget,
|
|
222
|
-
initializeProject,
|
|
223
|
-
checkUpgrades,
|
|
224
|
-
checkComponentIntegrity
|
|
225
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
8
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
9
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
10
|
-
for (let key of __getOwnPropNames(mod))
|
|
11
|
-
if (!__hasOwnProp.call(to, key))
|
|
12
|
-
__defProp(to, key, {
|
|
13
|
-
get: () => mod[key],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
19
|
-
var __export = (target, all) => {
|
|
20
|
-
for (var name in all)
|
|
21
|
-
__defProp(target, name, {
|
|
22
|
-
get: all[name],
|
|
23
|
-
enumerable: true,
|
|
24
|
-
configurable: true,
|
|
25
|
-
set: (newValue) => all[name] = () => newValue
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
29
|
-
|
|
30
|
-
export { __toESM, __commonJS, __export, __require };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import"./chunk-vmeqwm1c.js";
|
|
2
|
-
import"./chunk-qk8n91hw.js";
|
|
3
|
-
import"./chunk-nd5fdvaq.js";
|
|
4
|
-
import {
|
|
5
|
-
CLIError
|
|
6
|
-
} from "./chunk-cjd3mk4c.js";
|
|
7
|
-
import {
|
|
8
|
-
getAgentsDir
|
|
9
|
-
} from "./chunk-t16rfxh0.js";
|
|
10
|
-
import"./chunk-hpkhykhq.js";
|
|
11
|
-
import {
|
|
12
|
-
__require,
|
|
13
|
-
__toESM
|
|
14
|
-
} from "./chunk-5j4w74t6.js";
|
|
15
|
-
|
|
16
|
-
// src/commands/run-command.ts
|
|
17
|
-
import fs from "node:fs/promises";
|
|
18
|
-
import path from "node:path";
|
|
19
|
-
async function loadAgentContent(agentName, agentFilePath) {
|
|
20
|
-
const { enhanceAgentContent } = await import("./chunk-5thh3qem.js");
|
|
21
|
-
try {
|
|
22
|
-
if (agentFilePath) {
|
|
23
|
-
const content = await fs.readFile(path.resolve(agentFilePath), "utf-8");
|
|
24
|
-
return content;
|
|
25
|
-
}
|
|
26
|
-
const claudeAgentPath = path.join(process.cwd(), ".claude", "agents", `${agentName}.md`);
|
|
27
|
-
try {
|
|
28
|
-
const content = await fs.readFile(claudeAgentPath, "utf-8");
|
|
29
|
-
return content;
|
|
30
|
-
} catch (_error) {
|
|
31
|
-
const localAgentPath = path.join(process.cwd(), "agents", `${agentName}.md`);
|
|
32
|
-
try {
|
|
33
|
-
const content = await fs.readFile(localAgentPath, "utf-8");
|
|
34
|
-
return await enhanceAgentContent(content);
|
|
35
|
-
} catch (_error2) {
|
|
36
|
-
const packageAgentsDir = getAgentsDir();
|
|
37
|
-
const packageAgentPath = path.join(packageAgentsDir, `${agentName}.md`);
|
|
38
|
-
const content = await fs.readFile(packageAgentPath, "utf-8");
|
|
39
|
-
return await enhanceAgentContent(content);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
} catch (_error) {
|
|
43
|
-
throw new CLIError(`Agent '${agentName}' not found${agentFilePath ? ` at ${agentFilePath}` : ""}`, "AGENT_NOT_FOUND");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function extractAgentInstructions(agentContent) {
|
|
47
|
-
const yamlFrontMatterRegex = /^---\s*\n[\s\S]*?\n---\s*\n/;
|
|
48
|
-
const match = agentContent.match(yamlFrontMatterRegex);
|
|
49
|
-
if (match) {
|
|
50
|
-
return agentContent.substring(match[0].length).trim();
|
|
51
|
-
}
|
|
52
|
-
return agentContent.trim();
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
loadAgentContent,
|
|
56
|
-
extractAgentInstructions
|
|
57
|
-
};
|
|
58
|
-
export { loadAgentContent, extractAgentInstructions };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getOutputStylesDir,
|
|
3
|
-
getRulesDir
|
|
4
|
-
} from "./chunk-t16rfxh0.js";
|
|
5
|
-
import {
|
|
6
|
-
yamlUtils
|
|
7
|
-
} from "./chunk-hpkhykhq.js";
|
|
8
|
-
import"./chunk-5j4w74t6.js";
|
|
9
|
-
|
|
10
|
-
// src/utils/agent-enhancer.ts
|
|
11
|
-
import fs from "node:fs/promises";
|
|
12
|
-
import path from "node:path";
|
|
13
|
-
async function loadRulesAndStyles(ruleNames) {
|
|
14
|
-
const sections = [];
|
|
15
|
-
const rulesContent = await loadRules(ruleNames);
|
|
16
|
-
if (rulesContent) {
|
|
17
|
-
sections.push(rulesContent);
|
|
18
|
-
}
|
|
19
|
-
const stylesContent = await loadOutputStyles();
|
|
20
|
-
if (stylesContent) {
|
|
21
|
-
sections.push(stylesContent);
|
|
22
|
-
}
|
|
23
|
-
return sections.join(`
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
`);
|
|
28
|
-
}
|
|
29
|
-
async function loadRules(ruleNames) {
|
|
30
|
-
try {
|
|
31
|
-
const rulesDir = getRulesDir();
|
|
32
|
-
const rulesToLoad = ruleNames && ruleNames.length > 0 ? ruleNames : ["core"];
|
|
33
|
-
const sections = [];
|
|
34
|
-
for (const ruleName of rulesToLoad) {
|
|
35
|
-
const rulePath = path.join(rulesDir, `${ruleName}.md`);
|
|
36
|
-
try {
|
|
37
|
-
const content = await fs.readFile(rulePath, "utf8");
|
|
38
|
-
const stripped = await yamlUtils.stripFrontMatter(content);
|
|
39
|
-
sections.push(stripped);
|
|
40
|
-
} catch (error) {
|
|
41
|
-
console.warn(`Warning: Rule file not found: ${ruleName}.md`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return sections.join(`
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
`);
|
|
49
|
-
} catch (_error) {
|
|
50
|
-
return "";
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async function loadOutputStyles() {
|
|
54
|
-
try {
|
|
55
|
-
const outputStylesDir = getOutputStylesDir();
|
|
56
|
-
const files = await fs.readdir(outputStylesDir);
|
|
57
|
-
const mdFiles = files.filter((f) => f.endsWith(".md"));
|
|
58
|
-
if (mdFiles.length === 0) {
|
|
59
|
-
return "";
|
|
60
|
-
}
|
|
61
|
-
const sections = [];
|
|
62
|
-
for (const file of mdFiles) {
|
|
63
|
-
const filePath = path.join(outputStylesDir, file);
|
|
64
|
-
const content = await fs.readFile(filePath, "utf8");
|
|
65
|
-
const stripped = await yamlUtils.stripFrontMatter(content);
|
|
66
|
-
sections.push(stripped);
|
|
67
|
-
}
|
|
68
|
-
return sections.join(`
|
|
69
|
-
|
|
70
|
-
`);
|
|
71
|
-
} catch (_error) {
|
|
72
|
-
return "";
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
async function enhanceAgentContent(agentContent, ruleNames) {
|
|
76
|
-
const rulesAndStyles = await loadRulesAndStyles(ruleNames);
|
|
77
|
-
if (!rulesAndStyles) {
|
|
78
|
-
return agentContent;
|
|
79
|
-
}
|
|
80
|
-
return `${agentContent}
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
# Rules and Output Styles
|
|
85
|
-
|
|
86
|
-
${rulesAndStyles}`;
|
|
87
|
-
}
|
|
88
|
-
export {
|
|
89
|
-
loadRulesAndStyles,
|
|
90
|
-
enhanceAgentContent
|
|
91
|
-
};
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConfigService
|
|
3
|
-
} from "./chunk-x66eh37x.js";
|
|
4
|
-
import"./chunk-7eq34c42.js";
|
|
5
|
-
import {
|
|
6
|
-
projectSettings,
|
|
7
|
-
targetManager
|
|
8
|
-
} from "./chunk-vmeqwm1c.js";
|
|
9
|
-
import"./chunk-qk8n91hw.js";
|
|
10
|
-
import"./chunk-nd5fdvaq.js";
|
|
11
|
-
import {
|
|
12
|
-
CLIError
|
|
13
|
-
} from "./chunk-cjd3mk4c.js";
|
|
14
|
-
import"./chunk-t16rfxh0.js";
|
|
15
|
-
import"./chunk-hpkhykhq.js";
|
|
16
|
-
import"./chunk-5j4w74t6.js";
|
|
17
|
-
|
|
18
|
-
// src/commands/init-core.ts
|
|
19
|
-
import chalk from "chalk";
|
|
20
|
-
import ora from "ora";
|
|
21
|
-
|
|
22
|
-
// src/utils/target-config.ts
|
|
23
|
-
import { createInterface } from "node:readline";
|
|
24
|
-
function validateTarget(targetId) {
|
|
25
|
-
const targetOption = targetManager.getTarget(targetId);
|
|
26
|
-
if (targetOption._tag === "None") {
|
|
27
|
-
throw new Error(`Unknown target: ${targetId}. Available targets: ${targetManager.getImplementedTargetIDs().join(", ")}`);
|
|
28
|
-
}
|
|
29
|
-
const target = targetOption.value;
|
|
30
|
-
if (!target.isImplemented) {
|
|
31
|
-
throw new Error(`Target '${targetId}' is not implemented. Available targets: ${targetManager.getImplementedTargetIDs().join(", ")}`);
|
|
32
|
-
}
|
|
33
|
-
return targetId;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// src/commands/init-core.ts
|
|
37
|
-
async function selectAndValidateTarget(options) {
|
|
38
|
-
let targetId = options.target;
|
|
39
|
-
if (!targetId) {
|
|
40
|
-
targetId = await targetManager.promptForTargetSelection();
|
|
41
|
-
}
|
|
42
|
-
if (targetId) {
|
|
43
|
-
try {
|
|
44
|
-
validateTarget(targetId);
|
|
45
|
-
} catch (error) {
|
|
46
|
-
if (error instanceof Error) {
|
|
47
|
-
throw new CLIError(error.message, "UNSUPPORTED_TARGET");
|
|
48
|
-
}
|
|
49
|
-
throw error;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (!targetId) {
|
|
53
|
-
throw new Error("Target ID not set");
|
|
54
|
-
}
|
|
55
|
-
return targetId;
|
|
56
|
-
}
|
|
57
|
-
async function previewDryRun(targetId, options) {
|
|
58
|
-
const targetOption = targetManager.getTarget(targetId);
|
|
59
|
-
if (targetOption._tag === "None") {
|
|
60
|
-
throw new Error(`Target not found: ${targetId}`);
|
|
61
|
-
}
|
|
62
|
-
const target = targetOption.value;
|
|
63
|
-
if (options.mcp !== false && target.setupMCP) {
|
|
64
|
-
console.log(chalk.cyan.bold("MCP Tools:"));
|
|
65
|
-
console.log(chalk.dim(" ✓ MCP servers will be configured"));
|
|
66
|
-
}
|
|
67
|
-
if (options.agents !== false && target.setupAgents) {
|
|
68
|
-
console.log(chalk.cyan.bold(`
|
|
69
|
-
Agents:`));
|
|
70
|
-
console.log(chalk.dim(" ✓ Development agents will be installed"));
|
|
71
|
-
}
|
|
72
|
-
if (options.outputStyles !== false && target.setupOutputStyles) {
|
|
73
|
-
console.log(chalk.cyan.bold(`
|
|
74
|
-
Output Styles:`));
|
|
75
|
-
console.log(chalk.dim(" ✓ Output styles will be installed"));
|
|
76
|
-
}
|
|
77
|
-
if (options.rules !== false && target.setupRules) {
|
|
78
|
-
console.log(chalk.cyan.bold(`
|
|
79
|
-
Rules:`));
|
|
80
|
-
console.log(chalk.dim(" ✓ Custom rules will be installed"));
|
|
81
|
-
}
|
|
82
|
-
if (options.slashCommands !== false && target.setupSlashCommands) {
|
|
83
|
-
console.log(chalk.cyan.bold(`
|
|
84
|
-
Slash Commands:`));
|
|
85
|
-
console.log(chalk.dim(" ✓ Slash commands will be installed"));
|
|
86
|
-
}
|
|
87
|
-
if (options.hooks !== false && target.setupHooks) {
|
|
88
|
-
console.log(chalk.cyan.bold(`
|
|
89
|
-
Hooks:`));
|
|
90
|
-
console.log(chalk.dim(" ✓ Hooks will be configured"));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
async function installComponents(targetId, options) {
|
|
94
|
-
const targetOption = targetManager.getTarget(targetId);
|
|
95
|
-
if (targetOption._tag === "None") {
|
|
96
|
-
throw new Error(`Target not found: ${targetId}`);
|
|
97
|
-
}
|
|
98
|
-
const target = targetOption.value;
|
|
99
|
-
const quiet = options.quiet || false;
|
|
100
|
-
const result = {
|
|
101
|
-
targetId,
|
|
102
|
-
targetName: target.name,
|
|
103
|
-
installed: {}
|
|
104
|
-
};
|
|
105
|
-
if (target.setupMCP && options.mcp !== false) {
|
|
106
|
-
try {
|
|
107
|
-
const mcpResult = await target.setupMCP(process.cwd(), options);
|
|
108
|
-
result.installed.mcp = mcpResult.count;
|
|
109
|
-
if (!quiet) {
|
|
110
|
-
if (mcpResult.count > 0) {
|
|
111
|
-
console.log(chalk.green(`✔ Installed ${chalk.cyan(mcpResult.count)} MCP server${mcpResult.count !== 1 ? "s" : ""}`));
|
|
112
|
-
} else {
|
|
113
|
-
console.log(chalk.dim("ℹ No MCP servers selected"));
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
} catch (error) {
|
|
117
|
-
if (error instanceof Error && error.name === "ExitPromptError") {
|
|
118
|
-
if (!quiet) {
|
|
119
|
-
console.log(chalk.yellow(`
|
|
120
|
-
⚠️ MCP setup cancelled, continuing with other components
|
|
121
|
-
`));
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
if (!quiet) {
|
|
125
|
-
console.error(chalk.red("✖ Failed to setup MCP servers"));
|
|
126
|
-
}
|
|
127
|
-
throw error;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (target.setupAgents && options.agents !== false) {
|
|
132
|
-
const agentSpinner = quiet ? null : ora({ text: "Installing agents", color: "cyan" }).start();
|
|
133
|
-
try {
|
|
134
|
-
const agentResult = await target.setupAgents(process.cwd(), { ...options, quiet: true });
|
|
135
|
-
result.installed.agents = agentResult.count;
|
|
136
|
-
if (agentSpinner) {
|
|
137
|
-
agentSpinner.succeed(chalk.green(`Installed ${chalk.cyan(agentResult.count)} agent${agentResult.count !== 1 ? "s" : ""}`));
|
|
138
|
-
}
|
|
139
|
-
} catch (error) {
|
|
140
|
-
if (agentSpinner) {
|
|
141
|
-
agentSpinner.fail(chalk.red("Failed to install agents"));
|
|
142
|
-
}
|
|
143
|
-
throw error;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (target.setupOutputStyles && options.outputStyles !== false) {
|
|
147
|
-
const stylesSpinner = quiet ? null : ora({ text: "Installing output styles", color: "cyan" }).start();
|
|
148
|
-
try {
|
|
149
|
-
const stylesResult = await target.setupOutputStyles(process.cwd(), { ...options, quiet: true });
|
|
150
|
-
result.installed.outputStyles = stylesResult.count;
|
|
151
|
-
if (stylesSpinner) {
|
|
152
|
-
if (stylesResult.count > 0) {
|
|
153
|
-
stylesSpinner.succeed(chalk.green(`Installed ${chalk.cyan(stylesResult.count)} output style${stylesResult.count !== 1 ? "s" : ""}`));
|
|
154
|
-
} else if (stylesResult.message) {
|
|
155
|
-
stylesSpinner.info(chalk.dim(stylesResult.message));
|
|
156
|
-
} else {
|
|
157
|
-
stylesSpinner.info(chalk.dim("No output styles to install"));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
} catch (error) {
|
|
161
|
-
if (stylesSpinner) {
|
|
162
|
-
stylesSpinner.fail(chalk.red("Failed to install output styles"));
|
|
163
|
-
}
|
|
164
|
-
throw error;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
if (target.setupRules && options.rules !== false) {
|
|
168
|
-
const rulesSpinner = quiet ? null : ora({ text: "Installing rules", color: "cyan" }).start();
|
|
169
|
-
try {
|
|
170
|
-
const rulesResult = await target.setupRules(process.cwd(), { ...options, quiet: true });
|
|
171
|
-
result.installed.rules = rulesResult.count;
|
|
172
|
-
if (rulesSpinner) {
|
|
173
|
-
if (rulesResult.count > 0) {
|
|
174
|
-
rulesSpinner.succeed(chalk.green(`Installed ${chalk.cyan(rulesResult.count)} rule${rulesResult.count !== 1 ? "s" : ""}`));
|
|
175
|
-
} else if (rulesResult.message) {
|
|
176
|
-
rulesSpinner.info(chalk.dim(rulesResult.message));
|
|
177
|
-
} else {
|
|
178
|
-
rulesSpinner.info(chalk.dim("No rules to install"));
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
} catch (error) {
|
|
182
|
-
if (rulesSpinner) {
|
|
183
|
-
rulesSpinner.fail(chalk.red("Failed to install rules"));
|
|
184
|
-
}
|
|
185
|
-
throw error;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
if (target.setupSlashCommands && options.slashCommands !== false) {
|
|
189
|
-
const commandsSpinner = quiet ? null : ora({
|
|
190
|
-
text: "Installing slash commands",
|
|
191
|
-
color: "cyan"
|
|
192
|
-
}).start();
|
|
193
|
-
try {
|
|
194
|
-
const commandsResult = await target.setupSlashCommands(process.cwd(), { ...options, quiet: true });
|
|
195
|
-
result.installed.slashCommands = commandsResult.count;
|
|
196
|
-
if (commandsSpinner) {
|
|
197
|
-
if (commandsResult.count > 0) {
|
|
198
|
-
commandsSpinner.succeed(chalk.green(`Installed ${chalk.cyan(commandsResult.count)} slash command${commandsResult.count !== 1 ? "s" : ""}`));
|
|
199
|
-
} else if (commandsResult.message) {
|
|
200
|
-
commandsSpinner.info(chalk.dim(commandsResult.message));
|
|
201
|
-
} else {
|
|
202
|
-
commandsSpinner.info(chalk.dim("No slash commands to install"));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
} catch (error) {
|
|
206
|
-
if (commandsSpinner) {
|
|
207
|
-
commandsSpinner.fail(chalk.red("Failed to install slash commands"));
|
|
208
|
-
}
|
|
209
|
-
throw error;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (target.setupHooks && options.hooks !== false) {
|
|
213
|
-
const hooksSpinner = quiet ? null : ora({ text: "Setting up hooks", color: "cyan" }).start();
|
|
214
|
-
try {
|
|
215
|
-
const hooksResult = await target.setupHooks(process.cwd(), { ...options, quiet: true });
|
|
216
|
-
result.installed.hooks = hooksResult.count;
|
|
217
|
-
if (hooksSpinner) {
|
|
218
|
-
if (hooksResult.count > 0) {
|
|
219
|
-
const message = hooksResult.message ? `Configured ${chalk.cyan(hooksResult.count)} hook${hooksResult.count !== 1 ? "s" : ""} - ${hooksResult.message}` : `Configured ${chalk.cyan(hooksResult.count)} hook${hooksResult.count !== 1 ? "s" : ""}`;
|
|
220
|
-
hooksSpinner.succeed(chalk.green(message));
|
|
221
|
-
} else {
|
|
222
|
-
hooksSpinner.info(chalk.dim(hooksResult.message || "No hooks to configure"));
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
} catch (error) {
|
|
226
|
-
if (hooksSpinner) {
|
|
227
|
-
hooksSpinner.warn(chalk.yellow("Could not setup hooks"));
|
|
228
|
-
console.warn(chalk.dim(` ${error instanceof Error ? error.message : String(error)}`));
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
try {
|
|
233
|
-
await projectSettings.setDefaultTarget(targetId);
|
|
234
|
-
await ConfigService.saveProjectSettings({
|
|
235
|
-
target: targetId,
|
|
236
|
-
version: "1.0.0",
|
|
237
|
-
lastUpdated: new Date().toISOString()
|
|
238
|
-
});
|
|
239
|
-
} catch (error) {
|
|
240
|
-
if (!quiet) {
|
|
241
|
-
console.warn(chalk.yellow(`⚠ Warning: Could not save default target: ${error instanceof Error ? error.message : String(error)}`));
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return result;
|
|
245
|
-
}
|
|
246
|
-
export {
|
|
247
|
-
selectAndValidateTarget,
|
|
248
|
-
previewDryRun,
|
|
249
|
-
installComponents
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
export { selectAndValidateTarget, previewDryRun, installComponents };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import"./chunk-5j4w74t6.js";
|
|
2
|
-
|
|
3
|
-
// src/config/constants.ts
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
var CONFIG_DIR = ".sylphx-flow";
|
|
7
|
-
var USER_CONFIG_DIR = path.join(os.homedir(), CONFIG_DIR);
|
|
8
|
-
var USER_SETTINGS_FILE = path.join(USER_CONFIG_DIR, "settings.json");
|
|
9
|
-
function getProjectSettingsFile(cwd = process.cwd()) {
|
|
10
|
-
return path.join(cwd, CONFIG_DIR, "settings.json");
|
|
11
|
-
}
|
|
12
|
-
function getProjectLocalSettingsFile(cwd = process.cwd()) {
|
|
13
|
-
return path.join(cwd, CONFIG_DIR, "settings.local.json");
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
getProjectSettingsFile,
|
|
17
|
-
getProjectLocalSettingsFile,
|
|
18
|
-
USER_SETTINGS_FILE,
|
|
19
|
-
USER_CONFIG_DIR,
|
|
20
|
-
CONFIG_DIR
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { CONFIG_DIR, USER_SETTINGS_FILE, getProjectSettingsFile, getProjectLocalSettingsFile };
|