@arrislink/axon 1.0.7 → 1.0.9

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
@@ -129,6 +129,7 @@ graph LR
129
129
  |---------|-------------|
130
130
  | `ax init [name]` | Initialize a new Axon project |
131
131
  | `ax spec init` | Create project specification interactively |
132
+ | `ax spec edit` | Edit the existing specification |
132
133
  | `ax spec show` | Display current specification |
133
134
  | `ax plan` | Generate task graph from specification |
134
135
  | `ax work` | Execute the next task |
package/dist/index.js CHANGED
@@ -16228,6 +16228,15 @@ var init_i18n = __esm(() => {
16228
16228
  });
16229
16229
 
16230
16230
  // src/utils/prompt.ts
16231
+ var exports_prompt = {};
16232
+ __export(exports_prompt, {
16233
+ select: () => select,
16234
+ password: () => password,
16235
+ multiSelect: () => multiSelect,
16236
+ input: () => input,
16237
+ editor: () => editor,
16238
+ confirm: () => confirm
16239
+ });
16231
16240
  async function confirm(options) {
16232
16241
  const response = await import_prompts2.default({
16233
16242
  type: "confirm",
@@ -16273,6 +16282,45 @@ async function input(options) {
16273
16282
  });
16274
16283
  return response.value || "";
16275
16284
  }
16285
+ async function password(message) {
16286
+ const response = await import_prompts2.default({
16287
+ type: "password",
16288
+ name: "value",
16289
+ message
16290
+ });
16291
+ return response.value || "";
16292
+ }
16293
+ async function editor(message, defaultValue) {
16294
+ const editorCmd = process.env["EDITOR"] || process.env["VISUAL"] || "nano";
16295
+ const tmpFile = `${process.cwd()}/.axon-editor-${Date.now()}.md`;
16296
+ try {
16297
+ if (defaultValue) {
16298
+ await Bun.write(tmpFile, defaultValue);
16299
+ }
16300
+ const proc = Bun.spawnSync([editorCmd, tmpFile]);
16301
+ if (proc.success) {
16302
+ const edited = await Bun.file(tmpFile).text();
16303
+ return edited;
16304
+ }
16305
+ throw new Error("Editor exited with error");
16306
+ } catch (err) {
16307
+ console.warn("\u26A0\uFE0F \u5916\u90E8\u7F16\u8F91\u5668\u4E0D\u53EF\u7528\uFF0C\u8BF7\u76F4\u63A5\u8F93\u5165\u5185\u5BB9");
16308
+ const response = await import_prompts2.default({
16309
+ type: "text",
16310
+ name: "value",
16311
+ message,
16312
+ initial: defaultValue
16313
+ });
16314
+ return response.value || "";
16315
+ } finally {
16316
+ try {
16317
+ const file = Bun.file(tmpFile);
16318
+ if (await file.exists()) {
16319
+ await Bun.spawn(["rm", tmpFile]).exited;
16320
+ }
16321
+ } catch {}
16322
+ }
16323
+ }
16276
16324
  var import_prompts2;
16277
16325
  var init_prompt = __esm(() => {
16278
16326
  import_prompts2 = __toESM(require_prompts3(), 1);
@@ -25105,6 +25153,38 @@ specCommand.command("init").description("\u4EA4\u4E92\u5F0F\u521B\u5EFA\u9879\u7
25105
25153
  console.log(` 1. \u5BA1\u9605\u5E76\u7F16\u8F91 ${source_default.cyan(".openspec/spec.md")}`);
25106
25154
  console.log(` 2. ${source_default.cyan("ax plan")} - \u751F\u6210\u4EFB\u52A1\u56FE`);
25107
25155
  });
25156
+ specCommand.command("edit").description("\u7F16\u8F91\u9879\u76EE\u89C4\u683C\u6587\u6863").action(async () => {
25157
+ const projectRoot = process.cwd();
25158
+ if (!ConfigManager.isAxonProject(projectRoot)) {
25159
+ throw new AxonError("\u5F53\u524D\u76EE\u5F55\u4E0D\u662F Axon \u9879\u76EE", "SPEC_ERROR", [
25160
+ "\u8BF7\u5148\u8FD0\u884C `ax init` \u521D\u59CB\u5316\u9879\u76EE"
25161
+ ]);
25162
+ }
25163
+ const configManager = new ConfigManager(projectRoot);
25164
+ const config = configManager.get();
25165
+ const specPath = join5(projectRoot, config.tools.openspec.path, "spec.md");
25166
+ if (!existsSync6(specPath)) {
25167
+ throw new AxonError("\u89C4\u683C\u6587\u6863\u4E0D\u5B58\u5728", "SPEC_ERROR", ["\u4F7F\u7528 `ax spec init` \u521B\u5EFA\u89C4\u683C\u6587\u6863"]);
25168
+ }
25169
+ const content = readFileSync3(specPath, "utf-8");
25170
+ spinner.start("\u6253\u5F00\u7F16\u8F91\u5668");
25171
+ try {
25172
+ const { editor: editor2 } = await Promise.resolve().then(() => (init_prompt(), exports_prompt));
25173
+ const edited = await editor2("\u7F16\u8F91\u89C4\u683C\u6587\u6863:", content);
25174
+ if (edited !== content) {
25175
+ await Bun.write(specPath, edited);
25176
+ spinner.succeed("\u89C4\u683C\u6587\u6863\u5DF2\u4FDD\u5B58");
25177
+ } else {
25178
+ spinner.stop();
25179
+ logger.info("\u672A\u505A\u4EFB\u4F55\u66F4\u6539");
25180
+ }
25181
+ } catch (error) {
25182
+ spinner.fail();
25183
+ throw new AxonError("\u7F16\u8F91\u89C4\u683C\u6587\u6863\u5931\u8D25", "SPEC_ERROR", [
25184
+ error instanceof Error ? error.message : "\u672A\u77E5\u9519\u8BEF"
25185
+ ]);
25186
+ }
25187
+ });
25108
25188
  specCommand.command("show").description("\u663E\u793A\u5F53\u524D\u89C4\u683C\u6587\u6863").action(() => {
25109
25189
  const projectRoot = process.cwd();
25110
25190
  if (!ConfigManager.isAxonProject(projectRoot)) {
@@ -25130,9 +25210,7 @@ specCommand.command("validate").description("\u9A8C\u8BC1\u89C4\u683C\u6587\u686
25130
25210
  const config = configManager.get();
25131
25211
  const specPath = join5(projectRoot, config.tools.openspec.path, "spec.md");
25132
25212
  if (!existsSync6(specPath)) {
25133
- throw new AxonError("\u89C4\u683C\u6587\u6863\u4E0D\u5B58\u5728", "SPEC_ERROR", [
25134
- "\u4F7F\u7528 `ax spec init` \u521B\u5EFA\u89C4\u683C\u6587\u6863"
25135
- ]);
25213
+ throw new AxonError("\u89C4\u683C\u6587\u6863\u4E0D\u5B58\u5728", "SPEC_ERROR", ["\u4F7F\u7528 `ax spec init` \u521B\u5EFA\u89C4\u683C\u6587\u6863"]);
25136
25214
  }
25137
25215
  const content = readFileSync3(specPath, "utf-8");
25138
25216
  const issues = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrislink/axon",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "AI-Powered Development Operating System with unified LLM provider support",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "license": "MIT",
51
51
  "repository": {
52
52
  "type": "git",
53
- "url": "https://github.com/arrislink/axon.git"
53
+ "url": "git+https://github.com/arrislink/axon.git"
54
54
  },
55
55
  "bugs": {
56
56
  "url": "https://github.com/arrislink/axon/issues"
@@ -75,4 +75,4 @@
75
75
  "bun": ">=1.1.0",
76
76
  "node": ">=18.0.0"
77
77
  }
78
- }
78
+ }