wendkeep 0.37.0 → 0.38.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/CHANGELOG.md +21 -0
- package/README.md +2 -0
- package/README.pt-BR.md +2 -0
- package/bin/wendkeep.mjs +7 -1
- package/hooks/brain-inject.mjs +87 -80
- package/hooks/change-context.mjs +8 -4
- package/hooks/decision-capture.mjs +4 -2
- package/hooks/obsidian-common.mjs +701 -619
- package/hooks/plan-capture.mjs +8 -7
- package/hooks/pricing.json +53 -53
- package/hooks/session-ensure.mjs +413 -392
- package/hooks/session-identity.mjs +97 -0
- package/hooks/session-observability.mjs +16 -2
- package/hooks/session-start.mjs +340 -317
- package/hooks/session-stop.mjs +1153 -1141
- package/hooks/subagent-stop.mjs +7 -5
- package/hooks/task-log.mjs +5 -4
- package/hooks/token-usage.mjs +941 -941
- package/hooks/vault-health.mjs +198 -195
- package/package.json +1 -1
- package/src/change.mjs +14 -2
- package/src/rebuild-costs.mjs +5 -5
- package/src/session.mjs +37 -0
package/hooks/subagent-stop.mjs
CHANGED
|
@@ -8,17 +8,19 @@
|
|
|
8
8
|
import { existsSync } from 'fs';
|
|
9
9
|
import { join } from 'path';
|
|
10
10
|
import { pathToFileURL } from 'url';
|
|
11
|
-
import { readHookInput, writeHookOutput, getVaultBase,
|
|
11
|
+
import { readHookInput, writeHookOutput, getVaultBase, providerMeta } from './obsidian-common.mjs';
|
|
12
12
|
import { updateSessionObservability } from './session-observability.mjs';
|
|
13
|
+
import { resolveSessionEntry } from './session-identity.mjs';
|
|
13
14
|
|
|
14
15
|
export function refreshSubagents(vaultBase, input) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const
|
|
16
|
+
const { identity, entry } = resolveSessionEntry(vaultBase, input, providerMeta(input.provider).id);
|
|
17
|
+
if (identity.state !== 'resolved') return false;
|
|
18
|
+
const transcriptPath = identity.transcriptPath;
|
|
19
|
+
const sessionRel = entry?.session_file || '';
|
|
18
20
|
if (!sessionRel) return false;
|
|
19
21
|
const sessionPath = join(vaultBase, sessionRel);
|
|
20
22
|
if (!existsSync(sessionPath)) return false;
|
|
21
|
-
updateSessionObservability({ sessionPath, transcriptPath });
|
|
23
|
+
updateSessionObservability({ sessionPath, transcriptPath, caller: 'subagent-stop', canonicalConversationId: identity.canonicalConversationId });
|
|
22
24
|
return true;
|
|
23
25
|
}
|
|
24
26
|
|
package/hooks/task-log.mjs
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
9
9
|
import { join } from 'path';
|
|
10
10
|
import { pathToFileURL } from 'url';
|
|
11
|
-
import { readHookInput, writeHookOutput, getVaultBase,
|
|
11
|
+
import { readHookInput, writeHookOutput, getVaultBase, formatHourMinute, providerMeta } from './obsidian-common.mjs';
|
|
12
12
|
import { getLocale } from './locale.mjs';
|
|
13
|
+
import { resolveSessionEntry } from './session-identity.mjs';
|
|
13
14
|
|
|
14
15
|
// Pull the task's human text from whatever field the payload carries.
|
|
15
16
|
export function taskText(input) {
|
|
@@ -41,9 +42,9 @@ export function appendProgress(content, line, heading) {
|
|
|
41
42
|
export function logTask(vaultBase, input) {
|
|
42
43
|
const text = taskText(input);
|
|
43
44
|
if (!text) return false;
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const sessionRel =
|
|
45
|
+
const { identity, entry } = resolveSessionEntry(vaultBase, input, providerMeta(input.provider).id);
|
|
46
|
+
if (identity.state !== 'resolved') return false;
|
|
47
|
+
const sessionRel = entry?.session_file || '';
|
|
47
48
|
if (!sessionRel) return false;
|
|
48
49
|
const sessionPath = join(vaultBase, sessionRel);
|
|
49
50
|
if (!existsSync(sessionPath)) return false;
|