quidproquo-core 0.0.176 → 0.0.178

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.
@@ -0,0 +1,3 @@
1
+ export declare enum ClaudeAiActionType {
2
+ MessagesApi = "@quidproquo-core/ClaudeAi/MessagesApi"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClaudeAiActionType = void 0;
4
+ var ClaudeAiActionType;
5
+ (function (ClaudeAiActionType) {
6
+ ClaudeAiActionType["MessagesApi"] = "@quidproquo-core/ClaudeAi/MessagesApi";
7
+ })(ClaudeAiActionType = exports.ClaudeAiActionType || (exports.ClaudeAiActionType = {}));
@@ -0,0 +1,13 @@
1
+ import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
2
+ import { ClaudeAiActionType } from './ClaudeAiActionType';
3
+ import Anthropic from '@anthropic-ai/sdk';
4
+ export interface ClaudeAiMessagesApiActionPayload {
5
+ body: Anthropic.Messages.MessageCreateParamsNonStreaming;
6
+ apiKey: string;
7
+ }
8
+ export interface ClaudeAiMessagesApiAction extends Action<ClaudeAiMessagesApiActionPayload> {
9
+ type: ClaudeAiActionType.MessagesApi;
10
+ payload: ClaudeAiMessagesApiActionPayload;
11
+ }
12
+ export type ClaudeAiMessagesApiActionProcessor = ActionProcessor<ClaudeAiMessagesApiAction, Anthropic.Message>;
13
+ export type ClaudeAiMessagesApiActionRequester = ActionRequester<ClaudeAiMessagesApiAction, Anthropic.Message>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ import { ClaudeAiMessagesApiActionRequester } from './ClaudeAiMessagesApiActionTypes';
2
+ import Anthropic from '@anthropic-ai/sdk';
3
+ export declare function askClaudeAiMessagesApi(body: Anthropic.Messages.MessageCreateParamsNonStreaming, apiKey: string): ClaudeAiMessagesApiActionRequester;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.askClaudeAiMessagesApi = void 0;
4
+ const ClaudeAiActionType_1 = require("./ClaudeAiActionType");
5
+ function* askClaudeAiMessagesApi(body, apiKey) {
6
+ return yield { type: ClaudeAiActionType_1.ClaudeAiActionType.MessagesApi, payload: { body, apiKey } };
7
+ }
8
+ exports.askClaudeAiMessagesApi = askClaudeAiMessagesApi;
@@ -0,0 +1,3 @@
1
+ export * from './ClaudeAiActionType';
2
+ export * from './ClaudeAiMessagesApiActionTypes';
3
+ export * from './ClaudeAiMessagesApiRequester';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ClaudeAiActionType"), exports);
18
+ __exportStar(require("./ClaudeAiMessagesApiActionTypes"), exports);
19
+ __exportStar(require("./ClaudeAiMessagesApiRequester"), exports);
@@ -1,3 +1,4 @@
1
+ export * from './claudeAi';
1
2
  export * from './config';
2
3
  export * from './context';
3
4
  export * from './date';
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./claudeAi"), exports);
17
18
  __exportStar(require("./config"), exports);
18
19
  __exportStar(require("./context"), exports);
19
20
  __exportStar(require("./date"), exports);
@@ -15,7 +15,8 @@ export declare enum QPQCoreConfigSettingType {
15
15
  keyValueStore = "@quidproquo-core/config/KeyValueStore",
16
16
  configValue = "@quidproquo-core/config/ConfigValue",
17
17
  environmentSettings = "@quidproquo-core/config/EnvironmentSettings",
18
- deployEvent = "@quidproquo-core/config/DeployEvent"
18
+ deployEvent = "@quidproquo-core/config/DeployEvent",
19
+ claudeAi = "@quidproquo-core/config/ClaudeAi"
19
20
  }
20
21
  export interface QPQConfigSetting {
21
22
  configSettingType: string;
@@ -19,4 +19,5 @@ var QPQCoreConfigSettingType;
19
19
  QPQCoreConfigSettingType["configValue"] = "@quidproquo-core/config/ConfigValue";
20
20
  QPQCoreConfigSettingType["environmentSettings"] = "@quidproquo-core/config/EnvironmentSettings";
21
21
  QPQCoreConfigSettingType["deployEvent"] = "@quidproquo-core/config/DeployEvent";
22
+ QPQCoreConfigSettingType["claudeAi"] = "@quidproquo-core/config/ClaudeAi";
22
23
  })(QPQCoreConfigSettingType = exports.QPQCoreConfigSettingType || (exports.QPQCoreConfigSettingType = {}));
