at-shared-types 1.1.30 → 1.1.31

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.
Files changed (67) hide show
  1. package/dist/index.cjs +102 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.cts +222 -0
  4. package/dist/index.d.ts +222 -0
  5. package/dist/index.js +79 -0
  6. package/dist/index.js.map +1 -0
  7. package/package.json +23 -27
  8. package/dist/cjs/ai/chat/chatRequestDTO.d.ts +0 -6
  9. package/dist/cjs/ai/chat/chatRequestDTO.js +0 -2
  10. package/dist/cjs/ai/chat/chatResponseDTO.d.ts +0 -9
  11. package/dist/cjs/ai/chat/chatResponseDTO.js +0 -2
  12. package/dist/cjs/ai/chat/chatWithIntentRequestDTO.d.ts +0 -6
  13. package/dist/cjs/ai/chat/chatWithIntentRequestDTO.js +0 -2
  14. package/dist/cjs/ai/chat/chatWithIntentResponseDTO.d.ts +0 -5
  15. package/dist/cjs/ai/chat/chatWithIntentResponseDTO.js +0 -2
  16. package/dist/cjs/ai/chat/index.d.ts +0 -4
  17. package/dist/cjs/ai/chat/index.js +0 -20
  18. package/dist/cjs/ai/engine.d.ts +0 -53
  19. package/dist/cjs/ai/engine.js +0 -2
  20. package/dist/cjs/ai/index.d.ts +0 -3
  21. package/dist/cjs/ai/index.js +0 -19
  22. package/dist/cjs/ai/session/index.d.ts +0 -1
  23. package/dist/cjs/ai/session/index.js +0 -17
  24. package/dist/cjs/ai/session/sessionsDTO.d.ts +0 -16
  25. package/dist/cjs/ai/session/sessionsDTO.js +0 -2
  26. package/dist/cjs/core/errors/errorCodeDTO.d.ts +0 -6
  27. package/dist/cjs/core/errors/errorCodeDTO.js +0 -9
  28. package/dist/cjs/core/errors/index.d.ts +0 -1
  29. package/dist/cjs/core/errors/index.js +0 -17
  30. package/dist/cjs/core/index.d.ts +0 -2
  31. package/dist/cjs/core/index.js +0 -18
  32. package/dist/cjs/core/routes/formattedResponseDTO.d.ts +0 -10
  33. package/dist/cjs/core/routes/formattedResponseDTO.js +0 -2
  34. package/dist/cjs/core/routes/index.d.ts +0 -1
  35. package/dist/cjs/core/routes/index.js +0 -17
  36. package/dist/cjs/index.d.ts +0 -2
  37. package/dist/cjs/index.js +0 -18
  38. package/dist/esm/ai/chat/chatRequestDTO.d.ts +0 -6
  39. package/dist/esm/ai/chat/chatRequestDTO.js +0 -1
  40. package/dist/esm/ai/chat/chatResponseDTO.d.ts +0 -9
  41. package/dist/esm/ai/chat/chatResponseDTO.js +0 -1
  42. package/dist/esm/ai/chat/chatWithIntentRequestDTO.d.ts +0 -6
  43. package/dist/esm/ai/chat/chatWithIntentRequestDTO.js +0 -1
  44. package/dist/esm/ai/chat/chatWithIntentResponseDTO.d.ts +0 -5
  45. package/dist/esm/ai/chat/chatWithIntentResponseDTO.js +0 -1
  46. package/dist/esm/ai/chat/index.d.ts +0 -4
  47. package/dist/esm/ai/chat/index.js +0 -4
  48. package/dist/esm/ai/engine.d.ts +0 -53
  49. package/dist/esm/ai/engine.js +0 -1
  50. package/dist/esm/ai/index.d.ts +0 -3
  51. package/dist/esm/ai/index.js +0 -3
  52. package/dist/esm/ai/session/index.d.ts +0 -1
  53. package/dist/esm/ai/session/index.js +0 -1
  54. package/dist/esm/ai/session/sessionsDTO.d.ts +0 -16
  55. package/dist/esm/ai/session/sessionsDTO.js +0 -1
  56. package/dist/esm/core/errors/errorCodeDTO.d.ts +0 -6
  57. package/dist/esm/core/errors/errorCodeDTO.js +0 -6
  58. package/dist/esm/core/errors/index.d.ts +0 -1
  59. package/dist/esm/core/errors/index.js +0 -1
  60. package/dist/esm/core/index.d.ts +0 -2
  61. package/dist/esm/core/index.js +0 -2
  62. package/dist/esm/core/routes/formattedResponseDTO.d.ts +0 -10
  63. package/dist/esm/core/routes/formattedResponseDTO.js +0 -1
  64. package/dist/esm/core/routes/index.d.ts +0 -1
  65. package/dist/esm/core/routes/index.js +0 -1
  66. package/dist/esm/index.d.ts +0 -2
  67. package/dist/esm/index.js +0 -2
