@ouro.bot/cli 0.1.0-alpha.674 → 0.1.0-alpha.675

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.
Files changed (63) hide show
  1. package/README.md +11 -5
  2. package/changelog.json +13 -0
  3. package/dist/arc/evolution.js +13 -10
  4. package/dist/arc/obligations.js +1 -1
  5. package/dist/heart/active-work.js +3 -3
  6. package/dist/heart/agent-entry.js +8 -8
  7. package/dist/heart/commitments.js +1 -1
  8. package/dist/heart/core.js +45 -23
  9. package/dist/heart/daemon/agent-config-check.js +24 -0
  10. package/dist/heart/daemon/agent-discovery.js +28 -17
  11. package/dist/heart/daemon/agent-service.js +6 -6
  12. package/dist/heart/daemon/await-private-wake.js +59 -0
  13. package/dist/heart/daemon/cli-exec.js +180 -24
  14. package/dist/heart/daemon/cli-help.js +20 -2
  15. package/dist/heart/daemon/cli-parse.js +45 -2
  16. package/dist/heart/daemon/cli-render.js +1 -0
  17. package/dist/heart/daemon/daemon-entry.js +122 -25
  18. package/dist/heart/daemon/daemon.js +223 -20
  19. package/dist/heart/daemon/habit-private-wake.js +56 -0
  20. package/dist/heart/daemon/inner-status.js +3 -3
  21. package/dist/heart/daemon/message-router.js +39 -3
  22. package/dist/heart/daemon/pulse.js +43 -7
  23. package/dist/heart/daemon/socket-client.js +14 -2
  24. package/dist/heart/daemon/startup-tui.js +9 -1
  25. package/dist/heart/daemon/thoughts.js +39 -39
  26. package/dist/heart/habits/habit-scheduler.js +24 -4
  27. package/dist/heart/mailbox/mailbox-view.js +1 -1
  28. package/dist/heart/mailbox/readers/agent-machine.js +7 -7
  29. package/dist/heart/primitives.js +1 -1
  30. package/dist/heart/private-runtime/decision-renderer.js +156 -0
  31. package/dist/heart/private-runtime/index.js +18 -0
  32. package/dist/heart/private-runtime/ledger.js +218 -0
  33. package/dist/heart/private-runtime/policy.js +205 -0
  34. package/dist/heart/private-runtime/types.js +2 -0
  35. package/dist/heart/progress-story.js +1 -1
  36. package/dist/heart/session-transcript.js +1 -1
  37. package/dist/heart/tool-activity-callbacks.js +1 -1
  38. package/dist/heart/tool-description.js +2 -2
  39. package/dist/heart/tool-loop.js +2 -2
  40. package/dist/heart/turn-context.js +5 -5
  41. package/dist/mailbox-ui/assets/index-J8zDwHmE.js +1 -0
  42. package/dist/mailbox-ui/index.html +1 -1
  43. package/dist/mailroom/attention.js +1 -1
  44. package/dist/mind/context.js +2 -2
  45. package/dist/mind/pending.js +12 -5
  46. package/dist/mind/prompt.js +32 -25
  47. package/dist/repertoire/coding/feedback.js +25 -4
  48. package/dist/repertoire/tools-awaiting.js +2 -2
  49. package/dist/repertoire/tools-flow.js +4 -4
  50. package/dist/repertoire/tools-record.js +1 -1
  51. package/dist/repertoire/tools-session.js +33 -67
  52. package/dist/repertoire/tools-surface.js +3 -3
  53. package/dist/senses/cli.js +2 -2
  54. package/dist/senses/inner-dialog-worker.js +13 -519
  55. package/dist/senses/inner-dialog.js +10 -961
  56. package/dist/senses/mail.js +21 -5
  57. package/dist/senses/pipeline.js +1 -1
  58. package/dist/senses/private-runtime-worker.js +578 -0
  59. package/dist/senses/private-runtime.js +1145 -0
  60. package/dist/senses/shared-turn.js +1 -1
  61. package/dist/senses/trust-gate.js +2 -2
  62. package/package.json +1 -1
  63. package/dist/mailbox-ui/assets/index-CaTIFDmv.js +0 -1
@@ -10,965 +10,14 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
10
10
  if (k2 === undefined) k2 = k;
11
11
  o[k2] = m[k];
12
12
  }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
