@gowelle/stint-agent 1.2.36 → 1.2.37

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.
@@ -2,10 +2,10 @@ import {
2
2
  gitService,
3
3
  projectService,
4
4
  validatePidFile
5
- } from "./chunk-KHLFCZRY.js";
5
+ } from "./chunk-XRNTJYCQ.js";
6
6
  import {
7
7
  authService
8
- } from "./chunk-E3WNZ2CK.js";
8
+ } from "./chunk-HPHXBSGB.js";
9
9
 
10
10
  // src/components/StatusDashboard.tsx
11
11
  import { useState, useEffect } from "react";
@@ -0,0 +1,7 @@
1
+ import {
2
+ apiService
3
+ } from "./chunk-IBGWKTT7.js";
4
+ import "./chunk-HPHXBSGB.js";
5
+ export {
6
+ apiService
7
+ };
@@ -346,7 +346,7 @@ var AuthServiceImpl = class {
346
346
  return null;
347
347
  }
348
348
  try {
349
- const { apiService } = await import("./api-6KY43TBB.js");
349
+ const { apiService } = await import("./api-AFSILC7K.js");
350
350
  const user = await apiService.getCurrentUser();
351
351
  logger.info("auth", `Token validated for user: ${user.email}`);
352
352
  return user;
@@ -2,7 +2,7 @@ import {
2
2
  authService,
3
3
  config,
4
4
  logger
5
- } from "./chunk-E3WNZ2CK.js";
5
+ } from "./chunk-HPHXBSGB.js";
6
6
 
7
7
  // src/utils/circuit-breaker.ts
8
8
  var CircuitBreaker = class {
@@ -100,7 +100,7 @@ var CircuitBreaker = class {
100
100
  };
101
101
 
102
102
  // src/services/api.ts
103
- var AGENT_VERSION = "1.2.36";
103
+ var AGENT_VERSION = "1.2.37";
104
104
  var ApiServiceImpl = class {
105
105
  sessionId = null;
106
106
  circuitBreaker = new CircuitBreaker({
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  apiService
3
- } from "./chunk-VE7Z43P7.js";
3
+ } from "./chunk-IBGWKTT7.js";
4
4
  import {
5
5
  gitService,
6
6
  projectService
7
- } from "./chunk-KHLFCZRY.js";
7
+ } from "./chunk-XRNTJYCQ.js";
8
8
  import {
9
9
  authService,
10
10
  config,
11
11
  logger
12
- } from "./chunk-E3WNZ2CK.js";
12
+ } from "./chunk-HPHXBSGB.js";
13
13
 
14
14
  // src/utils/notify.ts
15
15
  import notifier from "node-notifier";
@@ -890,7 +890,7 @@ var WebSocketServiceImpl = class {
890
890
  "websocket",
891
891
  `Commit ${commit.id} marked as large, fetching full details...`
892
892
  );
893
- const { apiService: apiService2 } = await import("./api-6KY43TBB.js");
893
+ const { apiService: apiService2 } = await import("./api-AFSILC7K.js");
894
894
  const fullCommit = await apiService2.getCommit(commit.id);
895
895
  commit = {
896
896
  ...commit,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  config,
3
3
  logger
4
- } from "./chunk-E3WNZ2CK.js";
4
+ } from "./chunk-HPHXBSGB.js";
5
5
 
6
6
  // src/services/git.ts
7
7
  import simpleGit from "simple-git";
@@ -3,20 +3,20 @@ import {
3
3
  commitQueue,
4
4
  notify,
5
5
  websocketService
6
- } from "../chunk-BYBGWAQO.js";
6
+ } from "../chunk-NODAAPCO.js";
7
7
  import {
8
8
  apiService
9
- } from "../chunk-VE7Z43P7.js";
9
+ } from "../chunk-IBGWKTT7.js";
10
10
  import {
11
11
  gitService,
12
12
  projectService,
13
13
  removePidFile,
14
14
  writePidFile
15
- } from "../chunk-KHLFCZRY.js";
15
+ } from "../chunk-XRNTJYCQ.js";
16
16
  import {
17
17
  authService,
18
18
  logger
19
- } from "../chunk-E3WNZ2CK.js";
19
+ } from "../chunk-HPHXBSGB.js";
20
20
 
21
21
  // src/daemon/runner.ts
22
22
  import "dotenv/config";
@@ -290,6 +290,52 @@ var FileWatcher = class {
290
290
  }
291
291
  };
292
292
 
