@gowelle/stint-agent 1.2.46 → 1.2.47

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-6G57QEQ3.js";
5
+ } from "./chunk-EZWHVRCK.js";
6
6
  import {
7
7
  authService
8
- } from "./chunk-W6DXU2TZ.js";
8
+ } from "./chunk-GTNFXUSW.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-AOMGKVON.js";
4
+ import "./chunk-GTNFXUSW.js";
5
+ export {
6
+ apiService
7
+ };
@@ -2,7 +2,7 @@ import {
2
2
  authService,
3
3
  config,
4
4
  logger
5
- } from "./chunk-W6DXU2TZ.js";
5
+ } from "./chunk-GTNFXUSW.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.46";
103
+ var AGENT_VERSION = "1.2.47";
104
104
  var ApiServiceImpl = class {
105
105
  sessionId = null;
106
106
  circuitBreaker = new CircuitBreaker({
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  config,
3
3
  logger
4
- } from "./chunk-W6DXU2TZ.js";
4
+ } from "./chunk-GTNFXUSW.js";
5
5
 
6
6
  // src/services/git.ts
7
7
  import simpleGit from "simple-git";
@@ -358,7 +358,7 @@ var AuthServiceImpl = class {
358
358
  return null;
359
359
  }
360
360
  try {
361
- const { apiService } = await import("./api-BKJF4YTU.js");
361
+ const { apiService } = await import("./api-DLJJ4DDC.js");
362
362
  const user = await apiService.getCurrentUser();
363
363
  logger.info("auth", `Token validated for user: ${user.email}`);
364
364
  return user;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  apiService
3
- } from "./chunk-7WHS3Q3J.js";
3
+ } from "./chunk-AOMGKVON.js";
4
4
  import {
5
5
  gitService,
6
6
  projectService
7
- } from "./chunk-6G57QEQ3.js";
7
+ } from "./chunk-EZWHVRCK.js";
8
8
  import {
9
9
  authService,
10
10
  config,
11
11
  logger
12
- } from "./chunk-W6DXU2TZ.js";
12
+ } from "./chunk-GTNFXUSW.js";
13
13
 
14
14
  // src/services/package-detector.ts
15
15
  import fs from "fs";
@@ -307,6 +307,8 @@ var PackageDetectorService = class {
307
307
  }
308
308
  /**
309
309
  * Detect composer package (composer.json)
310
+ * Note: Composer encourages using git tags for versioning, so we fetch
311
+ * the version from Packagist if not specified locally in composer.json.
310
312
  */
