@addai/node 0.30.16-msp.0 → 0.30.16-msp.10
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/capabilities.d.ts +5 -1
- package/dist/capabilities.js +1 -1
- package/dist/claude-print.d.ts +34 -0
- package/dist/claude-print.js +134 -10
- package/dist/codex-models.d.ts +2 -0
- package/dist/codex-models.js +5 -0
- package/dist/mcp-direct.d.ts +22 -0
- package/dist/mcp-direct.js +163 -0
- package/dist/memory-pack.d.ts +7 -1
- package/dist/memory-pack.js +14 -2
- package/dist/memory-recall.d.ts +8 -0
- package/dist/memory-recall.js +163 -0
- package/dist/model-selector.d.ts +56 -1
- package/dist/model-selector.js +198 -16
- package/dist/session-runner.d.ts +25 -1
- package/dist/session-runner.js +377 -94
- package/dist/time-context.d.ts +10 -0
- package/dist/time-context.js +31 -0
- package/package.json +1 -1
package/dist/time-context.d.ts
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
* omit them to get the machine clock and zone at spawn time.
|
|
4
4
|
*/
|
|
5
5
|
export declare function currentTimeBlock(now?: Date, timeZone?: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* The block for a chat that resumes. Claude reuses a conversation's first system
|
|
8
|
+
* prompt on every later turn, so a "now" written here goes stale, and the model
|
|
9
|
+
* would believe it over the message in front of it. Every chat message carries
|
|
10
|
+
* its own UTC time, so this says to use that, and keeps only what stays true:
|
|
11
|
+
* where the entity is running and that zone's offset.
|
|
12
|
+
*/
|
|
13
|
+
export declare function chatTimeBlock(now?: Date, timeZone?: string): string;
|
|
14
|
+
/** appendTimeContext for a chat turn; see chatTimeBlock. */
|
|
15
|
+
export declare function appendChatTimeContext(systemPrompt: string | null | undefined, now?: Date, timeZone?: string): string;
|
|
6
16
|
/**
|
|
7
17
|
* Append the time block to a request's system prompt (or stand alone when the
|
|
8
18
|
* request has none). Used at every agent spawn site in session-runner.
|
package/dist/time-context.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
// Each request is a fresh CLI invocation, so the block is per-turn fresh.
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.currentTimeBlock = currentTimeBlock;
|
|
16
|
+
exports.chatTimeBlock = chatTimeBlock;
|
|
17
|
+
exports.appendChatTimeContext = appendChatTimeContext;
|
|
16
18
|
exports.appendTimeContext = appendTimeContext;
|
|
17
19
|
function machineTimeZone() {
|
|
18
20
|
try {
|
|
@@ -60,6 +62,35 @@ function currentTimeBlock(now = new Date(), timeZone = machineTimeZone()) {
|
|
|
60
62
|
'Timestamps on chat messages, records and logs may be stored in UTC — convert them to this timezone before repeating them to users. Never read a UTC timestamp as if it were local time.',
|
|
61
63
|
].join('\n');
|
|
62
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* The block for a chat that resumes. Claude reuses a conversation's first system
|
|
67
|
+
* prompt on every later turn, so a "now" written here goes stale, and the model
|
|
68
|
+
* would believe it over the message in front of it. Every chat message carries
|
|
69
|
+
* its own UTC time, so this says to use that, and keeps only what stays true:
|
|
70
|
+
* where the entity is running and that zone's offset.
|
|
71
|
+
*/
|
|
72
|
+
function chatTimeBlock(now = new Date(), timeZone = machineTimeZone()) {
|
|
73
|
+
let tz = timeZone;
|
|
74
|
+
let fmt;
|
|
75
|
+
try {
|
|
76
|
+
fmt = formatParts(now, tz);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
tz = 'UTC';
|
|
80
|
+
fmt = formatParts(now, tz);
|
|
81
|
+
}
|
|
82
|
+
return [
|
|
83
|
+
'## Current date & time',
|
|
84
|
+
`For the current time, use the time in the header of the newest message, which is in UTC. These instructions were written at ${fmt.stamp} ${fmt.zone} and can be hours or days old in a long chat, so only fall back on that if a message has no time.`,
|
|
85
|
+
`Local time where you are running is ${tz} (${fmt.offset} when this was written). Convert UTC times from messages, records and logs to it before telling people a time. Never read a UTC timestamp as if it were local time.`,
|
|
86
|
+
].join('\n');
|
|
87
|
+
}
|
|
88
|
+
/** appendTimeContext for a chat turn; see chatTimeBlock. */
|
|
89
|
+
function appendChatTimeContext(systemPrompt, now, timeZone) {
|
|
90
|
+
const block = chatTimeBlock(now, timeZone);
|
|
91
|
+
const sp = (systemPrompt ?? '').trim();
|
|
92
|
+
return sp ? `${systemPrompt}\n\n${block}` : block;
|
|
93
|
+
}
|
|
63
94
|
/**
|
|
64
95
|
* Append the time block to a request's system prompt (or stand alone when the
|
|
65
96
|
* request has none). Used at every agent spawn site in session-runner.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@addai/node",
|
|
3
|
-
"version": "0.30.16-msp.
|
|
3
|
+
"version": "0.30.16-msp.10",
|
|
4
4
|
"description": "Daemon that pairs a machine with your +Ai account and runs Claude / Codex / Kimi / Gemini agents on its behalf. Reachable via Supabase from Vault, Entity Studio, or any other +Ai surface.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|