@neta-art/cohub-protocol 1.5.0 → 1.6.0

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,117 @@
1
+ export type GenerationSource = {
2
+ type: "url";
3
+ url: string;
4
+ } | {
5
+ type: "base64";
6
+ media_type: string;
7
+ data: string;
8
+ } | {
9
+ type: "space_file";
10
+ space_id: string;
11
+ path: string;
12
+ };
13
+ export type GenerationContentBlockMeta = Record<string, unknown>;
14
+ export type GenerationContentBlock = {
15
+ type: "text";
16
+ text: string;
17
+ _meta?: GenerationContentBlockMeta;
18
+ } | {
19
+ type: "image";
20
+ source: GenerationSource;
21
+ _meta?: GenerationContentBlockMeta;
22
+ } | {
23
+ type: "video";
24
+ source: GenerationSource;
25
+ _meta?: GenerationContentBlockMeta;
26
+ } | {
27
+ type: "audio";
28
+ source: GenerationSource;
29
+ _meta?: GenerationContentBlockMeta;
30
+ };
31
+ export type CreateGenerationRequest = {
32
+ model: string;
33
+ content: GenerationContentBlock[];
34
+ parameters?: Record<string, unknown>;
35
+ metadata?: Record<string, unknown>;
36
+ };
37
+ export type GenerationStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled";
38
+ export type Generation = {
39
+ id: string;
40
+ status: GenerationStatus;
41
+ model: string;
42
+ input: GenerationContentBlock[];
43
+ output?: GenerationContentBlock[];
44
+ parameters?: Record<string, unknown>;
45
+ metadata?: Record<string, unknown>;
46
+ error?: {
47
+ code?: string;
48
+ message: string;
49
+ raw?: unknown;
50
+ };
51
+ created_at: string;
52
+ updated_at: string;
53
+ completed_at?: string;
54
+ };
55
+ export type GenerationContentSpec = {
56
+ type: "text" | "image" | "video" | "audio";
57
+ required?: boolean;
58
+ min?: number;
59
+ max?: number;
60
+ sources?: Array<"url" | "base64" | "space_file">;
61
+ merge?: "newline" | "space" | "concat";
62
+ meta?: Record<string, unknown>;
63
+ description?: string;
64
+ };
65
+ export type GenerationParameterSpec = {
66
+ type: "string";
67
+ optional?: boolean;
68
+ default?: string;
69
+ enum?: string[];
70
+ description?: string;
71
+ examples?: string[];
72
+ } | {
73
+ type: "number";
74
+ optional?: boolean;
75
+ default?: number;
76
+ min?: number;
77
+ max?: number;
78
+ description?: string;
79
+ examples?: number[];
80
+ } | {
81
+ type: "integer";
82
+ optional?: boolean;
83
+ default?: number;
84
+ min?: number;
85
+ max?: number;
86
+ description?: string;
87
+ examples?: number[];
88
+ } | {
89
+ type: "boolean";
90
+ optional?: boolean;
91
+ default?: boolean;
92
+ description?: string;
93
+ examples?: boolean[];
94
+ };
95
+ export type GenerationDeclaration = {
96
+ schema: "cohub.generation.v1";
97
+ model: string;
98
+ title?: string;
99
+ description?: string;
100
+ adapter: {
101
+ type: string;
102
+ base_url: string;
103
+ api_key: string;
104
+ };
105
+ content: {
106
+ input: GenerationContentSpec[];
107
+ };
108
+ parameters?: Record<string, GenerationParameterSpec>;
109
+ examples?: Array<{
110
+ title?: string;
111
+ request: CreateGenerationRequest;
112
+ }>;
113
+ };
114
+ export type PublicGenerationDeclaration = Omit<GenerationDeclaration, "adapter">;
115
+ export type ListGenerationDeclarationsResponse = {
116
+ declarations: PublicGenerationDeclaration[];
117
+ };
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -8,3 +8,4 @@ export * from "./gateway/index.js";
8
8
  export * from "./task/index.js";
9
9
  export * from "./fs/index.js";
10
10
  export * from "./ports/index.js";
11
+ export * from "./generation/index.js";
package/dist/index.js CHANGED
@@ -8,3 +8,4 @@ export * from "./gateway/index.js";
8
8
  export * from "./task/index.js";
9
9
  export * from "./fs/index.js";
10
10
  export * from "./ports/index.js";
11
+ export * from "./generation/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub-protocol",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Shared protocol definitions for the Cohub agent collaboration platform.",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
@@ -56,6 +56,10 @@
56
56
  "./ports": {
57
57
  "types": "./dist/ports/index.d.ts",
58
58
  "default": "./dist/ports/index.js"
59
+ },
60
+ "./generation": {
61
+ "types": "./dist/generation/index.d.ts",
62
+ "default": "./dist/generation/index.js"
59
63
  }
60
64
  },
61
65
  "types": "./dist/index.d.ts",