@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/bin.js
CHANGED
|
@@ -10373,7 +10373,7 @@ function validatePluginManifest(manifest) {
|
|
|
10373
10373
|
const m = manifest;
|
|
10374
10374
|
if (!m.id || typeof m.id !== "string" || m.id.trim() === "") {
|
|
10375
10375
|
errors.push("id is required and must be a non-empty string");
|
|
10376
|
-
} else if (
|
|
10376
|
+
} else if (!SLUG_PATTERN.test(m.id)) {
|
|
10377
10377
|
errors.push("id must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)");
|
|
10378
10378
|
}
|
|
10379
10379
|
if (!m.name || typeof m.name !== "string" || m.name.trim() === "") {
|
|
@@ -10426,7 +10426,7 @@ function validatePluginManifest(manifest) {
|
|
|
10426
10426
|
const runtime = m.runtime;
|
|
10427
10427
|
if (!runtime.runtimeId || typeof runtime.runtimeId !== "string" || runtime.runtimeId.trim() === "") {
|
|
10428
10428
|
errors.push("runtime.runtimeId is required and must be a non-empty string");
|
|
10429
|
-
} else if (
|
|
10429
|
+
} else if (!SLUG_PATTERN.test(runtime.runtimeId)) {
|
|
10430
10430
|
errors.push("runtime.runtimeId must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)");
|
|
10431
10431
|
}
|
|
10432
10432
|
if (!runtime.name || typeof runtime.name !== "string" || runtime.name.trim() === "") {
|
|
@@ -10441,14 +10441,93 @@ function validatePluginManifest(manifest) {
|
|
|
10441
10441
|
}
|
|
10442
10442
|
}
|
|
10443
10443
|
}
|
|
10444
|
+
if (m.skills !== void 0) {
|
|
10445
|
+
if (!Array.isArray(m.skills)) {
|
|
10446
|
+
errors.push("skills must be an array");
|
|
10447
|
+
} else {
|
|
10448
|
+
for (const [index2, skill] of m.skills.entries()) {
|
|
10449
|
+
if (!skill || typeof skill !== "object") {
|
|
10450
|
+
errors.push(`skills[${index2}] must be an object`);
|
|
10451
|
+
continue;
|
|
10452
|
+
}
|
|
10453
|
+
const skillMeta = skill;
|
|
10454
|
+
if (!skillMeta.skillId || typeof skillMeta.skillId !== "string" || skillMeta.skillId.trim() === "") {
|
|
10455
|
+
errors.push(`skills[${index2}].skillId is required and must be a non-empty string`);
|
|
10456
|
+
} else if (!SLUG_PATTERN.test(skillMeta.skillId)) {
|
|
10457
|
+
errors.push(`skills[${index2}].skillId must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)`);
|
|
10458
|
+
}
|
|
10459
|
+
if (!skillMeta.name || typeof skillMeta.name !== "string" || skillMeta.name.trim() === "") {
|
|
10460
|
+
errors.push(`skills[${index2}].name is required and must be a non-empty string`);
|
|
10461
|
+
}
|
|
10462
|
+
}
|
|
10463
|
+
}
|
|
10464
|
+
}
|
|
10465
|
+
if (m.workflowSteps !== void 0) {
|
|
10466
|
+
if (!Array.isArray(m.workflowSteps)) {
|
|
10467
|
+
errors.push("workflowSteps must be an array");
|
|
10468
|
+
} else {
|
|
10469
|
+
for (const [index2, step] of m.workflowSteps.entries()) {
|
|
10470
|
+
if (!step || typeof step !== "object") {
|
|
10471
|
+
errors.push(`workflowSteps[${index2}] must be an object`);
|
|
10472
|
+
continue;
|
|
10473
|
+
}
|
|
10474
|
+
const stepMeta = step;
|
|
10475
|
+
if (!stepMeta.stepId || typeof stepMeta.stepId !== "string" || stepMeta.stepId.trim() === "") {
|
|
10476
|
+
errors.push(`workflowSteps[${index2}].stepId is required and must be a non-empty string`);
|
|
10477
|
+
} else if (!SLUG_PATTERN.test(stepMeta.stepId)) {
|
|
10478
|
+
errors.push(`workflowSteps[${index2}].stepId must be a valid slug (lowercase, alphanumeric, hyphens only, cannot start or end with hyphen)`);
|
|
10479
|
+
}
|
|
10480
|
+
if (!stepMeta.name || typeof stepMeta.name !== "string" || stepMeta.name.trim() === "") {
|
|
10481
|
+
errors.push(`workflowSteps[${index2}].name is required and must be a non-empty string`);
|
|
10482
|
+
}
|
|
10483
|
+
if (stepMeta.mode !== void 0 && (typeof stepMeta.mode !== "string" || !["prompt", "script"].includes(stepMeta.mode))) {
|
|
10484
|
+
errors.push(`workflowSteps[${index2}].mode must be one of: prompt, script`);
|
|
10485
|
+
}
|
|
10486
|
+
}
|
|
10487
|
+
}
|
|
10488
|
+
}
|
|
10489
|
+
if (m.promptSurfaces !== void 0) {
|
|
10490
|
+
if (!Array.isArray(m.promptSurfaces)) {
|
|
10491
|
+
errors.push("promptSurfaces must be an array");
|
|
10492
|
+
} else {
|
|
10493
|
+
for (const [index2, surface] of m.promptSurfaces.entries()) {
|
|
10494
|
+
if (typeof surface !== "string" || !PROMPT_CONTRIBUTION_SURFACES.includes(surface)) {
|
|
10495
|
+
errors.push(`promptSurfaces[${index2}] must be one of: ${PROMPT_CONTRIBUTION_SURFACES.join(", ")}`);
|
|
10496
|
+
}
|
|
10497
|
+
}
|
|
10498
|
+
}
|
|
10499
|
+
}
|
|
10500
|
+
if (m.setup !== void 0) {
|
|
10501
|
+
if (typeof m.setup !== "object" || m.setup === null) {
|
|
10502
|
+
errors.push("setup must be an object");
|
|
10503
|
+
} else {
|
|
10504
|
+
const setup = m.setup;
|
|
10505
|
+
if (!setup.binaryName || typeof setup.binaryName !== "string" || setup.binaryName.trim() === "") {
|
|
10506
|
+
errors.push("setup.binaryName is required and must be a non-empty string");
|
|
10507
|
+
}
|
|
10508
|
+
if (!setup.description || typeof setup.description !== "string" || setup.description.trim() === "") {
|
|
10509
|
+
errors.push("setup.description is required and must be a non-empty string");
|
|
10510
|
+
}
|
|
10511
|
+
if (setup.channel !== void 0 && (typeof setup.channel !== "string" || !SETUP_CHANNELS.includes(setup.channel))) {
|
|
10512
|
+
errors.push(`setup.channel must be one of: ${SETUP_CHANNELS.join(", ")}`);
|
|
10513
|
+
}
|
|
10514
|
+
if (setup.defaultTimeoutMs !== void 0 && (typeof setup.defaultTimeoutMs !== "number" || !Number.isFinite(setup.defaultTimeoutMs) || setup.defaultTimeoutMs <= 0)) {
|
|
10515
|
+
errors.push("setup.defaultTimeoutMs must be a positive finite number");
|
|
10516
|
+
}
|
|
10517
|
+
}
|
|
10518
|
+
}
|
|
10444
10519
|
return {
|
|
10445
10520
|
valid: errors.length === 0,
|
|
10446
10521
|
errors
|
|
10447
10522
|
};
|
|
10448
10523
|
}
|
|
10524
|
+
var SLUG_PATTERN, PROMPT_CONTRIBUTION_SURFACES, SETUP_CHANNELS;
|
|
10449
10525
|
var init_plugin_types = __esm({
|
|
10450
10526
|
"../core/src/plugin-types.ts"() {
|
|
10451
10527
|
"use strict";
|
|
10528
|
+
SLUG_PATTERN = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
|
|
10529
|
+
PROMPT_CONTRIBUTION_SURFACES = ["executor-system", "executor-task", "triage", "reviewer", "heartbeat"];
|
|
10530
|
+
SETUP_CHANNELS = ["stable", "beta", "nightly"];
|
|
10452
10531
|
}
|
|
10453
10532
|
});
|
|
10454
10533
|
|
|
@@ -37414,6 +37493,60 @@ var init_plugin_loader = __esm({
|
|
|
37414
37493
|
}
|
|
37415
37494
|
return runtimes2;
|
|
37416
37495
|
}
|
|
37496
|
+
/**
|
|
37497
|
+
* Get all skill contributions from loaded plugins.
|
|
37498
|
+
*/
|
|
37499
|
+
getPluginSkills() {
|
|
37500
|
+
const skills = [];
|
|
37501
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37502
|
+
if (plugin4.skills) {
|
|
37503
|
+
for (const skill of plugin4.skills) {
|
|
37504
|
+
skills.push({ pluginId, skill });
|
|
37505
|
+
}
|
|
37506
|
+
}
|
|
37507
|
+
}
|
|
37508
|
+
return skills;
|
|
37509
|
+
}
|
|
37510
|
+
/**
|
|
37511
|
+
* Get all workflow step contributions from loaded plugins.
|
|
37512
|
+
*/
|
|
37513
|
+
getPluginWorkflowSteps() {
|
|
37514
|
+
const steps = [];
|
|
37515
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37516
|
+
if (plugin4.workflowSteps) {
|
|
37517
|
+
for (const step of plugin4.workflowSteps) {
|
|
37518
|
+
steps.push({ pluginId, step });
|
|
37519
|
+
}
|
|
37520
|
+
}
|
|
37521
|
+
}
|
|
37522
|
+
return steps;
|
|
37523
|
+
}
|
|
37524
|
+
/**
|
|
37525
|
+
* Get all prompt contributions from loaded plugins.
|
|
37526
|
+
*/
|
|
37527
|
+
getPluginPromptContributions() {
|
|
37528
|
+
const contributions = [];
|
|
37529
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37530
|
+
if (plugin4.promptContributions) {
|
|
37531
|
+
for (const contribution of plugin4.promptContributions.contributions) {
|
|
37532
|
+
contributions.push({ pluginId, contribution, config: plugin4.promptContributions });
|
|
37533
|
+
}
|
|
37534
|
+
}
|
|
37535
|
+
}
|
|
37536
|
+
return contributions;
|
|
37537
|
+
}
|
|
37538
|
+
/**
|
|
37539
|
+
* Get all setup metadata and hooks from loaded plugins.
|
|
37540
|
+
*/
|
|
37541
|
+
getPluginSetupInfo() {
|
|
37542
|
+
const setups = [];
|
|
37543
|
+
for (const [pluginId, plugin4] of this.plugins) {
|
|
37544
|
+
if (plugin4.setup) {
|
|
37545
|
+
setups.push({ pluginId, manifest: plugin4.setup.manifest, hooks: plugin4.setup.hooks });
|
|
37546
|
+
}
|
|
37547
|
+
}
|
|
37548
|
+
return setups;
|
|
37549
|
+
}
|
|
37417
37550
|
/**
|
|
37418
37551
|
* Get all loaded plugin instances.
|
|
37419
37552
|
*/
|
|
@@ -53980,11 +54113,8 @@ async function createFnAgent2(options) {
|
|
|
53980
54113
|
const createSessionWithModel = async (modelOverride) => {
|
|
53981
54114
|
const customToolList = [
|
|
53982
54115
|
...wrappedTools,
|
|
53983
|
-
...
|
|
54116
|
+
...options.customTools ?? []
|
|
53984
54117
|
];
|
|
53985
|
-
if (isReadonly && (options.customTools?.length ?? 0) > 0) {
|
|
53986
|
-
piLog.log(`readonly session \u2014 customTools (${options.customTools.length}) skipped`);
|
|
53987
|
-
}
|
|
53988
54118
|
if (options.beforeSpawnSession) {
|
|
53989
54119
|
await options.beforeSpawnSession();
|
|
53990
54120
|
}
|
|
@@ -56102,65 +56232,6 @@ ${lines.join("\n")}`
|
|
|
56102
56232
|
}
|
|
56103
56233
|
};
|
|
56104
56234
|
}
|
|
56105
|
-
function createIdentityTool({ agent, resolvedInstructions }) {
|
|
56106
|
-
const identityParams = Type.Object({});
|
|
56107
|
-
return {
|
|
56108
|
-
name: "fn_identity",
|
|
56109
|
-
label: "Identity Check",
|
|
56110
|
-
description: "Return a structured summary of which soul, instructions, and memory are loaded for this heartbeat tick. Call this FIRST before any other tool.",
|
|
56111
|
-
parameters: identityParams,
|
|
56112
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56113
|
-
execute: async (_id, _params, _signal, _onUpdate, _ctx) => {
|
|
56114
|
-
const PREVIEW_CHARS = 500;
|
|
56115
|
-
const INSTRUCTIONS_PREVIEW_CHARS = 1e3;
|
|
56116
|
-
const MEMORY_PREVIEW_CHARS = 1e3;
|
|
56117
|
-
const soulPresent = typeof agent.soul === "string" && agent.soul.trim().length > 0;
|
|
56118
|
-
const instructionsPresent = resolvedInstructions.trim().length > 0;
|
|
56119
|
-
const memoryPresent = typeof agent.memory === "string" && agent.memory.trim().length > 0;
|
|
56120
|
-
const soulPreview = soulPresent ? agent.soul.slice(0, PREVIEW_CHARS) : "";
|
|
56121
|
-
const instructionsPreview = instructionsPresent ? resolvedInstructions.slice(0, INSTRUCTIONS_PREVIEW_CHARS) : "";
|
|
56122
|
-
const memoryPreview = memoryPresent ? agent.memory.slice(0, MEMORY_PREVIEW_CHARS) : "";
|
|
56123
|
-
const result = {
|
|
56124
|
-
agentId: agent.id,
|
|
56125
|
-
name: agent.name,
|
|
56126
|
-
role: agent.role,
|
|
56127
|
-
soulPresent,
|
|
56128
|
-
instructionsPresent,
|
|
56129
|
-
memoryPresent,
|
|
56130
|
-
soulPreview,
|
|
56131
|
-
instructionsPreview,
|
|
56132
|
-
memoryPreview
|
|
56133
|
-
};
|
|
56134
|
-
const lines = [
|
|
56135
|
-
`agentId: ${result.agentId}`,
|
|
56136
|
-
`name: ${result.name}`,
|
|
56137
|
-
`role: ${result.role}`,
|
|
56138
|
-
`soul: ${result.soulPresent ? "loaded" : "absent"}`,
|
|
56139
|
-
`instructions: ${result.instructionsPresent ? "loaded" : "absent"}`,
|
|
56140
|
-
`memory: ${result.memoryPresent ? "loaded" : "absent"}`
|
|
56141
|
-
];
|
|
56142
|
-
if (result.soulPresent && result.soulPreview) {
|
|
56143
|
-
lines.push(`
|
|
56144
|
-
Soul preview (first ${PREVIEW_CHARS} chars):
|
|
56145
|
-
${result.soulPreview}`);
|
|
56146
|
-
}
|
|
56147
|
-
if (result.instructionsPresent && result.instructionsPreview) {
|
|
56148
|
-
lines.push(`
|
|
56149
|
-
Instructions preview (first ${INSTRUCTIONS_PREVIEW_CHARS} chars):
|
|
56150
|
-
${result.instructionsPreview}`);
|
|
56151
|
-
}
|
|
56152
|
-
if (result.memoryPresent && result.memoryPreview) {
|
|
56153
|
-
lines.push(`
|
|
56154
|
-
Memory preview (first ${MEMORY_PREVIEW_CHARS} chars):
|
|
56155
|
-
${result.memoryPreview}`);
|
|
56156
|
-
}
|
|
56157
|
-
return {
|
|
56158
|
-
content: [{ type: "text", text: lines.join("\n") }],
|
|
56159
|
-
details: result
|
|
56160
|
-
};
|
|
56161
|
-
}
|
|
56162
|
-
};
|
|
56163
|
-
}
|
|
56164
56235
|
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;
|
|
56165
56236
|
var init_agent_tools = __esm({
|
|
56166
56237
|
"../engine/src/agent-tools.ts"() {
|
|
@@ -72666,6 +72737,7 @@ Rules:
|
|
|
72666
72737
|
|
|
72667
72738
|
// ../engine/src/agent-heartbeat.ts
|
|
72668
72739
|
import { Type as Type6 } from "@mariozechner/pi-ai";
|
|
72740
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
72669
72741
|
function isBlockedStateDuplicate(current, previous) {
|
|
72670
72742
|
return current.blockedBy === previous.blockedBy && current.contextHash === previous.contextHash;
|
|
72671
72743
|
}
|
|
@@ -72675,39 +72747,30 @@ function truncatePrompt(text, maxChars) {
|
|
|
72675
72747
|
|
|
72676
72748
|
... (truncated, ${text.length} chars)`;
|
|
72677
72749
|
}
|
|
72750
|
+
function shortContentHash(value) {
|
|
72751
|
+
return createHash5("sha256").update(value).digest("hex").slice(0, 8);
|
|
72752
|
+
}
|
|
72678
72753
|
function buildIdentitySnapshot(args) {
|
|
72679
72754
|
const { agent, resolvedInstructions } = args;
|
|
72680
|
-
const
|
|
72681
|
-
const
|
|
72682
|
-
const
|
|
72683
|
-
const
|
|
72684
|
-
|
|
72685
|
-
|
|
72686
|
-
|
|
72755
|
+
const soulTrimmed = typeof agent.soul === "string" ? agent.soul.trim() : "";
|
|
72756
|
+
const instrTrimmed = resolvedInstructions.trim();
|
|
72757
|
+
const memTrimmed = typeof agent.memory === "string" ? agent.memory.trim() : "";
|
|
72758
|
+
const formatField = (trimmed) => {
|
|
72759
|
+
if (!trimmed) return "absent";
|
|
72760
|
+
return `loaded (${trimmed.length} chars, sha256:${shortContentHash(trimmed)})`;
|
|
72761
|
+
};
|
|
72762
|
+
return [
|
|
72687
72763
|
"## Identity Snapshot",
|
|
72688
72764
|
"",
|
|
72689
|
-
"
|
|
72765
|
+
"Full content is in the Custom Instructions section of your system prompt. Surface anomalies in your first text output before acting.",
|
|
72690
72766
|
"",
|
|
72691
72767
|
`- agentId: ${agent.id}`,
|
|
72692
72768
|
`- name: ${agent.name}`,
|
|
72693
72769
|
`- role: ${agent.role}`,
|
|
72694
|
-
`- soul: ${
|
|
72695
|
-
`- instructions: ${
|
|
72696
|
-
`- memory: ${
|
|
72697
|
-
];
|
|
72698
|
-
if (soulPresent) {
|
|
72699
|
-
const preview = agent.soul.trim().slice(0, SOUL_PREVIEW);
|
|
72700
|
-
lines.push("", `### Soul (first ${SOUL_PREVIEW} chars)`, preview);
|
|
72701
|
-
}
|
|
72702
|
-
if (instrPresent) {
|
|
72703
|
-
const preview = resolvedInstructions.trim().slice(0, INSTR_PREVIEW);
|
|
72704
|
-
lines.push("", `### Instructions (first ${INSTR_PREVIEW} chars)`, preview);
|
|
72705
|
-
}
|
|
72706
|
-
if (memPresent) {
|
|
72707
|
-
const preview = agent.memory.trim().slice(0, MEM_PREVIEW);
|
|
72708
|
-
lines.push("", `### Memory (first ${MEM_PREVIEW} chars)`, preview);
|
|
72709
|
-
}
|
|
72710
|
-
return lines.join("\n");
|
|
72770
|
+
`- soul: ${formatField(soulTrimmed)}`,
|
|
72771
|
+
`- instructions: ${formatField(instrTrimmed)}`,
|
|
72772
|
+
`- memory: ${formatField(memTrimmed)}`
|
|
72773
|
+
].join("\n");
|
|
72711
72774
|
}
|
|
72712
72775
|
async function getHeartbeatMemorySettings(taskStore) {
|
|
72713
72776
|
const maybeGetSettings = taskStore.getSettings;
|
|
@@ -72889,9 +72952,8 @@ When sending messages:
|
|
|
72889
72952
|
1. **Identity & context** \u2014 review the **Identity Snapshot** at the top of
|
|
72890
72953
|
this prompt. Confirm your role, soul, instructions, and memory match what
|
|
72891
72954
|
you expect, and surface any anomalies in your first text output before
|
|
72892
|
-
doing anything else.
|
|
72893
|
-
|
|
72894
|
-
authoritative source.)
|
|
72955
|
+
doing anything else. The full content is in the Custom Instructions
|
|
72956
|
+
section of your system prompt.
|
|
72895
72957
|
2. **Inbox** \u2014 when fn_read_messages is available, call it. Process any pending
|
|
72896
72958
|
messages first; reply with reply_to_message_id when answering.
|
|
72897
72959
|
3. **Wake delta** \u2014 read the Wake Delta block above. The wake reason is the
|
|
@@ -72917,9 +72979,8 @@ a bug. Do not loop on the same plan across heartbeats without recording why.`;
|
|
|
72917
72979
|
1. **Identity & context** \u2014 review the **Identity Snapshot** at the top of
|
|
72918
72980
|
this prompt. Confirm your role, soul, instructions, and memory match what
|
|
72919
72981
|
you expect, and surface any anomalies in your first text output before
|
|
72920
|
-
doing anything else.
|
|
72921
|
-
|
|
72922
|
-
authoritative source.)
|
|
72982
|
+
doing anything else. The full content is in the Custom Instructions
|
|
72983
|
+
section of your system prompt.
|
|
72923
72984
|
2. **Inbox** \u2014 when fn_read_messages is available, call it. Process any pending
|
|
72924
72985
|
messages first; reply with reply_to_message_id when answering.
|
|
72925
72986
|
3. **Wake delta** \u2014 read the Wake Delta block above. The wake reason is the
|
|
@@ -73721,7 +73782,6 @@ not loop on the same plan across heartbeats without recording why.`;
|
|
|
73721
73782
|
baseHeartbeatSystemPrompt,
|
|
73722
73783
|
[resolvedInstructionsForIdentity, memoryInstructions].filter((part) => part.trim()).join("\n\n")
|
|
73723
73784
|
);
|
|
73724
|
-
heartbeatTools.push(createIdentityTool({ agent, resolvedInstructions: resolvedInstructionsForIdentity }));
|
|
73725
73785
|
heartbeatTools.push(heartbeatDoneTool);
|
|
73726
73786
|
if (isNoTaskRun) {
|
|
73727
73787
|
agentLogger = new AgentLogger({
|
|
@@ -78575,10 +78635,18 @@ var init_plugin_runner = __esm({
|
|
|
78575
78635
|
cachedRoutes = null;
|
|
78576
78636
|
cachedUiSlots = null;
|
|
78577
78637
|
cachedRuntimes = null;
|
|
78638
|
+
cachedSkills = null;
|
|
78639
|
+
cachedWorkflowSteps = null;
|
|
78640
|
+
cachedPromptContributions = null;
|
|
78641
|
+
cachedSetupInfo = null;
|
|
78578
78642
|
toolsCacheVersion = 0;
|
|
78579
78643
|
routesCacheVersion = 0;
|
|
78580
78644
|
uiSlotsCacheVersion = 0;
|
|
78581
78645
|
runtimesCacheVersion = 0;
|
|
78646
|
+
skillsCacheVersion = 0;
|
|
78647
|
+
workflowStepsCacheVersion = 0;
|
|
78648
|
+
promptContributionsCacheVersion = 0;
|
|
78649
|
+
setupCacheVersion = 0;
|
|
78582
78650
|
hookTimeoutMs;
|
|
78583
78651
|
// Event handler references for cleanup
|
|
78584
78652
|
handlePluginEnabled;
|
|
@@ -78610,6 +78678,10 @@ var init_plugin_runner = __esm({
|
|
|
78610
78678
|
this.invalidateRoutesCache();
|
|
78611
78679
|
this.invalidateUiSlotsCache();
|
|
78612
78680
|
this.invalidateRuntimesCache();
|
|
78681
|
+
this.invalidateSkillsCache();
|
|
78682
|
+
this.invalidateWorkflowStepsCache();
|
|
78683
|
+
this.invalidatePromptContributionsCache();
|
|
78684
|
+
this.invalidateSetupCache();
|
|
78613
78685
|
}
|
|
78614
78686
|
/**
|
|
78615
78687
|
* Shutdown the plugin runner.
|
|
@@ -78690,6 +78762,54 @@ var init_plugin_runner = __esm({
|
|
|
78690
78762
|
}
|
|
78691
78763
|
return this.cachedRuntimes.runtimes;
|
|
78692
78764
|
}
|
|
78765
|
+
getPluginSkills() {
|
|
78766
|
+
if (!this.cachedSkills || this.cachedSkills.version !== this.skillsCacheVersion) {
|
|
78767
|
+
this.cachedSkills = {
|
|
78768
|
+
skills: this.options.pluginLoader.getPluginSkills(),
|
|
78769
|
+
version: this.skillsCacheVersion
|
|
78770
|
+
};
|
|
78771
|
+
}
|
|
78772
|
+
return this.cachedSkills.skills;
|
|
78773
|
+
}
|
|
78774
|
+
getPluginWorkflowSteps() {
|
|
78775
|
+
if (!this.cachedWorkflowSteps || this.cachedWorkflowSteps.version !== this.workflowStepsCacheVersion) {
|
|
78776
|
+
this.cachedWorkflowSteps = {
|
|
78777
|
+
steps: this.options.pluginLoader.getPluginWorkflowSteps(),
|
|
78778
|
+
version: this.workflowStepsCacheVersion
|
|
78779
|
+
};
|
|
78780
|
+
}
|
|
78781
|
+
return this.cachedWorkflowSteps.steps;
|
|
78782
|
+
}
|
|
78783
|
+
getPluginPromptContributions() {
|
|
78784
|
+
if (!this.cachedPromptContributions || this.cachedPromptContributions.version !== this.promptContributionsCacheVersion) {
|
|
78785
|
+
this.cachedPromptContributions = {
|
|
78786
|
+
contributions: this.options.pluginLoader.getPluginPromptContributions(),
|
|
78787
|
+
version: this.promptContributionsCacheVersion
|
|
78788
|
+
};
|
|
78789
|
+
}
|
|
78790
|
+
return this.cachedPromptContributions.contributions;
|
|
78791
|
+
}
|
|
78792
|
+
getPluginSetupInfo() {
|
|
78793
|
+
if (!this.cachedSetupInfo || this.cachedSetupInfo.version !== this.setupCacheVersion) {
|
|
78794
|
+
this.cachedSetupInfo = {
|
|
78795
|
+
setups: this.options.pluginLoader.getPluginSetupInfo(),
|
|
78796
|
+
version: this.setupCacheVersion
|
|
78797
|
+
};
|
|
78798
|
+
}
|
|
78799
|
+
return this.cachedSetupInfo.setups;
|
|
78800
|
+
}
|
|
78801
|
+
getPromptContributionsForSurface(surface) {
|
|
78802
|
+
return this.getPluginPromptContributions().filter(({ pluginId, contribution, config }) => {
|
|
78803
|
+
const plugin4 = this.options.pluginLoader.getPlugin(pluginId);
|
|
78804
|
+
if (!plugin4 || plugin4.state !== "started") {
|
|
78805
|
+
return false;
|
|
78806
|
+
}
|
|
78807
|
+
if (contribution.surface !== surface) {
|
|
78808
|
+
return false;
|
|
78809
|
+
}
|
|
78810
|
+
return config.enabledByDefault !== false;
|
|
78811
|
+
});
|
|
78812
|
+
}
|
|
78693
78813
|
/**
|
|
78694
78814
|
* Get a specific runtime registration by its runtimeId.
|
|
78695
78815
|
*
|
|
@@ -78723,6 +78843,10 @@ var init_plugin_runner = __esm({
|
|
|
78723
78843
|
this.invalidateRoutesCache();
|
|
78724
78844
|
this.invalidateUiSlotsCache();
|
|
78725
78845
|
this.invalidateRuntimesCache();
|
|
78846
|
+
this.invalidateSkillsCache();
|
|
78847
|
+
this.invalidateWorkflowStepsCache();
|
|
78848
|
+
this.invalidatePromptContributionsCache();
|
|
78849
|
+
this.invalidateSetupCache();
|
|
78726
78850
|
executorLog.log(`Plugin ${pluginId} reloaded`);
|
|
78727
78851
|
}
|
|
78728
78852
|
// ── Event Handlers for Hot-Load/Unload ─────────────────────────
|
|
@@ -78734,6 +78858,10 @@ var init_plugin_runner = __esm({
|
|
|
78734
78858
|
this.invalidateRoutesCache();
|
|
78735
78859
|
this.invalidateUiSlotsCache();
|
|
78736
78860
|
this.invalidateRuntimesCache();
|
|
78861
|
+
this.invalidateSkillsCache();
|
|
78862
|
+
this.invalidateWorkflowStepsCache();
|
|
78863
|
+
this.invalidatePromptContributionsCache();
|
|
78864
|
+
this.invalidateSetupCache();
|
|
78737
78865
|
try {
|
|
78738
78866
|
executorLog.log(`Auto-loading enabled plugin: ${plugin4.id}`);
|
|
78739
78867
|
await this.options.pluginLoader.loadPlugin(plugin4.id);
|
|
@@ -78749,6 +78877,10 @@ var init_plugin_runner = __esm({
|
|
|
78749
78877
|
this.invalidateRoutesCache();
|
|
78750
78878
|
this.invalidateUiSlotsCache();
|
|
78751
78879
|
this.invalidateRuntimesCache();
|
|
78880
|
+
this.invalidateSkillsCache();
|
|
78881
|
+
this.invalidateWorkflowStepsCache();
|
|
78882
|
+
this.invalidatePromptContributionsCache();
|
|
78883
|
+
this.invalidateSetupCache();
|
|
78752
78884
|
try {
|
|
78753
78885
|
executorLog.log(`Auto-stopping disabled plugin: ${plugin4.id}`);
|
|
78754
78886
|
await this.options.pluginLoader.stopPlugin(plugin4.id);
|
|
@@ -78764,6 +78896,10 @@ var init_plugin_runner = __esm({
|
|
|
78764
78896
|
this.invalidateRoutesCache();
|
|
78765
78897
|
this.invalidateUiSlotsCache();
|
|
78766
78898
|
this.invalidateRuntimesCache();
|
|
78899
|
+
this.invalidateSkillsCache();
|
|
78900
|
+
this.invalidateWorkflowStepsCache();
|
|
78901
|
+
this.invalidatePromptContributionsCache();
|
|
78902
|
+
this.invalidateSetupCache();
|
|
78767
78903
|
try {
|
|
78768
78904
|
executorLog.log(`Stopping unregistered plugin: ${plugin4.id}`);
|
|
78769
78905
|
await this.options.pluginLoader.stopPlugin(plugin4.id);
|
|
@@ -78780,6 +78916,10 @@ var init_plugin_runner = __esm({
|
|
|
78780
78916
|
this.invalidateRoutesCache();
|
|
78781
78917
|
this.invalidateUiSlotsCache();
|
|
78782
78918
|
this.invalidateRuntimesCache();
|
|
78919
|
+
this.invalidateSkillsCache();
|
|
78920
|
+
this.invalidateWorkflowStepsCache();
|
|
78921
|
+
this.invalidatePromptContributionsCache();
|
|
78922
|
+
this.invalidateSetupCache();
|
|
78783
78923
|
}
|
|
78784
78924
|
/**
|
|
78785
78925
|
* Handle plugin updates - invalidate caches.
|
|
@@ -78789,6 +78929,10 @@ var init_plugin_runner = __esm({
|
|
|
78789
78929
|
this.invalidateRoutesCache();
|
|
78790
78930
|
this.invalidateUiSlotsCache();
|
|
78791
78931
|
this.invalidateRuntimesCache();
|
|
78932
|
+
this.invalidateSkillsCache();
|
|
78933
|
+
this.invalidateWorkflowStepsCache();
|
|
78934
|
+
this.invalidatePromptContributionsCache();
|
|
78935
|
+
this.invalidateSetupCache();
|
|
78792
78936
|
}
|
|
78793
78937
|
/**
|
|
78794
78938
|
* Handle plugin:loaded event from loader - invalidate caches.
|
|
@@ -78798,6 +78942,10 @@ var init_plugin_runner = __esm({
|
|
|
78798
78942
|
this.invalidateRoutesCache();
|
|
78799
78943
|
this.invalidateUiSlotsCache();
|
|
78800
78944
|
this.invalidateRuntimesCache();
|
|
78945
|
+
this.invalidateSkillsCache();
|
|
78946
|
+
this.invalidateWorkflowStepsCache();
|
|
78947
|
+
this.invalidatePromptContributionsCache();
|
|
78948
|
+
this.invalidateSetupCache();
|
|
78801
78949
|
}
|
|
78802
78950
|
/**
|
|
78803
78951
|
* Handle plugin:unloaded event from loader - invalidate caches.
|
|
@@ -78807,6 +78955,10 @@ var init_plugin_runner = __esm({
|
|
|
78807
78955
|
this.invalidateRoutesCache();
|
|
78808
78956
|
this.invalidateUiSlotsCache();
|
|
78809
78957
|
this.invalidateRuntimesCache();
|
|
78958
|
+
this.invalidateSkillsCache();
|
|
78959
|
+
this.invalidateWorkflowStepsCache();
|
|
78960
|
+
this.invalidatePromptContributionsCache();
|
|
78961
|
+
this.invalidateSetupCache();
|
|
78810
78962
|
}
|
|
78811
78963
|
/**
|
|
78812
78964
|
* Handle plugin:reloaded event from loader - invalidate caches.
|
|
@@ -78816,6 +78968,10 @@ var init_plugin_runner = __esm({
|
|
|
78816
78968
|
this.invalidateRoutesCache();
|
|
78817
78969
|
this.invalidateUiSlotsCache();
|
|
78818
78970
|
this.invalidateRuntimesCache();
|
|
78971
|
+
this.invalidateSkillsCache();
|
|
78972
|
+
this.invalidateWorkflowStepsCache();
|
|
78973
|
+
this.invalidatePromptContributionsCache();
|
|
78974
|
+
this.invalidateSetupCache();
|
|
78819
78975
|
}
|
|
78820
78976
|
// ── Tool Conversion ───────────────────────────────────────────────
|
|
78821
78977
|
/**
|
|
@@ -78987,6 +79143,22 @@ var init_plugin_runner = __esm({
|
|
|
78987
79143
|
this.runtimesCacheVersion++;
|
|
78988
79144
|
this.log.log(`Runtimes cache invalidated (version: ${this.runtimesCacheVersion})`);
|
|
78989
79145
|
}
|
|
79146
|
+
invalidateSkillsCache() {
|
|
79147
|
+
this.skillsCacheVersion++;
|
|
79148
|
+
this.log.log(`Skills cache invalidated (version: ${this.skillsCacheVersion})`);
|
|
79149
|
+
}
|
|
79150
|
+
invalidateWorkflowStepsCache() {
|
|
79151
|
+
this.workflowStepsCacheVersion++;
|
|
79152
|
+
this.log.log(`Workflow steps cache invalidated (version: ${this.workflowStepsCacheVersion})`);
|
|
79153
|
+
}
|
|
79154
|
+
invalidatePromptContributionsCache() {
|
|
79155
|
+
this.promptContributionsCacheVersion++;
|
|
79156
|
+
this.log.log(`Prompt contributions cache invalidated (version: ${this.promptContributionsCacheVersion})`);
|
|
79157
|
+
}
|
|
79158
|
+
invalidateSetupCache() {
|
|
79159
|
+
this.setupCacheVersion++;
|
|
79160
|
+
this.log.log(`Setup cache invalidated (version: ${this.setupCacheVersion})`);
|
|
79161
|
+
}
|
|
78990
79162
|
// ── Store Event Subscriptions ────────────────────────────────────
|
|
78991
79163
|
/**
|
|
78992
79164
|
* Subscribe to TaskStore events for task lifecycle hooks.
|
|
@@ -133340,8 +133512,8 @@ var init_register_settings_sync_routes = __esm({
|
|
|
133340
133512
|
exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
133341
133513
|
version: 1
|
|
133342
133514
|
};
|
|
133343
|
-
const { createHash:
|
|
133344
|
-
const checksum =
|
|
133515
|
+
const { createHash: createHash6 } = await import("node:crypto");
|
|
133516
|
+
const checksum = createHash6("sha256").update(JSON.stringify(payload)).digest("hex");
|
|
133345
133517
|
await fetchFromRemoteNode(node, "/api/settings/sync-receive", {
|
|
133346
133518
|
method: "POST",
|
|
133347
133519
|
body: { ...payload, checksum }
|
|
@@ -133400,7 +133572,7 @@ var init_register_settings_sync_routes = __esm({
|
|
|
133400
133572
|
});
|
|
133401
133573
|
return;
|
|
133402
133574
|
}
|
|
133403
|
-
const { createHash:
|
|
133575
|
+
const { createHash: createHash6 } = await import("node:crypto");
|
|
133404
133576
|
const exportedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
133405
133577
|
const payloadWithoutChecksum = {
|
|
133406
133578
|
global: remoteSettings.global,
|
|
@@ -133408,7 +133580,7 @@ var init_register_settings_sync_routes = __esm({
|
|
|
133408
133580
|
exportedAt,
|
|
133409
133581
|
version: 1
|
|
133410
133582
|
};
|
|
133411
|
-
const checksum =
|
|
133583
|
+
const checksum = createHash6("sha256").update(JSON.stringify(payloadWithoutChecksum)).digest("hex");
|
|
133412
133584
|
const result = await central.applyRemoteSettings({
|
|
133413
133585
|
...payloadWithoutChecksum,
|
|
133414
133586
|
checksum
|
|
@@ -153181,7 +153353,7 @@ var require_websocket = __commonJS({
|
|
|
153181
153353
|
var http = __require("http");
|
|
153182
153354
|
var net = __require("net");
|
|
153183
153355
|
var tls = __require("tls");
|
|
153184
|
-
var { randomBytes: randomBytes4, createHash:
|
|
153356
|
+
var { randomBytes: randomBytes4, createHash: createHash6 } = __require("crypto");
|
|
153185
153357
|
var { Duplex, Readable: Readable2 } = __require("stream");
|
|
153186
153358
|
var { URL: URL2 } = __require("url");
|
|
153187
153359
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
@@ -153841,7 +154013,7 @@ var require_websocket = __commonJS({
|
|
|
153841
154013
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
153842
154014
|
return;
|
|
153843
154015
|
}
|
|
153844
|
-
const digest =
|
|
154016
|
+
const digest = createHash6("sha1").update(key + GUID).digest("base64");
|
|
153845
154017
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
153846
154018
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
153847
154019
|
return;
|
|
@@ -154208,7 +154380,7 @@ var require_websocket_server = __commonJS({
|
|
|
154208
154380
|
var EventEmitter37 = __require("events");
|
|
154209
154381
|
var http = __require("http");
|
|
154210
154382
|
var { Duplex } = __require("stream");
|
|
154211
|
-
var { createHash:
|
|
154383
|
+
var { createHash: createHash6 } = __require("crypto");
|
|
154212
154384
|
var extension2 = require_extension();
|
|
154213
154385
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
154214
154386
|
var subprotocol2 = require_subprotocol();
|
|
@@ -154509,7 +154681,7 @@ var require_websocket_server = __commonJS({
|
|
|
154509
154681
|
);
|
|
154510
154682
|
}
|
|
154511
154683
|
if (this._state > RUNNING) return abortHandshake(socket, 503);
|
|
154512
|
-
const digest =
|
|
154684
|
+
const digest = createHash6("sha1").update(key + GUID).digest("base64");
|
|
154513
154685
|
const headers = [
|
|
154514
154686
|
"HTTP/1.1 101 Switching Protocols",
|
|
154515
154687
|
"Upgrade: websocket",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,j as e}from"./vendor-react-K0fH_qHe.js";import{c as Ge,
|
|
1
|
+
import{r as t,j as e}from"./vendor-react-K0fH_qHe.js";import{c as Ge,dk as zs,dl as Bs,dm as Hs,dn as Is,L as _,R as We,al as ms,Z as Os,am as _e,V as Te,W as Ss,N as ks,dp as _s,dq as Vs,dr as Us,w as Cs,cx as Js,ds as Gs,z as q,dt as Ws,s as hs,B as gs,Q as Me,U as fs,a$ as ve,X as qs,F as be,A as Fe,I as qe,du as Ys,cr as Ks,aF as Zs,bn as Qs,an as ws,Y as Xs,a1 as et,a3 as st,dv as Ue,j as Rs,dw as tt,r as at,dx as nt,dy as it,dz as rt,dA as lt,dB as ct,dC as Ee,a9 as Le,ab as De,ac as $e,C as Q,a7 as Ms,dD as ot,dE as dt,i as ut,h as mt,k as ht,dF as Je,a2 as gt,dG as ft,dH as xt,dI as pt,dJ as vt,dK as bt,dL as Fs,dM as jt,dN as Nt,a0 as yt,dO as St,_ as kt,dP as Ct}from"./index-CEavim6l.js";import{S as As}from"./star-B6Th07jw.js";import{S as wt}from"./SkillMultiselect-CSkXQzdv.js";import{L as Ts}from"./list-checks-6EktkUso.js";import"./vendor-xterm-DzcZoU0P.js";/**
|
|
2
2
|
* @license lucide-react v1.7.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|