@inworld/cli 0.3.1 → 2.0.0-rc.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/dist/index.js +829 -305
- package/package.json +8 -2
- package/dist/index.js.map +0 -7
- package/dist/package.json +0 -49
- package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts +0 -10
- package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js +0 -16
- package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts +0 -13
- package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.js +0 -2
- package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts +0 -7
- package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js +0 -15
- package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts +0 -14
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js +0 -7
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.d.ts +0 -116
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.js +0 -71
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts +0 -14
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js +0 -7
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts +0 -76
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js +0 -40
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts +0 -10
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js +0 -7
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts +0 -7
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js +0 -13
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts +0 -115
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js +0 -86
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts +0 -255
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js +0 -88
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js.map +0 -1
- package/dist/proto/generated/portal/fetch.pb.d.ts +0 -26
- package/dist/proto/generated/portal/fetch.pb.d.ts.map +0 -1
- package/dist/proto/generated/portal/fetch.pb.js +0 -274
- package/dist/proto/generated/portal/fetch.pb.js.map +0 -1
- package/dist/src/auth/callback_server.d.ts +0 -41
- package/dist/src/auth/callback_server.d.ts.map +0 -1
- package/dist/src/auth/callback_server.js +0 -136
- package/dist/src/auth/callback_server.js.map +0 -1
- package/dist/src/auth/manager.d.ts +0 -97
- package/dist/src/auth/manager.d.ts.map +0 -1
- package/dist/src/auth/manager.js +0 -340
- package/dist/src/auth/manager.js.map +0 -1
- package/dist/src/auth/utils.d.ts +0 -45
- package/dist/src/auth/utils.d.ts.map +0 -1
- package/dist/src/auth/utils.js +0 -183
- package/dist/src/auth/utils.js.map +0 -1
- package/dist/src/commands/auth/disable_telemetry_command.d.ts +0 -3
- package/dist/src/commands/auth/disable_telemetry_command.d.ts.map +0 -1
- package/dist/src/commands/auth/enable_telemetry_command.d.ts +0 -3
- package/dist/src/commands/auth/enable_telemetry_command.d.ts.map +0 -1
- package/dist/src/commands/auth/login_ci_command.d.ts +0 -3
- package/dist/src/commands/auth/login_ci_command.d.ts.map +0 -1
- package/dist/src/commands/auth/login_ci_command.js +0 -41
- package/dist/src/commands/auth/login_ci_command.js.map +0 -1
- package/dist/src/commands/auth/login_command.d.ts +0 -4
- package/dist/src/commands/auth/login_command.d.ts.map +0 -1
- package/dist/src/commands/auth/login_command.js +0 -134
- package/dist/src/commands/auth/login_command.js.map +0 -1
- package/dist/src/commands/auth/logout_command.d.ts +0 -4
- package/dist/src/commands/auth/logout_command.d.ts.map +0 -1
- package/dist/src/commands/auth/logout_command.js +0 -54
- package/dist/src/commands/auth/logout_command.js.map +0 -1
- package/dist/src/commands/auth/print_access_token_command.d.ts +0 -3
- package/dist/src/commands/auth/print_access_token_command.d.ts.map +0 -1
- package/dist/src/commands/auth/print_access_token_command.js +0 -21
- package/dist/src/commands/auth/print_access_token_command.js.map +0 -1
- package/dist/src/commands/auth/print_api_key_command.d.ts +0 -3
- package/dist/src/commands/auth/print_api_key_command.d.ts.map +0 -1
- package/dist/src/commands/auth/print_api_key_command.js +0 -26
- package/dist/src/commands/auth/print_api_key_command.js.map +0 -1
- package/dist/src/commands/auth/status_command.d.ts +0 -4
- package/dist/src/commands/auth/status_command.d.ts.map +0 -1
- package/dist/src/commands/auth/status_command.js +0 -84
- package/dist/src/commands/auth/status_command.js.map +0 -1
- package/dist/src/commands/auth_command.d.ts +0 -3
- package/dist/src/commands/auth_command.d.ts.map +0 -1
- package/dist/src/commands/auth_command.js +0 -20
- package/dist/src/commands/auth_command.js.map +0 -1
- package/dist/src/commands/graph/graph_deploy_command.d.ts +0 -24
- package/dist/src/commands/graph/graph_deploy_command.d.ts.map +0 -1
- package/dist/src/commands/graph/graph_deploy_command.js +0 -191
- package/dist/src/commands/graph/graph_deploy_command.js.map +0 -1
- package/dist/src/commands/graph/graph_init_command.d.ts +0 -4
- package/dist/src/commands/graph/graph_init_command.d.ts.map +0 -1
- package/dist/src/commands/graph/graph_init_command.js +0 -376
- package/dist/src/commands/graph/graph_init_command.js.map +0 -1
- package/dist/src/commands/graph/graph_run_command.d.ts +0 -24
- package/dist/src/commands/graph/graph_run_command.d.ts.map +0 -1
- package/dist/src/commands/graph/graph_run_command.js +0 -50
- package/dist/src/commands/graph/graph_run_command.js.map +0 -1
- package/dist/src/commands/graph/graph_serve_command.d.ts +0 -4
- package/dist/src/commands/graph/graph_serve_command.d.ts.map +0 -1
- package/dist/src/commands/graph/graph_serve_command.js +0 -40
- package/dist/src/commands/graph/graph_serve_command.js.map +0 -1
- package/dist/src/commands/graph/graph_variant_command.d.ts +0 -3
- package/dist/src/commands/graph/graph_variant_command.d.ts.map +0 -1
- package/dist/src/commands/graph/graph_variant_command.js +0 -13
- package/dist/src/commands/graph/graph_variant_command.js.map +0 -1
- package/dist/src/commands/graph/graph_visualize_command.d.ts +0 -7
- package/dist/src/commands/graph/graph_visualize_command.d.ts.map +0 -1
- package/dist/src/commands/graph/graph_visualize_command.js +0 -35
- package/dist/src/commands/graph/graph_visualize_command.js.map +0 -1
- package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts +0 -3
- package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts.map +0 -1
- package/dist/src/commands/graph/variant/graph_variant_list_command.js +0 -25
- package/dist/src/commands/graph/variant/graph_variant_list_command.js.map +0 -1
- package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts +0 -7
- package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts.map +0 -1
- package/dist/src/commands/graph/variant/graph_variant_print_command.js +0 -45
- package/dist/src/commands/graph/variant/graph_variant_print_command.js.map +0 -1
- package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts +0 -3
- package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts.map +0 -1
- package/dist/src/commands/graph/variant/graph_variant_register_command.js +0 -45
- package/dist/src/commands/graph/variant/graph_variant_register_command.js.map +0 -1
- package/dist/src/commands/graph_command.d.ts +0 -3
- package/dist/src/commands/graph_command.d.ts.map +0 -1
- package/dist/src/commands/graph_command.js +0 -20
- package/dist/src/commands/graph_command.js.map +0 -1
- package/dist/src/commands/tts_commands.d.ts +0 -17
- package/dist/src/commands/tts_commands.d.ts.map +0 -1
- package/dist/src/commands/tts_commands.js +0 -568
- package/dist/src/commands/tts_commands.js.map +0 -1
- package/dist/src/commands/workspace_command.d.ts +0 -12
- package/dist/src/commands/workspace_command.d.ts.map +0 -1
- package/dist/src/commands/workspace_command.js +0 -33
- package/dist/src/commands/workspace_command.js.map +0 -1
- package/dist/src/constants.d.ts +0 -10
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js +0 -30
- package/dist/src/constants.js.map +0 -1
- package/dist/src/grpc/core/InworldError.d.ts +0 -30
- package/dist/src/grpc/core/InworldError.d.ts.map +0 -1
- package/dist/src/grpc/core/InworldError.js +0 -46
- package/dist/src/grpc/core/InworldError.js.map +0 -1
- package/dist/src/grpc/core/statusCodes.d.ts +0 -122
- package/dist/src/grpc/core/statusCodes.d.ts.map +0 -1
- package/dist/src/grpc/core/statusCodes.js +0 -133
- package/dist/src/grpc/core/statusCodes.js.map +0 -1
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/services/analytics.d.ts +0 -45
- package/dist/src/services/analytics.d.ts.map +0 -1
- package/dist/src/services/deploy_service.d.ts +0 -4
- package/dist/src/services/deploy_service.d.ts.map +0 -1
- package/dist/src/services/deploy_service.js +0 -128
- package/dist/src/services/deploy_service.js.map +0 -1
- package/dist/src/services/graph_loader.d.ts +0 -7
- package/dist/src/services/graph_loader.d.ts.map +0 -1
- package/dist/src/services/graph_loader.js +0 -103
- package/dist/src/services/graph_loader.js.map +0 -1
- package/dist/src/services/graph_variant_service.d.ts +0 -12
- package/dist/src/services/graph_variant_service.d.ts.map +0 -1
- package/dist/src/services/graph_variant_service.js +0 -66
- package/dist/src/services/graph_variant_service.js.map +0 -1
- package/dist/src/services/tts_service.d.ts +0 -273
- package/dist/src/services/tts_service.d.ts.map +0 -1
- package/dist/src/services/tts_service.js +0 -299
- package/dist/src/services/tts_service.js.map +0 -1
- package/dist/src/services/update_checker.d.ts +0 -37
- package/dist/src/services/update_checker.d.ts.map +0 -1
- package/dist/src/services/workspace_service.d.ts +0 -47
- package/dist/src/services/workspace_service.d.ts.map +0 -1
- package/dist/src/services/workspace_service.js +0 -222
- package/dist/src/services/workspace_service.js.map +0 -1
- package/dist/src/templates/llm_tts/README.md +0 -161
- package/dist/src/templates/llm_tts/graph.d.ts +0 -2
- package/dist/src/templates/llm_tts/graph.d.ts.map +0 -1
- package/dist/src/templates/llm_tts/graph.ts +0 -30
- package/dist/src/templates/llm_tts/metadata.json +0 -41
- package/dist/src/utils/array.d.ts +0 -2
- package/dist/src/utils/array.d.ts.map +0 -1
- package/dist/src/utils/array.js +0 -4
- package/dist/src/utils/array.js.map +0 -1
- package/dist/src/utils/confirm.d.ts +0 -62
- package/dist/src/utils/confirm.d.ts.map +0 -1
- package/dist/src/utils/confirm.js +0 -90
- package/dist/src/utils/confirm.js.map +0 -1
- package/dist/src/utils/long_running_operations.d.ts +0 -38
- package/dist/src/utils/long_running_operations.d.ts.map +0 -1
- package/dist/src/utils/long_running_operations.js +0 -62
- package/dist/src/utils/long_running_operations.js.map +0 -1
- package/dist/src/utils/resource_name_helper.d.ts +0 -12
- package/dist/src/utils/resource_name_helper.d.ts.map +0 -1
- package/dist/src/utils/resource_name_helper.js +0 -29
- package/dist/src/utils/resource_name_helper.js.map +0 -1
- package/dist/src/utils/selector.d.ts +0 -62
- package/dist/src/utils/selector.d.ts.map +0 -1
- package/dist/src/utils/selector.js +0 -77
- package/dist/src/utils/selector.js.map +0 -1
- package/dist/src/utils/spinner.d.ts +0 -75
- package/dist/src/utils/spinner.d.ts.map +0 -1
- package/dist/src/utils/spinner.js +0 -178
- package/dist/src/utils/spinner.js.map +0 -1
- package/dist/src/utils/ui.d.ts +0 -27
- package/dist/src/utils/ui.d.ts.map +0 -1
- package/dist/src/utils/ui.js +0 -83
- package/dist/src/utils/ui.js.map +0 -1
- package/dist/templates/llm_tts/README.md +0 -155
- package/dist/templates/llm_tts/graph.ts +0 -29
- package/dist/templates/llm_tts/metadata.json +0 -41
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import * as readline from 'readline';
|
|
2
|
-
import * as ui from './ui';
|
|
3
|
-
/**
|
|
4
|
-
* Generic selector utility that provides a consistent interface for selecting items
|
|
5
|
-
* from a list. Supports selection by index number or identifier.
|
|
6
|
-
*
|
|
7
|
-
* @param options Configuration options for the selector
|
|
8
|
-
* @returns The selected item or null if no selection was made
|
|
9
|
-
*/
|
|
10
|
-
export async function selectItem(options) {
|
|
11
|
-
const { items, getDisplayName, getIdentifier, prompt, title, forceFirst = false, noItemsMessage = 'No items found.', invalidSelectionMessage = 'Invalid selection. Please enter a valid number or identifier.', } = options;
|
|
12
|
-
if (items.length === 0) {
|
|
13
|
-
ui.printError(noItemsMessage);
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
// If forceFirst is true, return the first item without prompting
|
|
17
|
-
if (forceFirst) {
|
|
18
|
-
return items[0];
|
|
19
|
-
}
|
|
20
|
-
// Display available items
|
|
21
|
-
console.log();
|
|
22
|
-
ui.printHeader(title);
|
|
23
|
-
items.forEach((item, idx) => {
|
|
24
|
-
const displayName = getDisplayName(item);
|
|
25
|
-
const identifier = getIdentifier(item);
|
|
26
|
-
ui.printListItem(`${idx + 1}. ${displayName} (ID: ${identifier})`);
|
|
27
|
-
});
|
|
28
|
-
// Create readline interface for user input
|
|
29
|
-
const rl = readline.createInterface({
|
|
30
|
-
input: process.stdin,
|
|
31
|
-
output: process.stdout,
|
|
32
|
-
});
|
|
33
|
-
const question = (query) => new Promise((resolve) => rl.question(query, resolve));
|
|
34
|
-
let selectedItem = null;
|
|
35
|
-
try {
|
|
36
|
-
while (!selectedItem) {
|
|
37
|
-
const answer = (await question(`\n${prompt} `)).trim();
|
|
38
|
-
// Try to match by number
|
|
39
|
-
const idx = parseInt(answer, 10);
|
|
40
|
-
if (!isNaN(idx) && idx >= 1 && idx <= items.length) {
|
|
41
|
-
selectedItem = items[idx - 1];
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
// Try to match by identifier (full or partial)
|
|
45
|
-
selectedItem =
|
|
46
|
-
items.find((item) => {
|
|
47
|
-
const identifier = getIdentifier(item);
|
|
48
|
-
return (identifier === answer || identifier.split('/').pop() === answer);
|
|
49
|
-
}) || null;
|
|
50
|
-
}
|
|
51
|
-
if (!selectedItem) {
|
|
52
|
-
ui.printError(invalidSelectionMessage);
|
|
53
|
-
// Exit the loop and return null for invalid selection
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
finally {
|
|
59
|
-
rl.close();
|
|
60
|
-
}
|
|
61
|
-
return selectedItem;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Wrapper around selectItem that exits the process on failure
|
|
65
|
-
*
|
|
66
|
-
* @param options Configuration options for the selector
|
|
67
|
-
* @returns The selected item (never null due to process exit on failure)
|
|
68
|
-
*/
|
|
69
|
-
export async function selectItemOrExit(options) {
|
|
70
|
-
const { exitOnFailure = true, ...selectorOptions } = options;
|
|
71
|
-
const selected = await selectItem(selectorOptions);
|
|
72
|
-
if (!selected && exitOnFailure) {
|
|
73
|
-
process.exit(1);
|
|
74
|
-
}
|
|
75
|
-
return selected;
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=selector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../src/utils/selector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AA+C3B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAA2B;IAE3B,MAAM,EACJ,KAAK,EACL,cAAc,EACd,aAAa,EACb,MAAM,EACN,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,cAAc,GAAG,iBAAiB,EAClC,uBAAuB,GAAG,+DAA+D,GAC1F,GAAG,OAAO,CAAC;IAEZ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iEAAiE;IACjE,IA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C,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,+CAA+C;gBAC/C,YAAY;oBACV,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;wBAClB,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;wBACvC,OAAO,CACL,UAAU,KAAK,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,MAAM,CAChE,CAAC;oBACJ,CAAC,CAAC,IAAI,IAAI,CAAC;YACf,CAAC;YAED,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;gBACvC,sDAAsD;gBACtD,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAYD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAmC;IAEnC,MAAM,EAAE,aAAa,GAAG,IAAI,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,eAAe,CAAC,CAAC;IAEnD,IAAI,CAAC,QAAQ,IAAI,aAAa,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,QAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration for the LRO spinner
|
|
3
|
-
*/
|
|
4
|
-
export interface LROSpinnerConfig {
|
|
5
|
-
initialText?: string;
|
|
6
|
-
phraseInterval?: number;
|
|
7
|
-
showIterations?: boolean;
|
|
8
|
-
spinnerStyle?: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Creates and manages a spinner for long-running operations
|
|
12
|
-
*/
|
|
13
|
-
export declare class LROSpinner {
|
|
14
|
-
private spinner;
|
|
15
|
-
private phraseInterval?;
|
|
16
|
-
private currentPhraseIndex;
|
|
17
|
-
private config;
|
|
18
|
-
private iterationCount;
|
|
19
|
-
private startTime;
|
|
20
|
-
constructor(config?: LROSpinnerConfig);
|
|
21
|
-
/**
|
|
22
|
-
* Starts the spinner with rotating phrases
|
|
23
|
-
*/
|
|
24
|
-
start(): void;
|
|
25
|
-
/**
|
|
26
|
-
* Updates the spinner text with current phrase and optional iteration count
|
|
27
|
-
*/
|
|
28
|
-
private updateText;
|
|
29
|
-
/**
|
|
30
|
-
* Updates the iteration count
|
|
31
|
-
*/
|
|
32
|
-
updateIteration(iteration: number): void;
|
|
33
|
-
/**
|
|
34
|
-
* Updates spinner with custom text temporarily
|
|
35
|
-
*/
|
|
36
|
-
updateCustomText(text: string): void;
|
|
37
|
-
/**
|
|
38
|
-
* Succeeds the spinner with a success message
|
|
39
|
-
*/
|
|
40
|
-
succeed(text?: string): void;
|
|
41
|
-
/**
|
|
42
|
-
* Fails the spinner with an error message
|
|
43
|
-
*/
|
|
44
|
-
fail(text?: string): void;
|
|
45
|
-
/**
|
|
46
|
-
* Warns the spinner with a warning message
|
|
47
|
-
*/
|
|
48
|
-
warn(text?: string): void;
|
|
49
|
-
/**
|
|
50
|
-
* Stops the spinner without any status
|
|
51
|
-
*/
|
|
52
|
-
stop(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Cleans up intervals
|
|
55
|
-
*/
|
|
56
|
-
private cleanup;
|
|
57
|
-
/**
|
|
58
|
-
* Gets a random phrase for one-off usage
|
|
59
|
-
*/
|
|
60
|
-
static getRandomPhrase(): string;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Helper function to create spinner callbacks for LRO operations
|
|
64
|
-
*/
|
|
65
|
-
export declare function createLROSpinnerCallbacks(config?: LROSpinnerConfig): {
|
|
66
|
-
startCallback: (operationName: string) => void;
|
|
67
|
-
iterationCallback: (operationName: string, _checkResponse: any, checkData: {
|
|
68
|
-
checkIteration: number;
|
|
69
|
-
checkLimit: number;
|
|
70
|
-
checkTimeout: number;
|
|
71
|
-
}) => void;
|
|
72
|
-
doneCallback: (_operationName: string, _response: any) => void;
|
|
73
|
-
errorCallback: (operationName: string, error: string) => void;
|
|
74
|
-
};
|
|
75
|
-
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/utils/spinner.ts"],"names":[],"mappings":"AA8BA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAM;IACrB,OAAO,CAAC,cAAc,CAAC,CAAiB;IACxC,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,GAAE,gBAAqB;IAkBzC;;OAEG;IACH,KAAK,IAAI,IAAI;IAWb;;OAEG;IACH,OAAO,CAAC,UAAU;IAiBlB;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAKxC;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAQ5B;;OAEG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAMzB;;OAEG;IACH,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI;IAMzB;;OAEG;IACH,IAAI,IAAI,IAAI;IAKZ;;OAEG;IACH,OAAO,CAAC,OAAO;IAOf;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM;CAGjC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,CAAC,EAAE,gBAAgB;mCAIhC,MAAM;uCASpB,MAAM,kBACL,GAAG,aACR;QACT,cAAc,EAAE,MAAM,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,MAAM,CAAC;KACtB;mCAgB4B,MAAM,aAAa,GAAG;mCAOtB,MAAM,SAAS,MAAM;EAOvD"}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import ora from 'ora';
|
|
3
|
-
const PHRASES = [
|
|
4
|
-
'Condensing time-space matter',
|
|
5
|
-
'Starting particle collider',
|
|
6
|
-
'Calibrating quantum flux capacitor',
|
|
7
|
-
'Reversing polarity of neutron flow',
|
|
8
|
-
'Aligning cosmic frequencies',
|
|
9
|
-
'Compiling infinite loops',
|
|
10
|
-
'Downloading more RAM',
|
|
11
|
-
'Reticulating splines',
|
|
12
|
-
'Generating witty loading messages',
|
|
13
|
-
'Convincing electrons to cooperate',
|
|
14
|
-
'Negotiating with the cloud overlords',
|
|
15
|
-
'Bribing the API hamsters',
|
|
16
|
-
'Warming up the server potatoes',
|
|
17
|
-
'Untangling quantum entanglements',
|
|
18
|
-
'Feeding the deployment gremlins',
|
|
19
|
-
'Optimizing coffee-to-code ratio',
|
|
20
|
-
'Summoning the deployment spirits',
|
|
21
|
-
'Consulting the ancient scrolls',
|
|
22
|
-
'Charging the flux compensators',
|
|
23
|
-
'Stabilizing temporal anomalies',
|
|
24
|
-
'Synchronizing parallel universes',
|
|
25
|
-
'Decoding the matrix',
|
|
26
|
-
'Activating turbo encabulator',
|
|
27
|
-
'Adjusting the dilithium crystals',
|
|
28
|
-
];
|
|
29
|
-
/**
|
|
30
|
-
* Creates and manages a spinner for long-running operations
|
|
31
|
-
*/
|
|
32
|
-
export class LROSpinner {
|
|
33
|
-
spinner;
|
|
34
|
-
phraseInterval;
|
|
35
|
-
currentPhraseIndex = 0;
|
|
36
|
-
config;
|
|
37
|
-
iterationCount = 0;
|
|
38
|
-
startTime;
|
|
39
|
-
constructor(config = {}) {
|
|
40
|
-
this.config = {
|
|
41
|
-
initialText: 'Initializing deployment',
|
|
42
|
-
phraseInterval: 10000,
|
|
43
|
-
showIterations: true,
|
|
44
|
-
spinnerStyle: 'dots8Bit',
|
|
45
|
-
...config,
|
|
46
|
-
};
|
|
47
|
-
this.spinner = ora({
|
|
48
|
-
text: this.config.initialText,
|
|
49
|
-
spinner: this.config.spinnerStyle,
|
|
50
|
-
color: 'cyan',
|
|
51
|
-
});
|
|
52
|
-
this.startTime = Date.now();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Starts the spinner with rotating phrases
|
|
56
|
-
*/
|
|
57
|
-
start() {
|
|
58
|
-
this.spinner.start();
|
|
59
|
-
this.updateText();
|
|
60
|
-
// Start rotating phrases
|
|
61
|
-
this.phraseInterval = setInterval(() => {
|
|
62
|
-
// this.currentPhraseIndex = (this.currentPhraseIndex + 1) % PHRASES.length;
|
|
63
|
-
this.updateText();
|
|
64
|
-
}, this.config.phraseInterval);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Updates the spinner text with current phrase and optional iteration count
|
|
68
|
-
*/
|
|
69
|
-
updateText() {
|
|
70
|
-
const phrase = LROSpinner.getRandomPhrase();
|
|
71
|
-
const elapsedSeconds = Math.floor((Date.now() - this.startTime) / 1000);
|
|
72
|
-
let text = chalk.cyan(phrase);
|
|
73
|
-
if (this.config.showIterations && this.iterationCount > 0) {
|
|
74
|
-
text += chalk.gray(` (iteration ${this.iterationCount}, ${elapsedSeconds}s)`);
|
|
75
|
-
}
|
|
76
|
-
else if (elapsedSeconds > 0) {
|
|
77
|
-
text += chalk.gray(` (${elapsedSeconds}s)`);
|
|
78
|
-
}
|
|
79
|
-
this.spinner.text = text;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Updates the iteration count
|
|
83
|
-
*/
|
|
84
|
-
updateIteration(iteration) {
|
|
85
|
-
this.iterationCount = iteration + 1; // Convert 0-based to 1-based for display
|
|
86
|
-
this.updateText();
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Updates spinner with custom text temporarily
|
|
90
|
-
*/
|
|
91
|
-
updateCustomText(text) {
|
|
92
|
-
this.spinner.text = chalk.yellow(text);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Succeeds the spinner with a success message
|
|
96
|
-
*/
|
|
97
|
-
succeed(text) {
|
|
98
|
-
this.cleanup();
|
|
99
|
-
const elapsedSeconds = Math.floor((Date.now() - this.startTime) / 1000);
|
|
100
|
-
const successText = text || `Deployment completed successfully in ${elapsedSeconds}s`;
|
|
101
|
-
this.spinner.succeed(chalk.green(successText));
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Fails the spinner with an error message
|
|
105
|
-
*/
|
|
106
|
-
fail(text) {
|
|
107
|
-
this.cleanup();
|
|
108
|
-
const errorText = text || 'Deployment failed';
|
|
109
|
-
this.spinner.fail(chalk.red(errorText));
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Warns the spinner with a warning message
|
|
113
|
-
*/
|
|
114
|
-
warn(text) {
|
|
115
|
-
this.cleanup();
|
|
116
|
-
const warnText = text || 'Deployment completed with warnings';
|
|
117
|
-
this.spinner.warn(chalk.yellow(warnText));
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Stops the spinner without any status
|
|
121
|
-
*/
|
|
122
|
-
stop() {
|
|
123
|
-
this.cleanup();
|
|
124
|
-
this.spinner.stop();
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Cleans up intervals
|
|
128
|
-
*/
|
|
129
|
-
cleanup() {
|
|
130
|
-
if (this.phraseInterval) {
|
|
131
|
-
clearInterval(this.phraseInterval);
|
|
132
|
-
this.phraseInterval = undefined;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Gets a random phrase for one-off usage
|
|
137
|
-
*/
|
|
138
|
-
static getRandomPhrase() {
|
|
139
|
-
return PHRASES[Math.floor(Math.random() * PHRASES.length)];
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Helper function to create spinner callbacks for LRO operations
|
|
144
|
-
*/
|
|
145
|
-
export function createLROSpinnerCallbacks(config) {
|
|
146
|
-
let spinner = null;
|
|
147
|
-
return {
|
|
148
|
-
startCallback: (operationName) => {
|
|
149
|
-
spinner = new LROSpinner({
|
|
150
|
-
...config,
|
|
151
|
-
initialText: `Starting operation: ${operationName}`,
|
|
152
|
-
});
|
|
153
|
-
spinner.start();
|
|
154
|
-
},
|
|
155
|
-
iterationCallback: (operationName, _checkResponse, checkData) => {
|
|
156
|
-
if (spinner) {
|
|
157
|
-
spinner.updateIteration(checkData.checkIteration);
|
|
158
|
-
// Add progress warning if getting close to limit
|
|
159
|
-
if (checkData.checkIteration > checkData.checkLimit * 0.8) {
|
|
160
|
-
spinner.updateCustomText(chalk.yellow(`⚠️ Taking longer than expected... (${checkData.checkIteration}/${checkData.checkLimit})`));
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
doneCallback: (_operationName, _response) => {
|
|
165
|
-
if (spinner) {
|
|
166
|
-
spinner.succeed(`Operation completed.`);
|
|
167
|
-
spinner = null;
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
errorCallback: (operationName, error) => {
|
|
171
|
-
if (spinner) {
|
|
172
|
-
spinner.fail(`Operation ${operationName} failed: ${error}`);
|
|
173
|
-
spinner = null;
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=spinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spinner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,yBAAyB,CAAC,MAAyB;IACjE,IAAI,OAAO,GAAsB,IAAI,CAAC;IAEtC,OAAO;QACL,aAAa,EAAE,CAAC,aAAqB,EAAE,EAAE;YACvC,OAAO,GAAG,IAAI,UAAU,CAAC;gBACvB,GAAG,MAAM;gBACT,WAAW,EAAE,uBAAuB,aAAa,EAAE;aACpD,CAAC,CAAC;YACH,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;QAED,iBAAiB,EAAE,CACjB,aAAqB,EACrB,cAAmB,EACnB,SAIC,EACD,EAAE;YACF,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,eAAe,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;gBAElD,iDAAiD;gBACjD,IAAI,SAAS,CAAC,cAAc,GAAG,SAAS,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC;oBAC1D,OAAO,CAAC,gBAAgB,CACtB,KAAK,CAAC,MAAM,CACV,uCAAuC,SAAS,CAAC,cAAc,IAAI,SAAS,CAAC,UAAU,GAAG,CAC3F,CACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAED,YAAY,EAAE,CAAC,cAAsB,EAAE,SAAc,EAAE,EAAE;YACvD,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBACxC,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;QAED,aAAa,EAAE,CAAC,aAAqB,EAAE,KAAa,EAAE,EAAE;YACtD,IAAI,OAAO,EAAE,CAAC;gBACZ,OAAO,CAAC,IAAI,CAAC,aAAa,aAAa,YAAY,KAAK,EAAE,CAAC,CAAC;gBAC5D,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/src/utils/ui.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export declare function printHeader(message: string): void;
|
|
2
|
-
export declare function p(message: string): void;
|
|
3
|
-
export declare function print(message: string): void;
|
|
4
|
-
export declare function printBright(message: string): void;
|
|
5
|
-
export declare function printLink(message: string): void;
|
|
6
|
-
export declare function printError(message: string): void;
|
|
7
|
-
export declare function success(message: string): void;
|
|
8
|
-
export declare function printListHeader(message: string): void;
|
|
9
|
-
export declare function printListItem(message: string): void;
|
|
10
|
-
export declare function cyan(message: string): string;
|
|
11
|
-
export declare function yellow(message: string): string;
|
|
12
|
-
export declare function green(message: string): string;
|
|
13
|
-
export declare function bold(message: string): string;
|
|
14
|
-
export declare function bright(message: string): string;
|
|
15
|
-
export declare function dim(message: string): string;
|
|
16
|
-
export declare function link(message: string): string;
|
|
17
|
-
/**
|
|
18
|
-
* Prints content in a styled box
|
|
19
|
-
*/
|
|
20
|
-
export declare function printBox(lines: string[], options?: {
|
|
21
|
-
color?: string;
|
|
22
|
-
padding?: number;
|
|
23
|
-
}): void;
|
|
24
|
-
export declare function trimBase64Key(key: string): string;
|
|
25
|
-
export declare function trimToken(token: string): string;
|
|
26
|
-
export declare function workspaceLink(workspaceId: string): string;
|
|
27
|
-
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/utils/ui.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,QAE1C;AAED,wBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,QAEhC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,QAEpC;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,QAE1C;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,QAExC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,QAEzC;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,QAEtC;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,QAE9C;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,QAE5C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,UAEnC;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,UAErC;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,UAEpC;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,UAEnC;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,UAErC;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,UAElC;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,UAEnC;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,QAgCvF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,UAEhD"}
|
package/dist/src/utils/ui.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import { PLATFORM_URL } from '@/constants';
|
|
3
|
-
export function printHeader(message) {
|
|
4
|
-
console.log(chalk.bold(message));
|
|
5
|
-
}
|
|
6
|
-
export function p(message) {
|
|
7
|
-
console.log(message);
|
|
8
|
-
}
|
|
9
|
-
export function print(message) {
|
|
10
|
-
console.log(chalk.dim.white(message));
|
|
11
|
-
}
|
|
12
|
-
export function printBright(message) {
|
|
13
|
-
console.log(chalk.white(message));
|
|
14
|
-
}
|
|
15
|
-
export function printLink(message) {
|
|
16
|
-
console.log(chalk.dim.underline.cyan(message));
|
|
17
|
-
}
|
|
18
|
-
export function printError(message) {
|
|
19
|
-
console.error(chalk.dim.red(message));
|
|
20
|
-
}
|
|
21
|
-
export function success(message) {
|
|
22
|
-
console.log(chalk.dim.green(message));
|
|
23
|
-
}
|
|
24
|
-
export function printListHeader(message) {
|
|
25
|
-
console.log(chalk.gray(message));
|
|
26
|
-
}
|
|
27
|
-
export function printListItem(message) {
|
|
28
|
-
console.log('└ ' + chalk.gray(message));
|
|
29
|
-
}
|
|
30
|
-
export function cyan(message) {
|
|
31
|
-
return chalk.cyan(message);
|
|
32
|
-
}
|
|
33
|
-
export function yellow(message) {
|
|
34
|
-
return chalk.yellow(message);
|
|
35
|
-
}
|
|
36
|
-
export function green(message) {
|
|
37
|
-
return chalk.green(message);
|
|
38
|
-
}
|
|
39
|
-
export function bold(message) {
|
|
40
|
-
return chalk.bold(message);
|
|
41
|
-
}
|
|
42
|
-
export function link(message) {
|
|
43
|
-
return chalk.dim.underline.cyan(message);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Prints content in a styled box
|
|
47
|
-
*/
|
|
48
|
-
export function printBox(lines, options) {
|
|
49
|
-
const color = options?.color || 'yellow';
|
|
50
|
-
const padding = options?.padding ?? 2;
|
|
51
|
-
// Strip ANSI codes to calculate actual text width
|
|
52
|
-
const stripAnsi = (str) => str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
53
|
-
// Calculate box width based on longest line
|
|
54
|
-
const maxContentWidth = Math.max(...lines.map(line => stripAnsi(line).length));
|
|
55
|
-
const boxWidth = maxContentWidth + padding * 2;
|
|
56
|
-
const horizontalLine = '─'.repeat(boxWidth);
|
|
57
|
-
const emptyLine = ' '.repeat(boxWidth);
|
|
58
|
-
// Get chalk color function
|
|
59
|
-
const colorFn = chalk[color] || chalk.yellow;
|
|
60
|
-
// Print box
|
|
61
|
-
p('');
|
|
62
|
-
p(colorFn('┌' + horizontalLine + '┐'));
|
|
63
|
-
p(colorFn('│' + emptyLine + '│'));
|
|
64
|
-
lines.forEach(line => {
|
|
65
|
-
const actualLength = stripAnsi(line).length;
|
|
66
|
-
const leftPad = ' '.repeat(padding);
|
|
67
|
-
const rightPad = ' '.repeat(boxWidth - actualLength - padding);
|
|
68
|
-
p(colorFn('│') + leftPad + line + rightPad + colorFn('│'));
|
|
69
|
-
});
|
|
70
|
-
p(colorFn('│' + emptyLine + '│'));
|
|
71
|
-
p(colorFn('└' + horizontalLine + '┘'));
|
|
72
|
-
p('');
|
|
73
|
-
}
|
|
74
|
-
export function trimBase64Key(key) {
|
|
75
|
-
return key.substring(0, 3) + '...' + key.substring(key.length - 5);
|
|
76
|
-
}
|
|
77
|
-
export function trimToken(token) {
|
|
78
|
-
return token.substring(0, 5) + '...';
|
|
79
|
-
}
|
|
80
|
-
export function workspaceLink(workspaceId) {
|
|
81
|
-
return link(`${PLATFORM_URL}/v2/workspaces/${workspaceId}`);
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=ui.js.map
|
package/dist/src/utils/ui.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../src/utils/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,CAAC,CAAC,OAAe;IAC/B,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,OAAe;IACnC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACpC,C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AG,OAAO,CAAC,CAAC;QAC/D,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,cAAc,GAAG,GAAG,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,EAAE,CAAC,CAAC;AACR,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,WAAmB;IAC/C,OAAO,IAAI,CAAC,GAAG,YAAY,kBAAkB,WAAW,EAAE,CAAC,CAAA;AAC7D,CAAC"}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# LLM + TTS Pipeline Graph
|
|
2
|
-
|
|
3
|
-
This is an Inworld Runtime graph that creates a complete conversational AI pipeline with LLM chat and text-to-speech capabilities.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
This template provides a production-ready pipeline that:
|
|
8
|
-
|
|
9
|
-
- Accepts user input and formats it for LLM processing
|
|
10
|
-
- Sends requests to an LLM provider (OpenAI GPT-4o-mini by default)
|
|
11
|
-
- Streams responses for better user experience
|
|
12
|
-
- Chunks text for optimal TTS processing
|
|
13
|
-
- Converts text responses to speech using TTS
|
|
14
|
-
|
|
15
|
-
## Getting Started
|
|
16
|
-
|
|
17
|
-
### Installation
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm install
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Configuration
|
|
24
|
-
|
|
25
|
-
Before running, you'll need to set up your API keys:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# Set your Inworld API key
|
|
29
|
-
export INWORLD_API_KEY="your-inworld-api-key"
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Running the Graph
|
|
33
|
-
|
|
34
|
-
#### As a server (recommended):
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm start
|
|
38
|
-
# or
|
|
39
|
-
npx inworld serve {{graphFileName}}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
#### Direct execution:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
npm run run
|
|
46
|
-
# or
|
|
47
|
-
npx inworld run {{graphFileName}}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## Project Structure
|
|
51
|
-
|
|
52
|
-
- **`{{graphFileName}}`** - Main graph file with the LLM-TTS pipeline
|
|
53
|
-
- **`package.json`** - Project dependencies and scripts
|
|
54
|
-
- **`README.md`** - This file
|
|
55
|
-
|
|
56
|
-
## Pipeline Architecture
|
|
57
|
-
|
|
58
|
-
The graph uses a `SequentialGraphBuilder` with the following nodes in order:
|
|
59
|
-
|
|
60
|
-
1. **LLMChatRequestBuilderNode**: Formats user input into LLM chat messages
|
|
61
|
-
2. **RemoteLLMChatNode**: Sends requests to the LLM provider and receives responses
|
|
62
|
-
3. **TextChunkingNode**: Breaks text into optimal chunks for TTS processing
|
|
63
|
-
4. **RemoteTTSNode**: Converts text chunks to speech
|
|
64
|
-
|
|
65
|
-
## Customization
|
|
66
|
-
|
|
67
|
-
### Changing the LLM Provider
|
|
68
|
-
|
|
69
|
-
Edit the `RemoteLLMChatNode` configuration in `{{graphFileName}}`:
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
new RemoteLLMChatNode({
|
|
73
|
-
provider: 'anthropic', // Change to 'anthropic', 'google', etc.
|
|
74
|
-
modelName: 'claude-3-sonnet', // Change to desired model
|
|
75
|
-
stream: true,
|
|
76
|
-
// Add other provider-specific options
|
|
77
|
-
});
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Modifying the System Prompt
|
|
81
|
-
|
|
82
|
-
Add system messages to the `LLMChatRequestBuilderNode`:
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
new LLMChatRequestBuilderNode({
|
|
86
|
-
messages: [
|
|
87
|
-
{
|
|
88
|
-
role: 'system',
|
|
89
|
-
content: { type: 'text', text: 'You are a helpful assistant...' },
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
role: 'user',
|
|
93
|
-
content: { type: 'template', template: '{{user_input}}' },
|
|
94
|
-
},
|
|
95
|
-
],
|
|
96
|
-
});
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Customizing TTS Settings
|
|
100
|
-
|
|
101
|
-
Configure the TTS node for different voices or providers:
|
|
102
|
-
|
|
103
|
-
```typescript
|
|
104
|
-
new RemoteTTSNode({
|
|
105
|
-
speakerId: 'Dennis',
|
|
106
|
-
modelId: 'inworld-tts-1-max',
|
|
107
|
-
});
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Adding Additional Processing
|
|
111
|
-
|
|
112
|
-
You can insert additional nodes into the pipeline:
|
|
113
|
-
|
|
114
|
-
```typescript
|
|
115
|
-
const graphBuilder = new SequentialGraphBuilder({
|
|
116
|
-
id: 'custom-text-node-llm',
|
|
117
|
-
nodes: [
|
|
118
|
-
new LLMChatRequestBuilderNode({...}),
|
|
119
|
-
new RemoteLLMChatNode({...}),
|
|
120
|
-
new CustomProcessingNode(), // Your custom node
|
|
121
|
-
new TextChunkingNode(),
|
|
122
|
-
new RemoteTTSNode(),
|
|
123
|
-
],
|
|
124
|
-
});
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Environment Variables
|
|
128
|
-
|
|
129
|
-
The following environment variables can be configured:
|
|
130
|
-
|
|
131
|
-
- `INWORLD_API_KEY`: API key for OpenAI (required for GPT models)
|
|
132
|
-
|
|
133
|
-
## Deployment
|
|
134
|
-
|
|
135
|
-
To package your graph for deployment:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
npx inworld deploy {{graphFileName}}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
This will create a deployment package that can be uploaded to Inworld Cloud.
|
|
142
|
-
|
|
143
|
-
## Documentation
|
|
144
|
-
|
|
145
|
-
For more information about:
|
|
146
|
-
|
|
147
|
-
- Inworld Runtime: Visit the [documentation](https://docs.inworld.ai/)
|
|
148
|
-
- LLM providers: Check provider-specific documentation
|
|
149
|
-
- TTS options: See the TTS provider documentation
|
|
150
|
-
|
|
151
|
-
## Requirements
|
|
152
|
-
|
|
153
|
-
- Node.js >= 18.0.0
|
|
154
|
-
- @inworld/cli package
|
|
155
|
-
- Valid Inworld API key
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
RemoteLLMChatNode,
|
|
3
|
-
RemoteTTSNode,
|
|
4
|
-
SequentialGraphBuilder,
|
|
5
|
-
TextChunkingNode,
|
|
6
|
-
} from '@inworld/runtime/graph';
|
|
7
|
-
|
|
8
|
-
const graphBuilder = new SequentialGraphBuilder({
|
|
9
|
-
id: 'llm-tts-graph',
|
|
10
|
-
nodes: [
|
|
11
|
-
new RemoteLLMChatNode({
|
|
12
|
-
provider: 'openai',
|
|
13
|
-
modelName: 'gpt-4o-mini',
|
|
14
|
-
stream: true,
|
|
15
|
-
messageTemplates: [
|
|
16
|
-
{
|
|
17
|
-
role: 'user',
|
|
18
|
-
content: { type: 'template', template: '{{user_input}}' },
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
|
|
22
|
-
}),
|
|
23
|
-
new TextChunkingNode(),
|
|
24
|
-
new RemoteTTSNode(),
|
|
25
|
-
],
|
|
26
|
-
enableRemoteConfig: false
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
export const graph = graphBuilder.build();
|