@mozaik-ai/core 0.7.2 → 0.8.1

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Mozaik is a TypeScript library for orchestrating AI agents, supporting both manually defined and AI-generated workflows.
4
4
 
5
- ![Mosaic](https://www.rockform.co.uk/wp-content/uploads/2018/06/Picture6-1.jpg)
5
+ ![mozaik](https://github.com/user-attachments/assets/0fdc15a8-3778-4d0e-bd13-143d04090b9e)
6
6
 
7
7
  ---
8
8
 
package/dist/index.d.mts CHANGED
@@ -54,7 +54,7 @@ interface Tool {
54
54
  invoke: (args: any) => Promise<any>;
55
55
  }
56
56
 
57
- type Command = {
57
+ type MozaikRequest = {
58
58
  model: Model;
59
59
  messages?: Message[];
60
60
  task?: string;
@@ -75,8 +75,8 @@ declare abstract class RequestBuilder {
75
75
 
76
76
  declare abstract class Endpoint {
77
77
  abstract requestBuilder: RequestBuilder;
78
- command: Command | null;
79
- buildRequest(command: Command): any;
78
+ request: MozaikRequest | null;
79
+ buildRequest(request: MozaikRequest): any;
80
80
  abstract sendRequest(providerRequest: any): any;
81
81
  }
82
82
 
@@ -88,13 +88,13 @@ declare class RequestGateway {
88
88
  readonly endpointResolver: EndpointResolver;
89
89
  endpoint: Endpoint;
90
90
  constructor(endpointResolver: EndpointResolver);
91
- invoke(command: Command): Promise<any>;
91
+ invoke(request: MozaikRequest): Promise<any>;
92
92
  }
93
93
 
94
- declare class Agent {
95
- private command;
94
+ declare class MozaikAgent {
95
+ private request;
96
96
  gateway: RequestGateway;
97
- constructor(command: Command);
97
+ constructor(request: MozaikRequest);
98
98
  setModel(model: Model): void;
99
99
  setMessages(messages: Message[]): void;
100
100
  setTask(task: string): void;
@@ -102,9 +102,19 @@ declare class Agent {
102
102
  act(task?: string): Promise<any>;
103
103
  }
104
104
 
105
- declare class PlanningAgent extends Agent {
106
- constructor(command: Command);
105
+ declare class PlanningAgent extends MozaikAgent {
106
+ constructor(request: MozaikRequest);
107
107
  planFromGoal(goal: string): Promise<Workflow>;
108
108
  }
109
109
 
110
- export { Agent, type Command, type Message, type Model, PlanningAgent, Task, type Tool, WorkUnit, Workflow };
110
+ type UsageEntry = {
111
+ inputTokens: number;
112
+ outputTokens: number;
113
+ model: string;
114
+ };
115
+ type MozaikResponse = {
116
+ data: any;
117
+ usageEntries: UsageEntry[];
118
+ };
119
+
120
+ export { type Message, type Model, MozaikAgent, type MozaikRequest, type MozaikResponse, PlanningAgent, Task, type Tool, WorkUnit, Workflow };
package/dist/index.d.ts CHANGED
@@ -54,7 +54,7 @@ interface Tool {
54
54
  invoke: (args: any) => Promise<any>;
55
55
  }
56
56
 
57
- type Command = {
57
+ type MozaikRequest = {
58
58
  model: Model;
59
59
  messages?: Message[];
60
60
  task?: string;
@@ -75,8 +75,8 @@ declare abstract class RequestBuilder {
75
75
 
76
76
  declare abstract class Endpoint {
77
77
  abstract requestBuilder: RequestBuilder;
78
- command: Command | null;
79
- buildRequest(command: Command): any;
78
+ request: MozaikRequest | null;
79
+ buildRequest(request: MozaikRequest): any;
80
80
  abstract sendRequest(providerRequest: any): any;
81
81
  }
82
82
 
@@ -88,13 +88,13 @@ declare class RequestGateway {
88
88
  readonly endpointResolver: EndpointResolver;
89
89
  endpoint: Endpoint;
90
90
  constructor(endpointResolver: EndpointResolver);
91
- invoke(command: Command): Promise<any>;
91
+ invoke(request: MozaikRequest): Promise<any>;
92
92
  }
93
93
 
94
- declare class Agent {
95
- private command;
94
+ declare class MozaikAgent {
95
+ private request;
96
96
  gateway: RequestGateway;
97
- constructor(command: Command);
97
+ constructor(request: MozaikRequest);
98
98
  setModel(model: Model): void;
99
99
  setMessages(messages: Message[]): void;
100
100
  setTask(task: string): void;
@@ -102,9 +102,19 @@ declare class Agent {
102
102
  act(task?: string): Promise<any>;
103
103
  }
104
104
 
105
- declare class PlanningAgent extends Agent {
106
- constructor(command: Command);
105
+ declare class PlanningAgent extends MozaikAgent {
106
+ constructor(request: MozaikRequest);
107
107
  planFromGoal(goal: string): Promise<Workflow>;
108
108
  }
109
109
 
110
- export { Agent, type Command, type Message, type Model, PlanningAgent, Task, type Tool, WorkUnit, Workflow };
110
+ type UsageEntry = {
111
+ inputTokens: number;
112
+ outputTokens: number;
113
+ model: string;
114
+ };
115
+ type MozaikResponse = {
116
+ data: any;
117
+ usageEntries: UsageEntry[];
118
+ };
119
+
120
+ export { type Message, type Model, MozaikAgent, type MozaikRequest, type MozaikResponse, PlanningAgent, Task, type Tool, WorkUnit, Workflow };