@@ -0,0 +1,14 @@
1
+ import { QPQConfigSetting, QPQConfigAdvancedSettings } from '../QPQConfig';
2
+ export declare enum ClaudeAIModelSize {
3
+ Small = "small",
4
+ Medium = "medium",
5
+ Large = "large"
6
+ }
7
+ export interface QPQConfigAdvancedClaudeAISettings extends QPQConfigAdvancedSettings {
8
+ modelSize?: ClaudeAIModelSize;
9
+ }
10
+ export interface ClaudeAIQPQConfigSetting extends QPQConfigSetting {
11
+ name: string;
12
+ modelSize: ClaudeAIModelSize;
13
+ }
14
+ export declare const defineClaudeAI: (name: string, options?: QPQConfigAdvancedClaudeAISettings) => ClaudeAIQPQConfigSetting;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineClaudeAI = exports.ClaudeAIModelSize = void 0;
4
+ // Import the base configuration interfaces and types
5
+ const QPQConfig_1 = require("../QPQConfig");
6
+ // Define an enum for model sizes
7
+ var ClaudeAIModelSize;
8
+ (function (ClaudeAIModelSize) {
9
+ ClaudeAIModelSize["Small"] = "small";
10
+ ClaudeAIModelSize["Medium"] = "medium";
11
+ ClaudeAIModelSize["Large"] = "large";
12
+ })(ClaudeAIModelSize = exports.ClaudeAIModelSize || (exports.ClaudeAIModelSize = {}));
13
+ // Function to define Claude AI config with optional advanced settings
14
+ const defineClaudeAI = (name, options) => ({
15
+ configSettingType: QPQConfig_1.QPQCoreConfigSettingType.claudeAi,
16
+ uniqueKey: name,
17
+ name,
18
+ modelSize: (options === null || options === void 0 ? void 0 : options.modelSize) || ClaudeAIModelSize.Medium, // Default to 'medium' if not specified
19
+ });
20
+ exports.defineClaudeAI = defineClaudeAI;
@@ -16,3 +16,4 @@ export * from './schedule';
16
16
  export * from './secret';
17
17
  export * from './storageDrive';
18
18
  export * from './userDirectory';
19
+ export * from './claudeAi';
@@ -32,3 +32,4 @@ __exportStar(require("./schedule"), exports);
32
32
  __exportStar(require("./secret"), exports);
33
33
  __exportStar(require("./storageDrive"), exports);
34
34
  __exportStar(require("./userDirectory"), exports);
35
+ __exportStar(require("./claudeAi"), exports);
@@ -1,6 +1,11 @@
1
- import { QPQConfigSetting } from '../QPQConfig';
1
+ import { CrossModuleOwner } from '../../types';
2
+ import { QPQConfigAdvancedSettings, QPQConfigSetting } from '../QPQConfig';
3
+ export interface QPQConfigAdvancedParameterSettings extends QPQConfigAdvancedSettings {
4
+ owner?: CrossModuleOwner<'parameterName'>;
5
+ value?: string;
6
+ }
2
7
  export interface ParameterQPQConfigSetting extends QPQConfigSetting {
3
8
  key: string;
4
9
  value: string;
5
10
  }
6
- export declare const defineParameter: (key: string, value?: string) => ParameterQPQConfigSetting;
11
+ export declare const defineParameter: (key: string, options?: QPQConfigAdvancedParameterSettings) => ParameterQPQConfigSetting;
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defineParameter = void 0;
4
+ const qpqCoreUtils_1 = require("../../qpqCoreUtils");
4
5
  const QPQConfig_1 = require("../QPQConfig");
