@equinor/fusion-framework-cli-plugin-ai-base 1.0.4 → 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 +49 -1
- package/README.md +141 -51
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/options/index.js +11 -0
- package/dist/esm/options/index.js.map +1 -1
- package/dist/esm/options/options.js +49 -19
- package/dist/esm/options/options.js.map +1 -1
- package/dist/esm/options/schema.js +5 -0
- package/dist/esm/options/schema.js.map +1 -1
- package/dist/esm/options/types.js +9 -0
- package/dist/esm/options/types.js.map +1 -1
- package/dist/esm/options/with-options.js +4 -4
- package/dist/esm/options/with-options.js.map +1 -1
- package/dist/esm/register.js +11 -12
- package/dist/esm/register.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +12 -3
- package/dist/types/options/index.d.ts +11 -0
- package/dist/types/options/options.d.ts +49 -19
- package/dist/types/options/schema.d.ts +5 -0
- package/dist/types/options/types.d.ts +9 -0
- package/dist/types/register.d.ts +11 -12
- package/dist/types/version.d.ts +1 -1
- package/package.json +9 -8
- package/src/config.ts +12 -3
- package/src/options/index.ts +12 -0
- package/src/options/options.ts +49 -19
- package/src/options/schema.ts +6 -0
- package/src/options/types.ts +10 -0
- package/src/options/with-options.ts +6 -4
- package/src/register.ts +12 -12
- package/src/version.ts +1 -1
- package/tsconfig.json +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
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
|
+
|
|
40
|
+
## 1.0.5
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [#4157](https://github.com/equinor/fusion-framework/pull/4157) [`6aa8e1f`](https://github.com/equinor/fusion-framework/commit/6aa8e1f5c9d852b25e97aa7d98a63008c64d4581) Thanks [@Noggling](https://github.com/Noggling)! - Internal: patch release to align TypeScript types across packages for consistent type compatibility.
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [[`0a3a23c`](https://github.com/equinor/fusion-framework/commit/0a3a23c230778d64c23fa3008d59d80908d44f45), [`5cc81f5`](https://github.com/equinor/fusion-framework/commit/5cc81f58ad159f9308b1fe028f04629c407dac37), [`9d4d520`](https://github.com/equinor/fusion-framework/commit/9d4d520e9d3c3a3c4ef68a96952fbbc6f6d34720), [`40328c3`](https://github.com/equinor/fusion-framework/commit/40328c3a1489ad29c7bbc03fa283e1daa9a9ee2e), [`0dc5e05`](https://github.com/equinor/fusion-framework/commit/0dc5e058d4adb28ee72a1aac6dbdbc4da84741e9), [`6aa8e1f`](https://github.com/equinor/fusion-framework/commit/6aa8e1f5c9d852b25e97aa7d98a63008c64d4581)]:
|
|
47
|
+
- @equinor/fusion-framework-cli@13.3.16
|
|
48
|
+
- @equinor/fusion-framework-module-ai@2.0.2
|
|
49
|
+
- @equinor/fusion-framework-module@5.0.6
|
|
50
|
+
- @equinor/fusion-imports@1.1.11
|
|
51
|
+
|
|
3
52
|
## 1.0.4
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
|
@@ -44,7 +93,6 @@
|
|
|
44
93
|
This package provides shared utilities and options used across multiple AI CLI plugins including framework setup, AI configuration, and command option handling.
|
|
45
94
|
|
|
46
95
|
**Features:**
|
|
47
|
-
|
|
48
96
|
- Shared AI options and configuration schema
|
|
49
97
|
- Framework setup utilities
|
|
50
98
|
- Common command option handling
|
package/README.md
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @equinor/fusion-framework-cli-plugin-ai-base
|
|
2
2
|
|
|
3
|
-
> [!
|
|
4
|
-
>
|
|
5
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
##
|
|
19
|
+
## Quick start
|
|
23
20
|
|
|
24
|
-
###
|
|
21
|
+
### 1. Add the dependency
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
38
|
-
|
|
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
|
-
|
|
42
|
-
|
|
51
|
+
myCommand.action(async (options: AiOptions) => {
|
|
52
|
+
const framework = await setupFramework(options);
|
|
53
|
+
// use framework.ai …
|
|
54
|
+
});
|
|
43
55
|
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
162
|
+
```sh
|
|
163
|
+
pnpm build # type-check (no bundling)
|
|
164
|
+
pnpm test # run Vitest suite
|
|
165
|
+
```
|
|
76
166
|
|
package/dist/esm/config.js.map
CHANGED
|
@@ -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;
|
|
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
|
-
*
|
|
4
|
-
*
|
|
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
|
-
*
|
|
9
|
-
*
|
|
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
|
-
*
|
|
16
|
-
*
|
|
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
|
-
*
|
|
21
|
-
*
|
|
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
|
-
*
|
|
26
|
-
*
|
|
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
|
-
*
|
|
31
|
-
*
|
|
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
|
-
*
|
|
36
|
-
*
|
|
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
|
-
*
|
|
41
|
-
*
|
|
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
|
-
*
|
|
74
|
+
* All AI-related Commander option definitions as a single object.
|
|
46
75
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
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
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/options/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CACtC,wBAAwB,EACxB,mCAAmC,CACpC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAA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AA4C,CAAC;SACjD,GAAG,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
|
|
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('
|
|
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('
|
|
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
|
|
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":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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"}
|
package/dist/esm/register.js
CHANGED
|
@@ -2,23 +2,22 @@ import { createCommand } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Registers an AI plugin command with the CLI program.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
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
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* // Register a command under `ai`:
|
|
15
|
+
* registerAiPlugin(program, chatCommand);
|
|
16
|
+
* // Results in: ffc ai chat
|
|
19
17
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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) {
|
package/dist/esm/register.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/register.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C
|
|
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"}
|
package/dist/esm/version.js
CHANGED