@equinor/fusion-framework-cli-plugin-ai-base 1.0.5 → 2.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @equinor/fusion-framework-cli-plugin-ai-base
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - abffa53: Major version bump for Fusion Framework React 19 release.
8
+
9
+ All packages are bumped to the next major version as part of the React 19 upgrade. This release drops support for React versions below 18 and includes breaking changes across the framework.
10
+
11
+ **Breaking changes:**
12
+ - Peer dependencies now require React 18 or 19 (`^18.0.0 || ^19.0.0`)
13
+ - React Router upgraded from v6 to v7
14
+ - Navigation module refactored with new history API
15
+ - `renderComponent` and `renderApp` now use `createRoot` API
16
+
17
+ **Migration:**
18
+ - Update your React version to 18.0.0 or higher before upgrading
19
+ - Replace `NavigationProvider.createRouter()` with `@equinor/fusion-framework-react-router`
20
+ - See individual package changelogs for package-specific migration steps
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [abffa53]
25
+ - Updated dependencies [abffa53]
26
+ - Updated dependencies [abffa53]
27
+ - Updated dependencies [ae92f13]
28
+ - Updated dependencies [abffa53]
29
+ - Updated dependencies [abffa53]
30
+ - Updated dependencies [abffa53]
31
+ - Updated dependencies [abffa53]
32
+ - Updated dependencies [c123c39]
33
+ - Updated dependencies [3de232c]
34
+ - Updated dependencies [32bcf83]
35
+ - @equinor/fusion-framework-cli@14.0.0
36
+ - @equinor/fusion-framework-module@6.0.0
37
+ - @equinor/fusion-framework-module-ai@3.0.0
38
+ - @equinor/fusion-imports@2.0.0
39
+
3
40
  ## 1.0.5
4
41
 
5
42
  ### Patch Changes
@@ -56,7 +93,6 @@
56
93
  This package provides shared utilities and options used across multiple AI CLI plugins including framework setup, AI configuration, and command option handling.
57
94
 
58
95
  **Features:**
59
-
60
96
  - Shared AI options and configuration schema
61
97
  - Framework setup utilities
62
98
  - Common command option handling
package/README.md CHANGED
@@ -1,30 +1,27 @@
1
- # AI Base Plugin Package
1
+ # @equinor/fusion-framework-cli-plugin-ai-base
2
2
 
3
- > [!DANGER]
4
- > **⚠️ INTERNAL USE ONLY**
5
- > This package provides shared utilities and options for AI CLI plugins within Equinor's Fusion Framework ecosystem. External consumers should use the higher-level AI CLI plugins instead.
3
+ > [!CAUTION]
4
+ > **Internal base package** — not intended for direct consumption.
5
+ > Use the higher-level AI CLI plugins (`ai-chat`, `ai-index`) instead.
6
6
 
7
- ## Purpose
7
+ Shared utilities, option definitions, and framework bootstrapping for the
8
+ Fusion Framework AI CLI plugins. Every AI sub-command in the Fusion CLI
9
+ inherits its Commander options, Zod validation, and framework initialisation
10
+ logic from this package.
8
11
 
9
- Provides common functionality for AI CLI plugins to avoid code duplication:
10
- - Shared AI command options (model, temperature, tokens, etc.)
11
- - Fusion Framework setup with AI module configuration
12
- - Configuration file loading and validation
13
- - Type definitions for AI options and configuration
12
+ ## Who should use this
14
13
 
15
- Used by:
16
- - `@equinor/fusion-framework-cli-plugin-ai-chat`
17
- - `@equinor/fusion-framework-cli-plugin-ai-search`
18
- - `@equinor/fusion-framework-cli-plugin-ai-index`
19
-
20
- Changes here affect all consuming plugins, so coordinate updates carefully.
14
+ Authors of **new Fusion CLI AI plugins** that need the same Azure OpenAI /
15
+ Azure Cognitive Search options and framework setup that the existing plugins
16
+ share. If you are building a Fusion application, use the published CLI
17
+ plugins directly.
21
18
 
