spora 0.7.0 → 0.7.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/README.md +7 -5
- package/dist/autonomy-DAV7X6QS.js +19 -0
- package/dist/{chunk-53YLFYJF.js → chunk-3RYCUGXE.js} +6 -2
- package/dist/chunk-3RYCUGXE.js.map +1 -0
- package/dist/{chunk-AH7HPXYC.js → chunk-AOQ3WLZV.js} +153 -143
- package/dist/chunk-AOQ3WLZV.js.map +1 -0
- package/dist/chunk-E5NR6HT4.js +29 -0
- package/dist/chunk-E5NR6HT4.js.map +1 -0
- package/dist/{chunk-EBO4F5NU.js → chunk-JBYZ7K56.js} +2 -2
- package/dist/chunk-KWWAIS3C.js +180 -0
- package/dist/chunk-KWWAIS3C.js.map +1 -0
- package/dist/{chunk-UINSD4FT.js → chunk-LXQNVVIY.js} +6 -6
- package/dist/{chunk-UINSD4FT.js.map → chunk-LXQNVVIY.js.map} +1 -1
- package/dist/{chunk-AIEXQCQS.js → chunk-M6YOQVSI.js} +2 -2
- package/dist/{chunk-B6RPMDML.js → chunk-NO3NQN67.js} +16 -6
- package/dist/chunk-NO3NQN67.js.map +1 -0
- package/dist/{chunk-QOKQ5OTU.js → chunk-NPV3OV2K.js} +3 -14
- package/dist/chunk-NPV3OV2K.js.map +1 -0
- package/dist/{chunk-SBQILQCJ.js → chunk-OACD3HGE.js} +7 -7
- package/dist/{chunk-UM57WU5I.js → chunk-P6KZIJYL.js} +2 -2
- package/dist/{chunk-AHXZIGQE.js → chunk-T7L2L7ZL.js} +2 -2
- package/dist/{chunk-ZJZKH7N7.js → chunk-VZBHRUZS.js} +2 -2
- package/dist/chunk-VZBHRUZS.js.map +1 -0
- package/dist/chunk-WIK74GGJ.js +295 -0
- package/dist/chunk-WIK74GGJ.js.map +1 -0
- package/dist/{chunk-YLJVFCT4.js → chunk-WN35MRMF.js} +2 -2
- package/dist/cli.js +168 -137
- package/dist/cli.js.map +1 -1
- package/dist/client-57BQKVYF.js +337 -0
- package/dist/client-57BQKVYF.js.map +1 -0
- package/dist/{colony-LCWN5IAN.js → colony-JPZC3R34.js} +7 -7
- package/dist/{config-TFAFYSIW.js → config-FL4VJVKZ.js} +3 -3
- package/dist/{crypto-FHSQ72NU.js → crypto-NOXNL4GP.js} +3 -3
- package/dist/{goals-5TAPXNR2.js → goals-RBKLMILE.js} +3 -3
- package/dist/{heartbeat-ZHRCEMF5.js → heartbeat-TNEPE3ZP.js} +83 -88
- package/dist/heartbeat-TNEPE3ZP.js.map +1 -0
- package/dist/{identity-O4FLSZKZ.js → identity-VDUW4I2K.js} +3 -3
- package/dist/{init-G3WINLAP.js → init-ISSXETHY.js} +59 -46
- package/dist/init-ISSXETHY.js.map +1 -0
- package/dist/llm-T33QTPVW.js +22 -0
- package/dist/mcp-server.js +28 -28
- package/dist/mcp-server.js.map +1 -1
- package/dist/{memory-O3AJIKBX.js → memory-OIAH33G2.js} +3 -3
- package/dist/{memory-7FBE26K3.js → memory-PNW7SX7A.js} +3 -3
- package/dist/{paths-5GFUUHCZ.js → paths-BYR6MEPR.js} +2 -2
- package/dist/prompt-builder-5NYONN2W.js +23 -0
- package/dist/queue-G5PTE6R6.js +14 -0
- package/dist/{strategy-S45TX766.js → strategy-Z4JSFHSP.js} +3 -3
- package/dist/{web-chat-RQIILEQK.js → web-chat-3HM35XM4.js} +31 -80
- package/dist/web-chat-3HM35XM4.js.map +1 -0
- package/dist/x-client-GY6XSPK6.js +12 -0
- package/package.json +1 -1
- package/dist/account-creator-ZD643X3Z.js +0 -498
- package/dist/account-creator-ZD643X3Z.js.map +0 -1
- package/dist/chunk-535NMUUW.js +0 -96
- package/dist/chunk-535NMUUW.js.map +0 -1
- package/dist/chunk-53YLFYJF.js.map +0 -1
- package/dist/chunk-55XPDJ6P.js +0 -124
- package/dist/chunk-55XPDJ6P.js.map +0 -1
- package/dist/chunk-AH7HPXYC.js.map +0 -1
- package/dist/chunk-B6RPMDML.js.map +0 -1
- package/dist/chunk-E6GMS76S.js +0 -154
- package/dist/chunk-E6GMS76S.js.map +0 -1
- package/dist/chunk-JJZ7T2IZ.js +0 -32
- package/dist/chunk-JJZ7T2IZ.js.map +0 -1
- package/dist/chunk-QOKQ5OTU.js.map +0 -1
- package/dist/chunk-TF2XYGGG.js +0 -249
- package/dist/chunk-TF2XYGGG.js.map +0 -1
- package/dist/chunk-ZJZKH7N7.js.map +0 -1
- package/dist/client-B6NGVRHM.js +0 -381
- package/dist/client-B6NGVRHM.js.map +0 -1
- package/dist/client-DDCS5FJS.js +0 -412
- package/dist/client-DDCS5FJS.js.map +0 -1
- package/dist/decision-engine-DRPIZLHI.js +0 -19
- package/dist/heartbeat-ZHRCEMF5.js.map +0 -1
- package/dist/init-G3WINLAP.js.map +0 -1
- package/dist/llm-3LSNADSR.js +0 -16
- package/dist/prompt-builder-U2J4H7YX.js +0 -24
- package/dist/queue-USY7JXDV.js +0 -14
- package/dist/research-TQLP42BC.js +0 -13
- package/dist/web-chat-RQIILEQK.js.map +0 -1
- package/dist/x-client-TYU5QSLG.js +0 -12
- package/dist/x-client-TYU5QSLG.js.map +0 -1
- /package/dist/{config-TFAFYSIW.js.map → autonomy-DAV7X6QS.js.map} +0 -0
- /package/dist/{chunk-EBO4F5NU.js.map → chunk-JBYZ7K56.js.map} +0 -0
- /package/dist/{chunk-AIEXQCQS.js.map → chunk-M6YOQVSI.js.map} +0 -0
- /package/dist/{chunk-SBQILQCJ.js.map → chunk-OACD3HGE.js.map} +0 -0
- /package/dist/{chunk-UM57WU5I.js.map → chunk-P6KZIJYL.js.map} +0 -0
- /package/dist/{chunk-AHXZIGQE.js.map → chunk-T7L2L7ZL.js.map} +0 -0
- /package/dist/{chunk-YLJVFCT4.js.map → chunk-WN35MRMF.js.map} +0 -0
- /package/dist/{colony-LCWN5IAN.js.map → colony-JPZC3R34.js.map} +0 -0
- /package/dist/{crypto-FHSQ72NU.js.map → config-FL4VJVKZ.js.map} +0 -0
- /package/dist/{decision-engine-DRPIZLHI.js.map → crypto-NOXNL4GP.js.map} +0 -0
- /package/dist/{goals-5TAPXNR2.js.map → goals-RBKLMILE.js.map} +0 -0
- /package/dist/{identity-O4FLSZKZ.js.map → identity-VDUW4I2K.js.map} +0 -0
- /package/dist/{llm-3LSNADSR.js.map → llm-T33QTPVW.js.map} +0 -0
- /package/dist/{memory-7FBE26K3.js.map → memory-OIAH33G2.js.map} +0 -0
- /package/dist/{memory-O3AJIKBX.js.map → memory-PNW7SX7A.js.map} +0 -0
- /package/dist/{paths-5GFUUHCZ.js.map → paths-BYR6MEPR.js.map} +0 -0
- /package/dist/{prompt-builder-U2J4H7YX.js.map → prompt-builder-5NYONN2W.js.map} +0 -0
- /package/dist/{queue-USY7JXDV.js.map → queue-G5PTE6R6.js.map} +0 -0
- /package/dist/{research-TQLP42BC.js.map → strategy-Z4JSFHSP.js.map} +0 -0
- /package/dist/{strategy-S45TX766.js.map → x-client-GY6XSPK6.js.map} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
addToQueue,
|
|
3
|
+
flushQueue,
|
|
4
|
+
showQueue
|
|
5
|
+
} from "./chunk-OACD3HGE.js";
|
|
6
|
+
import "./chunk-NPV3OV2K.js";
|
|
7
|
+
import "./chunk-NO3NQN67.js";
|
|
8
|
+
import "./chunk-3RYCUGXE.js";
|
|
9
|
+
export {
|
|
10
|
+
addToQueue,
|
|
11
|
+
flushQueue,
|
|
12
|
+
showQueue
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=queue-G5PTE6R6.js.map
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
loadStrategy,
|
|
3
3
|
renderStrategyForPrompt,
|
|
4
4
|
saveStrategy
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-P6KZIJYL.js";
|
|
6
|
+
import "./chunk-3RYCUGXE.js";
|
|
7
7
|
export {
|
|
8
8
|
loadStrategy,
|
|
9
9
|
renderStrategyForPrompt,
|
|
10
10
|
saveStrategy
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=strategy-
|
|
12
|
+
//# sourceMappingURL=strategy-Z4JSFHSP.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadIdentity
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-M6YOQVSI.js";
|
|
4
|
+
import "./chunk-3RYCUGXE.js";
|
|
5
5
|
|
|
6
6
|
// src/web-chat/server.ts
|
|
7
7
|
import http from "http";
|
|
@@ -175,7 +175,7 @@ async function extractAndSaveLearnings(responseText) {
|
|
|
175
175
|
const learnPattern = /<<LEARN:\s*(.+?)>>/g;
|
|
176
176
|
const matches = [...responseText.matchAll(learnPattern)];
|
|
177
177
|
if (matches.length > 0) {
|
|
178
|
-
const { addLearning } = await import("./memory-
|
|
178
|
+
const { addLearning } = await import("./memory-OIAH33G2.js");
|
|
179
179
|
for (const match of matches) {
|
|
180
180
|
const learning = match[1].trim();
|
|
181
181
|
addLearning(learning, "web-chat", ["chat", "creator-interaction"]);
|
|
@@ -191,7 +191,7 @@ async function extractAndApplyTraining(responseText) {
|
|
|
191
191
|
try {
|
|
192
192
|
const update = JSON.parse(match[1].trim());
|
|
193
193
|
if (update.identity) {
|
|
194
|
-
const { loadIdentity: loadIdentity2, mutateIdentity, saveIdentity } = await import("./identity-
|
|
194
|
+
const { loadIdentity: loadIdentity2, mutateIdentity, saveIdentity } = await import("./identity-VDUW4I2K.js");
|
|
195
195
|
let identity = loadIdentity2();
|
|
196
196
|
const identityFields = {
|
|
197
197
|
tone: "tone",
|
|
@@ -230,7 +230,7 @@ async function extractAndApplyTraining(responseText) {
|
|
|
230
230
|
saveIdentity(identity);
|
|
231
231
|
}
|
|
232
232
|
if (update.strategy) {
|
|
233
|
-
const { loadStrategy, saveStrategy } = await import("./strategy-
|
|
233
|
+
const { loadStrategy, saveStrategy } = await import("./strategy-Z4JSFHSP.js");
|
|
234
234
|
const strategy = loadStrategy();
|
|
235
235
|
if (update.strategy.currentFocus) strategy.currentFocus = update.strategy.currentFocus;
|
|
236
236
|
if (update.strategy.shortTermGoals) strategy.shortTermGoals = update.strategy.shortTermGoals;
|
|
@@ -245,7 +245,7 @@ async function extractAndApplyTraining(responseText) {
|
|
|
245
245
|
console.log(chalk.dim(` [Training] Updated strategy`));
|
|
246
246
|
}
|
|
247
247
|
if (update.learning) {
|
|
248
|
-
const { addLearning } = await import("./memory-
|
|
248
|
+
const { addLearning } = await import("./memory-OIAH33G2.js");
|
|
249
249
|
addLearning(
|
|
250
250
|
update.learning.content,
|
|
251
251
|
"training-chat",
|
|
@@ -254,7 +254,7 @@ async function extractAndApplyTraining(responseText) {
|
|
|
254
254
|
console.log(chalk.dim(` [Training] Saved learning: ${update.learning.content}`));
|
|
255
255
|
}
|
|
256
256
|
if (update.reflection) {
|
|
257
|
-
const { loadIdentity: loadIdentity2, saveIdentity } = await import("./identity-
|
|
257
|
+
const { loadIdentity: loadIdentity2, saveIdentity } = await import("./identity-VDUW4I2K.js");
|
|
258
258
|
const identity = loadIdentity2();
|
|
259
259
|
identity.evolutionJournal.push({
|
|
260
260
|
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -264,7 +264,7 @@ async function extractAndApplyTraining(responseText) {
|
|
|
264
264
|
console.log(chalk.dim(` [Training] Added reflection to evolution journal`));
|
|
265
265
|
}
|
|
266
266
|
if (update.goalUpdates && Array.isArray(update.goalUpdates)) {
|
|
267
|
-
const { loadGoals, saveGoals } = await import("./goals-
|
|
267
|
+
const { loadGoals, saveGoals } = await import("./goals-RBKLMILE.js");
|
|
268
268
|
const tracker = loadGoals();
|
|
269
269
|
for (const gu of update.goalUpdates) {
|
|
270
270
|
const existing = tracker.goals.find((g) => g.goal === gu.goal);
|
|
@@ -290,7 +290,7 @@ async function extractAndApplyTraining(responseText) {
|
|
|
290
290
|
return responseText.replace(/<<TRAINING:[\s\S]*?>>/g, "").trim();
|
|
291
291
|
}
|
|
292
292
|
async function logChatInteraction(userMessage, agentResponse) {
|
|
293
|
-
const { logInteraction } = await import("./memory-
|
|
293
|
+
const { logInteraction } = await import("./memory-OIAH33G2.js");
|
|
294
294
|
logInteraction({
|
|
295
295
|
id: `chat-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
296
296
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -302,17 +302,12 @@ async function logChatInteraction(userMessage, agentResponse) {
|
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
async function runNarratedHeartbeat(server) {
|
|
305
|
-
const { loadConfig } = await import("./config-
|
|
306
|
-
const {
|
|
307
|
-
const {
|
|
308
|
-
const { buildSystemPrompt, buildHeartbeatUserMessage, buildReflectionPrompt } = await import("./prompt-builder-U2J4H7YX.js");
|
|
309
|
-
const { generateResponse } = await import("./llm-3LSNADSR.js");
|
|
310
|
-
const { parseActions, executeActions } = await import("./decision-engine-DRPIZLHI.js");
|
|
311
|
-
const { addLearning } = await import("./memory-O3AJIKBX.js");
|
|
312
|
-
const { loadStrategy, saveStrategy } = await import("./strategy-S45TX766.js");
|
|
305
|
+
const { loadConfig } = await import("./config-FL4VJVKZ.js");
|
|
306
|
+
const { flushQueue } = await import("./queue-G5PTE6R6.js");
|
|
307
|
+
const { runAutonomyCycle } = await import("./autonomy-DAV7X6QS.js");
|
|
313
308
|
const config = loadConfig();
|
|
314
309
|
const intervalMs = config.runtime?.heartbeatIntervalMs ?? 3e5;
|
|
315
|
-
const maxActions = config.runtime?.actionsPerHeartbeat ??
|
|
310
|
+
const maxActions = config.runtime?.actionsPerHeartbeat ?? 4;
|
|
316
311
|
let heartbeatCount = 0;
|
|
317
312
|
console.log(chalk.cyan(` [Agent] Autonomous heartbeat started (every ${Math.round(intervalMs / 6e4)} min)`));
|
|
318
313
|
while (true) {
|
|
@@ -334,32 +329,20 @@ async function runNarratedHeartbeat(server) {
|
|
|
334
329
|
}
|
|
335
330
|
} catch {
|
|
336
331
|
}
|
|
337
|
-
server.pushAgentEvent("narration", "
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
`${research.mentions.length} mentions`,
|
|
344
|
-
research.topicSearchResults.length > 0 ? `${research.topicSearchResults.length} topic searches` : null,
|
|
345
|
-
research.peopleActivity.length > 0 ? `checked ${research.peopleActivity.length} people` : null
|
|
346
|
-
].filter(Boolean).join(", ");
|
|
347
|
-
server.pushAgentEvent("narration", `Research: ${researchParts}`);
|
|
348
|
-
server.pushAgentEvent("narration", "Thinking about what to do...");
|
|
349
|
-
const systemPrompt = buildSystemPrompt();
|
|
350
|
-
const userMessage = buildHeartbeatUserMessage(research);
|
|
351
|
-
const response = await generateResponse(systemPrompt, userMessage);
|
|
352
|
-
const actions = parseActions(response.content);
|
|
353
|
-
if (actions.length === 0) {
|
|
332
|
+
server.pushAgentEvent("narration", "Observing timeline and planning actions...");
|
|
333
|
+
const cycle = await runAutonomyCycle(maxActions);
|
|
334
|
+
if (cycle.timeline.length > 0 || cycle.mentions.length > 0) {
|
|
335
|
+
server.pushAgentEvent("narration", `Found ${cycle.timeline.length} timeline posts and ${cycle.mentions.length} mentions`);
|
|
336
|
+
}
|
|
337
|
+
if (cycle.actions.length === 0) {
|
|
354
338
|
server.pushAgentEvent("narration", "Nothing interesting right now, going back to sleep");
|
|
355
339
|
console.log(chalk.dim(` [Agent] No actions this heartbeat`));
|
|
356
340
|
continue;
|
|
357
341
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
const action = limitedActions[i];
|
|
342
|
+
for (let i = 0; i < cycle.results.length; i++) {
|
|
343
|
+
const result = cycle.results[i];
|
|
344
|
+
const action = cycle.actions[i];
|
|
345
|
+
if (!action) continue;
|
|
363
346
|
if (result.success) {
|
|
364
347
|
if (action.action === "post" && action.content) {
|
|
365
348
|
server.pushAgentEvent("tweet", action.content, { status: "success" });
|
|
@@ -386,40 +369,8 @@ async function runNarratedHeartbeat(server) {
|
|
|
386
369
|
console.log(chalk.red(` [Agent] \u2717 ${result.action}: ${result.error}`));
|
|
387
370
|
}
|
|
388
371
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
server.pushAgentEvent("narration", "Reflecting on recent performance...");
|
|
392
|
-
const reflectionPrompt = buildReflectionPrompt(results);
|
|
393
|
-
const reflectionResponse = await generateResponse(
|
|
394
|
-
`You are ${loadIdentity().name}. Reflect honestly on your performance.`,
|
|
395
|
-
reflectionPrompt
|
|
396
|
-
);
|
|
397
|
-
const jsonMatch = reflectionResponse.content.match(/\{[\s\S]*\}/);
|
|
398
|
-
if (jsonMatch) {
|
|
399
|
-
try {
|
|
400
|
-
const reflection = JSON.parse(jsonMatch[0]);
|
|
401
|
-
if (reflection.learning && reflection.learning !== "null") {
|
|
402
|
-
addLearning(reflection.learning, "reflection", ["heartbeat", "performance"]);
|
|
403
|
-
server.pushAgentEvent("narration", `Learned: ${reflection.learning}`);
|
|
404
|
-
console.log(chalk.dim(` [Agent] Reflection learning: ${reflection.learning}`));
|
|
405
|
-
}
|
|
406
|
-
if (reflection.strategyUpdate && reflection.strategyUpdate !== "null") {
|
|
407
|
-
const strategy = loadStrategy();
|
|
408
|
-
strategy.experiments.push({
|
|
409
|
-
description: reflection.strategyUpdate,
|
|
410
|
-
status: "pending"
|
|
411
|
-
});
|
|
412
|
-
strategy.lastUpdated = (/* @__PURE__ */ new Date()).toISOString();
|
|
413
|
-
saveStrategy(strategy);
|
|
414
|
-
server.pushAgentEvent("narration", `Strategy: ${reflection.strategyUpdate}`);
|
|
415
|
-
console.log(chalk.dim(` [Agent] Strategy update: ${reflection.strategyUpdate}`));
|
|
416
|
-
}
|
|
417
|
-
} catch {
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
} catch (err) {
|
|
421
|
-
console.log(chalk.dim(` [Agent] Reflection failed: ${err.message}`));
|
|
422
|
-
}
|
|
372
|
+
for (const feedback of cycle.policyFeedback) {
|
|
373
|
+
server.pushAgentEvent("narration", `Policy adjusted plan: ${feedback}`);
|
|
423
374
|
}
|
|
424
375
|
} catch (error) {
|
|
425
376
|
const msg = error.message;
|
|
@@ -443,13 +394,13 @@ async function startWebChat() {
|
|
|
443
394
|
server.setMessageHandler(async (message) => {
|
|
444
395
|
try {
|
|
445
396
|
if (!systemPrompt || messageCount % 10 === 0) {
|
|
446
|
-
const { buildTrainingChatPrompt } = await import("./prompt-builder-
|
|
397
|
+
const { buildTrainingChatPrompt } = await import("./prompt-builder-5NYONN2W.js");
|
|
447
398
|
systemPrompt = buildTrainingChatPrompt();
|
|
448
399
|
}
|
|
449
400
|
messageCount++;
|
|
450
|
-
const { hasLLMKey, chat: chatLLM } = await import("./llm-
|
|
401
|
+
const { hasLLMKey, chat: chatLLM } = await import("./llm-T33QTPVW.js");
|
|
451
402
|
if (!hasLLMKey()) {
|
|
452
|
-
return "I can't respond right now - no API key configured. Run `spora
|
|
403
|
+
return "I can't respond right now - no API key configured. Run `spora llm set --provider <provider>` to set one up.";
|
|
453
404
|
}
|
|
454
405
|
chatHistory.push({ role: "user", content: message });
|
|
455
406
|
const response = await chatLLM(systemPrompt, chatHistory);
|
|
@@ -473,13 +424,13 @@ async function startWebChat() {
|
|
|
473
424
|
`));
|
|
474
425
|
openBrowser(url);
|
|
475
426
|
try {
|
|
476
|
-
const { hasLLMKey } = await import("./llm-
|
|
427
|
+
const { hasLLMKey } = await import("./llm-T33QTPVW.js");
|
|
477
428
|
if (hasLLMKey()) {
|
|
478
429
|
runNarratedHeartbeat(server).catch((err) => {
|
|
479
430
|
console.error(chalk.red(`Heartbeat failed to start: ${err}`));
|
|
480
431
|
});
|
|
481
432
|
} else {
|
|
482
|
-
console.log(chalk.yellow(" [Agent] No LLM key \u2014 autonomous heartbeat disabled. Run `spora
|
|
433
|
+
console.log(chalk.yellow(" [Agent] No LLM key \u2014 autonomous heartbeat disabled. Run `spora llm set --provider <provider>` to enable."));
|
|
483
434
|
server.pushActivity("status", "No LLM API key configured. Autonomous mode disabled.");
|
|
484
435
|
}
|
|
485
436
|
} catch (err) {
|
|
@@ -526,4 +477,4 @@ export {
|
|
|
526
477
|
openBrowser,
|
|
527
478
|
startWebChat
|
|
528
479
|
};
|
|
529
|
-
//# sourceMappingURL=web-chat-
|
|
480
|
+
//# sourceMappingURL=web-chat-3HM35XM4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/web-chat/server.ts","../src/web-chat/index.ts"],"sourcesContent":["/**\n * Local web chat server\n * Serves a simple chat interface for interacting with your Spore\n */\n\nimport http from \"node:http\";\nimport { URL } from \"node:url\";\nimport { readFileSync } from \"node:fs\";\nimport { join, dirname } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\ninterface ChatMessage {\n role: \"user\" | \"assistant\";\n content: string;\n timestamp: number;\n}\n\ninterface AgentActivity {\n type: \"heartbeat\" | \"action\" | \"status\";\n message: string;\n timestamp: number;\n}\n\n/** Messages pushed from the heartbeat into the chat UI */\nexport interface AgentChatEvent {\n type: \"narration\" | \"tweet\" | \"action\" | \"sleep\" | \"wake\" | \"error\";\n content: string;\n timestamp: number;\n meta?: Record<string, unknown>;\n}\n\ninterface AgentIdentity {\n name: string;\n handle: string;\n bio?: string;\n profileImage?: string;\n}\n\nexport class WebChatServer {\n private server: http.Server | null = null;\n private port: number;\n private messages: ChatMessage[] = [];\n private activities: AgentActivity[] = [];\n private agentEvents: AgentChatEvent[] = [];\n private onUserMessage?: (message: string) => Promise<string>;\n private identity?: AgentIdentity;\n\n constructor(port = 3737) {\n this.port = port;\n }\n\n setIdentity(identity: AgentIdentity) {\n this.identity = identity;\n }\n\n setMessageHandler(handler: (message: string) => Promise<string>) {\n this.onUserMessage = handler;\n }\n\n /** Push an activity update (from heartbeat) to the UI — kept for backwards compat */\n pushActivity(type: AgentActivity[\"type\"], message: string) {\n this.activities.push({ type, message, timestamp: Date.now() });\n if (this.activities.length > 100) {\n this.activities = this.activities.slice(-100);\n }\n }\n\n /** Push an event into the chat stream (narration, tweet card, sleep state, etc.) */\n pushAgentEvent(type: AgentChatEvent[\"type\"], content: string, meta?: Record<string, unknown>) {\n this.agentEvents.push({ type, content, timestamp: Date.now(), meta });\n if (this.agentEvents.length > 200) {\n this.agentEvents = this.agentEvents.slice(-200);\n }\n }\n\n async start(): Promise<string> {\n return new Promise((resolve, reject) => {\n this.server = http.createServer(async (req, res) => {\n const url = new URL(req.url || \"/\", `http://${req.headers.host}`);\n\n // CORS headers\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\");\n res.setHeader(\"Access-Control-Allow-Methods\", \"GET, POST, OPTIONS\");\n res.setHeader(\"Access-Control-Allow-Headers\", \"Content-Type\");\n\n if (req.method === \"OPTIONS\") {\n res.writeHead(200);\n res.end();\n return;\n }\n\n // Serve HTML\n if (url.pathname === \"/\" || url.pathname === \"/index.html\") {\n try {\n const possiblePaths = [\n join(__dirname, \"web-chat\", \"chat.html\"),\n join(__dirname, \"chat.html\"),\n join(__dirname, \"..\", \"web-chat\", \"chat.html\"),\n join(__dirname, \"..\", \"src\", \"web-chat\", \"chat.html\"),\n ];\n\n let html: string | null = null;\n for (const p of possiblePaths) {\n try {\n html = readFileSync(p, \"utf-8\");\n break;\n } catch {\n continue;\n }\n }\n\n if (html) {\n res.writeHead(200, { \"Content-Type\": \"text/html\" });\n res.end(html);\n } else {\n console.error(\"Could not find chat.html in any of:\", possiblePaths);\n res.writeHead(500);\n res.end(\"Error: Could not find chat.html\");\n }\n } catch (error) {\n res.writeHead(500);\n res.end(\"Error loading chat interface\");\n }\n return;\n }\n\n // API: Get agent identity\n if (url.pathname === \"/api/identity\" && req.method === \"GET\") {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ identity: this.identity || null }));\n return;\n }\n\n // API: Get messages\n if (url.pathname === \"/api/messages\" && req.method === \"GET\") {\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ messages: this.messages }));\n return;\n }\n\n // API: Get agent activity feed (legacy, kept for compat)\n if (url.pathname === \"/api/activity\" && req.method === \"GET\") {\n const since = parseInt(url.searchParams.get(\"since\") || \"0\", 10);\n const newActivities = this.activities.filter((a) => a.timestamp > since);\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ activities: newActivities }));\n return;\n }\n\n // API: Get agent events (narration, tweets, sleep) — polled by chat UI\n if (url.pathname === \"/api/agent-events\" && req.method === \"GET\") {\n const since = parseInt(url.searchParams.get(\"since\") || \"0\", 10);\n const newEvents = this.agentEvents.filter((e) => e.timestamp > since);\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ events: newEvents }));\n return;\n }\n\n // API: Send message\n if (url.pathname === \"/api/message\" && req.method === \"POST\") {\n let body = \"\";\n req.on(\"data\", (chunk) => {\n body += chunk.toString();\n });\n\n req.on(\"end\", async () => {\n try {\n const { message } = JSON.parse(body);\n\n // Add user message\n this.messages.push({\n role: \"user\",\n content: message,\n timestamp: Date.now(),\n });\n\n // Get response\n if (this.onUserMessage) {\n const response = await this.onUserMessage(message);\n this.messages.push({\n role: \"assistant\",\n content: response,\n timestamp: Date.now(),\n });\n res.writeHead(200, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ success: true, response }));\n } else {\n res.writeHead(500, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ error: \"No message handler configured\" }));\n }\n } catch (error) {\n res.writeHead(400, { \"Content-Type\": \"application/json\" });\n res.end(JSON.stringify({ error: \"Invalid request\" }));\n }\n });\n return;\n }\n\n // 404\n res.writeHead(404);\n res.end(\"Not found\");\n });\n\n this.server.listen(this.port, () => {\n const url = `http://localhost:${this.port}`;\n resolve(url);\n });\n\n this.server.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"EADDRINUSE\") {\n this.port++;\n this.server?.close();\n this.start().then(resolve).catch(reject);\n } else {\n reject(error);\n }\n });\n });\n }\n\n stop() {\n if (this.server) {\n this.server.close();\n this.server = null;\n }\n }\n}\n","/**\n * Web chat integration with autonomous heartbeat\n */\n\nimport { WebChatServer } from \"./server.js\";\nimport { loadIdentity } from \"../identity/index.js\";\nimport { execSync } from \"node:child_process\";\nimport chalk from \"chalk\";\n\n/**\n * Extract <<LEARN: ...>> tags from response, save them, and return cleaned text\n */\nasync function extractAndSaveLearnings(responseText: string): Promise<string> {\n const learnPattern = /<<LEARN:\\s*(.+?)>>/g;\n const matches = [...responseText.matchAll(learnPattern)];\n\n if (matches.length > 0) {\n const { addLearning } = await import(\"../memory/index.js\");\n for (const match of matches) {\n const learning = match[1].trim();\n addLearning(learning, \"web-chat\", [\"chat\", \"creator-interaction\"]);\n console.log(chalk.dim(` [Memory] Saved learning: ${learning}`));\n }\n }\n\n // Strip the learn tags from the response the user sees\n return responseText.replace(/<<LEARN:\\s*.+?>>/g, \"\").trim();\n}\n\n/**\n * Extract <<TRAINING:{json}>> tags from response, apply updates to identity/strategy/goals, and return cleaned text\n */\nasync function extractAndApplyTraining(responseText: string): Promise<string> {\n const trainingPattern = /<<TRAINING:([\\s\\S]*?)>>/g;\n const matches = [...responseText.matchAll(trainingPattern)];\n\n for (const match of matches) {\n try {\n const update = JSON.parse(match[1].trim());\n\n // Apply identity changes\n if (update.identity) {\n const { loadIdentity, mutateIdentity, saveIdentity } = await import(\"../identity/index.js\");\n let identity = loadIdentity();\n\n const identityFields: Record<string, string> = {\n tone: \"tone\",\n worldview: \"worldview\",\n conflictStyle: \"conflictStyle\",\n vocabularyStyle: \"vocabularyStyle\",\n tweetStyle: \"tweetStyle\",\n };\n\n // Simple string/enum fields\n for (const [key, field] of Object.entries(identityFields)) {\n if (update.identity[key] !== undefined) {\n identity = mutateIdentity(identity, field, update.identity[key], \"training-chat\");\n console.log(chalk.dim(` [Training] Updated ${field}`));\n }\n }\n\n // Array fields (replace entire array)\n const arrayFields = [\"coreValues\", \"topics\", \"avoidTopics\", \"goals\", \"boundaries\", \"catchphrases\", \"heroes\"];\n for (const field of arrayFields) {\n if (update.identity[field] !== undefined && Array.isArray(update.identity[field])) {\n identity = mutateIdentity(identity, field, update.identity[field], \"training-chat\");\n console.log(chalk.dim(` [Training] Updated ${field}`));\n }\n }\n\n // Traits (merge, don't replace)\n if (update.identity.traits && typeof update.identity.traits === \"object\") {\n for (const [trait, value] of Object.entries(update.identity.traits)) {\n if (typeof value === \"number\" && value >= 0 && value <= 1) {\n identity = mutateIdentity(identity, `traits.${trait}`, value, \"training-chat\");\n console.log(chalk.dim(` [Training] Updated traits.${trait} = ${value}`));\n }\n }\n }\n\n // Engagement strategy (merge)\n if (update.identity.engagementStrategy && typeof update.identity.engagementStrategy === \"object\") {\n for (const [key, value] of Object.entries(update.identity.engagementStrategy)) {\n identity = mutateIdentity(identity, `engagementStrategy.${key}`, value, \"training-chat\");\n console.log(chalk.dim(` [Training] Updated engagementStrategy.${key}`));\n }\n }\n\n saveIdentity(identity);\n }\n\n // Apply strategy changes\n if (update.strategy) {\n const { loadStrategy, saveStrategy } = await import(\"../memory/strategy.js\");\n const strategy = loadStrategy();\n\n if (update.strategy.currentFocus) strategy.currentFocus = update.strategy.currentFocus;\n if (update.strategy.shortTermGoals) strategy.shortTermGoals = update.strategy.shortTermGoals;\n if (update.strategy.experiments) {\n strategy.experiments.push(...update.strategy.experiments);\n }\n if (update.strategy.peopleToEngage) {\n strategy.peopleToEngage.push(...update.strategy.peopleToEngage);\n }\n\n strategy.lastUpdated = new Date().toISOString();\n saveStrategy(strategy);\n console.log(chalk.dim(` [Training] Updated strategy`));\n }\n\n // Apply standalone learning\n if (update.learning) {\n const { addLearning } = await import(\"../memory/index.js\");\n addLearning(\n update.learning.content,\n \"training-chat\",\n update.learning.tags || [\"training\"],\n );\n console.log(chalk.dim(` [Training] Saved learning: ${update.learning.content}`));\n }\n\n // Apply reflection to evolution journal\n if (update.reflection) {\n const { loadIdentity, saveIdentity } = await import(\"../identity/index.js\");\n const identity = loadIdentity();\n identity.evolutionJournal.push({\n date: new Date().toISOString(),\n reflection: update.reflection,\n });\n saveIdentity(identity);\n console.log(chalk.dim(` [Training] Added reflection to evolution journal`));\n }\n\n // Apply goal updates\n if (update.goalUpdates && Array.isArray(update.goalUpdates)) {\n const { loadGoals, saveGoals } = await import(\"../memory/goals.js\");\n const tracker = loadGoals();\n\n for (const gu of update.goalUpdates) {\n const existing = tracker.goals.find((g: { goal: string }) => g.goal === gu.goal);\n if (existing) {\n existing.progress = gu.progress;\n existing.lastUpdated = new Date().toISOString();\n } else {\n tracker.goals.push({\n goal: gu.goal,\n progress: gu.progress,\n lastUpdated: new Date().toISOString(),\n });\n }\n }\n\n tracker.lastReviewed = new Date().toISOString();\n saveGoals(tracker);\n console.log(chalk.dim(` [Training] Updated ${update.goalUpdates.length} goal(s)`));\n }\n\n } catch (err) {\n console.error(chalk.dim(` [Training] Failed to parse training update: ${(err as Error).message}`));\n }\n }\n\n // Strip the training tags from the response the user sees\n return responseText.replace(/<<TRAINING:[\\s\\S]*?>>/g, \"\").trim();\n}\n\n/**\n * Log a chat exchange as an interaction in memory\n */\nasync function logChatInteraction(userMessage: string, agentResponse: string): Promise<void> {\n const { logInteraction } = await import(\"../memory/index.js\");\n logInteraction({\n id: `chat-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,\n timestamp: new Date().toISOString(),\n type: \"reply\",\n content: agentResponse.slice(0, 200),\n targetHandle: \"creator\",\n creditsUsed: 0,\n success: true,\n });\n}\n\n/**\n * Run the autonomous heartbeat in the background, narrating to the chat UI\n */\nasync function runNarratedHeartbeat(server: WebChatServer): Promise<void> {\n const { loadConfig } = await import(\"../utils/config.js\");\n const { flushQueue } = await import(\"../scheduler/queue.js\");\n const { runAutonomyCycle } = await import(\"../runtime/autonomy.js\");\n\n const config = loadConfig();\n const intervalMs = config.runtime?.heartbeatIntervalMs ?? 300_000;\n const maxActions = config.runtime?.actionsPerHeartbeat ?? 4;\n\n let heartbeatCount = 0;\n\n console.log(chalk.cyan(` [Agent] Autonomous heartbeat started (every ${Math.round(intervalMs / 60_000)} min)`));\n\n while (true) {\n // Sleep first, then heartbeat\n const jitter = Math.floor(Math.random() * intervalMs * 0.3);\n const sleepMs = heartbeatCount === 0 ? 10_000 : intervalMs + jitter;\n const wakeUpAt = Date.now() + sleepMs;\n\n // Show sleep state in chat (skip for first quick boot)\n if (heartbeatCount > 0) {\n server.pushAgentEvent(\"sleep\", \"sleeping\", { wakeUpAt });\n }\n\n await new Promise((r) => setTimeout(r, sleepMs));\n\n heartbeatCount++;\n console.log(chalk.cyan(` [Agent] Heartbeat #${heartbeatCount}`));\n server.pushAgentEvent(\"wake\", `Waking up... heartbeat #${heartbeatCount}`);\n\n try {\n // 1. Flush queue\n try {\n const flushed = await flushQueue();\n if (flushed.posted > 0) {\n server.pushAgentEvent(\"action\", `Flushed ${flushed.posted} queued post(s)`);\n }\n } catch {\n // Queue flush is best-effort\n }\n\n // 2. Run tool-driven autonomy cycle\n server.pushAgentEvent(\"narration\", \"Observing timeline and planning actions...\");\n const cycle = await runAutonomyCycle(maxActions);\n\n if (cycle.timeline.length > 0 || cycle.mentions.length > 0) {\n server.pushAgentEvent(\"narration\", `Found ${cycle.timeline.length} timeline posts and ${cycle.mentions.length} mentions`);\n }\n\n if (cycle.actions.length === 0) {\n server.pushAgentEvent(\"narration\", \"Nothing interesting right now, going back to sleep\");\n console.log(chalk.dim(` [Agent] No actions this heartbeat`));\n continue;\n }\n\n // 3. Report results — push tweet cards for posts, narration for everything else\n for (let i = 0; i < cycle.results.length; i++) {\n const result = cycle.results[i];\n const action = cycle.actions[i];\n if (!action) continue;\n\n if (result.success) {\n if (action.action === \"post\" && action.content) {\n server.pushAgentEvent(\"tweet\", action.content, { status: \"success\" });\n } else if (action.action === \"reply\" && action.content) {\n server.pushAgentEvent(\"action\", `Replied to tweet: \"${action.content.slice(0, 80)}\"`);\n } else if (action.action === \"like\") {\n server.pushAgentEvent(\"action\", `Liked a tweet`);\n } else if (action.action === \"retweet\") {\n server.pushAgentEvent(\"action\", `Retweeted`);\n } else if (action.action === \"follow\") {\n server.pushAgentEvent(\"action\", `Followed @${action.handle}`);\n } else if (action.action === \"schedule\" && action.content) {\n server.pushAgentEvent(\"tweet\", action.content, { status: \"Scheduled\" });\n } else {\n server.pushAgentEvent(\"action\", `${action.action}${result.detail ? `: ${result.detail}` : \"\"}`);\n }\n console.log(chalk.green(` [Agent] ✓ ${result.action}`));\n } else {\n if (action.action === \"post\" && action.content) {\n server.pushAgentEvent(\"tweet\", action.content, { status: `Failed: ${result.error}` });\n } else {\n server.pushAgentEvent(\"error\", `${result.action} failed: ${result.error}`);\n }\n console.log(chalk.red(` [Agent] ✗ ${result.action}: ${result.error}`));\n }\n }\n\n for (const feedback of cycle.policyFeedback) {\n server.pushAgentEvent(\"narration\", `Policy adjusted plan: ${feedback}`);\n }\n\n } catch (error) {\n const msg = (error as Error).message;\n console.error(chalk.red(` [Agent] Heartbeat #${heartbeatCount} error: ${msg}`));\n server.pushAgentEvent(\"error\", `Something went wrong: ${msg}`);\n }\n }\n}\n\nexport async function startWebChat() {\n const identity = loadIdentity();\n\n const server = new WebChatServer();\n\n // Pass identity to server so the chat UI can display it\n server.setIdentity({\n name: identity.name,\n handle: identity.handle,\n bio: identity.bio,\n profileImage: identity.profileImage,\n });\n\n // Set up message handler - connected to actual LLM with memory\n const chatHistory: Array<{ role: \"user\" | \"assistant\"; content: string }> = [];\n let systemPrompt: string | null = null;\n let messageCount = 0;\n\n server.setMessageHandler(async (message: string) => {\n try {\n // Build training prompt on first message, rebuild every 10 messages to refresh memory\n if (!systemPrompt || messageCount % 10 === 0) {\n const { buildTrainingChatPrompt } = await import(\"../runtime/prompt-builder.js\");\n systemPrompt = buildTrainingChatPrompt();\n }\n messageCount++;\n\n // Check for LLM key\n const { hasLLMKey, chat: chatLLM } = await import(\"../runtime/llm.js\");\n if (!hasLLMKey()) {\n return \"I can't respond right now - no API key configured. Run `spora llm set --provider <provider>` to set one up.\";\n }\n\n // Add user message to history\n chatHistory.push({ role: \"user\", content: message });\n\n // Call LLM with full conversation history\n const response = await chatLLM(systemPrompt, chatHistory);\n\n // Extract training updates and learnings from response\n const afterTraining = await extractAndApplyTraining(response.content);\n const cleanResponse = await extractAndSaveLearnings(afterTraining);\n\n // Add cleaned assistant response to history\n chatHistory.push({ role: \"assistant\", content: cleanResponse });\n\n // Log interaction to memory (async, don't block response)\n logChatInteraction(message, cleanResponse).catch((err) =>\n console.error(chalk.dim(\" [Memory] Failed to log interaction:\"), err)\n );\n\n return cleanResponse;\n } catch (error) {\n console.error(\"Chat error:\", error);\n return `Sorry, I ran into an issue: ${(error as Error).message}`;\n }\n });\n\n const url = await server.start();\n\n console.log(chalk.green(`\\n✓ Chat interface started at ${chalk.bold(url)}\\n`));\n console.log(chalk.dim(`Press Ctrl+C to stop the server\\n`));\n\n // Open browser\n openBrowser(url);\n\n // Start autonomous heartbeat in background\n try {\n const { hasLLMKey } = await import(\"../runtime/llm.js\");\n if (hasLLMKey()) {\n runNarratedHeartbeat(server).catch((err) => {\n console.error(chalk.red(`Heartbeat failed to start: ${err}`));\n });\n } else {\n console.log(chalk.yellow(\" [Agent] No LLM key — autonomous heartbeat disabled. Run `spora llm set --provider <provider>` to enable.\"));\n server.pushActivity(\"status\", \"No LLM API key configured. Autonomous mode disabled.\");\n }\n } catch (err) {\n console.error(chalk.red(`Heartbeat failed to start: ${err}`));\n }\n\n // Keep process alive\n process.on(\"SIGINT\", () => {\n console.log(chalk.yellow(\"\\n\\nStopping chat server...\"));\n server.stop();\n process.exit(0);\n });\n\n // Return the server instance for external control\n return server;\n}\n\n/**\n * Open URL in a separate browser window (app-like)\n */\nfunction openBrowser(url: string) {\n const platform = process.platform;\n\n try {\n if (platform === \"darwin\") {\n // Open as a standalone Chrome app window (smaller, separate from existing tabs)\n try {\n execSync(`open -na \"Google Chrome\" --args --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n // Fallback: try Chromium-based browsers, then default\n try {\n execSync(`open -na \"Brave Browser\" --args --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n execSync(`open \"${url}\"`, { stdio: \"ignore\" });\n }\n }\n } else if (platform === \"win32\") {\n try {\n execSync(`start chrome --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n execSync(`start \"\" \"${url}\"`, { stdio: \"ignore\" });\n }\n } else {\n // Linux\n try {\n execSync(`google-chrome --app=\"${url}\" --window-size=500,700`, { stdio: \"ignore\" });\n } catch {\n execSync(`xdg-open \"${url}\"`, { stdio: \"ignore\" });\n }\n }\n } catch (error) {\n // Browser couldn't be opened, that's okay\n console.log(chalk.dim(`(Couldn't open browser automatically - please visit ${url} manually)`));\n }\n}\n\nexport { openBrowser };\n"],"mappings":";;;;;;AAKA,OAAO,UAAU;AACjB,SAAS,WAAW;AACpB,SAAS,oBAAoB;AAC7B,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAE9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,QAAQ,UAAU;AA6B7B,IAAM,gBAAN,MAAoB;AAAA,EACjB,SAA6B;AAAA,EAC7B;AAAA,EACA,WAA0B,CAAC;AAAA,EAC3B,aAA8B,CAAC;AAAA,EAC/B,cAAgC,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EAER,YAAY,OAAO,MAAM;AACvB,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,YAAY,UAAyB;AACnC,SAAK,WAAW;AAAA,EAClB;AAAA,EAEA,kBAAkB,SAA+C;AAC/D,SAAK,gBAAgB;AAAA,EACvB;AAAA;AAAA,EAGA,aAAa,MAA6B,SAAiB;AACzD,SAAK,WAAW,KAAK,EAAE,MAAM,SAAS,WAAW,KAAK,IAAI,EAAE,CAAC;AAC7D,QAAI,KAAK,WAAW,SAAS,KAAK;AAChC,WAAK,aAAa,KAA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iBAAS,uBAAuB,GAAG,2BAA2B,EAAE,OAAO,SAAS,CAAC;AAAA,MACnF,QAAQ;AACN,iBAAS,aAAa,GAAG,KAAK,EAAE,OAAO,SAAS,CAAC;AAAA,MACnD;AAAA,IACF,OAAO;AAEL,UAAI;AACF,iBAAS,wBAAwB,GAAG,2BAA2B,EAAE,OAAO,SAAS,CAAC;AAAA,MACpF,QAAQ;AACN,iBAAS,aAAa,GAAG,KAAK,EAAE,OAAO,SAAS,CAAC;AAAA,MACnD;AAAA,IACF;AAAA,EACF,SAAS,OAAO;AAEd,YAAQ,IAAI,MAAM,IAAI,uDAAuD,GAAG,YAAY,CAAC;AAAA,EAC/F;AACF;","names":["loadIdentity"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getXClient,
|
|
3
|
+
resetXClient
|
|
4
|
+
} from "./chunk-E5NR6HT4.js";
|
|
5
|
+
import "./chunk-NPV3OV2K.js";
|
|
6
|
+
import "./chunk-NO3NQN67.js";
|
|
7
|
+
import "./chunk-3RYCUGXE.js";
|
|
8
|
+
export {
|
|
9
|
+
getXClient,
|
|
10
|
+
resetXClient
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=x-client-GY6XSPK6.js.map
|