Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginName=Cognotik
pluginRepositoryUrl=https://github.com/SimiaCryptus/Cognotik
libraryGroup=com.simiacryptus
libraryVersion=2.0.17
libraryVersion=2.0.18

gradleVersion=8.13
org.gradle.caching=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private val clearButton by lazy {
val totalTokens = rowData.dropLast(1).sumOf {
(it[1].toIntOrNull() ?: 0) + (it[2].toIntOrNull() ?: 0)
}
if (totalTokens >= 10000) {
if (totalTokens >= 1000000) {
settings.feedbackRequested = true
showFeedbackNotification()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ class NarrativeGenerationTask(

data class ActOutline(
val act_number: Int = 1,
val title: String = "",
val purpose: String = "",
val scenes: List<SceneOutline> = emptyList()
val title: String? = "",
val purpose: String? = "",
val scenes: List<SceneOutline>? = emptyList()
)

data class SceneOutline(
Expand Down Expand Up @@ -283,7 +283,7 @@ Ensure the outline:
)

val outline = outlineAgent.answer(listOf("Generate outline")).obj
log.info("Generated outline: ${outline.acts.size} acts, ${outline.acts.sumOf { it.scenes.size }} scenes")
log.info("Generated outline: ${outline.acts.size} acts, ${outline.acts.sumOf { it.scenes?.size ?: 0 }} scenes")

val outlineContent = buildString {
appendLine("## ${outline.title}")
Expand All @@ -299,7 +299,7 @@ Ensure the outline:
appendLine()
appendLine("**Purpose:** ${act.purpose}")
appendLine()
act.scenes.forEach { scene ->
act.scenes?.forEach { scene ->
appendLine("#### Scene ${scene.scene_number}: ${scene.title}")
appendLine()
appendLine("- **Setting:** ${scene.setting}")
Expand All @@ -326,20 +326,20 @@ Ensure the outline:
resultBuilder.append("${outline.premise}\n\n")
resultBuilder.append("---\n\n")

overviewTask.add("✅ Phase 2 Complete: Outline created (${outline.acts.sumOf { it.scenes.size }} scenes)\n".renderMarkdown)
overviewTask.add("✅ Phase 2 Complete: Outline created (${outline.acts.sumOf { it.scenes?.size ?: 0 }} scenes)\n".renderMarkdown)
overviewTask.add("\n### Phase 3: Scene Generation\n*Writing scenes iteratively with context...*\n".renderMarkdown)
task.update()

// Phase 3: Generate each scene iteratively
log.info("Phase 3: Generating scenes")
val allScenes = outline.acts.flatMap { it.scenes }
val allScenes = outline.acts.flatMap { it.scenes ?: emptyList() } ?: emptyList()
val generatedScenes = mutableListOf<GeneratedScene>()
var cumulativeWordCount = 0

allScenes.forEachIndexed { index, sceneOutline ->
log.info("Generating scene ${index + 1}/${allScenes.size}: ${sceneOutline.title}")
log.info("Generating scene ${index + 1}/${allScenes.size}: ${sceneOutline?.title}")

overviewTask.add("- Scene ${sceneOutline.scene_number}: ${sceneOutline.title} ".renderMarkdown)
overviewTask.add("- Scene ${sceneOutline?.scene_number}: ${sceneOutline?.title} ".renderMarkdown)
task.update()

val sceneTask = task.ui.newTask(false)
Expand Down Expand Up @@ -541,7 +541,7 @@ Provide the revised scene content only.
appendLine()

val actScenes = generatedScenes.filter { scene ->
act.scenes.any { it.scene_number == scene.scene_number }
act.scenes?.any { it.scene_number == scene.scene_number } == true
}

actScenes.forEach { scene ->
Expand Down
Loading