@ghostpaw/questlog 0.4.0 → 0.5.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/dist/index.cjs +55 -5
- package/dist/index.d.cts +26 -3
- package/dist/index.d.ts +26 -3
- package/dist/index.js +55 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2002,6 +2002,29 @@ function softDeleteRumor(db, rumorId, now) {
|
|
|
2002
2002
|
).run(deletedAt, deletedAt, rumorId);
|
|
2003
2003
|
}
|
|
2004
2004
|
|
|
2005
|
+
// src/rumors/update_rumor.ts
|
|
2006
|
+
function updateRumor(db, rumorId, input) {
|
|
2007
|
+
if (input.title == null && input.details == null) {
|
|
2008
|
+
throw new Error("At least one of title or details must be provided to update a rumor.");
|
|
2009
|
+
}
|
|
2010
|
+
const current = getRumorOrThrow(db, rumorId);
|
|
2011
|
+
if (current.settledAt != null) {
|
|
2012
|
+
throw new Error(`Rumor ${rumorId} is already settled and cannot be updated.`);
|
|
2013
|
+
}
|
|
2014
|
+
if (current.dismissedAt != null) {
|
|
2015
|
+
throw new Error(`Rumor ${rumorId} is dismissed and cannot be updated. Reopen it first.`);
|
|
2016
|
+
}
|
|
2017
|
+
const now = resolveNow(input.now);
|
|
2018
|
+
const nextTitle = input.title != null ? assertNonEmpty(input.title, "Rumor title") : current.title;
|
|
2019
|
+
const nextDetails = input.details != null ? input.details.trim() || null : current.details;
|
|
2020
|
+
db.prepare(
|
|
2021
|
+
`UPDATE rumors
|
|
2022
|
+
SET title = ?, details = ?, updated_at = ?
|
|
2023
|
+
WHERE id = ? AND deleted_at IS NULL`
|
|
2024
|
+
).run(nextTitle, nextDetails, now, rumorId);
|
|
2025
|
+
return getRumorOrThrow(db, rumorId);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2005
2028
|
// src/search_questlog.ts
|
|
2006
2029
|
function searchQuestlog(db, query) {
|
|
2007
2030
|
const trimmed = query.trim();
|
|
@@ -5225,6 +5248,27 @@ function shapeWorkToolHandler(db, input) {
|
|
|
5225
5248
|
}
|
|
5226
5249
|
);
|
|
5227
5250
|
}
|
|
5251
|
+
case "update_rumor": {
|
|
5252
|
+
updateRumor(db, input.rumorId, {
|
|
5253
|
+
...input.title != null && { title: input.title },
|
|
5254
|
+
...input.details != null && { details: input.details },
|
|
5255
|
+
...input.now != null && { now: input.now }
|
|
5256
|
+
});
|
|
5257
|
+
const detail = getRumorDetail(db, input.rumorId);
|
|
5258
|
+
return toolSuccess(
|
|
5259
|
+
`Updated rumor \`${detail.title}\`.`,
|
|
5260
|
+
{
|
|
5261
|
+
action: input.action,
|
|
5262
|
+
primary: toRumorRef(detail),
|
|
5263
|
+
updated: [toRumorRef(detail)],
|
|
5264
|
+
rumor: detail
|
|
5265
|
+
},
|
|
5266
|
+
{
|
|
5267
|
+
entities: [toRumorRef(detail)],
|
|
5268
|
+
next: [inspectItemNext(toRumorRef(detail))]
|
|
5269
|
+
}
|
|
5270
|
+
);
|
|
5271
|
+
}
|
|
5228
5272
|
}
|
|
5229
5273
|
} catch (error) {
|
|
5230
5274
|
return translateToolError(error, {
|
|
@@ -5251,7 +5295,9 @@ var shapeWorkTool = defineQuestlogTool({
|
|
|
5251
5295
|
questId: "The concrete quest being attached to or detached from a questline.",
|
|
5252
5296
|
questlineId: "The questline that should receive the quest for attach actions.",
|
|
5253
5297
|
dismissedAt: "Optional dismissal timestamp for dismissing a rumor.",
|
|
5254
|
-
now: "Optional timestamp for reopen
|
|
5298
|
+
now: "Optional timestamp for reopen, questline membership, or rumor update.",
|
|
5299
|
+
title: "New title for the update_rumor action.",
|
|
5300
|
+
details: "New or enriched context for the update_rumor action. Append evidence as rumors accumulate information across conversations."
|
|
5255
5301
|
},
|
|
5256
5302
|
outputDescription: "Returns the changed or created rumor, quest, questline, or created quest set for the selected shape-work action, plus purpose-shaped primary and created or updated refs. Repeated safe actions return structured no-op results, and rumor settlement can ask for missing structure instead of failing.",
|
|
5257
5303
|
inputSchema: objectSchema(
|
|
@@ -5263,7 +5309,8 @@ var shapeWorkTool = defineQuestlogTool({
|
|
|
5263
5309
|
"detach_quest_from_questline",
|
|
5264
5310
|
"dismiss_rumor",
|
|
5265
5311
|
"reopen_rumor",
|
|
5266
|
-
"settle_rumor"
|
|
5312
|
+
"settle_rumor",
|
|
5313
|
+
"update_rumor"
|
|
5267
5314
|
]),
|
|
5268
5315
|
questId: integerSchema("Quest to attach or detach."),
|
|
5269
5316
|
questlineId: integerSchema("Questline that should receive the quest."),
|
|
@@ -5329,10 +5376,12 @@ var shapeWorkTool = defineQuestlogTool({
|
|
|
5329
5376
|
),
|
|
5330
5377
|
"Quests to create during rumor settlement. Include timing and tags directly."
|
|
5331
5378
|
),
|
|
5332
|
-
now: integerSchema("Optional timestamp for membership or
|
|
5379
|
+
now: integerSchema("Optional timestamp for membership, reopen, or rumor update."),
|
|
5380
|
+
title: stringSchema("New title for the update_rumor action."),
|
|
5381
|
+
details: stringSchema("New or enriched context text for the update_rumor action.")
|
|
5333
5382
|
},
|
|
5334
5383
|
["action"],
|
|
5335
|
-
"Create quests with timing and tags, create questlines, settle rumors into work,
|
|
5384
|
+
"Create quests with timing and tags, create questlines, settle rumors into work, manage quest-questline membership, or enrich open rumors with new context."
|
|
5336
5385
|
),
|
|
5337
5386
|
handler: shapeWorkToolHandler
|
|
5338
5387
|
});
|
|
@@ -5710,7 +5759,8 @@ __export(write_exports, {
|
|
|
5710
5759
|
untagQuest: () => untagQuest,
|
|
5711
5760
|
updateQuestReward: () => updateQuestReward,
|
|
5712
5761
|
updateQuestline: () => updateQuestline,
|
|
5713
|
-
updateRepeatableQuest: () => updateRepeatableQuest
|
|
5762
|
+
updateRepeatableQuest: () => updateRepeatableQuest,
|
|
5763
|
+
updateRumor: () => updateRumor
|
|
5714
5764
|
});
|
|
5715
5765
|
|
|
5716
5766
|
exports.initQuestlogTables = initQuestlogTables;
|
package/dist/index.d.cts
CHANGED
|
@@ -268,6 +268,15 @@ interface CaptureRumorInput {
|
|
|
268
268
|
details?: string | null;
|
|
269
269
|
now?: number;
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Input for enriching an existing open rumor with new title or details.
|
|
273
|
+
* At least one of title or details must be provided.
|
|
274
|
+
*/
|
|
275
|
+
interface UpdateRumorInput {
|
|
276
|
+
title?: string;
|
|
277
|
+
details?: string;
|
|
278
|
+
now?: number;
|
|
279
|
+
}
|
|
271
280
|
/**
|
|
272
281
|
* A downstream artifact created from rumor settlement.
|
|
273
282
|
*/
|
|
@@ -653,6 +662,13 @@ declare function settleRumor(db: QuestlogDb, rumorId: number, input: SettleRumor
|
|
|
653
662
|
*/
|
|
654
663
|
declare function softDeleteRumor(db: QuestlogDb, rumorId: number, now?: number): void;
|
|
655
664
|
|
|
665
|
+
/**
|
|
666
|
+
* Enriches an existing open rumor with a new title and/or details.
|
|
667
|
+
* Advances updatedAt so downstream consumers can detect enrichment.
|
|
668
|
+
* Throws if the rumor is settled, dismissed, or deleted.
|
|
669
|
+
*/
|
|
670
|
+
declare function updateRumor(db: QuestlogDb, rumorId: number, input: UpdateRumorInput): Rumor;
|
|
671
|
+
|
|
656
672
|
/**
|
|
657
673
|
* Search result across questlog content.
|
|
658
674
|
*/
|
|
@@ -1474,7 +1490,13 @@ type ShapeWorkToolInput = {
|
|
|
1474
1490
|
} | ({
|
|
1475
1491
|
action: 'settle_rumor';
|
|
1476
1492
|
rumorId: number;
|
|
1477
|
-
} & SettleRumorInput)
|
|
1493
|
+
} & SettleRumorInput) | {
|
|
1494
|
+
action: 'update_rumor';
|
|
1495
|
+
rumorId: number;
|
|
1496
|
+
title?: string;
|
|
1497
|
+
details?: string;
|
|
1498
|
+
now?: number;
|
|
1499
|
+
};
|
|
1478
1500
|
interface ShapeWorkToolData {
|
|
1479
1501
|
action: ShapeWorkToolInput['action'];
|
|
1480
1502
|
primary?: ToolEntityRef | undefined;
|
|
@@ -1693,8 +1715,9 @@ declare const write_untagQuest: typeof untagQuest;
|
|
|
1693
1715
|
declare const write_updateQuestReward: typeof updateQuestReward;
|
|
1694
1716
|
declare const write_updateQuestline: typeof updateQuestline;
|
|
1695
1717
|
declare const write_updateRepeatableQuest: typeof updateRepeatableQuest;
|
|
1718
|
+
declare const write_updateRumor: typeof updateRumor;
|
|
1696
1719
|
declare namespace write {
|
|
1697
|
-
export { write_abandonQuest as abandonQuest, write_abandonQuestAndSpawnFollowups as abandonQuestAndSpawnFollowups, write_addQuestReward as addQuestReward, write_addUnlock as addUnlock, write_archiveQuestline as archiveQuestline, write_archiveRepeatableQuest as archiveRepeatableQuest, write_captureRumor as captureRumor, write_claimQuestReward as claimQuestReward, write_createQuest as createQuest, write_createQuestline as createQuestline, write_createRepeatableQuest as createRepeatableQuest, write_detachQuestFromQuestline as detachQuestFromQuestline, write_dismissRumor as dismissRumor, write_finishQuest as finishQuest, write_logQuestEffort as logQuestEffort, write_moveQuestToQuestline as moveQuestToQuestline, write_planQuestTime as planQuestTime, write_removeQuestReward as removeQuestReward, write_removeUnlock as removeUnlock, write_reopenRumor as reopenRumor, write_replaceQuestTags as replaceQuestTags, write_replaceRepeatableQuestRewards as replaceRepeatableQuestRewards, write_replaceRepeatableQuestTags as replaceRepeatableQuestTags, write_replaceUnlocks as replaceUnlocks, write_reviseQuestObjective as reviseQuestObjective, write_settleRumor as settleRumor, write_softDeleteQuest as softDeleteQuest, write_softDeleteQuestline as softDeleteQuestline, write_softDeleteRepeatableQuest as softDeleteRepeatableQuest, write_softDeleteRumor as softDeleteRumor, write_spawnDueRepeatableQuests as spawnDueRepeatableQuests, write_startQuest as startQuest, write_tagQuest as tagQuest, write_untagQuest as untagQuest, write_updateQuestReward as updateQuestReward, write_updateQuestline as updateQuestline, write_updateRepeatableQuest as updateRepeatableQuest };
|
|
1720
|
+
export { write_abandonQuest as abandonQuest, write_abandonQuestAndSpawnFollowups as abandonQuestAndSpawnFollowups, write_addQuestReward as addQuestReward, write_addUnlock as addUnlock, write_archiveQuestline as archiveQuestline, write_archiveRepeatableQuest as archiveRepeatableQuest, write_captureRumor as captureRumor, write_claimQuestReward as claimQuestReward, write_createQuest as createQuest, write_createQuestline as createQuestline, write_createRepeatableQuest as createRepeatableQuest, write_detachQuestFromQuestline as detachQuestFromQuestline, write_dismissRumor as dismissRumor, write_finishQuest as finishQuest, write_logQuestEffort as logQuestEffort, write_moveQuestToQuestline as moveQuestToQuestline, write_planQuestTime as planQuestTime, write_removeQuestReward as removeQuestReward, write_removeUnlock as removeUnlock, write_reopenRumor as reopenRumor, write_replaceQuestTags as replaceQuestTags, write_replaceRepeatableQuestRewards as replaceRepeatableQuestRewards, write_replaceRepeatableQuestTags as replaceRepeatableQuestTags, write_replaceUnlocks as replaceUnlocks, write_reviseQuestObjective as reviseQuestObjective, write_settleRumor as settleRumor, write_softDeleteQuest as softDeleteQuest, write_softDeleteQuestline as softDeleteQuestline, write_softDeleteRepeatableQuest as softDeleteRepeatableQuest, write_softDeleteRumor as softDeleteRumor, write_spawnDueRepeatableQuests as spawnDueRepeatableQuests, write_startQuest as startQuest, write_tagQuest as tagQuest, write_untagQuest as untagQuest, write_updateQuestReward as updateQuestReward, write_updateQuestline as updateQuestline, write_updateRepeatableQuest as updateRepeatableQuest, write_updateRumor as updateRumor };
|
|
1698
1721
|
}
|
|
1699
1722
|
|
|
1700
|
-
export { type AbandonQuestResult, type CaptureRumorInput, type CreateQuestInput, type CreateQuestlineInput, type CreateRepeatableQuestInput, type DueRepeatableAnchor, type FollowupQuestInput, type JsonSchema, type JsonSchemaType, type MarkerDefinition, type MarkerId, type PlanQuestTimeInput, type Quest, type QuestDetail, type QuestListFilters, type QuestReward, type QuestRewardInput, type QuestState, type QuestUnlock, type Questline, type QuestlineDetail, type QuestlogDb, type QuestlogSearchResult, type QuestlogSkill, type QuestlogSkillRegistry, type QuestlogSoul, type QuestlogSoulTrait, type QuestlogToolDefinition, type QuestlogToolMapping, type RepeatableQuest, type RepeatableQuestReward, type RepeatableQuestRewardInput, type Rumor, type RumorDetail, type RumorOutput, type RumorState, type SettleRumorInput, type SettleRumorResult, type Tag, type ToolClarificationCode, type ToolDefinitionRegistry, type ToolEntityKind, type ToolEntityRef, type ToolErrorCode, type ToolErrorKind, type ToolFailure, type ToolInputDescriptions, type ToolListItem, type ToolNeedsClarification, type ToolNextStepHint, type ToolNextStepHintKind, type ToolOutcomeKind, type ToolOutputDescription, type ToolResult, type ToolSideEffects, type ToolSuccess, type ToolWarning, type ToolWarningCode, type UpdateQuestlineInput, type UpdateRepeatableQuestInput, abandonQuest, abandonQuestAndSpawnFollowups, addQuestReward, addUnlock, archiveDeleteAndPruneSkill, archiveQuestline, archiveRepeatableQuest, arraySchema, booleanSchema, captureRumor, captureRumorTool, captureRumorToolHandler, captureRumorToolName, chooseWorkShapeSkill, claimQuestReward, clarifyAmbiguousRequestsSkill, closeWorkAndClaimOutcomesSkill, createConcreteQuestSkill, createQuest, createQuestline, createRepeatableQuest, defineQuestlogSkill, defineQuestlogTool, detachQuestFromQuestline, detectSlipsAndStalenessSkill, dismissRumor, enumSchema, escalateAndUnblockSkill, finishQuest, frameInitiativeQuestlineSkill, getQuestDetail, getQuestlineDetail, getQuestlogSkillByName, getQuestlogToolByName, getRumorDetail, getRumorOutputs, handleExceptionsAndWeirdCasesSkill, initQuestlogTables, inspectQuestlogItemTool, inspectQuestlogItemToolHandler, inspectQuestlogItemToolName, intakeTriageSkill, integerSchema, listActiveQuests, listAvailableQuests, listBlockedQuests, listDeferredQuests, listDueRepeatableQuestAnchors, listDueSoonQuests, listInProgressQuests, listMissedScheduledQuests, listOpenQuests, listOverdueQuests, listQuestlines, listQuestlogSkills, listQuestlogToolDefinitions, listResolvedQuests, listRumors, listScheduledForDay, listScheduledNow, literalSchema, logQuestEffort, maintainClearOwnershipSkill, manageApprovalsAndPromisesSkill, manageRepeatableTool, manageRepeatableToolHandler, manageRepeatableToolName, index$2 as markers, moveQuestToQuestline, numberSchema, objectSchema, oneOfSchema, organizeWorkTool, organizeWorkToolHandler, organizeWorkToolName, planQuestTime, planQuestTool, planQuestToolHandler, planQuestToolName, planSuccessorWorkSkill, planTimeCorrectlySkill, prioritizeAcrossStreamsSkill, protectCapacityAndFocusSkill, questlogSkills, questlogToolMappings, questlogTools, read, recoverFromModelingMistakesSkill, removeQuestReward, removeUnlock, reopenRumor, replaceQuestTags, replaceRepeatableQuestRewards, replaceRepeatableQuestTags, replaceUnlocks, reportStatusAndManageExpectationsSkill, retireWorkTool, retireWorkToolHandler, retireWorkToolName, reviewQuestlogTool, reviewQuestlogToolHandler, reviewQuestlogToolName, reviseOrReshapeCommitmentSkill, reviseQuestObjective, rewardWorkTool, rewardWorkToolHandler, rewardWorkToolName, runOperationalReviewSkill, runQuestTool, runQuestToolHandler, runQuestToolName, runRecurringRhythmsSkill, searchAndRetrieveContextSkill, searchQuestlogTool, searchQuestlogToolHandler, searchQuestlogToolName, sequenceWithUnlocksSkill, settleRumor, settleRumorIntoStructureSkill, shapeWorkTool, shapeWorkToolHandler, shapeWorkToolName, index$1 as skills, softDeleteQuest, softDeleteQuestline, softDeleteRepeatableQuest, softDeleteRumor, soul, spawnDueRepeatableQuests, startQuest, stringSchema, tagAndFilterPortfoliosSkill, tagQuest, tagWorkTool, tagWorkToolHandler, tagWorkToolName, toolFailure, toolNeedsClarification, toolNoOp, toolSuccess, toolWarning, index as tools, untagQuest, updateQuestReward, updateQuestline, updateRepeatableQuest, write };
|
|
1723
|
+
export { type AbandonQuestResult, type CaptureRumorInput, type CreateQuestInput, type CreateQuestlineInput, type CreateRepeatableQuestInput, type DueRepeatableAnchor, type FollowupQuestInput, type JsonSchema, type JsonSchemaType, type MarkerDefinition, type MarkerId, type PlanQuestTimeInput, type Quest, type QuestDetail, type QuestListFilters, type QuestReward, type QuestRewardInput, type QuestState, type QuestUnlock, type Questline, type QuestlineDetail, type QuestlogDb, type QuestlogSearchResult, type QuestlogSkill, type QuestlogSkillRegistry, type QuestlogSoul, type QuestlogSoulTrait, type QuestlogToolDefinition, type QuestlogToolMapping, type RepeatableQuest, type RepeatableQuestReward, type RepeatableQuestRewardInput, type Rumor, type RumorDetail, type RumorOutput, type RumorState, type SettleRumorInput, type SettleRumorResult, type Tag, type ToolClarificationCode, type ToolDefinitionRegistry, type ToolEntityKind, type ToolEntityRef, type ToolErrorCode, type ToolErrorKind, type ToolFailure, type ToolInputDescriptions, type ToolListItem, type ToolNeedsClarification, type ToolNextStepHint, type ToolNextStepHintKind, type ToolOutcomeKind, type ToolOutputDescription, type ToolResult, type ToolSideEffects, type ToolSuccess, type ToolWarning, type ToolWarningCode, type UpdateQuestlineInput, type UpdateRepeatableQuestInput, type UpdateRumorInput, abandonQuest, abandonQuestAndSpawnFollowups, addQuestReward, addUnlock, archiveDeleteAndPruneSkill, archiveQuestline, archiveRepeatableQuest, arraySchema, booleanSchema, captureRumor, captureRumorTool, captureRumorToolHandler, captureRumorToolName, chooseWorkShapeSkill, claimQuestReward, clarifyAmbiguousRequestsSkill, closeWorkAndClaimOutcomesSkill, createConcreteQuestSkill, createQuest, createQuestline, createRepeatableQuest, defineQuestlogSkill, defineQuestlogTool, detachQuestFromQuestline, detectSlipsAndStalenessSkill, dismissRumor, enumSchema, escalateAndUnblockSkill, finishQuest, frameInitiativeQuestlineSkill, getQuestDetail, getQuestlineDetail, getQuestlogSkillByName, getQuestlogToolByName, getRumorDetail, getRumorOutputs, handleExceptionsAndWeirdCasesSkill, initQuestlogTables, inspectQuestlogItemTool, inspectQuestlogItemToolHandler, inspectQuestlogItemToolName, intakeTriageSkill, integerSchema, listActiveQuests, listAvailableQuests, listBlockedQuests, listDeferredQuests, listDueRepeatableQuestAnchors, listDueSoonQuests, listInProgressQuests, listMissedScheduledQuests, listOpenQuests, listOverdueQuests, listQuestlines, listQuestlogSkills, listQuestlogToolDefinitions, listResolvedQuests, listRumors, listScheduledForDay, listScheduledNow, literalSchema, logQuestEffort, maintainClearOwnershipSkill, manageApprovalsAndPromisesSkill, manageRepeatableTool, manageRepeatableToolHandler, manageRepeatableToolName, index$2 as markers, moveQuestToQuestline, numberSchema, objectSchema, oneOfSchema, organizeWorkTool, organizeWorkToolHandler, organizeWorkToolName, planQuestTime, planQuestTool, planQuestToolHandler, planQuestToolName, planSuccessorWorkSkill, planTimeCorrectlySkill, prioritizeAcrossStreamsSkill, protectCapacityAndFocusSkill, questlogSkills, questlogToolMappings, questlogTools, read, recoverFromModelingMistakesSkill, removeQuestReward, removeUnlock, reopenRumor, replaceQuestTags, replaceRepeatableQuestRewards, replaceRepeatableQuestTags, replaceUnlocks, reportStatusAndManageExpectationsSkill, retireWorkTool, retireWorkToolHandler, retireWorkToolName, reviewQuestlogTool, reviewQuestlogToolHandler, reviewQuestlogToolName, reviseOrReshapeCommitmentSkill, reviseQuestObjective, rewardWorkTool, rewardWorkToolHandler, rewardWorkToolName, runOperationalReviewSkill, runQuestTool, runQuestToolHandler, runQuestToolName, runRecurringRhythmsSkill, searchAndRetrieveContextSkill, searchQuestlogTool, searchQuestlogToolHandler, searchQuestlogToolName, sequenceWithUnlocksSkill, settleRumor, settleRumorIntoStructureSkill, shapeWorkTool, shapeWorkToolHandler, shapeWorkToolName, index$1 as skills, softDeleteQuest, softDeleteQuestline, softDeleteRepeatableQuest, softDeleteRumor, soul, spawnDueRepeatableQuests, startQuest, stringSchema, tagAndFilterPortfoliosSkill, tagQuest, tagWorkTool, tagWorkToolHandler, tagWorkToolName, toolFailure, toolNeedsClarification, toolNoOp, toolSuccess, toolWarning, index as tools, untagQuest, updateQuestReward, updateQuestline, updateRepeatableQuest, updateRumor, write };
|
package/dist/index.d.ts
CHANGED
|
@@ -268,6 +268,15 @@ interface CaptureRumorInput {
|
|
|
268
268
|
details?: string | null;
|
|
269
269
|
now?: number;
|
|
270
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Input for enriching an existing open rumor with new title or details.
|
|
273
|
+
* At least one of title or details must be provided.
|
|
274
|
+
*/
|
|
275
|
+
interface UpdateRumorInput {
|
|
276
|
+
title?: string;
|
|
277
|
+
details?: string;
|
|
278
|
+
now?: number;
|
|
279
|
+
}
|
|
271
280
|
/**
|
|
272
281
|
* A downstream artifact created from rumor settlement.
|
|
273
282
|
*/
|
|
@@ -653,6 +662,13 @@ declare function settleRumor(db: QuestlogDb, rumorId: number, input: SettleRumor
|
|
|
653
662
|
*/
|
|
654
663
|
declare function softDeleteRumor(db: QuestlogDb, rumorId: number, now?: number): void;
|
|
655
664
|
|
|
665
|
+
/**
|
|
666
|
+
* Enriches an existing open rumor with a new title and/or details.
|
|
667
|
+
* Advances updatedAt so downstream consumers can detect enrichment.
|
|
668
|
+
* Throws if the rumor is settled, dismissed, or deleted.
|
|
669
|
+
*/
|
|
670
|
+
declare function updateRumor(db: QuestlogDb, rumorId: number, input: UpdateRumorInput): Rumor;
|
|
671
|
+
|
|
656
672
|
/**
|
|
657
673
|
* Search result across questlog content.
|
|
658
674
|
*/
|
|
@@ -1474,7 +1490,13 @@ type ShapeWorkToolInput = {
|
|
|
1474
1490
|
} | ({
|
|
1475
1491
|
action: 'settle_rumor';
|
|
1476
1492
|
rumorId: number;
|
|
1477
|
-
} & SettleRumorInput)
|
|
1493
|
+
} & SettleRumorInput) | {
|
|
1494
|
+
action: 'update_rumor';
|
|
1495
|
+
rumorId: number;
|
|
1496
|
+
title?: string;
|
|
1497
|
+
details?: string;
|
|
1498
|
+
now?: number;
|
|
1499
|
+
};
|
|
1478
1500
|
interface ShapeWorkToolData {
|
|
1479
1501
|
action: ShapeWorkToolInput['action'];
|
|
1480
1502
|
primary?: ToolEntityRef | undefined;
|
|
@@ -1693,8 +1715,9 @@ declare const write_untagQuest: typeof untagQuest;
|
|
|
1693
1715
|
declare const write_updateQuestReward: typeof updateQuestReward;
|
|
1694
1716
|
declare const write_updateQuestline: typeof updateQuestline;
|
|
1695
1717
|
declare const write_updateRepeatableQuest: typeof updateRepeatableQuest;
|
|
1718
|
+
declare const write_updateRumor: typeof updateRumor;
|
|
1696
1719
|
declare namespace write {
|
|
1697
|
-
export { write_abandonQuest as abandonQuest, write_abandonQuestAndSpawnFollowups as abandonQuestAndSpawnFollowups, write_addQuestReward as addQuestReward, write_addUnlock as addUnlock, write_archiveQuestline as archiveQuestline, write_archiveRepeatableQuest as archiveRepeatableQuest, write_captureRumor as captureRumor, write_claimQuestReward as claimQuestReward, write_createQuest as createQuest, write_createQuestline as createQuestline, write_createRepeatableQuest as createRepeatableQuest, write_detachQuestFromQuestline as detachQuestFromQuestline, write_dismissRumor as dismissRumor, write_finishQuest as finishQuest, write_logQuestEffort as logQuestEffort, write_moveQuestToQuestline as moveQuestToQuestline, write_planQuestTime as planQuestTime, write_removeQuestReward as removeQuestReward, write_removeUnlock as removeUnlock, write_reopenRumor as reopenRumor, write_replaceQuestTags as replaceQuestTags, write_replaceRepeatableQuestRewards as replaceRepeatableQuestRewards, write_replaceRepeatableQuestTags as replaceRepeatableQuestTags, write_replaceUnlocks as replaceUnlocks, write_reviseQuestObjective as reviseQuestObjective, write_settleRumor as settleRumor, write_softDeleteQuest as softDeleteQuest, write_softDeleteQuestline as softDeleteQuestline, write_softDeleteRepeatableQuest as softDeleteRepeatableQuest, write_softDeleteRumor as softDeleteRumor, write_spawnDueRepeatableQuests as spawnDueRepeatableQuests, write_startQuest as startQuest, write_tagQuest as tagQuest, write_untagQuest as untagQuest, write_updateQuestReward as updateQuestReward, write_updateQuestline as updateQuestline, write_updateRepeatableQuest as updateRepeatableQuest };
|
|
1720
|
+
export { write_abandonQuest as abandonQuest, write_abandonQuestAndSpawnFollowups as abandonQuestAndSpawnFollowups, write_addQuestReward as addQuestReward, write_addUnlock as addUnlock, write_archiveQuestline as archiveQuestline, write_archiveRepeatableQuest as archiveRepeatableQuest, write_captureRumor as captureRumor, write_claimQuestReward as claimQuestReward, write_createQuest as createQuest, write_createQuestline as createQuestline, write_createRepeatableQuest as createRepeatableQuest, write_detachQuestFromQuestline as detachQuestFromQuestline, write_dismissRumor as dismissRumor, write_finishQuest as finishQuest, write_logQuestEffort as logQuestEffort, write_moveQuestToQuestline as moveQuestToQuestline, write_planQuestTime as planQuestTime, write_removeQuestReward as removeQuestReward, write_removeUnlock as removeUnlock, write_reopenRumor as reopenRumor, write_replaceQuestTags as replaceQuestTags, write_replaceRepeatableQuestRewards as replaceRepeatableQuestRewards, write_replaceRepeatableQuestTags as replaceRepeatableQuestTags, write_replaceUnlocks as replaceUnlocks, write_reviseQuestObjective as reviseQuestObjective, write_settleRumor as settleRumor, write_softDeleteQuest as softDeleteQuest, write_softDeleteQuestline as softDeleteQuestline, write_softDeleteRepeatableQuest as softDeleteRepeatableQuest, write_softDeleteRumor as softDeleteRumor, write_spawnDueRepeatableQuests as spawnDueRepeatableQuests, write_startQuest as startQuest, write_tagQuest as tagQuest, write_untagQuest as untagQuest, write_updateQuestReward as updateQuestReward, write_updateQuestline as updateQuestline, write_updateRepeatableQuest as updateRepeatableQuest, write_updateRumor as updateRumor };
|
|
1698
1721
|
}
|
|
1699
1722
|
|
|
1700
|
-
export { type AbandonQuestResult, type CaptureRumorInput, type CreateQuestInput, type CreateQuestlineInput, type CreateRepeatableQuestInput, type DueRepeatableAnchor, type FollowupQuestInput, type JsonSchema, type JsonSchemaType, type MarkerDefinition, type MarkerId, type PlanQuestTimeInput, type Quest, type QuestDetail, type QuestListFilters, type QuestReward, type QuestRewardInput, type QuestState, type QuestUnlock, type Questline, type QuestlineDetail, type QuestlogDb, type QuestlogSearchResult, type QuestlogSkill, type QuestlogSkillRegistry, type QuestlogSoul, type QuestlogSoulTrait, type QuestlogToolDefinition, type QuestlogToolMapping, type RepeatableQuest, type RepeatableQuestReward, type RepeatableQuestRewardInput, type Rumor, type RumorDetail, type RumorOutput, type RumorState, type SettleRumorInput, type SettleRumorResult, type Tag, type ToolClarificationCode, type ToolDefinitionRegistry, type ToolEntityKind, type ToolEntityRef, type ToolErrorCode, type ToolErrorKind, type ToolFailure, type ToolInputDescriptions, type ToolListItem, type ToolNeedsClarification, type ToolNextStepHint, type ToolNextStepHintKind, type ToolOutcomeKind, type ToolOutputDescription, type ToolResult, type ToolSideEffects, type ToolSuccess, type ToolWarning, type ToolWarningCode, type UpdateQuestlineInput, type UpdateRepeatableQuestInput, abandonQuest, abandonQuestAndSpawnFollowups, addQuestReward, addUnlock, archiveDeleteAndPruneSkill, archiveQuestline, archiveRepeatableQuest, arraySchema, booleanSchema, captureRumor, captureRumorTool, captureRumorToolHandler, captureRumorToolName, chooseWorkShapeSkill, claimQuestReward, clarifyAmbiguousRequestsSkill, closeWorkAndClaimOutcomesSkill, createConcreteQuestSkill, createQuest, createQuestline, createRepeatableQuest, defineQuestlogSkill, defineQuestlogTool, detachQuestFromQuestline, detectSlipsAndStalenessSkill, dismissRumor, enumSchema, escalateAndUnblockSkill, finishQuest, frameInitiativeQuestlineSkill, getQuestDetail, getQuestlineDetail, getQuestlogSkillByName, getQuestlogToolByName, getRumorDetail, getRumorOutputs, handleExceptionsAndWeirdCasesSkill, initQuestlogTables, inspectQuestlogItemTool, inspectQuestlogItemToolHandler, inspectQuestlogItemToolName, intakeTriageSkill, integerSchema, listActiveQuests, listAvailableQuests, listBlockedQuests, listDeferredQuests, listDueRepeatableQuestAnchors, listDueSoonQuests, listInProgressQuests, listMissedScheduledQuests, listOpenQuests, listOverdueQuests, listQuestlines, listQuestlogSkills, listQuestlogToolDefinitions, listResolvedQuests, listRumors, listScheduledForDay, listScheduledNow, literalSchema, logQuestEffort, maintainClearOwnershipSkill, manageApprovalsAndPromisesSkill, manageRepeatableTool, manageRepeatableToolHandler, manageRepeatableToolName, index$2 as markers, moveQuestToQuestline, numberSchema, objectSchema, oneOfSchema, organizeWorkTool, organizeWorkToolHandler, organizeWorkToolName, planQuestTime, planQuestTool, planQuestToolHandler, planQuestToolName, planSuccessorWorkSkill, planTimeCorrectlySkill, prioritizeAcrossStreamsSkill, protectCapacityAndFocusSkill, questlogSkills, questlogToolMappings, questlogTools, read, recoverFromModelingMistakesSkill, removeQuestReward, removeUnlock, reopenRumor, replaceQuestTags, replaceRepeatableQuestRewards, replaceRepeatableQuestTags, replaceUnlocks, reportStatusAndManageExpectationsSkill, retireWorkTool, retireWorkToolHandler, retireWorkToolName, reviewQuestlogTool, reviewQuestlogToolHandler, reviewQuestlogToolName, reviseOrReshapeCommitmentSkill, reviseQuestObjective, rewardWorkTool, rewardWorkToolHandler, rewardWorkToolName, runOperationalReviewSkill, runQuestTool, runQuestToolHandler, runQuestToolName, runRecurringRhythmsSkill, searchAndRetrieveContextSkill, searchQuestlogTool, searchQuestlogToolHandler, searchQuestlogToolName, sequenceWithUnlocksSkill, settleRumor, settleRumorIntoStructureSkill, shapeWorkTool, shapeWorkToolHandler, shapeWorkToolName, index$1 as skills, softDeleteQuest, softDeleteQuestline, softDeleteRepeatableQuest, softDeleteRumor, soul, spawnDueRepeatableQuests, startQuest, stringSchema, tagAndFilterPortfoliosSkill, tagQuest, tagWorkTool, tagWorkToolHandler, tagWorkToolName, toolFailure, toolNeedsClarification, toolNoOp, toolSuccess, toolWarning, index as tools, untagQuest, updateQuestReward, updateQuestline, updateRepeatableQuest, write };
|
|
1723
|
+
export { type AbandonQuestResult, type CaptureRumorInput, type CreateQuestInput, type CreateQuestlineInput, type CreateRepeatableQuestInput, type DueRepeatableAnchor, type FollowupQuestInput, type JsonSchema, type JsonSchemaType, type MarkerDefinition, type MarkerId, type PlanQuestTimeInput, type Quest, type QuestDetail, type QuestListFilters, type QuestReward, type QuestRewardInput, type QuestState, type QuestUnlock, type Questline, type QuestlineDetail, type QuestlogDb, type QuestlogSearchResult, type QuestlogSkill, type QuestlogSkillRegistry, type QuestlogSoul, type QuestlogSoulTrait, type QuestlogToolDefinition, type QuestlogToolMapping, type RepeatableQuest, type RepeatableQuestReward, type RepeatableQuestRewardInput, type Rumor, type RumorDetail, type RumorOutput, type RumorState, type SettleRumorInput, type SettleRumorResult, type Tag, type ToolClarificationCode, type ToolDefinitionRegistry, type ToolEntityKind, type ToolEntityRef, type ToolErrorCode, type ToolErrorKind, type ToolFailure, type ToolInputDescriptions, type ToolListItem, type ToolNeedsClarification, type ToolNextStepHint, type ToolNextStepHintKind, type ToolOutcomeKind, type ToolOutputDescription, type ToolResult, type ToolSideEffects, type ToolSuccess, type ToolWarning, type ToolWarningCode, type UpdateQuestlineInput, type UpdateRepeatableQuestInput, type UpdateRumorInput, abandonQuest, abandonQuestAndSpawnFollowups, addQuestReward, addUnlock, archiveDeleteAndPruneSkill, archiveQuestline, archiveRepeatableQuest, arraySchema, booleanSchema, captureRumor, captureRumorTool, captureRumorToolHandler, captureRumorToolName, chooseWorkShapeSkill, claimQuestReward, clarifyAmbiguousRequestsSkill, closeWorkAndClaimOutcomesSkill, createConcreteQuestSkill, createQuest, createQuestline, createRepeatableQuest, defineQuestlogSkill, defineQuestlogTool, detachQuestFromQuestline, detectSlipsAndStalenessSkill, dismissRumor, enumSchema, escalateAndUnblockSkill, finishQuest, frameInitiativeQuestlineSkill, getQuestDetail, getQuestlineDetail, getQuestlogSkillByName, getQuestlogToolByName, getRumorDetail, getRumorOutputs, handleExceptionsAndWeirdCasesSkill, initQuestlogTables, inspectQuestlogItemTool, inspectQuestlogItemToolHandler, inspectQuestlogItemToolName, intakeTriageSkill, integerSchema, listActiveQuests, listAvailableQuests, listBlockedQuests, listDeferredQuests, listDueRepeatableQuestAnchors, listDueSoonQuests, listInProgressQuests, listMissedScheduledQuests, listOpenQuests, listOverdueQuests, listQuestlines, listQuestlogSkills, listQuestlogToolDefinitions, listResolvedQuests, listRumors, listScheduledForDay, listScheduledNow, literalSchema, logQuestEffort, maintainClearOwnershipSkill, manageApprovalsAndPromisesSkill, manageRepeatableTool, manageRepeatableToolHandler, manageRepeatableToolName, index$2 as markers, moveQuestToQuestline, numberSchema, objectSchema, oneOfSchema, organizeWorkTool, organizeWorkToolHandler, organizeWorkToolName, planQuestTime, planQuestTool, planQuestToolHandler, planQuestToolName, planSuccessorWorkSkill, planTimeCorrectlySkill, prioritizeAcrossStreamsSkill, protectCapacityAndFocusSkill, questlogSkills, questlogToolMappings, questlogTools, read, recoverFromModelingMistakesSkill, removeQuestReward, removeUnlock, reopenRumor, replaceQuestTags, replaceRepeatableQuestRewards, replaceRepeatableQuestTags, replaceUnlocks, reportStatusAndManageExpectationsSkill, retireWorkTool, retireWorkToolHandler, retireWorkToolName, reviewQuestlogTool, reviewQuestlogToolHandler, reviewQuestlogToolName, reviseOrReshapeCommitmentSkill, reviseQuestObjective, rewardWorkTool, rewardWorkToolHandler, rewardWorkToolName, runOperationalReviewSkill, runQuestTool, runQuestToolHandler, runQuestToolName, runRecurringRhythmsSkill, searchAndRetrieveContextSkill, searchQuestlogTool, searchQuestlogToolHandler, searchQuestlogToolName, sequenceWithUnlocksSkill, settleRumor, settleRumorIntoStructureSkill, shapeWorkTool, shapeWorkToolHandler, shapeWorkToolName, index$1 as skills, softDeleteQuest, softDeleteQuestline, softDeleteRepeatableQuest, softDeleteRumor, soul, spawnDueRepeatableQuests, startQuest, stringSchema, tagAndFilterPortfoliosSkill, tagQuest, tagWorkTool, tagWorkToolHandler, tagWorkToolName, toolFailure, toolNeedsClarification, toolNoOp, toolSuccess, toolWarning, index as tools, untagQuest, updateQuestReward, updateQuestline, updateRepeatableQuest, updateRumor, write };
|
package/dist/index.js
CHANGED
|
@@ -2000,6 +2000,29 @@ function softDeleteRumor(db, rumorId, now) {
|
|
|
2000
2000
|
).run(deletedAt, deletedAt, rumorId);
|
|
2001
2001
|
}
|
|
2002
2002
|
|
|
2003
|
+
// src/rumors/update_rumor.ts
|
|
2004
|
+
function updateRumor(db, rumorId, input) {
|
|
2005
|
+
if (input.title == null && input.details == null) {
|
|
2006
|
+
throw new Error("At least one of title or details must be provided to update a rumor.");
|
|
2007
|
+
}
|
|
2008
|
+
const current = getRumorOrThrow(db, rumorId);
|
|
2009
|
+
if (current.settledAt != null) {
|
|
2010
|
+
throw new Error(`Rumor ${rumorId} is already settled and cannot be updated.`);
|
|
2011
|
+
}
|
|
2012
|
+
if (current.dismissedAt != null) {
|
|
2013
|
+
throw new Error(`Rumor ${rumorId} is dismissed and cannot be updated. Reopen it first.`);
|
|
2014
|
+
}
|
|
2015
|
+
const now = resolveNow(input.now);
|
|
2016
|
+
const nextTitle = input.title != null ? assertNonEmpty(input.title, "Rumor title") : current.title;
|
|
2017
|
+
const nextDetails = input.details != null ? input.details.trim() || null : current.details;
|
|
2018
|
+
db.prepare(
|
|
2019
|
+
`UPDATE rumors
|
|
2020
|
+
SET title = ?, details = ?, updated_at = ?
|
|
2021
|
+
WHERE id = ? AND deleted_at IS NULL`
|
|
2022
|
+
).run(nextTitle, nextDetails, now, rumorId);
|
|
2023
|
+
return getRumorOrThrow(db, rumorId);
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2003
2026
|
// src/search_questlog.ts
|
|
2004
2027
|
function searchQuestlog(db, query) {
|
|
2005
2028
|
const trimmed = query.trim();
|
|
@@ -5223,6 +5246,27 @@ function shapeWorkToolHandler(db, input) {
|
|
|
5223
5246
|
}
|
|
5224
5247
|
);
|
|
5225
5248
|
}
|
|
5249
|
+
case "update_rumor": {
|
|
5250
|
+
updateRumor(db, input.rumorId, {
|
|
5251
|
+
...input.title != null && { title: input.title },
|
|
5252
|
+
...input.details != null && { details: input.details },
|
|
5253
|
+
...input.now != null && { now: input.now }
|
|
5254
|
+
});
|
|
5255
|
+
const detail = getRumorDetail(db, input.rumorId);
|
|
5256
|
+
return toolSuccess(
|
|
5257
|
+
`Updated rumor \`${detail.title}\`.`,
|
|
5258
|
+
{
|
|
5259
|
+
action: input.action,
|
|
5260
|
+
primary: toRumorRef(detail),
|
|
5261
|
+
updated: [toRumorRef(detail)],
|
|
5262
|
+
rumor: detail
|
|
5263
|
+
},
|
|
5264
|
+
{
|
|
5265
|
+
entities: [toRumorRef(detail)],
|
|
5266
|
+
next: [inspectItemNext(toRumorRef(detail))]
|
|
5267
|
+
}
|
|
5268
|
+
);
|
|
5269
|
+
}
|
|
5226
5270
|
}
|
|
5227
5271
|
} catch (error) {
|
|
5228
5272
|
return translateToolError(error, {
|
|
@@ -5249,7 +5293,9 @@ var shapeWorkTool = defineQuestlogTool({
|
|
|
5249
5293
|
questId: "The concrete quest being attached to or detached from a questline.",
|
|
5250
5294
|
questlineId: "The questline that should receive the quest for attach actions.",
|
|
5251
5295
|
dismissedAt: "Optional dismissal timestamp for dismissing a rumor.",
|
|
5252
|
-
now: "Optional timestamp for reopen
|
|
5296
|
+
now: "Optional timestamp for reopen, questline membership, or rumor update.",
|
|
5297
|
+
title: "New title for the update_rumor action.",
|
|
5298
|
+
details: "New or enriched context for the update_rumor action. Append evidence as rumors accumulate information across conversations."
|
|
5253
5299
|
},
|
|
5254
5300
|
outputDescription: "Returns the changed or created rumor, quest, questline, or created quest set for the selected shape-work action, plus purpose-shaped primary and created or updated refs. Repeated safe actions return structured no-op results, and rumor settlement can ask for missing structure instead of failing.",
|
|
5255
5301
|
inputSchema: objectSchema(
|
|
@@ -5261,7 +5307,8 @@ var shapeWorkTool = defineQuestlogTool({
|
|
|
5261
5307
|
"detach_quest_from_questline",
|
|
5262
5308
|
"dismiss_rumor",
|
|
5263
5309
|
"reopen_rumor",
|
|
5264
|
-
"settle_rumor"
|
|
5310
|
+
"settle_rumor",
|
|
5311
|
+
"update_rumor"
|
|
5265
5312
|
]),
|
|
5266
5313
|
questId: integerSchema("Quest to attach or detach."),
|
|
5267
5314
|
questlineId: integerSchema("Questline that should receive the quest."),
|
|
@@ -5327,10 +5374,12 @@ var shapeWorkTool = defineQuestlogTool({
|
|
|
5327
5374
|
),
|
|
5328
5375
|
"Quests to create during rumor settlement. Include timing and tags directly."
|
|
5329
5376
|
),
|
|
5330
|
-
now: integerSchema("Optional timestamp for membership or
|
|
5377
|
+
now: integerSchema("Optional timestamp for membership, reopen, or rumor update."),
|
|
5378
|
+
title: stringSchema("New title for the update_rumor action."),
|
|
5379
|
+
details: stringSchema("New or enriched context text for the update_rumor action.")
|
|
5331
5380
|
},
|
|
5332
5381
|
["action"],
|
|
5333
|
-
"Create quests with timing and tags, create questlines, settle rumors into work,
|
|
5382
|
+
"Create quests with timing and tags, create questlines, settle rumors into work, manage quest-questline membership, or enrich open rumors with new context."
|
|
5334
5383
|
),
|
|
5335
5384
|
handler: shapeWorkToolHandler
|
|
5336
5385
|
});
|
|
@@ -5708,7 +5757,8 @@ __export(write_exports, {
|
|
|
5708
5757
|
untagQuest: () => untagQuest,
|
|
5709
5758
|
updateQuestReward: () => updateQuestReward,
|
|
5710
5759
|
updateQuestline: () => updateQuestline,
|
|
5711
|
-
updateRepeatableQuest: () => updateRepeatableQuest
|
|
5760
|
+
updateRepeatableQuest: () => updateRepeatableQuest,
|
|
5761
|
+
updateRumor: () => updateRumor
|
|
5712
5762
|
});
|
|
5713
5763
|
|
|
5714
5764
|
export { initQuestlogTables, markers_exports as markers, read_exports as read, skills_exports as skills, soul_exports as soul, tools_exports as tools, write_exports as write };
|