@gowelle/stint-agent 1.2.46 → 1.2.48

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-DO2UM4KG.js";
6
6
  import {
7
7
  authService
8
- } from "./chunk-W6DXU2TZ.js";
8
+ } from "./chunk-FX5SUMJG.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-GFOTV2EU.js";
4
+ import "./chunk-FX5SUMJG.js";
5
+ export {
6
+ apiService
7
+ };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  apiService
3
- } from "./chunk-7WHS3Q3J.js";
3
+ } from "./chunk-GFOTV2EU.js";
4
4
  import {
5
5
  gitService,
6
6
  projectService
7
- } from "./chunk-6G57QEQ3.js";
7
+ } from "./chunk-DO2UM4KG.js";
8
8
  import {
9
9
  authService,
10
10
  config,
11
11
  logger
12
- } from "./chunk-W6DXU2TZ.js";
12
+ } from "./chunk-FX5SUMJG.js";
13
13
 
14
14
  // src/services/package-detector.ts
15
15
  import fs from "fs";
@@ -165,7 +165,11 @@ var PackageDetectorService = class {
165
165
  if (response.ok) {
166
166
  const data = await response.json();
167
167
  const downloads = data.package?.downloads || {};
168
- const latestVersion = Object.keys(data.package?.versions || {}).pop() || "";
168
+ const versions = data.package?.versions || {};
169
+ const versionKeys = Object.keys(versions).filter(
170
+ (v) => !v.includes("dev") && !v.startsWith("dev-")
171
+ );
172
+ const latestVersion = versionKeys[0] || Object.keys(versions)[0] || "";
169
173
  return {
170
174
  isPublished: true,
171
175
  publishedVersion: latestVersion,
@@ -307,6 +311,8 @@ var PackageDetectorService = class {
307
311
  }
308
312
  /**
309
313
  * Detect composer package (composer.json)
314
+ * Note: Composer encourages using git tags for versioning, so we fetch
315
+ * the version from Packagist if not specified locally in composer.json.
310
316
  */
311
317
  async detectComposer(projectPath) {
312
318
  const manifestPath = path.join(projectPath, "composer.json");
@@ -316,10 +322,15 @@ var PackageDetectorService = class {
316
322
  try {
317
323
  const content = fs.readFileSync(manifestPath, "utf8");
318
324
  const pkg = JSON.parse(content);
325
+ const packageName = pkg.name || "unknown";
326
+ let version = pkg.version;
327
+ if (!version && packageName !== "unknown") {
328
+ version = await this.fetchComposerVersionFromPackagist(packageName);
329
+ }
319
330
  return {
320
331
  type: "composer",
321
- name: pkg.name || "unknown",
322
- version: pkg.version || "0.0.0",
332
+ name: packageName,
333
+ version: version || "0.0.0",
323
334
  manifestPath
324
335
  };
325
336
  } catch (error) {
@@ -330,6 +341,37 @@ var PackageDetectorService = class {
330
341
  return null;
331
342
  }
332
343
  }
344
+ /**
345
+ * Fetch the latest version of a composer package from Packagist
346
+ */
347
+ async fetchComposerVersionFromPackagist(name) {
348
+ try {
349
+ const controller = new AbortController();
350
+ const timeoutId = setTimeout(() => controller.abort(), 3e3);
351
+ const response = await fetch2(
352
+ `https://packagist.org/packages/${name}.json`,
353
+ {
354
+ signal: controller.signal,
355
+ headers: { Accept: "application/json" }
356
+ }
357
+ );
358
+ clearTimeout(timeoutId);
359
+ if (response.ok) {
360
+ const data = await response.json();
361
+ const versions = data.package?.versions || {};
362
+ const versionKeys = Object.keys(versions).filter(
363
+ (v) => !v.includes("dev") && !v.startsWith("dev-")
364
+ );
365
+ return versionKeys[0] || Object.keys(versions)[0];
366
+ }
367
+ } catch (error) {
368
+ logger.debug(
369
+ "package-detector",
370
+ `Failed to fetch version from Packagist: ${error.message}`
371
+ );
372
+ }
373
+ return void 0;
374
+ }
333
375
  /**
334
376
  * Detect cargo package (Cargo.toml)
335
377
  */
@@ -1387,7 +1429,7 @@ var WebSocketServiceImpl = class {
1387
1429
  "websocket",
1388
1430
  `Commit ${commit.id} marked as large, fetching full details...`
1389
1431
  );
1390
- const { apiService: apiService2 } = await import("./api-BKJF4YTU.js");
1432
+ const { apiService: apiService2 } = await import("./api-5NWCQKIO.js");
1391
1433
  const fullCommit = await apiService2.getCommit(commit.id);
1392
1434
  commit = {
1393
1435
  ...commit,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  config,
3
3
  logger
4
- } from "./chunk-W6DXU2TZ.js";
4
+ } from "./chunk-FX5SUMJG.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-5NWCQKIO.js");
362
362
  const user = await apiService.getCurrentUser();
363
363
  logger.info("auth", `Token validated for user: ${user.email}`);
364
364
  return user;
@@ -2,7 +2,7 @@ import {
2
2
  authService,
3
3
  config,
4
4
  logger
5
- } from "./chunk-W6DXU2TZ.js";
5
+ } from "./chunk-FX5SUMJG.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.48";
104
104
  var ApiServiceImpl = class {
105
105
  sessionId = null;
106
106
  circuitBreaker = new CircuitBreaker({
@@ -4,20 +4,20 @@ import {
4
4
  notify,
5
5
  packageDetector,
6
6
  websocketService
7
- } from "../chunk-VMK4LAM2.js";
7
+ } from "../chunk-BXL4FWJP.js";
8
8
  import {
9
9
  apiService
10
- } from "../chunk-7WHS3Q3J.js";
10
+ } from "../chunk-GFOTV2EU.js";
11
11
  import {
12
12
  gitService,
13
13
  projectService,
14
14
  removePidFile,
15
15
  writePidFile
16
- } from "../chunk-6G57QEQ3.js";
16
+ } from "../chunk-DO2UM4KG.js";
17
17
  import {
18
18
  authService,
19
19
  logger
20
- } from "../chunk-W6DXU2TZ.js";
20
+ } from "../chunk-FX5SUMJG.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-BXL4FWJP.js";
7
7
  import {
8
8
  apiService
9
- } from "./chunk-7WHS3Q3J.js";
9
+ } from "./chunk-GFOTV2EU.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-DO2UM4KG.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-FX5SUMJG.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-EEY7KFZW.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.48";
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.48",
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
- };