autohand-cli 0.2.0 → 0.4.0

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.

Potentially problematic release.


This version of autohand-cli might be problematic. Click here for more details.

@@ -5,7 +5,7 @@ import readline from "readline";
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "autohand-cli",
8
- version: "0.2.0",
8
+ version: "0.4.0",
9
9
  description: "Autohand interactive coding agent CLI powered by LLMs.",
10
10
  type: "module",
11
11
  bin: {
package/dist/index.cjs CHANGED
@@ -36,7 +36,7 @@ var init_package = __esm({
36
36
  "package.json"() {
37
37
  package_default = {
38
38
  name: "autohand-cli",
39
- version: "0.2.0",
39
+ version: "0.4.0",
40
40
  description: "Autohand interactive coding agent CLI powered by LLMs.",
41
41
  type: "module",
42
42
  bin: {
@@ -11276,6 +11276,29 @@ var AutohandAgent = class {
11276
11276
  }
11277
11277
  await this.runInteractiveLoop();
11278
11278
  }
11279
+ /**
11280
+ * Run a single instruction in command mode (non-interactive)
11281
+ * This initializes all necessary context before executing the instruction
11282
+ */
11283
+ async runCommandMode(instruction) {
11284
+ await this.sessionManager.initialize();
11285
+ await this.projectManager.initialize();
11286
+ await this.memoryManager.initialize();
11287
+ await this.resetConversationContext();
11288
+ const providerSettings = getProviderConfig(this.runtime.config, this.activeProvider);
11289
+ const model2 = this.runtime.options.model ?? providerSettings?.model ?? "unconfigured";
11290
+ await this.sessionManager.createSession(this.runtime.workspaceRoot, model2);
11291
+ const session2 = this.sessionManager.getCurrentSession();
11292
+ if (session2) {
11293
+ await this.telemetryManager.startSession(
11294
+ session2.metadata.sessionId,
11295
+ model2,
11296
+ this.activeProvider
11297
+ );
11298
+ }
11299
+ await this.runInstruction(instruction);
11300
+ await this.telemetryManager.endSession("completed");
11301
+ }
11279
11302
  async resumeSession(sessionId) {
11280
11303
  await this.sessionManager.initialize();
11281
11304
  await this.projectManager.initialize();
@@ -13139,6 +13162,7 @@ ${import_chalk31.default.gray("\u203A")} ${inputPreview}${import_chalk31.default
13139
13162
  };
13140
13163
 
13141
13164
  // src/index.ts
13165
+ process.title = "autohand";
13142
13166
  function getGitCommit() {
13143
13167
  try {
13144
13168
  return (0, import_node_child_process10.execSync)("git rev-parse --short HEAD", { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
@@ -13238,7 +13262,7 @@ async function runCLI(options) {
13238
13262
  const files = new FileActionManager(workspaceRoot);
13239
13263
  const agent = new AutohandAgent(llmProvider, files, runtime);
13240
13264
  if (options.prompt) {
13241
- await agent.runInstruction(options.prompt);
13265
+ await agent.runCommandMode(options.prompt);
13242
13266
  } else if (options.resumeSessionId) {
13243
13267
  await agent.resumeSession(options.resumeSessionId);
13244
13268
  } else {
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  metadata as metadata18,
10
10
  package_default
11
- } from "./chunk-4UISIRMD.js";
11
+ } from "./chunk-NKYA2UBI.js";
12
12
  import {
13
13
  metadata as metadata19
14
14
  } from "./chunk-UW2LYWIM.js";
@@ -5694,7 +5694,7 @@ var SlashCommandHandler = class {
5694
5694
  return null;
5695
5695
  }
5696
5696
  case "/status": {
5697
- const { status } = await import("./status-XAJH67SE.js");
5697
+ const { status } = await import("./status-PQX6N2EX.js");
5698
5698
  return status(this.ctx);
5699
5699
  }
5700
5700
  case "/login": {
@@ -8361,6 +8361,29 @@ var AutohandAgent = class {
8361
8361
  }
8362
8362
  await this.runInteractiveLoop();
8363
8363
  }
8364
+ /**
8365
+ * Run a single instruction in command mode (non-interactive)
8366
+ * This initializes all necessary context before executing the instruction
8367
+ */
8368
+ async runCommandMode(instruction) {
8369
+ await this.sessionManager.initialize();
8370
+ await this.projectManager.initialize();
8371
+ await this.memoryManager.initialize();
8372
+ await this.resetConversationContext();
8373
+ const providerSettings = getProviderConfig(this.runtime.config, this.activeProvider);
8374
+ const model = this.runtime.options.model ?? providerSettings?.model ?? "unconfigured";
8375
+ await this.sessionManager.createSession(this.runtime.workspaceRoot, model);
8376
+ const session = this.sessionManager.getCurrentSession();
8377
+ if (session) {
8378
+ await this.telemetryManager.startSession(
8379
+ session.metadata.sessionId,
8380
+ model,
8381
+ this.activeProvider
8382
+ );
8383
+ }
8384
+ await this.runInstruction(instruction);
8385
+ await this.telemetryManager.endSession("completed");
8386
+ }
8364
8387
  async resumeSession(sessionId) {
8365
8388
  await this.sessionManager.initialize();
8366
8389
  await this.projectManager.initialize();
@@ -10224,6 +10247,7 @@ ${chalk12.gray("\u203A")} ${inputPreview}${chalk12.gray("\u258B")}`;
10224
10247
  };
10225
10248
 
10226
10249
  // src/index.ts
10250
+ process.title = "autohand";
10227
10251
  function getGitCommit() {
10228
10252
  try {
10229
10253
  return execSync2("git rev-parse --short HEAD", { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] }).trim();
@@ -10323,7 +10347,7 @@ async function runCLI(options) {
10323
10347
  const files = new FileActionManager(workspaceRoot);
10324
10348
  const agent = new AutohandAgent(llmProvider, files, runtime);
10325
10349
  if (options.prompt) {
10326
- await agent.runInstruction(options.prompt);
10350
+ await agent.runCommandMode(options.prompt);
10327
10351
  } else if (options.resumeSessionId) {
10328
10352
  await agent.resumeSession(options.resumeSessionId);
10329
10353
  } else {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  status
4
- } from "./chunk-4UISIRMD.js";
4
+ } from "./chunk-NKYA2UBI.js";
5
5
  export {
6
6
  metadata,
7
7
  status
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autohand-cli",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Autohand interactive coding agent CLI powered by LLMs.",
5
5
  "type": "module",
6
6
  "bin": {