diff --git a/angular.json b/angular.json index fa3e06d42..e614e8e77 100644 --- a/angular.json +++ b/angular.json @@ -64,7 +64,7 @@ "scripts": ["node_modules/uplot/dist/uPlot.iife.min.js"], "extraWebpackConfig": "projects/step-app/webpack.config.js", "commonChunk": false, - "allowedCommonJsDependencies": ["ace-builds", "luxon"] + "allowedCommonJsDependencies": ["ace-builds", "luxon", "@logicflow-ai/astra-wingman"] }, "configurations": { "local": { diff --git a/package.json b/package.json index b906d215a..cd9afe201 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,8 @@ "tslib": "2.3.0", "uplot": "^1.6.28", "uuid": "8.3.2", - "zone.js": "0.14.3" + "zone.js": "0.14.3", + "@logicflow-ai/astra-wingman": "latest" }, "devDependencies": { "@angular-devkit/build-angular": "17.1.1", diff --git a/projects/step-app/src/bootstrap.ts b/projects/step-app/src/bootstrap.ts index 76f4b170a..f5ac15ad8 100644 --- a/projects/step-app/src/bootstrap.ts +++ b/projects/step-app/src/bootstrap.ts @@ -3,11 +3,16 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { environment } from './environments/environment'; import { AppModule } from '@exense/step-frontend'; +import { initializeWingman } from '@logicflow-ai/astra-wingman'; if (environment.production) { enableProdMode(); } +if (environment.wingmanConfig) { + initializeWingman(environment.wingmanConfig); +} + platformBrowserDynamic() .bootstrapModule(AppModule) .catch((err) => console.error(err)); diff --git a/projects/step-app/src/environments/environment.prod.ts b/projects/step-app/src/environments/environment.prod.ts index c9669790b..40eac97b1 100644 --- a/projects/step-app/src/environments/environment.prod.ts +++ b/projects/step-app/src/environments/environment.prod.ts @@ -1,3 +1,23 @@ +import { initializeWingman } from '@logicflow-ai/astra-wingman'; +type WingmanConfig = Parameters[0]; + export const environment = { production: true, + wingmanConfig: { + endpoint: 'https://astra.logicflow.ai/', + application: 'Autonomous STEP', + projectId: '38eb9b47-5483-4e09-88e6-defc8b4e4216', + environments: ['http://localhost:4201', 'https://stepos-sed-2461.stepcloud-test.ch'], + active: true, + allowPassword: true, + language: () => 'en', + username: () => 'admin', + customState: () => { + return { role: 'admin' }; + }, + debugging: true, + testing: false, + flowGpt: false, + gptInContext: false, + } as WingmanConfig | undefined, }; diff --git a/projects/step-app/src/environments/environment.ts b/projects/step-app/src/environments/environment.ts index 66998ae9a..942e4b7fd 100644 --- a/projects/step-app/src/environments/environment.ts +++ b/projects/step-app/src/environments/environment.ts @@ -1,9 +1,29 @@ // This file can be replaced during build by using the `fileReplacements` array. // `ng build` replaces `environment.ts` with `environment.prod.ts`. // The list of file replacements can be found in `angular.json`. +import { initializeWingman } from '@logicflow-ai/astra-wingman'; + +type WingmanConfig = Parameters[0]; export const environment = { production: false, + wingmanConfig: { + endpoint: 'https://astra.logicflow.ai/', + application: 'Autonomous STEP', + projectId: '38eb9b47-5483-4e09-88e6-defc8b4e4216', + environments: ['http://localhost:4201', 'https://stepos-sed-2461.stepcloud-test.ch'], + active: true, + allowPassword: true, + language: () => 'en', + username: () => 'admin', + customState: () => { + return { role: 'admin' }; + }, + debugging: true, + testing: false, + flowGpt: false, + gptInContext: false, + } as WingmanConfig | undefined, }; /* diff --git a/projects/step-frontend/src/lib/modules/plan-editor/components/plan-editor-actions/plan-editor-actions.component.ts b/projects/step-frontend/src/lib/modules/plan-editor/components/plan-editor-actions/plan-editor-actions.component.ts index a822e1d74..df9ccccc5 100644 --- a/projects/step-frontend/src/lib/modules/plan-editor/components/plan-editor-actions/plan-editor-actions.component.ts +++ b/projects/step-frontend/src/lib/modules/plan-editor/components/plan-editor-actions/plan-editor-actions.component.ts @@ -56,7 +56,7 @@ export class PlanEditorActionsComponent implements OnChanges { undo: 'Undo (Ctrl + Z)', redo: 'Redo (Ctrl + Y)', duplicate: 'Duplicate this plan', - showSource: 'Show plan\'s YAML source', + showSource: "Show plan's YAML source", export: 'Export this plan', start: 'Execute this plan', resetInteractive: 'Reset the session of the interactive mode', diff --git a/projects/step-frontend/src/lib/modules/timeseries/performance-view/time-selection/performance-view-time-selection.component.ts b/projects/step-frontend/src/lib/modules/timeseries/performance-view/time-selection/performance-view-time-selection.component.ts index 2866678bf..c5291205b 100644 --- a/projects/step-frontend/src/lib/modules/timeseries/performance-view/time-selection/performance-view-time-selection.component.ts +++ b/projects/step-frontend/src/lib/modules/timeseries/performance-view/time-selection/performance-view-time-selection.component.ts @@ -1,4 +1,14 @@ -import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core'; +import { + Component, + EventEmitter, + inject, + Input, + OnDestroy, + OnInit, + Output, + ViewChild, + ViewEncapsulation, +} from '@angular/core'; import { TimeSeriesUtils } from '../../time-series-utils'; import { TSRangerComponent } from '../../ranger/ts-ranger.component'; import { TimeSeriesContext } from '../../time-series-context';