@mappies/miniwat-agent 0.1.0 → 0.2.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.
- package/dist/index.cjs +22 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,7 +20,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
Agent: () => Agent
|
|
23
|
+
Agent: () => Agent,
|
|
24
|
+
AgentConfig: () => AgentConfig,
|
|
25
|
+
Session: () => Session
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(index_exports);
|
|
26
28
|
|
|
@@ -38,8 +40,26 @@ var Agent = class {
|
|
|
38
40
|
return await this.model.stream(session.messages, { ...option, instruction: this.instruction });
|
|
39
41
|
}
|
|
40
42
|
};
|
|
43
|
+
|
|
44
|
+
// src/entities/agentConfig.ts
|
|
45
|
+
var AgentConfig = class {
|
|
46
|
+
constructor(data) {
|
|
47
|
+
this.instruction = data.instruction;
|
|
48
|
+
this.model = data.model;
|
|
49
|
+
this.toolDispatcher = data.toolDispatcher;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/entities/session.ts
|
|
54
|
+
var Session = class {
|
|
55
|
+
constructor(data) {
|
|
56
|
+
this.messages = data?.messages || [];
|
|
57
|
+
}
|
|
58
|
+
};
|
|
41
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
60
|
0 && (module.exports = {
|
|
43
|
-
Agent
|
|
61
|
+
Agent,
|
|
62
|
+
AgentConfig,
|
|
63
|
+
Session
|
|
44
64
|
});
|
|
45
65
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/entities/agent.ts"],"sourcesContent":["export { Agent } from './entities/agent';\nexport { AgentConfig } from './entities/agentConfig';\nexport { Session } from './entities/session';","import { Model, ModelOption, ResponseMessage, Instruction } from \"@mappies/miniwat-agent-core\";\nimport { AgentConfig } from \"./agentConfig\";\nimport { ToolDispatcher } from \"@mappies/miniwat-mcp-core\";\nimport { Readable } from \"stream\";\nimport { Session } from \"./session\";\n\nexport class Agent\n{\n public readonly instruction
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/entities/agent.ts","../src/entities/agentConfig.ts","../src/entities/session.ts"],"sourcesContent":["export { Agent } from './entities/agent';\nexport { AgentConfig } from './entities/agentConfig';\nexport { Session } from './entities/session';","import { Model, ModelOption, ResponseMessage, Instruction } from \"@mappies/miniwat-agent-core\";\nimport { AgentConfig } from \"./agentConfig\";\nimport { ToolDispatcher } from \"@mappies/miniwat-mcp-core\";\nimport { Readable } from \"stream\";\nimport { Session } from \"./session\";\n\nexport class Agent\n{\n public readonly instruction?: Instruction\n public readonly model: Model;\n public readonly toolDispatcher?: ToolDispatcher;\n\n constructor(config: AgentConfig)\n {\n this.model = config.model;\n this.instruction = config.instruction;\n this.toolDispatcher = config.toolDispatcher;\n }\n\n async invoke(session: Session, option?: Omit<ModelOption, 'instruction'>): Promise<ResponseMessage>\n {\n return await this.model.invoke(session.messages, {...option, instruction: this.instruction});\n }\n\n async stream(session: Session, option?: Omit<ModelOption, 'instruction'>): Promise<Readable>\n {\n return await this.model.stream(session.messages, {...option, instruction: this.instruction});\n }\n}","import { Model, Instruction } from \"@mappies/miniwat-agent-core\";\nimport { ToolDispatcher } from \"@mappies/miniwat-mcp-core\";\n\nexport class AgentConfig \n{\n /**\n * Agent instruction\n */\n instruction?: Instruction;\n\n /**\n * The language model used by this agent.\n */\n model: Model;\n\n /**\n * Tool dispatcher for tools.\n */\n toolDispatcher?: ToolDispatcher;\n\n constructor(data:AgentConfig)\n {\n this.instruction = data.instruction;\n this.model = data.model;\n this.toolDispatcher = data.toolDispatcher;\n }\n}","import { Message } from \"@mappies/miniwat-agent-core\";\n\nexport class Session\n{\n public messages: Message[];\n\n constructor(data?:Partial<Session>)\n {\n this.messages = data?.messages || []\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,QAAN,MACP;AAAA,EAKI,YAAY,QACZ;AACI,SAAK,QAAQ,OAAO;AACpB,SAAK,cAAc,OAAO;AAC1B,SAAK,iBAAiB,OAAO;AAAA,EACjC;AAAA,EAEA,MAAM,OAAO,SAAkB,QAC/B;AACI,WAAO,MAAM,KAAK,MAAM,OAAO,QAAQ,UAAU,EAAC,GAAG,QAAQ,aAAa,KAAK,YAAW,CAAC;AAAA,EAC/F;AAAA,EAEA,MAAM,OAAO,SAAkB,QAC/B;AACI,WAAO,MAAM,KAAK,MAAM,OAAO,QAAQ,UAAU,EAAC,GAAG,QAAQ,aAAa,KAAK,YAAW,CAAC;AAAA,EAC/F;AACJ;;;ACzBO,IAAM,cAAN,MACP;AAAA,EAgBI,YAAY,MACZ;AACI,SAAK,cAAc,KAAK;AACxB,SAAK,QAAQ,KAAK;AAClB,SAAK,iBAAiB,KAAK;AAAA,EAC/B;AACJ;;;ACxBO,IAAM,UAAN,MACP;AAAA,EAGI,YAAY,MACZ;AACI,SAAK,WAAW,MAAM,YAAY,CAAC;AAAA,EACvC;AACJ;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -2,11 +2,11 @@ import { Instruction, Model, Message, ModelOption, ResponseMessage } from '@mapp
|
|
|
2
2
|
import { ToolDispatcher } from '@mappies/miniwat-mcp-core';
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
declare class AgentConfig {
|
|
6
6
|
/**
|
|
7
7
|
* Agent instruction
|
|
8
8
|
*/
|
|
9
|
-
instruction
|
|
9
|
+
instruction?: Instruction;
|
|
10
10
|
/**
|
|
11
11
|
* The language model used by this agent.
|
|
12
12
|
*/
|
|
@@ -15,14 +15,16 @@ interface AgentConfig {
|
|
|
15
15
|
* Tool dispatcher for tools.
|
|
16
16
|
*/
|
|
17
17
|
toolDispatcher?: ToolDispatcher;
|
|
18
|
+
constructor(data: AgentConfig);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
declare class Session {
|
|
21
22
|
messages: Message[];
|
|
23
|
+
constructor(data?: Partial<Session>);
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
declare class Agent {
|
|
25
|
-
readonly instruction
|
|
27
|
+
readonly instruction?: Instruction;
|
|
26
28
|
readonly model: Model;
|
|
27
29
|
readonly toolDispatcher?: ToolDispatcher;
|
|
28
30
|
constructor(config: AgentConfig);
|
|
@@ -30,4 +32,4 @@ declare class Agent {
|
|
|
30
32
|
stream(session: Session, option?: Omit<ModelOption, 'instruction'>): Promise<Readable>;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
export { Agent,
|
|
35
|
+
export { Agent, AgentConfig, Session };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { Instruction, Model, Message, ModelOption, ResponseMessage } from '@mapp
|
|
|
2
2
|
import { ToolDispatcher } from '@mappies/miniwat-mcp-core';
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
declare class AgentConfig {
|
|
6
6
|
/**
|
|
7
7
|
* Agent instruction
|
|
8
8
|
*/
|
|
9
|
-
instruction
|
|
9
|
+
instruction?: Instruction;
|
|
10
10
|
/**
|
|
11
11
|
* The language model used by this agent.
|
|
12
12
|
*/
|
|
@@ -15,14 +15,16 @@ interface AgentConfig {
|
|
|
15
15
|
* Tool dispatcher for tools.
|
|
16
16
|
*/
|
|
17
17
|
toolDispatcher?: ToolDispatcher;
|
|
18
|
+
constructor(data: AgentConfig);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
declare class Session {
|
|
21
22
|
messages: Message[];
|
|
23
|
+
constructor(data?: Partial<Session>);
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
declare class Agent {
|
|
25
|
-
readonly instruction
|
|
27
|
+
readonly instruction?: Instruction;
|
|
26
28
|
readonly model: Model;
|
|
27
29
|
readonly toolDispatcher?: ToolDispatcher;
|
|
28
30
|
constructor(config: AgentConfig);
|
|
@@ -30,4 +32,4 @@ declare class Agent {
|
|
|
30
32
|
stream(session: Session, option?: Omit<ModelOption, 'instruction'>): Promise<Readable>;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
export { Agent,
|
|
35
|
+
export { Agent, AgentConfig, Session };
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,25 @@ var Agent = class {
|
|
|
12
12
|
return await this.model.stream(session.messages, { ...option, instruction: this.instruction });
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
+
|
|
16
|
+
// src/entities/agentConfig.ts
|
|
17
|
+
var AgentConfig = class {
|
|
18
|
+
constructor(data) {
|
|
19
|
+
this.instruction = data.instruction;
|
|
20
|
+
this.model = data.model;
|
|
21
|
+
this.toolDispatcher = data.toolDispatcher;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// src/entities/session.ts
|
|
26
|
+
var Session = class {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
this.messages = data?.messages || [];
|
|
29
|
+
}
|
|
30
|
+
};
|
|
15
31
|
export {
|
|
16
|
-
Agent
|
|
32
|
+
Agent,
|
|
33
|
+
AgentConfig,
|
|
34
|
+
Session
|
|
17
35
|
};
|
|
18
36
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/entities/agent.ts"],"sourcesContent":["import { Model, ModelOption, ResponseMessage, Instruction } from \"@mappies/miniwat-agent-core\";\nimport { AgentConfig } from \"./agentConfig\";\nimport { ToolDispatcher } from \"@mappies/miniwat-mcp-core\";\nimport { Readable } from \"stream\";\nimport { Session } from \"./session\";\n\nexport class Agent\n{\n public readonly instruction
|
|
1
|
+
{"version":3,"sources":["../src/entities/agent.ts","../src/entities/agentConfig.ts","../src/entities/session.ts"],"sourcesContent":["import { Model, ModelOption, ResponseMessage, Instruction } from \"@mappies/miniwat-agent-core\";\nimport { AgentConfig } from \"./agentConfig\";\nimport { ToolDispatcher } from \"@mappies/miniwat-mcp-core\";\nimport { Readable } from \"stream\";\nimport { Session } from \"./session\";\n\nexport class Agent\n{\n public readonly instruction?: Instruction\n public readonly model: Model;\n public readonly toolDispatcher?: ToolDispatcher;\n\n constructor(config: AgentConfig)\n {\n this.model = config.model;\n this.instruction = config.instruction;\n this.toolDispatcher = config.toolDispatcher;\n }\n\n async invoke(session: Session, option?: Omit<ModelOption, 'instruction'>): Promise<ResponseMessage>\n {\n return await this.model.invoke(session.messages, {...option, instruction: this.instruction});\n }\n\n async stream(session: Session, option?: Omit<ModelOption, 'instruction'>): Promise<Readable>\n {\n return await this.model.stream(session.messages, {...option, instruction: this.instruction});\n }\n}","import { Model, Instruction } from \"@mappies/miniwat-agent-core\";\nimport { ToolDispatcher } from \"@mappies/miniwat-mcp-core\";\n\nexport class AgentConfig \n{\n /**\n * Agent instruction\n */\n instruction?: Instruction;\n\n /**\n * The language model used by this agent.\n */\n model: Model;\n\n /**\n * Tool dispatcher for tools.\n */\n toolDispatcher?: ToolDispatcher;\n\n constructor(data:AgentConfig)\n {\n this.instruction = data.instruction;\n this.model = data.model;\n this.toolDispatcher = data.toolDispatcher;\n }\n}","import { Message } from \"@mappies/miniwat-agent-core\";\n\nexport class Session\n{\n public messages: Message[];\n\n constructor(data?:Partial<Session>)\n {\n this.messages = data?.messages || []\n }\n}"],"mappings":";AAMO,IAAM,QAAN,MACP;AAAA,EAKI,YAAY,QACZ;AACI,SAAK,QAAQ,OAAO;AACpB,SAAK,cAAc,OAAO;AAC1B,SAAK,iBAAiB,OAAO;AAAA,EACjC;AAAA,EAEA,MAAM,OAAO,SAAkB,QAC/B;AACI,WAAO,MAAM,KAAK,MAAM,OAAO,QAAQ,UAAU,EAAC,GAAG,QAAQ,aAAa,KAAK,YAAW,CAAC;AAAA,EAC/F;AAAA,EAEA,MAAM,OAAO,SAAkB,QAC/B;AACI,WAAO,MAAM,KAAK,MAAM,OAAO,QAAQ,UAAU,EAAC,GAAG,QAAQ,aAAa,KAAK,YAAW,CAAC;AAAA,EAC/F;AACJ;;;ACzBO,IAAM,cAAN,MACP;AAAA,EAgBI,YAAY,MACZ;AACI,SAAK,cAAc,KAAK;AACxB,SAAK,QAAQ,KAAK;AAClB,SAAK,iBAAiB,KAAK;AAAA,EAC/B;AACJ;;;ACxBO,IAAM,UAAN,MACP;AAAA,EAGI,YAAY,MACZ;AACI,SAAK,WAAW,MAAM,YAAY,CAAC;AAAA,EACvC;AACJ;","names":[]}
|