package/dist/index.cjs ADDED
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ATDomainDTO: () => ATDomainDTO,
24
+ ATTransportDTO: () => ATTransportDTO,
25
+ Casing: () => casing_exports
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+
29
+ // src/at-domain-dto.ts
30
+ var ATDomainDTO = {};
31
+
32
+ // src/core/transport/errors.ts
33
+ var ATAPIErrorCodeDTO = {
34
+ // 45xx – AI / workflow
35
+ AI_SESSION_EXPIRED: 4501,
36
+ AI_SESSION_NOT_FOUND: 4502,
37
+ AI_REQUEST_CONTEXT_MISSING: 4503
38
+ };
39
+
40
+ // src/at-transport-dto.ts
41
+ var ATTransportDTO = {
42
+ ATAPIErrorCodeDTO
43
+ };
44
+
45
+ // src/casing/index.ts
46
+ var casing_exports = {};
47
+ __export(casing_exports, {
48
+ Runtime: () => case_runtime_exports,
49
+ Types: () => case_types_exports,
50
+ toCamelDeep: () => toCamelDeep,
51
+ toCamelKey: () => toCamelKey,
52
+ toSnakeDeep: () => toSnakeDeep,
53
+ toSnakeKey: () => toSnakeKey
54
+ });
55
+
56
+ // src/casing/case.types.ts
57
+ var case_types_exports = {};
58
+
59
+ // src/casing/case.runtime.ts
60
+ var case_runtime_exports = {};
61
+ __export(case_runtime_exports, {
62
+ toCamelDeep: () => toCamelDeep,
63
+ toCamelKey: () => toCamelKey,
64
+ toSnakeDeep: () => toSnakeDeep,
65
+ toSnakeKey: () => toSnakeKey
66
+ });
67
+ var CAMEL_TO_SNAKE = /[A-Z]/g;
68
+ var SNAKE_TO_CAMEL = /_([a-z])/g;
69
+ var toSnakeKey = (k) => k.replace(CAMEL_TO_SNAKE, (m) => `_${m.toLowerCase()}`);
70
+ var toCamelKey = (k) => k.replace(SNAKE_TO_CAMEL, (_, c) => c.toUpperCase());
71
+ function toSnakeDeep(value, exceptions = /* @__PURE__ */ new Set()) {
72
+ if (Array.isArray(value)) return value.map((v) => toSnakeDeep(v, exceptions));
73
+ if (value instanceof Date) return value;
74
+ if (value && typeof value === "object") {
75
+ const out = {};
76
+ for (const [k, v] of Object.entries(value)) {
77
+ const nk = exceptions.has(k) ? k : toSnakeKey(k);
78
+ out[nk] = toSnakeDeep(v, exceptions);
79
+ }
80
+ return out;
81
+ }
82
+ return value;
83
+ }
84
+ function toCamelDeep(value) {
85
+ if (Array.isArray(value)) return value.map(toCamelDeep);
86
+ if (value instanceof Date) return value;
87
+ if (value && typeof value === "object") {
88
+ const out = {};
89
+ for (const [k, v] of Object.entries(value)) {
90
+ out[toCamelKey(k)] = toCamelDeep(v);
91
+ }
92
+ return out;
93
+ }
94
+ return value;
95
+ }
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ ATDomainDTO,
99
+ ATTransportDTO,
100
+ Casing
101
+ });
102
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/at-domain-dto.ts","../src/core/transport/errors.ts","../src/at-transport-dto.ts","../src/casing/index.ts","../src/casing/case.types.ts","../src/casing/case.runtime.ts"],"sourcesContent":["export { ATDomainDTO } from \"./at-domain-dto\";\r\nexport { ATTransportDTO } from \"./at-transport-dto\";\r\nexport * as Casing from \"./casing\";\r\n","import type * as Engine from \"./ai/domain/engine\";\r\nimport type * as Session from \"./ai/domain/session\";\r\n\r\n/**\r\n * Runtime value (empty on purpose) so consumers can:\r\n * import { ATDomainDTO } from \"at-shared-types\"\r\n * and then use:\r\n * ATDomainDTO.SomeType\r\n */\r\nexport const ATDomainDTO = {} as const;\r\n\r\n/**\r\n * Namespace holds ONLY types (and could hold values too if you ever need).\r\n * TS merges this with the const above.\r\n */\r\nexport namespace ATDomainDTO {\r\n export type ATChatMessageContentDTO = Engine.ATChatMessageContentDTO;\r\n\r\n export type AIChatMessageDTO = Engine.AIChatMessageDTO;\r\n export type AIChatOptionsResponseFormatDTO = Engine.AIChatOptionsResponseFormatDTO;\r\n\r\n export type AIRequestContextDTO = Engine.AIRequestContextDTO;\r\n export type AIChatOptionsDTO = Engine.AIChatOptionsDTO;\r\n\r\n export type AIIntentDTO = Engine.AIIntentDTO;\r\n export type AICapabilityDTO = Engine.AICapabilityDTO;\r\n export type AIPageContextDTO = Engine.AIPageContextDTO;\r\n\r\n export type AIChatWithIntentOptionsDTO = Engine.AIChatWithIntentOptionsDTO;\r\n\r\n export type AIPromptRoleDTO = Session.AIPromptRoleDTO;\r\n export type AISessionConfigDTO = Session.AISessionConfigDTO;\r\n}\r\n","export const ATAPIErrorCodeDTO = {\r\n // 45xx – AI / workflow\r\n AI_SESSION_EXPIRED: 4501,\r\n AI_SESSION_NOT_FOUND: 4502,\r\n AI_REQUEST_CONTEXT_MISSING: 4503,\r\n} as const;\r\n\r\nexport type ATAPIErrorCodeDTO = typeof ATAPIErrorCodeDTO[keyof typeof ATAPIErrorCodeDTO];","import type * as AIWire from \"./ai/transport/wire.types\";\r\nimport type * as AIChat from \"./ai/transport/chat\";\r\nimport {\r\n ATAPIErrorCodeDTO as ATAPIErrorCodeConst,\r\n type ATAPIErrorCodeDTO as ATAPIErrorCodeType,\r\n} from \"./core/transport/errors\";\r\nimport type * as CoreResponses from \"./core/transport/responses\";\r\n\r\nexport const ATTransportDTO = {\r\n ATAPIErrorCodeDTO: ATAPIErrorCodeConst,\r\n} as const;\r\n\r\nexport namespace ATTransportDTO {\r\n // expose the union type\r\n export type ATAPIErrorCodeDTO = ATAPIErrorCodeType;\r\n\r\n // core response DTOs\r\n export type ResponseSuccessDTO<T> = CoreResponses.ResponseSuccessDTO<T>;\r\n export type ResponseErrorDTO = CoreResponses.ResponseErrorDTO;\r\n\r\n // AI transport request/response DTOs\r\n export type AIChatRequestDTO = AIChat.AIChatRequestDTO;\r\n export type AIChatResponseDTO = AIChat.AIChatResponseDTO;\r\n export type AIChatWithIntentRequestDTO = AIChat.AIChatWithIntentRequestDTO;\r\n export type AIChatWithIntentResponseDTO = AIChat.AIChatWithIntentResponseDTO;\r\n\r\n // wire DTOs\r\n export type AIChatMessageWireDTO = AIWire.AIChatMessageWireDTO;\r\n export type AIChatOptionsWireDTO = AIWire.AIChatOptionsWireDTO;\r\n export type AIRequestContextWireDTO = AIWire.AIRequestContextWireDTO;\r\n export type AIChatWithIntentOptionsWireDTO = AIWire.AIChatWithIntentOptionsWireDTO;\r\n\r\n export type AIIntentWireDTO = AIWire.AIIntentWireDTO;\r\n export type AICapabilityWireDTO = AIWire.AICapabilityWireDTO;\r\n export type AIPageContextWireDTO = AIWire.AIPageContextWireDTO;\r\n\r\n export type AISessionConfigWireDTO = AIWire.AISessionConfigWireDTO;\r\n}\r\n","// src/casing/index.ts\r\nexport * from \"./case.types\";\r\nexport * from \"./case.runtime\";\r\n\r\n// (optional) if you still like namespaces, keep them too:\r\nimport * as Types from \"./case.types\";\r\nimport * as Runtime from \"./case.runtime\";\r\nexport { Types, Runtime };\r\n","export type SnakeCase<S extends string> =\r\n S extends `${infer H}${infer T}`\r\n ? T extends Uncapitalize<T>\r\n ? `${Lowercase<H>}${SnakeCase<T>}`\r\n : `${Lowercase<H>}_${SnakeCase<Uncapitalize<T>>}`\r\n : S;\r\n\r\nexport type CamelCase<S extends string> =\r\n S extends `${infer A}_${infer B}`\r\n ? `${A}${Capitalize<CamelCase<B>>}`\r\n : S;\r\n\r\ntype Primitive = string | number | boolean | bigint | symbol | null | undefined;\r\ntype Builtin = Primitive | Date | RegExp | Error;\r\n\r\nexport type DeepSnakeKeys<T> =\r\n T extends Builtin ? T :\r\n T extends (...args: any[]) => any ? T :\r\n T extends readonly [any, ...any[]]\r\n ? { [I in keyof T]: DeepSnakeKeys<T[I]> } :\r\n T extends ReadonlyArray<infer U>\r\n ? ReadonlyArray<DeepSnakeKeys<U>> :\r\n T extends Map<infer K, infer V>\r\n ? Map<DeepSnakeKeys<K>, DeepSnakeKeys<V>> :\r\n T extends Set<infer U>\r\n ? Set<DeepSnakeKeys<U>> :\r\n T extends object\r\n ? { [K in keyof T as K extends string ? SnakeCase<K> : K]: DeepSnakeKeys<T[K]> }\r\n : T;\r\n\r\nexport type DeepCamelKeys<T> =\r\n T extends Builtin ? T :\r\n T extends (...args: any[]) => any ? T :\r\n T extends readonly [any, ...any[]]\r\n ? { [I in keyof T]: DeepCamelKeys<T[I]> } :\r\n T extends ReadonlyArray<infer U>\r\n ? ReadonlyArray<DeepCamelKeys<U>> :\r\n T extends Map<infer K, infer V>\r\n ? Map<DeepCamelKeys<K>, DeepCamelKeys<V>> :\r\n T extends Set<infer U>\r\n ? Set<DeepCamelKeys<U>> :\r\n T extends object\r\n ? { [K in keyof T as K extends string ? CamelCase<K> : K]: DeepCamelKeys<T[K]> }\r\n : T;\r\n","const CAMEL_TO_SNAKE = /[A-Z]/g;\r\nconst SNAKE_TO_CAMEL = /_([a-z])/g;\r\n\r\nexport const toSnakeKey = (k: string) =>\r\n k.replace(CAMEL_TO_SNAKE, m => `_${m.toLowerCase()}`);\r\n\r\nexport const toCamelKey = (k: string) =>\r\n k.replace(SNAKE_TO_CAMEL, (_, c) => c.toUpperCase());\r\n\r\nexport function toSnakeDeep<T>(value: T, exceptions = new Set<string>()): any {\r\n if (Array.isArray(value)) return value.map(v => toSnakeDeep(v, exceptions));\r\n if (value instanceof Date) return value;\r\n if (value && typeof value === \"object\") {\r\n const out: Record<string, any> = {};\r\n for (const [k, v] of Object.entries(value as any)) {\r\n const nk = exceptions.has(k) ? k : toSnakeKey(k);\r\n out[nk] = toSnakeDeep(v, exceptions);\r\n }\r\n return out;\r\n }\r\n return value;\r\n}\r\n\r\nexport function toCamelDeep<T>(value: T): any {\r\n if (Array.isArray(value)) return value.map(toCamelDeep);\r\n if (value instanceof Date) return value;\r\n if (value && typeof value === \"object\") {\r\n const out: Record<string, any> = {};\r\n for (const [k, v] of Object.entries(value as any)) {\r\n out[toCamelKey(k)] = toCamelDeep(v);\r\n }\r\n return out;\r\n }\r\n return value;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSO,IAAM,cAAc,CAAC;;;ACTrB,IAAM,oBAAoB;AAAA;AAAA,EAE7B,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,4BAA4B;AAChC;;;ACGO,IAAM,iBAAiB;AAAA,EAC1B;AACJ;;;ACVA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AAEhB,IAAM,aAAa,CAAC,MACvB,EAAE,QAAQ,gBAAgB,OAAK,IAAI,EAAE,YAAY,CAAC,EAAE;AAEjD,IAAM,aAAa,CAAC,MACvB,EAAE,QAAQ,gBAAgB,CAAC,GAAG,MAAM,EAAE,YAAY,CAAC;AAEhD,SAAS,YAAe,OAAU,aAAa,oBAAI,IAAY,GAAQ;AAC1E,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,IAAI,OAAK,YAAY,GAAG,UAAU,CAAC;AAC1E,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,SAAS,OAAO,UAAU,UAAU;AACpC,UAAM,MAA2B,CAAC;AAClC,eAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAY,GAAG;AAC/C,YAAM,KAAK,WAAW,IAAI,CAAC,IAAI,IAAI,WAAW,CAAC;AAC/C,UAAI,EAAE,IAAI,YAAY,GAAG,UAAU;AAAA,IACvC;AACA,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,SAAS,YAAe,OAAe;AAC1C,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,IAAI,WAAW;AACtD,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,SAAS,OAAO,UAAU,UAAU;AACpC,UAAM,MAA2B,CAAC;AAClC,eAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAY,GAAG;AAC/C,UAAI,WAAW,CAAC,CAAC,IAAI,YAAY,CAAC;AAAA,IACtC;AACA,WAAO;AAAA,EACX;AACA,SAAO;AACX;","names":[]}
@@ -0,0 +1,222 @@
1
+ type ATChatMessageContentDTO = string | null;
2
+ /**
3
+ * Internal representation — can include nulls for assistant messages, etc.
4
+ */
5
+ type AIChatMessageDTO = {
6
+ role: "system";
7
+ content: ATChatMessageContentDTO;
8
+ } | {
9
+ role: "user";
10
+ content: ATChatMessageContentDTO;
11
+ } | {
12
+ role: "assistant";
13
+ content: ATChatMessageContentDTO;
14
+ };
15
+ type AIChatOptionsResponseFormatDTO = {
16
+ type: "text";
17
+ } | {
18
+ type: "json";
19
+ jsonSchema?: Record<string, any>;
20
+ };
21
+ interface AIRequestContextDTO {
22
+ messages?: AIChatMessageDTO[];
23
+ sessionID?: string;
24
+ engine?: string;
25
+ engineType?: string;
26
+ }
27
+ interface AIChatOptionsDTO {
28
+ model?: string;
29
+ temperature?: number;
30
+ maxTokens?: number;
31
+ engineID?: string;
32
+ responseFormat?: AIChatOptionsResponseFormatDTO;
33
+ requestContext?: AIRequestContextDTO;
34
+ }
35
+ interface AIIntentDTO {
36
+ capabilityID: string;
37
+ params?: object;
38
+ confidence?: number;
39
+ reason?: string;
40
+ output?: unknown;
41
+ }
42
+ interface AICapabilityDTO {
43
+ id: string;
44
+ description: string;
45
+ }
46
+ interface AIPageContextDTO {
47
+ location?: string;
48
+ data?: unknown;
49
+ }
50
+ interface AIChatWithIntentOptionsDTO extends AIChatOptionsDTO {
51
+ capabilities?: AICapabilityDTO[];
52
+ pageContext?: AIPageContextDTO | null;
53
+ }
54
+
55
+ /** A single role message in a prompt (system, user, assistant, etc.) */
56
+ interface AIPromptRoleDTO {
57
+ /** Role type: system | user | assistant */
58
+ role: "system" | "user" | "assistant";
59
+ /**
60
+ * Content of the message.
61
+ * Can include placeholders like {{var:name}} or {{prompt:other.prompt.id}}.
62
+ */
63
+ content: string;
64
+ }
65
+ interface AISessionConfigDTO {
66
+ id: string;
67
+ messages?: AIPromptRoleDTO[];
68
+ priority?: number;
69
+ slot?: string;
70
+ }
71
+
72
+ /**
73
+ * Runtime value (empty on purpose) so consumers can:
74
+ * import { ATDomainDTO } from "at-shared-types"
75
+ * and then use:
76
+ * ATDomainDTO.SomeType
77
+ */
78
+ declare const ATDomainDTO: {};
79
+ /**
80
+ * Namespace holds ONLY types (and could hold values too if you ever need).
81
+ * TS merges this with the const above.
82
+ */
83
+ declare namespace ATDomainDTO {
84
+ type ATChatMessageContentDTO = ATChatMessageContentDTO;
85
+ type AIChatMessageDTO = AIChatMessageDTO;
86
+ type AIChatOptionsResponseFormatDTO = AIChatOptionsResponseFormatDTO;
87
+ type AIRequestContextDTO = AIRequestContextDTO;
88
+ type AIChatOptionsDTO = AIChatOptionsDTO;
89
+ type AIIntentDTO = AIIntentDTO;
90
+ type AICapabilityDTO = AICapabilityDTO;
91
+ type AIPageContextDTO = AIPageContextDTO;
92
+ type AIChatWithIntentOptionsDTO = AIChatWithIntentOptionsDTO;
93
+ type AIPromptRoleDTO = AIPromptRoleDTO;
94
+ type AISessionConfigDTO = AISessionConfigDTO;
95
+ }
96
+
97
+ type SnakeCase<S extends string> = S extends `${infer H}${infer T}` ? T extends Uncapitalize<T> ? `${Lowercase<H>}${SnakeCase<T>}` : `${Lowercase<H>}_${SnakeCase<Uncapitalize<T>>}` : S;
98
+ type CamelCase<S extends string> = S extends `${infer A}_${infer B}` ? `${A}${Capitalize<CamelCase<B>>}` : S;
99
+ type Primitive = string | number | boolean | bigint | symbol | null | undefined;
100
+ type Builtin = Primitive | Date | RegExp | Error;
101
+ type DeepSnakeKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
102
+ [I in keyof T]: DeepSnakeKeys<T[I]>;
103
+ } : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepSnakeKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepSnakeKeys<K>, DeepSnakeKeys<V>> : T extends Set<infer U> ? Set<DeepSnakeKeys<U>> : T extends object ? {
104
+ [K in keyof T as K extends string ? SnakeCase<K> : K]: DeepSnakeKeys<T[K]>;
105
+ } : T;
106
+ type DeepCamelKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
107
+ [I in keyof T]: DeepCamelKeys<T[I]>;
108
+ } : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepCamelKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepCamelKeys<K>, DeepCamelKeys<V>> : T extends Set<infer U> ? Set<DeepCamelKeys<U>> : T extends object ? {
109
+ [K in keyof T as K extends string ? CamelCase<K> : K]: DeepCamelKeys<T[K]>;
110
+ } : T;
111
+
112
+ type case_types_CamelCase<S extends string> = CamelCase<S>;
113
+ type case_types_DeepCamelKeys<T> = DeepCamelKeys<T>;
114
+ type case_types_DeepSnakeKeys<T> = DeepSnakeKeys<T>;
115
+ type case_types_SnakeCase<S extends string> = SnakeCase<S>;
116
+ declare namespace case_types {
117
+ export type { case_types_CamelCase as CamelCase, case_types_DeepCamelKeys as DeepCamelKeys, case_types_DeepSnakeKeys as DeepSnakeKeys, case_types_SnakeCase as SnakeCase };
118
+ }
119
+
120
+ declare const toSnakeKey: (k: string) => string;
121
+ declare const toCamelKey: (k: string) => string;
122
+ declare function toSnakeDeep<T>(value: T, exceptions?: Set<string>): any;
123
+ declare function toCamelDeep<T>(value: T): any;
124
+
125
+ declare const case_runtime_toCamelDeep: typeof toCamelDeep;
126
+ declare const case_runtime_toCamelKey: typeof toCamelKey;
127
+ declare const case_runtime_toSnakeDeep: typeof toSnakeDeep;
128
+ declare const case_runtime_toSnakeKey: typeof toSnakeKey;
129
+ declare namespace case_runtime {
130
+ export { case_runtime_toCamelDeep as toCamelDeep, case_runtime_toCamelKey as toCamelKey, case_runtime_toSnakeDeep as toSnakeDeep, case_runtime_toSnakeKey as toSnakeKey };
131
+ }
132
+
133
+ type index_CamelCase<S extends string> = CamelCase<S>;
134
+ type index_DeepCamelKeys<T> = DeepCamelKeys<T>;
135
+ type index_DeepSnakeKeys<T> = DeepSnakeKeys<T>;
136
+ type index_SnakeCase<S extends string> = SnakeCase<S>;
137
+ declare const index_toCamelDeep: typeof toCamelDeep;
138
+ declare const index_toCamelKey: typeof toCamelKey;
139
+ declare const index_toSnakeDeep: typeof toSnakeDeep;
140
+ declare const index_toSnakeKey: typeof toSnakeKey;
141
+ declare namespace index {
142
+ export { type index_CamelCase as CamelCase, type index_DeepCamelKeys as DeepCamelKeys, type index_DeepSnakeKeys as DeepSnakeKeys, case_runtime as Runtime, type index_SnakeCase as SnakeCase, case_types as Types, index_toCamelDeep as toCamelDeep, index_toCamelKey as toCamelKey, index_toSnakeDeep as toSnakeDeep, index_toSnakeKey as toSnakeKey };
143
+ }
144
+
145
+ type AIChatMessageWireDTO = DeepSnakeKeys<AIChatMessageDTO>;
146
+ type AIChatOptionsWireDTO = DeepSnakeKeys<AIChatOptionsDTO>;
147
+ type AIRequestContextWireDTO = DeepSnakeKeys<AIRequestContextDTO>;
148
+ type AIChatWithIntentOptionsWireDTO = DeepSnakeKeys<AIChatWithIntentOptionsDTO>;
149
+ type AIIntentWireDTO = DeepSnakeKeys<AIIntentDTO>;
150
+ type AICapabilityWireDTO = DeepSnakeKeys<AICapabilityDTO>;
151
+ type AIPageContextWireDTO = DeepSnakeKeys<AIPageContextDTO>;
152
+ type AISessionConfigWireDTO = DeepSnakeKeys<AISessionConfigDTO>;
153
+
154
+ interface AIChatRequestDTO {
155
+ session_id: string;
156
+ messages: AIChatMessageWireDTO[];
157
+ options?: AIChatWithIntentOptionsWireDTO;
158
+ }
159
+
160
+ interface AIChatResponseDTO {
161
+ message: AIChatMessageWireDTO;
162
+ usage?: {
163
+ tokens?: number;
164
+ };
165
+ raw?: any;
166
+ debug?: any;
167
+ }
168
+
169
+ interface AIChatWithIntentRequestDTO {
170
+ session_id: string;
171
+ messages: AIChatMessageWireDTO[];
172
+ options?: AIChatWithIntentOptionsWireDTO;
173
+ }
174
+
175
+ interface AIChatWithIntentResponseDTO extends AIChatResponseDTO {
176
+ intents?: AIIntentWireDTO[];
177
+ }
178
+
179
+ declare const ATAPIErrorCodeDTO: {
180
+ readonly AI_SESSION_EXPIRED: 4501;
181
+ readonly AI_SESSION_NOT_FOUND: 4502;
182
+ readonly AI_REQUEST_CONTEXT_MISSING: 4503;
183
+ };
184
+ type ATAPIErrorCodeDTO = typeof ATAPIErrorCodeDTO[keyof typeof ATAPIErrorCodeDTO];
185
+
186
+ interface ResponseSuccessDTO<T> {
187
+ code: number;
188
+ data: T;
189
+ }
190
+ interface ResponseErrorDTO {
191
+ code: number;
192
+ message: string;
193
+ errors?: any[];
194
+ timestamp: string;
195
+ }
196
+
197
+ declare const ATTransportDTO: {
198
+ readonly ATAPIErrorCodeDTO: {
199
+ readonly AI_SESSION_EXPIRED: 4501;
200
+ readonly AI_SESSION_NOT_FOUND: 4502;
201
+ readonly AI_REQUEST_CONTEXT_MISSING: 4503;
202
+ };
203
+ };
204
+ declare namespace ATTransportDTO {
205
+ type ATAPIErrorCodeDTO = ATAPIErrorCodeDTO;
206
+ type ResponseSuccessDTO<T> = ResponseSuccessDTO<T>;
207
+ type ResponseErrorDTO = ResponseErrorDTO;
208
+ type AIChatRequestDTO = AIChatRequestDTO;
209
+ type AIChatResponseDTO = AIChatResponseDTO;
210
+ type AIChatWithIntentRequestDTO = AIChatWithIntentRequestDTO;
211
+ type AIChatWithIntentResponseDTO = AIChatWithIntentResponseDTO;
212
+ type AIChatMessageWireDTO = AIChatMessageWireDTO;
213
+ type AIChatOptionsWireDTO = AIChatOptionsWireDTO;
214
+ type AIRequestContextWireDTO = AIRequestContextWireDTO;
215
+ type AIChatWithIntentOptionsWireDTO = AIChatWithIntentOptionsWireDTO;
216
+ type AIIntentWireDTO = AIIntentWireDTO;
217
+ type AICapabilityWireDTO = AICapabilityWireDTO;
218
+ type AIPageContextWireDTO = AIPageContextWireDTO;
219
+ type AISessionConfigWireDTO = AISessionConfigWireDTO;
220
+ }
221
+
222
+ export { ATDomainDTO, ATTransportDTO, index as Casing };
@@ -0,0 +1,222 @@
1
+ type ATChatMessageContentDTO = string | null;
2
+ /**
3
+ * Internal representation — can include nulls for assistant messages, etc.
4
+ */
5
+ type AIChatMessageDTO = {
6
+ role: "system";
7
+ content: ATChatMessageContentDTO;
8
+ } | {
9
+ role: "user";
10
+ content: ATChatMessageContentDTO;
11
+ } | {
12
+ role: "assistant";
13
+ content: ATChatMessageContentDTO;
14
+ };
15
+ type AIChatOptionsResponseFormatDTO = {
16
+ type: "text";
17
+ } | {
18
+ type: "json";
19
+ jsonSchema?: Record<string, any>;
20
+ };
21
+ interface AIRequestContextDTO {
22
+ messages?: AIChatMessageDTO[];
23
+ sessionID?: string;
24
+ engine?: string;
25
+ engineType?: string;
26
+ }
27
+ interface AIChatOptionsDTO {
28
+ model?: string;
29
+ temperature?: number;
30
+ maxTokens?: number;
31
+ engineID?: string;
32
+ responseFormat?: AIChatOptionsResponseFormatDTO;
33
+ requestContext?: AIRequestContextDTO;
34
+ }
35
+ interface AIIntentDTO {
36
+ capabilityID: string;
37
+ params?: object;
38
+ confidence?: number;
39
+ reason?: string;
40
+ output?: unknown;
41
+ }
42
+ interface AICapabilityDTO {
43
+ id: string;
44
+ description: string;
45
+ }
46
+ interface AIPageContextDTO {
47
+ location?: string;
48
+ data?: unknown;
49
+ }
50
+ interface AIChatWithIntentOptionsDTO extends AIChatOptionsDTO {
51
+ capabilities?: AICapabilityDTO[];
52
+ pageContext?: AIPageContextDTO | null;
53
+ }
54
+
55
+ /** A single role message in a prompt (system, user, assistant, etc.) */
56
+ interface AIPromptRoleDTO {
57
+ /** Role type: system | user | assistant */
58
+ role: "system" | "user" | "assistant";
59
+ /**
60
+ * Content of the message.
61
+ * Can include placeholders like {{var:name}} or {{prompt:other.prompt.id}}.
62
+ */
63
+ content: string;
64
+ }
65
+ interface AISessionConfigDTO {
66
+ id: string;
67
+ messages?: AIPromptRoleDTO[];
68
+ priority?: number;
69
+ slot?: string;
70
+ }
71
+
72
+ /**
73
+ * Runtime value (empty on purpose) so consumers can:
74
+ * import { ATDomainDTO } from "at-shared-types"
75
+ * and then use:
76
+ * ATDomainDTO.SomeType
77
+ */
78
+ declare const ATDomainDTO: {};
79
+ /**
80
+ * Namespace holds ONLY types (and could hold values too if you ever need).
81
+ * TS merges this with the const above.
82
+ */
83
+ declare namespace ATDomainDTO {
84
+ type ATChatMessageContentDTO = ATChatMessageContentDTO;
85
+ type AIChatMessageDTO = AIChatMessageDTO;
86
+ type AIChatOptionsResponseFormatDTO = AIChatOptionsResponseFormatDTO;
87
+ type AIRequestContextDTO = AIRequestContextDTO;
88
+ type AIChatOptionsDTO = AIChatOptionsDTO;
89
+ type AIIntentDTO = AIIntentDTO;
90
+ type AICapabilityDTO = AICapabilityDTO;
91
+ type AIPageContextDTO = AIPageContextDTO;
92
+ type AIChatWithIntentOptionsDTO = AIChatWithIntentOptionsDTO;
93
+ type AIPromptRoleDTO = AIPromptRoleDTO;
94
+ type AISessionConfigDTO = AISessionConfigDTO;
95
+ }
96
+
97
+ type SnakeCase<S extends string> = S extends `${infer H}${infer T}` ? T extends Uncapitalize<T> ? `${Lowercase<H>}${SnakeCase<T>}` : `${Lowercase<H>}_${SnakeCase<Uncapitalize<T>>}` : S;
98
+ type CamelCase<S extends string> = S extends `${infer A}_${infer B}` ? `${A}${Capitalize<CamelCase<B>>}` : S;
99
+ type Primitive = string | number | boolean | bigint | symbol | null | undefined;
100
+ type Builtin = Primitive | Date | RegExp | Error;
101
+ type DeepSnakeKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
102
+ [I in keyof T]: DeepSnakeKeys<T[I]>;
103
+ } : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepSnakeKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepSnakeKeys<K>, DeepSnakeKeys<V>> : T extends Set<infer U> ? Set<DeepSnakeKeys<U>> : T extends object ? {
104
+ [K in keyof T as K extends string ? SnakeCase<K> : K]: DeepSnakeKeys<T[K]>;
105
+ } : T;
106
+ type DeepCamelKeys<T> = T extends Builtin ? T : T extends (...args: any[]) => any ? T : T extends readonly [any, ...any[]] ? {
107
+ [I in keyof T]: DeepCamelKeys<T[I]>;
108
+ } : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepCamelKeys<U>> : T extends Map<infer K, infer V> ? Map<DeepCamelKeys<K>, DeepCamelKeys<V>> : T extends Set<infer U> ? Set<DeepCamelKeys<U>> : T extends object ? {
109
+ [K in keyof T as K extends string ? CamelCase<K> : K]: DeepCamelKeys<T[K]>;
110
+ } : T;
111
+
112
+ type case_types_CamelCase<S extends string> = CamelCase<S>;
113
+ type case_types_DeepCamelKeys<T> = DeepCamelKeys<T>;
114
+ type case_types_DeepSnakeKeys<T> = DeepSnakeKeys<T>;
115
+ type case_types_SnakeCase<S extends string> = SnakeCase<S>;
116
+ declare namespace case_types {
117
+ export type { case_types_CamelCase as CamelCase, case_types_DeepCamelKeys as DeepCamelKeys, case_types_DeepSnakeKeys as DeepSnakeKeys, case_types_SnakeCase as SnakeCase };
118
+ }
119
+
120
+ declare const toSnakeKey: (k: string) => string;
121
+ declare const toCamelKey: (k: string) => string;
122
+ declare function toSnakeDeep<T>(value: T, exceptions?: Set<string>): any;
123
+ declare function toCamelDeep<T>(value: T): any;
124
+
125
+ declare const case_runtime_toCamelDeep: typeof toCamelDeep;
126
+ declare const case_runtime_toCamelKey: typeof toCamelKey;
127
+ declare const case_runtime_toSnakeDeep: typeof toSnakeDeep;
128
+ declare const case_runtime_toSnakeKey: typeof toSnakeKey;
129
+ declare namespace case_runtime {
130
+ export { case_runtime_toCamelDeep as toCamelDeep, case_runtime_toCamelKey as toCamelKey, case_runtime_toSnakeDeep as toSnakeDeep, case_runtime_toSnakeKey as toSnakeKey };
131
+ }
132
+
133
+ type index_CamelCase<S extends string> = CamelCase<S>;
134
+ type index_DeepCamelKeys<T> = DeepCamelKeys<T>;
135
+ type index_DeepSnakeKeys<T> = DeepSnakeKeys<T>;
136
+ type index_SnakeCase<S extends string> = SnakeCase<S>;
137
+ declare const index_toCamelDeep: typeof toCamelDeep;
138
+ declare const index_toCamelKey: typeof toCamelKey;
139
+ declare const index_toSnakeDeep: typeof toSnakeDeep;
140
+ declare const index_toSnakeKey: typeof toSnakeKey;
141
+ declare namespace index {
142
+ export { type index_CamelCase as CamelCase, type index_DeepCamelKeys as DeepCamelKeys, type index_DeepSnakeKeys as DeepSnakeKeys, case_runtime as Runtime, type index_SnakeCase as SnakeCase, case_types as Types, index_toCamelDeep as toCamelDeep, index_toCamelKey as toCamelKey, index_toSnakeDeep as toSnakeDeep, index_toSnakeKey as toSnakeKey };
143
+ }
144
+
145
+ type AIChatMessageWireDTO = DeepSnakeKeys<AIChatMessageDTO>;
146
+ type AIChatOptionsWireDTO = DeepSnakeKeys<AIChatOptionsDTO>;
147
+ type AIRequestContextWireDTO = DeepSnakeKeys<AIRequestContextDTO>;
148
+ type AIChatWithIntentOptionsWireDTO = DeepSnakeKeys<AIChatWithIntentOptionsDTO>;
149
+ type AIIntentWireDTO = DeepSnakeKeys<AIIntentDTO>;
150
+ type AICapabilityWireDTO = DeepSnakeKeys<AICapabilityDTO>;
151
+ type AIPageContextWireDTO = DeepSnakeKeys<AIPageContextDTO>;
152
+ type AISessionConfigWireDTO = DeepSnakeKeys<AISessionConfigDTO>;
153
+
154
+ interface AIChatRequestDTO {
155
+ session_id: string;
156
+ messages: AIChatMessageWireDTO[];
157
+ options?: AIChatWithIntentOptionsWireDTO;
158
+ }
159
+
160
+ interface AIChatResponseDTO {
161
+ message: AIChatMessageWireDTO;
162
+ usage?: {
163
+ tokens?: number;
164
+ };
165
+ raw?: any;
166
+ debug?: any;
167
+ }
168
+
169
+ interface AIChatWithIntentRequestDTO {
170
+ session_id: string;
171
+ messages: AIChatMessageWireDTO[];
172
+ options?: AIChatWithIntentOptionsWireDTO;
173
+ }
174
+
175
+ interface AIChatWithIntentResponseDTO extends AIChatResponseDTO {
176
+ intents?: AIIntentWireDTO[];
177
+ }
178
+
179
+ declare const ATAPIErrorCodeDTO: {
180
+ readonly AI_SESSION_EXPIRED: 4501;
181
+ readonly AI_SESSION_NOT_FOUND: 4502;
182
+ readonly AI_REQUEST_CONTEXT_MISSING: 4503;
183
+ };
184
+ type ATAPIErrorCodeDTO = typeof ATAPIErrorCodeDTO[keyof typeof ATAPIErrorCodeDTO];
185
+
186
+ interface ResponseSuccessDTO<T> {
187
+ code: number;
188
+ data: T;
189
+ }
190
+ interface ResponseErrorDTO {
191
+ code: number;
192
+ message: string;
193
+ errors?: any[];
194
+ timestamp: string;
195
+ }
196
+
197
+ declare const ATTransportDTO: {
198
+ readonly ATAPIErrorCodeDTO: {
199
+ readonly AI_SESSION_EXPIRED: 4501;
200
+ readonly AI_SESSION_NOT_FOUND: 4502;
201
+ readonly AI_REQUEST_CONTEXT_MISSING: 4503;
202
+ };
203
+ };
204
+ declare namespace ATTransportDTO {
205
+ type ATAPIErrorCodeDTO = ATAPIErrorCodeDTO;
206
+ type ResponseSuccessDTO<T> = ResponseSuccessDTO<T>;
207
+ type ResponseErrorDTO = ResponseErrorDTO;
208
+ type AIChatRequestDTO = AIChatRequestDTO;
209
+ type AIChatResponseDTO = AIChatResponseDTO;
210
+ type AIChatWithIntentRequestDTO = AIChatWithIntentRequestDTO;
211
+ type AIChatWithIntentResponseDTO = AIChatWithIntentResponseDTO;
212
+ type AIChatMessageWireDTO = AIChatMessageWireDTO;
213
+ type AIChatOptionsWireDTO = AIChatOptionsWireDTO;
214
+ type AIRequestContextWireDTO = AIRequestContextWireDTO;
215
+ type AIChatWithIntentOptionsWireDTO = AIChatWithIntentOptionsWireDTO;
216
+ type AIIntentWireDTO = AIIntentWireDTO;
217
+ type AICapabilityWireDTO = AICapabilityWireDTO;
218
+ type AIPageContextWireDTO = AIPageContextWireDTO;
219
+ type AISessionConfigWireDTO = AISessionConfigWireDTO;
220
+ }
221
+
222
+ export { ATDomainDTO, ATTransportDTO, index as Casing };
package/dist/index.js ADDED
@@ -0,0 +1,79 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/at-domain-dto.ts
8
+ var ATDomainDTO = {};
9
+
10
+ // src/core/transport/errors.ts
11
+ var ATAPIErrorCodeDTO = {
12
+ // 45xx – AI / workflow
13
+ AI_SESSION_EXPIRED: 4501,
14
+ AI_SESSION_NOT_FOUND: 4502,
15
+ AI_REQUEST_CONTEXT_MISSING: 4503
16
+ };
17
+
18
+ // src/at-transport-dto.ts
19
+ var ATTransportDTO = {
20
+ ATAPIErrorCodeDTO
21
+ };
22
+
23
+ // src/casing/index.ts
24
+ var casing_exports = {};
25
+ __export(casing_exports, {
26
+ Runtime: () => case_runtime_exports,
27
+ Types: () => case_types_exports,
28
+ toCamelDeep: () => toCamelDeep,
29
+ toCamelKey: () => toCamelKey,
30
+ toSnakeDeep: () => toSnakeDeep,
31
+ toSnakeKey: () => toSnakeKey
32
+ });
33
+
34
+ // src/casing/case.types.ts
35
+ var case_types_exports = {};
36
+
37
+ // src/casing/case.runtime.ts
38
+ var case_runtime_exports = {};
39
+ __export(case_runtime_exports, {
40
+ toCamelDeep: () => toCamelDeep,
41
+ toCamelKey: () => toCamelKey,
42
+ toSnakeDeep: () => toSnakeDeep,
43
+ toSnakeKey: () => toSnakeKey
44
+ });
45
+ var CAMEL_TO_SNAKE = /[A-Z]/g;
46
+ var SNAKE_TO_CAMEL = /_([a-z])/g;
47
+ var toSnakeKey = (k) => k.replace(CAMEL_TO_SNAKE, (m) => `_${m.toLowerCase()}`);
48
+ var toCamelKey = (k) => k.replace(SNAKE_TO_CAMEL, (_, c) => c.toUpperCase());
49
+ function toSnakeDeep(value, exceptions = /* @__PURE__ */ new Set()) {
50
+ if (Array.isArray(value)) return value.map((v) => toSnakeDeep(v, exceptions));
51
+ if (value instanceof Date) return value;
52
+ if (value && typeof value === "object") {
53
+ const out = {};
54
+ for (const [k, v] of Object.entries(value)) {
55
+ const nk = exceptions.has(k) ? k : toSnakeKey(k);
56
+ out[nk] = toSnakeDeep(v, exceptions);
57
+ }
58
+ return out;
59
+ }
60
+ return value;
61
+ }
62
+ function toCamelDeep(value) {
63
+ if (Array.isArray(value)) return value.map(toCamelDeep);
64
+ if (value instanceof Date) return value;
65
+ if (value && typeof value === "object") {
66
+ const out = {};
67
+ for (const [k, v] of Object.entries(value)) {
68
+ out[toCamelKey(k)] = toCamelDeep(v);
69
+ }
70
+ return out;
71
+ }
72
+ return value;
73
+ }
74
+ export {
75
+ ATDomainDTO,
76
+ ATTransportDTO,
77
+ casing_exports as Casing
78
+ };
79
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/at-domain-dto.ts","../src/core/transport/errors.ts","../src/at-transport-dto.ts","../src/casing/index.ts","../src/casing/case.types.ts","../src/casing/case.runtime.ts"],"sourcesContent":["import type * as Engine from \"./ai/domain/engine\";\r\nimport type * as Session from \"./ai/domain/session\";\r\n\r\n/**\r\n * Runtime value (empty on purpose) so consumers can:\r\n * import { ATDomainDTO } from \"at-shared-types\"\r\n * and then use:\r\n * ATDomainDTO.SomeType\r\n */\r\nexport const ATDomainDTO = {} as const;\r\n\r\n/**\r\n * Namespace holds ONLY types (and could hold values too if you ever need).\r\n * TS merges this with the const above.\r\n */\r\nexport namespace ATDomainDTO {\r\n export type ATChatMessageContentDTO = Engine.ATChatMessageContentDTO;\r\n\r\n export type AIChatMessageDTO = Engine.AIChatMessageDTO;\r\n export type AIChatOptionsResponseFormatDTO = Engine.AIChatOptionsResponseFormatDTO;\r\n\r\n export type AIRequestContextDTO = Engine.AIRequestContextDTO;\r\n export type AIChatOptionsDTO = Engine.AIChatOptionsDTO;\r\n\r\n export type AIIntentDTO = Engine.AIIntentDTO;\r\n export type AICapabilityDTO = Engine.AICapabilityDTO;\r\n export type AIPageContextDTO = Engine.AIPageContextDTO;\r\n\r\n export type AIChatWithIntentOptionsDTO = Engine.AIChatWithIntentOptionsDTO;\r\n\r\n export type AIPromptRoleDTO = Session.AIPromptRoleDTO;\r\n export type AISessionConfigDTO = Session.AISessionConfigDTO;\r\n}\r\n","export const ATAPIErrorCodeDTO = {\r\n // 45xx – AI / workflow\r\n AI_SESSION_EXPIRED: 4501,\r\n AI_SESSION_NOT_FOUND: 4502,\r\n AI_REQUEST_CONTEXT_MISSING: 4503,\r\n} as const;\r\n\r\nexport type ATAPIErrorCodeDTO = typeof ATAPIErrorCodeDTO[keyof typeof ATAPIErrorCodeDTO];","import type * as AIWire from \"./ai/transport/wire.types\";\r\nimport type * as AIChat from \"./ai/transport/chat\";\r\nimport {\r\n ATAPIErrorCodeDTO as ATAPIErrorCodeConst,\r\n type ATAPIErrorCodeDTO as ATAPIErrorCodeType,\r\n} from \"./core/transport/errors\";\r\nimport type * as CoreResponses from \"./core/transport/responses\";\r\n\r\nexport const ATTransportDTO = {\r\n ATAPIErrorCodeDTO: ATAPIErrorCodeConst,\r\n} as const;\r\n\r\nexport namespace ATTransportDTO {\r\n // expose the union type\r\n export type ATAPIErrorCodeDTO = ATAPIErrorCodeType;\r\n\r\n // core response DTOs\r\n export type ResponseSuccessDTO<T> = CoreResponses.ResponseSuccessDTO<T>;\r\n export type ResponseErrorDTO = CoreResponses.ResponseErrorDTO;\r\n\r\n // AI transport request/response DTOs\r\n export type AIChatRequestDTO = AIChat.AIChatRequestDTO;\r\n export type AIChatResponseDTO = AIChat.AIChatResponseDTO;\r\n export type AIChatWithIntentRequestDTO = AIChat.AIChatWithIntentRequestDTO;\r\n export type AIChatWithIntentResponseDTO = AIChat.AIChatWithIntentResponseDTO;\r\n\r\n // wire DTOs\r\n export type AIChatMessageWireDTO = AIWire.AIChatMessageWireDTO;\r\n export type AIChatOptionsWireDTO = AIWire.AIChatOptionsWireDTO;\r\n export type AIRequestContextWireDTO = AIWire.AIRequestContextWireDTO;\r\n export type AIChatWithIntentOptionsWireDTO = AIWire.AIChatWithIntentOptionsWireDTO;\r\n\r\n export type AIIntentWireDTO = AIWire.AIIntentWireDTO;\r\n export type AICapabilityWireDTO = AIWire.AICapabilityWireDTO;\r\n export type AIPageContextWireDTO = AIWire.AIPageContextWireDTO;\r\n\r\n export type AISessionConfigWireDTO = AIWire.AISessionConfigWireDTO;\r\n}\r\n","// src/casing/index.ts\r\nexport * from \"./case.types\";\r\nexport * from \"./case.runtime\";\r\n\r\n// (optional) if you still like namespaces, keep them too:\r\nimport * as Types from \"./case.types\";\r\nimport * as Runtime from \"./case.runtime\";\r\nexport { Types, Runtime };\r\n","export type SnakeCase<S extends string> =\r\n S extends `${infer H}${infer T}`\r\n ? T extends Uncapitalize<T>\r\n ? `${Lowercase<H>}${SnakeCase<T>}`\r\n : `${Lowercase<H>}_${SnakeCase<Uncapitalize<T>>}`\r\n : S;\r\n\r\nexport type CamelCase<S extends string> =\r\n S extends `${infer A}_${infer B}`\r\n ? `${A}${Capitalize<CamelCase<B>>}`\r\n : S;\r\n\r\ntype Primitive = string | number | boolean | bigint | symbol | null | undefined;\r\ntype Builtin = Primitive | Date | RegExp | Error;\r\n\r\nexport type DeepSnakeKeys<T> =\r\n T extends Builtin ? T :\r\n T extends (...args: any[]) => any ? T :\r\n T extends readonly [any, ...any[]]\r\n ? { [I in keyof T]: DeepSnakeKeys<T[I]> } :\r\n T extends ReadonlyArray<infer U>\r\n ? ReadonlyArray<DeepSnakeKeys<U>> :\r\n T extends Map<infer K, infer V>\r\n ? Map<DeepSnakeKeys<K>, DeepSnakeKeys<V>> :\r\n T extends Set<infer U>\r\n ? Set<DeepSnakeKeys<U>> :\r\n T extends object\r\n ? { [K in keyof T as K extends string ? SnakeCase<K> : K]: DeepSnakeKeys<T[K]> }\r\n : T;\r\n\r\nexport type DeepCamelKeys<T> =\r\n T extends Builtin ? T :\r\n T extends (...args: any[]) => any ? T :\r\n T extends readonly [any, ...any[]]\r\n ? { [I in keyof T]: DeepCamelKeys<T[I]> } :\r\n T extends ReadonlyArray<infer U>\r\n ? ReadonlyArray<DeepCamelKeys<U>> :\r\n T extends Map<infer K, infer V>\r\n ? Map<DeepCamelKeys<K>, DeepCamelKeys<V>> :\r\n T extends Set<infer U>\r\n ? Set<DeepCamelKeys<U>> :\r\n T extends object\r\n ? { [K in keyof T as K extends string ? CamelCase<K> : K]: DeepCamelKeys<T[K]> }\r\n : T;\r\n","const CAMEL_TO_SNAKE = /[A-Z]/g;\r\nconst SNAKE_TO_CAMEL = /_([a-z])/g;\r\n\r\nexport const toSnakeKey = (k: string) =>\r\n k.replace(CAMEL_TO_SNAKE, m => `_${m.toLowerCase()}`);\r\n\r\nexport const toCamelKey = (k: string) =>\r\n k.replace(SNAKE_TO_CAMEL, (_, c) => c.toUpperCase());\r\n\r\nexport function toSnakeDeep<T>(value: T, exceptions = new Set<string>()): any {\r\n if (Array.isArray(value)) return value.map(v => toSnakeDeep(v, exceptions));\r\n if (value instanceof Date) return value;\r\n if (value && typeof value === \"object\") {\r\n const out: Record<string, any> = {};\r\n for (const [k, v] of Object.entries(value as any)) {\r\n const nk = exceptions.has(k) ? k : toSnakeKey(k);\r\n out[nk] = toSnakeDeep(v, exceptions);\r\n }\r\n return out;\r\n }\r\n return value;\r\n}\r\n\r\nexport function toCamelDeep<T>(value: T): any {\r\n if (Array.isArray(value)) return value.map(toCamelDeep);\r\n if (value instanceof Date) return value;\r\n if (value && typeof value === \"object\") {\r\n const out: Record<string, any> = {};\r\n for (const [k, v] of Object.entries(value as any)) {\r\n out[toCamelKey(k)] = toCamelDeep(v);\r\n }\r\n return out;\r\n }\r\n return value;\r\n}\r\n"],"mappings":";;;;;;;AASO,IAAM,cAAc,CAAC;;;ACTrB,IAAM,oBAAoB;AAAA;AAAA,EAE7B,oBAAoB;AAAA,EACpB,sBAAsB;AAAA,EACtB,4BAA4B;AAChC;;;ACGO,IAAM,iBAAiB;AAAA,EAC1B;AACJ;;;ACVA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AAEhB,IAAM,aAAa,CAAC,MACvB,EAAE,QAAQ,gBAAgB,OAAK,IAAI,EAAE,YAAY,CAAC,EAAE;AAEjD,IAAM,aAAa,CAAC,MACvB,EAAE,QAAQ,gBAAgB,CAAC,GAAG,MAAM,EAAE,YAAY,CAAC;AAEhD,SAAS,YAAe,OAAU,aAAa,oBAAI,IAAY,GAAQ;AAC1E,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,IAAI,OAAK,YAAY,GAAG,UAAU,CAAC;AAC1E,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,SAAS,OAAO,UAAU,UAAU;AACpC,UAAM,MAA2B,CAAC;AAClC,eAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAY,GAAG;AAC/C,YAAM,KAAK,WAAW,IAAI,CAAC,IAAI,IAAI,WAAW,CAAC;AAC/C,UAAI,EAAE,IAAI,YAAY,GAAG,UAAU;AAAA,IACvC;AACA,WAAO;AAAA,EACX;AACA,SAAO;AACX;AAEO,SAAS,YAAe,OAAe;AAC1C,MAAI,MAAM,QAAQ,KAAK,EAAG,QAAO,MAAM,IAAI,WAAW;AACtD,MAAI,iBAAiB,KAAM,QAAO;AAClC,MAAI,SAAS,OAAO,UAAU,UAAU;AACpC,UAAM,MAA2B,CAAC;AAClC,eAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,KAAY,GAAG;AAC/C,UAAI,WAAW,CAAC,CAAC,IAAI,YAAY,CAAC;AAAA,IACtC;AACA,WAAO;AAAA,EACX;AACA,SAAO;AACX;","names":[]}