293
+ // src/daemon/sync.ts
294
+ async function syncPendingCommits() {
295
+ logger.info("sync", "Syncing pending commits...");
296
+ const linkedProjects = projectService.getAllLinkedProjects();
297
+ const linkedProjectIds = Object.values(linkedProjects).map(
298
+ (p) => p.projectId
299
+ );
300
+ if (linkedProjectIds.length === 0) {
301
+ logger.info("sync", "No linked projects found locally.");
302
+ return;
303
+ }
304
+ try {
305
+ const apiProjects = await apiService.getLinkedProjects();
306
+ const relevantProjects = apiProjects.filter(
307
+ (p) => linkedProjectIds.includes(p.id)
308
+ );
309
+ logger.info(
310
+ "sync",
311
+ `Checking ${relevantProjects.length} projects for pending commits...`
312
+ );
313
+ for (const project of relevantProjects) {
314
+ try {
315
+ const pendingCommits = await apiService.getPendingCommits(project.id);
316
+ if (pendingCommits.length > 0) {
317
+ logger.info(
318
+ "sync",
319
+ `Found ${pendingCommits.length} pending commits for project ${project.name}`
320
+ );
321
+ for (const commit of pendingCommits) {
322
+ commitQueue.addToQueue(commit, project);
323
+ }
324
+ }
325
+ } catch (error) {
326
+ logger.error(
327
+ "sync",
328
+ `Failed to sync commits for project ${project.name}`,
329
+ error
330
+ );
331
+ }
332
+ }
333
+ logger.success("sync", "Pending commit sync complete");
334
+ } catch (error) {
335
+ logger.error("sync", "Failed to sync pending commits", error);
336
+ }
337
+ }
338
+
293
339
  // src/daemon/index.ts
294
340
  var heartbeatInterval = null;
295
341
  var isShuttingDown = false;
@@ -433,6 +479,7 @@ Priority: ${suggestion.priority}`,
433
479
  }
434
480
  logger.success("daemon", "Initial project sync complete");
435
481
  }
482
+ await syncPendingCommits();
436
483
  logger.success("daemon", "Daemon started successfully");
437
484
  await new Promise(() => {
438
485
  });
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  commitQueue,
4
4
  websocketService
5
- } from "./chunk-BYBGWAQO.js";
5
+ } from "./chunk-NODAAPCO.js";
6
6
  import {
7
7
  apiService
8
- } from "./chunk-VE7Z43P7.js";
8
+ } from "./chunk-IBGWKTT7.js";
9
9
  import {
10
10
  getPidFilePath,
11
11
  gitService,
@@ -14,14 +14,14 @@ import {
14
14
  projectService,
15
15
  spawnDetached,
16
16
  validatePidFile
17
- } from "./chunk-KHLFCZRY.js";
17
+ } from "./chunk-XRNTJYCQ.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __toESM,
21
21
  authService,
22
22
  config,
23
23
  logger
24
- } from "./chunk-E3WNZ2CK.js";
24
+ } from "./chunk-HPHXBSGB.js";
25
25
 
26
26
  // node_modules/semver/internal/constants.js
27
27
  var require_constants = __commonJS({
@@ -2657,7 +2657,7 @@ function registerStatusCommand(program2) {
2657
2657
  try {
2658
2658
  const { render } = await import("ink");
2659
2659
  const { createElement } = await import("react");
2660
- const { StatusDashboard } = await import("./StatusDashboard-VOOOQA7A.js");
2660
+ const { StatusDashboard } = await import("./StatusDashboard-AMDPK7EQ.js");
2661
2661
  render(createElement(StatusDashboard, { cwd }));
2662
2662
  return;
2663
2663
  } catch (error) {
@@ -4846,7 +4846,7 @@ ${chalk14.bold("Config file:")} ${chalk14.cyan(configPath)}
4846
4846
  }
4847
4847
 
4848
4848
  // src/index.ts
4849
- var AGENT_VERSION = "1.2.36";
4849
+ var AGENT_VERSION = "1.2.37";
4850
4850
  var program = new Command();
4851
4851
  program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(AGENT_VERSION, "-v, --version", "output the current version").addHelpText(
4852
4852
  "after",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gowelle/stint-agent",
3
- "version": "1.2.36",
3
+ "version": "1.2.37",
4
4
  "description": "Local agent for Stint - Project Assistant",
5
5
  "author": "Gowelle John <gowelle.john@icloud.com>",
6
6
  "license": "MIT",
@@ -1,7 +0,0 @@
1
- import {
2
- apiService
3
- } from "./chunk-VE7Z43P7.js";
4
- import "./chunk-E3WNZ2CK.js";
5
- export {
6
- apiService
7
- };