@123toto/ai-app-assistant-server 0.2.0 → 0.2.2
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 +21 -0
- package/dist/express.d.cts +1 -1
- package/dist/express.d.ts +1 -1
- package/dist/index.cjs +60 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +59 -8
- package/dist/index.js.map +1 -1
- package/dist/{managed-server-BGQ-1jkx.d.ts → managed-server-CusQWWBB.d.ts} +10 -3
- package/dist/{managed-server-CthTKEQ6.d.cts → managed-server-wXfu_9rp.d.cts} +10 -3
- package/dist/nest.d.cts +1 -1
- package/dist/nest.d.ts +1 -1
- package/package.json +2 -2
|
@@ -37,7 +37,9 @@ interface AiAppAssistant {
|
|
|
37
37
|
declare function createAiAppAssistant(options: AiAppAssistantOptions): AiAppAssistant;
|
|
38
38
|
|
|
39
39
|
/** Providers available without installing an additional AI SDK package. */
|
|
40
|
-
|
|
40
|
+
declare const AI_APP_ASSISTANT_PROVIDERS: readonly ["anthropic", "google", "mistral", "ollama", "openai"];
|
|
41
|
+
/** Provider identifier derived from the runtime-neutral exported catalog. */
|
|
42
|
+
type BuiltInProvider = typeof AI_APP_ASSISTANT_PROVIDERS[number];
|
|
41
43
|
/** Stable provider metadata suitable for a settings interface. */
|
|
42
44
|
interface AiProviderInfo {
|
|
43
45
|
id: BuiltInProvider;
|
|
@@ -246,6 +248,8 @@ interface AiAppAssistantConfigurationSynchronizer {
|
|
|
246
248
|
}
|
|
247
249
|
interface AiAppAssistantConfigurationManagerOptions {
|
|
248
250
|
repository: AiAppAssistantConfigurationRepository;
|
|
251
|
+
/** Global kill switch. When false, no provider operation is allowed. */
|
|
252
|
+
enabled?: boolean | (() => boolean);
|
|
249
253
|
/** Defaults to the local in-memory quota implementation. */
|
|
250
254
|
quotaStore?: AiAppAssistantQuotaStore;
|
|
251
255
|
/** Environment or deployment defaults. They are never persisted automatically. */
|
|
@@ -270,7 +274,7 @@ interface AiAppAssistantConfigurationSaveResult {
|
|
|
270
274
|
configuration?: AiAppAssistantManagedConfigurationView;
|
|
271
275
|
reloadRequired: boolean;
|
|
272
276
|
}
|
|
273
|
-
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "quota_reached" | "secret_storage_unavailable";
|
|
277
|
+
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "assistant_disabled" | "quota_reached" | "secret_storage_unavailable";
|
|
274
278
|
/** Framework-neutral policy error that HTTP adapters can map safely. */
|
|
275
279
|
declare class AiAppAssistantManagementError extends Error {
|
|
276
280
|
readonly status: number;
|
|
@@ -285,6 +289,8 @@ declare class AiAppAssistantManagementError extends Error {
|
|
|
285
289
|
declare class AiAppAssistantConfigurationManager {
|
|
286
290
|
#private;
|
|
287
291
|
constructor(options: AiAppAssistantConfigurationManagerOptions);
|
|
292
|
+
/** Returns the current state of the host-controlled global kill switch. */
|
|
293
|
+
isEnabled(): boolean;
|
|
288
294
|
/** Returns the built-in provider catalogue; no credentials are exposed. */
|
|
289
295
|
listProviders(): AiProviderInfo[];
|
|
290
296
|
/** Discovers models with an explicit key or the currently configured secret. */
|
|
@@ -329,6 +335,7 @@ declare class AiAppAssistantConfigurationManager {
|
|
|
329
335
|
private connectionSignature;
|
|
330
336
|
private lastKnownConnection;
|
|
331
337
|
private now;
|
|
338
|
+
private assertEnabled;
|
|
332
339
|
private publishAndEmit;
|
|
333
340
|
private emit;
|
|
334
341
|
}
|
|
@@ -530,4 +537,4 @@ interface ManagedAiAppAssistantServer<TIdentity extends AiAppAssistantRuntimeIde
|
|
|
530
537
|
*/
|
|
531
538
|
declare function createManagedAiAppAssistantServer<TIdentity extends AiAppAssistantRuntimeIdentity, TNativeContext = undefined>(options: CreateManagedAiAppAssistantServerOptions<TIdentity, TNativeContext>): ManagedAiAppAssistantServer<TIdentity, TNativeContext>;
|
|
532
539
|
|
|
533
|
-
export {
|
|
540
|
+
export { createManagedAiAppAssistantFetchHandlers as $, type AiAppAssistant as A, type BuiltInProvider as B, type AiAppAssistantQuotaStore as C, type AiAppAssistantRecentFailure as D, type AiAppAssistantRedisClient as E, type AiAppAssistantRedisQuotaClient as F, type AiAppAssistantRedisTelemetryClient as G, type AiAppAssistantRuntimeIdentity as H, type AiAppAssistantSecretProtector as I, type AiAppAssistantTelemetryStore as J, type AiAppAssistantTelemetrySummary as K, AiModelDiscoveryError as L, type ManagedAiAppAssistantServer as M, type AiModelInfo as N, type AiProviderInfo as O, type CreateAiAppAssistantConfigurationRepositoryOptions as P, type CreateManagedAiAppAssistantRuntimeOptions as Q, type CreateManagedAiAppAssistantServerOptions as R, type ListAiModelsOptions as S, type ManagedAiAppAssistantFetchHandlerOptions as T, type ManagedAiAppAssistantFetchHandlers as U, type ManagedAiAppAssistantRuntime as V, createAes256GcmSecretProtector as W, createAiAppAssistant as X, createAiAppAssistantConfigurationRepository as Y, createAiAppAssistantFailureEvent as Z, createDisabledSecretProtector as _, type AiAppAssistantStreamEvent as a, createManagedAiAppAssistantRuntime as a0, createManagedAiAppAssistantServer as a1, createMemoryAiAppAssistantQuotaStore as a2, createMemoryAiAppAssistantStore as a3, createMemoryAiAppAssistantTelemetryStore as a4, createPollingAiAppAssistantConfigurationSynchronizer as a5, createRedisAiAppAssistantQuotaStore as a6, createRedisAiAppAssistantStore as a7, createRedisAiAppAssistantTelemetryStore as a8, listAiModels as a9, listAiProviders as aa, validateAndSaveAiAppAssistantConfiguration as ab, type AiAppAssistantConfiguration as b, AI_APP_ASSISTANT_PROVIDERS as c, type AiAppAssistantAccessRule as d, type AiAppAssistantConfigurationActor as e, type AiAppAssistantConfigurationAdministration as f, type AiAppAssistantConfigurationAuditChange as g, type AiAppAssistantConfigurationAuditEntry as h, type AiAppAssistantConfigurationAuditField as i, type AiAppAssistantConfigurationChangeEvent as j, AiAppAssistantConfigurationConflictError as k, AiAppAssistantConfigurationManager as l, type AiAppAssistantConfigurationManagerOptions as m, type AiAppAssistantConfigurationRepository as n, type AiAppAssistantConfigurationSaveResult as o, type AiAppAssistantConfigurationSynchronizer as p, type AiAppAssistantConfigurationView as q, type AiAppAssistantGenerationEvent as r, type AiAppAssistantGenerationOperation as s, type AiAppAssistantKeyValueStore as t, type AiAppAssistantManagedConfigurationSetup as u, type AiAppAssistantManagedStorage as v, AiAppAssistantManagementError as w, type AiAppAssistantManagementErrorCode as x, type AiAppAssistantQuotaPolicy as y, type AiAppAssistantQuotaResult as z };
|
|
@@ -37,7 +37,9 @@ interface AiAppAssistant {
|
|
|
37
37
|
declare function createAiAppAssistant(options: AiAppAssistantOptions): AiAppAssistant;
|
|
38
38
|
|
|
39
39
|
/** Providers available without installing an additional AI SDK package. */
|
|
40
|
-
|
|
40
|
+
declare const AI_APP_ASSISTANT_PROVIDERS: readonly ["anthropic", "google", "mistral", "ollama", "openai"];
|
|
41
|
+
/** Provider identifier derived from the runtime-neutral exported catalog. */
|
|
42
|
+
type BuiltInProvider = typeof AI_APP_ASSISTANT_PROVIDERS[number];
|
|
41
43
|
/** Stable provider metadata suitable for a settings interface. */
|
|
42
44
|
interface AiProviderInfo {
|
|
43
45
|
id: BuiltInProvider;
|
|
@@ -246,6 +248,8 @@ interface AiAppAssistantConfigurationSynchronizer {
|
|
|
246
248
|
}
|
|
247
249
|
interface AiAppAssistantConfigurationManagerOptions {
|
|
248
250
|
repository: AiAppAssistantConfigurationRepository;
|
|
251
|
+
/** Global kill switch. When false, no provider operation is allowed. */
|
|
252
|
+
enabled?: boolean | (() => boolean);
|
|
249
253
|
/** Defaults to the local in-memory quota implementation. */
|
|
250
254
|
quotaStore?: AiAppAssistantQuotaStore;
|
|
251
255
|
/** Environment or deployment defaults. They are never persisted automatically. */
|
|
@@ -270,7 +274,7 @@ interface AiAppAssistantConfigurationSaveResult {
|
|
|
270
274
|
configuration?: AiAppAssistantManagedConfigurationView;
|
|
271
275
|
reloadRequired: boolean;
|
|
272
276
|
}
|
|
273
|
-
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "quota_reached" | "secret_storage_unavailable";
|
|
277
|
+
type AiAppAssistantManagementErrorCode = "unauthorized" | "forbidden" | "conflict" | "invalid_request" | "not_configured" | "assistant_disabled" | "quota_reached" | "secret_storage_unavailable";
|
|
274
278
|
/** Framework-neutral policy error that HTTP adapters can map safely. */
|
|
275
279
|
declare class AiAppAssistantManagementError extends Error {
|
|
276
280
|
readonly status: number;
|
|
@@ -285,6 +289,8 @@ declare class AiAppAssistantManagementError extends Error {
|
|
|
285
289
|
declare class AiAppAssistantConfigurationManager {
|
|
286
290
|
#private;
|
|
287
291
|
constructor(options: AiAppAssistantConfigurationManagerOptions);
|
|
292
|
+
/** Returns the current state of the host-controlled global kill switch. */
|
|
293
|
+
isEnabled(): boolean;
|
|
288
294
|
/** Returns the built-in provider catalogue; no credentials are exposed. */
|
|
289
295
|
listProviders(): AiProviderInfo[];
|
|
290
296
|
/** Discovers models with an explicit key or the currently configured secret. */
|
|
@@ -329,6 +335,7 @@ declare class AiAppAssistantConfigurationManager {
|
|
|
329
335
|
private connectionSignature;
|
|
330
336
|
private lastKnownConnection;
|
|
331
337
|
private now;
|
|
338
|
+
private assertEnabled;
|
|
332
339
|
private publishAndEmit;
|
|
333
340
|
private emit;
|
|
334
341
|
}
|
|
@@ -530,4 +537,4 @@ interface ManagedAiAppAssistantServer<TIdentity extends AiAppAssistantRuntimeIde
|
|
|
530
537
|
*/
|
|
531
538
|
declare function createManagedAiAppAssistantServer<TIdentity extends AiAppAssistantRuntimeIdentity, TNativeContext = undefined>(options: CreateManagedAiAppAssistantServerOptions<TIdentity, TNativeContext>): ManagedAiAppAssistantServer<TIdentity, TNativeContext>;
|
|
532
539
|
|
|
533
|
-
export {
|
|
540
|
+
export { createManagedAiAppAssistantFetchHandlers as $, type AiAppAssistant as A, type BuiltInProvider as B, type AiAppAssistantQuotaStore as C, type AiAppAssistantRecentFailure as D, type AiAppAssistantRedisClient as E, type AiAppAssistantRedisQuotaClient as F, type AiAppAssistantRedisTelemetryClient as G, type AiAppAssistantRuntimeIdentity as H, type AiAppAssistantSecretProtector as I, type AiAppAssistantTelemetryStore as J, type AiAppAssistantTelemetrySummary as K, AiModelDiscoveryError as L, type ManagedAiAppAssistantServer as M, type AiModelInfo as N, type AiProviderInfo as O, type CreateAiAppAssistantConfigurationRepositoryOptions as P, type CreateManagedAiAppAssistantRuntimeOptions as Q, type CreateManagedAiAppAssistantServerOptions as R, type ListAiModelsOptions as S, type ManagedAiAppAssistantFetchHandlerOptions as T, type ManagedAiAppAssistantFetchHandlers as U, type ManagedAiAppAssistantRuntime as V, createAes256GcmSecretProtector as W, createAiAppAssistant as X, createAiAppAssistantConfigurationRepository as Y, createAiAppAssistantFailureEvent as Z, createDisabledSecretProtector as _, type AiAppAssistantStreamEvent as a, createManagedAiAppAssistantRuntime as a0, createManagedAiAppAssistantServer as a1, createMemoryAiAppAssistantQuotaStore as a2, createMemoryAiAppAssistantStore as a3, createMemoryAiAppAssistantTelemetryStore as a4, createPollingAiAppAssistantConfigurationSynchronizer as a5, createRedisAiAppAssistantQuotaStore as a6, createRedisAiAppAssistantStore as a7, createRedisAiAppAssistantTelemetryStore as a8, listAiModels as a9, listAiProviders as aa, validateAndSaveAiAppAssistantConfiguration as ab, type AiAppAssistantConfiguration as b, AI_APP_ASSISTANT_PROVIDERS as c, type AiAppAssistantAccessRule as d, type AiAppAssistantConfigurationActor as e, type AiAppAssistantConfigurationAdministration as f, type AiAppAssistantConfigurationAuditChange as g, type AiAppAssistantConfigurationAuditEntry as h, type AiAppAssistantConfigurationAuditField as i, type AiAppAssistantConfigurationChangeEvent as j, AiAppAssistantConfigurationConflictError as k, AiAppAssistantConfigurationManager as l, type AiAppAssistantConfigurationManagerOptions as m, type AiAppAssistantConfigurationRepository as n, type AiAppAssistantConfigurationSaveResult as o, type AiAppAssistantConfigurationSynchronizer as p, type AiAppAssistantConfigurationView as q, type AiAppAssistantGenerationEvent as r, type AiAppAssistantGenerationOperation as s, type AiAppAssistantKeyValueStore as t, type AiAppAssistantManagedConfigurationSetup as u, type AiAppAssistantManagedStorage as v, AiAppAssistantManagementError as w, type AiAppAssistantManagementErrorCode as x, type AiAppAssistantQuotaPolicy as y, type AiAppAssistantQuotaResult as z };
|
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-wXfu_9rp.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-CusQWWBB.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.2",
|
|
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.2"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@nestjs/common": "~11.1.29",
|