instar 1.3.326 → 1.3.328
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +2 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/ForwardedTopicContext.d.ts.map +1 -1
- package/dist/core/ForwardedTopicContext.js +4 -6
- package/dist/core/ForwardedTopicContext.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +23 -5
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/lifeline/ServerSupervisor.d.ts +8 -0
- package/dist/lifeline/ServerSupervisor.d.ts.map +1 -1
- package/dist/lifeline/ServerSupervisor.js +25 -0
- package/dist/lifeline/ServerSupervisor.js.map +1 -1
- package/dist/lifeline/SlowRetrySentinelEscalation.d.ts +45 -0
- package/dist/lifeline/SlowRetrySentinelEscalation.d.ts.map +1 -0
- package/dist/lifeline/SlowRetrySentinelEscalation.js +51 -0
- package/dist/lifeline/SlowRetrySentinelEscalation.js.map +1 -0
- package/dist/lifeline/TelegramLifeline.d.ts +6 -0
- package/dist/lifeline/TelegramLifeline.d.ts.map +1 -1
- package/dist/lifeline/TelegramLifeline.js +25 -1
- package/dist/lifeline/TelegramLifeline.js.map +1 -1
- package/dist/memory/TopicMemory.d.ts.map +1 -1
- package/dist/memory/TopicMemory.js +3 -2
- package/dist/memory/TopicMemory.js.map +1 -1
- package/dist/messaging/shared/compactionResumePayload.d.ts.map +1 -1
- package/dist/messaging/shared/compactionResumePayload.js +2 -1
- package/dist/messaging/shared/compactionResumePayload.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +3 -2
- package/dist/server/routes.js.map +1 -1
- package/dist/utils/localTime.d.ts +42 -0
- package/dist/utils/localTime.d.ts.map +1 -0
- package/dist/utils/localTime.js +60 -0
- package/dist/utils/localTime.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +67 -67
- package/src/templates/hooks/compaction-recovery.sh +15 -3
- package/src/templates/hooks/slack-channel-context.sh +1 -1
- package/src/templates/hooks/telegram-topic-context.sh +8 -2
- package/upgrades/1.3.327.md +57 -0
- package/upgrades/1.3.328.md +44 -0
- package/upgrades/local-time-coherence.eli16.md +11 -0
- package/upgrades/side-effects/local-time-coherence.md +89 -0
- package/upgrades/side-effects/supervisor-sentinel-escalation.md +61 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local-timezone timestamp rendering for agent-facing context blocks.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists (2026-06-05 time-incoherency incident): every injected
|
|
5
|
+
* thread-history surface rendered timestamps as unlabeled UTC
|
|
6
|
+
* (`toISOString().slice(11, 19)`). An agent read `[21:23:10]` as local
|
|
7
|
+
* wall-clock and told the user "you heard nothing between 9:23pm and now"
|
|
8
|
+
* about an event that happened at 2:23pm the user's time — while the
|
|
9
|
+
* session-start hook injects CURRENT TIME in local time. Two clocks, one
|
|
10
|
+
* labeled, one not.
|
|
11
|
+
*
|
|
12
|
+
* Structure > Willpower: agents cannot be trusted to remember that history
|
|
13
|
+
* timestamps are UTC while wall-clock is local. Every timestamp an agent
|
|
14
|
+
* sees MUST be rendered in the host's local timezone with an explicit
|
|
15
|
+
* timezone label, so no conversion discipline is required.
|
|
16
|
+
*
|
|
17
|
+
* All thread-history / topic-context / compaction-resume renderers MUST use
|
|
18
|
+
* this helper instead of hand-rolling `toISOString()` slices.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The host's short timezone label for a given instant (e.g. "PDT", "GMT+2").
|
|
22
|
+
* Empty string if Intl can't resolve one — callers render without a label
|
|
23
|
+
* rather than failing.
|
|
24
|
+
*/
|
|
25
|
+
export declare function localTzAbbreviation(d?: Date): string;
|
|
26
|
+
/**
|
|
27
|
+
* Format a timestamp in the HOST's local timezone with an explicit tz label.
|
|
28
|
+
*
|
|
29
|
+
* Default shape: `2026-06-05 14:23 PDT` (date + minutes + label) — history
|
|
30
|
+
* lines spanning midnight stay unambiguous, and minute granularity matches
|
|
31
|
+
* how users talk about time. Options:
|
|
32
|
+
* - `date: false` → `14:23 PDT` (for compact status lines)
|
|
33
|
+
* - `seconds: true` → include `:SS`
|
|
34
|
+
*
|
|
35
|
+
* Invalid / missing input renders as `??:??` (the existing sentinel the
|
|
36
|
+
* history formats already used).
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatLocalTimestamp(input: string | number | Date | null | undefined, opts?: {
|
|
39
|
+
date?: boolean;
|
|
40
|
+
seconds?: boolean;
|
|
41
|
+
}): string;
|
|
42
|
+
//# sourceMappingURL=localTime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localTime.d.ts","sourceRoot":"","sources":["../../src/utils/localTime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,GAAE,IAAiB,GAAG,MAAM,CAShE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,EAChD,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/C,MAAM,CAUR"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local-timezone timestamp rendering for agent-facing context blocks.
|
|
3
|
+
*
|
|
4
|
+
* Why this exists (2026-06-05 time-incoherency incident): every injected
|
|
5
|
+
* thread-history surface rendered timestamps as unlabeled UTC
|
|
6
|
+
* (`toISOString().slice(11, 19)`). An agent read `[21:23:10]` as local
|
|
7
|
+
* wall-clock and told the user "you heard nothing between 9:23pm and now"
|
|
8
|
+
* about an event that happened at 2:23pm the user's time — while the
|
|
9
|
+
* session-start hook injects CURRENT TIME in local time. Two clocks, one
|
|
10
|
+
* labeled, one not.
|
|
11
|
+
*
|
|
12
|
+
* Structure > Willpower: agents cannot be trusted to remember that history
|
|
13
|
+
* timestamps are UTC while wall-clock is local. Every timestamp an agent
|
|
14
|
+
* sees MUST be rendered in the host's local timezone with an explicit
|
|
15
|
+
* timezone label, so no conversion discipline is required.
|
|
16
|
+
*
|
|
17
|
+
* All thread-history / topic-context / compaction-resume renderers MUST use
|
|
18
|
+
* this helper instead of hand-rolling `toISOString()` slices.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* The host's short timezone label for a given instant (e.g. "PDT", "GMT+2").
|
|
22
|
+
* Empty string if Intl can't resolve one — callers render without a label
|
|
23
|
+
* rather than failing.
|
|
24
|
+
*/
|
|
25
|
+
export function localTzAbbreviation(d = new Date()) {
|
|
26
|
+
try {
|
|
27
|
+
const part = new Intl.DateTimeFormat('en-US', { timeZoneName: 'short' })
|
|
28
|
+
.formatToParts(d)
|
|
29
|
+
.find((p) => p.type === 'timeZoneName');
|
|
30
|
+
return part?.value ?? '';
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Format a timestamp in the HOST's local timezone with an explicit tz label.
|
|
38
|
+
*
|
|
39
|
+
* Default shape: `2026-06-05 14:23 PDT` (date + minutes + label) — history
|
|
40
|
+
* lines spanning midnight stay unambiguous, and minute granularity matches
|
|
41
|
+
* how users talk about time. Options:
|
|
42
|
+
* - `date: false` → `14:23 PDT` (for compact status lines)
|
|
43
|
+
* - `seconds: true` → include `:SS`
|
|
44
|
+
*
|
|
45
|
+
* Invalid / missing input renders as `??:??` (the existing sentinel the
|
|
46
|
+
* history formats already used).
|
|
47
|
+
*/
|
|
48
|
+
export function formatLocalTimestamp(input, opts = {}) {
|
|
49
|
+
if (input == null || input === '')
|
|
50
|
+
return '??:??';
|
|
51
|
+
const d = input instanceof Date ? input : new Date(input);
|
|
52
|
+
if (Number.isNaN(d.getTime()))
|
|
53
|
+
return '??:??';
|
|
54
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
55
|
+
const datePart = opts.date === false ? '' : `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} `;
|
|
56
|
+
const time = `${pad(d.getHours())}:${pad(d.getMinutes())}${opts.seconds ? `:${pad(d.getSeconds())}` : ''}`;
|
|
57
|
+
const tz = localTzAbbreviation(d);
|
|
58
|
+
return `${datePart}${time}${tz ? ` ${tz}` : ''}`;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=localTime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localTime.js","sourceRoot":"","sources":["../../src/utils/localTime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAU,IAAI,IAAI,EAAE;IACtD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;aACrE,aAAa,CAAC,CAAC,CAAC;aAChB,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;QAC1C,OAAO,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAgD,EAChD,OAA8C,EAAE;IAEhD,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,OAAO,CAAC;IAClD,MAAM,CAAC,GAAG,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,C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