@cobol-ts/ai 0.0.0-stage → 0.0.18

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 CHANGED
@@ -1,3 +1,5 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # `@cobol-ts/ai`
2
+
3
+ Asynchronous, provider-independent TypeScript interface matching the **OpenAI Chat Completions** request/response envelope and call path (`client.chat.completions.create`). Only the string-content, non-streaming subset needed for the first reverse-engineering loop is represented; tool calls and other OpenAI fields may be added later.
4
+
5
+ This package knows nothing about COBOL, characteristic repositories, YAML, filesystem paths or mock responses. There is deliberately no SDK dependency. A production OpenAI adapter is a separate implementation of `AiClient`.
@@ -0,0 +1 @@
1
+ export * from './src/chat';
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
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("./src/chat"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA0B"}
@@ -0,0 +1,38 @@
1
+ /** The string-content subset of OpenAI's Chat Completions request vocabulary.
2
+ * This is a provider port, not a dependency on an OpenAI SDK.
3
+ * Tool calls and multimodal parts can be added without changing the orchestration. */
4
+ export type ChatRole = 'system' | 'developer' | 'user' | 'assistant' | 'tool';
5
+ export interface ChatMessage {
6
+ readonly role: ChatRole;
7
+ readonly content: string;
8
+ readonly name?: string;
9
+ readonly tool_call_id?: string;
10
+ }
11
+ export interface ChatCompletionCreateParams {
12
+ readonly model: string;
13
+ readonly messages: readonly ChatMessage[];
14
+ readonly temperature?: number;
15
+ }
16
+ export interface ChatCompletion {
17
+ readonly id: string;
18
+ readonly object: 'chat.completion';
19
+ readonly created: number;
20
+ readonly model: string;
21
+ readonly choices: readonly {
22
+ readonly index: number;
23
+ readonly message: {
24
+ readonly role: 'assistant';
25
+ readonly content: string | null;
26
+ };
27
+ readonly finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | null;
28
+ }[];
29
+ }
30
+ /** Match the OpenAI `client.chat.completions.create(...)` call shape.
31
+ * The client may be a real provider, a recording decorator or a mock. */
32
+ export interface AiClient {
33
+ readonly chat: {
34
+ readonly completions: {
35
+ create(params: ChatCompletionCreateParams): Promise<ChatCompletion>;
36
+ };
37
+ };
38
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/chat.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "@cobol-ts/ai",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "OpenAI Chat Completions-shaped asynchronous AI port (no provider implementation)",
4
+ "version": "0.0.18",
5
+ "main": "dist/index",
6
+ "types": "dist/index",
7
+ "browserslist": {
8
+ "development": [
9
+ "last 1 chrome version",
10
+ "last 1 firefox version",
11
+ "last 1 safari version"
12
+ ],
13
+ "production": [
14
+ ">0.2%",
15
+ "not dead",
16
+ "not op_mini all"
17
+ ]
18
+ },
19
+ "dependencies": {},
20
+ "devDependencies": {
21
+ "typescript": "^5.2.2",
22
+ "@testing-library/jest-dom": "^6.1.4",
23
+ "@types/jest": "^29.0.0",
24
+ "@types/node": "^14.0.0",
25
+ "jest": "^29.0.0",
26
+ "ts-jest": "^29.0.0"
27
+ },
28
+ "eslintConfig": {
29
+ "extends": [
30
+ "react-app",
31
+ "react-app/jest"
32
+ ],
33
+ "overrides": [
34
+ {
35
+ "files": [
36
+ "**/*.stories.*"
37
+ ],
38
+ "rules": {
39
+ "import/no-anonymous-default-export": "off"
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ "files": [
45
+ "dist/index.js",
46
+ "dist/index.d.ts",
47
+ "dist/src/",
48
+ "dist/**/*"
49
+ ],
50
+ "keywords": [
51
+ "indexing"
52
+ ],
53
+ "license": "MIT",
54
+ "repository": "git@github.com:intellimaintain/intellimaintain.git",
55
+ "scripts": {
56
+ "test": "jest --config jest.config.json --env node",
57
+ "test:watch": "npm run test -- --watch"
58
+ }
6
59
  }