@cloudbase/agent-examples-agkit-agents-manga-creator 0.0.2 → 0.0.6
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/CHANGELOG.md +70 -0
- package/dist/index.js +51 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +51 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/agent.ts +65 -20
- package/src/tools.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# @cloudbase/agent-examples-agkit-agents-manga-creator
|
|
2
2
|
|
|
3
|
+
## 0.0.11-alpha.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- alpha release 0.0.10-alpha.2
|
|
8
|
+
- Update all public packages to version 0.0.10-alpha.2
|
|
9
|
+
- Trigger automated alpha release workflow
|
|
10
|
+
- Includes latest features and improvements
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @cloudbase/agent-tools@0.0.11-alpha.3
|
|
14
|
+
- @cloudbase/agent-agents@0.0.11-alpha.3
|
|
15
|
+
|
|
16
|
+
## 0.0.11-alpha.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- alpha release 0.0.10-alpha.2
|
|
21
|
+
- Update all public packages to version 0.0.10-alpha.2
|
|
22
|
+
- Trigger automated alpha release workflow
|
|
23
|
+
- Includes latest features and improvements
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
- @cloudbase/agent-tools@0.0.11-alpha.2
|
|
27
|
+
- @cloudbase/agent-agents@0.0.11-alpha.2
|
|
28
|
+
|
|
29
|
+
## 0.0.11-alpha.1
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- alpha release 0.0.10-alpha.2
|
|
34
|
+
- Update all public packages to version 0.0.10-alpha.2
|
|
35
|
+
- Trigger automated alpha release workflow
|
|
36
|
+
- Includes latest features and improvements
|
|
37
|
+
|
|
38
|
+
- Updated dependencies
|
|
39
|
+
- @cloudbase/agent-tools@0.0.11-alpha.1
|
|
40
|
+
- @cloudbase/agent-agents@0.0.11-alpha.1
|
|
41
|
+
|
|
42
|
+
## 0.0.11-alpha.0
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- 97b2740: alpha release 0.0.10-alpha.2
|
|
47
|
+
- Update all public packages to version 0.0.10-alpha.2
|
|
48
|
+
- Trigger automated alpha release workflow
|
|
49
|
+
- Includes latest features and improvements
|
|
50
|
+
|
|
51
|
+
- fd4c62a: alpha release 0.0.10-alpha.2
|
|
52
|
+
- Update all public packages to version 0.0.10-alpha.2
|
|
53
|
+
- Trigger automated alpha release workflow
|
|
54
|
+
- Includes latest features and improvements
|
|
55
|
+
|
|
56
|
+
- da3388c: alpha release 0.0.10-alpha.2
|
|
57
|
+
- Update all public packages to version 0.0.10-alpha.2
|
|
58
|
+
- Trigger automated alpha release workflow
|
|
59
|
+
- Includes latest features and improvements
|
|
60
|
+
|
|
61
|
+
- alpha release 0.0.10-alpha.2
|
|
62
|
+
- Update all public packages to version 0.0.10-alpha.2
|
|
63
|
+
- Trigger automated alpha release workflow
|
|
64
|
+
- Includes latest features and improvements
|
|
65
|
+
|
|
66
|
+
- Updated dependencies [97b2740]
|
|
67
|
+
- Updated dependencies [fd4c62a]
|
|
68
|
+
- Updated dependencies [da3388c]
|
|
69
|
+
- Updated dependencies
|
|
70
|
+
- @cloudbase/agent-tools@0.0.11-alpha.0
|
|
71
|
+
- @cloudbase/agent-agents@0.0.11-alpha.0
|
|
72
|
+
|
|
3
73
|
## 0.0.10
|
|
4
74
|
|
|
5
75
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -540,7 +540,7 @@ var generateCharacterDesignTool = agentTools.tool(
|
|
|
540
540
|
}
|
|
541
541
|
console.log("=== Character Design Tool Called ===");
|
|
542
542
|
console.log("Characters proposed:", characters.map((c) => c.name));
|
|
543
|
-
console.log("State.characters updated:", state.characters
|
|
543
|
+
console.log("State.characters updated:", state.characters);
|
|
544
544
|
console.log("===================================");
|
|
545
545
|
}
|
|
546
546
|
return {
|
|
@@ -637,6 +637,9 @@ var generateComicPageTool = agentTools.tool(
|
|
|
637
637
|
async ({ pageNumber, panels, styleGuide }, context) => {
|
|
638
638
|
try {
|
|
639
639
|
const state = context?.state;
|
|
640
|
+
console.log("=== Generate Comic Page Tool Called ===");
|
|
641
|
+
console.log("State:", state);
|
|
642
|
+
console.log("===================================");
|
|
640
643
|
if (!panels || panels.length === 0) {
|
|
641
644
|
throw new Error("No panels provided for page generation");
|
|
642
645
|
}
|
|
@@ -960,23 +963,7 @@ function createMangaCreatorAgent() {
|
|
|
960
963
|
- Maintain a consistent comic style throughout based on confirmed parameters
|
|
961
964
|
- Dialogue and narrative text should complement the images naturally
|
|
962
965
|
- Follow comic book conventions: panel layout, dialogue bubbles, sound effects, etc.
|
|
963
|
-
|
|
964
|
-
**Output Format:**
|
|
965
|
-
- During generation: Show each panel as it's created (image + story paragraph)
|
|
966
|
-
- Final output: Use Markdown format with all images and story text combined into a complete picture book, like:
|
|
967
|
-
\`\`\`markdown
|
|
968
|
-
# Story Title
|
|
969
|
-
|
|
970
|
-

|
|
971
|
-
|
|
972
|
-
Story paragraph for panel 1...
|
|
973
|
-
|
|
974
|
-

|
|
975
|
-
|
|
976
|
-
Story paragraph for panel 2...
|
|
977
|
-
|
|
978
|
-
...
|
|
979
|
-
\`\`\``,
|
|
966
|
+
`,
|
|
980
967
|
modelSettings: {
|
|
981
968
|
temperature: 0.8,
|
|
982
969
|
maxTokens: 16e3
|
|
@@ -1026,9 +1013,47 @@ function createMangaCreatorAgent() {
|
|
|
1026
1013
|
} catch {
|
|
1027
1014
|
}
|
|
1028
1015
|
}
|
|
1029
|
-
|
|
1016
|
+
const confirmationMessage = userMessage || (state.userResponse && typeof state.userResponse === "string" ? state.userResponse : JSON.stringify(state.userResponse || {}));
|
|
1017
|
+
if (confirmationMessage) {
|
|
1030
1018
|
try {
|
|
1031
|
-
const confirmedParams = JSON.parse(
|
|
1019
|
+
const confirmedParams = typeof confirmationMessage === "string" ? JSON.parse(confirmationMessage) : confirmationMessage;
|
|
1020
|
+
if (confirmedParams.userConfirmed && confirmedParams.type === "character_design" && confirmedParams.characters) {
|
|
1021
|
+
for (const char of confirmedParams.characters) {
|
|
1022
|
+
const existingIndex = state.characters.findIndex((c) => c.name === char.name);
|
|
1023
|
+
if (existingIndex >= 0) {
|
|
1024
|
+
state.characters[existingIndex].description = char.description;
|
|
1025
|
+
} else {
|
|
1026
|
+
state.characters.push({
|
|
1027
|
+
name: char.name,
|
|
1028
|
+
description: char.description
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
if (state.characterDesignParams) {
|
|
1033
|
+
state.characterDesignParams.userConfirmed = true;
|
|
1034
|
+
} else {
|
|
1035
|
+
state.characterDesignParams = {
|
|
1036
|
+
characters: confirmedParams.characters.map((c) => ({
|
|
1037
|
+
name: c.name,
|
|
1038
|
+
description: c.description
|
|
1039
|
+
})),
|
|
1040
|
+
userConfirmed: true
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
console.log("=== Character Design Confirmed in handleNextStep ===");
|
|
1044
|
+
console.log("Updated state.characters:", state.characters);
|
|
1045
|
+
console.log("Character count:", state.characters.length);
|
|
1046
|
+
console.log("===================================================");
|
|
1047
|
+
state.userResponse = void 0;
|
|
1048
|
+
return { action: "continue", nextStep: null };
|
|
1049
|
+
}
|
|
1050
|
+
} catch (error) {
|
|
1051
|
+
console.error("Failed to parse character design confirmation:", error);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
if (confirmationMessage && characterDesignParams && !characterDesignParams.userConfirmed) {
|
|
1055
|
+
try {
|
|
1056
|
+
const confirmedParams = typeof confirmationMessage === "string" ? JSON.parse(confirmationMessage) : confirmationMessage;
|
|
1032
1057
|
if (confirmedParams.userConfirmed && confirmedParams.type === "character_design") {
|
|
1033
1058
|
if (state.characterDesignParams && confirmedParams.characters) {
|
|
1034
1059
|
state.characterDesignParams.userConfirmed = true;
|
|
@@ -1043,10 +1068,15 @@ function createMangaCreatorAgent() {
|
|
|
1043
1068
|
});
|
|
1044
1069
|
}
|
|
1045
1070
|
}
|
|
1071
|
+
console.log("=== Character Design Confirmed in handleNextStep (legacy) ===");
|
|
1072
|
+
console.log("Updated state.characters:", state.characters);
|
|
1073
|
+
console.log("===================================================");
|
|
1046
1074
|
}
|
|
1075
|
+
state.userResponse = void 0;
|
|
1047
1076
|
return { action: "continue", nextStep: null };
|
|
1048
1077
|
}
|
|
1049
|
-
} catch {
|
|
1078
|
+
} catch (error) {
|
|
1079
|
+
console.error("Failed to parse character design confirmation:", error);
|
|
1050
1080
|
}
|
|
1051
1081
|
}
|
|
1052
1082
|
if (scriptParams && !scriptParams.userConfirmed) {
|