35
16
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.loadInnerDialogInstincts = loadInnerDialogInstincts;
37
- exports.buildInnerDialogBootstrapMessage = buildInnerDialogBootstrapMessage;
38
- exports.buildNonCanonicalCleanupNudge = buildNonCanonicalCleanupNudge;
39
- exports.buildInstinctUserMessage = buildInstinctUserMessage;
40
- exports.readTaskFile = readTaskFile;
41
- exports.buildTaskTriggeredMessage = buildTaskTriggeredMessage;
42
- exports.deriveResumeCheckpoint = deriveResumeCheckpoint;
43
- exports.innerDialogSessionPath = innerDialogSessionPath;
44
- exports.enrichDelegatedFromWithBridge = enrichDelegatedFromWithBridge;
45
- exports.routeDelegatedCompletion = routeDelegatedCompletion;
46
- exports.buildParseErrorNudge = buildParseErrorNudge;
47
- exports.buildHeldReturnWakeMessage = buildHeldReturnWakeMessage;
48
- exports.runInnerDialogTurn = runInnerDialogTurn;
49
- const fs = __importStar(require("fs"));
50
- const path = __importStar(require("path"));
51
- const config_1 = require("../heart/config");
52
- const core_1 = require("../heart/core");
53
- const identity_1 = require("../heart/identity");
54
- const context_1 = require("../mind/context");
55
- const prompt_1 = require("../mind/prompt");
56
- const mcp_manager_1 = require("../repertoire/mcp-manager");
57
- const tools_1 = require("../repertoire/tools");
58
- const bundle_manifest_1 = require("../mind/bundle-manifest");
59
- const pending_1 = require("../mind/pending");
60
- const obligations_1 = require("../arc/obligations");
61
- const attention_queue_1 = require("./attention-queue");
62
- const packets_1 = require("../arc/packets");
63
- const friends_1 = require("@ouro.bot/friends");
64
- const trust_gate_1 = require("./trust-gate");
65
- const pipeline_1 = require("./pipeline");
66
- const nerves_1 = require("../nerves");
67
- const runtime_1 = require("../nerves/runtime");
68
- const manager_1 = require("../heart/bridges/manager");
69
- const session_activity_1 = require("../heart/session-activity");
70
- const bluebubbles_1 = require("./bluebubbles");
71
- const habit_turn_message_1 = require("./habit-turn-message");
72
- const await_turn_message_1 = require("./await-turn-message");
73
- const await_parser_1 = require("../heart/awaiting/await-parser");
74
- const await_runtime_state_1 = require("../heart/awaiting/await-runtime-state");
75
- const habit_parser_1 = require("../heart/habits/habit-parser");
76
- const habit_runtime_state_1 = require("../heart/habits/habit-runtime-state");
77
- const cadence_1 = require("../heart/daemon/cadence");
78
- const daemon_health_1 = require("../heart/daemon/daemon-health");
79
- const flight_recorder_1 = require("../arc/flight-recorder");
80
- const desk_section_1 = require("../mind/desk-section");
81
- const DEFAULT_INNER_DIALOG_INSTINCTS = [
82
- {
83
- id: "heartbeat_checkin",
84
- prompt: "...time passing. anything stirring?",
85
- enabled: true,
86
- },
87
- ];
88
- function readAspirations(agentRoot) {
89
- try {
90
- return fs.readFileSync(path.join(agentRoot, "psyche", "ASPIRATIONS.md"), "utf8").trim();
91
- }
92
- catch {
93
- return "";
94
- }
95
- }
96
- function loadInnerDialogInstincts() {
97
- return [...DEFAULT_INNER_DIALOG_INSTINCTS];
98
- }
99
- function buildInnerDialogBootstrapMessage(aspirations, stateSummary) {
100
- const lines = ["waking up."];
101
- if (aspirations) {
102
- lines.push("", "## what matters to me", aspirations);
103
- }
104
- if (stateSummary) {
105
- lines.push("", "## what i know so far", stateSummary);
106
- }
107
- lines.push("", "what needs my attention?");
108
- return lines.join("\n");
109
- }
110
- function buildNonCanonicalCleanupNudge(nonCanonicalPaths) {
111
- if (nonCanonicalPaths.length === 0)
112
- return "";
113
- const listed = nonCanonicalPaths.slice(0, 20).map((entry) => `- ${entry}`);
114
- if (nonCanonicalPaths.length > 20) {
115
- listed.push(`- ... (${nonCanonicalPaths.length - 20} more)`);
116
- }
117
- return [
118
- "## canonical cleanup nudge",
119
- "I found non-canonical files in my bundle. I should distill anything valuable into my diary and remove these files.",
120
- ...listed,
121
- ].join("\n");
122
- }
123
- function displayCheckpoint(checkpoint) {
124
- const trimmed = checkpoint?.trim();
125
- if (!trimmed || trimmed === "no prior checkpoint recorded") {
126
- return undefined;
127
- }
128
- return trimmed;
129
- }
130
- function buildInstinctUserMessage(instincts, _reason, state) {
131
- const active = instincts.find((instinct) => instinct.enabled !== false) ?? DEFAULT_INNER_DIALOG_INSTINCTS[0];
132
- const checkpoint = displayCheckpoint(state.checkpoint);
133
- const lines = [active.prompt];
134
- if (checkpoint) {
135
- lines.push(`\nlast checkpoint: ${checkpoint}`);
136
- }
137
- return lines.join("\n");
138
- }
139
- function readTaskFile(agentRoot, taskId) {
140
- // Task files live in collection subdirectories (one-shots, ongoing).
141
- // Try each collection, then fall back to root tasks/ for legacy layout.
142
- // Habits are no longer in tasks/ — they live at bundle root habits/.
143
- const collections = ["one-shots", "ongoing", ""];
144
- for (const collection of collections) {
145
- try {
146
- return fs.readFileSync(path.join(agentRoot, "tasks", collection, `${taskId}.md`), "utf8").trim();
147
- }
148
- catch {
149
- // not in this collection — try next
150
- }
151
- }
152
- return "";
153
- }
154
- function buildTaskTriggeredMessage(taskId, taskContent, checkpoint) {
155
- const lines = ["a task needs my attention."];
156
- if (taskContent) {
157
- lines.push("", `## task: ${taskId}`, taskContent);
158
- }
159
- else {
160
- lines.push("", `## task: ${taskId}`, "(task file not found)");
161
- }
162
- const renderedCheckpoint = displayCheckpoint(checkpoint);
163
- if (renderedCheckpoint) {
164
- lines.push("", `last checkpoint: ${renderedCheckpoint}`);
165
- }
166
- return lines.join("\n");
167
- }
168
- function contentToText(content) {
169
- if (typeof content === "string")
170
- return content.trim();
171
- if (!Array.isArray(content))
172
- return "";
173
- const text = content
174
- .map((part) => {
175
- if (typeof part === "string")
176
- return part;
177
- if (!part || typeof part !== "object")
178
- return "";
179
- if ("text" in part && typeof part.text === "string") {
180
- return part.text;
181
- }
182
- return "";
183
- })
184
- .join("\n");
185
- return text.trim();
186
- }
187
- function checkpointTextFromAssistantContent(content) {
188
- const assistantText = contentToText(content);
189
- if (!assistantText)
190
- return null;
191
- const cleanedLines = assistantText
192
- .split("\n")
193
- .map((line) => line.replace(/<\/?think>/gi, "").trim())
194
- .filter((line) => line.length > 0);
195
- const explicitCheckpoint = cleanedLines
196
- .find((line) => /^checkpoint\s*:/i.test(line));
197
- if (explicitCheckpoint) {
198
- const parsed = explicitCheckpoint.replace(/^checkpoint\s*:\s*/i, "").trim();
199
- return parsed || null;
200
- }
201
- const firstLine = cleanedLines[0];
202
- return firstLine ?? null;
203
- }
204
- function truncateCheckpointText(text) {
205
- if (text.length <= 220)
206
- return text;
207
- return `${text.slice(0, 217)}...`;
208
- }
209
- function parseToolArguments(argumentsValue) {
210
- if (!argumentsValue)
211
- return {};
212
- try {
213
- const parsed = JSON.parse(argumentsValue);
214
- return parsed && typeof parsed === "object" && !Array.isArray(parsed)
215
- ? parsed
216
- : {};
217
- }
218
- catch {
219
- return {};
220
- }
221
- }
222
- function toolArgumentText(args, keys) {
223
- for (const key of keys) {
224
- const value = args[key];
225
- if (typeof value === "string" && value.trim()) {
226
- return value.trim();
227
- }
228
- }
229
- return "";
230
- }
231
- function summarizeToolAction(name, argumentsValue) {
232
- if (!name)
233
- return null;
234
- const args = parseToolArguments(argumentsValue);
235
- if (name === "surface") {
236
- const message = toolArgumentText(args, ["message", "text", "content"]);
237
- return message ? `surfaced: ${message}` : null;
238
- }
239
- if (name === "ponder") {
240
- const thought = toolArgumentText(args, ["summary", "question", "topic", "prompt"]);
241
- return thought ? `pondered: ${thought}` : null;
242
- }
243
- if (name === "diary_write") {
244
- const note = toolArgumentText(args, ["text", "content", "note", "entry"]);
245
- return note ? `diary: ${note}` : null;
246
- }
247
- if (name === "let_go") {
248
- const reason = toolArgumentText(args, ["reason", "note", "status"]);
249
- return reason ? `let go: ${reason}` : null;
250
- }
251
- if (name === "rest") {
252
- const note = toolArgumentText(args, ["note", "status"]);
253
- return note ? `rested: ${note}` : null;
254
- }
255
- return null;
256
- }
257
- function extractToolFunction(toolCall) {
258
- if (!toolCall || typeof toolCall !== "object" || !("function" in toolCall))
259
- return null;
260
- const maybeFunction = toolCall.function;
261
- if (!maybeFunction || typeof maybeFunction !== "object")
262
- return null;
263
- const name = "name" in maybeFunction && typeof maybeFunction.name === "string"
264
- ? maybeFunction.name
265
- : undefined;
266
- const argumentsValue = "arguments" in maybeFunction && typeof maybeFunction.arguments === "string"
267
- ? maybeFunction.arguments
268
- : undefined;
269
- return { name, arguments: argumentsValue };
270
- }
271
- function checkpointTextFromAssistantToolCalls(message) {
272
- if (message.role !== "assistant" || !Array.isArray(message.tool_calls))
273
- return null;
274
- for (let i = message.tool_calls.length - 1; i >= 0; i--) {
275
- const toolFunction = extractToolFunction(message.tool_calls[i]);
276
- const summary = summarizeToolAction(toolFunction?.name, toolFunction?.arguments);
277
- if (summary)
278
- return summary;
279
- }
280
- return null;
281
- }
282
- function latestRestStatus(messages) {
283
- for (let i = messages.length - 1; i >= 0; i--) {
284
- const message = messages[i];
285
- if (message.role !== "assistant" || !Array.isArray(message.tool_calls))
286
- continue;
287
- for (let j = message.tool_calls.length - 1; j >= 0; j--) {
288
- const toolFunction = extractToolFunction(message.tool_calls[j]);
289
- if (toolFunction?.name !== "rest")
290
- continue;
291
- const status = parseToolArguments(toolFunction.arguments).status;
292
- return typeof status === "string" && status.trim() ? status.trim() : undefined;
293
- }
294
- }
295
- return undefined;
296
- }
297
- function deriveResumeCheckpoint(messages) {
298
- for (let i = messages.length - 1; i >= 0; i--) {
299
- const message = messages[i];
300
- if (message.role !== "assistant")
301
- continue;
302
- const textCheckpoint = checkpointTextFromAssistantContent(message.content);
303
- if (textCheckpoint)
304
- return truncateCheckpointText(textCheckpoint);
305
- const toolCheckpoint = checkpointTextFromAssistantToolCalls(message);
306
- if (toolCheckpoint)
307
- return truncateCheckpointText(toolCheckpoint);
308
- }
309
- return "no prior checkpoint recorded";
310
- }
311
- function extractAssistantPreview(messages, maxLength = 120) {
312
- const lastAssistant = [...messages].reverse().find((m) => m.role === "assistant");
313
- if (!lastAssistant)
314
- return "";
315
- const text = contentToText(lastAssistant.content);
316
- if (!text)
317
- return "";
318
- /* v8 ignore next -- unreachable: contentToText().trim() guarantees a non-empty line @preserve */
319
- const firstLine = text.split("\n").find((line) => line.trim().length > 0) ?? "";
320
- if (firstLine.length <= maxLength)
321
- return firstLine;
322
- return `${firstLine.slice(0, maxLength - 3)}...`;
323
- }
324
- function extractToolCallNames(messages) {
325
- const names = [];
326
- for (const msg of messages) {
327
- if (msg.role === "assistant" && "tool_calls" in msg && Array.isArray(msg.tool_calls)) {
328
- for (const tc of msg.tool_calls) {
329
- if ("function" in tc && tc.function?.name)
330
- names.push(tc.function.name);
331
- }
332
- }
333
- }
334
- return [...new Set(names)];
335
- }
336
- function createInnerDialogCallbacks() {
337
- return {
338
- onModelStart: () => { },
339
- onModelStreamStart: () => { },
340
- onTextChunk: () => { },
341
- onReasoningChunk: () => { },
342
- onToolStart: () => { },
343
- onToolEnd: () => { },
344
- onError: () => { },
345
- };
346
- }
347
- function innerDialogSessionPath() {
348
- return (0, config_1.sessionPath)(pending_1.INNER_DIALOG_PENDING.friendId, pending_1.INNER_DIALOG_PENDING.channel, pending_1.INNER_DIALOG_PENDING.key);
349
- }
350
- function innerDialogRuntimeStatePath(sessionFilePath) {
351
- return path.join(path.dirname(sessionFilePath), "runtime.json");
352
- }
353
- function writeInnerDialogRuntimeState(sessionFilePath, state) {
354
- const filePath = innerDialogRuntimeStatePath(sessionFilePath);
355
- try {
356
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
357
- fs.writeFileSync(filePath, JSON.stringify(state, null, 2) + "\n", "utf8");
358
- }
359
- catch (error) {
360
- (0, runtime_1.emitNervesEvent)({
361
- level: "warn",
362
- component: "senses",
363
- event: "senses.inner_dialog_runtime_state_error",
364
- message: "failed to write inner dialog runtime state",
365
- meta: {
366
- status: state.status,
367
- reason: state.reason ?? null,
368
- path: filePath,
369
- /* v8 ignore next -- Node fs APIs throw Error objects for mkdirSync/writeFileSync failures @preserve */
370
- error: error instanceof Error ? error.message : String(error),
371
- },
372
- });
373
- }
374
- }
375
- /* v8 ignore start -- routing helpers: called from routing functions which are integration paths @preserve */
376
- function writePendingEnvelope(pendingDir, message) {
377
- fs.mkdirSync(pendingDir, { recursive: true });
378
- const fileName = `${message.timestamp}-${Math.random().toString(36).slice(2, 10)}.json`;
379
- const filePath = path.join(pendingDir, fileName);
380
- fs.writeFileSync(filePath, JSON.stringify(message, null, 2), "utf8");
381
- }
382
- function sessionMatchesActivity(activity, session) {
383
- return activity.friendId === session.friendId
384
- && activity.channel === session.channel
385
- && activity.key === session.key;
386
- }
387
- /* v8 ignore stop */
388
- /* v8 ignore start -- routing: delivery now inline via surface tool; routing functions preserved for reuse @preserve */
389
- function resolveBridgePreferredSession(delegatedFrom, sessionActivity) {
390
- if (!delegatedFrom.bridgeId)
391
- return null;
392
- const bridge = (0, manager_1.createBridgeManager)().getBridge(delegatedFrom.bridgeId);
393
- if (!bridge || bridge.lifecycle === "completed" || bridge.lifecycle === "cancelled") {
394
- return null;
395
- }
396
- return sessionActivity.find((activity) => activity.friendId === delegatedFrom.friendId
397
- && activity.channel !== "inner"
398
- && bridge.attachedSessions.some((session) => sessionMatchesActivity(activity, session))) ?? null;
399
- }
400
- async function tryDeliverDelegatedCompletion(target, outboundEnvelope) {
401
- if (target.channel !== "bluebubbles") {
402
- return false;
403
- }
404
- const result = await (0, bluebubbles_1.sendProactiveBlueBubblesMessageToSession)({
405
- friendId: target.friendId,
406
- sessionKey: target.key,
407
- text: outboundEnvelope.content,
408
- intent: "explicit_cross_chat",
409
- });
410
- return result.delivered;
411
- }
412
- function enrichDelegatedFromWithBridge(delegatedFrom) {
413
- if (delegatedFrom.bridgeId) {
414
- return delegatedFrom;
415
- }
416
- const bridgeManager = (0, manager_1.createBridgeManager)();
417
- const originBridges = bridgeManager.findBridgesForSession({
418
- friendId: delegatedFrom.friendId,
419
- channel: delegatedFrom.channel,
420
- key: delegatedFrom.key,
421
- });
422
- const activeBridge = originBridges.find((b) => b.lifecycle === "active");
423
- if (activeBridge) {
424
- return { ...delegatedFrom, bridgeId: activeBridge.id };
425
- }
426
- return delegatedFrom;
427
- }
428
- function advanceObligationQuietly(agentName, obligationId, update) {
429
- if (!obligationId)
430
- return;
431
- try {
432
- (0, obligations_1.advanceReturnObligation)(agentName, obligationId, update);
433
- /* v8 ignore start -- best-effort: obligation fs errors must never block return routing @preserve */
434
- }
435
- catch {
436
- // swallowed
437
- }
438
- /* v8 ignore stop */
439
- }
440
- async function routeDelegatedCompletion(agentRoot, agentName, completion, drainedPending, timestamp) {
441
- const delegated = (drainedPending ?? []).find((message) => message.delegatedFrom);
442
- if (!delegated?.delegatedFrom || !completion?.answer?.trim()) {
443
- return;
444
- }
445
- const delegatedFrom = enrichDelegatedFromWithBridge(delegated.delegatedFrom);
446
- const obligationId = delegated.obligationId;
447
- // Advance any inner return obligations from queued -> running (they were drained this turn).
448
- // drainedPending is guaranteed non-null here (we found delegated above).
449
- for (const msg of drainedPending) {
450
- if (msg.obligationId) {
451
- advanceObligationQuietly(agentName, msg.obligationId, {
452
- status: "running",
453
- startedAt: timestamp,
454
- });
455
- }
456
- }
457
- if (delegated.obligationStatus === "pending") {
458
- // Fulfill the persistent obligation in the store
459
- try {
460
- const pending = (0, obligations_1.findPendingObligationForOrigin)(agentRoot, {
461
- friendId: delegatedFrom.friendId,
462
- channel: delegatedFrom.channel,
463
- key: delegatedFrom.key,
464
- });
465
- /* v8 ignore next 2 -- obligation fulfillment tested via obligations.test.ts; integration requires real disk state @preserve */
466
- if (pending) {
467
- (0, obligations_1.fulfillObligation)(agentRoot, pending.id);
468
- }
469
- }
470
- catch {
471
- /* v8 ignore next -- defensive: obligation store read failure should not break delivery @preserve */
472
- }
473
- (0, runtime_1.emitNervesEvent)({
474
- event: "senses.obligation_fulfilled",
475
- component: "senses",
476
- message: "obligation fulfilled via delegated completion",
477
- meta: {
478
- friendId: delegatedFrom.friendId,
479
- channel: delegatedFrom.channel,
480
- key: delegatedFrom.key,
481
- },
482
- });
483
- }
484
- const outboundEnvelope = {
485
- from: agentName,
486
- friendId: delegatedFrom.friendId,
487
- channel: delegatedFrom.channel,
488
- key: delegatedFrom.key,
489
- content: completion.answer.trim(),
490
- timestamp,
491
- delegatedFrom,
492
- ...(obligationId ? { obligationId } : {}),
493
- };
494
- const sessionActivity = (0, session_activity_1.listSessionActivity)({
495
- sessionsDir: path.join(agentRoot, "state", "sessions"),
496
- friendsDir: path.join(agentRoot, "friends"),
497
- agentName,
498
- });
499
- // Priority 1: Bridge-preferred session (if delegation was within a bridge).
500
- const bridgeTarget = resolveBridgePreferredSession(delegatedFrom, sessionActivity);
501
- if (bridgeTarget) {
502
- if (await tryDeliverDelegatedCompletion(bridgeTarget, outboundEnvelope)) {
503
- advanceObligationQuietly(agentName, obligationId, { status: "returned", returnedAt: timestamp, returnTarget: "bridge-session" });
504
- return;
505
- }
506
- writePendingEnvelope((0, pending_1.getPendingDir)(agentName, bridgeTarget.friendId, bridgeTarget.channel, bridgeTarget.key), outboundEnvelope);
507
- advanceObligationQuietly(agentName, obligationId, { status: "returned", returnedAt: timestamp, returnTarget: "bridge-session" });
508
- return;
509
- }
510
- // Priority 1.5: Direct return to originating session (ponder without bridge).
511
- // When delegatedFrom has specific channel+key, route directly there instead of searching for freshest.
512
- if (delegatedFrom.channel && delegatedFrom.key && delegatedFrom.channel !== "inner") {
513
- const directTarget = sessionActivity.find((a) => a.friendId === delegatedFrom.friendId && a.channel === delegatedFrom.channel && a.key === delegatedFrom.key);
514
- if (directTarget) {
515
- if (await tryDeliverDelegatedCompletion(directTarget, outboundEnvelope)) {
516
- advanceObligationQuietly(agentName, obligationId, { status: "returned", returnedAt: timestamp, returnTarget: "direct-originator" });
517
- return;
518
- }
519
- }
520
- // Even if session isn't in activity list (might have ended), queue to its pending dir
521
- writePendingEnvelope((0, pending_1.getPendingDir)(agentName, delegatedFrom.friendId, delegatedFrom.channel, delegatedFrom.key), outboundEnvelope);
522
- advanceObligationQuietly(agentName, obligationId, { status: "returned", returnedAt: timestamp, returnTarget: "direct-originator" });
523
- return;
524
- }
525
- // Priority 2: Freshest active friend session.
526
- // For BB, prefer DM sessions (;-;) over group chats (;+;) — proactive outreach should never land in groups.
527
- const allFriendSessions = (0, session_activity_1.listSessionActivity)({
528
- sessionsDir: path.join(agentRoot, "state", "sessions"),
529
- friendsDir: path.join(agentRoot, "friends"),
530
- agentName,
531
- }).filter((s) => s.friendId === delegatedFrom.friendId && s.channel !== "inner");
532
- const bbDm = allFriendSessions.find((s) => s.channel === "bluebubbles" && s.key.includes(";-;"));
533
- const freshest = bbDm ?? allFriendSessions.find((s) => s.channel !== "bluebubbles" || s.key.includes(";-;")) ?? allFriendSessions[0];
534
- if (freshest) {
535
- if (await tryDeliverDelegatedCompletion(freshest, outboundEnvelope)) {
536
- advanceObligationQuietly(agentName, obligationId, { status: "returned", returnedAt: timestamp, returnTarget: "freshest-session" });
537
- return;
538
- }
539
- writePendingEnvelope((0, pending_1.getPendingDir)(agentName, freshest.friendId, freshest.channel, freshest.key), outboundEnvelope);
540
- advanceObligationQuietly(agentName, obligationId, { status: "returned", returnedAt: timestamp, returnTarget: "freshest-session" });
541
- return;
542
- }
543
- // Priority 3: Deferred return queue.
544
- writePendingEnvelope((0, pending_1.getDeferredReturnDir)(agentName, delegatedFrom.friendId), outboundEnvelope);
545
- advanceObligationQuietly(agentName, obligationId, { status: "deferred", returnedAt: timestamp, returnTarget: "deferred" });
546
- }
547
- /* v8 ignore stop */
548
- // Self-referencing friend record for inner dialog (agent talking to itself).
549
- // No real friend to resolve -- this satisfies the pipeline's friend resolver contract.
550
- function createSelfFriend(agentName) {
551
- return {
552
- id: "self",
553
- name: agentName,
554
- trustLevel: "family",
555
- externalIds: [],
556
- tenantMemberships: [],
557
- toolPreferences: {},
558
- notes: {},
559
- totalTokens: 0,
560
- createdAt: new Date().toISOString(),
561
- updatedAt: new Date().toISOString(),
562
- schemaVersion: 1,
563
- };
564
- }
565
- // No-op friend store for inner dialog. Inner dialog doesn't track token usage per-friend.
566
- function createNoOpFriendStore() {
567
- return {
568
- get: async () => null,
569
- put: async () => { },
570
- delete: async () => { },
571
- findByExternalId: async () => null,
572
- };
573
- }
574
- function buildParseErrorNudge(parseErrors) {
575
- if (parseErrors.length === 0)
576
- return "";
577
- const lines = parseErrors.map((e) => `I noticed my habit file \`${e.file}\` has invalid frontmatter — I should fix it. (${e.error})`);
578
- return lines.join("\n");
579
- }
580
- function buildHeldReturnWakeMessage() {
581
- return [
582
- "held return work arrived; use the current held-work frame above as the authority for this turn.",
583
- "Older checkpoints, rest summaries, transcript memories, completed returns, and repeated probes are historical context, not evidence about what is waiting now.",
584
- "Return only the requested result; do not add commentary about prior attempts, old loops, or completed probes.",
585
- "Return each listed item with surface(delegationId=...) before resting or settling.",
586
- ].join("\n");
587
- }
588
- function buildAlsoDueLine(agentRoot, currentHabitName, now) {
589
- const habitsDir = path.join(agentRoot, "habits");
590
- let files;
591
- try {
592
- files = fs.readdirSync(habitsDir);
593
- }
594
- catch {
595
- return "";
596
- }
597
- const nowMs = now().getTime();
598
- const alsoDue = [];
599
- for (const file of files) {
600
- if (!file.endsWith(".md"))
601
- continue;
602
- const stem = file.replace(/\.md$/, "");
603
- if (stem === currentHabitName)
604
- continue;
605
- try {
606
- const content = fs.readFileSync(path.join(habitsDir, file), "utf-8");
607
- const habit = (0, habit_runtime_state_1.applyHabitRuntimeState)(agentRoot, (0, habit_parser_1.parseHabitFile)(content, path.join(habitsDir, file)));
608
- if (habit.status !== "active" || !habit.cadence)
609
- continue;
610
- const cadenceMs = (0, cadence_1.parseCadenceToMs)(habit.cadence);
611
- if (cadenceMs === null)
612
- continue;
613
- if (habit.lastRun === null) {
614
- alsoDue.push(stem);
615
- continue;
616
- }
617
- const lastRunMs = new Date(habit.lastRun).getTime();
618
- if (nowMs - lastRunMs >= cadenceMs) {
619
- alsoDue.push(stem);
620
- }
621
- }
622
- catch {
623
- // skip unreadable habits
624
- }
625
- }
626
- if (alsoDue.length === 0)
627
- return "";
628
- return `also due: ${alsoDue.join(", ")}`;
629
- }
630
- function buildHabitSurfacePolicy(origin, surface) {
631
- const lines = ["## habit surface policy"];
632
- lines.push("this habit runs privately, but it may message outward when it needs input, has a useful answer, is blocked, or should report status.");
633
- if (surface.family)
634
- lines.push("- family recipients are allowed by default.");
635
- if (surface.originator && origin)
636
- lines.push(`- the originator is allowed: ${origin.friendId} via ${origin.channel}/${origin.key}.`);
637
- if (surface.originator && !origin)
638
- lines.push("- originator messaging is enabled, but this habit has no origin metadata.");
639
- if (surface.extra.length > 0)
640
- lines.push(`- extra allowed recipients: ${surface.extra.join(", ")}.`);
641
- lines.push("- use send_message for intentional contact; use surface only for a held return tied to an existing return obligation.");
642
- return lines.join("\n");
643
- }
644
- async function runInnerDialogTurn(options) {
645
- const now = options?.now ?? (() => new Date());
646
- const reason = options?.reason ?? "instinct";
647
- const sessionFilePath = options?.habitSession?.sessionPath ?? innerDialogSessionPath();
648
- const agentName = (0, identity_1.getAgentName)();
649
- writeInnerDialogRuntimeState(sessionFilePath, {
650
- status: "running",
651
- reason,
652
- startedAt: now().toISOString(),
653
- });
654
- try {
655
- const loaded = (0, context_1.loadSession)(sessionFilePath);
656
- const existingMessages = loaded?.messages ? [...loaded.messages] : [];
657
- const instincts = options?.instincts ?? loadInnerDialogInstincts();
658
- const state = {
659
- cycleCount: 1,
660
- resting: false,
661
- lastHeartbeatAt: now().toISOString(),
662
- };
663
- const pendingDir = options?.habitSession?.pendingDir ?? (0, pending_1.getInnerDialogPendingDir)(agentName);
664
- const shouldUseHeldReturnWake = !options?.taskId && reason !== "habit" && reason !== "await"
665
- ? (0, obligations_1.listActiveReturnObligations)(agentName).length > 0
666
- : false;
667
- // ── Adapter concern: build user message ──────────────────────────
668
- let userContent;
669
- let habitTools;
670
- let habitParsedSuccessfully = false;
671
- if (existingMessages.length === 0 && !(reason === "habit" && options?.habitName)) {
672
- // Fresh session: bootstrap message with non-canonical cleanup nudge
673
- const aspirations = readAspirations((0, identity_1.getAgentRoot)());
674
- const nonCanonical = (0, bundle_manifest_1.findNonCanonicalBundlePaths)((0, identity_1.getAgentRoot)());
675
- const cleanupNudge = buildNonCanonicalCleanupNudge(nonCanonical);
676
- userContent = [
677
- buildInnerDialogBootstrapMessage(aspirations, "No prior inner dialog session found."),
678
- cleanupNudge,
679
- ].filter(Boolean).join("\n\n");
680
- }
681
- else {
682
- // Resumed session: task-triggered or instinct message with checkpoint context
683
- const assistantTurns = existingMessages.filter((message) => message.role === "assistant").length;
684
- state.cycleCount = assistantTurns + 1;
685
- state.checkpoint = deriveResumeCheckpoint(existingMessages);
686
- if (options?.taskId) {
687
- const taskContent = readTaskFile((0, identity_1.getAgentRoot)(), options.taskId);
688
- userContent = buildTaskTriggeredMessage(options.taskId, taskContent, state.checkpoint);
689
- }
690
- else if (reason === "habit" && options?.habitName) {
691
- const agentRoot = (0, identity_1.getAgentRoot)();
692
- const habitName = options.habitName;
693
- const habitFilePath = path.join(agentRoot, "habits", `${habitName}.md`);
694
- const preparedHabit = options.preparedHabit?.habit.name === habitName ? options.preparedHabit.habit : null;
695
- // Read and parse the habit file
696
- let habitBody;
697
- let habitTitle = habitName;
698
- let habitLastRun = null;
699
- let habitOrigin = null;
700
- let habitSurface = { family: true, originator: true, extra: [] };
701
- if (preparedHabit) {
702
- habitBody = preparedHabit.body || undefined;
703
- habitTitle = preparedHabit.title || habitName;
704
- habitLastRun = preparedHabit.lastRun;
705
- habitTools = preparedHabit.tools;
706
- habitOrigin = preparedHabit.origin;
707
- habitSurface = preparedHabit.surface;
708
- }
709
- else {
710
- try {
711
- const habitContent = fs.readFileSync(habitFilePath, "utf-8");
712
- const parsed = (0, habit_runtime_state_1.applyHabitRuntimeState)(agentRoot, (0, habit_parser_1.parseHabitFile)(habitContent, habitFilePath));
713
- habitBody = parsed.body || undefined;
714
- habitTitle = parsed.title || habitName;
715
- habitLastRun = parsed.lastRun;
716
- habitTools = parsed.tools;
717
- habitOrigin = parsed.origin;
718
- habitSurface = parsed.surface;
719
- }
720
- catch {
721
- // Habit file missing or unreadable
722
- }
723
- }
724
- // If the habit file couldn't be read at all (no body, no title parsed), error message
725
- if (habitBody === undefined && habitTitle === habitName) {
726
- userContent = `habit "${habitName}" could not be read (file not found or unreadable). check habits/${habitName}.md exists.`;
727
- }
728
- else {
729
- habitParsedSuccessfully = true;
730
- // Unified path: gather context for ALL habits (heartbeat included)
731
- const obligations = (0, obligations_1.listActiveReturnObligations)(agentName);
732
- const nowMs = now().getTime();
733
- const staleObligations = obligations.map((o) => ({
734
- friendName: o.origin.friendId,
735
- content: o.delegatedContent,
736
- stalenessMs: nowMs - o.createdAt,
737
- }));
738
- const alsoDue = buildAlsoDueLine(agentRoot, habitName, now);
739
- const arcResume = (0, flight_recorder_1.formatFlightRecorderResume)((0, flight_recorder_1.readFlightRecorderResume)(agentRoot));
740
- const deskOrientation = (0, desk_section_1.deskRecordOrientationSection)(agentRoot, now());
741
- const surfacePolicy = buildHabitSurfacePolicy(habitOrigin, habitSurface);
742
- // Degraded state (best-effort: never crash)
743
- let degradedComponents = [];
744
- try {
745
- const health = (0, daemon_health_1.readHealth)((0, daemon_health_1.getDefaultHealthPath)());
746
- if (health && health.degraded.length > 0) {
747
- degradedComponents = health.degraded.map((d) => ({ component: d.component, reason: d.reason }));
748
- }
749
- }
750
- catch {
751
- // Best-effort: missing file or parse error -> empty array, no crash
752
- }
753
- userContent = (0, habit_turn_message_1.buildHabitTurnMessage)({
754
- habitName,
755
- habitTitle,
756
- habitBody,
757
- lastRun: habitLastRun,
758
- checkpoint: displayCheckpoint(state.checkpoint),
759
- alsoDue: alsoDue || undefined,
760
- staleObligations,
761
- parseErrors: options?.parseErrors ?? [],
762
- degradedComponents,
763
- arcResume,
764
- deskOrientation,
765
- surfacePolicy,
766
- priorSessionSummary: options.preparedHabit?.habit.name === habitName ? options.preparedHabit.priorSessionSummary : undefined,
767
- now,
768
- });
769
- }
770
- }
771
- else if (reason === "await" && options?.awaitName) {
772
- const agentRoot = (0, identity_1.getAgentRoot)();
773
- const awaitName = options.awaitName;
774
- const awaitFilePath = path.join(agentRoot, "awaiting", `${awaitName}.md`);
775
- let awaitBody;
776
- let condition = null;
777
- let lastCheckedAt = null;
778
- let lastObservation = null;
779
- let checkedCount = 0;
780
- let awaitFound = false;
781
- try {
782
- const awaitContent = fs.readFileSync(awaitFilePath, "utf-8");
783
- const parsed = (0, await_runtime_state_1.applyAwaitRuntimeState)(agentRoot, (0, await_parser_1.parseAwaitFile)(awaitContent, awaitFilePath));
784
- awaitFound = true;
785
- awaitBody = parsed.body || undefined;
786
- condition = parsed.condition;
787
- lastCheckedAt = parsed.last_checked ?? null;
788
- lastObservation = parsed.last_observation ?? null;
789
- checkedCount = parsed.checked_count ?? 0;
790
- }
791
- catch {
792
- // file missing — fall through to error message
793
- }
794
- if (!awaitFound || !condition) {
795
- userContent = `await "${awaitName}" could not be read (file not found or no condition). check awaiting/${awaitName}.md.`;
796
- }
797
- else {
798
- userContent = (0, await_turn_message_1.buildAwaitTurnMessage)({
799
- awaitName,
800
- condition,
801
- body: awaitBody,
802
- lastCheckedAt,
803
- lastObservation,
804
- checkedCount,
805
- checkpoint: displayCheckpoint(state.checkpoint),
806
- now,
807
- });
808
- }
809
- }
810
- else {
811
- userContent = buildInstinctUserMessage(instincts, reason, state);
812
- }
813
- }
814
- if (shouldUseHeldReturnWake) {
815
- userContent = buildHeldReturnWakeMessage();
816
- }
817
- const userMessage = { role: "user", content: userContent };
818
- // ── Session loader: wraps existing session logic ──────────────────
819
- const innerCapabilities = (0, friends_1.getChannelCapabilities)("inner");
820
- const selfFriend = createSelfFriend(agentName);
821
- const selfContext = { friend: selfFriend, channel: innerCapabilities };
822
- const mcpManager = await (0, mcp_manager_1.getSharedMcpManager)() ?? undefined;
823
- // ── Habit tool enforcement ───────────────────────────────────────
824
- let habitToolsResolved;
825
- if (habitTools !== undefined) {
826
- const fullTools = (0, tools_1.getToolsForChannel)(innerCapabilities);
827
- habitToolsResolved = fullTools.filter((t) => habitTools.includes(t.function.name));
828
- (0, runtime_1.emitNervesEvent)({
829
- event: "habit.tools_restricted",
830
- component: "senses",
831
- message: "habit running with restricted tools",
832
- meta: {
833
- habitName: options?.habitName,
834
- declared: habitTools,
835
- resolved: habitToolsResolved.map((t) => t.function.name),
836
- },
837
- });
838
- }
839
- else if (reason === "habit" && options?.habitName && habitParsedSuccessfully) {
840
- (0, runtime_1.emitNervesEvent)({
841
- event: "habit.tools_unrestricted",
842
- component: "senses",
843
- message: "habit running with full tool repertoire",
844
- meta: { habitName: options.habitName },
845
- });
846
- }
847
- const sessionLoader = {
848
- loadOrCreate: async () => {
849
- if (existingMessages.length > 0) {
850
- return {
851
- messages: existingMessages,
852
- sessionPath: sessionFilePath,
853
- structuredOutputs: loaded?.structuredOutputs,
854
- };
855
- }
856
- // Fresh session: build system prompt
857
- const systemPrompt = await (0, prompt_1.buildSystem)("inner", {
858
- toolChoiceRequired: true,
859
- flightRecorderResume: (0, flight_recorder_1.readFlightRecorderResume)((0, identity_1.getAgentRoot)()),
860
- });
861
- return {
862
- messages: [{ role: "system", content: (0, prompt_1.flattenSystemPrompt)(systemPrompt) }],
863
- sessionPath: sessionFilePath,
864
- structuredOutputs: [],
865
- };
866
- },
867
- };
868
- // ── Call shared pipeline ──────────────────────────────────────────
869
- const callbacks = createInnerDialogCallbacks();
870
- const traceId = (0, nerves_1.createTraceId)();
871
- // Attention queue: built when pending messages are drained, shared with tool context
872
- let attentionQueue = [];
873
- const result = await (0, pipeline_1.handleInboundTurn)({
874
- channel: "inner",
875
- sessionKey: "dialog",
876
- capabilities: innerCapabilities,
877
- messages: [userMessage],
878
- continuityIngressTexts: [],
879
- callbacks,
880
- friendResolver: { resolve: () => Promise.resolve(selfContext) },
881
- sessionLoader,
882
- pendingDir,
883
- friendStore: createNoOpFriendStore(),
884
- enforceTrustGate: trust_gate_1.enforceTrustGate,
885
- drainPending: pending_1.drainPending,
886
- runAgent: core_1.runAgent,
887
- postTurn: (turnMessages, sessionPathArg, usage, hooks, state) => {
888
- const prepared = (0, context_1.postTurnTrim)(turnMessages, usage, hooks);
889
- return (0, context_1.deferPostTurnPersist)(sessionPathArg, prepared, usage, state);
890
- },
891
- accumulateFriendTokens: friends_1.accumulateFriendTokens,
892
- signal: options?.signal,
893
- /* v8 ignore start -- attention queue: callback invoked by pipeline during pending drain; tested via attention-queue unit tests @preserve */
894
- onPendingDrained: (drained) => {
895
- const outstandingObligations = (0, obligations_1.listActiveReturnObligations)(agentName);
896
- const builtAttentionQueue = (0, attention_queue_1.buildAttentionQueue)({
897
- drainedPending: drained,
898
- outstandingObligations,
899
- friendNameResolver: (friendId) => {
900
- try {
901
- const raw = fs.readFileSync(path.join((0, identity_1.getAgentRoot)(agentName), "friends", friendId + ".json"), "utf-8");
902
- const parsed = JSON.parse(raw);
903
- return typeof parsed.name === "string" ? parsed.name : null;
904
- }
905
- catch {
906
- return null;
907
- }
908
- },
909
- packetResolver: (packetId) => {
910
- try {
911
- return (0, packets_1.readPonderPacket)((0, identity_1.getAgentRoot)(agentName), packetId);
912
- }
913
- catch {
914
- return null;
915
- }
916
- },
917
- });
918
- attentionQueue.splice(0, attentionQueue.length, ...builtAttentionQueue);
919
- const attentionFrame = (0, attention_queue_1.buildAttentionQueueStatusFrame)(attentionQueue);
920
- return attentionFrame ? [attentionFrame] : [];
921
- },
922
- /* v8 ignore stop */
923
- runAgentOptions: {
924
- traceId,
925
- toolChoiceRequired: true,
926
- mcpManager,
927
- ...(habitToolsResolved !== undefined && { tools: habitToolsResolved }),
928
- toolContext: {
929
- signin: async () => undefined,
930
- delegatedOrigins: attentionQueue,
931
- ...(options?.habitSession ? { habitSession: options.habitSession } : {}),
932
- },
933
- ...(options?.habitSession ? { habitSession: options.habitSession } : {}),
934
- },
935
- });
936
- // Post-turn routeDelegatedCompletion removed: delivery is now inline via surface tool.
937
- // settle in inner dialog produces no CompletionMetadata, so routeDelegatedCompletion
938
- // would be a no-op. The routing infrastructure is reused by the surface handler.
939
- const resultMessages = result.messages ?? [];
940
- const assistantPreview = extractAssistantPreview(resultMessages);
941
- const toolCalls = extractToolCallNames(resultMessages);
942
- (0, runtime_1.emitNervesEvent)({
943
- component: "senses",
944
- event: "senses.inner_dialog_turn",
945
- message: "inner dialog turn completed",
946
- meta: {
947
- reason,
948
- session: sessionFilePath,
949
- ...(options?.taskId && { taskId: options.taskId }),
950
- ...(assistantPreview && { assistantPreview }),
951
- ...(toolCalls.length > 0 && { toolCalls }),
952
- ...(result.usage && {
953
- promptTokens: result.usage.input_tokens,
954
- completionTokens: result.usage.output_tokens,
955
- totalTokens: result.usage.total_tokens,
956
- }),
957
- },
958
- });
959
- return {
960
- messages: resultMessages,
961
- usage: result.usage,
962
- sessionPath: result.sessionPath ?? sessionFilePath,
963
- completion: result.completion,
964
- turnOutcome: result.turnOutcome,
965
- restStatus: latestRestStatus(resultMessages),
966
- };
967
- }
968
- finally {
969
- writeInnerDialogRuntimeState(sessionFilePath, {
970
- status: "idle",
971
- lastCompletedAt: now().toISOString(),
972
- });
973
- }
974
- }
17
+ exports.runInnerDialogTurn = exports.innerDialogSessionPath = exports.loadInnerDialogInstincts = exports.buildInnerDialogBootstrapMessage = void 0;
18
+ __exportStar(require("./private-runtime"), exports);
19
+ var private_runtime_1 = require("./private-runtime");
20
+ Object.defineProperty(exports, "buildInnerDialogBootstrapMessage", { enumerable: true, get: function () { return private_runtime_1.buildPrivateRuntimeBootstrapMessage; } });
21
+ Object.defineProperty(exports, "loadInnerDialogInstincts", { enumerable: true, get: function () { return private_runtime_1.loadPrivateRuntimeInstincts; } });
22
+ Object.defineProperty(exports, "innerDialogSessionPath", { enumerable: true, get: function () { return private_runtime_1.privateRuntimeSessionPath; } });
23
+ Object.defineProperty(exports, "runInnerDialogTurn", { enumerable: true, get: function () { return private_runtime_1.runPrivateRuntimeTurn; } });