@equinor/fusion-framework-cli 13.0.0-cli-search-index.5 → 13.0.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/CHANGELOG.md +136 -56
- package/README.md +24 -0
- package/bin/build/bin.mjs +1 -1
- package/bin/build/cli.mjs +6 -6
- package/dist/esm/lib/dev-server.js +1 -0
- package/dist/esm/lib/dev-server.js.map +1 -1
- package/dist/esm/lib/fusion-cli-config.js +21 -0
- package/dist/esm/lib/fusion-cli-config.js.map +1 -0
- package/dist/esm/lib/index.js +1 -0
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/cli/commands/create/_helpers/cleanup-template-files.d.ts +4 -2
- package/dist/types/cli/commands/create/_helpers/open-in-ide.d.ts +3 -2
- package/dist/types/cli/commands/create/_helpers/select-git-protocol.d.ts +7 -2
- package/dist/types/cli/commands/create/_helpers/setup-repository.d.ts +6 -2
- package/dist/types/cli/commands/create/app.d.ts +4 -1
- package/dist/types/cli/commands/index.d.ts +1 -1
- package/dist/types/cli/plugins/loader.d.ts +2 -0
- package/dist/types/lib/dev-server.d.ts +1 -0
- package/dist/types/lib/fusion-cli-config.d.ts +84 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/ai-commands.md +26 -22
- package/package.json +16 -33
- package/dist/esm/lib/ai/fusion-ai.js +0 -2
- package/dist/esm/lib/ai/fusion-ai.js.map +0 -1
- package/dist/esm/lib/ai/index.js +0 -2
- package/dist/esm/lib/ai/index.js.map +0 -1
- package/dist/types/cli/commands/ai/chat.d.ts +0 -2
- package/dist/types/cli/commands/ai/embeddings.d.ts +0 -2
- package/dist/types/cli/commands/ai/index.d.ts +0 -30
- package/dist/types/cli/commands/ai/search.d.ts +0 -48
- package/dist/types/cli/commands/ai/utils/generate-cunk-id.d.ts +0 -8
- package/dist/types/cli/commands/ai/utils/git/file-changes.d.ts +0 -21
- package/dist/types/cli/commands/ai/utils/git/git-client.d.ts +0 -17
- package/dist/types/cli/commands/ai/utils/git/index.d.ts +0 -5
- package/dist/types/cli/commands/ai/utils/git/metadata.d.ts +0 -7
- package/dist/types/cli/commands/ai/utils/git/status.d.ts +0 -12
- package/dist/types/cli/commands/ai/utils/git/types.d.ts +0 -33
- package/dist/types/cli/commands/ai/utils/markdown/index.d.ts +0 -2
- package/dist/types/cli/commands/ai/utils/markdown/parser.d.ts +0 -21
- package/dist/types/cli/commands/ai/utils/markdown/types.d.ts +0 -11
- package/dist/types/cli/commands/ai/utils/setup-framework.d.ts +0 -10
- package/dist/types/cli/commands/ai/utils/ts-doc/constants.d.ts +0 -5
- package/dist/types/cli/commands/ai/utils/ts-doc/extractors.d.ts +0 -28
- package/dist/types/cli/commands/ai/utils/ts-doc/index.d.ts +0 -2
- package/dist/types/cli/commands/ai/utils/ts-doc/parser.d.ts +0 -23
- package/dist/types/cli/commands/ai/utils/ts-doc/types.d.ts +0 -20
- package/dist/types/cli/commands/ai/utils/types.d.ts +0 -7
- package/dist/types/cli/commands/create/_helpers/start-dev-server.d.ts +0 -17
- package/dist/types/cli/options/ai.d.ts +0 -105
- package/dist/types/lib/ai/fusion-ai.d.ts +0 -20
- package/dist/types/lib/ai/index.d.ts +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { processServices } from '@equinor/fusion-framework-dev-server';
|
|
1
2
|
export { loadDevServerConfig, defineDevServerConfig, } from './load-dev-server-config.js';
|
|
2
3
|
export { mergeDevServerConfig } from './merge-dev-server-config.js';
|
|
3
4
|
//# sourceMappingURL=dev-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server.js","sourceRoot":"","sources":["../../../src/lib/dev-server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"dev-server.js","sourceRoot":"","sources":["../../../src/lib/dev-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to define a Fusion CLI configuration function with proper typing.
|
|
3
|
+
*
|
|
4
|
+
* @param fn - A function that returns the Fusion CLI configuration object (either synchronously or asynchronously)
|
|
5
|
+
* @returns The provided configuration function, unchanged
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This utility is used to provide type safety and tooling support for Fusion CLI configuration authoring.
|
|
9
|
+
* It is a no-op at runtime, but helps with code completion and documentation for consumers.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { defineFusionCli } from '@equinor/fusion-framework-cli';
|
|
14
|
+
*
|
|
15
|
+
* export default defineFusionCli(() => ({
|
|
16
|
+
* plugins: ['@equinor/fusion-framework-cli-plugin-ai'],
|
|
17
|
+
* }));
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export const defineFusionCli = (fn) => fn;
|
|
21
|
+
//# sourceMappingURL=fusion-cli-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fusion-cli-config.js","sourceRoot":"","sources":["../../../src/lib/fusion-cli-config.ts"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAqB,EAAE,EAAE,CAAC,EAAE,CAAC"}
|
package/dist/esm/lib/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { resolvePackage } from './utils/resolve-package.js';
|
|
2
2
|
export { resolveEntryPoint } from './utils/resolve-source-entry-point.js';
|
|
3
3
|
export { loadDevServerConfig, defineDevServerConfig, } from './load-dev-server-config.js';
|
|
4
|
+
export { defineFusionCli, } from './fusion-cli-config.js';
|
|
4
5
|
// Legacy imports - these will be removed in the next major version
|
|
5
6
|
// @todo - remove these imports, introduced in v11
|
|
6
7
|
export { defineAppConfig, defineAppManifest } from './legacy.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AAErC,mEAAmE;AACnE,kDAAkD;AAClD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAwB,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,eAAe,GAIhB,MAAM,wBAAwB,CAAC;AAEhC,mEAAmE;AACnE,kDAAkD;AAClD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/esm/version.js
CHANGED
|
@@ -5,11 +5,13 @@ import type { ProjectTemplateRepository } from '../../../../bin/helpers/ProjectT
|
|
|
5
5
|
*
|
|
6
6
|
* Offers the user the option to remove the cloned template repository and
|
|
7
7
|
* temporary files to free up disk space. If the user declines, the files
|
|
8
|
-
* remain available for future use.
|
|
8
|
+
* remain available for future use. If cleanup is explicitly provided, it
|
|
9
|
+
* will be used directly without prompting.
|
|
9
10
|
*
|
|
10
11
|
* @param repo - ProjectTemplateRepository instance containing temporary files
|
|
11
12
|
* @param logger - Console logger for displaying prompts and cleanup status
|
|
13
|
+
* @param cleanup - Optional cleanup flag to use directly (skips prompt if provided)
|
|
12
14
|
* @returns Promise that resolves when the cleanup process is complete
|
|
13
15
|
*/
|
|
14
|
-
export declare function cleanupTemplateFiles(repo: ProjectTemplateRepository, logger: ConsoleLogger): Promise<void>;
|
|
16
|
+
export declare function cleanupTemplateFiles(repo: ProjectTemplateRepository, logger: ConsoleLogger, cleanup?: boolean): Promise<void>;
|
|
15
17
|
export default cleanupTemplateFiles;
|
|
@@ -5,11 +5,12 @@ import type { ConsoleLogger } from '@equinor/fusion-framework-cli/bin';
|
|
|
5
5
|
* Displays a selection menu with supported IDEs (VS Code, Cursor) and executes
|
|
6
6
|
* the appropriate command to open the project directory. The IDE runs detached
|
|
7
7
|
* and independently of the CLI process. If the user chooses not to open an IDE,
|
|
8
|
-
* the function completes without action.
|
|
8
|
+
* the function completes without action. If skip is true, the prompt is skipped.
|
|
9
9
|
*
|
|
10
10
|
* @param targetDir - Absolute path to the project directory to open
|
|
11
11
|
* @param logger - Console logger for displaying prompts and instructions
|
|
12
|
+
* @param skip - If true, skip the IDE opening prompt entirely
|
|
12
13
|
* @returns Promise that resolves when the IDE selection process is complete
|
|
13
14
|
*/
|
|
14
|
-
export declare function openInIDE(targetDir: string, logger: ConsoleLogger): Promise<void>;
|
|
15
|
+
export declare function openInIDE(targetDir: string, logger: ConsoleLogger, skip?: boolean): Promise<void>;
|
|
15
16
|
export default openInIDE;
|
|
@@ -4,16 +4,21 @@ import type { GitClientProtocol } from '../../../../bin/helpers/ProjectTemplateR
|
|
|
4
4
|
* Prompts the user to select their preferred Git protocol for repository cloning.
|
|
5
5
|
*
|
|
6
6
|
* This function presents a choice between HTTPS and SSH protocols, with
|
|
7
|
-
* intelligent defaults based on SSH configuration detection.
|
|
7
|
+
* intelligent defaults based on SSH configuration detection. If a protocol
|
|
8
|
+
* is provided, it will be used directly without prompting.
|
|
8
9
|
*
|
|
9
10
|
* @param logger - Optional logger instance for debug output
|
|
11
|
+
* @param protocol - Optional protocol to use directly (skips prompt if provided)
|
|
10
12
|
* @returns Promise resolving to the selected Git protocol ('https' or 'ssh')
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* ```typescript
|
|
14
16
|
* const protocol = await selectGitProtocol(logger);
|
|
15
17
|
* console.log(`Using ${protocol} protocol for cloning`);
|
|
18
|
+
*
|
|
19
|
+
* // Non-interactive mode
|
|
20
|
+
* const protocol = await selectGitProtocol(logger, 'https');
|
|
16
21
|
* ```
|
|
17
22
|
*/
|
|
18
|
-
export declare function selectGitProtocol(logger?: ConsoleLogger): Promise<GitClientProtocol>;
|
|
23
|
+
export declare function selectGitProtocol(logger?: ConsoleLogger, protocol?: GitClientProtocol): Promise<GitClientProtocol>;
|
|
19
24
|
export default selectGitProtocol;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConsoleLogger } from '@equinor/fusion-framework-cli/bin';
|
|
2
|
-
import { ProjectTemplateRepository } from '../../../../bin/helpers/ProjectTemplateRepository.js';
|
|
2
|
+
import { ProjectTemplateRepository, type GitClientProtocol } from '../../../../bin/helpers/ProjectTemplateRepository.js';
|
|
3
3
|
/**
|
|
4
4
|
* Sets up and initializes a project template repository for template access.
|
|
5
5
|
*
|
|
@@ -11,13 +11,17 @@ import { ProjectTemplateRepository } from '../../../../bin/helpers/ProjectTempla
|
|
|
11
11
|
* @param clean - Whether to clean the repo directory before cloning (removes existing directory)
|
|
12
12
|
* @param branch - Git branch to checkout (defaults to 'main')
|
|
13
13
|
* @param logger - Logger instance for output and debugging
|
|
14
|
+
* @param protocol - Optional Git protocol to use (skips prompt if provided)
|
|
14
15
|
* @returns Promise resolving to the initialized repository ready for template access
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```typescript
|
|
18
19
|
* const repo = await setupRepository('equinor/fusion-app-template', true, 'main', logger);
|
|
19
20
|
* const templates = await repo.getAvailableTemplates();
|
|
21
|
+
*
|
|
22
|
+
* // Non-interactive mode
|
|
23
|
+
* const repo = await setupRepository('equinor/fusion-app-template', true, 'main', logger, 'https');
|
|
20
24
|
* ```
|
|
21
25
|
*/
|
|
22
|
-
export declare function setupRepository(templateRepoName: string, clean: boolean, branch: string, logger: ConsoleLogger): Promise<ProjectTemplateRepository>;
|
|
26
|
+
export declare function setupRepository(templateRepoName: string, clean: boolean, branch: string, logger: ConsoleLogger, protocol?: GitClientProtocol): Promise<ProjectTemplateRepository>;
|
|
23
27
|
export default setupRepository;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Selecting from available project templates (React, vanilla, etc.)
|
|
7
7
|
* - Setting up complete local development environment
|
|
8
8
|
* - Resolving workspace dependencies to npm versions
|
|
9
|
-
* - Installing dependencies
|
|
9
|
+
* - Installing dependencies
|
|
10
10
|
* - Opening projects in the user's preferred IDE
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
*
|
|
23
23
|
* # Create with clean directory and specific branch
|
|
24
24
|
* ffc create app my-app --clean --branch develop
|
|
25
|
+
*
|
|
26
|
+
* # Non-interactive mode with all options specified
|
|
27
|
+
* ffc create app my-app --template basic --git-protocol https --no-cleanup --no-open
|
|
25
28
|
* ```
|
|
26
29
|
*/
|
|
27
30
|
export declare const createAppCommand: (name: string) => import("commander").Command;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export { processServices } from '@equinor/fusion-framework-dev-server';
|
|
1
2
|
export { loadDevServerConfig, defineDevServerConfig, type DevServerConfigFn, type DevServerConfigExport, } from './load-dev-server-config.js';
|
|
2
3
|
export { mergeDevServerConfig } from './merge-dev-server-config.js';
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* A plugin can be either a package name (string) that will be dynamically imported,
|
|
4
|
+
* or a direct plugin registration function.
|
|
5
|
+
*/
|
|
6
|
+
export type FusionCliPlugin = string | ((program: Command) => void);
|
|
7
|
+
/**
|
|
8
|
+
* Plugin configuration that lists plugins to load
|
|
9
|
+
*/
|
|
10
|
+
export type FusionCliConfig = {
|
|
11
|
+
/** Array of plugin package names or direct plugin functions to load */
|
|
12
|
+
plugins?: FusionCliPlugin[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* A function type for defining dynamic or static Fusion CLI configuration.
|
|
16
|
+
*
|
|
17
|
+
* @param env - Optional environment object with root directory information
|
|
18
|
+
* @returns The Fusion CLI configuration object, a promise resolving to it, or void if no configuration is provided
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* This function enables both static and dynamic configuration patterns. It can be used to
|
|
22
|
+
* return a configuration object directly, or to compute it asynchronously (e.g., by reading files or environment variables).
|
|
23
|
+
*
|
|
24
|
+
* @example <caption>Static configuration with package names</caption>
|
|
25
|
+
* ```ts
|
|
26
|
+
* export default defineFusionCli(() => ({
|
|
27
|
+
* plugins: ['@equinor/fusion-framework-cli-plugin-ai'],
|
|
28
|
+
* }));
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example <caption>Static configuration with direct imports</caption>
|
|
32
|
+
* ```ts
|
|
33
|
+
* import aiPlugin from '@equinor/fusion-framework-cli-plugin-ai';
|
|
34
|
+
*
|
|
35
|
+
* export default defineFusionCli(() => ({
|
|
36
|
+
* plugins: [aiPlugin],
|
|
37
|
+
* }));
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example <caption>Dynamic configuration</caption>
|
|
41
|
+
* ```ts
|
|
42
|
+
* export default defineFusionCli((env) => {
|
|
43
|
+
* const plugins = ['@equinor/fusion-framework-cli-plugin-ai'];
|
|
44
|
+
* if (process.env.ENABLE_EXPERIMENTAL_PLUGINS === 'true') {
|
|
45
|
+
* plugins.push('@equinor/fusion-framework-cli-plugin-experimental');
|
|
46
|
+
* }
|
|
47
|
+
* return { plugins };
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export type FusionCliConfigFn = (env?: {
|
|
52
|
+
root?: string;
|
|
53
|
+
}) => FusionCliConfig | Promise<FusionCliConfig | void> | void;
|
|
54
|
+
/**
|
|
55
|
+
* Represents the configuration export for Fusion CLI plugins.
|
|
56
|
+
*
|
|
57
|
+
* This can either be a static configuration object (`FusionCliConfig`) or a function (`FusionCliConfigFn`)
|
|
58
|
+
* that returns the configuration dynamically.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* - Enables flexible config authoring for different deployment scenarios
|
|
62
|
+
* - Supports both object and function-based configuration
|
|
63
|
+
*/
|
|
64
|
+
export type FusionCliConfigExport = FusionCliConfig | FusionCliConfigFn;
|
|
65
|
+
/**
|
|
66
|
+
* Utility to define a Fusion CLI configuration function with proper typing.
|
|
67
|
+
*
|
|
68
|
+
* @param fn - A function that returns the Fusion CLI configuration object (either synchronously or asynchronously)
|
|
69
|
+
* @returns The provided configuration function, unchanged
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* This utility is used to provide type safety and tooling support for Fusion CLI configuration authoring.
|
|
73
|
+
* It is a no-op at runtime, but helps with code completion and documentation for consumers.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* import { defineFusionCli } from '@equinor/fusion-framework-cli';
|
|
78
|
+
*
|
|
79
|
+
* export default defineFusionCli(() => ({
|
|
80
|
+
* plugins: ['@equinor/fusion-framework-cli-plugin-ai'],
|
|
81
|
+
* }));
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare const defineFusionCli: (fn: FusionCliConfigFn) => FusionCliConfigFn;
|
|
@@ -2,4 +2,5 @@ export type { RuntimeEnv } from './types.js';
|
|
|
2
2
|
export { resolvePackage, type ResolvedPackage } from './utils/resolve-package.js';
|
|
3
3
|
export { resolveEntryPoint } from './utils/resolve-source-entry-point.js';
|
|
4
4
|
export { loadDevServerConfig, defineDevServerConfig, type DevServerConfigExport, type DevServerConfigFn, } from './load-dev-server-config.js';
|
|
5
|
+
export { defineFusionCli, type FusionCliConfig, type FusionCliConfigFn, type FusionCliConfigExport, } from './fusion-cli-config.js';
|
|
5
6
|
export { defineAppConfig, defineAppManifest } from './legacy.js';
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "13.0.
|
|
1
|
+
export declare const version = "13.0.1";
|
package/docs/ai-commands.md
CHANGED
|
@@ -84,30 +84,34 @@ For GitHub Actions workflows, configure:
|
|
|
84
84
|
For the `embeddings` command, you can create a `fusion-ai.config.ts` file in your project root:
|
|
85
85
|
|
|
86
86
|
```typescript
|
|
87
|
-
import { configureFusionAI
|
|
87
|
+
import { configureFusionAI } from '@equinor/fusion-framework-cli-plugin-ai-index';
|
|
88
|
+
import type { FusionAIConfigWithIndex } from '@equinor/fusion-framework-cli-plugin-ai-index';
|
|
88
89
|
|
|
89
|
-
export default configureFusionAI(():
|
|
90
|
+
export default configureFusionAI((): FusionAIConfigWithIndex => {
|
|
90
91
|
return {
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
//
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
92
|
+
// Index-specific configuration
|
|
93
|
+
index: {
|
|
94
|
+
// File patterns to match for processing
|
|
95
|
+
patterns: [
|
|
96
|
+
'packages/**/src/**/*.{ts,tsx}',
|
|
97
|
+
'packages/**/docs/**/*.md',
|
|
98
|
+
'packages/**/README.md',
|
|
99
|
+
],
|
|
100
|
+
// Embedding generation configuration
|
|
101
|
+
embedding: {
|
|
102
|
+
// Size of text chunks for embedding
|
|
103
|
+
chunkSize: 1000,
|
|
104
|
+
// Overlap between chunks to maintain context
|
|
105
|
+
chunkOverlap: 200,
|
|
106
|
+
},
|
|
107
|
+
// Metadata processing configuration
|
|
108
|
+
metadata: {
|
|
109
|
+
// Optional: Custom metadata processor
|
|
110
|
+
// attributeProcessor: (metadata, document) => {
|
|
111
|
+
// // Transform or filter metadata attributes
|
|
112
|
+
// return metadata;
|
|
113
|
+
// },
|
|
114
|
+
},
|
|
111
115
|
},
|
|
112
116
|
};
|
|
113
117
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -59,10 +59,6 @@
|
|
|
59
59
|
"types": "./dist/types/lib/utils/index.d.ts",
|
|
60
60
|
"import": "./dist/esm/lib/utils/index.js"
|
|
61
61
|
},
|
|
62
|
-
"./ai": {
|
|
63
|
-
"types": "./dist/types/lib/ai/index.d.ts",
|
|
64
|
-
"import": "./dist/esm/lib/ai/index.js"
|
|
65
|
-
},
|
|
66
62
|
"./package.json": "./package.json",
|
|
67
63
|
"./README.md": "./README.md",
|
|
68
64
|
"./CHANGELOG.md": "./CHANGELOG.md"
|
|
@@ -89,9 +85,6 @@
|
|
|
89
85
|
],
|
|
90
86
|
"utils": [
|
|
91
87
|
"dist/types/lib/utils/index.d.ts"
|
|
92
|
-
],
|
|
93
|
-
"ai": [
|
|
94
|
-
"dist/types/lib/ai/index.d.ts"
|
|
95
88
|
]
|
|
96
89
|
}
|
|
97
90
|
},
|
|
@@ -101,37 +94,25 @@
|
|
|
101
94
|
"directory": "packages/cli"
|
|
102
95
|
},
|
|
103
96
|
"dependencies": {
|
|
104
|
-
"@langchain/core": "^1.0.1",
|
|
105
|
-
"@langchain/textsplitters": "^1.0.0",
|
|
106
|
-
"@types/find-up": "^4.0.2",
|
|
107
97
|
"@types/inquirer": "^9.0.9",
|
|
108
98
|
"commander": "^14.0.1",
|
|
109
99
|
"deepmerge": "^4.3.1",
|
|
110
|
-
"dotenv": "^17.2.
|
|
100
|
+
"dotenv": "^17.2.3",
|
|
111
101
|
"execa": "^9.6.0",
|
|
112
102
|
"find-up": "^8.0.0",
|
|
113
|
-
"
|
|
114
|
-
"globby": "^15.0.0",
|
|
115
|
-
"gray-matter": "^4.0.3",
|
|
116
|
-
"inquirer": "^12.9.6",
|
|
103
|
+
"inquirer": "^13.0.1",
|
|
117
104
|
"is-mergeable-object": "^1.1.1",
|
|
118
105
|
"is-path-inside": "^4.0.0",
|
|
119
|
-
"multimatch": "^7.0.0",
|
|
120
106
|
"ora": "^9.0.0",
|
|
121
|
-
"package-up": "^5.0.0",
|
|
122
107
|
"read-package-up": "^11.0.0",
|
|
123
108
|
"simple-git": "^3.28.0",
|
|
124
109
|
"vite": "^7.1.12",
|
|
125
|
-
"tree-sitter": "^0.25.0",
|
|
126
|
-
"tree-sitter-typescript": "^0.23.2",
|
|
127
|
-
"ts-morph": "^27.0.2",
|
|
128
|
-
"tsx": "^4.19.3",
|
|
129
110
|
"vite-tsconfig-paths": "^5.1.4",
|
|
130
111
|
"zod": "^4.1.8",
|
|
131
|
-
"@equinor/fusion-framework-dev-portal": "1.
|
|
132
|
-
"@equinor/fusion-framework-
|
|
133
|
-
"@equinor/fusion-framework-
|
|
134
|
-
"@equinor/fusion-imports": "1.1.
|
|
112
|
+
"@equinor/fusion-framework-dev-portal": "1.3.0",
|
|
113
|
+
"@equinor/fusion-framework-module-msal-node": "2.0.2",
|
|
114
|
+
"@equinor/fusion-framework-dev-server": "1.1.18",
|
|
115
|
+
"@equinor/fusion-imports": "1.1.8"
|
|
135
116
|
},
|
|
136
117
|
"devDependencies": {
|
|
137
118
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -150,15 +131,18 @@
|
|
|
150
131
|
"pretty-bytes": "^7.0.0",
|
|
151
132
|
"rollup": "^4.50.2",
|
|
152
133
|
"rollup-plugin-terser": "^7.0.2",
|
|
153
|
-
"rxjs": "^7.8.
|
|
134
|
+
"rxjs": "^7.8.1",
|
|
154
135
|
"type-fest": "^5.0.0",
|
|
155
136
|
"typescript": "^5.8.2",
|
|
156
137
|
"vitest": "^3.2.4",
|
|
157
|
-
"@equinor/fusion-framework-
|
|
158
|
-
"@equinor/fusion-framework-
|
|
159
|
-
"@equinor/fusion-framework-
|
|
160
|
-
"@equinor/fusion-framework-
|
|
161
|
-
"@equinor/fusion-framework-module
|
|
138
|
+
"@equinor/fusion-framework-cli-plugin-ai-mcp": "1.0.1",
|
|
139
|
+
"@equinor/fusion-framework-cli-plugin-ai-search": "1.0.1",
|
|
140
|
+
"@equinor/fusion-framework-cli-plugin-ai-chat": "1.0.1",
|
|
141
|
+
"@equinor/fusion-framework-cli-plugin-ai-index": "1.0.1",
|
|
142
|
+
"@equinor/fusion-framework-module": "5.0.5",
|
|
143
|
+
"@equinor/fusion-framework-module-app": "7.2.1",
|
|
144
|
+
"@equinor/fusion-framework-module-http": "7.0.5",
|
|
145
|
+
"@equinor/fusion-framework-module-service-discovery": "9.0.4"
|
|
162
146
|
},
|
|
163
147
|
"peerDependenciesMeta": {
|
|
164
148
|
"typescript": {
|
|
@@ -167,7 +151,6 @@
|
|
|
167
151
|
},
|
|
168
152
|
"scripts": {
|
|
169
153
|
"prebuild": "tsc -b",
|
|
170
|
-
"dev:cli": "tsx src/cli/main.ts",
|
|
171
154
|
"build": "rollup -c rollup.config.js",
|
|
172
155
|
"build:clean": "rm -rf dist && rm -rf bin/build && rm -f tsconfig.tsbuildinfo && pnpm build",
|
|
173
156
|
"test": "vitest",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fusion-ai.js","sourceRoot":"","sources":["../../../../src/lib/ai/fusion-ai.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAkD,EAAE,EAAE,CAAC,EAAE,CAAC"}
|
package/dist/esm/lib/ai/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/ai/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command: `ai`
|
|
3
|
-
*
|
|
4
|
-
* Manage Large Language Model (ai) integrations and configurations.
|
|
5
|
-
*
|
|
6
|
-
* Features:
|
|
7
|
-
* - Interactive chat with AI models
|
|
8
|
-
* - Document embedding and chunking utilities
|
|
9
|
-
* - Vector store search for validating embeddings
|
|
10
|
-
* - Configure ai clients
|
|
11
|
-
* - Test model connections
|
|
12
|
-
* - Manage API keys and settings
|
|
13
|
-
*
|
|
14
|
-
* Usage:
|
|
15
|
-
* $ ffc ai <subcommand> [options]
|
|
16
|
-
*
|
|
17
|
-
* Subcommands:
|
|
18
|
-
* chat Interactive chat with AI models
|
|
19
|
-
* embeddings Document embedding utilities for ai processing
|
|
20
|
-
* search Search the vector store to validate embeddings
|
|
21
|
-
*
|
|
22
|
-
* Examples:
|
|
23
|
-
* $ ffc ai chat
|
|
24
|
-
* $ ffc ai chat --model gpt-4 --api-key sk-...
|
|
25
|
-
* $ ffc ai embeddings --dry-run ./src
|
|
26
|
-
* $ ffc ai embeddings --chunk-size 1000 ./docs/readme.md
|
|
27
|
-
* $ ffc ai search "how to use the framework"
|
|
28
|
-
*/
|
|
29
|
-
export declare const command: import("commander").Command;
|
|
30
|
-
export default command;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI command: `ai search`
|
|
3
|
-
*
|
|
4
|
-
* Search the vector store to validate embeddings and retrieve relevant documents.
|
|
5
|
-
*
|
|
6
|
-
* Features:
|
|
7
|
-
* - Semantic search using vector embeddings
|
|
8
|
-
* - Configurable result limits
|
|
9
|
-
* - Filter support for metadata-based filtering
|
|
10
|
-
* - JSON output option for programmatic use
|
|
11
|
-
* - Detailed result display with scores and metadata
|
|
12
|
-
*
|
|
13
|
-
* Usage:
|
|
14
|
-
* $ ffc ai search <query> [options]
|
|
15
|
-
*
|
|
16
|
-
* Options:
|
|
17
|
-
* --limit <number> Maximum number of results to return (default: 10)
|
|
18
|
-
* --filter <expression> OData filter expression for metadata filtering
|
|
19
|
-
* --json Output results as JSON
|
|
20
|
-
* --raw Output raw metadata without normalization
|
|
21
|
-
* --verbose Enable verbose output
|
|
22
|
-
* --openai-api-key <key> API key for Azure OpenAI
|
|
23
|
-
* --openai-api-version <version> API version (default: 2024-02-15-preview)
|
|
24
|
-
* --openai-instance <name> Azure OpenAI instance name
|
|
25
|
-
* --openai-embedding-deployment <name> Azure OpenAI embedding deployment name
|
|
26
|
-
* --azure-search-endpoint <url> Azure Search endpoint URL
|
|
27
|
-
* --azure-search-api-key <key> Azure Search API key
|
|
28
|
-
* --azure-search-index-name <name> Azure Search index name
|
|
29
|
-
*
|
|
30
|
-
* Environment Variables:
|
|
31
|
-
* AZURE_OPENAI_API_KEY API key for Azure OpenAI
|
|
32
|
-
* AZURE_OPENAI_API_VERSION API version
|
|
33
|
-
* AZURE_OPENAI_INSTANCE_NAME Instance name
|
|
34
|
-
* AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME Embedding deployment name
|
|
35
|
-
* AZURE_SEARCH_ENDPOINT Azure Search endpoint
|
|
36
|
-
* AZURE_SEARCH_API_KEY Azure Search API key
|
|
37
|
-
* AZURE_SEARCH_INDEX_NAME Azure Search index name
|
|
38
|
-
*
|
|
39
|
-
* Examples:
|
|
40
|
-
* $ ffc ai search "how to use the framework"
|
|
41
|
-
* $ ffc ai search "authentication" --limit 5
|
|
42
|
-
* $ ffc ai search "typescript" --filter "metadata/source eq 'src/index.ts'"
|
|
43
|
-
* $ ffc ai search "documentation" --json
|
|
44
|
-
* $ ffc ai search "documentation" --json --raw
|
|
45
|
-
* $ ffc ai search "API reference" --verbose
|
|
46
|
-
*/
|
|
47
|
-
export declare const command: import("commander").Command;
|
|
48
|
-
export default command;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a unique identifier for a document chunk based on file path
|
|
3
|
-
* Creates a deterministic, URL-safe hash from the file path for validation and checks
|
|
4
|
-
* @param filePath - The file path to generate an ID from
|
|
5
|
-
* @param chunkIndex - Optional chunk index to append for multi-chunk documents
|
|
6
|
-
* @returns A base64-encoded hash of the file path, optionally suffixed with chunk index
|
|
7
|
-
*/
|
|
8
|
-
export declare const generateChunkId: (filePath: string, chunkIndex?: number) => string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ChangedFile, GitDiffOptions } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get list of changed files using git diff with status
|
|
4
|
-
* @param options - Git diff configuration options
|
|
5
|
-
* @returns Array of changed files with their status
|
|
6
|
-
*/
|
|
7
|
-
export declare const getChangedFiles: (options: GitDiffOptions) => Promise<ChangedFile[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Determine the git status of a file, including handling renames
|
|
10
|
-
* Returns an array of ChangedFile objects - if the file was renamed, returns both old and new paths
|
|
11
|
-
* @param filePath - Absolute file path to check
|
|
12
|
-
* @returns Promise resolving to array of changed files (1 or 2 items if renamed)
|
|
13
|
-
*/
|
|
14
|
-
export declare const getFileStatus: (filePath: string) => Promise<ChangedFile[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Check if a file path matches any of the changed files
|
|
17
|
-
* @param filePath - File path to check
|
|
18
|
-
* @param changedFiles - Array of changed file objects
|
|
19
|
-
* @returns True if file has changed
|
|
20
|
-
*/
|
|
21
|
-
export declare const isFileChanged: (filePath: string, changedFiles: ChangedFile[]) => boolean;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type SimpleGit } from 'simple-git';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve the project root (git repository root) for a given file path
|
|
4
|
-
* @param filePath - File path to resolve from
|
|
5
|
-
* @returns Project root path or undefined if not in a git repository
|
|
6
|
-
*/
|
|
7
|
-
export declare const resolveProjectRoot: (filePath: string) => string | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* Get or create a SimpleGit instance for a given file path
|
|
10
|
-
* Uses caching to avoid creating multiple instances for the same repository
|
|
11
|
-
* @param filePath - File path to get git instance for
|
|
12
|
-
* @returns Git instance and repository path, or undefined if not in a git repository
|
|
13
|
-
*/
|
|
14
|
-
export declare const getGit: (filePath: string) => {
|
|
15
|
-
git: SimpleGit | undefined;
|
|
16
|
-
gitRepoPath: string;
|
|
17
|
-
} | undefined;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export type { GitMetadata, GitDiffOptions, FileChangeStatus, ChangedFile, } from './types.js';
|
|
2
|
-
export { resolveProjectRoot, getGit } from './git-client.js';
|
|
3
|
-
export { extractGitMetadata } from './metadata.js';
|
|
4
|
-
export { getChangedFiles, getFileStatus, isFileChanged } from './file-changes.js';
|
|
5
|
-
export { getGitStatus } from './status.js';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { GitMetadata } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Extract git metadata for a file
|
|
4
|
-
* @param filePath - Absolute file path
|
|
5
|
-
* @returns Git metadata or undefined if not in a git repository
|
|
6
|
-
*/
|
|
7
|
-
export declare const extractGitMetadata: (filePath: string) => Promise<GitMetadata | undefined>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get git status information for debugging
|
|
3
|
-
* @param cwd - Working directory
|
|
4
|
-
* @returns Git status information
|
|
5
|
-
*/
|
|
6
|
-
export declare const getGitStatus: (cwd?: string) => Promise<{
|
|
7
|
-
branch: string;
|
|
8
|
-
commit: string;
|
|
9
|
-
hasChanges: boolean;
|
|
10
|
-
stagedFiles: number;
|
|
11
|
-
unstagedFiles: number;
|
|
12
|
-
}>;
|