@runfusion/fusion 0.14.0 → 0.14.2
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/bin.js +277 -105
- package/dist/client/assets/{AgentDetailView-CBFUveyO.js → AgentDetailView-C2Iik3Qf.js} +1 -1
- package/dist/client/assets/{AgentsView-DPezXQ-U.js → AgentsView-DkX0tzrN.js} +3 -3
- package/dist/client/assets/ChatView-CEm2Hw6m.js +1 -0
- package/dist/client/assets/{DevServerView-Daft4YFc.js → DevServerView-Bumvo_ge.js} +1 -1
- package/dist/client/assets/{DirectoryPicker-rew1y6qO.js → DirectoryPicker-CXN11cBp.js} +1 -1
- package/dist/client/assets/{DocumentsView-i72qJzwd.js → DocumentsView-B71IqAxA.js} +1 -1
- package/dist/client/assets/{InsightsView-BL5eZJ0a.js → InsightsView-Bs4Rldu6.js} +1 -1
- package/dist/client/assets/{MemoryView-pl8Cdg_p.js → MemoryView-Bs7b_L2Q.js} +1 -1
- package/dist/client/assets/{NodesView-D6eJ15zc.js → NodesView-BvAGTXbO.js} +1 -1
- package/dist/client/assets/{PiExtensionsManager-ExInwXWP.js → PiExtensionsManager-3Kcc4uhA.js} +2 -2
- package/dist/client/assets/PluginManager-Ch-Xynlm.js +1 -0
- package/dist/client/assets/PluginManager-DA_T0GHn.css +1 -0
- package/dist/client/assets/{ResearchView-B_QPUEjB.js → ResearchView-Bj6Saqf6.js} +1 -1
- package/dist/client/assets/{RoadmapsView-DBNLaEsK.js → RoadmapsView-9qT8Vwd0.js} +1 -1
- package/dist/client/assets/{SettingsModal-CL_gWmOj.js → SettingsModal-D4ERGQNQ.js} +1 -1
- package/dist/client/assets/SettingsModal-Zo5qDGOq.js +31 -0
- package/dist/client/assets/{SetupWizardModal-CLkY9HFL.js → SetupWizardModal-Dv0rX2_o.js} +1 -1
- package/dist/client/assets/{SkillMultiselect-B0qi32SQ.js → SkillMultiselect-CSkXQzdv.js} +1 -1
- package/dist/client/assets/{SkillsView-umVjRq6o.js → SkillsView-2srXMOzj.js} +1 -1
- package/dist/client/assets/TodoView-CxPPIvw2.js +6 -0
- package/dist/client/assets/{folder-open-nYPrL1W3.js → folder-open-FA1PwpXV.js} +1 -1
- package/dist/client/assets/{index-Bc8nfKeH.js → index-CEavim6l.js} +150 -149
- package/dist/client/assets/index-D1gTSlYB.css +1 -0
- package/dist/client/assets/{list-checks-sK8xJeH_.js → list-checks-6EktkUso.js} +1 -1
- package/dist/client/assets/{star-BRtXbYkB.js → star-B6Th07jw.js} +1 -1
- package/dist/client/assets/{upload-BP60eBwN.js → upload-BJwuErhV.js} +1 -1
- package/dist/client/assets/{users-qSGAX2Pf.js → users-BrnPTF8H.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/client/version.json +1 -1
- package/dist/extension.js +273 -101
- package/dist/pi-claude-cli/package.json +1 -1
- package/dist/pi-claude-cli/src/__tests__/event-bridge.test.ts +107 -0
- package/dist/pi-claude-cli/src/event-bridge.ts +48 -4
- package/package.json +1 -1
- package/skill/fusion/references/engine-tools.md +0 -1
- package/dist/client/assets/ChatView-5N4-EuhD.js +0 -1
- package/dist/client/assets/PluginManager-CYhtxHun.js +0 -1
- package/dist/client/assets/PluginManager-jyNkJZSz.css +0 -1
- package/dist/client/assets/SettingsModal-1ET586M3.js +0 -31
- package/dist/client/assets/TodoView-CFifSvrD.js +0 -6
- package/dist/client/assets/index-C1prPuSl.css +0 -1
package/dist/client/index.html
CHANGED
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
}
|
|
93
93
|
})();
|
|
94
94
|
</script>
|
|
95
|
-
<script type="module" crossorigin src="/assets/index-
|
|
95
|
+
<script type="module" crossorigin src="/assets/index-CEavim6l.js"></script>
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-K0fH_qHe.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/vendor-xterm-DzcZoU0P.js">
|
|
98
98
|
<link rel="stylesheet" crossorigin href="/assets/vendor-xterm-LZoznX6r.css">
|
|
99
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
99
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D1gTSlYB.css">
|
|
100
100
|
</head>
|
|
101
101
|
<body>
|
|
102
102
|
<div id="root"></div>
|
package/dist/client/version.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"monmfp1r-d0470197"}
|
package/dist/extension.js
CHANGED
|
@@ -10371,7 +10371,7 @@ function validatePluginManifest(manifest) {
|
|
|
10371
10371
|
const m = manifest;
|
|
10372
10372
|
if (!m.id || typeof m.id !== "string" || m.id.trim() === "") {
|
|
10373
10373
|
errors.push("id is required and must be a non-empty string");
|
|
10374
|
-
} else if (
|
|
10374
|
+
} else if (!SLUG_PATTERN.test(m.id)) {
|
|
10375
10375
|
errors.push("id must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)");
|
|
10376
10376
|
}
|
|
10377
10377
|
if (!m.name || typeof m.name !== "string" || m.name.trim() === "") {
|
|
@@ -10424,7 +10424,7 @@ function validatePluginManifest(manifest) {
|
|
|
10424
10424
|
const runtime = m.runtime;
|
|
10425
10425
|
if (!runtime.runtimeId || typeof runtime.runtimeId !== "string" || runtime.runtimeId.trim() === "") {
|
|
10426
10426
|
errors.push("runtime.runtimeId is required and must be a non-empty string");
|
|
10427
|
-
} else if (
|
|
10427
|
+
} else if (!SLUG_PATTERN.test(runtime.runtimeId)) {
|
|
10428
10428
|
errors.push("runtime.runtimeId must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)");
|
|
10429
10429
|
}
|
|
10430
10430
|
if (!runtime.name || typeof runtime.name !== "string" || runtime.name.trim() === "") {
|
|
@@ -10439,14 +10439,93 @@ function validatePluginManifest(manifest) {
|
|
|
10439
10439
|
}
|
|
10440
10440
|
}
|
|
10441
10441
|
}
|
|
10442
|
+
if (m.skills !== void 0) {
|
|
10443
|
+
if (!Array.isArray(m.skills)) {
|
|
10444
|
+
errors.push("skills must be an array");
|
|
10445
|
+
} else {
|
|
10446
|
+
for (const [index, skill] of m.skills.entries()) {
|
|
10447
|
+
if (!skill || typeof skill !== "object") {
|
|
10448
|
+
errors.push(`skills[${index}] must be an object`);
|
|
10449
|
+
continue;
|
|
10450
|
+
}
|
|
10451
|
+
const skillMeta = skill;
|
|
10452
|
+
if (!skillMeta.skillId || typeof skillMeta.skillId !== "string" || skillMeta.skillId.trim() === "") {
|
|
10453
|
+
errors.push(`skills[${index}].skillId is required and must be a non-empty string`);
|
|
10454
|
+
} else if (!SLUG_PATTERN.test(skillMeta.skillId)) {
|
|
10455
|
+
errors.push(`skills[${index}].skillId must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)`);
|
|
10456
|
+
}
|
|
10457
|
+
if (!skillMeta.name || typeof skillMeta.name !== "string" || skillMeta.name.trim() === "") {
|
|
10458
|
+
errors.push(`skills[${index}].name is required and must be a non-empty string`);
|
|
10459
|
+
}
|
|
10460
|
+
}
|
|
10461
|
+
}
|
|
10462
|
+
}
|
|
10463
|
+
if (m.workflowSteps !== void 0) {
|
|
10464
|
+
if (!Array.isArray(m.workflowSteps)) {
|
|
10465
|
+
errors.push("workflowSteps must be an array");
|
|
10466
|
+
} else {
|
|
10467
|
+
for (const [index, step] of m.workflowSteps.entries()) {
|
|
10468
|
+
if (!step || typeof step !== "object") {
|
|
10469
|
+
errors.push(`workflowSteps[${index}] must be an object`);
|
|
10470
|
+
continue;
|
|
10471
|
+
}
|
|
10472
|
+
const stepMeta = step;
|
|
10473
|
+
if (!stepMeta.stepId || typeof stepMeta.stepId !== "string" || stepMeta.stepId.trim() === "") {
|
|
10474
|
+
errors.push(`workflowSteps[${index}].stepId is required and must be a non-empty string`);
|
|
10475
|
+
} else if (!SLUG_PATTERN.test(stepMeta.stepId)) {
|
|
10476
|
+
errors.push(`workflowSteps[${index}].stepId must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)`);
|
|
10477
|
+
}
|
|
10478
|
+
if (!stepMeta.name || typeof stepMeta.name !== "string" || stepMeta.name.trim() === "") {
|
|
10479
|
+
errors.push(`workflowSteps[${index}].name is required and must be a non-empty string`);
|
|
10480
|
+
}
|
|
10481
|
+
if (stepMeta.mode !== void 0 && (typeof stepMeta.mode !== "string" || !["prompt", "script"].includes(stepMeta.mode))) {
|
|
10482
|
+
errors.push(`workflowSteps[${index}].mode must be one of: prompt, script`);
|
|
10483
|
+
}
|
|
10484
|
+
}
|
|
10485
|
+
}
|
|
10486
|
+
}
|
|
10487
|
+
if (m.promptSurfaces !== void 0) {
|
|
10488
|
+
if (!Array.isArray(m.promptSurfaces)) {
|
|
10489
|
+
errors.push("promptSurfaces must be an array");
|
|
10490
|
+
} else {
|
|
10491
|
+
for (const [index, surface] of m.promptSurfaces.entries()) {
|
|
10492
|
+
if (typeof surface !== "string" || !PROMPT_CONTRIBUTION_SURFACES.includes(surface)) {
|
|
10493
|
+
errors.push(`promptSurfaces[${index}] must be one of: ${PROMPT_CONTRIBUTION_SURFACES.join(", ")}`);
|
|
10494
|
+
}
|
|
10495
|
+
}
|
|
10496
|
+
}
|
|
10497
|
+
}
|
|
10498
|
+
if (m.setup !== void 0) {
|
|
10499
|
+
if (typeof m.setup !== "object" || m.setup === null) {
|
|
10500
|
+
errors.push("setup must be an object");
|
|
10501
|
+
} else {
|
|
10502
|
+
const setup = m.setup;
|
|
10503
|
+
if (!setup.binaryName || typeof setup.binaryName !== "string" || setup.binaryName.trim() === "") {
|
|
10504
|
+
errors.push("setup.binaryName is required and must be a non-empty string");
|
|
10505
|
+
}
|
|
10506
|
+
if (!setup.description || typeof setup.description !== "string" || setup.description.trim() === "") {
|
|
10507
|
+
errors.push("setup.description is required and must be a non-empty string");
|
|
10508
|
+
}
|
|
10509
|
+
if (setup.channel !== void 0 && (typeof setup.channel !== "string" || !SETUP_CHANNELS.includes(setup.channel))) {
|
|
10510
|
+
errors.push(`setup.channel must be one of: ${SETUP_CHANNELS.join(", ")}`);
|
|
10511
|
+
}
|
|
10512
|
+
if (setup.defaultTimeoutMs !== void 0 && (typeof setup.defaultTimeoutMs !== "number" || !Number.isFinite(setup.defaultTimeoutMs) || setup.defaultTimeoutMs <= 0)) {
|
|
10513
|
+
errors.push("setup.defaultTimeoutMs must be a positive finite number");
|
|
10514
|
+
}
|
|
10515
|
+
}
|
|
10516
|
+
}
|
|
10442
10517
|
return {
|
|
10443
10518
|
valid: errors.length === 0,
|
|
10444
10519
|
errors
|
|
10445
10520
|
};
|
|
10446
10521
|
}
|
|
10522
|
+
var SLUG_PATTERN, PROMPT_CONTRIBUTION_SURFACES, SETUP_CHANNELS;
|
|
10447
10523
|
var init_plugin_types = __esm({
|
|
10448
10524
|
"../core/src/plugin-types.ts"() {
|
|
10449
10525
|
"use strict";
|
|
10526
|
+
SLUG_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
|
|
10527
|
+
PROMPT_CONTRIBUTION_SURFACES = ["executor-system", "executor-task", "triage", "reviewer", "heartbeat"];
|
|
10528
|
+
SETUP_CHANNELS = ["stable", "beta", "nightly"];
|
|
10450
10529
|
}
|
|
10451
10530
|
});
|
|
10452
10531
|
|
|
@@ -37412,6 +37491,60 @@ var init_plugin_loader = __esm({
|
|
|
37412
37491
|
}
|
|
37413
37492
|
return runtimes;
|
|
37414
37493
|
}
|
|
37494
|
+
/**
|
|
37495
|
+
* Get all skill contributions from loaded plugins.
|
|
37496
|
+
*/
|
|
37497
|
+
getPluginSkills() {
|
|
37498
|
+
const skills = [];
|
|
37499
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37500
|
+
if (plugin4.skills) {
|
|
37501
|
+
for (const skill of plugin4.skills) {
|
|
37502
|
+
skills.push({ pluginId, skill });
|
|
37503
|
+
}
|
|
37504
|
+
}
|
|
37505
|
+
}
|
|
37506
|
+
return skills;
|
|
37507
|
+
}
|
|
37508
|
+
/**
|
|
37509
|
+
* Get all workflow step contributions from loaded plugins.
|
|
37510
|
+
*/
|
|
37511
|
+
getPluginWorkflowSteps() {
|
|
37512
|
+
const steps = [];
|
|
37513
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37514
|
+
if (plugin4.workflowSteps) {
|
|
37515
|
+
for (const step of plugin4.workflowSteps) {
|
|
37516
|
+
steps.push({ pluginId, step });
|
|
37517
|
+
}
|
|
37518
|
+
}
|
|
37519
|
+
}
|
|
37520
|
+
return steps;
|
|
37521
|
+
}
|
|
37522
|
+
/**
|
|
37523
|
+
* Get all prompt contributions from loaded plugins.
|
|
37524
|
+
*/
|
|
37525
|
+
getPluginPromptContributions() {
|
|
37526
|
+
const contributions = [];
|
|
37527
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37528
|
+
if (plugin4.promptContributions) {
|
|
37529
|
+
for (const contribution of plugin4.promptContributions.contributions) {
|
|
37530
|
+
contributions.push({ pluginId, contribution, config: plugin4.promptContributions });
|
|
37531
|
+
}
|
|
37532
|
+
}
|
|
37533
|
+
}
|
|
37534
|
+
return contributions;
|
|
37535
|
+
}
|
|
37536
|
+
/**
|
|
37537
|
+
* Get all setup metadata and hooks from loaded plugins.
|
|
37538
|
+
*/
|
|
37539
|
+
getPluginSetupInfo() {
|
|
37540
|
+
const setups = [];
|
|
37541
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37542
|
+
if (plugin4.setup) {
|
|
37543
|
+
setups.push({ pluginId, manifest: plugin4.setup.manifest, hooks: plugin4.setup.hooks });
|
|
37544
|
+
}
|
|
37545
|
+
}
|
|
37546
|
+
return setups;
|
|
37547
|
+
}
|
|
37415
37548
|
/**
|
|
37416
37549
|
* Get all loaded plugin instances.
|
|
37417
37550
|
*/
|
|
@@ -53221,11 +53354,8 @@ async function createFnAgent2(options) {
|
|
|
53221
53354
|
const createSessionWithModel = async (modelOverride) => {
|
|
53222
53355
|
const customToolList = [
|
|
53223
53356
|
...wrappedTools,
|
|
53224
|
-
...
|
|
53357
|
+
...options.customTools ?? []
|
|
53225
53358
|
];
|
|
53226
|
-
if (isReadonly && (options.customTools?.length ?? 0) > 0) {
|
|
53227
|
-
piLog.log(`readonly session \u2014 customTools (${options.customTools.length}) skipped`);
|
|
53228
|
-
}
|
|
53229
53359
|
if (options.beforeSpawnSession) {
|
|
53230
53360
|
await options.beforeSpawnSession();
|
|
53231
53361
|
}
|
|
@@ -55343,65 +55473,6 @@ ${lines.join("\n")}`
|
|
|
55343
55473
|
}
|
|
55344
55474
|
};
|
|
55345
55475
|
}
|
|
55346
|
-
function createIdentityTool({ agent, resolvedInstructions }) {
|
|
55347
|
-
const identityParams = Type.Object({});
|
|
55348
|
-
return {
|
|
55349
|
-
name: "fn_identity",
|
|
55350
|
-
label: "Identity Check",
|
|
55351
|
-
description: "Return a structured summary of which soul, instructions, and memory are loaded for this heartbeat tick. Call this FIRST before any other tool.",
|
|
55352
|
-
parameters: identityParams,
|
|
55353
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55354
|
-
execute: async (_id, _params, _signal, _onUpdate, _ctx) => {
|
|
55355
|
-
const PREVIEW_CHARS = 500;
|
|
55356
|
-
const INSTRUCTIONS_PREVIEW_CHARS = 1e3;
|
|
55357
|
-
const MEMORY_PREVIEW_CHARS = 1e3;
|
|
55358
|
-
const soulPresent = typeof agent.soul === "string" && agent.soul.trim().length > 0;
|
|
55359
|
-
const instructionsPresent = resolvedInstructions.trim().length > 0;
|
|
55360
|
-
const memoryPresent = typeof agent.memory === "string" && agent.memory.trim().length > 0;
|
|
55361
|
-
const soulPreview = soulPresent ? agent.soul.slice(0, PREVIEW_CHARS) : "";
|
|
55362
|
-
const instructionsPreview = instructionsPresent ? resolvedInstructions.slice(0, INSTRUCTIONS_PREVIEW_CHARS) : "";
|
|
55363
|
-
const memoryPreview = memoryPresent ? agent.memory.slice(0, MEMORY_PREVIEW_CHARS) : "";
|
|
55364
|
-
const result = {
|
|
55365
|
-
agentId: agent.id,
|
|
55366
|
-
name: agent.name,
|
|
55367
|
-
role: agent.role,
|
|
55368
|
-
soulPresent,
|
|
55369
|
-
instructionsPresent,
|
|
55370
|
-
memoryPresent,
|
|
55371
|
-
soulPreview,
|
|
55372
|
-
instructionsPreview,
|
|
55373
|
-
memoryPreview
|
|
55374
|
-
};
|
|
55375
|
-
const lines = [
|
|
55376
|
-
`agentId: ${result.agentId}`,
|
|
55377
|
-
`name: ${result.name}`,
|
|
55378
|
-
`role: ${result.role}`,
|
|
55379
|
-
`soul: ${result.soulPresent ? "loaded" : "absent"}`,
|
|
55380
|
-
`instructions: ${result.instructionsPresent ? "loaded" : "absent"}`,
|
|
55381
|
-
`memory: ${result.memoryPresent ? "loaded" : "absent"}`
|
|
55382
|
-
];
|
|
55383
|
-
if (result.soulPresent && result.soulPreview) {
|
|
55384
|
-
lines.push(`
|
|
55385
|
-
Soul preview (first ${PREVIEW_CHARS} chars):
|
|
55386
|
-
${result.soulPreview}`);
|
|
55387
|
-
}
|
|
55388
|
-
if (result.instructionsPresent && result.instructionsPreview) {
|
|
55389
|
-
lines.push(`
|
|
55390
|
-
Instructions preview (first ${INSTRUCTIONS_PREVIEW_CHARS} chars):
|
|
55391
|
-
${result.instructionsPreview}`);
|
|
55392
|
-
}
|
|
55393
|
-
if (result.memoryPresent && result.memoryPreview) {
|
|
55394
|
-
lines.push(`
|
|
55395
|
-
Memory preview (first ${MEMORY_PREVIEW_CHARS} chars):
|
|
55396
|
-
${result.memoryPreview}`);
|
|
55397
|
-
}
|
|
55398
|
-
return {
|
|
55399
|
-
content: [{ type: "text", text: lines.join("\n") }],
|
|
55400
|
-
details: result
|
|
55401
|
-
};
|
|
55402
|
-
}
|
|
55403
|
-
};
|
|
55404
|
-
}
|
|
55405
55476
|
var taskCreateParams, taskLogParams, taskDocumentWriteParams, taskDocumentReadParams, reflectOnPerformanceParams, listAgentsParams, delegateTaskParams, sendMessageParams, readMessagesParams, memorySearchParams, memoryGetParams, researchRunParams, researchListParams, researchGetParams, researchCancelParams, memoryAppendParams, log10, AGENT_MEMORY_ROOT2, AGENT_MEMORY_FILENAME2, AGENT_DREAMS_FILENAME2, agentQmdRefreshState, AGENT_QMD_REFRESH_INTERVAL_MS, DAILY_AGENT_MEMORY_RE2;
|
|
55406
55477
|
var init_agent_tools = __esm({
|
|
55407
55478
|
"../engine/src/agent-tools.ts"() {
|
|
@@ -71907,6 +71978,7 @@ Rules:
|
|
|
71907
71978
|
|
|
71908
71979
|
// ../engine/src/agent-heartbeat.ts
|
|
71909
71980
|
import { Type as Type6 } from "@mariozechner/pi-ai";
|
|
71981
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
71910
71982
|
function isBlockedStateDuplicate(current, previous) {
|
|
71911
71983
|
return current.blockedBy === previous.blockedBy && current.contextHash === previous.contextHash;
|
|
71912
71984
|
}
|
|
@@ -71916,39 +71988,30 @@ function truncatePrompt(text, maxChars) {
|
|
|
71916
71988
|
|
|
71917
71989
|
... (truncated, ${text.length} chars)`;
|
|
71918
71990
|
}
|
|
71991
|
+
function shortContentHash(value) {
|
|
71992
|
+
return createHash5("sha256").update(value).digest("hex").slice(0, 8);
|
|
71993
|
+
}
|
|
71919
71994
|
function buildIdentitySnapshot(args) {
|
|
71920
71995
|
const { agent, resolvedInstructions } = args;
|
|
71921
|
-
const
|
|
71922
|
-
const
|
|
71923
|
-
const
|
|
71924
|
-
const
|
|
71925
|
-
|
|
71926
|
-
|
|
71927
|
-
|
|
71996
|
+
const soulTrimmed = typeof agent.soul === "string" ? agent.soul.trim() : "";
|
|
71997
|
+
const instrTrimmed = resolvedInstructions.trim();
|
|
71998
|
+
const memTrimmed = typeof agent.memory === "string" ? agent.memory.trim() : "";
|
|
71999
|
+
const formatField = (trimmed) => {
|
|
72000
|
+
if (!trimmed) return "absent";
|
|
72001
|
+
return `loaded (${trimmed.length} chars, sha256:${shortContentHash(trimmed)})`;
|
|
72002
|
+
};
|
|
72003
|
+
return [
|
|
71928
72004
|
"## Identity Snapshot",
|
|
71929
72005
|
"",
|
|
71930
|
-
"
|
|
72006
|
+
"Full content is in the Custom Instructions section of your system prompt. Surface anomalies in your first text output before acting.",
|
|
71931
72007
|
"",
|
|
71932
72008
|
`- agentId: ${agent.id}`,
|
|
71933
72009
|
`- name: ${agent.name}`,
|
|
71934
72010
|
`- role: ${agent.role}`,
|
|
71935
|
-
`- soul: ${
|
|
71936
|
-
`- instructions: ${
|
|
71937
|
-
`- memory: ${
|
|
71938
|
-
];
|
|
71939
|
-
if (soulPresent) {
|
|
71940
|
-
const preview = agent.soul.trim().slice(0, SOUL_PREVIEW);
|
|
71941
|
-
lines.push("", `### Soul (first ${SOUL_PREVIEW} chars)`, preview);
|
|
71942
|
-
}
|
|
71943
|
-
if (instrPresent) {
|
|
71944
|
-
const preview = resolvedInstructions.trim().slice(0, INSTR_PREVIEW);
|
|
71945
|
-
lines.push("", `### Instructions (first ${INSTR_PREVIEW} chars)`, preview);
|
|
71946
|
-
}
|
|
71947
|
-
if (memPresent) {
|
|
71948
|
-
const preview = agent.memory.trim().slice(0, MEM_PREVIEW);
|
|
71949
|
-
lines.push("", `### Memory (first ${MEM_PREVIEW} chars)`, preview);
|
|
71950
|
-
}
|
|
71951
|
-
return lines.join("\n");
|
|
72011
|
+
`- soul: ${formatField(soulTrimmed)}`,
|
|
72012
|
+
`- instructions: ${formatField(instrTrimmed)}`,
|
|
72013
|
+
`- memory: ${formatField(memTrimmed)}`
|
|
72014
|
+
].join("\n");
|
|
71952
72015
|
}
|
|
71953
72016
|
async function getHeartbeatMemorySettings(taskStore) {
|
|
71954
72017
|
const maybeGetSettings = taskStore.getSettings;
|
|
@@ -72130,9 +72193,8 @@ When sending messages:
|
|
|
72130
72193
|
1. **Identity & context** \u2014 review the **Identity Snapshot** at the top of
|
|
72131
72194
|
this prompt. Confirm your role, soul, instructions, and memory match what
|
|
72132
72195
|
you expect, and surface any anomalies in your first text output before
|
|
72133
|
-
doing anything else.
|
|
72134
|
-
|
|
72135
|
-
authoritative source.)
|
|
72196
|
+
doing anything else. The full content is in the Custom Instructions
|
|
72197
|
+
section of your system prompt.
|
|
72136
72198
|
2. **Inbox** \u2014 when fn_read_messages is available, call it. Process any pending
|
|
72137
72199
|
messages first; reply with reply_to_message_id when answering.
|
|
72138
72200
|
3. **Wake delta** \u2014 read the Wake Delta block above. The wake reason is the
|
|
@@ -72158,9 +72220,8 @@ a bug. Do not loop on the same plan across heartbeats without recording why.`;
|
|
|
72158
72220
|
1. **Identity & context** \u2014 review the **Identity Snapshot** at the top of
|
|
72159
72221
|
this prompt. Confirm your role, soul, instructions, and memory match what
|
|
72160
72222
|
you expect, and surface any anomalies in your first text output before
|
|
72161
|
-
doing anything else.
|
|
72162
|
-
|
|
72163
|
-
authoritative source.)
|
|
72223
|
+
doing anything else. The full content is in the Custom Instructions
|
|
72224
|
+
section of your system prompt.
|
|
72164
72225
|
2. **Inbox** \u2014 when fn_read_messages is available, call it. Process any pending
|
|
72165
72226
|
messages first; reply with reply_to_message_id when answering.
|
|
72166
72227
|
3. **Wake delta** \u2014 read the Wake Delta block above. The wake reason is the
|
|
@@ -72962,7 +73023,6 @@ not loop on the same plan across heartbeats without recording why.`;
|
|
|
72962
73023
|
baseHeartbeatSystemPrompt,
|
|
72963
73024
|
[resolvedInstructionsForIdentity, memoryInstructions].filter((part) => part.trim()).join("\n\n")
|
|
72964
73025
|
);
|
|
72965
|
-
heartbeatTools.push(createIdentityTool({ agent, resolvedInstructions: resolvedInstructionsForIdentity }));
|
|
72966
73026
|
heartbeatTools.push(heartbeatDoneTool);
|
|
72967
73027
|
if (isNoTaskRun) {
|
|
72968
73028
|
agentLogger = new AgentLogger({
|
|
@@ -77816,10 +77876,18 @@ var init_plugin_runner = __esm({
|
|
|
77816
77876
|
cachedRoutes = null;
|
|
77817
77877
|
cachedUiSlots = null;
|
|
77818
77878
|
cachedRuntimes = null;
|
|
77879
|
+
cachedSkills = null;
|
|
77880
|
+
cachedWorkflowSteps = null;
|
|
77881
|
+
cachedPromptContributions = null;
|
|
77882
|
+
cachedSetupInfo = null;
|
|
77819
77883
|
toolsCacheVersion = 0;
|
|
77820
77884
|
routesCacheVersion = 0;
|
|
77821
77885
|
uiSlotsCacheVersion = 0;
|
|
77822
77886
|
runtimesCacheVersion = 0;
|
|
77887
|
+
skillsCacheVersion = 0;
|
|
77888
|
+
workflowStepsCacheVersion = 0;
|
|
77889
|
+
promptContributionsCacheVersion = 0;
|
|
77890
|
+
setupCacheVersion = 0;
|
|
77823
77891
|
hookTimeoutMs;
|
|
77824
77892
|
// Event handler references for cleanup
|
|
77825
77893
|
handlePluginEnabled;
|
|
@@ -77851,6 +77919,10 @@ var init_plugin_runner = __esm({
|
|
|
77851
77919
|
this.invalidateRoutesCache();
|
|
77852
77920
|
this.invalidateUiSlotsCache();
|
|
77853
77921
|
this.invalidateRuntimesCache();
|
|
77922
|
+
this.invalidateSkillsCache();
|
|
77923
|
+
this.invalidateWorkflowStepsCache();
|
|
77924
|
+
this.invalidatePromptContributionsCache();
|
|
77925
|
+
this.invalidateSetupCache();
|
|
77854
77926
|
}
|
|
77855
77927
|
/**
|
|
77856
77928
|
* Shutdown the plugin runner.
|
|
@@ -77931,6 +78003,54 @@ var init_plugin_runner = __esm({
|
|
|
77931
78003
|
}
|
|
77932
78004
|
return this.cachedRuntimes.runtimes;
|
|
77933
78005
|
}
|
|
78006
|
+
getPluginSkills() {
|
|
78007
|
+
if (!this.cachedSkills || this.cachedSkills.version !== this.skillsCacheVersion) {
|
|
78008
|
+
this.cachedSkills = {
|
|
78009
|
+
skills: this.options.pluginLoader.getPluginSkills(),
|
|
78010
|
+
version: this.skillsCacheVersion
|
|
78011
|
+
};
|
|
78012
|
+
}
|
|
78013
|
+
return this.cachedSkills.skills;
|
|
78014
|
+
}
|
|
78015
|
+
getPluginWorkflowSteps() {
|
|
78016
|
+
if (!this.cachedWorkflowSteps || this.cachedWorkflowSteps.version !== this.workflowStepsCacheVersion) {
|
|
78017
|
+
this.cachedWorkflowSteps = {
|
|
78018
|
+
steps: this.options.pluginLoader.getPluginWorkflowSteps(),
|
|
78019
|
+
version: this.workflowStepsCacheVersion
|
|
78020
|
+
};
|
|
78021
|
+
}
|
|
78022
|
+
return this.cachedWorkflowSteps.steps;
|
|
78023
|
+
}
|
|
78024
|
+
getPluginPromptContributions() {
|
|
78025
|
+
if (!this.cachedPromptContributions || this.cachedPromptContributions.version !== this.promptContributionsCacheVersion) {
|
|
78026
|
+
this.cachedPromptContributions = {
|
|
78027
|
+
contributions: this.options.pluginLoader.getPluginPromptContributions(),
|
|
78028
|
+
version: this.promptContributionsCacheVersion
|
|
78029
|
+
};
|
|
78030
|
+
}
|
|
78031
|
+
return this.cachedPromptContributions.contributions;
|
|
78032
|
+
}
|
|
78033
|
+
getPluginSetupInfo() {
|
|
78034
|
+
if (!this.cachedSetupInfo || this.cachedSetupInfo.version !== this.setupCacheVersion) {
|
|
78035
|
+
this.cachedSetupInfo = {
|
|
78036
|
+
setups: this.options.pluginLoader.getPluginSetupInfo(),
|
|
78037
|
+
version: this.setupCacheVersion
|
|
78038
|
+
};
|
|
78039
|
+
}
|
|
78040
|
+
return this.cachedSetupInfo.setups;
|
|
78041
|
+
}
|
|
78042
|
+
getPromptContributionsForSurface(surface) {
|
|
78043
|
+
return this.getPluginPromptContributions().filter(({ pluginId, contribution, config }) => {
|
|
78044
|
+
const plugin4 = this.options.pluginLoader.getPlugin(pluginId);
|
|
78045
|
+
if (!plugin4 || plugin4.state !== "started") {
|
|
78046
|
+
return false;
|
|
78047
|
+
}
|
|
78048
|
+
if (contribution.surface !== surface) {
|
|
78049
|
+
return false;
|
|
78050
|
+
}
|
|
78051
|
+
return config.enabledByDefault !== false;
|
|
78052
|
+
});
|
|
78053
|
+
}
|
|
77934
78054
|
/**
|
|
77935
78055
|
* Get a specific runtime registration by its runtimeId.
|
|
77936
78056
|
*
|
|
@@ -77964,6 +78084,10 @@ var init_plugin_runner = __esm({
|
|
|
77964
78084
|
this.invalidateRoutesCache();
|
|
77965
78085
|
this.invalidateUiSlotsCache();
|
|
77966
78086
|
this.invalidateRuntimesCache();
|
|
78087
|
+
this.invalidateSkillsCache();
|
|
78088
|
+
this.invalidateWorkflowStepsCache();
|
|
78089
|
+
this.invalidatePromptContributionsCache();
|
|
78090
|
+
this.invalidateSetupCache();
|
|
77967
78091
|
executorLog.log(`Plugin ${pluginId} reloaded`);
|
|
77968
78092
|
}
|
|
77969
78093
|
// ── Event Handlers for Hot-Load/Unload ─────────────────────────
|
|
@@ -77975,6 +78099,10 @@ var init_plugin_runner = __esm({
|
|
|
77975
78099
|
this.invalidateRoutesCache();
|
|
77976
78100
|
this.invalidateUiSlotsCache();
|
|
77977
78101
|
this.invalidateRuntimesCache();
|
|
78102
|
+
this.invalidateSkillsCache();
|
|
78103
|
+
this.invalidateWorkflowStepsCache();
|
|
78104
|
+
this.invalidatePromptContributionsCache();
|
|
78105
|
+
this.invalidateSetupCache();
|
|
77978
78106
|
try {
|
|
77979
78107
|
executorLog.log(`Auto-loading enabled plugin: ${plugin4.id}`);
|
|
77980
78108
|
await this.options.pluginLoader.loadPlugin(plugin4.id);
|
|
@@ -77990,6 +78118,10 @@ var init_plugin_runner = __esm({
|
|
|
77990
78118
|
this.invalidateRoutesCache();
|
|
77991
78119
|
this.invalidateUiSlotsCache();
|
|
77992
78120
|
this.invalidateRuntimesCache();
|
|
78121
|
+
this.invalidateSkillsCache();
|
|
78122
|
+
this.invalidateWorkflowStepsCache();
|
|
78123
|
+
this.invalidatePromptContributionsCache();
|
|
78124
|
+
this.invalidateSetupCache();
|
|
77993
78125
|
try {
|
|
77994
78126
|
executorLog.log(`Auto-stopping disabled plugin: ${plugin4.id}`);
|
|
77995
78127
|
await this.options.pluginLoader.stopPlugin(plugin4.id);
|
|
@@ -78005,6 +78137,10 @@ var init_plugin_runner = __esm({
|
|
|
78005
78137
|
this.invalidateRoutesCache();
|
|
78006
78138
|
this.invalidateUiSlotsCache();
|
|
78007
78139
|
this.invalidateRuntimesCache();
|
|
78140
|
+
this.invalidateSkillsCache();
|
|
78141
|
+
this.invalidateWorkflowStepsCache();
|
|
78142
|
+
this.invalidatePromptContributionsCache();
|
|
78143
|
+
this.invalidateSetupCache();
|
|
78008
78144
|
try {
|
|
78009
78145
|
executorLog.log(`Stopping unregistered plugin: ${plugin4.id}`);
|
|
78010
78146
|
await this.options.pluginLoader.stopPlugin(plugin4.id);
|
|
@@ -78021,6 +78157,10 @@ var init_plugin_runner = __esm({
|
|
|
78021
78157
|
this.invalidateRoutesCache();
|
|
78022
78158
|
this.invalidateUiSlotsCache();
|
|
78023
78159
|
this.invalidateRuntimesCache();
|
|
78160
|
+
this.invalidateSkillsCache();
|
|
78161
|
+
this.invalidateWorkflowStepsCache();
|
|
78162
|
+
this.invalidatePromptContributionsCache();
|
|
78163
|
+
this.invalidateSetupCache();
|
|
78024
78164
|
}
|
|
78025
78165
|
/**
|
|
78026
78166
|
* Handle plugin updates - invalidate caches.
|
|
@@ -78030,6 +78170,10 @@ var init_plugin_runner = __esm({
|
|
|
78030
78170
|
this.invalidateRoutesCache();
|
|
78031
78171
|
this.invalidateUiSlotsCache();
|
|
78032
78172
|
this.invalidateRuntimesCache();
|
|
78173
|
+
this.invalidateSkillsCache();
|
|
78174
|
+
this.invalidateWorkflowStepsCache();
|
|
78175
|
+
this.invalidatePromptContributionsCache();
|
|
78176
|
+
this.invalidateSetupCache();
|
|
78033
78177
|
}
|
|
78034
78178
|
/**
|
|
78035
78179
|
* Handle plugin:loaded event from loader - invalidate caches.
|
|
@@ -78039,6 +78183,10 @@ var init_plugin_runner = __esm({
|
|
|
78039
78183
|
this.invalidateRoutesCache();
|
|
78040
78184
|
this.invalidateUiSlotsCache();
|
|
78041
78185
|
this.invalidateRuntimesCache();
|
|
78186
|
+
this.invalidateSkillsCache();
|
|
78187
|
+
this.invalidateWorkflowStepsCache();
|
|
78188
|
+
this.invalidatePromptContributionsCache();
|
|
78189
|
+
this.invalidateSetupCache();
|
|
78042
78190
|
}
|
|
78043
78191
|
/**
|
|
78044
78192
|
* Handle plugin:unloaded event from loader - invalidate caches.
|
|
@@ -78048,6 +78196,10 @@ var init_plugin_runner = __esm({
|
|
|
78048
78196
|
this.invalidateRoutesCache();
|
|
78049
78197
|
this.invalidateUiSlotsCache();
|
|
78050
78198
|
this.invalidateRuntimesCache();
|
|
78199
|
+
this.invalidateSkillsCache();
|
|
78200
|
+
this.invalidateWorkflowStepsCache();
|
|
78201
|
+
this.invalidatePromptContributionsCache();
|
|
78202
|
+
this.invalidateSetupCache();
|
|
78051
78203
|
}
|
|
78052
78204
|
/**
|
|
78053
78205
|
* Handle plugin:reloaded event from loader - invalidate caches.
|
|
@@ -78057,6 +78209,10 @@ var init_plugin_runner = __esm({
|
|
|
78057
78209
|
this.invalidateRoutesCache();
|
|
78058
78210
|
this.invalidateUiSlotsCache();
|
|
78059
78211
|
this.invalidateRuntimesCache();
|
|
78212
|
+
this.invalidateSkillsCache();
|
|
78213
|
+
this.invalidateWorkflowStepsCache();
|
|
78214
|
+
this.invalidatePromptContributionsCache();
|
|
78215
|
+
this.invalidateSetupCache();
|
|
78060
78216
|
}
|
|
78061
78217
|
// ── Tool Conversion ───────────────────────────────────────────────
|
|
78062
78218
|
/**
|
|
@@ -78228,6 +78384,22 @@ var init_plugin_runner = __esm({
|
|
|
78228
78384
|
this.runtimesCacheVersion++;
|
|
78229
78385
|
this.log.log(`Runtimes cache invalidated (version: ${this.runtimesCacheVersion})`);
|
|
78230
78386
|
}
|
|
78387
|
+
invalidateSkillsCache() {
|
|
78388
|
+
this.skillsCacheVersion++;
|
|
78389
|
+
this.log.log(`Skills cache invalidated (version: ${this.skillsCacheVersion})`);
|
|
78390
|
+
}
|
|
78391
|
+
invalidateWorkflowStepsCache() {
|
|
78392
|
+
this.workflowStepsCacheVersion++;
|
|
78393
|
+
this.log.log(`Workflow steps cache invalidated (version: ${this.workflowStepsCacheVersion})`);
|
|
78394
|
+
}
|
|
78395
|
+
invalidatePromptContributionsCache() {
|
|
78396
|
+
this.promptContributionsCacheVersion++;
|
|
78397
|
+
this.log.log(`Prompt contributions cache invalidated (version: ${this.promptContributionsCacheVersion})`);
|
|
78398
|
+
}
|
|
78399
|
+
invalidateSetupCache() {
|
|
78400
|
+
this.setupCacheVersion++;
|
|
78401
|
+
this.log.log(`Setup cache invalidated (version: ${this.setupCacheVersion})`);
|
|
78402
|
+
}
|
|
78231
78403
|
// ── Store Event Subscriptions ────────────────────────────────────
|
|
78232
78404
|
/**
|
|
78233
78405
|
* Subscribe to TaskStore events for task lifecycle hooks.
|
|
@@ -96670,7 +96842,7 @@ var require_websocket = __commonJS({
|
|
|
96670
96842
|
var http = __require("http");
|
|
96671
96843
|
var net = __require("net");
|
|
96672
96844
|
var tls = __require("tls");
|
|
96673
|
-
var { randomBytes: randomBytes3, createHash:
|
|
96845
|
+
var { randomBytes: randomBytes3, createHash: createHash6 } = __require("crypto");
|
|
96674
96846
|
var { Duplex, Readable } = __require("stream");
|
|
96675
96847
|
var { URL: URL2 } = __require("url");
|
|
96676
96848
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -97330,7 +97502,7 @@ var require_websocket = __commonJS({
|
|
|
97330
97502
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
97331
97503
|
return;
|
|
97332
97504
|
}
|
|
97333
|
-
const digest =
|
|
97505
|
+
const digest = createHash6("sha1").update(key + GUID).digest("base64");
|
|
97334
97506
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
97335
97507
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
97336
97508
|
return;
|
|
@@ -97697,7 +97869,7 @@ var require_websocket_server = __commonJS({
|
|
|
97697
97869
|
var EventEmitter31 = __require("events");
|
|
97698
97870
|
var http = __require("http");
|
|
97699
97871
|
var { Duplex } = __require("stream");
|
|
97700
|
-
var { createHash:
|
|
97872
|
+
var { createHash: createHash6 } = __require("crypto");
|
|
97701
97873
|
var extension2 = require_extension();
|
|
97702
97874
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
97703
97875
|
var subprotocol2 = require_subprotocol();
|
|
@@ -97998,7 +98170,7 @@ var require_websocket_server = __commonJS({
|
|
|
97998
98170
|
);
|
|
97999
98171
|
}
|
|
98000
98172
|
if (this._state > RUNNING) return abortHandshake(socket, 503);
|
|
98001
|
-
const digest =
|
|
98173
|
+
const digest = createHash6("sha1").update(key + GUID).digest("base64");
|
|
98002
98174
|
const headers = [
|
|
98003
98175
|
"HTTP/1.1 101 Switching Protocols",
|
|
98004
98176
|
"Upgrade: websocket",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusion/pi-claude-cli",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "Fusion vendored fork: pi coding-agent extension that routes LLM calls through the Claude Code CLI. Forked from rchern/pi-claude-cli (MIT). See UPSTREAM.md.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": true,
|