@yagni-app/code-staging 1.2.14-staging.2276.1 → 1.2.14-staging.2281.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/extension/index.js
CHANGED
|
@@ -48,6 +48,7 @@ import { createGrantCensus } from "./permission/grantCensus.js";
|
|
|
48
48
|
import { runsInSandboxHarness, toolchainBashToolDefinition, toolchainSpawnHookFromEnv, toolchainUserBashOperations, } from "./toolchain/spawnHook.js";
|
|
49
49
|
import { CLOUD_SESSION_ENV } from "./pipeline/cloud.js";
|
|
50
50
|
import { registerCompactionPins } from "./pipeline/compactionPins.js";
|
|
51
|
+
import { registerSessionInbox } from "./pipeline/sessionInbox.js";
|
|
51
52
|
import { registerStageClock } from "./pipeline/stageClock.js";
|
|
52
53
|
import { registerBashDefaultTimeout } from "./toolchain/bashDefaultTimeout.js";
|
|
53
54
|
import { scrubSecrets } from "./pipeline/scrubSecrets.js";
|
|
@@ -185,6 +186,10 @@ export async function registerYagni(pi, deps = {}) {
|
|
|
185
186
|
// Not doing list and the Decisions above the fold (YAG-1163). Anywhere else
|
|
186
187
|
// it registers nothing.
|
|
187
188
|
registerCompactionPins(pi, env);
|
|
189
|
+
// A session-lane turn takes what a person sends a yak while it runs, from
|
|
190
|
+
// its execution's inbox, after each tool call (YAG-1210). Anywhere else it
|
|
191
|
+
// registers nothing.
|
|
192
|
+
registerSessionInbox(pi, env);
|
|
188
193
|
// The grounding settings switch (the judgment-loop kill switch): resolved
|
|
189
194
|
// ONCE at boot from the USER-tier config (default on; a malformed config
|
|
190
195
|
// fails soft to on with a sink warn). Eval mode is its own carve-out and
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
export { SESSION_INBOX_DIR_ENV, sessionInboxDir } from "./sessionLane.js";
|
|
3
|
+
/** A message the host wrote: `<id>.json`. */
|
|
4
|
+
export declare const INBOX_MESSAGE_SUFFIX = ".json";
|
|
5
|
+
/** The receipt this turn writes once pi put the message in the conversation: `<id>.received`. */
|
|
6
|
+
export declare const INBOX_RECEIPT_SUFFIX = ".received";
|
|
7
|
+
/** The most one message file may weigh; a larger one is never read, and goes the host's other way. */
|
|
8
|
+
export declare const MAX_INBOX_FILE_BYTES: number;
|
|
9
|
+
/** The most of a message's text one steer carries. */
|
|
10
|
+
export declare const MAX_STEER_CHARS = 16000;
|
|
11
|
+
/** The most messages one check hands to pi: the oldest first. */
|
|
12
|
+
export declare const MAX_INBOX_FILES_PER_CHECK = 20;
|
|
13
|
+
/**
|
|
14
|
+
* The most message files one check reads to find the oldest: more than the
|
|
15
|
+
* host ever gives one execution's inbox (50, `MAX_INBOX_MESSAGES_PER_EXECUTION`
|
|
16
|
+
* in the backend's `yaks/inbox.ts`), so messages reach pi in the order they
|
|
17
|
+
* were written whatever their file names.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MAX_INBOX_FILES_READ = 64;
|
|
20
|
+
/** Whether a string is a message id the inbox names files by. */
|
|
21
|
+
export declare function isInboxMessageId(value: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The first line of a message's steer, naming it: what the receipt matches
|
|
24
|
+
* the message pi puts in the conversation by, so a person's words that quote
|
|
25
|
+
* another message cannot answer for it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function steerHeader(id: string): string;
|
|
28
|
+
/** One message as the host wrote it. */
|
|
29
|
+
export interface InboxMessage {
|
|
30
|
+
id: string;
|
|
31
|
+
/** The words as the host wrapped them for the session, untrusted content marked. */
|
|
32
|
+
text: string;
|
|
33
|
+
/** When the person wrote it (epoch ms): the order messages are handed over in. */
|
|
34
|
+
at: number;
|
|
35
|
+
}
|
|
36
|
+
/** A message file's text read as a message named `id`, or null when it is not one. Pure. */
|
|
37
|
+
export declare function parseInboxMessage(id: string, raw: string): InboxMessage | null;
|
|
38
|
+
/** The steer a message is handed over as: its header, then its words, capped. Pure. */
|
|
39
|
+
export declare function steerText(message: InboxMessage): string;
|
|
40
|
+
/** The file system the inbox reads and writes; a test's own. */
|
|
41
|
+
export interface InboxFs {
|
|
42
|
+
list(dir: string): string[];
|
|
43
|
+
size(path: string): number;
|
|
44
|
+
read(path: string): string;
|
|
45
|
+
exists(path: string): boolean;
|
|
46
|
+
/** Write `text` to `path` whole: written beside it, then renamed over it. */
|
|
47
|
+
writeWhole(path: string, text: string): void;
|
|
48
|
+
}
|
|
49
|
+
export declare const nodeInboxFs: InboxFs;
|
|
50
|
+
/** What a registered inbox does, for the test that drives it without pi. */
|
|
51
|
+
export interface SessionInbox {
|
|
52
|
+
/** Read the folder and hand each new message to pi; returns the ids handed over. */
|
|
53
|
+
check(idle: boolean): string[];
|
|
54
|
+
/** A user message pi put in the conversation: the receipt, when it is one of ours. */
|
|
55
|
+
delivered(message: {
|
|
56
|
+
role?: unknown;
|
|
57
|
+
content?: unknown;
|
|
58
|
+
} | undefined): string | null;
|
|
59
|
+
}
|
|
60
|
+
/** The inbox's logic over its folder, its file system and pi's send. */
|
|
61
|
+
export declare function createSessionInbox(dir: string, send: (text: string) => void, fs?: InboxFs, now?: () => number): SessionInbox;
|
|
62
|
+
/**
|
|
63
|
+
* On a session-lane turn whose inbox the session lane named, messages in it
|
|
64
|
+
* reach the session after each tool call. Registered nowhere else.
|
|
65
|
+
*/
|
|
66
|
+
export declare function registerSessionInbox(pi: Pick<ExtensionAPI, "on" | "sendUserMessage">, env?: NodeJS.ProcessEnv, fs?: InboxFs): boolean;
|
|
67
|
+
//# sourceMappingURL=sessionInbox.d.ts.map
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A person's message reaches a running session-lane turn (YAG-1210). While a
|
|
3
|
+
* yak's ticket runs, the host writes each message a person sends it into
|
|
4
|
+
* this execution's inbox folder on the machine
|
|
5
|
+
* (`<input folder>/inbox/<execution>/<message>.json`, `yaks/inbox.ts` in the
|
|
6
|
+
* backend). After every tool call this turn reads the folder and hands each
|
|
7
|
+
* new message to pi as a steer (`deliverAs: "steer"`, pi 0.84.1): pi puts it
|
|
8
|
+
* in the conversation once the current tool calls finish, before the model's
|
|
9
|
+
* next step, so it never cuts a command off.
|
|
10
|
+
*
|
|
11
|
+
* The receipt is the proof it arrived: `<message>.received`, written beside
|
|
12
|
+
* the message when pi puts that steer into the conversation (its
|
|
13
|
+
* `message_end`), never when it is only queued. pi exits when its prompt is
|
|
14
|
+
* done, so a steer queued after the model's last tool call may never be
|
|
15
|
+
* taken; such a message has no receipt, and the host sends it the way it
|
|
16
|
+
* always has, to the next turn. The host reads the receipts (its watch's
|
|
17
|
+
* poll, `sessionPoll.ts`) and records them, so each message arrives once.
|
|
18
|
+
*
|
|
19
|
+
* Fail-soft and bounded: a folder that is missing or cannot be read, a file
|
|
20
|
+
* that is too big or does not parse, a send that throws, or a receipt that
|
|
21
|
+
* cannot be written leave the turn running exactly as it was, and the
|
|
22
|
+
* message to the host's fallback. The message is data: the host writes it
|
|
23
|
+
* wrapped as a person's words, and nothing here runs or follows it. Only the
|
|
24
|
+
* session's own turn takes messages (never a subagent it spawns), and only
|
|
25
|
+
* while its prompt is running, so a send never starts a new prompt.
|
|
26
|
+
*/
|
|
27
|
+
import { existsSync as nodeExistsSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync, } from "node:fs";
|
|
28
|
+
import { join } from "node:path";
|
|
29
|
+
import { logEvent } from "../errorSink.js";
|
|
30
|
+
import { isSessionLaneTurn, SESSION_INBOX_DIR_ENV } from "./sessionLane.js";
|
|
31
|
+
export { SESSION_INBOX_DIR_ENV, sessionInboxDir } from "./sessionLane.js";
|
|
32
|
+
/** A message the host wrote: `<id>.json`. */
|
|
33
|
+
export const INBOX_MESSAGE_SUFFIX = ".json";
|
|
34
|
+
/** The receipt this turn writes once pi put the message in the conversation: `<id>.received`. */
|
|
35
|
+
export const INBOX_RECEIPT_SUFFIX = ".received";
|
|
36
|
+
/** The most one message file may weigh; a larger one is never read, and goes the host's other way. */
|
|
37
|
+
export const MAX_INBOX_FILE_BYTES = 32 * 1024;
|
|
38
|
+
/** The most of a message's text one steer carries. */
|
|
39
|
+
export const MAX_STEER_CHARS = 16_000;
|
|
40
|
+
/** The most messages one check hands to pi: the oldest first. */
|
|
41
|
+
export const MAX_INBOX_FILES_PER_CHECK = 20;
|
|
42
|
+
/**
|
|
43
|
+
* The most message files one check reads to find the oldest: more than the
|
|
44
|
+
* host ever gives one execution's inbox (50, `MAX_INBOX_MESSAGES_PER_EXECUTION`
|
|
45
|
+
* in the backend's `yaks/inbox.ts`), so messages reach pi in the order they
|
|
46
|
+
* were written whatever their file names.
|
|
47
|
+
*/
|
|
48
|
+
export const MAX_INBOX_FILES_READ = 64;
|
|
49
|
+
const MESSAGE_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
50
|
+
/** Whether a string is a message id the inbox names files by. */
|
|
51
|
+
export function isInboxMessageId(value) {
|
|
52
|
+
return MESSAGE_ID.test(value);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The first line of a message's steer, naming it: what the receipt matches
|
|
56
|
+
* the message pi puts in the conversation by, so a person's words that quote
|
|
57
|
+
* another message cannot answer for it.
|
|
58
|
+
*/
|
|
59
|
+
export function steerHeader(id) {
|
|
60
|
+
return `A person on the Team wrote to you while you worked (YAGNI message ${id}).`;
|
|
61
|
+
}
|
|
62
|
+
/** A message file's text read as a message named `id`, or null when it is not one. Pure. */
|
|
63
|
+
export function parseInboxMessage(id, raw) {
|
|
64
|
+
let data;
|
|
65
|
+
try {
|
|
66
|
+
data = JSON.parse(raw);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
if (!data || typeof data !== "object" || Array.isArray(data))
|
|
72
|
+
return null;
|
|
73
|
+
const record = data;
|
|
74
|
+
if (record.id !== id || typeof record.text !== "string")
|
|
75
|
+
return null;
|
|
76
|
+
const text = record.text.trim();
|
|
77
|
+
if (!text)
|
|
78
|
+
return null;
|
|
79
|
+
const at = typeof record.at === "number" && Number.isFinite(record.at) ? record.at : 0;
|
|
80
|
+
return { id, text, at };
|
|
81
|
+
}
|
|
82
|
+
/** The steer a message is handed over as: its header, then its words, capped. Pure. */
|
|
83
|
+
export function steerText(message) {
|
|
84
|
+
const text = message.text.length > MAX_STEER_CHARS
|
|
85
|
+
? `${message.text.slice(0, MAX_STEER_CHARS)}\n\n(cut: the rest is on the ticket's conversation)`
|
|
86
|
+
: message.text;
|
|
87
|
+
return `${steerHeader(message.id)}\n\n${text}`;
|
|
88
|
+
}
|
|
89
|
+
/** The text of a message's content, as pi holds a user message. */
|
|
90
|
+
function textOf(content) {
|
|
91
|
+
if (typeof content === "string")
|
|
92
|
+
return content;
|
|
93
|
+
if (!Array.isArray(content))
|
|
94
|
+
return "";
|
|
95
|
+
return content
|
|
96
|
+
.map((part) => part && typeof part === "object" && part.type === "text"
|
|
97
|
+
? String(part.text ?? "")
|
|
98
|
+
: "")
|
|
99
|
+
.join("\n");
|
|
100
|
+
}
|
|
101
|
+
export const nodeInboxFs = {
|
|
102
|
+
list: (dir) => readdirSync(dir),
|
|
103
|
+
size: (path) => statSync(path).size,
|
|
104
|
+
read: (path) => readFileSync(path, "utf8"),
|
|
105
|
+
exists: (path) => nodeExistsSync(path),
|
|
106
|
+
writeWhole: (path, text) => {
|
|
107
|
+
const temp = `${path}.${process.pid}.tmp`;
|
|
108
|
+
writeFileSync(temp, text, { mode: 0o644 });
|
|
109
|
+
renameSync(temp, path);
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
/** The inbox's logic over its folder, its file system and pi's send. */
|
|
113
|
+
export function createSessionInbox(dir, send, fs = nodeInboxFs, now = Date.now) {
|
|
114
|
+
/** Handed to pi and not in the conversation yet: id to header. */
|
|
115
|
+
const pending = new Map();
|
|
116
|
+
/** Put in the conversation by this turn, or receipted before it. */
|
|
117
|
+
const taken = new Set();
|
|
118
|
+
const receiptOf = (id) => join(dir, `${id}${INBOX_RECEIPT_SUFFIX}`);
|
|
119
|
+
const unread = () => {
|
|
120
|
+
let names;
|
|
121
|
+
try {
|
|
122
|
+
names = fs.list(dir);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return [];
|
|
126
|
+
}
|
|
127
|
+
const found = [];
|
|
128
|
+
let read = 0;
|
|
129
|
+
for (const name of names.sort()) {
|
|
130
|
+
if (read >= MAX_INBOX_FILES_READ)
|
|
131
|
+
break;
|
|
132
|
+
if (!name.endsWith(INBOX_MESSAGE_SUFFIX))
|
|
133
|
+
continue;
|
|
134
|
+
const id = name.slice(0, -INBOX_MESSAGE_SUFFIX.length);
|
|
135
|
+
if (!isInboxMessageId(id) || pending.has(id) || taken.has(id))
|
|
136
|
+
continue;
|
|
137
|
+
const path = join(dir, name);
|
|
138
|
+
try {
|
|
139
|
+
// A receipt from an earlier pi child of the same execution (the plan's re-ask).
|
|
140
|
+
if (fs.exists(receiptOf(id))) {
|
|
141
|
+
taken.add(id);
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (fs.size(path) > MAX_INBOX_FILE_BYTES)
|
|
145
|
+
continue;
|
|
146
|
+
read += 1;
|
|
147
|
+
const message = parseInboxMessage(id, fs.read(path));
|
|
148
|
+
if (message)
|
|
149
|
+
found.push(message);
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
// Unreadable now: the next tool call reads it again.
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Ids are random: the oldest by when they were written, then the bound.
|
|
156
|
+
return found
|
|
157
|
+
.sort((a, b) => a.at - b.at || a.id.localeCompare(b.id))
|
|
158
|
+
.slice(0, MAX_INBOX_FILES_PER_CHECK);
|
|
159
|
+
};
|
|
160
|
+
return {
|
|
161
|
+
check(idle) {
|
|
162
|
+
// pi starts a new prompt for a message sent while it is idle; this
|
|
163
|
+
// turn's prompt is over then, and the host's fallback takes the rest.
|
|
164
|
+
if (idle)
|
|
165
|
+
return [];
|
|
166
|
+
const handed = [];
|
|
167
|
+
for (const message of unread()) {
|
|
168
|
+
pending.set(message.id, steerHeader(message.id));
|
|
169
|
+
try {
|
|
170
|
+
send(steerText(message));
|
|
171
|
+
handed.push(message.id);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
pending.delete(message.id);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (handed.length > 0) {
|
|
178
|
+
logEvent({
|
|
179
|
+
source: "session-inbox",
|
|
180
|
+
level: "info",
|
|
181
|
+
event: "steered",
|
|
182
|
+
fields: { messages: handed.length },
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
return handed;
|
|
186
|
+
},
|
|
187
|
+
delivered(message) {
|
|
188
|
+
if (!message || message.role !== "user" || pending.size === 0)
|
|
189
|
+
return null;
|
|
190
|
+
const text = textOf(message.content);
|
|
191
|
+
for (const [id, header] of pending) {
|
|
192
|
+
if (!text.startsWith(header))
|
|
193
|
+
continue;
|
|
194
|
+
pending.delete(id);
|
|
195
|
+
taken.add(id);
|
|
196
|
+
try {
|
|
197
|
+
fs.writeWhole(receiptOf(id), `${JSON.stringify({ id, at: now() })}\n`);
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
// No receipt: the host reads the message as not taken and sends it
|
|
201
|
+
// to the next turn too. Said, since it is the one way a message
|
|
202
|
+
// can arrive twice.
|
|
203
|
+
logEvent({
|
|
204
|
+
source: "session-inbox",
|
|
205
|
+
level: "warn",
|
|
206
|
+
event: "receipt_unwritten",
|
|
207
|
+
flush: "sync",
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return id;
|
|
211
|
+
}
|
|
212
|
+
return null;
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* On a session-lane turn whose inbox the session lane named, messages in it
|
|
218
|
+
* reach the session after each tool call. Registered nowhere else.
|
|
219
|
+
*/
|
|
220
|
+
export function registerSessionInbox(pi, env = process.env, fs = nodeInboxFs) {
|
|
221
|
+
if (!isSessionLaneTurn(env))
|
|
222
|
+
return false;
|
|
223
|
+
const dir = env[SESSION_INBOX_DIR_ENV]?.trim();
|
|
224
|
+
if (!dir)
|
|
225
|
+
return false;
|
|
226
|
+
const inbox = createSessionInbox(dir, (text) => {
|
|
227
|
+
// Typed `void`: pi 0.84.1's binding catches a failed send itself (an
|
|
228
|
+
// extension error, `send_user_message`). A promise from a later pi is
|
|
229
|
+
// caught here, never an unhandled rejection. A send that failed writes
|
|
230
|
+
// no receipt, so the message reaches the next turn.
|
|
231
|
+
const sent = pi.sendUserMessage(text, { deliverAs: "steer" });
|
|
232
|
+
if (sent instanceof Promise)
|
|
233
|
+
sent.catch(() => undefined);
|
|
234
|
+
}, fs);
|
|
235
|
+
pi.on("tool_execution_end", (_event, ctx) => {
|
|
236
|
+
try {
|
|
237
|
+
const idle = typeof ctx?.isIdle === "function" ? ctx.isIdle() : false;
|
|
238
|
+
inbox.check(idle);
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
// Never the turn's failure.
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
pi.on("message_end", (event) => {
|
|
245
|
+
try {
|
|
246
|
+
inbox.delivered(event.message);
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
// Never the turn's failure.
|
|
250
|
+
}
|
|
251
|
+
return undefined;
|
|
252
|
+
});
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=sessionInbox.js.map
|
|
@@ -193,6 +193,18 @@ export interface SessionTurnOutcome {
|
|
|
193
193
|
export declare const HEARTBEAT_EVERY_MS = 30000;
|
|
194
194
|
/** The child's env: the folder its turn's inputs are in, which the compaction pins read (`compactionPins.ts`). */
|
|
195
195
|
export declare const SESSION_INPUT_DIR_ENV = "YAGNI_SESSION_INPUT_DIR";
|
|
196
|
+
/**
|
|
197
|
+
* The child's env: this execution's inbox, where the host writes what a
|
|
198
|
+
* person sends the yak while the turn runs (YAG-1210, `sessionInbox.ts`).
|
|
199
|
+
*/
|
|
200
|
+
export declare const SESSION_INBOX_DIR_ENV = "YAGNI_SESSION_INBOX_DIR";
|
|
201
|
+
/**
|
|
202
|
+
* The execution's inbox under the turn's input folder, as the host writes
|
|
203
|
+
* it (`yaks/inbox.ts` in the backend); null for an execution id that is not
|
|
204
|
+
* one, which names no folder. Keyed by the execution, so a message written
|
|
205
|
+
* after its session ended is never read by the next one.
|
|
206
|
+
*/
|
|
207
|
+
export declare function sessionInboxDir(inputDir: string, executionId: string): string | null;
|
|
196
208
|
/** What a turn's heartbeat carries, kept up to date from the child's events. */
|
|
197
209
|
export interface TurnPulse {
|
|
198
210
|
/** Tokens the turn's model calls used so far: input, output and cache together. */
|
|
@@ -375,6 +375,21 @@ export function turnStop(run, writes, aborted) {
|
|
|
375
375
|
export const HEARTBEAT_EVERY_MS = 30_000;
|
|
376
376
|
/** The child's env: the folder its turn's inputs are in, which the compaction pins read (`compactionPins.ts`). */
|
|
377
377
|
export const SESSION_INPUT_DIR_ENV = "YAGNI_SESSION_INPUT_DIR";
|
|
378
|
+
/**
|
|
379
|
+
* The child's env: this execution's inbox, where the host writes what a
|
|
380
|
+
* person sends the yak while the turn runs (YAG-1210, `sessionInbox.ts`).
|
|
381
|
+
*/
|
|
382
|
+
export const SESSION_INBOX_DIR_ENV = "YAGNI_SESSION_INBOX_DIR";
|
|
383
|
+
const EXECUTION_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
384
|
+
/**
|
|
385
|
+
* The execution's inbox under the turn's input folder, as the host writes
|
|
386
|
+
* it (`yaks/inbox.ts` in the backend); null for an execution id that is not
|
|
387
|
+
* one, which names no folder. Keyed by the execution, so a message written
|
|
388
|
+
* after its session ended is never read by the next one.
|
|
389
|
+
*/
|
|
390
|
+
export function sessionInboxDir(inputDir, executionId) {
|
|
391
|
+
return EXECUTION_ID.test(executionId) ? join(inputDir, "inbox", executionId) : null;
|
|
392
|
+
}
|
|
378
393
|
/** One child event folded into the pulse: its spend, its tool, its time. */
|
|
379
394
|
export function notePulse(pulse, event, at) {
|
|
380
395
|
pulse.lastEventAt = at;
|
|
@@ -479,10 +494,17 @@ async function runTurn(input, deps, pulse) {
|
|
|
479
494
|
...(timeBudgetMs !== undefined ? { timeBudgetMs } : {}),
|
|
480
495
|
};
|
|
481
496
|
let decisionsRecorded = 0;
|
|
497
|
+
const inboxDir = sessionInboxDir(input.inputDir, input.identity.executionId);
|
|
482
498
|
const runDeps = {
|
|
483
499
|
cwd: input.cwd,
|
|
484
|
-
// The input folder, for the turn's own compaction to pin its facts from
|
|
485
|
-
|
|
500
|
+
// The input folder, for the turn's own compaction to pin its facts from
|
|
501
|
+
// (YAG-1163), and the execution's inbox, for what a person sends the
|
|
502
|
+
// running turn (YAG-1210).
|
|
503
|
+
env: {
|
|
504
|
+
...input.childEnv,
|
|
505
|
+
[SESSION_INPUT_DIR_ENV]: input.inputDir,
|
|
506
|
+
...(inboxDir ? { [SESSION_INBOX_DIR_ENV]: inboxDir } : {}),
|
|
507
|
+
},
|
|
486
508
|
sessionFile: paths.sessionFile,
|
|
487
509
|
callerLabel: SESSION_CALLER_LABEL,
|
|
488
510
|
...(input.runId ? { attribution: { runId: input.runId } } : {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "1.2.14-staging.
|
|
3
|
+
"version": "1.2.14-staging.2281.1",
|
|
4
4
|
"description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"turndown": "^7.2.4",
|
|
59
59
|
"typebox": "^1.3.15"
|
|
60
60
|
},
|
|
61
|
-
"yagniSourceSha": "
|
|
61
|
+
"yagniSourceSha": "63e73bd85004c339d647aa5ce5f79c71527a9e89"
|
|
62
62
|
}
|