5
- const defineParameter = (key, value = '') => ({
6
+ const defineParameter = (key, options) => ({
6
7
  configSettingType: QPQConfig_1.QPQCoreConfigSettingType.parameter,
7
8
  uniqueKey: key,
8
9
  key,
9
- value
10
+ value: (options === null || options === void 0 ? void 0 : options.value) || '',
11
+ owner: (0, qpqCoreUtils_1.convertCrossModuleOwnerToGenericResourceNameOverride)(options === null || options === void 0 ? void 0 : options.owner),
10
12
  });
11
13
  exports.defineParameter = defineParameter;
@@ -1,5 +1,5 @@
1
1
  import { QPQConfig, QPQConfigSetting } from './config/QPQConfig';
2
- import { ApplicationQPQConfigSetting, StorageDriveQPQConfigSetting, EventBusQPQConfigSetting, ScheduleQPQConfigSetting, SecretQPQConfigSetting, ParameterQPQConfigSetting, QueueQPQConfigSetting, QpqQueueProcessors, UserDirectoryQPQConfigSetting, KeyValueStoreQPQConfigSetting, DeployEventsQPQConfigSetting } from './config/settings';
2
+ import { ApplicationQPQConfigSetting, StorageDriveQPQConfigSetting, EventBusQPQConfigSetting, ScheduleQPQConfigSetting, SecretQPQConfigSetting, ParameterQPQConfigSetting, QueueQPQConfigSetting, QpqQueueProcessors, UserDirectoryQPQConfigSetting, KeyValueStoreQPQConfigSetting, DeployEventsQPQConfigSetting, ClaudeAIQPQConfigSetting } from './config/settings';
3
3
  import { EmailTemplates } from './config/settings/emailTemplates/types';
4
4
  import { CrossModuleOwner, CrossServiceResourceName, CustomFullyQualifiedResource, FullyQualifiedResource, ResourceName } from './types';
5
5
  /**
@@ -48,6 +48,7 @@ export declare const getStorageDriveByName: (storageDriveName: string, configs:
48
48
  export declare const getQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
49
49
  export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
50
50
  export declare const getAllEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
51
+ export declare const getAllClaudeAiConfigs: (qpqConfig: QPQConfig) => ClaudeAIQPQConfigSetting[];
51
52
  export declare const getOwnedEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
52
53
  export declare const getEventBusConfigByName: (eventBusName: string, qpqConfig: QPQConfig) => EventBusQPQConfigSetting | undefined;
53
54
  export declare const getOwnedItems: <T extends QPQConfigSetting>(settings: T[], qpqConfig: QPQConfig) => T[];
@@ -64,10 +65,13 @@ export declare const getQueueSrcEntries: (configs: QPQConfig) => string[];
64
65
  export declare const getUserDirectorySrcEntries: (qpqConfig: QPQConfig) => string[];
65
66
  export declare const getAllSrcEntries: (qpqConfig: QPQConfig) => string[];
66
67
  export declare const getSecretByName: (secretName: string, qpqConfig: QPQConfig) => SecretQPQConfigSetting;
68
+ export declare const getAllSecretConfigs: (qpqConfig: QPQConfig) => SecretQPQConfigSetting[];
67
69
  export declare const getOwnedSecrets: (qpqConfig: QPQConfig) => SecretQPQConfigSetting[];
68
70
  export declare const getGlobalConfigValue: <T>(qpqConfig: QPQConfig, name: string) => T;
69
71
  export declare const getUserDirectories: (configs: QPQConfig) => UserDirectoryQPQConfigSetting[];
70
- export declare const getParameterConfigs: (qpqConfig: QPQConfig) => ParameterQPQConfigSetting[];
72
+ export declare const getAllParameterConfigs: (qpqConfig: QPQConfig) => ParameterQPQConfigSetting[];
73
+ export declare const getParameterConfig: (name: string, qpqConfig: QPQConfig) => ParameterQPQConfigSetting;
74
+ export declare const getOwnedParameterConfigs: (qpqConfig: QPQConfig) => ParameterQPQConfigSetting[];
71
75
  export declare const getUniqueKeyForSetting: (setting: QPQConfigSetting) => string;
72
76
  export declare const getScheduleEntryFullPath: (qpqConfig: QPQConfig, scheduleConfig: ScheduleQPQConfigSetting) => string;
73
77
  export declare const getStorageDriveEntryFullPath: (qpqConfig: QPQConfig, storageDriveConfig: StorageDriveQPQConfigSetting) => string;
@@ -34,7 +34,8 @@ var __rest = (this && this.__rest) || function (s, e) {
34
34
  return t;
35
35
  };
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.convertCrossModuleOwnerToGenericResourceNameOverride = exports.getQueueQueueProcessors = exports.getUserDirectoryEntryFullPath = exports.getQueueEntryFullPath = exports.getStorageDriveUploadFullPath = exports.getDeployEventFullPath = exports.getStorageDriveEntryFullPath = exports.getScheduleEntryFullPath = exports.getUniqueKeyForSetting = exports.getParameterConfigs = exports.getUserDirectories = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getSecretByName = exports.getAllSrcEntries = exports.getUserDirectorySrcEntries = exports.getQueueSrcEntries = exports.getScheduleEvents = exports.getUserDirectoryEmailTemplates = exports.getActionProcessorSources = exports.getKeyValueStoreByName = exports.resolveCrossServiceResourceName = exports.getOwnedStorageDrives = exports.getOwnedKeyValueStores = exports.getDeployEventConfigs = exports.getAllKeyValueStores = exports.getOwnedItems = exports.getEventBusConfigByName = exports.getOwnedEventBusConfigs = exports.getAllEventBusConfigs = exports.getStorageDriveNames = exports.getQueues = exports.getStorageDriveByName = exports.getStorageDrives = exports.getApplicationModuleDeployRegion = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationName = exports.getApplicationModuleName = exports.getApplicationConfigSetting = exports.getConfigSetting = exports.getConfigSettings = exports.flattenQpqConfig = void 0;
37
+ exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.convertCrossModuleOwnerToGenericResourceNameOverride = exports.getQueueQueueProcessors = exports.getUserDirectoryEntryFullPath = exports.getQueueEntryFullPath = exports.getStorageDriveUploadFullPath = exports.getDeployEventFullPath = exports.getStorageDriveEntryFullPath = exports.getScheduleEntryFullPath = exports.getUniqueKeyForSetting = exports.getOwnedParameterConfigs = exports.getParameterConfig = exports.getAllParameterConfigs = exports.getUserDirectories = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getAllSecretConfigs = exports.getSecretByName = exports.getAllSrcEntries = exports.getUserDirectorySrcEntries = exports.getQueueSrcEntries = exports.getScheduleEvents = exports.getUserDirectoryEmailTemplates = exports.getActionProcessorSources = exports.getKeyValueStoreByName = exports.resolveCrossServiceResourceName = exports.getOwnedStorageDrives = exports.getOwnedKeyValueStores = exports.getDeployEventConfigs = exports.getAllKeyValueStores = exports.getOwnedItems = exports.getEventBusConfigByName = exports.getOwnedEventBusConfigs = exports.getAllClaudeAiConfigs = exports.getAllEventBusConfigs = exports.getStorageDriveNames = exports.getQueues = exports.getStorageDriveByName = exports.getStorageDrives = exports.getApplicationModuleDeployRegion = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationName = exports.getApplicationModuleName = exports.getApplicationConfigSetting = exports.getConfigSetting = exports.getConfigSettings = exports.flattenQpqConfig = void 0;
38
+ exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = void 0;
38
39
  const path = __importStar(require("path"));
39
40
  const QPQConfig_1 = require("./config/QPQConfig");
40
41
  /**
@@ -169,6 +170,11 @@ const getAllEventBusConfigs = (qpqConfig) => {
169
170
  return eventBuses;
170
171
  };
171
172
  exports.getAllEventBusConfigs = getAllEventBusConfigs;
173
+ const getAllClaudeAiConfigs = (qpqConfig) => {
174
+ const claudeAis = (0, exports.getConfigSettings)(qpqConfig, QPQConfig_1.QPQCoreConfigSettingType.claudeAi);
175
+ return claudeAis;
176
+ };
177
+ exports.getAllClaudeAiConfigs = getAllClaudeAiConfigs;
172
178
  const getOwnedEventBusConfigs = (qpqConfig) => {
173
179
  const ownedEventBusConfigs = (0, exports.getOwnedItems)((0, exports.getAllEventBusConfigs)(qpqConfig), qpqConfig);
174
180
  return ownedEventBusConfigs;
@@ -277,8 +283,13 @@ const getSecretByName = (secretName, qpqConfig) => {
277
283
  return secret;
278
284
  };
279
285
  exports.getSecretByName = getSecretByName;
280
- const getOwnedSecrets = (qpqConfig) => {
286
+ const getAllSecretConfigs = (qpqConfig) => {
281
287
  const secrets = (0, exports.getConfigSettings)(qpqConfig, QPQConfig_1.QPQCoreConfigSettingType.secret);
288
+ return secrets;
289
+ };
290
+ exports.getAllSecretConfigs = getAllSecretConfigs;
291
+ const getOwnedSecrets = (qpqConfig) => {
292
+ const secrets = (0, exports.getAllSecretConfigs)(qpqConfig);
282
293
  return (0, exports.getOwnedItems)(secrets, qpqConfig);
283
294
  };
284
295
  exports.getOwnedSecrets = getOwnedSecrets;
@@ -295,11 +306,25 @@ const getUserDirectories = (configs) => {
295
306
  return userDirectories;
296
307
  };
297
308
  exports.getUserDirectories = getUserDirectories;
298
- const getParameterConfigs = (qpqConfig) => {
309
+ const getAllParameterConfigs = (qpqConfig) => {
299
310
  const parameters = (0, exports.getConfigSettings)(qpqConfig, QPQConfig_1.QPQCoreConfigSettingType.parameter);
300
311
  return parameters;
301
312
  };
302
- exports.getParameterConfigs = getParameterConfigs;
313
+ exports.getAllParameterConfigs = getAllParameterConfigs;
314
+ const getParameterConfig = (name, qpqConfig) => {
315
+ const parameters = (0, exports.getConfigSettings)(qpqConfig, QPQConfig_1.QPQCoreConfigSettingType.parameter);
316
+ const param = parameters.find((p) => p.key === name);
317
+ if (!param) {
318
+ throw new Error(`Parameter ${name} not found`);
319
+ }
320
+ return param;
321
+ };
322
+ exports.getParameterConfig = getParameterConfig;
323
+ const getOwnedParameterConfigs = (qpqConfig) => {
324
+ const parameters = (0, exports.getAllParameterConfigs)(qpqConfig);
325
+ return (0, exports.getOwnedItems)(parameters, qpqConfig);
326
+ };
327
+ exports.getOwnedParameterConfigs = getOwnedParameterConfigs;
303
328
  const getUniqueKeyForSetting = (setting) => {
304
329
  const type = setting.configSettingType.split('/').pop();
305
330
  const key = setting.uniqueKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-core",
3
- "version": "0.0.176",
3
+ "version": "0.0.178",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "types": "./lib/commonjs/index.d.ts",
@@ -25,7 +25,10 @@
25
25
  },
26
26
  "homepage": "https://github.com/joe-coady/quidproquo#readme",
27
27
  "devDependencies": {
28
- "quidproquo-tsconfig": "0.0.176",
28
+ "quidproquo-tsconfig": "0.0.178",
29
29
  "typescript": "^4.9.3"
30
+ },
31
+ "dependencies": {
32
+ "@anthropic-ai/sdk": "^0.19.1"
30
33
  }
31
34
  }