@inworld/cli 0.3.0 → 1.0.0-rc.1
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 +820 -296
- package/dist/package.json +11 -7
- package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/language_codes/language_codes.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/errors.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/operations.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graph_configuration.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/targeting.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts +2 -0
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/apikeys.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/impression_event_data.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/language_code.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/users.pb.js.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js +0 -1
- package/dist/proto/generated/portal/ai/inworld/studio/v1alpha/workspaces.pb.js.map +1 -1
- package/dist/proto/generated/portal/fetch.pb.d.ts.map +1 -1
- package/dist/proto/generated/portal/fetch.pb.js.map +1 -1
- package/dist/src/auth/manager.d.ts.map +1 -1
- package/dist/src/auth/manager.js +1 -3
- package/dist/src/auth/manager.js.map +1 -1
- package/dist/src/auth/utils.d.ts +1 -1
- package/dist/src/auth/utils.d.ts.map +1 -1
- package/dist/src/auth/utils.js +1 -1
- package/dist/src/auth/utils.js.map +1 -1
- package/dist/src/commands/auth/disable_telemetry_command.js +21 -0
- package/dist/src/commands/auth/disable_telemetry_command.js.map +1 -0
- package/dist/src/commands/auth/enable_telemetry_command.js +22 -0
- package/dist/src/commands/auth/enable_telemetry_command.js.map +1 -0
- package/dist/src/commands/auth/login_command.d.ts.map +1 -1
- package/dist/src/commands/auth/login_command.js +2 -2
- package/dist/src/commands/auth/login_command.js.map +1 -1
- package/dist/src/commands/auth/status_command.d.ts.map +1 -1
- package/dist/src/commands/auth/status_command.js.map +1 -1
- package/dist/src/commands/auth_command.js +4 -0
- package/dist/src/commands/auth_command.js.map +1 -1
- package/dist/src/commands/graph/graph_deploy_command.d.ts.map +1 -1
- package/dist/src/commands/graph/graph_deploy_command.js +14 -1
- package/dist/src/commands/graph/graph_deploy_command.js.map +1 -1
- package/dist/src/commands/graph/graph_init_command.d.ts.map +1 -1
- package/dist/src/commands/graph/graph_init_command.js +231 -272
- package/dist/src/commands/graph/graph_init_command.js.map +1 -1
- package/dist/src/commands/graph/graph_run_command.d.ts.map +1 -1
- package/dist/src/commands/graph/graph_run_command.js +1 -1
- package/dist/src/commands/graph/graph_run_command.js.map +1 -1
- package/dist/src/commands/graph/graph_visualize_command.d.ts.map +1 -1
- package/dist/src/commands/graph/graph_visualize_command.js +3 -3
- package/dist/src/commands/graph/graph_visualize_command.js.map +1 -1
- package/dist/src/commands/graph/variant/graph_variant_list_command.d.ts.map +1 -1
- package/dist/src/commands/graph/variant/graph_variant_list_command.js +1 -0
- package/dist/src/commands/graph/variant/graph_variant_list_command.js.map +1 -1
- package/dist/src/commands/graph/variant/graph_variant_print_command.d.ts.map +1 -1
- package/dist/src/commands/graph/variant/graph_variant_print_command.js +2 -1
- package/dist/src/commands/graph/variant/graph_variant_print_command.js.map +1 -1
- package/dist/src/commands/graph/variant/graph_variant_register_command.d.ts.map +1 -1
- package/dist/src/commands/graph/variant/graph_variant_register_command.js +1 -0
- package/dist/src/commands/graph/variant/graph_variant_register_command.js.map +1 -1
- package/dist/src/commands/tts/tts_clone_command.d.ts +6 -0
- package/dist/src/commands/tts/tts_clone_command.d.ts.map +1 -0
- package/dist/src/commands/tts/tts_clone_command.js +80 -0
- package/dist/src/commands/tts/tts_clone_command.js.map +1 -0
- package/dist/src/commands/tts/tts_design_command.d.ts +6 -0
- package/dist/src/commands/tts/tts_design_command.d.ts.map +1 -0
- package/dist/src/commands/tts/tts_design_command.js +216 -0
- package/dist/src/commands/tts/tts_design_command.js.map +1 -0
- package/dist/src/commands/tts/tts_list_voices_command.d.ts +6 -0
- package/dist/src/commands/tts/tts_list_voices_command.d.ts.map +1 -0
- package/dist/src/commands/tts/tts_list_voices_command.js +108 -0
- package/dist/src/commands/tts/tts_list_voices_command.js.map +1 -0
- package/dist/src/commands/tts/tts_synthesize_command.d.ts +6 -0
- package/dist/src/commands/tts/tts_synthesize_command.d.ts.map +1 -0
- package/dist/src/commands/tts/tts_synthesize_command.js +351 -0
- package/dist/src/commands/tts/tts_synthesize_command.js.map +1 -0
- package/dist/src/commands/tts/tts_utils.d.ts +14 -0
- package/dist/src/commands/tts/tts_utils.d.ts.map +1 -0
- package/dist/src/commands/tts/tts_utils.js +84 -0
- package/dist/src/commands/tts/tts_utils.js.map +1 -0
- package/dist/src/commands/tts_commands.d.ts +0 -11
- package/dist/src/commands/tts_commands.d.ts.map +1 -1
- package/dist/src/commands/tts_commands.js +6 -556
- package/dist/src/commands/tts_commands.js.map +1 -1
- package/dist/src/commands/workspace_command.d.ts +10 -0
- package/dist/src/commands/workspace_command.d.ts.map +1 -1
- package/dist/src/commands/workspace_command.js +39 -0
- package/dist/src/commands/workspace_command.js.map +1 -1
- package/dist/src/constants.d.ts +2 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +19 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/grpc/core/InworldError.d.ts.map +1 -1
- package/dist/src/grpc/core/InworldError.js.map +1 -1
- package/dist/src/index.js +139 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/services/analytics.d.ts +2 -2
- package/dist/src/services/analytics.d.ts.map +1 -1
- package/dist/src/services/analytics.js +139 -0
- package/dist/src/services/analytics.js.map +1 -0
- package/dist/src/services/deploy_service.js +1 -1
- package/dist/src/services/deploy_service.js.map +1 -1
- package/dist/src/services/graph_loader.d.ts.map +1 -1
- package/dist/src/services/graph_loader.js +1 -1
- package/dist/src/services/graph_loader.js.map +1 -1
- package/dist/src/services/graph_variant_service.d.ts.map +1 -1
- package/dist/src/services/graph_variant_service.js +1 -1
- package/dist/src/services/graph_variant_service.js.map +1 -1
- package/dist/src/services/template_service.d.ts +79 -0
- package/dist/src/services/template_service.d.ts.map +1 -0
- package/dist/src/services/template_service.js +299 -0
- package/dist/src/services/template_service.js.map +1 -0
- package/dist/src/services/tts_service.d.ts +138 -71
- package/dist/src/services/tts_service.d.ts.map +1 -1
- package/dist/src/services/tts_service.js +87 -66
- package/dist/src/services/tts_service.js.map +1 -1
- package/dist/src/services/update_checker.js +134 -0
- package/dist/src/services/update_checker.js.map +1 -0
- package/dist/src/services/workspace_service.d.ts +6 -0
- package/dist/src/services/workspace_service.d.ts.map +1 -1
- package/dist/src/services/workspace_service.js +115 -13
- package/dist/src/services/workspace_service.js.map +1 -1
- package/dist/src/utils/audio_player.d.ts +10 -0
- package/dist/src/utils/audio_player.d.ts.map +1 -0
- package/dist/src/utils/audio_player.js +34 -0
- package/dist/src/utils/audio_player.js.map +1 -0
- package/dist/src/utils/long_running_operations.d.ts.map +1 -1
- package/dist/src/utils/long_running_operations.js +1 -1
- package/dist/src/utils/long_running_operations.js.map +1 -1
- package/dist/src/utils/resource_name_helper.d.ts +5 -0
- package/dist/src/utils/resource_name_helper.d.ts.map +1 -1
- package/dist/src/utils/resource_name_helper.js +9 -0
- package/dist/src/utils/resource_name_helper.js.map +1 -1
- package/dist/src/utils/selector.d.ts.map +1 -1
- package/dist/src/utils/selector.js +1 -2
- package/dist/src/utils/selector.js.map +1 -1
- package/dist/src/utils/ui.d.ts.map +1 -1
- package/dist/src/utils/ui.js +8 -2
- package/dist/src/utils/ui.js.map +1 -1
- package/package.json +8 -2
- package/dist/index.js.map +0 -7
- 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/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
|
@@ -19,6 +19,43 @@ export const selectWorkspaceCommand = new Command('select')
|
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
+
/**
|
|
23
|
+
* Select API key command
|
|
24
|
+
* Allows switching to a different API key within the current workspace
|
|
25
|
+
*/
|
|
26
|
+
export const selectKeyCommand = new Command('select-key')
|
|
27
|
+
.description('Select an API key for the current workspace')
|
|
28
|
+
.action(async () => {
|
|
29
|
+
await requireAuth();
|
|
30
|
+
try {
|
|
31
|
+
await WorkspaceService.selectApiKey();
|
|
32
|
+
process.exit(0);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
printError(`\nFailed to select API key: ${error.message || error}`);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Create API key command
|
|
41
|
+
* Creates a new scoped API key for the current workspace
|
|
42
|
+
*/
|
|
43
|
+
export const addKeyCommand = new Command('add-key')
|
|
44
|
+
.description('Create a new API key (read-only by default, --write for read/write)')
|
|
45
|
+
.option('-w, --write', 'Create with read/write permissions for voices and router')
|
|
46
|
+
.option('-n, --name <name>', 'Display name for the API key')
|
|
47
|
+
.action(async (options) => {
|
|
48
|
+
await requireAuth();
|
|
49
|
+
try {
|
|
50
|
+
const mode = options.write ? 'write' : 'read';
|
|
51
|
+
await WorkspaceService.createApiKey(mode, options.name);
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
printError(`\nFailed to create API key: ${error.message || error}`);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
22
59
|
/**
|
|
23
60
|
* Main workspace command with subcommands
|
|
24
61
|
* Manages user workspaces
|
|
@@ -27,6 +64,8 @@ export const workspaceCommand = new Command('workspace')
|
|
|
27
64
|
.description('Manage Inworld workspaces')
|
|
28
65
|
.alias('ws')
|
|
29
66
|
.addCommand(selectWorkspaceCommand)
|
|
67
|
+
.addCommand(selectKeyCommand)
|
|
68
|
+
.addCommand(addKeyCommand)
|
|
30
69
|
.action(() => {
|
|
31
70
|
workspaceCommand.help();
|
|
32
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace_command.js","sourceRoot":"","sources":["../../../src/commands/workspace_command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC;KACxD,WAAW,CAAC,uCAAuC,CAAC;KACpD,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,MAAM,WAAW,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;QAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,UAAU,CAAC,+BAA+B,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KACrD,WAAW,CAAC,2BAA2B,CAAC;KACxC,KAAK,CAAC,IAAI,CAAC;KACX,UAAU,CAAC,sBAAsB,CAAC;KAClC,MAAM,CAAC,GAAG,EAAE;IACX,gBAAgB,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"workspace_command.js","sourceRoot":"","sources":["../../../src/commands/workspace_command.ts"],"names":[],"mapp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;KAChD,WAAW,CAAC,qEAAqE,CAAC;KAClF,MAAM,CAAC,aAAa,EAAE,0DAA0D,CAAC;KACjF,MAAM,CAAC,mBAAmB,EAAE,8BAA8B,CAAC;KAC3D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,MAAM,WAAW,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9C,MAAM,gBAAgB,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,UAAU,CAAC,+BAA+B,KAAK,CAAC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KACrD,WAAW,CAAC,2BAA2B,CAAC;KACxC,KAAK,CAAC,IAAI,CAAC;KACX,UAAU,CAAC,sBAAsB,CAAC;KAClC,UAAU,CAAC,gBAAgB,CAAC;KAC5B,UAAU,CAAC,aAAa,CAAC;KACzB,MAAM,CAAC,GAAG,EAAE;IACX,gBAAgB,CAAC,IAAI,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
package/dist/src/constants.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const FIREBASE_API_KEY: string;
|
|
|
5
5
|
export declare const INWORLD_CLI_AUTH_URL: string;
|
|
6
6
|
export declare const INWORLD_CLI_AUTH_CALLBACK_PORT: number;
|
|
7
7
|
export declare const MIXPANEL_TOKEN: string;
|
|
8
|
-
export declare const
|
|
8
|
+
export declare const TEMPLATES_METADATA_URL: string;
|
|
9
|
+
export declare const RUNTIME_VERSION = "0.9.0-rc.17";
|
|
9
10
|
export declare const CLI_VERSION: string;
|
|
10
11
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,WAAW,EAAE,KAAK,GAAG,OAAO,GAAG,MACP,CAAC;AACtC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,YAAY,QAAuB,CAAC;AACjD,eAAO,MAAM,gBAAgB,QAEc,CAAC;AAC5C,eAAO,MAAM,oBAAoB,QACmC,CAAC;AACrE,eAAO,MAAM,8BAA8B,QAG1C,CAAC;AAEF,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,WAAW,EAAE,KAAK,GAAG,OAAO,GAAG,MACP,CAAC;AACtC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,YAAY,QAAuB,CAAC;AACjD,eAAO,MAAM,gBAAgB,QAEc,CAAC;AAC5C,eAAO,MAAM,oBAAoB,QACmC,CAAC;AACrE,eAAO,MAAM,8BAA8B,QAG1C,CAAC;AAEF,eAAO,MAAM,cAAc,QAC+C,CAAC;AAmB3E,eAAO,MAAM,sBAAsB,QAAgC,CAAC;AAEpE,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,WAAW,QAAsB,CAAC"}
|
package/dist/src/constants.js
CHANGED
|
@@ -25,6 +25,24 @@ export const FIREBASE_API_KEY = process.env.INWORLD_FIREBASE_API_KEY ||
|
|
|
25
25
|
'AIzaSyAPVBLVid0xPwjuU4Gmn_6_GyqxBq-SwQs';
|
|
26
26
|
export const INWORLD_CLI_AUTH_URL = process.env.INWORLD_CLI_AUTH_URL || 'https://cli.inworld.ai/login';
|
|
27
27
|
export const INWORLD_CLI_AUTH_CALLBACK_PORT = parseInt(process.env.INWORLD_CLI_AUTH_CALLBACK_PORT || '8085', 10);
|
|
28
|
-
export const
|
|
28
|
+
export const MIXPANEL_TOKEN = process.env.INWORLD_MIXPANEL_TOKEN || '2cf13116e9701343ac27ddc452adfbbc';
|
|
29
|
+
const resolveTemplatesMetadataUrl = () => {
|
|
30
|
+
if (process.env.INWORLD_TEMPLATES_METADATA_URL) {
|
|
31
|
+
return process.env.INWORLD_TEMPLATES_METADATA_URL;
|
|
32
|
+
}
|
|
33
|
+
const env = (process.env.INWORLD_ENV || '').toUpperCase();
|
|
34
|
+
switch (env) {
|
|
35
|
+
case 'DEV':
|
|
36
|
+
return 'https://storage.googleapis.com/assets-inworld-ai/files/dev/templates-info.json';
|
|
37
|
+
case 'STAGE':
|
|
38
|
+
return 'https://storage.googleapis.com/assets-inworld-ai/files/stage/templates-info.json';
|
|
39
|
+
case 'PROD':
|
|
40
|
+
return 'https://storage.googleapis.com/assets-inworld-ai/files/prod/templates-info.json';
|
|
41
|
+
default:
|
|
42
|
+
return 'https://storage.googleapis.com/assets-inworld-ai/files/prod/templates-info.json';
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
export const TEMPLATES_METADATA_URL = resolveTemplatesMetadataUrl();
|
|
46
|
+
export const RUNTIME_VERSION = '0.9.0-rc.17';
|
|
29
47
|
export const CLI_VERSION = packageJson.version;
|
|
30
48
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,WAAW,MAAM,iBAAiB,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,CAAC;AAElE,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAEhE,MAAM,kBAAkB,GAAG,GAAG,EAAE;IAC9B,IAAI,OAAO,CAAC,G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WAAW,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1D,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,KAAK;YACR,OAAO,gFAAgF,CAAC;QAC1F,KAAK,OAAO;YACV,OAAO,kFAAkF,CAAC;QAC5F,KAAK,MAAM;YACT,OAAO,iFAAiF,CAAC;QAC3F;YACE,OAAO,iFAAiF,CAAC;IAC7F,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,2BAA2B,EAAE,CAAC;AAEpE,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InworldError.d.ts","sourceRoot":"","sources":["../../../../src/grpc/core/InworldError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"InworldError.d.ts","sourceRoot":"","sources":["../../../../src/grpc/core/InworldError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AAGrF,OAAO,EAAE,cAAc,EAAoB,MAAM,eAAe,CAAC;AAEjE,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAkB,SAAQ,QAAQ,CAAC,UAAU,CAAC;IAC7D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,iBAAiB,CAWtE;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,oBAAoB,CAS5E;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,YAAY,CAAC,CAOlE;AAED,qBAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;gBAEP,KAAK,EAAE,oBAAoB,GAAG,KAAK,EAAE,QAAQ,CAAC,EAAE,OAAO;CAgBpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InworldError.js","sourceRoot":"","sources":["../../../../src/grpc/core/InworldError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"InworldError.js","sourceRoot":"","sources":["../../../../src/grpc/core/InworldError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAwBjE,MAAM,UAAU,mBAAmB,CAAC,GAAQ;IAC1C,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,OAAO,IAAI,GAAG;QACd,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ;QAChC,iBAAiB,IAAI,GAAG;QACxB,CAAC,GAAG,CAAC,eAAe,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACzE,CAAC,OAAO,GAAG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;QAED,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACF"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { loginCommandAlias } from './commands/auth/login_command';
|
|
4
|
+
import { logoutCommandAlias } from './commands/auth/logout_command';
|
|
5
|
+
import { statusCommandAlias } from './commands/auth/status_command';
|
|
6
|
+
import { authCommand } from './commands/auth_command';
|
|
7
|
+
import { deployCommandAlias } from './commands/graph/graph_deploy_command';
|
|
8
|
+
import { initCommandAlias } from './commands/graph/graph_init_command';
|
|
9
|
+
import { runCommandAlias } from './commands/graph/graph_run_command';
|
|
10
|
+
import { serveCommandAlias } from './commands/graph/graph_serve_command';
|
|
11
|
+
import { graphCommand } from './commands/graph_command';
|
|
12
|
+
import { ttsCommand } from './commands/tts_commands';
|
|
13
|
+
import { workspaceCommand } from './commands/workspace_command';
|
|
14
|
+
import { CLI_VERSION } from './constants';
|
|
15
|
+
import { analytics } from './services/analytics';
|
|
16
|
+
import { updateChecker } from './services/update_checker';
|
|
17
|
+
const version = CLI_VERSION;
|
|
18
|
+
process.env.DISABLE_WELCOME_MESSAGE = 'true';
|
|
19
|
+
class InworldCLI {
|
|
20
|
+
program;
|
|
21
|
+
currentCommand = null;
|
|
22
|
+
constructor() {
|
|
23
|
+
this.program = new Command();
|
|
24
|
+
this.setupProgram();
|
|
25
|
+
this.registerCommands();
|
|
26
|
+
}
|
|
27
|
+
setupProgram() {
|
|
28
|
+
this.program
|
|
29
|
+
.name('inworld')
|
|
30
|
+
.description('Inworld Runtime CLI')
|
|
31
|
+
.version(version, '--version')
|
|
32
|
+
.configureOutput({
|
|
33
|
+
writeOut: (str) => process.stdout.write(str),
|
|
34
|
+
writeErr: (str) => process.stderr.write(str),
|
|
35
|
+
getOutHelpWidth: () => process.stdout.columns || 80,
|
|
36
|
+
getErrHelpWidth: () => process.stderr.columns || 80,
|
|
37
|
+
})
|
|
38
|
+
.hook('preAction', (_thisCommand, actionCommand) => {
|
|
39
|
+
// Track command execution
|
|
40
|
+
const commandName = this.getCommandName(actionCommand);
|
|
41
|
+
this.currentCommand = commandName;
|
|
42
|
+
const options = actionCommand.opts();
|
|
43
|
+
// Sanitize options to remove sensitive data
|
|
44
|
+
const sanitizedOptions = this.sanitizeOptions(options);
|
|
45
|
+
analytics.trackCommandExecution(commandName, sanitizedOptions);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the full command name from a Command instance
|
|
50
|
+
*/
|
|
51
|
+
getCommandName(command) {
|
|
52
|
+
let name = command.name();
|
|
53
|
+
while (command.parent && command.parent.name() !== 'inworld') {
|
|
54
|
+
command = command.parent;
|
|
55
|
+
name = `${command.name()} ${name}`;
|
|
56
|
+
}
|
|
57
|
+
return name;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Sanitizes command options to remove sensitive data
|
|
61
|
+
*/
|
|
62
|
+
sanitizeOptions(options) {
|
|
63
|
+
const sanitized = {};
|
|
64
|
+
const sensitiveKeys = ['token', 'apikey', 'password', 'secret', 'key'];
|
|
65
|
+
for (const [key, value] of Object.entries(options)) {
|
|
66
|
+
const lowerKey = key.toLowerCase();
|
|
67
|
+
const isSensitive = sensitiveKeys.some((k) => lowerKey.includes(k));
|
|
68
|
+
if (isSensitive) {
|
|
69
|
+
sanitized[key] = '[REDACTED]';
|
|
70
|
+
}
|
|
71
|
+
else if (typeof value === 'string' ||
|
|
72
|
+
typeof value === 'number' ||
|
|
73
|
+
typeof value === 'boolean') {
|
|
74
|
+
sanitized[key] = value;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
sanitized[key] = typeof value;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return sanitized;
|
|
81
|
+
}
|
|
82
|
+
registerCommands() {
|
|
83
|
+
this.program.addCommand(loginCommandAlias);
|
|
84
|
+
this.program.addCommand(logoutCommandAlias);
|
|
85
|
+
this.program.addCommand(statusCommandAlias);
|
|
86
|
+
this.program.addCommand(serveCommandAlias);
|
|
87
|
+
this.program.addCommand(runCommandAlias);
|
|
88
|
+
this.program.addCommand(deployCommandAlias);
|
|
89
|
+
this.program.addCommand(initCommandAlias);
|
|
90
|
+
this.program.addCommand(authCommand);
|
|
91
|
+
this.program.addCommand(graphCommand);
|
|
92
|
+
this.program.addCommand(ttsCommand);
|
|
93
|
+
this.program.addCommand(workspaceCommand);
|
|
94
|
+
// Add a default help command
|
|
95
|
+
this.program
|
|
96
|
+
.command('help')
|
|
97
|
+
.description('Display help information')
|
|
98
|
+
.action(() => {
|
|
99
|
+
this.program.help();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
async run(args) {
|
|
103
|
+
try {
|
|
104
|
+
// Initialize analytics and update checker in parallel (non-blocking)
|
|
105
|
+
const initPromise = Promise.all([
|
|
106
|
+
analytics.initialize().catch(() => {
|
|
107
|
+
// Silently ignore analytics initialization errors
|
|
108
|
+
}),
|
|
109
|
+
updateChecker.checkAndNotify().catch(() => {
|
|
110
|
+
// Silently ignore update check errors
|
|
111
|
+
}),
|
|
112
|
+
]);
|
|
113
|
+
// Give initialization a reasonable time to complete, but don't block
|
|
114
|
+
const timeoutPromise = new Promise((resolve) => setTimeout(resolve, 1000));
|
|
115
|
+
await Promise.race([initPromise, timeoutPromise]);
|
|
116
|
+
await this.program.parseAsync(args);
|
|
117
|
+
// Flush analytics before exit
|
|
118
|
+
await analytics.flush();
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
// Track command failure if we know which command was running
|
|
122
|
+
if (this.currentCommand) {
|
|
123
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
124
|
+
analytics.trackCommandResult(this.currentCommand, false, errorMessage);
|
|
125
|
+
}
|
|
126
|
+
console.error(chalk.red('Error:'), error instanceof Error ? error.message : String(error));
|
|
127
|
+
// Ensure analytics are flushed even on error
|
|
128
|
+
await analytics.flush();
|
|
129
|
+
process.exit(1);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Create and run the CLI
|
|
134
|
+
const cli = new InworldCLI();
|
|
135
|
+
cli.run().catch((error) => {
|
|
136
|
+
console.error(chalk.red('Fatal error:'), error);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
});
|
|
139
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;A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CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Analytics service handles tracking CLI usage via Mixpanel.
|
|
3
|
-
* Users can opt
|
|
3
|
+
* Users can opt out using the 'inworld auth disable_telemetry' command.
|
|
4
4
|
*/
|
|
5
5
|
export declare class Analytics {
|
|
6
6
|
private static readonly CONF_ENTRY_NAME;
|
|
@@ -11,7 +11,7 @@ export declare class Analytics {
|
|
|
11
11
|
constructor();
|
|
12
12
|
/**
|
|
13
13
|
* Initializes Mixpanel with user context (email and CLI version).
|
|
14
|
-
* Only initializes if user is authenticated and hasn't opted out.
|
|
14
|
+
* Only initializes if the user is authenticated and hasn't opted out.
|
|
15
15
|
*/
|
|
16
16
|
initialize(): Promise<void>;
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/services/analytics.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAe;IAEtD,OAAO,CAAC,IAAI,CAAwC;IACpD,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAS;;IAQ5B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAsCjC;;OAEG;IACH,kBAAkB,IAAI,OAAO;IAM7B;;OAEG;IACH,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI3C;;;;OAIG;IACH,qBAAqB,
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../../src/services/analytics.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAe;IAEtD,OAAO,CAAC,IAAI,CAAwC;IACpD,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAS;;IAQ5B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAsCjC;;OAEG;IACH,kBAAkB,IAAI,OAAO;IAM7B;;OAEG;IACH,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAI3C;;;;OAIG;IACH,qBAAqB,CACnB,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,IAAI;IAiBP;;;;;OAKG;IACH,kBAAkB,CAChB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,YAAY,CAAC,EAAE,MAAM,GACpB,IAAI;IAkBP;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAkBvB;AAGD,eAAO,MAAM,SAAS,WAAkB,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import Conf from 'conf';
|
|
2
|
+
import Mixpanel from 'mixpanel';
|
|
3
|
+
import { authManager } from '@/auth/manager';
|
|
4
|
+
import { CLI_VERSION, MIXPANEL_TOKEN } from '@/constants';
|
|
5
|
+
/**
|
|
6
|
+
* Analytics service handles tracking CLI usage via Mixpanel.
|
|
7
|
+
* Users can opt out using the 'inworld auth disable_telemetry' command.
|
|
8
|
+
*/
|
|
9
|
+
export class Analytics {
|
|
10
|
+
static CONF_ENTRY_NAME = 'analytics';
|
|
11
|
+
conf;
|
|
12
|
+
mixpanel = null;
|
|
13
|
+
userId = null;
|
|
14
|
+
initialized = false;
|
|
15
|
+
constructor() {
|
|
16
|
+
this.conf = new Conf({
|
|
17
|
+
projectName: 'inworld-cli-config',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Initializes Mixpanel with user context (email and CLI version).
|
|
22
|
+
* Only initializes if the user is authenticated and hasn't opted out.
|
|
23
|
+
*/
|
|
24
|
+
async initialize() {
|
|
25
|
+
try {
|
|
26
|
+
// Check if telemetry is enabled (opt-in by default)
|
|
27
|
+
if (!this.isTelemetryEnabled()) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Don't initialize if no token is provided
|
|
31
|
+
if (!MIXPANEL_TOKEN) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Get user credentials to identify the user
|
|
35
|
+
const credentials = await authManager.getCredentials();
|
|
36
|
+
if (!credentials?.email) {
|
|
37
|
+
// Don't initialize if the user is not authenticated
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Initialize Mixpanel
|
|
41
|
+
this.mixpanel = Mixpanel.init(MIXPANEL_TOKEN);
|
|
42
|
+
this.userId = credentials.email;
|
|
43
|
+
this.initialized = true;
|
|
44
|
+
// Set user profile properties
|
|
45
|
+
if (this.mixpanel && this.userId) {
|
|
46
|
+
this.mixpanel.people.set(this.userId, {
|
|
47
|
+
$email: credentials.email,
|
|
48
|
+
cli_version: CLI_VERSION,
|
|
49
|
+
environment: credentials.env || 'PROD',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Silently fail - we don't want analytics to break the CLI
|
|
55
|
+
this.initialized = false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Checks if telemetry is enabled (opt-in by default)
|
|
60
|
+
*/
|
|
61
|
+
isTelemetryEnabled() {
|
|
62
|
+
const config = this.conf.get(Analytics.CONF_ENTRY_NAME);
|
|
63
|
+
// Default to true (opt-in by default)
|
|
64
|
+
return config?.telemetryEnabled !== false;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Enables or disables telemetry
|
|
68
|
+
*/
|
|
69
|
+
setTelemetryEnabled(enabled) {
|
|
70
|
+
this.conf.set(Analytics.CONF_ENTRY_NAME, { telemetryEnabled: enabled });
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Tracks a command execution event
|
|
74
|
+
* @param command The command being executed (e.g., 'auth login', 'graph deploy')
|
|
75
|
+
* @param parameters Command parameters (sanitized, no sensitive data)
|
|
76
|
+
*/
|
|
77
|
+
trackCommandExecution(command, parameters) {
|
|
78
|
+
if (!this.initialized || !this.mixpanel || !this.userId) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
this.mixpanel.track('[inworld cli] command_execution', {
|
|
83
|
+
distinct_id: this.userId,
|
|
84
|
+
command,
|
|
85
|
+
cli_version: CLI_VERSION,
|
|
86
|
+
...parameters,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
// Silently fail
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Tracks a command result event (success or failure)
|
|
95
|
+
* @param command The command that was executed
|
|
96
|
+
* @param success Whether the command succeeded
|
|
97
|
+
* @param errorMessage Optional error message (sanitized)
|
|
98
|
+
*/
|
|
99
|
+
trackCommandResult(command, success, errorMessage) {
|
|
100
|
+
if (!this.initialized || !this.mixpanel || !this.userId) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
try {
|
|
104
|
+
this.mixpanel.track('[inworld_cli] command_result', {
|
|
105
|
+
distinct_id: this.userId,
|
|
106
|
+
command,
|
|
107
|
+
success,
|
|
108
|
+
cli_version: CLI_VERSION,
|
|
109
|
+
error_message: errorMessage,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Silently fail
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Flushes any pending events to Mixpanel
|
|
118
|
+
* Should be called before the CLI exits
|
|
119
|
+
*/
|
|
120
|
+
flush() {
|
|
121
|
+
return new Promise((resolve) => {
|
|
122
|
+
if (!this.initialized || !this.mixpanel) {
|
|
123
|
+
resolve();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// Give Mixpanel a short time to flush, but don't block indefinitely
|
|
127
|
+
const timeout = setTimeout(() => resolve(), 500);
|
|
128
|
+
// Mixpanel doesn't have a flush method in this version, but we can
|
|
129
|
+
// give it a small delay to send pending events
|
|
130
|
+
setTimeout(() => {
|
|
131
|
+
clearTimeout(timeout);
|
|
132
|
+
resolve();
|
|
133
|
+
}, 100);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Export singleton instance
|
|
138
|
+
export const analytics = new Analytics();
|
|
139
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../../src/services/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAM1D;;;GAGG;AACH,MAAM,OAAO,SAAS;IACZ,MAAM,CAAU,eAAe,GAAG,WAAW,CAAC;IAE9C,IAAI,CAAwC;IAC5C,QAAQ,GAA6B,IAAI,CAAC;IAC1C,MAAM,GAAkB,IAAI,CAAC;IAC7B,WAAW,GAAG,KAAK,CAAC;IAE5B;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAkC;YACpD,WAAW,EAAE,oBAAoB;SAClC,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU;QACd,IAAI,CAAC;YACH,oDAAoD;YACpD,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;gBAC/B,OAAO;YACT,CAAC;YAED,2CAA2C;YAC3C,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,OAAO;YACT,CAAC;YAED,4CAA4C;YAC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C,CAAC;QACV,CAAC,CAAC,CAAC;IACL,CAAC;;AAGH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GraphsService } from '@/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb';
|
|
2
1
|
import { authenticatedInworldRequest, requireAuth, requireWorkspace, } from '@/auth/utils';
|
|
3
2
|
import { isGrpcError } from '@/grpc/core/InworldError';
|
|
4
3
|
import { GrpcStatusCode } from '@/grpc/core/statusCodes';
|
|
4
|
+
import { GraphsService } from '@/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb';
|
|
5
5
|
import { checkLRO } from '@/utils/long_running_operations';
|
|
6
6
|
import { getGraphResourceName, getWorkspaceResourceName, } from '@/utils/resource_name_helper';
|
|
7
7
|
import { createLROSpinnerCallbacks } from '@/utils/spinner';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy_service.js","sourceRoot":"","sources":["../../../src/services/deploy_service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"deploy_service.js","sourceRoot":"","sources":["../../../src/services/deploy_service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,WAAW,EACX,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,8EAA8E,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AA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;AACH,MAAM,QAAQ,GAAG,KAAK,EAAE,iBAAyB,EAAE,EAAE;IACnD,WAAW,EAAE,CAAC;IACd,OAAO,MAAM,2BAA2B,CAAC,aAAa,CAAC,QAAQ,EAAE;QAC/D,IAAI,EAAE,iBAAiB;KACxB,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,aAAa,GAAG,KAAK,EAAE,WAAmB,EAAE,OAAe,EAAE,EAAE;IACnE,WAAW,EAAE,CAAC;IACd,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACrE,MAAM,qBAAqB,GAAG,wBAAwB,CAAC,WAAW,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,MAAM,2BAA2B,CACjD,aAAa,CAAC,WAAW,EACzB;QACE,MAAM,EAAE,GAAG,qBAAqB,EAAE;QAClC,KAAK,EAAE;YACL,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,OAAO;YACpB,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE;SAC9C;KACF,CACF,CAAC;IAEF,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;QACjD,WAAW,EAAE,qBAAqB,OAAO,sBAAsB;QAC/D,cAAc,EAAE,KAAK;KACtB,CAAC,CAAC;IAEH,MAAM,QAAQ,CAAC;QACb,aAAa,EAAE,SAAS,CAAC,IAAI;QAC7B,WAAW,EAAE,gBAAgB;KAC9B,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_loader.d.ts","sourceRoot":"","sources":["../../../src/services/graph_loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_loader.d.ts","sourceRoot":"","sources":["../../../src/services/graph_loader.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,SAAS,GAAU,MAAM,MAAM;;;;;EAmG3C,CAAC"}
|
|
@@ -2,8 +2,8 @@ import * as esbuild from 'esbuild';
|
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import { Module } from 'module';
|
|
4
4
|
import path from 'path';
|
|
5
|
-
import { printError } from '@/utils/ui';
|
|
6
5
|
import { requireApiKey } from '@/auth/utils';
|
|
6
|
+
import { printError } from '@/utils/ui';
|
|
7
7
|
export const loadGraph = async (file) => {
|
|
8
8
|
process.env.INWORLD_API_KEY = await requireApiKey();
|
|
9
9
|
// Resolve the file path
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_loader.js","sourceRoot":"","sources":["../../../src/services/graph_loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"graph_loader.js","sourceRoot":"","sources":["../../../src/services/graph_loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,EAAE,IAAY,EAAE,EAAE;IAC9C,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,MAAM,aAAa,EAAE,CAAC;IAEpD,wBAAwB;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;IAEnD,IA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AAC,CAAC;IAClB,CAAC;IAED,gCAAgC;IAChC,0CAA0C;IAC1C,mBAAmB;IACnB,wFAAwF;IACxF,OAAO;IACP,qBAAqB;IACrB,IAAI;IAEJ,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW;QACX,mBAAmB;QACnB,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,SAAS,sBAAsB,CAAC,QAAgB;IAC9C,IAAI,UAAU,GAAG,QAAQ,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;IAEzC,OAAO,UAAU,KAAK,IAAI,EAAE,CAAC;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAC9D,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;YACnC,OAAO,eAAe,CAAC;QACzB,CAAC;QACD,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED,+BAA+B;IAC/B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACxD,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACnC,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_variant_service.d.ts","sourceRoot":"","sources":["../../../src/services/graph_variant_service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph_variant_service.d.ts","sourceRoot":"","sources":["../../../src/services/graph_variant_service.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB,GAAU,SAAS,MAAM,0IAMtD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED,eAAO,MAAM,oBAAoB,GAC/B,SAAS,MAAM,EACf,oBAAoB,MAAM,EAC1B,eAAe,MAAM,EACrB,QAAO,OAAe,qBAoDvB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GraphsService } from '@/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb';
|
|
2
1
|
import { authenticatedInworldRequest, requireWorkspace } from '@/auth/utils';
|
|
2
|
+
import { GraphsService } from '@/proto/generated/portal/ai/inworld/studio/v1/remote/configuration/graphs.pb';
|
|
3
3
|
import { checkLRO } from '@/utils/long_running_operations';
|
|
4
4
|
import { getGraphResourceName, getGraphVariantResourceName, } from '@/utils/resource_name_helper';
|
|
5
5
|
import { ensureGraphRegistered } from './deploy_service';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_variant_service.js","sourceRoot":"","sources":["../../../src/services/graph_variant_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"graph_variant_service.js","sourceRoot":"","sources":["../../../src/services/graph_variant_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,8EAA8E,CAAC;AAC7G,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,OAAe,EAAE,EAAE;IACzD,MAAM,WAAW,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAC7C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACrE,OAAO,MAAM,2BAA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M,qBAAqB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAChE,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,EAAE,UAAU,KAAK,IAAI,EAAE,CAAC;YAClD,OAAO,CAAC,GAAG,CACT,UAAU,OAAO,iEAAiE,CACnF,CAAC;YACF,6EAA6E;YAC7E,MAAM,SAAS,GAAG,MAAM,2BAA2B,CACjD,aAAa,CAAC,WAAW,EACzB;gBACE,KAAK,EAAE;oBACL,GAAG,KAAK;oBACR,SAAS,EAAE,EAAE,UAAU,EAAE,YAAY,mBAAmB,KAAK,EAAE;iBAChE;aACF,CACF,CAAC;YACF,MAAM,QAAQ,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template metadata from JSON file
|
|
3
|
+
*/
|
|
4
|
+
export interface TemplateMetadata {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
githubRepo: string;
|
|
8
|
+
readmeLink?: string;
|
|
9
|
+
inputModality?: string[];
|
|
10
|
+
outputModality?: string[];
|
|
11
|
+
useCase?: string[];
|
|
12
|
+
useCases?: Array<string | {
|
|
13
|
+
useCase: string;
|
|
14
|
+
icon?: string;
|
|
15
|
+
}>;
|
|
16
|
+
sdk?: string;
|
|
17
|
+
sdkVersion?: string;
|
|
18
|
+
webDemo?: string | null;
|
|
19
|
+
videoDemo?: string | null;
|
|
20
|
+
docsLink?: string | null;
|
|
21
|
+
type?: string;
|
|
22
|
+
backgroundImage?: string;
|
|
23
|
+
foregroundImage?: string;
|
|
24
|
+
id: string;
|
|
25
|
+
rawReadmeURL?: string;
|
|
26
|
+
readmeContent?: string;
|
|
27
|
+
readmeHTML?: string;
|
|
28
|
+
branch?: string;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Template info including directory name and metadata
|
|
33
|
+
*/
|
|
34
|
+
export interface TemplateInfo {
|
|
35
|
+
directory: string;
|
|
36
|
+
metadata: TemplateMetadata;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Fetch templates metadata from the public JSON file
|
|
40
|
+
* Always fetches fresh data (no caching)
|
|
41
|
+
*/
|
|
42
|
+
export declare function fetchTemplatesMetadata(): Promise<TemplateMetadata[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Extract owner/repo from GitHub URL
|
|
45
|
+
*/
|
|
46
|
+
export declare function extractRepoFromUrl(githubUrl: string): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Parse repository string to extract owner and repo
|
|
49
|
+
* Supports formats:
|
|
50
|
+
* - 'owner/repo'
|
|
51
|
+
* - 'https://github.com/owner/repo'
|
|
52
|
+
* - 'https://github.com/owner/repo.git'
|
|
53
|
+
*/
|
|
54
|
+
export declare function parseRepository(repoString: string): {
|
|
55
|
+
owner: string;
|
|
56
|
+
repo: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Check if template is cached and valid (without downloading)
|
|
60
|
+
*/
|
|
61
|
+
export declare function isTemplateCached(templateId: string, forceRefresh: boolean): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Download and cache a template from GitHub
|
|
64
|
+
* Returns the path to the cached template directory and whether it was from cache
|
|
65
|
+
*/
|
|
66
|
+
export declare function downloadAndCacheTemplate(templateId: string, repository: string, branch?: string, forceRefresh?: boolean): Promise<{
|
|
67
|
+
path: string;
|
|
68
|
+
fromCache: boolean;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Get available templates from metadata URL
|
|
72
|
+
*/
|
|
73
|
+
export declare function getAvailableTemplatesWithMetadata(): Promise<TemplateInfo[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Copy directory recursively (exported for use in command)
|
|
76
|
+
* Excludes .git directories and other unnecessary files
|
|
77
|
+
*/
|
|
78
|
+
export declare function copyTemplateDirectory(src: string, dest: string): void;
|
|
79
|
+
//# sourceMappingURL=template_service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template_service.d.ts","sourceRoot":"","sources":["../../../src/services/template_service.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CAC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