@sembix/cli 1.2.1 → 1.4.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/COMMANDS.md +1522 -0
- package/QUICKSTART.md +829 -0
- package/README.md +1976 -309
- package/USAGE-EXAMPLES.md +872 -0
- package/config.example.yaml +3 -0
- package/dist/commands/configure.d.ts.map +1 -1
- package/dist/commands/configure.js +172 -2
- package/dist/commands/configure.js.map +1 -1
- package/dist/commands/index.d.ts +10 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +11 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/login.d.ts +19 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +118 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +21 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +66 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/profile-project.d.ts +14 -0
- package/dist/commands/profile-project.d.ts.map +1 -0
- package/dist/commands/profile-project.js +123 -0
- package/dist/commands/profile-project.js.map +1 -0
- package/dist/commands/profile.d.ts +26 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +177 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/project.d.ts +16 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +153 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/setup.js +3 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/workflow.d.ts +91 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +1201 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/config-schema.d.ts +26 -0
- package/dist/config-schema.d.ts.map +1 -1
- package/dist/config-schema.js +24 -1
- package/dist/config-schema.js.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +23 -2
- package/dist/config.js.map +1 -1
- package/dist/index.js +324 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts/environment-setup.d.ts.map +1 -1
- package/dist/prompts/environment-setup.js +12 -0
- package/dist/prompts/environment-setup.js.map +1 -1
- package/dist/prompts/project-selection.d.ts +8 -0
- package/dist/prompts/project-selection.d.ts.map +1 -0
- package/dist/prompts/project-selection.js +132 -0
- package/dist/prompts/project-selection.js.map +1 -0
- package/dist/prompts/workflow-inputs.d.ts +10 -0
- package/dist/prompts/workflow-inputs.d.ts.map +1 -0
- package/dist/prompts/workflow-inputs.js +71 -0
- package/dist/prompts/workflow-inputs.js.map +1 -0
- package/dist/prompts/workflow-selection.d.ts +8 -0
- package/dist/prompts/workflow-selection.d.ts.map +1 -0
- package/dist/prompts/workflow-selection.js +147 -0
- package/dist/prompts/workflow-selection.js.map +1 -0
- package/dist/sembix-cli-1.4.0.tgz +0 -0
- package/dist/services/cognito-auth.d.ts +92 -0
- package/dist/services/cognito-auth.d.ts.map +1 -0
- package/dist/services/cognito-auth.js +319 -0
- package/dist/services/cognito-auth.js.map +1 -0
- package/dist/services/studio-api-client.d.ts +127 -0
- package/dist/services/studio-api-client.d.ts.map +1 -0
- package/dist/services/studio-api-client.js +291 -0
- package/dist/services/studio-api-client.js.map +1 -0
- package/dist/types/studio.d.ts +82 -0
- package/dist/types/studio.d.ts.map +1 -0
- package/dist/types/studio.js +7 -0
- package/dist/types/studio.js.map +1 -0
- package/dist/types.d.ts +286 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/browser-auth.d.ts +45 -0
- package/dist/utils/browser-auth.d.ts.map +1 -0
- package/dist/utils/browser-auth.js +168 -0
- package/dist/utils/browser-auth.js.map +1 -0
- package/dist/utils/cognito-auth.d.ts +3 -0
- package/dist/utils/cognito-auth.d.ts.map +1 -0
- package/dist/utils/cognito-auth.js +3 -0
- package/dist/utils/cognito-auth.js.map +1 -0
- package/dist/utils/config-file.d.ts +40 -0
- package/dist/utils/config-file.d.ts.map +1 -1
- package/dist/utils/config-file.js +158 -4
- package/dist/utils/config-file.js.map +1 -1
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +15 -2
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/environment.d.ts +22 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +39 -0
- package/dist/utils/environment.js.map +1 -0
- package/dist/utils/error-handler.d.ts +53 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +174 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/fuzzy-match.d.ts +31 -0
- package/dist/utils/fuzzy-match.d.ts.map +1 -0
- package/dist/utils/fuzzy-match.js +138 -0
- package/dist/utils/fuzzy-match.js.map +1 -0
- package/dist/utils/input-parser.d.ts +14 -0
- package/dist/utils/input-parser.d.ts.map +1 -0
- package/dist/utils/input-parser.js +34 -0
- package/dist/utils/input-parser.js.map +1 -0
- package/dist/utils/output.d.ts +55 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +80 -0
- package/dist/utils/output.js.map +1 -0
- package/dist/utils/recent-workflows.d.ts +37 -0
- package/dist/utils/recent-workflows.d.ts.map +1 -0
- package/dist/utils/recent-workflows.js +172 -0
- package/dist/utils/recent-workflows.js.map +1 -0
- package/dist/utils/studio-api-client.d.ts +3 -0
- package/dist/utils/studio-api-client.d.ts.map +1 -0
- package/dist/utils/studio-api-client.js +3 -0
- package/dist/utils/studio-api-client.js.map +1 -0
- package/dist/utils/studio-api.d.ts +53 -0
- package/dist/utils/studio-api.d.ts.map +1 -0
- package/dist/utils/studio-api.js +102 -0
- package/dist/utils/studio-api.js.map +1 -0
- package/dist/utils/studio-config.d.ts +74 -0
- package/dist/utils/studio-config.d.ts.map +1 -0
- package/dist/utils/studio-config.js +213 -0
- package/dist/utils/studio-config.js.map +1 -0
- package/dist/utils/token-manager.d.ts +4 -0
- package/dist/utils/token-manager.d.ts.map +1 -0
- package/dist/utils/token-manager.js +3 -0
- package/dist/utils/token-manager.js.map +1 -0
- package/dist/utils/ui.d.ts +55 -1
- package/dist/utils/ui.d.ts.map +1 -1
- package/dist/utils/ui.js +151 -2
- package/dist/utils/ui.js.map +1 -1
- package/package.json +4 -1
- package/dist/__tests__/config-schema.test.d.ts +0 -2
- package/dist/__tests__/config-schema.test.d.ts.map +0 -1
- package/dist/__tests__/config-schema.test.js +0 -471
- package/dist/__tests__/config-schema.test.js.map +0 -1
- package/dist/__tests__/config.test.d.ts +0 -2
- package/dist/__tests__/config.test.d.ts.map +0 -1
- package/dist/__tests__/config.test.js +0 -75
- package/dist/__tests__/config.test.js.map +0 -1
- package/dist/__tests__/integration/configure.test.d.ts +0 -2
- package/dist/__tests__/integration/configure.test.d.ts.map +0 -1
- package/dist/__tests__/integration/configure.test.js +0 -247
- package/dist/__tests__/integration/configure.test.js.map +0 -1
- package/dist/__tests__/integration/fixtures/configs.d.ts +0 -477
- package/dist/__tests__/integration/fixtures/configs.d.ts.map +0 -1
- package/dist/__tests__/integration/fixtures/configs.js +0 -175
- package/dist/__tests__/integration/fixtures/configs.js.map +0 -1
- package/dist/__tests__/integration/helpers/cli-runner.d.ts +0 -63
- package/dist/__tests__/integration/helpers/cli-runner.d.ts.map +0 -1
- package/dist/__tests__/integration/helpers/cli-runner.js +0 -152
- package/dist/__tests__/integration/helpers/cli-runner.js.map +0 -1
- package/dist/__tests__/integration/helpers/command-runner.d.ts +0 -53
- package/dist/__tests__/integration/helpers/command-runner.d.ts.map +0 -1
- package/dist/__tests__/integration/helpers/command-runner.js +0 -117
- package/dist/__tests__/integration/helpers/command-runner.js.map +0 -1
- package/dist/__tests__/integration/studio-create.test.d.ts +0 -2
- package/dist/__tests__/integration/studio-create.test.d.ts.map +0 -1
- package/dist/__tests__/integration/studio-create.test.js +0 -209
- package/dist/__tests__/integration/studio-create.test.js.map +0 -1
- package/dist/__tests__/integration/studio-update.test.d.ts +0 -2
- package/dist/__tests__/integration/studio-update.test.d.ts.map +0 -1
- package/dist/__tests__/integration/studio-update.test.js +0 -166
- package/dist/__tests__/integration/studio-update.test.js.map +0 -1
- package/dist/commands/__tests__/configure.test.d.ts +0 -2
- package/dist/commands/__tests__/configure.test.d.ts.map +0 -1
- package/dist/commands/__tests__/configure.test.js +0 -229
- package/dist/commands/__tests__/configure.test.js.map +0 -1
- package/dist/prompts/__tests__/environment-setup.test.d.ts +0 -2
- package/dist/prompts/__tests__/environment-setup.test.d.ts.map +0 -1
- package/dist/prompts/__tests__/environment-setup.test.js +0 -206
- package/dist/prompts/__tests__/environment-setup.test.js.map +0 -1
- package/dist/prompts/__tests__/hub-integration.test.d.ts +0 -2
- package/dist/prompts/__tests__/hub-integration.test.d.ts.map +0 -1
- package/dist/prompts/__tests__/hub-integration.test.js +0 -126
- package/dist/prompts/__tests__/hub-integration.test.js.map +0 -1
- package/dist/prompts/__tests__/prompt-helpers.test.d.ts +0 -2
- package/dist/prompts/__tests__/prompt-helpers.test.d.ts.map +0 -1
- package/dist/prompts/__tests__/prompt-helpers.test.js +0 -235
- package/dist/prompts/__tests__/prompt-helpers.test.js.map +0 -1
- package/dist/sembix-cli-1.2.1.tgz +0 -0
- package/dist/utils/__tests__/config-file.test.d.ts +0 -2
- package/dist/utils/__tests__/config-file.test.d.ts.map +0 -1
- package/dist/utils/__tests__/config-file.test.js +0 -218
- package/dist/utils/__tests__/config-file.test.js.map +0 -1
- package/dist/utils/__tests__/config-loader.test.d.ts +0 -2
- package/dist/utils/__tests__/config-loader.test.d.ts.map +0 -1
- package/dist/utils/__tests__/config-loader.test.js +0 -325
- package/dist/utils/__tests__/config-loader.test.js.map +0 -1
- package/dist/utils/__tests__/github.test.d.ts +0 -2
- package/dist/utils/__tests__/github.test.d.ts.map +0 -1
- package/dist/utils/__tests__/github.test.js +0 -282
- package/dist/utils/__tests__/github.test.js.map +0 -1
- package/dist/utils/__tests__/ui.test.d.ts +0 -2
- package/dist/utils/__tests__/ui.test.d.ts.map +0 -1
- package/dist/utils/__tests__/ui.test.js +0 -256
- package/dist/utils/__tests__/ui.test.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAG9B;IACA;IAHT,YACE,OAAe,EACR,UAAkB,EAClB,YAAqB;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHR,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAS;QAG5B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,oEAAoE;QACpE,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;CACF;AAED;;G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,EAAE;QAC7C,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,cAAc,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fuzzy matching utility for searching workflows and projects
|
|
3
|
+
*/
|
|
4
|
+
export interface FuzzyMatch<T> {
|
|
5
|
+
item: T;
|
|
6
|
+
score: number;
|
|
7
|
+
matches: number[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Performs fuzzy matching on a list of items
|
|
11
|
+
* @param query Search query
|
|
12
|
+
* @param items List of items to search
|
|
13
|
+
* @param getText Function to extract searchable text from an item
|
|
14
|
+
* @param minScore Minimum score threshold (default: 100)
|
|
15
|
+
* @returns Sorted array of matches (highest score first)
|
|
16
|
+
*/
|
|
17
|
+
export declare function fuzzyMatch<T>(query: string, items: T[], getText: (item: T) => string, minScore?: number): FuzzyMatch<T>[];
|
|
18
|
+
/**
|
|
19
|
+
* Highlights matched characters in terminal output
|
|
20
|
+
* @param text Original text
|
|
21
|
+
* @param matches Array of character indices to highlight
|
|
22
|
+
* @returns Text with ANSI color codes for highlighting
|
|
23
|
+
*/
|
|
24
|
+
export declare function highlightMatches(text: string, matches: number[]): string;
|
|
25
|
+
/**
|
|
26
|
+
* Converts a score to a percentage (0-100)
|
|
27
|
+
* @param score Fuzzy match score
|
|
28
|
+
* @returns Percentage (0-100)
|
|
29
|
+
*/
|
|
30
|
+
export declare function scoreToPercentage(score: number): number;
|
|
31
|
+
//# sourceMappingURL=fuzzy-match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuzzy-match.d.ts","sourceRoot":"","sources":["../../src/utils/fuzzy-match.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,EAC5B,QAAQ,GAAE,MAAY,GACrB,UAAU,CAAC,CAAC,CAAC,EAAE,CAwBjB;AAsFD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAgBxE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvD"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fuzzy matching utility for searching workflows and projects
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Performs fuzzy matching on a list of items
|
|
6
|
+
* @param query Search query
|
|
7
|
+
* @param items List of items to search
|
|
8
|
+
* @param getText Function to extract searchable text from an item
|
|
9
|
+
* @param minScore Minimum score threshold (default: 100)
|
|
10
|
+
* @returns Sorted array of matches (highest score first)
|
|
11
|
+
*/
|
|
12
|
+
export function fuzzyMatch(query, items, getText, minScore = 100) {
|
|
13
|
+
const normalizedQuery = query.toLowerCase().trim();
|
|
14
|
+
if (!normalizedQuery)
|
|
15
|
+
return [];
|
|
16
|
+
const results = [];
|
|
17
|
+
for (const item of items) {
|
|
18
|
+
const text = getText(item);
|
|
19
|
+
const normalizedText = text.toLowerCase();
|
|
20
|
+
const score = calculateScore(normalizedQuery, normalizedText);
|
|
21
|
+
if (score >= minScore) {
|
|
22
|
+
results.push({
|
|
23
|
+
item,
|
|
24
|
+
score,
|
|
25
|
+
matches: findMatches(normalizedQuery, normalizedText)
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Sort by score descending
|
|
30
|
+
results.sort((a, b) => b.score - a.score);
|
|
31
|
+
return results;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Calculates a fuzzy match score
|
|
35
|
+
* Higher score = better match
|
|
36
|
+
*/
|
|
37
|
+
function calculateScore(query, text) {
|
|
38
|
+
// Exact match (case-insensitive)
|
|
39
|
+
if (text === query)
|
|
40
|
+
return 1000;
|
|
41
|
+
// Starts with query
|
|
42
|
+
if (text.startsWith(query)) {
|
|
43
|
+
return 500 + (100 - text.indexOf(query));
|
|
44
|
+
}
|
|
45
|
+
// Word boundary match (after space, dash, or underscore)
|
|
46
|
+
const words = text.split(/[\s\-_]+/);
|
|
47
|
+
for (let i = 0; i < words.length; i++) {
|
|
48
|
+
if (words[i].startsWith(query)) {
|
|
49
|
+
// Earlier words get higher scores
|
|
50
|
+
return 300 + (100 - i * 10);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Substring match
|
|
54
|
+
const index = text.indexOf(query);
|
|
55
|
+
if (index >= 0) {
|
|
56
|
+
// Earlier matches get higher scores
|
|
57
|
+
return 200 + (100 - index);
|
|
58
|
+
}
|
|
59
|
+
// Character sequence match (all characters appear in order)
|
|
60
|
+
let score = 0;
|
|
61
|
+
let queryIndex = 0;
|
|
62
|
+
let consecutive = 0;
|
|
63
|
+
let lastMatchIndex = -1;
|
|
64
|
+
for (let i = 0; i < text.length && queryIndex < query.length; i++) {
|
|
65
|
+
if (text[i] === query[queryIndex]) {
|
|
66
|
+
queryIndex++;
|
|
67
|
+
// Bonus for consecutive matches
|
|
68
|
+
if (lastMatchIndex === i - 1) {
|
|
69
|
+
consecutive++;
|
|
70
|
+
score += consecutive * 10;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
consecutive = 1;
|
|
74
|
+
score += 5;
|
|
75
|
+
}
|
|
76
|
+
// Bonus for matches at word boundaries
|
|
77
|
+
if (i === 0 || /[\s\-_]/.test(text[i - 1])) {
|
|
78
|
+
score += 15;
|
|
79
|
+
}
|
|
80
|
+
lastMatchIndex = i;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
consecutive = 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// All characters matched?
|
|
87
|
+
if (queryIndex === query.length) {
|
|
88
|
+
return score;
|
|
89
|
+
}
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Finds the indices of matched characters
|
|
94
|
+
*/
|
|
95
|
+
function findMatches(query, text) {
|
|
96
|
+
const matches = [];
|
|
97
|
+
let queryIndex = 0;
|
|
98
|
+
for (let i = 0; i < text.length && queryIndex < query.length; i++) {
|
|
99
|
+
if (text[i] === query[queryIndex]) {
|
|
100
|
+
matches.push(i);
|
|
101
|
+
queryIndex++;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return matches;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Highlights matched characters in terminal output
|
|
108
|
+
* @param text Original text
|
|
109
|
+
* @param matches Array of character indices to highlight
|
|
110
|
+
* @returns Text with ANSI color codes for highlighting
|
|
111
|
+
*/
|
|
112
|
+
export function highlightMatches(text, matches) {
|
|
113
|
+
if (matches.length === 0)
|
|
114
|
+
return text;
|
|
115
|
+
let result = '';
|
|
116
|
+
const matchSet = new Set(matches);
|
|
117
|
+
for (let i = 0; i < text.length; i++) {
|
|
118
|
+
if (matchSet.has(i)) {
|
|
119
|
+
// Bold yellow for matched characters
|
|
120
|
+
result += `\x1b[1m\x1b[33m${text[i]}\x1b[0m`;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
result += text[i];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Converts a score to a percentage (0-100)
|
|
130
|
+
* @param score Fuzzy match score
|
|
131
|
+
* @returns Percentage (0-100)
|
|
132
|
+
*/
|
|
133
|
+
export function scoreToPercentage(score) {
|
|
134
|
+
// Map score to percentage
|
|
135
|
+
// 1000 = 100%, 0 = 0%
|
|
136
|
+
return Math.min(100, Math.round((score / 1000) * 100));
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=fuzzy-match.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuzzy-match.js","sourceRoot":"","sources":["../../src/utils/fuzzy-match.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,KAAa,EACb,KAAU,EACV,OAA4B,EAC5B,WAAmB,GAAG;IAEtB,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACnD,IAAI,CAAC,eAAe;QAAE,OAAO,EAAE,CAAC;IAEhC,MAAM,OAAO,GAAoB,EAAE,CAAC;IAEpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3B,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,KAAK,GAAG,cAAc,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC;QAE9D,IAAI,KAAK,IAAI,QAAQ,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC;gBACX,IAAI;gBACJ,KAAK;gBACL,OAAO,EAAE,WAAW,CAAC,eAAe,EAAE,cAAc,CAAC;aACtD,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,2BAA2B;IAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAE1C,OAAO,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U,gBAAgB,CAAC,IAAY,EAAE,OAAiB;IAC9D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEtC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAElC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACpB,qCAAqC;YACrC,MAAM,IAAI,kBAAkB,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,0BAA0B;IAC1B,sBAAsB;IACtB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StartWorkflowConfiguration } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parse workflow inputs from JSON string and detect format.
|
|
4
|
+
* Supports two formats:
|
|
5
|
+
* 1. Simple key-value object: {"key": "value"} -> maps to inputVariables (deprecated)
|
|
6
|
+
* 2. InitialInstructions array: [{"id": "x", "instruction": "value"}] -> maps to initialInstructions
|
|
7
|
+
* 3. Complete StartWorkflowConfiguration object with initialInstructions or workspaceMetadata
|
|
8
|
+
*
|
|
9
|
+
* @param inputsJson - JSON string containing workflow inputs
|
|
10
|
+
* @returns StartWorkflowConfiguration object ready to send to API
|
|
11
|
+
* @throws Error if JSON is invalid or format is unrecognized
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseWorkflowInputs(inputsJson: string): StartWorkflowConfiguration;
|
|
14
|
+
//# sourceMappingURL=input-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-parser.d.ts","sourceRoot":"","sources":["../../src/utils/input-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,0BAA0B,CAuBlF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse workflow inputs from JSON string and detect format.
|
|
3
|
+
* Supports two formats:
|
|
4
|
+
* 1. Simple key-value object: {"key": "value"} -> maps to inputVariables (deprecated)
|
|
5
|
+
* 2. InitialInstructions array: [{"id": "x", "instruction": "value"}] -> maps to initialInstructions
|
|
6
|
+
* 3. Complete StartWorkflowConfiguration object with initialInstructions or workspaceMetadata
|
|
7
|
+
*
|
|
8
|
+
* @param inputsJson - JSON string containing workflow inputs
|
|
9
|
+
* @returns StartWorkflowConfiguration object ready to send to API
|
|
10
|
+
* @throws Error if JSON is invalid or format is unrecognized
|
|
11
|
+
*/
|
|
12
|
+
export function parseWorkflowInputs(inputsJson) {
|
|
13
|
+
const parsed = JSON.parse(inputsJson);
|
|
14
|
+
// Detect format by structure
|
|
15
|
+
if (Array.isArray(parsed)) {
|
|
16
|
+
// Array format → InitialInstructions
|
|
17
|
+
return {
|
|
18
|
+
initialInstructions: parsed
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
else if (typeof parsed === 'object' && parsed !== null) {
|
|
22
|
+
// Check if it's already a complete StartWorkflowConfiguration
|
|
23
|
+
if ('initialInstructions' in parsed || 'workspaceMetadata' in parsed || 'inputVariables' in parsed) {
|
|
24
|
+
// Already in correct format
|
|
25
|
+
return parsed;
|
|
26
|
+
}
|
|
27
|
+
// Simple key-value object → Legacy inputVariables
|
|
28
|
+
return {
|
|
29
|
+
inputVariables: parsed
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
throw new Error('Invalid input format. Expected object or array.');
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=input-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-parser.js","sourceRoot":"","sources":["../../src/utils/input-parser.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAEtC,6BAA6B;IAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,qCAAqC;QACrC,OAAO;YACL,mBAAmB,EAAE,MAAM;SAC5B,CAAC;IACJ,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACzD,8DAA8D;QAC9D,IAAI,qBAAqB,IAAI,MAAM,IAAI,mBAAmB,IAAI,MAAM,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAAC;YACnG,4BAA4B;YAC5B,OAAO,MAAoC,CAAC;QAC9C,CAAC;QAED,kDAAkD;QAClD,OAAO;YACL,cAAc,EAAE,MAAM;SACvB,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatting utilities for CLI commands.
|
|
3
|
+
* Supports JSON (compact), PRETTY (pretty-printed JSON), and TEXT (human-readable) formats.
|
|
4
|
+
* Follows AWS CLI patterns for output and error handling.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum OutputFormat {
|
|
7
|
+
JSON = "json",// Default: compact JSON
|
|
8
|
+
PRETTY = "pretty",// Pretty-printed JSON
|
|
9
|
+
TEXT = "text"
|
|
10
|
+
}
|
|
11
|
+
export interface OutputOptions {
|
|
12
|
+
format: OutputFormat;
|
|
13
|
+
command?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Output successful command results.
|
|
17
|
+
* For JSON/PRETTY modes, outputs to stdout and exits with code 0.
|
|
18
|
+
* For TEXT mode, returns control to the command for custom formatting.
|
|
19
|
+
*
|
|
20
|
+
* @param data - Data to output
|
|
21
|
+
* @param options - Output options including format
|
|
22
|
+
*/
|
|
23
|
+
export declare function outputSuccess<T>(data: T, options: OutputOptions): void;
|
|
24
|
+
/**
|
|
25
|
+
* Output error to stderr in JSON format and exit with specified code.
|
|
26
|
+
* Follows AWS CLI error formatting pattern.
|
|
27
|
+
*
|
|
28
|
+
* @param error - Error object or message
|
|
29
|
+
* @param exitCode - Exit code (default: 1)
|
|
30
|
+
*/
|
|
31
|
+
export declare function outputError(error: Error | string, exitCode?: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Command options interface for output format selection
|
|
34
|
+
*/
|
|
35
|
+
export interface CommandOptionsWithOutput {
|
|
36
|
+
output?: string;
|
|
37
|
+
pretty?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Determine output format from command options.
|
|
41
|
+
* Priority: --pretty flag > --output flag > default (json)
|
|
42
|
+
*
|
|
43
|
+
* @param options - Command options
|
|
44
|
+
* @returns Output format
|
|
45
|
+
*/
|
|
46
|
+
export declare function getOutputFormat(options: CommandOptionsWithOutput): OutputFormat;
|
|
47
|
+
/**
|
|
48
|
+
* Check if the command is running in quiet mode (JSON/PRETTY output).
|
|
49
|
+
* In quiet mode, UI elements like banners and spinners should be suppressed.
|
|
50
|
+
*
|
|
51
|
+
* @param format - Output format
|
|
52
|
+
* @returns true if quiet mode (JSON/PRETTY), false if TEXT mode
|
|
53
|
+
*/
|
|
54
|
+
export declare function isQuietMode(format: OutputFormat): boolean;
|
|
55
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oBAAY,YAAY;IACtB,IAAI,SAAS,CAAO,wBAAwB;IAC5C,MAAM,WAAW,CAAG,sBAAsB;IAC1C,IAAI,SAAS;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI,CAYtE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,QAAQ,GAAE,MAAU,GAAG,IAAI,CAY7E;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,YAAY,CAe/E;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAEzD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatting utilities for CLI commands.
|
|
3
|
+
* Supports JSON (compact), PRETTY (pretty-printed JSON), and TEXT (human-readable) formats.
|
|
4
|
+
* Follows AWS CLI patterns for output and error handling.
|
|
5
|
+
*/
|
|
6
|
+
export var OutputFormat;
|
|
7
|
+
(function (OutputFormat) {
|
|
8
|
+
OutputFormat["JSON"] = "json";
|
|
9
|
+
OutputFormat["PRETTY"] = "pretty";
|
|
10
|
+
OutputFormat["TEXT"] = "text"; // Human-readable (legacy mode)
|
|
11
|
+
})(OutputFormat || (OutputFormat = {}));
|
|
12
|
+
/**
|
|
13
|
+
* Output successful command results.
|
|
14
|
+
* For JSON/PRETTY modes, outputs to stdout and exits with code 0.
|
|
15
|
+
* For TEXT mode, returns control to the command for custom formatting.
|
|
16
|
+
*
|
|
17
|
+
* @param data - Data to output
|
|
18
|
+
* @param options - Output options including format
|
|
19
|
+
*/
|
|
20
|
+
export function outputSuccess(data, options) {
|
|
21
|
+
if (options.format === OutputFormat.TEXT) {
|
|
22
|
+
// Return control to command for human-readable output
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const output = options.format === OutputFormat.PRETTY
|
|
26
|
+
? JSON.stringify(data, null, 2)
|
|
27
|
+
: JSON.stringify(data);
|
|
28
|
+
console.log(output);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Output error to stderr in JSON format and exit with specified code.
|
|
33
|
+
* Follows AWS CLI error formatting pattern.
|
|
34
|
+
*
|
|
35
|
+
* @param error - Error object or message
|
|
36
|
+
* @param exitCode - Exit code (default: 1)
|
|
37
|
+
*/
|
|
38
|
+
export function outputError(error, exitCode = 1) {
|
|
39
|
+
const errorObj = typeof error === 'string' ? new Error(error) : error;
|
|
40
|
+
const errorData = {
|
|
41
|
+
error: {
|
|
42
|
+
message: errorObj.message,
|
|
43
|
+
code: 'code' in errorObj && typeof errorObj.code === 'string' ? errorObj.code : 'CLI_ERROR',
|
|
44
|
+
type: errorObj.name || 'Error'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
console.error(JSON.stringify(errorData));
|
|
48
|
+
process.exit(exitCode);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Determine output format from command options.
|
|
52
|
+
* Priority: --pretty flag > --output flag > default (json)
|
|
53
|
+
*
|
|
54
|
+
* @param options - Command options
|
|
55
|
+
* @returns Output format
|
|
56
|
+
*/
|
|
57
|
+
export function getOutputFormat(options) {
|
|
58
|
+
if (options.pretty) {
|
|
59
|
+
return OutputFormat.PRETTY;
|
|
60
|
+
}
|
|
61
|
+
if (options.output === 'text') {
|
|
62
|
+
return OutputFormat.TEXT;
|
|
63
|
+
}
|
|
64
|
+
if (options.output === 'pretty') {
|
|
65
|
+
return OutputFormat.PRETTY;
|
|
66
|
+
}
|
|
67
|
+
// Default to JSON
|
|
68
|
+
return OutputFormat.JSON;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Check if the command is running in quiet mode (JSON/PRETTY output).
|
|
72
|
+
* In quiet mode, UI elements like banners and spinners should be suppressed.
|
|
73
|
+
*
|
|
74
|
+
* @param format - Output format
|
|
75
|
+
* @returns true if quiet mode (JSON/PRETTY), false if TEXT mode
|
|
76
|
+
*/
|
|
77
|
+
export function isQuietMode(format) {
|
|
78
|
+
return format !== OutputFormat.TEXT;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/utils/output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,6BAAa,CAAA,CAAO,+BAA+B;AACrD,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;AAOD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAI,IAAO,EAAE,OAAsB;IAC9D,IAAI,OAAO,CAAC,MAAM,KAAK,YAAY,CAAC,IAAI,EAAE,CAAC;QACzC,sDAAsD;QACtD,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,YAAY,CAAC,MAAM;QACnD,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/B,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CA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KAAK,YAAY,CAAC,IAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface RecentWorkflowEntry {
|
|
2
|
+
profileName: string;
|
|
3
|
+
projectId: string;
|
|
4
|
+
projectName: string;
|
|
5
|
+
workflowId: string;
|
|
6
|
+
workflowName: string;
|
|
7
|
+
lastUsed: string;
|
|
8
|
+
useCount: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Adds or updates a recent workflow entry
|
|
12
|
+
* Increments use count if entry already exists
|
|
13
|
+
*/
|
|
14
|
+
export declare function addRecentWorkflow(profileName: string, projectId: string, projectName: string, workflowId: string, workflowName: string): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Gets recent workflows for a profile, optionally filtered by project
|
|
17
|
+
* Sorted by use count (desc) then last used (desc)
|
|
18
|
+
*/
|
|
19
|
+
export declare function getRecentWorkflows(profileName: string, projectId?: string, limit?: number): Promise<RecentWorkflowEntry[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Gets recent projects for a profile
|
|
22
|
+
* Returns unique projects sorted by most recently used workflow
|
|
23
|
+
*/
|
|
24
|
+
export declare function getRecentProjects(profileName: string, limit?: number): Promise<Array<{
|
|
25
|
+
projectId: string;
|
|
26
|
+
projectName: string;
|
|
27
|
+
lastUsed: string;
|
|
28
|
+
}>>;
|
|
29
|
+
/**
|
|
30
|
+
* Clears all cached workflows for a specific profile
|
|
31
|
+
*/
|
|
32
|
+
export declare function clearCacheForProfile(profileName: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Clears the entire cache
|
|
35
|
+
*/
|
|
36
|
+
export declare function clearCache(): Promise<void>;
|
|
37
|
+
//# sourceMappingURL=recent-workflows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recent-workflows.d.ts","sourceRoot":"","sources":["../../src/utils/recent-workflows.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAOD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,EAClB,KAAK,GAAE,MAAW,GACjB,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAkBhC;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,KAAK,GAAE,MAAU,GAChB,OAAO,CAAC,KAAK,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAwB9E;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E;AAED;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAIhD"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { homedir } from 'os';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { promises as fs } from 'fs';
|
|
4
|
+
import { existsSync } from 'fs';
|
|
5
|
+
const CACHE_DIR = join(homedir(), '.sembix');
|
|
6
|
+
const CACHE_FILE = join(CACHE_DIR, 'recent-workflows.json');
|
|
7
|
+
const MAX_ENTRIES = 50;
|
|
8
|
+
const MAX_ENTRIES_PER_PROFILE = 10;
|
|
9
|
+
const CACHE_VERSION = '1.0';
|
|
10
|
+
/**
|
|
11
|
+
* Adds or updates a recent workflow entry
|
|
12
|
+
* Increments use count if entry already exists
|
|
13
|
+
*/
|
|
14
|
+
export async function addRecentWorkflow(profileName, projectId, projectName, workflowId, workflowName) {
|
|
15
|
+
const cache = await loadCache();
|
|
16
|
+
// Find existing entry
|
|
17
|
+
const existingIndex = cache.entries.findIndex(e => e.profileName === profileName &&
|
|
18
|
+
e.projectId === projectId &&
|
|
19
|
+
e.workflowId === workflowId);
|
|
20
|
+
if (existingIndex >= 0) {
|
|
21
|
+
// Update existing entry
|
|
22
|
+
cache.entries[existingIndex].lastUsed = new Date().toISOString();
|
|
23
|
+
cache.entries[existingIndex].useCount++;
|
|
24
|
+
cache.entries[existingIndex].projectName = projectName; // update in case changed
|
|
25
|
+
cache.entries[existingIndex].workflowName = workflowName; // update in case changed
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
// Add new entry
|
|
29
|
+
cache.entries.push({
|
|
30
|
+
profileName,
|
|
31
|
+
projectId,
|
|
32
|
+
projectName,
|
|
33
|
+
workflowId,
|
|
34
|
+
workflowName,
|
|
35
|
+
lastUsed: new Date().toISOString(),
|
|
36
|
+
useCount: 1
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// Evict old entries if needed
|
|
40
|
+
await evictOldEntries(cache);
|
|
41
|
+
await saveCache(cache);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Gets recent workflows for a profile, optionally filtered by project
|
|
45
|
+
* Sorted by use count (desc) then last used (desc)
|
|
46
|
+
*/
|
|
47
|
+
export async function getRecentWorkflows(profileName, projectId, limit = 10) {
|
|
48
|
+
const cache = await loadCache();
|
|
49
|
+
let filtered = cache.entries.filter(e => e.profileName === profileName);
|
|
50
|
+
if (projectId) {
|
|
51
|
+
filtered = filtered.filter(e => e.projectId === projectId);
|
|
52
|
+
}
|
|
53
|
+
// Sort by useCount (desc), then lastUsed (desc)
|
|
54
|
+
filtered.sort((a, b) => {
|
|
55
|
+
if (b.useCount !== a.useCount) {
|
|
56
|
+
return b.useCount - a.useCount;
|
|
57
|
+
}
|
|
58
|
+
return new Date(b.lastUsed).getTime() - new Date(a.lastUsed).getTime();
|
|
59
|
+
});
|
|
60
|
+
return filtered.slice(0, limit);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Gets recent projects for a profile
|
|
64
|
+
* Returns unique projects sorted by most recently used workflow
|
|
65
|
+
*/
|
|
66
|
+
export async function getRecentProjects(profileName, limit = 5) {
|
|
67
|
+
const cache = await loadCache();
|
|
68
|
+
const filtered = cache.entries.filter(e => e.profileName === profileName);
|
|
69
|
+
// Group by project and get most recent usage
|
|
70
|
+
const projectMap = new Map();
|
|
71
|
+
for (const entry of filtered) {
|
|
72
|
+
const existing = projectMap.get(entry.projectId);
|
|
73
|
+
if (!existing || new Date(entry.lastUsed) > new Date(existing.lastUsed)) {
|
|
74
|
+
projectMap.set(entry.projectId, {
|
|
75
|
+
projectId: entry.projectId,
|
|
76
|
+
projectName: entry.projectName,
|
|
77
|
+
lastUsed: entry.lastUsed
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// Convert to array and sort by most recent
|
|
82
|
+
const projects = Array.from(projectMap.values());
|
|
83
|
+
projects.sort((a, b) => new Date(b.lastUsed).getTime() - new Date(a.lastUsed).getTime());
|
|
84
|
+
return projects.slice(0, limit);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Clears all cached workflows for a specific profile
|
|
88
|
+
*/
|
|
89
|
+
export async function clearCacheForProfile(profileName) {
|
|
90
|
+
const cache = await loadCache();
|
|
91
|
+
cache.entries = cache.entries.filter(e => e.profileName !== profileName);
|
|
92
|
+
await saveCache(cache);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Clears the entire cache
|
|
96
|
+
*/
|
|
97
|
+
export async function clearCache() {
|
|
98
|
+
if (existsSync(CACHE_FILE)) {
|
|
99
|
+
await fs.unlink(CACHE_FILE);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Evicts old entries based on LRU and per-profile limits
|
|
104
|
+
*/
|
|
105
|
+
async function evictOldEntries(cache) {
|
|
106
|
+
// Overall limit - keep most recently used
|
|
107
|
+
if (cache.entries.length > MAX_ENTRIES) {
|
|
108
|
+
cache.entries.sort((a, b) => new Date(b.lastUsed).getTime() - new Date(a.lastUsed).getTime());
|
|
109
|
+
cache.entries = cache.entries.slice(0, MAX_ENTRIES);
|
|
110
|
+
}
|
|
111
|
+
// Per-profile limit - keep most frequently used within each profile
|
|
112
|
+
const profileGroups = new Map();
|
|
113
|
+
for (const entry of cache.entries) {
|
|
114
|
+
if (!profileGroups.has(entry.profileName)) {
|
|
115
|
+
profileGroups.set(entry.profileName, []);
|
|
116
|
+
}
|
|
117
|
+
profileGroups.get(entry.profileName).push(entry);
|
|
118
|
+
}
|
|
119
|
+
const kept = [];
|
|
120
|
+
for (const [, entries] of profileGroups) {
|
|
121
|
+
// Sort by useCount (desc), then lastUsed (desc)
|
|
122
|
+
entries.sort((a, b) => {
|
|
123
|
+
if (b.useCount !== a.useCount)
|
|
124
|
+
return b.useCount - a.useCount;
|
|
125
|
+
return new Date(b.lastUsed).getTime() - new Date(a.lastUsed).getTime();
|
|
126
|
+
});
|
|
127
|
+
kept.push(...entries.slice(0, MAX_ENTRIES_PER_PROFILE));
|
|
128
|
+
}
|
|
129
|
+
cache.entries = kept;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Loads the cache from disk
|
|
133
|
+
* Returns empty cache if file doesn't exist or can't be parsed
|
|
134
|
+
*/
|
|
135
|
+
async function loadCache() {
|
|
136
|
+
try {
|
|
137
|
+
if (!existsSync(CACHE_FILE)) {
|
|
138
|
+
return { version: CACHE_VERSION, entries: [] };
|
|
139
|
+
}
|
|
140
|
+
const content = await fs.readFile(CACHE_FILE, 'utf-8');
|
|
141
|
+
const cache = JSON.parse(content);
|
|
142
|
+
// Validate version and structure
|
|
143
|
+
if (!cache.version || !Array.isArray(cache.entries)) {
|
|
144
|
+
return { version: CACHE_VERSION, entries: [] };
|
|
145
|
+
}
|
|
146
|
+
return cache;
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
// If we can't read or parse the cache, return empty cache
|
|
150
|
+
return { version: CACHE_VERSION, entries: [] };
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Saves the cache to disk with restricted permissions
|
|
155
|
+
*/
|
|
156
|
+
async function saveCache(cache) {
|
|
157
|
+
try {
|
|
158
|
+
// Ensure directory exists
|
|
159
|
+
if (!existsSync(CACHE_DIR)) {
|
|
160
|
+
await fs.mkdir(CACHE_DIR, { recursive: true, mode: 0o700 });
|
|
161
|
+
}
|
|
162
|
+
// Write cache file with restricted permissions (only user can read/write)
|
|
163
|
+
const content = JSON.stringify(cache, null, 2);
|
|
164
|
+
await fs.writeFile(CACHE_FILE, content, { mode: 0o600 });
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
// Silently fail if we can't write the cache
|
|
168
|
+
// This shouldn't break the CLI functionality
|
|
169
|
+
console.error('Warning: Failed to save recent workflows cache:', error instanceof Error ? error.message : 'Unknown error');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=recent-workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recent-workflows.js","sourceRoot":"","sources":["../../src/utils/recent-workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEh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AC;AACH,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,SAAS,CAAC,KAA2B;IAClD,IAAI,CAAC;QACH,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9D,CAAC;QAED,0EAA0E;QAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/C,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,4CAA4C;QAC5C,6CAA6C;QAC7C,OAAO,CAAC,KAAK,CAAC,iDAAiD,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC7H,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { StudioApiClient } from '../services/studio-api-client.js';
|
|
2
|
+
export type { StudioProfile, StudioAuthTokens, StartWorkflowConfiguration, WorkflowStartResponse, FetchWorkflowRunResponse, FetchWorkflowRunListItem, SearchParams } from '../types.js';
|
|
3
|
+
//# sourceMappingURL=studio-api-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"studio-api-client.d.ts","sourceRoot":"","sources":["../../src/utils/studio-api-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB,EACxB,YAAY,EACb,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"studio-api-client.js","sourceRoot":"","sources":["../../src/utils/studio-api-client.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC"}
|