@gowelle/stint-agent 1.2.21 → 1.2.22

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/README.md CHANGED
@@ -20,6 +20,7 @@ The official CLI agent for [Stint](https://stint.codes) — a lightweight daemon
20
20
  - 🚀 Multiple release channels (stable/beta/nightly)
21
21
  - 🔍 Built-in environment diagnostics
22
22
  - 📈 Resource usage monitoring
23
+ - 📁 File selection for commits (sync changed files to web app)
23
24
 
24
25
  For detailed feature documentation, see the **[Features Guide](docs/features.md)**.
25
26
 
@@ -2,10 +2,10 @@ import {
2
2
  gitService,
3
3
  projectService,
4
4
  validatePidFile
5
- } from "./chunk-5OXEEP67.js";
5
+ } from "./chunk-TQHWJWBZ.js";
6
6
  import {
7
7
  authService
8
- } from "./chunk-E5GW4WNQ.js";
8
+ } from "./chunk-7H6J2KCA.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-KMYPMLEH.js";
4
+ import "./chunk-7H6J2KCA.js";
5
+ export {
6
+ apiService
7
+ };
@@ -308,7 +308,7 @@ var AuthServiceImpl = class {
308
308
  return null;
309
309
  }
310
310
  try {
311
- const { apiService } = await import("./api-EZ3J5BUL.js");
311
+ const { apiService } = await import("./api-U7WJAW3E.js");
312
312
  const user = await apiService.getCurrentUser();
313
313
  logger.info("auth", `Token validated for user: ${user.email}`);
314
314
  return user;
@@ -2,7 +2,7 @@ import {
2
2
  authService,
3
3
  config,
4
4
  logger
5
- } from "./chunk-E5GW4WNQ.js";
5
+ } from "./chunk-7H6J2KCA.js";
6
6
 
7
7
  // src/utils/circuit-breaker.ts
