acmecode 1.0.5 → 1.0.6

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.
Files changed (3) hide show
  1. package/dist/index.js +13 -13
  2. package/package.json +3 -3
  3. package/src/index.ts +69 -59
package/dist/index.js CHANGED
@@ -2,22 +2,22 @@ import { Command } from "commander";
2
2
  import { config as dotenvConfig } from "dotenv";
3
3
  dotenvConfig({ quiet: true });
4
4
  import pkg from "../package.json" with { type: "json" };
5
- import React from 'react';
6
- import { render } from 'ink';
7
- import App from '@acmecode/tui/App.js';
8
- import { createSession, listSessions } from '@acmecode/core/session/index.js';
9
- import crypto from 'crypto';
10
- import path from 'path';
5
+ import React from "react";
6
+ import { render } from "ink";
7
+ import App from "@acmecloud/tui/App.js";
8
+ import { createSession, listSessions, } from "@acmecloud/core/session/index.js";
9
+ import crypto from "crypto";
10
+ import path from "path";
11
11
  function main() {
12
12
  const program = new Command();
13
13
  program
14
14
  .name("acmecode")
15
15
  .description("AI Coding Assistant CLI")
16
16
  .version(pkg.version)
17
- .argument('[dir]', 'Directory to run in', '.')
18
- .option('-n, --new', 'Create a new session')
19
- .option('-s, --session <id>', 'Resume a specific session ID')
20
- .option('--list', 'List all sessions')
17
+ .argument("[dir]", "Directory to run in", ".")
18
+ .option("-n, --new", "Create a new session")
19
+ .option("-s, --session <id>", "Resume a specific session ID")
20
+ .option("--list", "List all sessions")
21
21
  .action((dir, options) => {
22
22
  // Change current working directory to the specified directory
23
23
  const targetDir = path.resolve(process.cwd(), dir);
@@ -30,8 +30,8 @@ function main() {
30
30
  }
31
31
  if (options.list) {
32
32
  const sessions = listSessions();
33
- console.log('Available Sessions:');
34
- sessions.forEach(s => console.log(`- ${s.id} (${s.title}) updated at ${s.updated_at}`));
33
+ console.log("Available Sessions:");
34
+ sessions.forEach((s) => console.log(`- ${s.id} (${s.title}) updated at ${s.updated_at}`));
35
35
  process.exit(0);
36
36
  }
37
37
  let sessionId = options.session;
@@ -45,7 +45,7 @@ function main() {
45
45
  onExit: () => {
46
46
  unmount();
47
47
  process.exit(0);
48
- }
48
+ },
49
49
  }));
50
50
  });
51
51
  program.parse();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acmecode",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "description": "AI Coding Assistant CLI",
6
6
  "main": "dist/index.js",
@@ -13,8 +13,8 @@
13
13
  "dev": "tsx src/index.ts"
14
14
  },
