@elnora-ai/cli 2.5.2 → 2.6.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 +59 -79
  2. package/package.json +1 -1
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.5.2" : process.env.npm_package_version ?? "0.0.0-dev";
33
+ VERSION = true ? "2.6.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";
@@ -1860,11 +1860,13 @@ async function checkApiReachable() {
1860
1860
  async function checkAuthenticated() {
1861
1861
  const key = resolveApiKey();
1862
1862
  const client = new ElnoraApiClient(key);
1863
- const result = await client.get("projects", {
1864
- queryParams: { page: 1, pageSize: 1 }
1865
- });
1866
- const count = result?.totalCount ?? result?.items?.length ?? 0;
1867
- return { status: "pass", msg: `Authenticated profile: default (${count} projects accessible)` };
1863
+ const orgs = await client.get("organizations");
1864
+ const list = Array.isArray(orgs) ? orgs : orgs.items ?? [];
1865
+ const count = Array.isArray(orgs) ? orgs.length : orgs.totalCount ?? list.length;
1866
+ return {
1867
+ status: "pass",
1868
+ msg: `Authenticated profile: default (${count} organization${count === 1 ? "" : "s"} accessible)`
1869
+ };
1868
1870
  }
1869
1871
  async function checkVersionCurrent() {
1870
1872
  try {
@@ -4306,23 +4308,33 @@ var foldersChildren = {
4306
4308
 
4307
4309
  // src/commands/folders/create.ts
4308
4310
  import { z as z51 } from "zod";
4311
+
4312
+ // src/commands/_shared/deprecated.ts
4313
+ var PROJECTS_REMOVED_MESSAGE = "Projects were removed from the Elnora platform. Use tasks, folders, and the Knowledge Base instead. This command is a deprecated no-op and will be removed in a future release.";
4314
+ function projectsRemoved(extra) {
4315
+ return { deprecated: true, message: PROJECTS_REMOVED_MESSAGE, ...extra };
4316
+ }
4317
+
4318
+ // src/commands/folders/create.ts
4309
4319
  var inputSchema49 = z51.object({
4310
4320
  name: z51.string().min(1).describe("Folder name"),
4311
4321
  parentId: z51.string().uuid().optional().describe("Parent folder ID (for nesting)"),
4312
- project: z51.string().uuid().optional().describe("Legacy: create a project-scoped folder in this project instead of a Knowledge Base folder")
4322
+ project: z51.string().uuid().optional().describe("[DEPRECATED] Legacy project-scoped folders were removed; this option is a no-op.")
4313
4323
  });
4314
4324
  var foldersCreate = {
4315
4325
  name: "folders.create",
4316
4326
  group: "folders",
4317
- description: "Create a Knowledge Base folder (or a legacy project folder when project is set)",
4327
+ description: "Create a Knowledge Base folder. (The legacy project-scoped path via `project` is deprecated and no longer supported.)",
4318
4328
  inputSchema: inputSchema49,
4319
4329
  outputSchema: z51.any(),
4320
4330
  async execute(input, ctx) {
4321
- const body = { name: input.name };
4322
- if (input.parentId) body.parentFolderId = input.parentId;
4323
4331
  if (input.project) {
4324
- return ctx.client.post("project_folders", body, { pathParams: { id: input.project } });
4332
+ return projectsRemoved({
4333
+ hint: "Project-scoped folders were removed. Omit --project to create a Knowledge Base folder."
4334
+ });
4325
4335
  }
4336
+ const body = { name: input.name };
4337
+ if (input.parentId) body.parentFolderId = input.parentId;
4326
4338
  return ctx.client.post("folder_create", body);
4327
4339
  },
4328
4340
  formatOutput(output, format) {
@@ -4415,13 +4427,13 @@ var inputSchema53 = z55.object({
4415
4427
  var foldersList = {
4416
4428
  name: "folders.list",
4417
4429
  group: "folders",
4418
- description: "List folders in a project",
4430
+ description: "[DEPRECATED] List folders in a project \u2014 projects were removed. Use `folders roots` and `folders children` to browse the Knowledge Base.",
4419
4431
  inputSchema: inputSchema53,
4420
4432
  outputSchema: z55.any(),
4421
4433
  annotations: { readOnlyHint: true },
4422
- async execute(input, ctx) {
4423
- return ctx.client.get("project_folders", {
4424
- pathParams: { id: input.projectId }
4434
+ async execute() {
4435
+ return projectsRemoved({
4436
+ hint: "Use `elnora folders roots` and `elnora folders children <FOLDER_ID>` to browse Knowledge Base folders."
4425
4437
  });
4426
4438
  },
4427
4439
  formatOutput(output, format) {
@@ -5332,15 +5344,11 @@ var inputSchema86 = z89.object({
5332
5344
  var projectsAddMember = {
5333
5345
  name: "projects.addMember",
5334
5346
  group: "projects",
5335
- description: "Add a member to a project",
5347
+ description: "[DEPRECATED] Add a member to a project \u2014 projects were removed; this is a no-op.",
5336
5348
  inputSchema: inputSchema86,
5337
5349
  outputSchema: z89.any(),
5338
- async execute(input, ctx) {
5339
- return ctx.client.post(
5340
- "project_members",
5341
- { userId: input.userId, role: input.role },
5342
- { pathParams: { id: input.projectId } }
5343
- );
5350
+ async execute() {
5351
+ return projectsRemoved();
5344
5352
  },
5345
5353
  formatOutput(output, format) {
5346
5354
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -5356,18 +5364,15 @@ var inputSchema87 = z90.object({
5356
5364
  var projectsArchive = {
5357
5365
  name: "projects.archive",
5358
5366
  group: "projects",
5359
- description: "Archive (delete) a project",
5367
+ description: "[DEPRECATED] Archive (delete) a project \u2014 projects were removed; this is a no-op.",
5360
5368
  inputSchema: inputSchema87,
5361
5369
  outputSchema: z90.any(),
5362
5370
  annotations: { destructiveHint: true },
5363
- async execute(input, ctx) {
5364
- await ctx.client.del("project", {
5365
- pathParams: { id: input.projectId }
5366
- });
5367
- return { archived: true, projectId: input.projectId };
5371
+ async execute() {
5372
+ return projectsRemoved();
5368
5373
  },
5369
5374
  formatOutput(output, format) {
5370
- if (format === "compact") return output.projectId;
5375
+ if (format === "compact") return output.id ?? JSON.stringify(output);
5371
5376
  return JSON.stringify(output, null, 2);
5372
5377
  }
5373
5378
  };
@@ -5382,11 +5387,11 @@ var inputSchema88 = z91.object({
5382
5387
  var projectsCreate = {
5383
5388
  name: "projects.create",
5384
5389
  group: "projects",
5385
- description: "Create a new project",
5390
+ description: "[DEPRECATED] Create a new project \u2014 projects were removed; this is a no-op.",
5386
5391
  inputSchema: inputSchema88,
5387
5392
  outputSchema: z91.any(),
5388
- async execute(input, ctx) {
5389
- return ctx.client.post("projects", input);
5393
+ async execute() {
5394
+ return projectsRemoved();
5390
5395
  },
5391
5396
  formatOutput(output, format) {
5392
5397
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -5402,14 +5407,12 @@ var inputSchema89 = z92.object({
5402
5407
  var projectsGet = {
5403
5408
  name: "projects.get",
5404
5409
  group: "projects",
5405
- description: "Get details of a specific project",
5410
+ description: "[DEPRECATED] Get details of a specific project \u2014 projects were removed; this is a no-op.",
5406
5411
  inputSchema: inputSchema89,
5407
5412
  outputSchema: z92.any(),
5408
5413
  annotations: { readOnlyHint: true },
5409
- async execute(input, ctx) {
5410
- return ctx.client.get("project", {
5411
- pathParams: { id: input.projectId }
5412
- });
5414
+ async execute() {
5415
+ return projectsRemoved();
5413
5416
  },
5414
5417
  formatOutput(output, format) {
5415
5418
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -5425,14 +5428,12 @@ var inputSchema90 = z93.object({
5425
5428
  var projectsLeave = {
5426
5429
  name: "projects.leave",
5427
5430
  group: "projects",
5428
- description: "Leave a project",
5431
+ description: "[DEPRECATED] Leave a project \u2014 projects were removed; this is a no-op.",
5429
5432
  inputSchema: inputSchema90,
5430
5433
  outputSchema: z93.any(),
5431
5434
  annotations: { destructiveHint: true },
5432
- async execute(input, ctx) {
5433
- return ctx.client.post("project_leave", void 0, {
5434
- pathParams: { id: input.projectId }
5435
- });
5435
+ async execute() {
5436
+ return projectsRemoved();
5436
5437
  },
5437
5438
  formatOutput(output, format) {
5438
5439
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -5448,14 +5449,12 @@ var inputSchema91 = z94.object({
5448
5449
  var projectsList = {
5449
5450
  name: "projects.list",
5450
5451
  group: "projects",
5451
- description: "List all projects accessible to the current user",
5452
+ description: "[DEPRECATED] List all projects accessible to the current user \u2014 projects were removed; this is a no-op.",
5452
5453
  inputSchema: inputSchema91,
5453
5454
  outputSchema: z94.any(),
5454
5455
  annotations: { readOnlyHint: true },
5455
- async execute(input, ctx) {
5456
- return ctx.client.get("projects", {
5457
- queryParams: { page: input.page, pageSize: input.pageSize }
5458
- });
5456
+ async execute(input) {
5457
+ return projectsRemoved({ items: [], totalCount: 0, page: input.page, pageSize: input.pageSize });
5459
5458
  },
5460
5459
  formatOutput(output, format) {
5461
5460
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -5471,14 +5470,12 @@ var inputSchema92 = z95.object({
5471
5470
  var projectsMembers = {
5472
5471
  name: "projects.members",
5473
5472
  group: "projects",
5474
- description: "List members of a project",
5473
+ description: "[DEPRECATED] List members of a project \u2014 projects were removed; this is a no-op.",
5475
5474
  inputSchema: inputSchema92,
5476
5475
  outputSchema: z95.any(),
5477
5476
  annotations: { readOnlyHint: true },
5478
- async execute(input, ctx) {
5479
- return ctx.client.get("project_members", {
5480
- pathParams: { id: input.projectId }
5481
- });
5477
+ async execute() {
5478
+ return projectsRemoved();
5482
5479
  },
5483
5480
  formatOutput(output, format) {
5484
5481
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -5495,24 +5492,20 @@ var inputSchema93 = z96.object({
5495
5492
  var projectsRemoveMember = {
5496
5493
  name: "projects.removeMember",
5497
5494
  group: "projects",
5498
- description: "Remove a member from a project",
5495
+ description: "[DEPRECATED] Remove a member from a project \u2014 projects were removed; this is a no-op.",
5499
5496
  inputSchema: inputSchema93,
5500
5497
  outputSchema: z96.any(),
5501
5498
  annotations: { destructiveHint: true },
5502
- async execute(input, ctx) {
5503
- await ctx.client.del("project_member", {
5504
- pathParams: { id: input.projectId, uid: input.userId }
5505
- });
5506
- return { removed: true };
5499
+ async execute() {
5500
+ return projectsRemoved();
5507
5501
  },
5508
5502
  formatOutput(output, format) {
5509
- if (format === "compact") return String(output.removed);
5503
+ if (format === "compact") return output.id ?? JSON.stringify(output);
5510
5504
  return JSON.stringify(output, null, 2);
5511
5505
  }
5512
5506
  };
5513
5507
 
5514
5508
  // src/commands/projects/update.ts
5515
- init_errors();
5516
5509
  import { z as z97 } from "zod";
5517
5510
  var inputSchema94 = z97.object({
5518
5511
  projectId: z97.string().uuid().describe("Project ID"),
@@ -5523,21 +5516,12 @@ var inputSchema94 = z97.object({
5523
5516
  var projectsUpdate = {
5524
5517
  name: "projects.update",
5525
5518
  group: "projects",
5526
- description: "Update an existing project",
5519
+ description: "[DEPRECATED] Update an existing project \u2014 projects were removed; this is a no-op.",
5527
5520
  inputSchema: inputSchema94,
5528
5521
  outputSchema: z97.any(),
5529
5522
  annotations: { idempotentHint: true },
5530
- async execute(input, ctx) {
5531
- const { projectId, ...fields } = input;
5532
- if (!fields.name && !fields.description && !fields.icon) {
5533
- throw new ValidationError(
5534
- "At least one field (name, description, icon) must be provided.",
5535
- "Provide at least one field to update."
5536
- );
5537
- }
5538
- return ctx.client.patch("project", fields, {
5539
- pathParams: { id: projectId }
5540
- });
5523
+ async execute() {
5524
+ return projectsRemoved();
5541
5525
  },
5542
5526
  formatOutput(output, format) {
5543
5527
  if (format === "compact") return output.id ?? JSON.stringify(output);
@@ -5555,16 +5539,12 @@ var inputSchema95 = z98.object({
5555
5539
  var projectsUpdateRole = {
5556
5540
  name: "projects.updateRole",
5557
5541
  group: "projects",
5558
- description: "Update a project member's role",
5542
+ description: "[DEPRECATED] Update a project member's role \u2014 projects were removed; this is a no-op.",
5559
5543
  inputSchema: inputSchema95,
5560
5544
  outputSchema: z98.any(),
5561
5545
  annotations: { idempotentHint: true },
5562
- async execute(input, ctx) {
5563
- return ctx.client.put(
5564
- "project_member_role",
5565
- { role: input.role },
5566
- { pathParams: { id: input.projectId, uid: input.userId } }
5567
- );
5546
+ async execute() {
5547
+ return projectsRemoved();
5568
5548
  },
5569
5549
  formatOutput(output, format) {
5570
5550
  if (format === "compact") return output.id ?? JSON.stringify(output);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elnora-ai/cli",
3
- "version": "2.5.2",
3
+ "version": "2.6.0",
4
4
  "description": "Elnora AI Platform CLI",
5
5
  "type": "module",
6
6
  "bin": {