8
8
  var CircuitBreaker = class {
@@ -98,7 +98,7 @@ var CircuitBreaker = class {
98
98
  };
99
99
 
100
100
  // src/services/api.ts
101
- var AGENT_VERSION = "1.2.21";
101
+ var AGENT_VERSION = "1.2.22";
102
102
  var ApiServiceImpl = class {
103
103
  sessionId = null;
104
104
  circuitBreaker = new CircuitBreaker({
@@ -330,8 +330,9 @@ var ApiServiceImpl = class {
330
330
  * Sync project repository information with the API
331
331
  * @param projectId - Project ID
332
332
  * @param data - Repository information (path, remote URL, branches)
333
+ * @param changedFiles - Optional array of changed files for commit file selection
333
334
  */
334
- async syncProject(projectId, data) {
335
+ async syncProject(projectId, data, changedFiles) {
335
336
  logger.info("api", `Syncing project ${projectId}`);
336
337
  await this.withRetry(async () => {
337
338
  const payload = {
@@ -341,11 +342,14 @@ var ApiServiceImpl = class {
341
342
  current_branch: data.currentBranch,
342
343
  branches: data.branches
343
344
  };
345
+ if (changedFiles && changedFiles.length > 0) {
346
+ payload.changed_files = changedFiles;
347
+ }
344
348
  await this.request(`/api/agent/projects/${projectId}/sync`, {
345
349
  method: "POST",
346
350
  body: JSON.stringify(payload)
347
351
  });
348
- logger.success("api", `Project ${projectId} synced`);
352
+ logger.success("api", `Project ${projectId} synced (${changedFiles?.length ?? 0} changed files)`);
349
353
  }, "Sync project");
350
354
  }
351
355
  /**
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  config,
3
3
  logger
4
- } from "./chunk-E5GW4WNQ.js";
4
+ } from "./chunk-7H6J2KCA.js";
5
5
 
6
6
  // src/services/git.ts
7
7
  import simpleGit from "simple-git";
@@ -150,6 +150,73 @@ var GitServiceImpl = class {
150
150
  throw new Error(`Failed to get git status: ${error.message}`);
151
151
  }
152
152
  }
153
+ /**
154
+ * Get detailed information about all changed files in the working directory
155
+ * Used for file selection during commit generation in the web app
156
+ * @param path - Repository path
157
+ * @returns Array of changed files with their status and staging state
158
+ */
159
+ async getChangedFiles(path3) {
160
+ try {
161
+ const git = this.getGit(path3);
162
+ const status = await git.status();
163
+ const changedFiles = [];
164
+ for (const file of status.staged) {
165
+ let fileStatus = "modified";
166
+ if (status.created.includes(file)) {
167
+ fileStatus = "added";
168
+ } else if (status.deleted.includes(file)) {
169
+ fileStatus = "deleted";
170
+ } else if (status.renamed.some((r) => r.to === file)) {
171
+ fileStatus = "renamed";
172
+ }
173
+ changedFiles.push({
174
+ path: file,
175
+ status: fileStatus,
176
+ staged: true
177
+ });
178
+ }
179
+ for (const file of status.modified) {
180
+ if (!status.staged.includes(file)) {
181
+ changedFiles.push({
182
+ path: file,
183
+ status: "modified",
184
+ staged: false
185
+ });
186
+ }
187
+ }
188
+ for (const file of status.deleted) {
189
+ if (!status.staged.includes(file)) {
190
+ changedFiles.push({
191
+ path: file,
192
+ status: "deleted",
193
+ staged: false
194
+ });
195
+ }
196
+ }
197
+ for (const file of status.not_added) {
198
+ changedFiles.push({
199
+ path: file,
200
+ status: "untracked",
201
+ staged: false
202
+ });
203
+ }
204
+ for (const renamed of status.renamed) {
205
+ if (!status.staged.includes(renamed.to)) {
206
+ changedFiles.push({
207
+ path: renamed.to,
208
+ status: "renamed",
209
+ staged: false
210
+ });
211
+ }
212
+ }
213
+ logger.info("git", `Found ${changedFiles.length} changed files in ${path3}`);
214
+ return changedFiles;
215
+ } catch (error) {
216
+ logger.error("git", `Failed to get changed files in ${path3}`, error);
217
+ throw new Error(`Failed to get changed files: ${error.message}`);
218
+ }
219
+ }
153
220
  /**
154
221
  * Push commits to remote repository
155
222
  * @param path - Repository path
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  apiService
3
- } from "./chunk-CJHTK5DX.js";
3
+ } from "./chunk-KMYPMLEH.js";
4
4
  import {
5
5
  gitService,
6
6
  projectService
7
- } from "./chunk-5OXEEP67.js";
7
+ } from "./chunk-TQHWJWBZ.js";
8
8
  import {
9
9
  authService,
10
10
  config,
11
11
  logger
12
- } from "./chunk-E5GW4WNQ.js";
12
+ } from "./chunk-7H6J2KCA.js";
13
13
 
14
14
  // src/utils/notify.ts
15
15
  import notifier from "node-notifier";
@@ -93,7 +93,7 @@ var HookService = class {
93
93
  const startTime = Date.now();
94
94
  logger.debug("hooks", `Executing hook: ${hook.name} (${hook.command})`);
95
95
  const timeout = hook.timeout || 3e4;
96
- const childProcess = exec(hook.command, {
96
+ exec(hook.command, {
97
97
  cwd,
98
98
  timeout,
99
99
  maxBuffer: 10 * 1024 * 1024
@@ -3,20 +3,20 @@ import {
3
3
  commitQueue,
4
4
  notify,
5
5
  websocketService
6
- } from "../chunk-EGEDPYQY.js";
6
+ } from "../chunk-ZNBNEPPK.js";
7
7
  import {
8
8
  apiService
9
- } from "../chunk-CJHTK5DX.js";
9
+ } from "../chunk-KMYPMLEH.js";
10
10
  import {
11
11
  gitService,
12
12
  projectService,
13
13
  removePidFile,
14
14
  writePidFile
15
- } from "../chunk-5OXEEP67.js";
15
+ } from "../chunk-TQHWJWBZ.js";
16
16
  import {
17
17
  authService,
18
18
  logger
19
- } from "../chunk-E5GW4WNQ.js";
19
+ } from "../chunk-7H6J2KCA.js";
20
20
 
21
21
  // src/daemon/runner.ts
22
22
  import "dotenv/config";
@@ -161,7 +161,8 @@ var FileWatcher = class {
161
161
  return;
162
162
  }
163
163
  const repoInfo = await gitService.getRepoInfo(projectPath);
164
- await apiService.syncProject(projectId, repoInfo);
164
+ const changedFiles = await gitService.getChangedFiles(projectPath);
165
+ await apiService.syncProject(projectId, repoInfo, changedFiles);
165
166
  logger.success("watcher", `Synced project ${projectId}`);
166
167
  let projectName = projectId;
167
168
  try {
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  commitQueue,
4
4
  websocketService
5
- } from "./chunk-EGEDPYQY.js";
5
+ } from "./chunk-ZNBNEPPK.js";
6
6
  import {
7
7
  apiService
8
- } from "./chunk-CJHTK5DX.js";
8
+ } from "./chunk-KMYPMLEH.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-5OXEEP67.js";
17
+ } from "./chunk-TQHWJWBZ.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __toESM,
21
21
  authService,
22
22
  config,
23
23
  logger
24
- } from "./chunk-E5GW4WNQ.js";
24
+ } from "./chunk-7H6J2KCA.js";
25
25
 
26
26
  // node_modules/semver/internal/constants.js
27
27
  var require_constants = __commonJS({
@@ -2552,7 +2552,7 @@ function registerStatusCommand(program2) {
2552
2552
  try {
2553
2553
  const { render } = await import("ink");
2554
2554
  const { createElement } = await import("react");
2555
- const { StatusDashboard } = await import("./StatusDashboard-A6WLLY4U.js");
2555
+ const { StatusDashboard } = await import("./StatusDashboard-LYZL3IQH.js");
2556
2556
  render(createElement(StatusDashboard, { cwd }));
2557
2557
  return;
2558
2558
  } catch (error) {
@@ -2660,10 +2660,12 @@ function registerSyncCommand(program2) {
2660
2660
  spinner.text = `Found ${totalFiles} files to analyze...`;
2661
2661
  spinner.text = "Getting branch information...";
2662
2662
  const repoInfo = await gitService.getRepoInfo(cwd);
2663
+ spinner.text = "Getting changed files...";
2664
+ const changedFiles = await gitService.getChangedFiles(cwd);
2663
2665
  spinner.text = "Preparing sync payload...";
2664
2666
  const syncSpinner = ora7("Connecting to server...").start();
2665
2667
  try {
2666
- await apiService.syncProject(linkedProject.projectId, repoInfo);
2668
+ await apiService.syncProject(linkedProject.projectId, repoInfo, changedFiles);
2667
2669
  syncSpinner.succeed("Server sync completed");
2668
2670
  } catch (error) {
2669
2671
  syncSpinner.fail("Server sync failed");
@@ -2672,6 +2674,7 @@ function registerSyncCommand(program2) {
2672
2674
  console.log(chalk7.green("\n\u2713 Repository sync completed"));
2673
2675
  console.log(chalk7.gray("\u2500".repeat(50)));
2674
2676
  console.log(`${chalk7.bold("Files:")} ${totalFiles} total (${status.staged.length} staged, ${status.unstaged.length} modified, ${status.untracked.length} untracked)`);
2677
+ console.log(`${chalk7.bold("Changed:")} ${changedFiles.length} files synced for commit selection`);
2675
2678
  console.log(`${chalk7.bold("Project ID:")} ${linkedProject.projectId}`);
2676
2679
  console.log(`${chalk7.bold("Branch:")} ${repoInfo.currentBranch}`);
2677
2680
  console.log(`${chalk7.bold("Commit:")} ${repoInfo.lastCommitSha.substring(0, 7)} - ${repoInfo.lastCommitMessage}`);
@@ -4151,7 +4154,7 @@ function registerDoctorCommand(program2) {
4151
4154
  }
4152
4155
 
4153
4156
  // src/index.ts
4154
- var AGENT_VERSION = "1.2.21";
4157
+ var AGENT_VERSION = "1.2.22";
4155
4158
  var program = new Command();
4156
4159
  program.name("stint").description("Stint Agent - Local daemon for Stint Project Assistant").version(AGENT_VERSION, "-v, --version", "output the current version").addHelpText("after", `
4157
4160
  ${chalk14.bold("Examples:")}
package/package.json CHANGED
@@ -1,92 +1,98 @@
1
- {
2
- "name": "@gowelle/stint-agent",
3
- "version": "1.2.21",
4
- "description": "Local agent for Stint - Project Assistant",
5
- "author": "Gowelle John <gowelle.john@icloud.com>",
6
- "license": "MIT",
7
- "type": "module",
8
- "bin": {
9
- "stint": "./dist/index.js"
10
- },
11
- "files": [
12
- "dist",
13
- "assets",
14
- "README.md",
15
- "LICENSE"
16
- ],
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/gowelle/stint-agent.git"
20
- },
21
- "homepage": "https://github.com/gowelle/stint-agent#readme",
22
- "bugs": {
23
- "url": "https://github.com/gowelle/stint-agent/issues"
24
- },
25
- "keywords": [
26
- "stint",
27
- "agent",
28
- "project-assistant",
29
- "cli",
30
- "git"
31
- ],
32
- "dependencies": {
33
- "@inquirer/prompts": "^8.1.0",
34
- "chalk": "^5.3.0",
35
- "commander": "^12.0.0",
36
- "conf": "^12.0.0",
37
- "dotenv": "^17.2.3",
38
- "ink": "^5.2.1",
39
- "laravel-echo": "^2.2.6",
40
- "node-fetch": "^3.3.2",
41
- "node-notifier": "^10.0.1",
42
- "open": "^10.0.0",
43
- "ora": "^8.0.1",
44
- "prompts": "^2.4.2",
45
- "pusher-js": "^8.4.0",
46
- "react": "^18.3.1",
47
- "simple-git": "^3.22.0",
48
- "ws": "^8.16.0"
49
- },
50
- "devDependencies": {
51
- "@types/node": "^20.11.0",
52
- "@types/node-notifier": "^8.0.5",
53
- "@types/prompts": "^2.4.9",
54
- "@types/react": "^18.3.27",
55
- "@types/ws": "^8.5.10",
56
- "@typescript-eslint/eslint-plugin": "^8.50.0",
57
- "@typescript-eslint/parser": "^8.50.0",
58
- "@vitest/coverage-v8": "^4.0.16",
59
- "eslint": "^8.56.0",
60
- "ts-node": "^10.9.2",
61
- "tsup": "^8.0.1",
62
- "typescript": "^5.3.3",
63
- "vitest": "^4.0.16"
64
- },
65
- "engines": {
66
- "node": ">=20.0.0"
67
- },
68
- "stint": {
69
- "channels": {
70
- "stable": {
71
- "pattern": "^\\d+\\.\\d+\\.\\d+$",
72
- "description": "Production-ready releases"
73
- },
74
- "beta": {
75
- "pattern": "^\\d+\\.\\d+\\.\\d+-beta\\.\\d+$",
76
- "description": "Pre-release versions for testing"
77
- },
78
- "nightly": {
79
- "pattern": "^\\d+\\.\\d+\\.\\d+-nightly\\.\\d{8}$",
80
- "description": "Nightly builds from main branch"
81
- }
82
- },
83
- "defaultChannel": "stable"
84
- },
85
- "scripts": {
86
- "build": "tsup",
87
- "dev": "tsup --watch",
88
- "lint": "eslint src",
89
- "test": "vitest",
90
- "test:update": "node --loader ts-node/esm scripts/test-update.ts"
91
- }
92
- }
1
+ {
2
+ "name": "@gowelle/stint-agent",
3
+ "version": "1.2.22",
4
+ "description": "Local agent for Stint - Project Assistant",
5
+ "author": "Gowelle John <gowelle.john@icloud.com>",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "bin": {
9
+ "stint": "./dist/index.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "assets",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/gowelle/stint-agent.git"
20
+ },
21
+ "homepage": "https://github.com/gowelle/stint-agent#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/gowelle/stint-agent/issues"
24
+ },
25
+ "keywords": [
26
+ "stint",
27
+ "agent",
28
+ "project-assistant",
29
+ "cli",
30
+ "git"
31
+ ],
32
+ "scripts": {
33
+ "build": "tsup",
34
+ "dev": "tsup --watch",
35
+ "lint": "eslint src",
36
+ "test": "vitest",
37
+ "test:update": "node --loader ts-node/esm scripts/test-update.ts",
38
+ "prepublishOnly": "npm run build"
39
+ },
40
+ "dependencies": {
41
+ "@inquirer/prompts": "^8.1.0",
42
+ "chalk": "^5.3.0",
43
+ "commander": "^12.0.0",
44
+ "conf": "^12.0.0",
45
+ "dotenv": "^17.2.3",
46
+ "ink": "^5.2.1",
47
+ "laravel-echo": "^2.2.6",
48
+ "node-fetch": "^3.3.2",
49
+ "node-notifier": "^10.0.1",
50
+ "open": "^10.0.0",
51
+ "ora": "^8.0.1",
52
+ "prompts": "^2.4.2",
53
+ "pusher-js": "^8.4.0",
54
+ "react": "^18.3.1",
55
+ "simple-git": "^3.22.0",
56
+ "ws": "^8.16.0"
57
+ },
58
+ "devDependencies": {
59
+ "@types/node": "^20.11.0",
60
+ "@types/node-notifier": "^8.0.5",
61
+ "@types/prompts": "^2.4.9",
62
+ "@types/react": "^18.3.27",
63
+ "@types/ws": "^8.5.10",
64
+ "@typescript-eslint/eslint-plugin": "^8.50.0",
65
+ "@typescript-eslint/parser": "^8.50.0",
66
+ "@vitest/coverage-v8": "^4.0.16",
67
+ "eslint": "^8.56.0",
68
+ "ts-node": "^10.9.2",
69
+ "tsup": "^8.0.1",
70
+ "typescript": "^5.3.3",
71
+ "vitest": "^4.0.16"
72
+ },
73
+ "engines": {
74
+ "node": ">=20.0.0"
75
+ },
76
+ "stint": {
77
+ "channels": {
78
+ "stable": {
79
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
80
+ "description": "Production-ready releases"
81
+ },
82
+ "beta": {
83
+ "pattern": "^\\d+\\.\\d+\\.\\d+-beta\\.\\d+$",
84
+ "description": "Pre-release versions for testing"
85
+ },
86
+ "nightly": {
87
+ "pattern": "^\\d+\\.\\d+\\.\\d+-nightly\\.\\d{8}$",
88
+ "description": "Nightly builds from main branch"
89
+ }
90
+ },
91
+ "defaultChannel": "stable"
92
+ },
93
+ "pnpm": {
94
+ "onlyBuiltDependencies": [
95
+ "esbuild"
96
+ ]
97
+ }
98
+ }
@@ -1,7 +0,0 @@
1
- import {
2
- apiService
3
- } from "./chunk-CJHTK5DX.js";
4
- import "./chunk-E5GW4WNQ.js";
5
- export {
6
- apiService
7
- };