22
- ## Usage in Consuming Plugins
19
+ ## Quick start
23
20
 
24
- ### Install as Dependency
21
+ ### 1. Add the dependency
25
22
 
26
- **For monorepo packages:**
27
- ```json
23
+ ```jsonc
24
+ // package.json (monorepo)
28
25
  {
29
26
  "dependencies": {
30
27
  "@equinor/fusion-framework-cli-plugin-ai-base": "workspace:*"
@@ -32,45 +29,138 @@ Changes here affect all consuming plugins, so coordinate updates carefully.
32
29
  }
33
30
  ```
34
31
 
35
- ### Import from Base Package
32
+ ### 2. Create a sub-command with AI options
33
+
34
+ ```ts
35
+ import { createCommand } from 'commander';
36
+ import {
37
+ withOptions,
38
+ type AiOptions,
39
+ } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
40
+ import {
41
+ registerAiPlugin,
42
+ setupFramework,
43
+ } from '@equinor/fusion-framework-cli-plugin-ai-base';
44
+
45
+ const myCommand = createCommand('my-task')
46
+ .description('Run my custom AI task');
36
47
 
37
- ```typescript
38
- // Import AI options from command-options export
39
- import { withOptions, type AiOptions, AiOptionsSchema } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
48
+ // Attach core + chat + embedding options and pre-action validation
49
+ withOptions(myCommand, { includeChat: true, includeEmbedding: true });
40
50
 
41
- // Import framework utilities from main export
42
- import { setupFramework, registerAiPlugin, loadFusionAIConfig } from '@equinor/fusion-framework-cli-plugin-ai-base';
51
+ myCommand.action(async (options: AiOptions) => {
52
+ const framework = await setupFramework(options);
53
+ // use framework.ai …
54
+ });
43
55
 
44
- // Or import everything from main export
45
- import {
46
- setupFramework,
47
- registerAiPlugin,
56
+ // Register under `fusion-cli ai my-task`
57
+ export const register = (program: Command) =>
58
+ registerAiPlugin(program, myCommand);
59
+ ```
60
+
61
+ ### 3. Load a configuration file (optional)
62
+
63
+ ```ts
64
+ import {
48
65
  loadFusionAIConfig,
49
- type FrameworkInstance,
50
- type FusionAIConfig
66
+ configureFusionAI,
51
67
  } from '@equinor/fusion-framework-cli-plugin-ai-base';
68
+
69
+ // fusion-ai.config.ts
70
+ export default configureFusionAI(async () => ({
71
+ apiKey: process.env.OPENAI_API_KEY,
72
+ deployment: 'gpt-4',
73
+ }));
74
+
75
+ // at runtime
76
+ const config = await loadFusionAIConfig('fusion-ai.config', {
77
+ baseDir: process.cwd(),
78
+ });
52
79
  ```
53
80
 
54
- ## Exports
55
-
56
- - `./command-options` - AI command options, validation schemas, and option helpers
57
- - `withOptions` - Function to add AI options to a Commander command
58
- - `options` - Default export containing all option definitions
59
- - `AiOptionsSchema` - Zod schema for validating AI options
60
- - `AiOptionsType` - Type inferred from the schema
61
- - `AiOptions` - TypeScript interface for AI options
62
- - `.` - Main export containing:
63
- - `setupFramework` - Initialize and configure Fusion Framework with AI module
64
- - `registerAiPlugin` - Register AI plugin commands with CLI program
65
- - `loadFusionAIConfig` - Load Fusion AI configuration from file
66
- - `configureFusionAI` - Configuration factory function
67
- - `FrameworkInstance` - Type for initialized framework instance
68
- - `FusionAIConfig` - Base configuration interface
69
- - `LoadFusionAIConfigOptions` - Options for loading configuration
81
+ ## Export map
82
+
83
+ The package exposes two entry points:
84
+
85
+ | Entry point | Import path | Purpose |
86
+ |---|---|---|
87
+ | Main | `@equinor/fusion-framework-cli-plugin-ai-base` | Framework setup, plugin registration, config loading |
88
+ | Command options | `@equinor/fusion-framework-cli-plugin-ai-base/command-options` | Commander option definitions, Zod schema, types |
89
+
90
+ ### Main entry point (`.`)
91
+
92
+ | Export | Kind | Description |
93
+ |---|---|---|
94
+ | `setupFramework` | function | Initialise the Fusion Framework with Azure OpenAI chat, embedding, and vector-store modules |
95
+ | `registerAiPlugin` | function | Register a Commander sub-command under the shared `ai` command group |
96
+ | `loadFusionAIConfig` | function | Locate and import a `fusion-ai.config.{ts,mjs,js,json}` file |
97
+ | `configureFusionAI` | function | Type-safe factory for writing configuration files |
98
+ | `FrameworkInstance` | type | Initialised framework with the AI module |
99
+ | `FusionAIConfig` | interface | Base configuration shape (extend for custom fields) |
100
+ | `LoadFusionAIConfigOptions` | interface | Options for `loadFusionAIConfig` (base dir, extensions) |
101
+
102
+ ### Command options entry point (`./command-options`)
103
+
104
+ | Export | Kind | Description |
105
+ |---|---|---|
106
+ | `withOptions` | function | Attach AI options and pre-action validation to a Commander command |
107
+ | `options` | object | All Commander `Option` instances as a single record |
108
+ | `AiOptionsSchema` | Zod schema | Runtime validation for the AI options object |
109
+ | `AiOptionsType` | type | Inferred type from `AiOptionsSchema` |
110
+ | `AiOptions` | interface | Hand-authored TypeScript interface for the options |
111
+
112
+ ## Environment variables
113
+
114
+ Every CLI flag has an environment-variable fallback, so plugins work in CI
115
+ without explicit flags.
116
+
117
+ | Flag | Environment variable | Required | Default |
118
+ |---|---|---|---|
119
+ | `--openai-api-key` | `AZURE_OPENAI_API_KEY` | Yes | — |
120
+ | `--openai-api-version` | `AZURE_OPENAI_API_VERSION` | Yes | `2024-02-15-preview` |
121
+ | `--openai-instance` | `AZURE_OPENAI_INSTANCE_NAME` | Yes | — |
122
+ | `--openai-chat-deployment` | `AZURE_OPENAI_CHAT_DEPLOYMENT_NAME` | When chat is enabled | — |
123
+ | `--openai-embedding-deployment` | `AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME` | When embedding is enabled | — |
124
+ | `--azure-search-endpoint` | `AZURE_SEARCH_ENDPOINT` | When search is enabled | — |
125
+ | `--azure-search-api-key` | `AZURE_SEARCH_API_KEY` | When search is enabled | — |
126
+ | `--azure-search-index-name` | `AZURE_SEARCH_INDEX_NAME` | When search is enabled | — |
127
+
128
+ ## Key concepts
129
+
130
+ ### Selective option inclusion
131
+
132
+ `withOptions` accepts an `args` object with three boolean flags — `includeChat`,
133
+ `includeEmbedding`, and `includeSearch` — that control which options (and which
134
+ pre-action validation rules) are attached. Only include what your command needs.
135
+
136
+ ### Pre-action validation
137
+
138
+ `withOptions` registers a Commander `preAction` hook that validates required
139
+ options before the action handler runs. If a required option is missing or
140
+ empty the hook throws `InvalidOptionArgumentError` with a descriptive message
141
+ that includes the corresponding environment variable name.
142
+
143
+ ### Framework bootstrap
144
+
145
+ `setupFramework` creates a `ModulesConfigurator`, enables the AI module, and
146
+ conditionally registers chat models, embedding models, and an Azure Cognitive
147
+ Search vector store based on which options are present. The returned
148
+ `FrameworkInstance` is ready for downstream use.
149
+
150
+ ## Consuming plugins
151
+
152
+ Changes to this package affect every AI CLI plugin:
153
+
154
+ - `@equinor/fusion-framework-cli-plugin-ai-chat`
155
+ - `@equinor/fusion-framework-cli-plugin-ai-index`
156
+
157
+ Coordinate updates carefully and create changesets for any consumer-visible
158
+ change.
70
159
 
71
160
  ## Development
72
161
 
73
- - Build: `pnpm build` (type checking only, no bundling needed)
74
- - Changesets should be created for versioning and changelog tracking
75
- - Breaking changes affect all consuming plugins, so coordinate updates carefully
162
+ ```sh
163
+ pnpm build # type-check (no bundling)
164
+ pnpm test # run Vitest suite
165
+ ```
76
166
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAcvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAA2B,EAAwB,EAAE,EAAE,CAAC,EAAE,CAAC;AAY5F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,aAAqB,kBAAkB,EACvC,UAAqC,EAAE;IAEvC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAExD,gFAAgF;IAChF,MAAM,MAAM,GAAG,MAAM,YAAY,CAAuB,UAAU,EAAE;QAClE,OAAO;QACP,UAAU;KACX,CAAC,CAAC;IAEH,mEAAmE;IACnE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO,MAAM,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,sEAAsE;IACtE,OAAO,QAAa,CAAC;AACvB,CAAC;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAcvD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAA2B,EAAwB,EAAE,EAAE,CAAC,EAAE,CAAC;AAqB5F;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,aAAqB,kBAAkB,EACvC,UAAqC,EAAE;IAEvC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAExD,gFAAgF;IAChF,MAAM,MAAM,GAAG,MAAM,YAAY,CAAuB,UAAU,EAAE;QAClE,OAAO;QACP,UAAU;KACX,CAAC,CAAC;IAEH,mEAAmE;IACnE,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/B,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO,MAAM,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,sEAAsE;IACtE,OAAO,QAAa,CAAC;AACvB,CAAC;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,3 +1,14 @@
1
+ /**
2
+ * AI command-option utilities for Fusion Framework CLI plugins.
3
+ *
4
+ * @remarks
5
+ * This entry point provides Commander option definitions, a Zod validation schema,
6
+ * and the {@link withOptions} helper that wires options and pre-action validation
7
+ * into any Commander command. Import from
8
+ * `@equinor/fusion-framework-cli-plugin-ai-base/command-options`.
9
+ *
10
+ * @packageDocumentation
11
+ */
1
12
  export { default as options } from './options.js';
2
13
  export { withOptions } from './with-options.js';
3
14
  export { AiOptionsSchema } from './schema.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/options/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAsB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/options/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAsB,MAAM,aAAa,CAAC"}
@@ -1,51 +1,81 @@
1
1
  import { createOption } from 'commander';
2
2
  /**
3
- * Option for specifying the Azure OpenAI API key.
4
- * Required for authentication with Azure OpenAI services.
3
+ * Commander option for the Azure OpenAI API key (`--openai-api-key`).
4
+ *
5
+ * @remarks
6
+ * Required for all Azure OpenAI operations. Falls back to the
7
+ * `AZURE_OPENAI_API_KEY` environment variable when the flag is omitted.
5
8
  */
6
9
  export const apiKeyOption = createOption('--openai-api-key <key>', 'API key for Azure OpenAI services').env('AZURE_OPENAI_API_KEY');
7
10
  /**
8
- * Option for specifying the Azure OpenAI API version.
9
- * Defaults to the latest stable version if not provided.
11
+ * Commander option for the Azure OpenAI API version (`--openai-api-version`).
12
+ *
13
+ * @remarks
14
+ * Defaults to `2024-02-15-preview`. Falls back to the
15
+ * `AZURE_OPENAI_API_VERSION` environment variable when the flag is omitted.
10
16
  */
11
17
  export const apiVersionOption = createOption('--openai-api-version <version>', 'Azure OpenAI API version')
12
18
  .env('AZURE_OPENAI_API_VERSION')
13
19
  .default('2024-02-15-preview');
14
20
  /**
15
- * Option for specifying the Azure OpenAI instance name.
16
- * Required for Azure OpenAI service endpoint construction.
21
+ * Commander option for the Azure OpenAI instance name (`--openai-instance`).
22
+ *
23
+ * @remarks
24
+ * Required for constructing the Azure OpenAI service endpoint. Falls back to
25
+ * the `AZURE_OPENAI_INSTANCE_NAME` environment variable when the flag is omitted.
17
26
  */
18
27
  export const apiInstanceOption = createOption('--openai-instance <name>', 'Azure OpenAI instance name').env('AZURE_OPENAI_INSTANCE_NAME');
19
28
  /**
20
- * Option for specifying the Azure OpenAI deployment name for chat models.
21
- * Required for chat completions API calls.
29
+ * Commander option for the Azure OpenAI chat deployment (`--openai-chat-deployment`).
30
+ *
31
+ * @remarks
32
+ * Required for chat-completion operations. Falls back to the
33
+ * `AZURE_OPENAI_CHAT_DEPLOYMENT_NAME` environment variable when the flag is omitted.
34
+ * Only added to a command when `withOptions` is called with `includeChat: true`.
22
35
  */
23
36
  export const chatDeploymentOption = createOption('--openai-chat-deployment <name>', 'Azure OpenAI chat deployment name').env('AZURE_OPENAI_CHAT_DEPLOYMENT_NAME');
24
37
  /**
25
- * Option for specifying the Azure OpenAI deployment name for embedding models.
26
- * Required for embeddings API calls.
38
+ * Commander option for the Azure OpenAI embedding deployment (`--openai-embedding-deployment`).
39
+ *
40
+ * @remarks
41
+ * Required for embedding and vector-search operations. Falls back to the
42
+ * `AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME` environment variable when the flag is omitted.
43
+ * Only added to a command when `withOptions` is called with `includeEmbedding: true`.
27
44
  */
28
45
  export const embeddingDeploymentOption = createOption('--openai-embedding-deployment <name>', 'Azure OpenAI embedding deployment name').env('AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME');
29
46
  /**
30
- * Option for specifying the Azure Search endpoint URL.
31
- * Required for Azure Cognitive Search operations.
47
+ * Commander option for the Azure Cognitive Search endpoint (`--azure-search-endpoint`).
48
+ *
49
+ * @remarks
50
+ * Required for vector-search operations. Falls back to the
51
+ * `AZURE_SEARCH_ENDPOINT` environment variable when the flag is omitted.
52
+ * Only added to a command when `withOptions` is called with `includeSearch: true`.
32
53
  */
33
54
  export const azureSearchEndpointOption = createOption('--azure-search-endpoint <url>', 'Azure Search endpoint URL').env('AZURE_SEARCH_ENDPOINT');
34
55
  /**
35
- * Option for specifying the Azure Search API key.
36
- * Required for authentication with Azure Cognitive Search.
56
+ * Commander option for the Azure Cognitive Search API key (`--azure-search-api-key`).
57
+ *
58
+ * @remarks
59
+ * Required for authenticating with Azure Cognitive Search. Falls back to the
60
+ * `AZURE_SEARCH_API_KEY` environment variable when the flag is omitted.
61
+ * Only added to a command when `withOptions` is called with `includeSearch: true`.
37
62
  */
38
63
  export const azureSearchApiKeyOption = createOption('--azure-search-api-key <key>', 'Azure Search API key').env('AZURE_SEARCH_API_KEY');
39
64
  /**
40
- * Option for specifying the Azure Search index name.
41
- * Required for search operations on a specific index.
65
+ * Commander option for the Azure Cognitive Search index name (`--azure-search-index-name`).
66
+ *
67
+ * @remarks
68
+ * Identifies the target search index to query or write to. Falls back to the
69
+ * `AZURE_SEARCH_INDEX_NAME` environment variable when the flag is omitted.
70
+ * Only added to a command when `withOptions` is called with `includeSearch: true`.
42
71
  */
43
72
  export const azureSearchIndexNameOption = createOption('--azure-search-index-name <name>', 'Azure Search index name').env('AZURE_SEARCH_INDEX_NAME');
44
73
  /**
45
- * Default export containing all AI-related command options.
74
+ * All AI-related Commander option definitions as a single object.
46
75
  *
47
- * Provides convenient access to all option definitions for use in CLI commands.
48
- * Each option can also be imported individually for more granular control.
76
+ * @remarks
77
+ * Use this default export for convenient bulk access when you need every option.
78
+ * For selective inclusion prefer importing the named constants directly.
49
79
  */
50
80
  export default {
51
81
  apiKeyOption,
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/options/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CACtC,wBAAwB,EACxB,mCAAmC,CACpC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAE9B;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAC1C,gCAAgC,EAChC,0BAA0B,CAC3B;KACE,GAAG,CAAC,0BAA0B,CAAC;KAC/B,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAC3C,0BAA0B,EAC1B,4BAA4B,CAC7B,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEpC;;;GAGG;AACH,MAAM,CAAC,MAAM,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M,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAC3C,0BAA0B,EAC1B,4BAA4B,CAC7B,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAC9C,iCAAiC,EACjC,mCAAmC,CACpC,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAE3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CACnD,sCAAsC,EACtC,wCAAwC,CACzC,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,YAAY,CACnD,+BAA+B,EAC/B,2BAA2B,CAC5B,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAE/B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,YAAY,CACjD,8BAA8B,EAC9B,sBAAsB,CACvB,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,YAAY,CACpD,kCAAkC,EAClC,yBAAyB,CAC1B,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;AAEjC;;;;;;GAMG;AACH,eAAe;IACb,YAAY;IACZ,gBAAgB;IAChB,iBAAiB;IACjB,oBAAoB;IACpB,yBAAyB;IACzB,yBAAyB;IACzB,uBAAuB;IACvB,0BAA0B;CAC3B,CAAC"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Zod validation schema and inferred type for AI command options.
3
+ *
4
+ * @packageDocumentation
5
+ */
1
6
  import z from 'zod';
2
7
  /**
3
8
  * Base Zod schema for AI-related command options.
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/options/schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB;;;;;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AG,CAAC,CAAC,EAAE,mDAAmD,CAAC;SAC3D,QAAQ,EAAE;SACV,QAAQ,CAAC,2BAA2B,CAAC;IACxC,iBAAiB,EAAE,CAAC;SACjB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,kDAAkD,CAAC;SAC1D,QAAQ,EAAE;SACV,QAAQ,CAAC,sBAAsB,CAAC;IACnC,oBAAoB,EAAE,CAAC;SACpB,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,EAAE,qDAAqD,CAAC;SAC7D,QAAQ,EAAE;SACV,QAAQ,CAAC,yBAAyB,CAAC;CACvC,CAAC;KACD,QAAQ,CAAC,iCAAiC,CAAC,CAAC"}
@@ -1,2 +1,11 @@
1
+ /**
2
+ * Hand-authored TypeScript interface for AI CLI command options.
3
+ *
4
+ * @remarks
5
+ * Use {@link AiOptions} when you need a lightweight type without pulling in Zod.
6
+ * For runtime validation prefer {@link AiOptionsSchema} from the schema module.
7
+ *
8
+ * @packageDocumentation
9
+ */
1
10
  export {};
2
11
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/options/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/options/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -55,7 +55,7 @@ export const withOptions = (command, args) => {
55
55
  if (!options.openaiApiKey ||
56
56
  typeof options.openaiApiKey !== 'string' ||
57
57
  options.openaiApiKey.trim() === '') {
58
- throw new InvalidOptionArgumentError('API key is required and must be a non-empty string.');
58
+ throw new InvalidOptionArgumentError('Azure OpenAI API key is required. Provide it via --openai-api-key option or AZURE_OPENAI_API_KEY environment variable.');
59
59
  }
60
60
  // Validate API version
61
61
  if (!options.openaiApiVersion || typeof options.openaiApiVersion !== 'string') {
@@ -65,7 +65,7 @@ export const withOptions = (command, args) => {
65
65
  if (!options.openaiInstance ||
66
66
  typeof options.openaiInstance !== 'string' ||
67
67
  options.openaiInstance.trim() === '') {
68
- throw new InvalidOptionArgumentError('API instance name is required and must be a non-empty string.');
68
+ throw new InvalidOptionArgumentError('Azure OpenAI instance name is required. Provide it via --openai-instance option or AZURE_OPENAI_INSTANCE_NAME environment variable.');
69
69
  }
70
70
  if (args?.includeChat === true) {
71
71
  if (!options.openaiChatDeployment ||
@@ -78,7 +78,7 @@ export const withOptions = (command, args) => {
78
78
  if (!options.openaiEmbeddingDeployment ||
79
79
  typeof options.openaiEmbeddingDeployment !== 'string' ||
80
80
  options.openaiEmbeddingDeployment.trim() === '') {
81
- throw new InvalidOptionArgumentError('Embedding deployment name is required and must be a non-empty string.');
81
+ throw new InvalidOptionArgumentError('Azure OpenAI embedding deployment name is required. Provide it via --openai-embedding-deployment option or AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME environment variable.');
82
82
  }
83
83
  }
84
84
  if (args?.includeSearch === true) {
@@ -90,7 +90,7 @@ export const withOptions = (command, args) => {
90
90
  if (!options.azureSearchApiKey ||
91
91
  typeof options.azureSearchApiKey !== 'string' ||
92
92
  options.azureSearchApiKey.trim() === '') {
93
- throw new InvalidOptionArgumentError('Azure Search API key is required and must be a non-empty string.');
93
+ throw new InvalidOptionArgumentError('Azure Search API key is required. Provide it via --azure-search-api-key option or AZURE_SEARCH_API_KEY environment variable.');
94
94
  }
95
95
  if (!options.azureSearchIndexName ||
96
96
  typeof options.azureSearchIndexName !== 'string' ||
@@ -1 +1 @@
1
- {"version":3,"file":"with-options.js","sourceRoot":"","sources":["../../../src/options/with-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAC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,EACvC,CAAC;gBACD,MAAM,IAAI,0BAA0B,CAClC,kEAAkE,CACnE,CAAC;YACJ,CAAC;YAED,IACE,CAAC,OAAO,CAAC,oBAAoB;gBAC7B,OAAO,OAAO,CAAC,oBAAoB,KAAK,QAAQ;gBAChD,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,KAAK,EAAE,EAC1C,CAAC;gBACD,MAAM,IAAI,0BAA0B,CAClC,qEAAqE,CACtE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"with-options.js","sourceRoot":"","sources":["../../../src/options/with-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,cAAc,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,OAAgB,EAChB,IAIE,EACO,EAAE;IACX,8BAA8B;IAC9B,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAChC,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IACpC,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IAErC,qBAAqB;IACrB,IAAI,IAAI,EAAE,WAAW,KAAK,IAAI,EAAE,CAAC;QAC/B,OAAO,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED,IAAI,IAAI,EAAE,gBAAgB,KAAK,IAAI,EAAE,CAAC;QACpC,OAAO,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,uBAAuB;IACvB,IAA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J,CAAC;QACH,CAAC;QAED,IAAI,IAAI,EAAE,gBAAgB,KAAK,IAAI,EAAE,CAAC;YACpC,IACE,CAAC,OAAO,CAAC,yBAAyB;gBAClC,OAAO,OAAO,CAAC,yBAAyB,KAAK,QAAQ;gBACrD,OAAO,CAAC,yBAAyB,CAAC,IAAI,EAAE,KAAK,EAAE,EAC/C,CAAC;gBACD,MAAM,IAAI,0BAA0B,CAClC,yKAAyK,CAC1K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,IAAI,IAAI,EAAE,aAAa,KAAK,IAAI,EAAE,CAAC;YACjC,IACE,CAAC,OAAO,CAAC,mBAAmB;gBAC5B,OAAO,OAAO,CAAC,mBAAmB,KAAK,QAAQ;gBAC/C,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,EACzC,CAAC;gBACD,MAAM,IAAI,0BAA0B,CAClC,mEAAmE,CACpE,CAAC;YACJ,CAAC;YAED,IACE,CAAC,OAAO,CAAC,iBAAiB;gBAC1B,OAAO,OAAO,CAAC,iBAAiB,KAAK,QAAQ;gBAC7C,OAAO,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,EACvC,CAAC;gBACD,MAAM,IAAI,0BAA0B,CAClC,8HAA8H,CAC/H,CAAC;YACJ,CAAC;YAED,IACE,CAAC,OAAO,CAAC,oBAAoB;gBAC7B,OAAO,OAAO,CAAC,oBAAoB,KAAK,QAAQ;gBAChD,OAAO,CAAC,oBAAoB,CAAC,IAAI,EAAE,KAAK,EAAE,EAC1C,CAAC;gBACD,MAAM,IAAI,0BAA0B,CAClC,qEAAqE,CACtE,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -2,23 +2,22 @@ import { createCommand } from 'commander';
2
2
  /**
3
3
  * Registers an AI plugin command with the CLI program.
4
4
  *
5
- * This function ensures the 'ai' command group exists in the CLI program and adds
6
- * the provided command as a subcommand. If the 'ai' group doesn't exist, it creates
7
- * it with a standard description. This allows multiple AI-related plugins to register
8
- * their commands under a common namespace.
5
+ * Ensures the `ai` command group exists and attaches the provided command
6
+ * as a direct subcommand. Each plugin is responsible for structuring its
7
+ * own subcommands internally.
9
8
  *
10
- * @param program - The Commander program instance to register commands with
11
- * @param command - The command to add to the 'ai' command group
12
- * @returns void
9
+ * @param program - The Commander program instance to register commands with.
10
+ * @param command - The command to add under the `ai` command group.
13
11
  *
14
12
  * @example
15
13
  * ```ts
16
- * const myAiCommand = createCommand('chat')
17
- * .description('Start an AI chat session')
18
- * .action(() => { ... });
14
+ * // Register a command under `ai`:
15
+ * registerAiPlugin(program, chatCommand);
16
+ * // Results in: ffc ai chat
19
17
  *
20
- * registerAiPlugin(program, myAiCommand);
21
- * // Results in: fusion-cli ai chat
18
+ * // Register a command that has its own subcommands:
19
+ * registerAiPlugin(program, indexCommand);
20
+ * // Results in: ffc ai index embeddings, ffc ai index delete, etc.
22
21
  * ```
23
22
  */
24
23
  export function registerAiPlugin(program, command) {
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB,EAAE,OAAgB;IACjE,gDAAgD;IAChD,IAAI,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,WAAW,CACzC,mEAAmE,CACpE,CAAC;QACF,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IACD,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB,EAAE,OAAgB;IACjE,gDAAgD;IAChD,IAAI,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,WAAW,CACzC,mEAAmE,CACpE,CAAC;QACF,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '1.0.5';
2
+ export const version = '2.0.0';
3
3
  //# sourceMappingURL=version.js.map