@runfusion/fusion 0.0.3 → 0.0.5

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.
@@ -78,11 +78,11 @@
78
78
  }
79
79
  })();
80
80
  </script>
81
- <script type="module" crossorigin src="/assets/index-6vxMhlrC.js"></script>
81
+ <script type="module" crossorigin src="/assets/index-wtVkS5Qz.js"></script>
82
82
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-K0fH_qHe.js">
83
83
  <link rel="modulepreload" crossorigin href="/assets/vendor-xterm-DzcZoU0P.js">
84
84
  <link rel="stylesheet" crossorigin href="/assets/vendor-xterm-LZoznX6r.css">
85
- <link rel="stylesheet" crossorigin href="/assets/index-DVmHYNJ8.css">
85
+ <link rel="stylesheet" crossorigin href="/assets/index-9GdD09x7.css">
86
86
  </head>
87
87
  <body>
88
88
  <div id="root"></div>
package/dist/extension.js CHANGED
@@ -3509,13 +3509,25 @@ import { mkdir, readFile, writeFile, readdir, unlink, rename } from "node:fs/pro
3509
3509
  import { basename, join as join2, resolve } from "node:path";
3510
3510
  import { randomUUID, randomBytes, createHash } from "node:crypto";
3511
3511
  import { EventEmitter } from "node:events";
3512
- var AgentStore;
3512
+ function resolveCreationRuntimeConfig(incoming, metadata) {
3513
+ const isEphemeral = isEphemeralAgent({ metadata });
3514
+ if (isEphemeral) {
3515
+ return incoming;
3516
+ }
3517
+ const rc = { ...incoming ?? {} };
3518
+ if (typeof rc.heartbeatIntervalMs !== "number" || !Number.isFinite(rc.heartbeatIntervalMs)) {
3519
+ rc.heartbeatIntervalMs = DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS;
3520
+ }
3521
+ return rc;
3522
+ }
3523
+ var DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS, AgentStore;
3513
3524
  var init_agent_store = __esm({
3514
3525
  "../core/src/agent-store.ts"() {
3515
3526
  "use strict";
3516
3527
  init_types();
3517
3528
  init_agent_permissions();
3518
3529
  init_db();
3530
+ DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS = 36e5;
3519
3531
  AgentStore = class extends EventEmitter {
3520
3532
  rootDir;
3521
3533
  agentsDir;
@@ -3654,6 +3666,16 @@ var init_agent_store = __esm({
3654
3666
  }
3655
3667
  /**
3656
3668
  * Create a new agent with "idle" state.
3669
+ *
3670
+ * For non-ephemeral agents, ensures `runtimeConfig.heartbeatIntervalMs` is
3671
+ * persisted at creation time — previously it was only ever written when the
3672
+ * user interacted with the dashboard dropdown, so agents created and never
3673
+ * touched would end up with no interval on disk. That made the dashboard's
3674
+ * freshness check behave inconsistently between agents that had been
3675
+ * configured and agents that hadn't, even though the scheduler applied the
3676
+ * same default (1h) to both at runtime. Writing the default explicitly
3677
+ * removes that divergence and keeps the persisted config truthful.
3678
+ *
3657
3679
  * @param input - Creation parameters
3658
3680
  * @returns The created agent
3659
3681
  * @throws Error if input is invalid
@@ -3667,6 +3689,8 @@ var init_agent_store = __esm({
3667
3689
  }
3668
3690
  const now = (/* @__PURE__ */ new Date()).toISOString();
3669
3691
  const agentId = `agent-${randomUUID().slice(0, 8)}`;
3692
+ const metadata = input.metadata ?? {};
3693
+ const runtimeConfig = resolveCreationRuntimeConfig(input.runtimeConfig, metadata);
3670
3694
  const agent = {
3671
3695
  id: agentId,
3672
3696
  name: input.name.trim(),
@@ -3674,11 +3698,11 @@ var init_agent_store = __esm({
3674
3698
  state: "idle",
3675
3699
  createdAt: now,
3676
3700
  updatedAt: now,
3677
- metadata: input.metadata ?? {},
3701
+ metadata,
3678
3702
  ...input.title && { title: input.title },
3679
3703
  ...input.icon && { icon: input.icon },
3680
3704
  ...input.reportsTo && { reportsTo: input.reportsTo },
3681
- ...input.runtimeConfig && { runtimeConfig: input.runtimeConfig },
3705
+ ...runtimeConfig && { runtimeConfig },
3682
3706
  ...input.permissions && { permissions: input.permissions },
3683
3707
  ...input.instructionsPath && { instructionsPath: input.instructionsPath },
3684
3708
  ...input.instructionsText && { instructionsText: input.instructionsText },
@@ -34456,7 +34480,7 @@ async function syncBackupAutomation(automationStore, settings) {
34456
34480
  if (!AutomationStore2.isValidCron(schedule)) {
34457
34481
  throw new Error(`Invalid backup schedule: ${schedule}`);
34458
34482
  }
34459
- const command = "fn backup --create";
34483
+ const command = "npx runfusion.ai backup --create";
34460
34484
  if (existingSchedule) {
34461
34485
  return await automationStore.updateSchedule(existingSchedule.id, {
34462
34486
  scheduleType: "custom",
@@ -34489,7 +34513,7 @@ async function syncBackupRoutine(routineStore, settings) {
34489
34513
  if (!RoutineStore2.isValidCron(schedule)) {
34490
34514
  throw new Error(`Invalid backup schedule: ${schedule}`);
34491
34515
  }
34492
- const command = "fn backup --create";
34516
+ const command = "npx runfusion.ai backup --create";
34493
34517
  const input = {
34494
34518
  name: BACKUP_SCHEDULE_NAME,
34495
34519
  description: "Automatic database backup based on project settings",
@@ -47048,6 +47072,7 @@ __export(src_exports, {
47048
47072
  CheckoutConflictError: () => CheckoutConflictError,
47049
47073
  DAEMON_TOKEN_HEX_LENGTH: () => DAEMON_TOKEN_HEX_LENGTH,
47050
47074
  DAEMON_TOKEN_PREFIX: () => DAEMON_TOKEN_PREFIX,
47075
+ DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS: () => DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS,
47051
47076
  DEFAULT_AUTO_SUMMARIZE_SCHEDULE: () => DEFAULT_AUTO_SUMMARIZE_SCHEDULE,
47052
47077
  DEFAULT_EXECUTION_MODE: () => DEFAULT_EXECUTION_MODE,
47053
47078
  DEFAULT_GLOBAL_SETTINGS: () => DEFAULT_GLOBAL_SETTINGS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runfusion/fusion",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "description": "Fusion CLI: HTTP API server, daemon, dashboard launcher, and task tooling for the Fusion AI coding agent.",
6
6
  "homepage": "https://github.com/Runfusion/Fusion#readme",