15
15
  "dependencies": {
16
- "@acmecloud/core": "^1.0.4",
17
- "@acmecloud/tui": "^1.0.4",
16
+ "@acmecloud/core": "^1.0.5",
17
+ "@acmecloud/tui": "^1.0.5",
18
18
  "commander": "^14.0.3",
19
19
  "ink": "^6.8.0",
20
20
  "react": "^19.2.4"
package/src/index.ts CHANGED
@@ -1,59 +1,69 @@
1
- import { Command } from "commander";
2
- import { config as dotenvConfig } from "dotenv";
3
- dotenvConfig({ quiet: true });
4
- import pkg from "../package.json" with { type: "json" };
5
- import React from 'react';
6
- import { render } from 'ink';
7
- import App from '@acmecode/tui/App.js';
8
- import { createSession, listSessions, deleteSession } from '@acmecode/core/session/index.js';
9
- import crypto from 'crypto';
10
- import path from 'path';
11
-
12
- function main() {
13
- const program = new Command();
14
-
15
- program
16
- .name("acmecode")
17
- .description("AI Coding Assistant CLI")
18
- .version(pkg.version)
19
- .argument('[dir]', 'Directory to run in', '.')
20
- .option('-n, --new', 'Create a new session')
21
- .option('-s, --session <id>', 'Resume a specific session ID')
22
- .option('--list', 'List all sessions')
23
- .action((dir, options) => {
24
- // Change current working directory to the specified directory
25
- const targetDir = path.resolve(process.cwd(), dir);
26
- try {
27
- process.chdir(targetDir);
28
- } catch (err: any) {
29
- console.error(`Failed to change directory to ${targetDir}: ${err.message}`);
30
- process.exit(1);
31
- }
32
- if (options.list) {
33
- const sessions = listSessions();
34
- console.log('Available Sessions:');
35
- sessions.forEach(s => console.log(`- ${s.id} (${s.title}) updated at ${s.updated_at}`));
36
- process.exit(0);
37
- }
38
-
39
- let sessionId = options.session;
40
-
41
- // Always create a fresh session unless explicitly resuming one
42
- if (!sessionId) {
43
- sessionId = crypto.randomUUID().slice(0, 8);
44
- createSession(sessionId, `Session ${new Date().toLocaleString()}`);
45
- }
46
-
47
- const { unmount } = render(React.createElement(App, {
48
- sessionId: sessionId,
49
- onExit: () => {
50
- unmount();
51
- process.exit(0);
52
- }
53
- }));
54
- });
55
-
56
- program.parse();
57
- }
58
-
59
- main();
1
+ import { Command } from "commander";
2
+ import { config as dotenvConfig } from "dotenv";
3
+ dotenvConfig({ quiet: true });
4
+ import pkg from "../package.json" with { type: "json" };
5
+ import React from "react";
6
+ import { render } from "ink";
7
+ import App from "@acmecloud/tui/App.js";
8
+ import {
9
+ createSession,
10
+ listSessions,
11
+ deleteSession,
12
+ } from "@acmecloud/core/session/index.js";
13
+ import crypto from "crypto";
14
+ import path from "path";
15
+
16
+ function main() {
17
+ const program = new Command();
18
+
19
+ program
20
+ .name("acmecode")
21
+ .description("AI Coding Assistant CLI")
22
+ .version(pkg.version)
23
+ .argument("[dir]", "Directory to run in", ".")
24
+ .option("-n, --new", "Create a new session")
25
+ .option("-s, --session <id>", "Resume a specific session ID")
26
+ .option("--list", "List all sessions")
27
+ .action((dir, options) => {
28
+ // Change current working directory to the specified directory
29
+ const targetDir = path.resolve(process.cwd(), dir);
30
+ try {
31
+ process.chdir(targetDir);
32
+ } catch (err: any) {
33
+ console.error(
34
+ `Failed to change directory to ${targetDir}: ${err.message}`,
35
+ );
36
+ process.exit(1);
37
+ }
38
+ if (options.list) {
39
+ const sessions = listSessions();
40
+ console.log("Available Sessions:");
41
+ sessions.forEach((s) =>
42
+ console.log(`- ${s.id} (${s.title}) updated at ${s.updated_at}`),
43
+ );
44
+ process.exit(0);
45
+ }
46
+
47
+ let sessionId = options.session;
48
+
49
+ // Always create a fresh session unless explicitly resuming one
50
+ if (!sessionId) {
51
+ sessionId = crypto.randomUUID().slice(0, 8);
52
+ createSession(sessionId, `Session ${new Date().toLocaleString()}`);
53
+ }
54
+
55
+ const { unmount } = render(
56
+ React.createElement(App, {
57
+ sessionId: sessionId,
58
+ onExit: () => {
59
+ unmount();
60
+ process.exit(0);
61
+ },
62
+ }),
63
+ );
64
+ });
65
+
66
+ program.parse();
67
+ }
68
+
69
+ main();