@runfusion/fusion 0.0.4 → 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.
package/dist/bin.js CHANGED
@@ -3510,13 +3510,25 @@ import { mkdir, readFile, writeFile, readdir, unlink, rename } from "node:fs/pro
3510
3510
  import { basename, join as join2, resolve } from "node:path";
3511
3511
  import { randomUUID, randomBytes, createHash } from "node:crypto";
3512
3512
  import { EventEmitter } from "node:events";
3513
- var AgentStore;
3513
+ function resolveCreationRuntimeConfig(incoming, metadata) {
3514
+ const isEphemeral = isEphemeralAgent({ metadata });
3515
+ if (isEphemeral) {
3516
+ return incoming;
3517
+ }
3518
+ const rc = { ...incoming ?? {} };
3519
+ if (typeof rc.heartbeatIntervalMs !== "number" || !Number.isFinite(rc.heartbeatIntervalMs)) {
3520
+ rc.heartbeatIntervalMs = DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS;
3521
+ }
3522
+ return rc;
3523
+ }
3524
+ var DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS, AgentStore;
3514
3525
  var init_agent_store = __esm({
3515
3526
  "../core/src/agent-store.ts"() {
3516
3527
  "use strict";
3517
3528
  init_types();
3518
3529
  init_agent_permissions();
3519
3530
  init_db();
3531
+ DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS = 36e5;
3520
3532
  AgentStore = class extends EventEmitter {
3521
3533
  rootDir;
3522
3534
  agentsDir;
@@ -3655,6 +3667,16 @@ var init_agent_store = __esm({
3655
3667
  }
3656
3668
  /**
3657
3669
  * Create a new agent with "idle" state.
3670
+ *
3671
+ * For non-ephemeral agents, ensures `runtimeConfig.heartbeatIntervalMs` is
3672
+ * persisted at creation time — previously it was only ever written when the
3673
+ * user interacted with the dashboard dropdown, so agents created and never
3674
+ * touched would end up with no interval on disk. That made the dashboard's
3675
+ * freshness check behave inconsistently between agents that had been
3676
+ * configured and agents that hadn't, even though the scheduler applied the
3677
+ * same default (1h) to both at runtime. Writing the default explicitly
3678
+ * removes that divergence and keeps the persisted config truthful.
3679
+ *
3658
3680
  * @param input - Creation parameters
3659
3681
  * @returns The created agent
3660
3682
  * @throws Error if input is invalid
@@ -3668,6 +3690,8 @@ var init_agent_store = __esm({
3668
3690
  }
3669
3691
  const now = (/* @__PURE__ */ new Date()).toISOString();
3670
3692
  const agentId = `agent-${randomUUID().slice(0, 8)}`;
3693
+ const metadata = input.metadata ?? {};
3694
+ const runtimeConfig = resolveCreationRuntimeConfig(input.runtimeConfig, metadata);
3671
3695
  const agent = {
3672
3696
  id: agentId,
3673
3697
  name: input.name.trim(),
@@ -3675,11 +3699,11 @@ var init_agent_store = __esm({
3675
3699
  state: "idle",
3676
3700
  createdAt: now,
3677
3701
  updatedAt: now,
3678
- metadata: input.metadata ?? {},
3702
+ metadata,
3679
3703
  ...input.title && { title: input.title },
3680
3704
  ...input.icon && { icon: input.icon },
3681
3705
  ...input.reportsTo && { reportsTo: input.reportsTo },
3682
- ...input.runtimeConfig && { runtimeConfig: input.runtimeConfig },
3706
+ ...runtimeConfig && { runtimeConfig },
3683
3707
  ...input.permissions && { permissions: input.permissions },
3684
3708
  ...input.instructionsPath && { instructionsPath: input.instructionsPath },
3685
3709
  ...input.instructionsText && { instructionsText: input.instructionsText },
@@ -47049,6 +47073,7 @@ __export(src_exports, {
47049
47073
  CheckoutConflictError: () => CheckoutConflictError,
47050
47074
  DAEMON_TOKEN_HEX_LENGTH: () => DAEMON_TOKEN_HEX_LENGTH,
47051
47075
  DAEMON_TOKEN_PREFIX: () => DAEMON_TOKEN_PREFIX,
47076
+ DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS: () => DEFAULT_AGENT_HEARTBEAT_INTERVAL_MS,
47052
47077
  DEFAULT_AUTO_SUMMARIZE_SCHEDULE: () => DEFAULT_AUTO_SUMMARIZE_SCHEDULE,
47053
47078
  DEFAULT_EXECUTION_MODE: () => DEFAULT_EXECUTION_MODE,
47054
47079
  DEFAULT_GLOBAL_SETTINGS: () => DEFAULT_GLOBAL_SETTINGS,
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 },
@@ -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.4",
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",
@@ -69,8 +69,8 @@
69
69
  "vitest": "^3.1.0",
70
70
  "yaml": "^2.8.3",
71
71
  "@fusion/core": "0.1.0",
72
- "@fusion/engine": "0.1.0",
73
- "@fusion/dashboard": "0.1.0"
72
+ "@fusion/dashboard": "0.1.0",
73
+ "@fusion/engine": "0.1.0"
74
74
  },
75
75
  "repository": {
76
76
  "type": "git",