@123toto/ai-app-assistant-server 0.2.0 → 0.2.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/README.md +4 -0
- package/dist/express.d.cts +1 -1
- package/dist/express.d.ts +1 -1
- package/dist/index.cjs +33 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/{managed-server-BGQ-1jkx.d.ts → managed-server-CGmvVYsF.d.ts} +6 -1
- package/dist/{managed-server-CthTKEQ6.d.cts → managed-server-CQb-RK-i.d.cts} +6 -1
- package/dist/nest.d.cts +1 -1
- package/dist/nest.d.ts +1 -1
- package/package.json +2 -2
|
@@ -246,6 +246,8 @@ interface AiAppAssistantConfigurationSynchronizer {
|
|
|
246
246
|
}
|
|
247
247
|
interface AiAppAssistantConfigurationManagerOptions {
|
|
248
248
|
repository: AiAppAssistantConfigurationRepository;
|
|
249
|
+
/** Global kill switch. When false, no provider operation is allowed. */
|
|
250
|
+
enabled?: boolean | (() => boolean);
|
|
249
251
|
/** Defaults to the local in-memory quota implementation. */
|
|
250
252
|
quotaStore?: AiAppAssistantQuotaStore;
|
|
251
253
|
/** Environment or deployment defaults. They are never persisted automatically. */
|
|
@@ -270,7 +272,7 @@ interface AiAppAssistantConfigurationSaveResult {
|
|
|
270
272
|
configuration?: AiAppAssistantManagedConfigurationView;
|
|
271
273
|
reloadRequired: boolean;
|
|
272
274
|
}
|
|
273
|
-
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "quota_reached" | "secret_storage_unavailable";
|
|
275
|
+
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "assistant_disabled" | "quota_reached" | "secret_storage_unavailable";
|
|
274
276
|
/** Framework-neutral policy error that HTTP adapters can map safely. */
|
|
275
277
|
declare class AiAppAssistantManagementError extends Error {
|
|
276
278
|
readonly status: number;
|
|
@@ -285,6 +287,8 @@ declare class AiAppAssistantManagementError extends Error {
|
|
|
285
287
|
declare class AiAppAssistantConfigurationManager {
|
|
286
288
|
#private;
|
|
287
289
|
constructor(options: AiAppAssistantConfigurationManagerOptions);
|
|
290
|
+
/** Returns the current state of the host-controlled global kill switch. */
|
|
291
|
+
isEnabled(): boolean;
|
|
288
292
|
/** Returns the built-in provider catalogue; no credentials are exposed. */
|
|
289
293
|
listProviders(): AiProviderInfo[];
|
|
290
294
|
/** Discovers models with an explicit key or the currently configured secret. */
|
|
@@ -329,6 +333,7 @@ declare class AiAppAssistantConfigurationManager {
|
|
|
329
333
|
private connectionSignature;
|
|
330
334
|
private lastKnownConnection;
|
|
331
335
|
private now;
|
|
336
|
+
private assertEnabled;
|
|
332
337
|
private publishAndEmit;
|
|
333
338
|
private emit;
|
|
334
339
|
}
|
|
@@ -246,6 +246,8 @@ interface AiAppAssistantConfigurationSynchronizer {
|
|
|
246
246
|
}
|
|
247
247
|
interface AiAppAssistantConfigurationManagerOptions {
|
|
248
248
|
repository: AiAppAssistantConfigurationRepository;
|
|
249
|
+
/** Global kill switch. When false, no provider operation is allowed. */
|
|
250
|
+
enabled?: boolean | (() => boolean);
|
|
249
251
|
/** Defaults to the local in-memory quota implementation. */
|
|
250
252
|
quotaStore?: AiAppAssistantQuotaStore;
|
|
251
253
|
/** Environment or deployment defaults. They are never persisted automatically. */
|
|
@@ -270,7 +272,7 @@ interface AiAppAssistantConfigurationSaveResult {
|
|
|
270
272
|
configuration?: AiAppAssistantManagedConfigurationView;
|
|
271
273
|
reloadRequired: boolean;
|
|
272
274
|
}
|
|
273
|
-
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "quota_reached" | "secret_storage_unavailable";
|
|
275
|
+
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "assistant_disabled" | "quota_reached" | "secret_storage_unavailable";
|
|
274
276
|
/** Framework-neutral policy error that HTTP adapters can map safely. */
|
|
275
277
|
declare class AiAppAssistantManagementError extends Error {
|
|
276
278
|
readonly status: number;
|
|
@@ -285,6 +287,8 @@ declare class AiAppAssistantManagementError extends Error {
|
|
|
285
287
|
declare class AiAppAssistantConfigurationManager {
|
|
286
288
|
#private;
|
|
287
289
|
constructor(options: AiAppAssistantConfigurationManagerOptions);
|
|
290
|
+
/** Returns the current state of the host-controlled global kill switch. */
|
|
291
|
+
isEnabled(): boolean;
|
|
288
292
|
/** Returns the built-in provider catalogue; no credentials are exposed. */
|
|
289
293
|
listProviders(): AiProviderInfo[];
|
|
290
294
|
/** Discovers models with an explicit key or the currently configured secret. */
|
|
@@ -329,6 +333,7 @@ declare class AiAppAssistantConfigurationManager {
|
|
|
329
333
|
private connectionSignature;
|
|
330
334
|
private lastKnownConnection;
|
|
331
335
|
private now;
|
|
336
|
+
private assertEnabled;
|
|
332
337
|
private publishAndEmit;
|
|
333
338
|
private emit;
|
|
334
339
|
}
|
package/dist/nest.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleMetadata, FactoryProvider, DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { M as ManagedAiAppAssistantServer } from './managed-server-
|
|
2
|
+
import { M as ManagedAiAppAssistantServer } from './managed-server-CQb-RK-i.cjs';
|
|
3
3
|
import './ai-sdk-qU3KgNu-.cjs';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '@123toto/ai-app-assistant-contracts';
|
package/dist/nest.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleMetadata, FactoryProvider, DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { M as ManagedAiAppAssistantServer } from './managed-server-
|
|
2
|
+
import { M as ManagedAiAppAssistantServer } from './managed-server-CGmvVYsF.js';
|
|
3
3
|
import './ai-sdk-qU3KgNu-.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '@123toto/ai-app-assistant-contracts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@123toto/ai-app-assistant-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Framework-neutral Node.js backend for contextual in-app AI assistants",
|
|
6
6
|
"engines": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@ai-sdk/openai": "^3.0.0",
|
|
78
78
|
"ai": "^6.0.0",
|
|
79
79
|
"zod": "^4.0.0",
|
|
80
|
-
"@123toto/ai-app-assistant-contracts": "0.2.
|
|
80
|
+
"@123toto/ai-app-assistant-contracts": "0.2.1"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@nestjs/common": "~11.1.29",
|