@elnora-ai/cli 2.1.2 → 2.2.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.
Files changed (2) hide show
  1. package/dist/cli.js +35 -20
  2. package/package.json +4 -3
package/dist/cli.js CHANGED
@@ -30,7 +30,7 @@ var VERSION, PRODUCTION_BASE_URL, BASE_URL, AI_SERVER_URL, PRODUCTION_MCP_URL, M
30
30
  var init_config = __esm({
31
31
  "src/lib/config.ts"() {
32
32
  "use strict";
33
- VERSION = true ? "2.1.2" : process.env.npm_package_version ?? "0.0.0-dev";
33
+ VERSION = true ? "2.2.0" : process.env.npm_package_version ?? "0.0.0-dev";
34
34
  PRODUCTION_BASE_URL = "https://platform.elnora.ai/api/v1";
35
35
  BASE_URL = process.env.ELNORA_API_URL ?? PRODUCTION_BASE_URL;
36
36
  AI_SERVER_URL = process.env.ELNORA_AI_SERVER_URL ?? "https://platform.elnora.ai/ai-server";
@@ -69,6 +69,7 @@ var init_config = __esm({
69
69
  // Folders
70
70
  folder: "/folders/{id}",
71
71
  folder_move: "/folders/{id}/move",
72
+ folders_files: "/folders/files",
72
73
  // Organizations
73
74
  organizations: "/organizations",
74
75
  organization: "/organizations/{id}",
@@ -2724,6 +2725,7 @@ var accountAddLegalDoc = {
2724
2725
  description: "Add a legal document version (SystemAdmin only)",
2725
2726
  inputSchema: inputSchema2,
2726
2727
  outputSchema: z3.any(),
2728
+ annotations: { internal: true },
2727
2729
  async execute(input, ctx) {
2728
2730
  const body = {
2729
2731
  documentType: input.documentType,
@@ -2814,7 +2816,7 @@ var accountDeleteLegalDoc = {
2814
2816
  description: "Delete a legal document version (SystemAdmin only)",
2815
2817
  inputSchema: inputSchema5,
2816
2818
  outputSchema: z6.any(),
2817
- annotations: { destructiveHint: true },
2819
+ annotations: { destructiveHint: true, internal: true },
2818
2820
  async execute(input, ctx) {
2819
2821
  if (!input.yes) {
2820
2822
  const confirmed = await confirmDestructive(
@@ -2903,6 +2905,7 @@ var accountUpdateLegalDoc = {
2903
2905
  description: "Update a legal document version (SystemAdmin only)",
2904
2906
  inputSchema: inputSchema8,
2905
2907
  outputSchema: z9.any(),
2908
+ annotations: { internal: true },
2906
2909
  async execute(input, ctx) {
2907
2910
  const body = {};
2908
2911
  if (input.content !== void 0) body.content = input.content;
@@ -2932,7 +2935,7 @@ var accountUsers = {
2932
2935
  description: "List all users (admin)",
2933
2936
  inputSchema: inputSchema9,
2934
2937
  outputSchema: z10.any(),
2935
- annotations: { readOnlyHint: true },
2938
+ annotations: { readOnlyHint: true, internal: true },
2936
2939
  async execute(input, ctx) {
2937
2940
  const queryParams = {};
2938
2941
  if (input.state) queryParams.state = input.state;
@@ -3572,7 +3575,7 @@ var filesContent = {
3572
3575
  // src/commands/files/create.ts
3573
3576
  import { z as z28 } from "zod";
3574
3577
  var inputSchema26 = z28.object({
3575
- project: z28.string().uuid().describe("Project ID"),
3578
+ project: z28.string().uuid().optional().describe("Project ID (optional; defaults to your workspace)"),
3576
3579
  name: z28.string().min(1).describe("File name"),
3577
3580
  type: z28.string().min(1).describe("File type"),
3578
3581
  folder: z28.string().uuid().optional().describe("Folder ID")
@@ -3585,9 +3588,12 @@ var filesCreate = {
3585
3588
  outputSchema: z28.any(),
3586
3589
  async execute(input, ctx) {
3587
3590
  return ctx.client.post("files", {
3588
- projectId: input.project,
3591
+ // projectId optional (ELN-880 Phase C): omitted → backend uses the caller's default workspace.
3592
+ ...input.project ? { projectId: input.project } : {},
3589
3593
  name: input.name,
3590
- type: input.type,
3594
+ // Backend CreateFileDTO expects `fileType` (the CLI flag is --type). Previously sent as
3595
+ // `type`, which the API ignored → "FileType field is required" 400.
3596
+ fileType: input.type,
3591
3597
  folderId: input.folder
3592
3598
  });
3593
3599
  },
@@ -3650,7 +3656,7 @@ var filesDownload = {
3650
3656
  import { z as z31 } from "zod";
3651
3657
  var inputSchema29 = z31.object({
3652
3658
  fileId: z31.string().uuid().describe("File ID to fork"),
3653
- targetProject: z31.string().uuid().describe("Target project ID")
3659
+ targetProject: z31.string().uuid().optional().describe("Target project ID (optional; defaults to your workspace)")
3654
3660
  });
3655
3661
  var filesFork = {
3656
3662
  name: "files.fork",
@@ -3661,7 +3667,11 @@ var filesFork = {
3661
3667
  async execute(input, ctx) {
3662
3668
  return ctx.client.post(
3663
3669
  "file_fork",
3664
- { targetProjectId: input.targetProject },
3670
+ {
3671
+ // targetProject optional (ELN-880 Phase C): omit → backend forks into the caller's
3672
+ // default workspace. Only sent when explicitly supplied.
3673
+ ...input.targetProject ? { targetProjectId: input.targetProject } : {}
3674
+ },
3665
3675
  {
3666
3676
  pathParams: { id: input.fileId }
3667
3677
  }
@@ -3699,7 +3709,7 @@ var filesGet = {
3699
3709
  // src/commands/files/list.ts
3700
3710
  import { z as z33 } from "zod";
3701
3711
  var inputSchema31 = z33.object({
3702
- project: z33.string().uuid().describe("Project ID"),
3712
+ project: z33.string().uuid().optional().describe("Project ID (optional; defaults to your workspace)"),
3703
3713
  ...paginationInput
3704
3714
  });
3705
3715
  var filesList = {
@@ -3710,10 +3720,13 @@ var filesList = {
3710
3720
  outputSchema: z33.any(),
3711
3721
  annotations: { readOnlyHint: true },
3712
3722
  async execute(input, ctx) {
3713
- return ctx.client.get("project_files", {
3714
- pathParams: { id: input.project },
3715
- queryParams: { page: input.page, pageSize: input.pageSize }
3716
- });
3723
+ if (input.project) {
3724
+ return ctx.client.get("project_files", {
3725
+ pathParams: { id: input.project },
3726
+ queryParams: { page: input.page, pageSize: input.pageSize }
3727
+ });
3728
+ }
3729
+ return ctx.client.get("folders_files");
3717
3730
  },
3718
3731
  formatOutput(output, format) {
3719
3732
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -3842,7 +3855,7 @@ import { readFileSync as readFileSync6, statSync as statSync3 } from "node:fs";
3842
3855
  import { basename } from "node:path";
3843
3856
  import { z as z38 } from "zod";
3844
3857
  var inputSchema36 = z38.object({
3845
- project: z38.string().uuid().describe("Project ID"),
3858
+ project: z38.string().uuid().optional().describe("Project ID (optional; defaults to your workspace)"),
3846
3859
  filePath: z38.string().min(1).describe("Local file path to upload"),
3847
3860
  fileName: z38.string().optional().describe("Override file name"),
3848
3861
  contentType: z38.string().optional().describe("MIME content type")
@@ -3859,7 +3872,7 @@ var filesUpload = {
3859
3872
  const contentType = input.contentType ?? "application/octet-stream";
3860
3873
  const fileSize = statSync3(input.filePath).size;
3861
3874
  const uploadInfo = await ctx.client.post("file_upload", {
3862
- projectId: input.project,
3875
+ ...input.project ? { projectId: input.project } : {},
3863
3876
  fileName,
3864
3877
  contentType,
3865
3878
  fileSizeBytes: fileSize
@@ -3889,7 +3902,7 @@ import { readFileSync as readFileSync7, statSync as statSync4 } from "node:fs";
3889
3902
  import { basename as basename2 } from "node:path";
3890
3903
  import { z as z39 } from "zod";
3891
3904
  var inputSchema37 = z39.object({
3892
- project: z39.string().uuid().describe("Project ID"),
3905
+ project: z39.string().uuid().optional().describe("Project ID (optional; defaults to your workspace)"),
3893
3906
  filePaths: z39.string().min(1).describe("Comma-separated local file paths to upload"),
3894
3907
  folder: z39.string().uuid().optional().describe("Folder ID")
3895
3908
  });
@@ -3918,7 +3931,7 @@ var filesUploadBatch = {
3918
3931
  const contentType = "application/octet-stream";
3919
3932
  const fileSize = statSync4(filePath).size;
3920
3933
  const uploadInfo = await ctx.client.post("file_upload", {
3921
- projectId: input.project,
3934
+ ...input.project ? { projectId: input.project } : {},
3922
3935
  fileName,
3923
3936
  contentType,
3924
3937
  fileSizeBytes: fileSize,
@@ -4730,7 +4743,7 @@ var orgsListAll = {
4730
4743
  description: "List all organizations (admin)",
4731
4744
  inputSchema: inputSchema65,
4732
4745
  outputSchema: z68.any(),
4733
- annotations: { readOnlyHint: true },
4746
+ annotations: { readOnlyHint: true, internal: true },
4734
4747
  async execute(_input, ctx) {
4735
4748
  return ctx.client.get("organizations_all");
4736
4749
  },
@@ -5602,7 +5615,7 @@ ${this.useColor ? pc5.yellow("Stream timed out.") : "Stream timed out."}
5602
5615
 
5603
5616
  // src/commands/tasks/create.ts
5604
5617
  var inputSchema89 = z92.object({
5605
- project: z92.string().uuid().describe("Project ID"),
5618
+ project: z92.string().uuid().optional().describe("Project ID (optional; defaults to your workspace)"),
5606
5619
  title: z92.string().optional().describe("Task title"),
5607
5620
  message: z92.string().optional().describe("Initial message"),
5608
5621
  wait: z92.boolean().default(false).describe("Wait for agent response (polling)"),
@@ -5617,7 +5630,9 @@ var tasksCreate = {
5617
5630
  outputSchema: z92.any(),
5618
5631
  async execute(input, ctx) {
5619
5632
  const result = await ctx.client.post("tasks", {
5620
- projectId: input.project,
5633
+ // projectId is optional (ELN-880 Phase C): when omitted the backend creates the
5634
+ // task in the caller's default workspace. Only sent when explicitly supplied.
5635
+ ...input.project ? { projectId: input.project } : {},
5621
5636
  title: input.title,
5622
5637
  initialMessage: input.message
5623
5638
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elnora-ai/cli",
3
- "version": "2.1.2",
3
+ "version": "2.2.0",
4
4
  "description": "Elnora AI Platform CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -44,14 +44,14 @@
44
44
  "zod": "^4.4.3"
45
45
  },
46
46
  "devDependencies": {
47
- "@biomejs/biome": "^2.5.0",
47
+ "@biomejs/biome": "2.5.1",
48
48
  "@types/express": "^5.0.6",
49
49
  "@types/node": "^25.9.3",
50
50
  "@yao-pkg/pkg": "^6.20.0",
51
51
  "esbuild": "^0.28.1",
52
52
  "tsx": "^4.22.4",
53
53
  "typescript": "^6.0.3",
54
- "vitest": "^4.1.8"
54
+ "vitest": "^4.1.9"
55
55
  },
56
56
  "scripts": {
57
57
  "postinstall": "node scripts/postinstall.mjs",
@@ -59,6 +59,7 @@
59
59
  "build:binary": "node scripts/build.mjs --pkg",
60
60
  "dev": "tsx src/cli.ts",
61
61
  "audit:mcp-parity": "tsx scripts/audit-mcp-parity.ts",
62
+ "docs:reference": "tsx scripts/gen-docs-reference.ts",
62
63
  "test": "vitest run",
63
64
  "test:watch": "vitest",
64
65
  "lint": "biome check src/ __tests__/",