311
313
  async detectComposer(projectPath) {
312
314
  const manifestPath = path.join(projectPath, "composer.json");
@@ -316,10 +318,15 @@ var PackageDetectorService = class {
316
318
  try {
317
319
  const content = fs.readFileSync(manifestPath, "utf8");
318
320
  const pkg = JSON.parse(content);
321
+ const packageName = pkg.name || "unknown";
322
+ let version = pkg.version;
323
+ if (!version && packageName !== "unknown") {
324
+ version = await this.fetchComposerVersionFromPackagist(packageName);
325
+ }
319
326
  return {
320
327
  type: "composer",
321
- name: pkg.name || "unknown",
322
- version: pkg.version || "0.0.0",
328
+ name: packageName,
329
+ version: version || "0.0.0",
323
330
  manifestPath
324
331
  };
325
332
  } catch (error) {
@@ -330,6 +337,37 @@ var PackageDetectorService = class {
330
337
  return null;
331
338
  }
332
339
  }
340
+ /**
341
+ * Fetch the latest version of a composer package from Packagist
342
+ */
343
+ async fetchComposerVersionFromPackagist(name) {
344
+ try {
345
+ const controller = new AbortController();
346
+ const timeoutId = setTimeout(() => controller.abort(), 3e3);
347
+ const response = await fetch2(
348
+ `https://packagist.org/packages/${name}.json`,
349
+ {
350
+ signal: controller.signal,
351
+ headers: { Accept: "application/json" }
352
+ }
353
+ );
354
+ clearTimeout(timeoutId);
355
+ if (response.ok) {
356
+ const data = await response.json();
357
+ const versions = data.package?.versions || {};
358
+ const versionKeys = Object.keys(versions).filter(
359
+ (v) => !v.includes("dev") && !v.startsWith("dev-")
360
+ );
361
+ return versionKeys[0] || Object.keys(versions)[0];
362
+ }
363
+ } catch (error) {
364
+ logger.debug(
365
+ "package-detector",
366
+ `Failed to fetch version from Packagist: ${error.message}`
367
+ );
368
+ }
369
+ return void 0;
370
+ }
333
371
  /**
334
372
  * Detect cargo package (Cargo.toml)
335
373
  */
@@ -1387,7 +1425,7 @@ var WebSocketServiceImpl = class {
1387
1425
  "websocket",
1388
1426
  `Commit ${commit.id} marked as large, fetching full details...`
1389
1427
  );
1390
- const { apiService: apiService2 } = await import("./api-BKJF4YTU.js");
1428
+ const { apiService: apiService2 } = await import("./api-DLJJ4DDC.js");
1391
1429
  const fullCommit = await apiService2.getCommit(commit.id);
1392
1430
  commit = {
1393
1431
  ...commit,
@@ -4,20 +4,20 @@ import {
4
4
  notify,
5
5
  packageDetector,
6
6
  websocketService
7
- } from "../chunk-VMK4LAM2.js";
7
+ } from "../chunk-ZPS772PW.js";
8
8
  import {
9
9
  apiService
10
- } from "../chunk-7WHS3Q3J.js";
10
+ } from "../chunk-AOMGKVON.js";
11
11
  import {
12
12
  gitService,
13
13
  projectService,
14
14
  removePidFile,
15
15
  writePidFile
16
- } from "../chunk-6G57QEQ3.js";
16
+ } from "../chunk-EZWHVRCK.js";
17
17
  import {
18
18
  authService,
19
19
  logger
20
- } from "../chunk-W6DXU2TZ.js";
20
+ } from "../chunk-GTNFXUSW.js";
21
21
 
22
22
  // src/daemon/runner.ts
23
23
  import "dotenv/config";
package/dist/index.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  commitQueue,
4
4
  packageDetector,
5
5
  websocketService
6
- } from "./chunk-VMK4LAM2.js";
6
+ } from "./chunk-ZPS772PW.js";
7
7
  import {
8
8
  apiService
9
- } from "./chunk-7WHS3Q3J.js";
9
+ } from "./chunk-AOMGKVON.js";
10
10
  import {
11
11
  getPidFilePath,
12
12
  gitService,
@@ -15,14 +15,14 @@ import {
15
15
  projectService,
16
16
  spawnDetached,
17
17
  validatePidFile
18
- } from "./chunk-6G57QEQ3.js";
18
+ } from "./chunk-EZWHVRCK.js";
19
19
  import {
20
20
  __commonJS,
21
21
  __toESM,
22
22
  authService,
23
23
  config,
24
24
  logger
25
- } from "./chunk-W6DXU2TZ.js";
25
+ } from "./chunk-GTNFXUSW.js";
26
26
 
27
27
  // node_modules/semver/internal/constants.js
28
28
  var require_constants = __commonJS({
@@ -2658,7 +2658,7 @@ function registerStatusCommand(program2) {
2658
2658
  try {
2659
2659
  const { render } = await import("ink");
2660
2660
  const { createElement } = await import("react");
2661
- const { StatusDashboard } = await import("./StatusDashboard-BHUFNUJC.js");
2661
+ const { StatusDashboard } = await import("./StatusDashboard-PWYZUDN3.js");
2662
2662
  render(createElement(StatusDashboard, { cwd }));
2663
2663
  return;
2664
2664
  } catch (error) {
@@ -4946,7 +4946,7 @@ Tasks for project ${chalk15.cyan(linkedProject.projectId)}`
4946
4946
  });
4947
4947
 
4948
4948
  // src/index.ts
4949
- var AGENT_VERSION = "1.2.46";
4949
+ var AGENT_VERSION = "1.2.47";
4950
4950
  var program = new Command2();
4951
4951
  program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(AGENT_VERSION, "-v, --version", "output the current version").addHelpText(
4952
4952
  "after",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gowelle/stint-agent",
3
- "version": "1.2.46",
3
+ "version": "1.2.47",
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-7WHS3Q3J.js";
4
- import "./chunk-W6DXU2TZ.js";
5
- export {
6
- apiService
7
- };