minovative-mind-cli 1.1.2 → 1.1.4

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
@@ -65,7 +65,27 @@ Getting started with Minovative Mind CLI is easy!
65
65
  # Commands
66
66
 
67
67
  <!-- commands -->
68
+ * [`minovative-mind-cli chat`](#minovative-mind-cli-chat)
68
69
  * [`minovative-mind-cli help [COMMAND]`](#minovative-mind-cli-help-command)
70
+ * [`minovative-mind-cli login`](#minovative-mind-cli-login)
71
+ * [`minovative-mind-cli logout`](#minovative-mind-cli-logout)
72
+
73
+ ## `minovative-mind-cli chat`
74
+
75
+ Start an interactive AI coding agent session powered by Vertex AI.
76
+
77
+ ```
78
+ USAGE
79
+ $ minovative-mind-cli chat
80
+
81
+ DESCRIPTION
82
+ Start an interactive AI coding agent session powered by Vertex AI.
83
+
84
+ EXAMPLES
85
+ $ minovative-mind-cli
86
+
87
+ $ minovative-mind-cli --help
88
+ ```
69
89
 
70
90
  ## `minovative-mind-cli help [COMMAND]`
71
91
 
@@ -84,6 +104,30 @@ FLAGS
84
104
  DESCRIPTION
85
105
  Display help for minovative-mind-cli.
86
106
  ```
107
+
108
+ ## `minovative-mind-cli login`
109
+
110
+ Sign in to your Minovative Mind account using GitHub
111
+
112
+ ```
113
+ USAGE
114
+ $ minovative-mind-cli login
115
+
116
+ DESCRIPTION
117
+ Sign in to your Minovative Mind account using GitHub
118
+ ```
119
+
120
+ ## `minovative-mind-cli logout`
121
+
122
+ Sign out of your Minovative Mind account
123
+
124
+ ```
125
+ USAGE
126
+ $ minovative-mind-cli logout
127
+
128
+ DESCRIPTION
129
+ Sign out of your Minovative Mind account
130
+ ```
87
131
  <!-- commandsstop -->
88
132
 
89
133
  ## Legal
@@ -6,6 +6,7 @@ import * as p from '@clack/prompts';
6
6
  import pc from 'picocolors';
7
7
  import { startAgentLoop } from '../services/agent.js';
8
8
  import { getAuthorizedIdToken, login } from '../services/auth.js';
9
+ import { updateWorkspaceStatus } from '../services/workspace.js';
9
10
  export default class DefaultCommand extends Command {
10
11
  static description = 'Start an interactive AI coding agent session powered by Vertex AI.';
11
12
  static examples = ['<%= config.bin %>', '<%= config.bin %> --help'];
@@ -30,6 +31,10 @@ export default class DefaultCommand extends Command {
30
31
  }
31
32
  p.log.info(`${pc.dim('Workspace:')} ${pc.cyan(workspaceRoot)}`);
32
33
  p.log.info(`${pc.dim('Commands:')} Type ${pc.yellow('/')} to open the command menu and "${pc.yellow('stop')}" to stop the ai generation. Type ${pc.yellow('exit')} to leave.`);
34
+ // Update workspace status in the background
35
+ if (idToken) {
36
+ updateWorkspaceStatus(idToken, workspaceRoot).catch(() => { });
37
+ }
33
38
  await startAgentLoop(workspaceRoot, this.config.version);
34
39
  }
35
40
  }
@@ -0,0 +1 @@
1
+ export declare function updateWorkspaceStatus(idToken: string, workspaceRoot: string): Promise<void>;
@@ -0,0 +1,51 @@
1
+ import * as path from 'path';
2
+ import { debugLog } from '../utils/logger.js';
3
+ export async function updateWorkspaceStatus(idToken, workspaceRoot) {
4
+ try {
5
+ // 1. Decode JWT to get user_id (uid)
6
+ const payloadBase64 = idToken.split('.')[1];
7
+ if (!payloadBase64)
8
+ return;
9
+ const payloadRaw = Buffer.from(payloadBase64, 'base64').toString('utf8');
10
+ const payload = JSON.parse(payloadRaw);
11
+ const uid = payload.user_id;
12
+ if (!uid)
13
+ return;
14
+ // 2. Generate a URL-safe ID for the workspace based on its path
15
+ const workspaceId = Buffer.from(workspaceRoot)
16
+ .toString('base64')
17
+ .replace(/\//g, '_')
18
+ .replace(/\+/g, '-')
19
+ .replace(/=/g, '');
20
+ // 3. Prepare the Firestore REST API payload
21
+ const url = `https://firestore.googleapis.com/v1/projects/minovative-mind-prod/databases/(default)/documents/users/${uid}/projects/${workspaceId}?updateMask.fieldPaths=name&updateMask.fieldPaths=path&updateMask.fieldPaths=workspacePath&updateMask.fieldPaths=lastUsed`;
22
+ const body = {
23
+ name: `projects/minovative-mind-prod/databases/(default)/documents/users/${uid}/projects/${workspaceId}`,
24
+ fields: {
25
+ name: { stringValue: path.basename(workspaceRoot) },
26
+ path: { stringValue: workspaceRoot },
27
+ workspacePath: { stringValue: workspaceRoot },
28
+ lastUsed: { timestampValue: new Date().toISOString() },
29
+ },
30
+ };
31
+ // 4. Send the PATCH request
32
+ const response = await fetch(url, {
33
+ method: 'PATCH',
34
+ headers: {
35
+ Authorization: `Bearer ${idToken}`,
36
+ 'Content-Type': 'application/json',
37
+ },
38
+ body: JSON.stringify(body),
39
+ });
40
+ if (!response.ok) {
41
+ const errorText = await response.text();
42
+ debugLog(`Failed to update workspace status: ${response.status} ${errorText}`);
43
+ }
44
+ else {
45
+ debugLog(`Workspace status updated successfully for ${workspaceRoot}`);
46
+ }
47
+ }
48
+ catch (error) {
49
+ debugLog(`Error updating workspace status: ${error.message}`);
50
+ }
51
+ }
@@ -1,4 +1,69 @@
1
1
  {
2
- "commands": {},
3
- "version": "1.1.2"
2
+ "commands": {
3
+ "chat": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "Start an interactive AI coding agent session powered by Vertex AI.",
7
+ "examples": [
8
+ "<%= config.bin %>",
9
+ "<%= config.bin %> --help"
10
+ ],
11
+ "flags": {},
12
+ "hasDynamicHelp": false,
13
+ "hiddenAliases": [],
14
+ "id": "chat",
15
+ "pluginAlias": "minovative-mind-cli",
16
+ "pluginName": "minovative-mind-cli",
17
+ "pluginType": "core",
18
+ "strict": true,
19
+ "enableJsonFlag": false,
20
+ "isESM": true,
21
+ "relativePath": [
22
+ "dist",
23
+ "commands",
24
+ "chat.js"
25
+ ]
26
+ },
27
+ "login": {
28
+ "aliases": [],
29
+ "args": {},
30
+ "description": "Sign in to your Minovative Mind account using GitHub",
31
+ "flags": {},
32
+ "hasDynamicHelp": false,
33
+ "hiddenAliases": [],
34
+ "id": "login",
35
+ "pluginAlias": "minovative-mind-cli",
36
+ "pluginName": "minovative-mind-cli",
37
+ "pluginType": "core",
38
+ "strict": true,
39
+ "enableJsonFlag": false,
40
+ "isESM": true,
41
+ "relativePath": [
42
+ "dist",
43
+ "commands",
44
+ "login.js"
45
+ ]
46
+ },
47
+ "logout": {
48
+ "aliases": [],
49
+ "args": {},
50
+ "description": "Sign out of your Minovative Mind account",
51
+ "flags": {},
52
+ "hasDynamicHelp": false,
53
+ "hiddenAliases": [],
54
+ "id": "logout",
55
+ "pluginAlias": "minovative-mind-cli",
56
+ "pluginName": "minovative-mind-cli",
57
+ "pluginType": "core",
58
+ "strict": true,
59
+ "enableJsonFlag": false,
60
+ "isESM": true,
61
+ "relativePath": [
62
+ "dist",
63
+ "commands",
64
+ "logout.js"
65
+ ]
66
+ }
67
+ },
68
+ "version": "1.1.4"
4
69
  }
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "minovative-mind-cli",
3
3
  "description": "An automated AI agent powered by Vertex AI that helps you write software",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
5
5
  "author": "Daniel Ward",
6
- "bin": "./bin/run.js",
6
+ "bin": {
7
+ "minovative-mind-cli": "./bin/run.js"
8
+ },
7
9
  "bugs": "https://github.com/quarantiine/minovative-mind-cli/issues",
8
10
  "dependencies": {
9
11
  "@clack/prompts": "^0.11.0",
@@ -66,14 +68,17 @@
66
68
  ],
67
69
  "topicSeparator": " "
68
70
  },
69
- "repository": "quarantiine/minovative-mind-cli",
71
+ "repository": {
72
+ "type": "git",
73
+ "url": "git+https://github.com/quarantiine/minovative-mind-cli.git"
74
+ },
70
75
  "scripts": {
71
76
  "build": "shx rm -rf dist && tsc -b",
72
77
  "prepare": "npm run build",
73
78
  "lint": "eslint",
74
79
  "postpack": "shx rm -f oclif.manifest.json",
75
80
  "posttest": "npm run lint",
76
- "prepack": "oclif manifest && oclif readme --no-source-links",
81
+ "prepack": "npm run build && oclif manifest && oclif readme --no-source-links",
77
82
  "test": "mocha --forbid-only \"test/**/*.test.ts\"",
78
83
  "version": "oclif readme --no-source-links && git add README.md"
79
84
  },