@elnora-ai/cli 2.6.3 → 2.6.5
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/dist/cli.js +42 -44
- 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.6.
|
|
33
|
+
VERSION = true ? "2.6.5" : 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";
|
|
@@ -651,7 +651,8 @@ var init_client = __esm({
|
|
|
651
651
|
} catch {
|
|
652
652
|
}
|
|
653
653
|
if (response.status === 401) {
|
|
654
|
-
|
|
654
|
+
const suggestion = method !== "GET" ? `Check your API key from platform.elnora.ai > Settings > API Keys. If that key works for other commands, the API may not route ${method} on this path \u2014 it answers an unsupported method with 401, not 405.` : void 0;
|
|
655
|
+
throw new AuthError(errorMessage.slice(0, 200) || "Authentication failed", { suggestion });
|
|
655
656
|
}
|
|
656
657
|
if (response.status === 403) {
|
|
657
658
|
throw new ElnoraError(errorMessage.slice(0, 200) || "Access denied", {
|
|
@@ -1830,6 +1831,13 @@ function registerUpdateCheck(quiet2 = false) {
|
|
|
1830
1831
|
})();
|
|
1831
1832
|
}
|
|
1832
1833
|
|
|
1834
|
+
// src/commands/_shared/auth-probe.ts
|
|
1835
|
+
async function probeOrganizationCount(client) {
|
|
1836
|
+
const orgs = await client.get("organizations");
|
|
1837
|
+
if (Array.isArray(orgs)) return orgs.length;
|
|
1838
|
+
return orgs?.totalCount ?? orgs?.items?.length ?? 0;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1833
1841
|
// src/commands/doctor.ts
|
|
1834
1842
|
var EXPECTED_SKILLS = [
|
|
1835
1843
|
"elnora-admin",
|
|
@@ -1860,9 +1868,7 @@ async function checkApiReachable() {
|
|
|
1860
1868
|
async function checkAuthenticated() {
|
|
1861
1869
|
const key = resolveApiKey();
|
|
1862
1870
|
const client = new ElnoraApiClient(key);
|
|
1863
|
-
const
|
|
1864
|
-
const list = Array.isArray(orgs) ? orgs : orgs.items ?? [];
|
|
1865
|
-
const count = Array.isArray(orgs) ? orgs.length : orgs.totalCount ?? list.length;
|
|
1871
|
+
const count = await probeOrganizationCount(client);
|
|
1866
1872
|
return {
|
|
1867
1873
|
status: "pass",
|
|
1868
1874
|
msg: `Authenticated profile: default (${count} organization${count === 1 ? "" : "s"} accessible)`
|
|
@@ -2940,7 +2946,7 @@ var accountUpdateLegalDoc = {
|
|
|
2940
2946
|
if (Object.keys(body).length === 0) {
|
|
2941
2947
|
throw new ValidationError("At least one of --content or --effectiveDate is required");
|
|
2942
2948
|
}
|
|
2943
|
-
return ctx.client.
|
|
2949
|
+
return ctx.client.put("legal_doc_version_id", body, {
|
|
2944
2950
|
pathParams: { id: input.versionId }
|
|
2945
2951
|
});
|
|
2946
2952
|
},
|
|
@@ -3271,11 +3277,8 @@ var authLogin = {
|
|
|
3271
3277
|
Checking profile "${profileName}"...`);
|
|
3272
3278
|
try {
|
|
3273
3279
|
const client = new ElnoraApiClient(savedKey);
|
|
3274
|
-
const
|
|
3275
|
-
|
|
3276
|
-
});
|
|
3277
|
-
const projectCount = result?.totalCount ?? result?.items?.length ?? 0;
|
|
3278
|
-
process.stderr.write(` authenticated (${projectCount} project${projectCount !== 1 ? "s" : ""}).
|
|
3280
|
+
const orgCount = await probeOrganizationCount(client);
|
|
3281
|
+
process.stderr.write(` authenticated (${orgCount} organization${orgCount !== 1 ? "s" : ""}).
|
|
3279
3282
|
|
|
3280
3283
|
`);
|
|
3281
3284
|
process.stderr.write(" To update your API key, run:\n");
|
|
@@ -3329,20 +3332,17 @@ var authLogin = {
|
|
|
3329
3332
|
}
|
|
3330
3333
|
try {
|
|
3331
3334
|
const tempClient = new ElnoraApiClient(key);
|
|
3332
|
-
const
|
|
3333
|
-
queryParams: { page: 1, pageSize: 1 }
|
|
3334
|
-
});
|
|
3335
|
-
const projectCount = result?.totalCount ?? result?.items?.length ?? 0;
|
|
3335
|
+
const orgCount = await probeOrganizationCount(tempClient);
|
|
3336
3336
|
const configPath = saveProfile(profileName, key);
|
|
3337
3337
|
if (isTTY()) {
|
|
3338
|
-
process.stderr.write(` Done! ${
|
|
3338
|
+
process.stderr.write(` Done! ${orgCount} organization${orgCount !== 1 ? "s" : ""} accessible.
|
|
3339
3339
|
`);
|
|
3340
3340
|
process.stderr.write(` Saved to profile "${profileName}" at ${configPath}
|
|
3341
3341
|
|
|
3342
3342
|
`);
|
|
3343
3343
|
process.stderr.write(" Next steps:\n");
|
|
3344
|
-
process.stderr.write(" elnora
|
|
3345
|
-
process.stderr.write(
|
|
3344
|
+
process.stderr.write(" elnora tasks list See your tasks\n");
|
|
3345
|
+
process.stderr.write(' elnora tasks create --message "..." --stream Start a conversation\n');
|
|
3346
3346
|
process.stderr.write(" elnora doctor Verify your setup\n\n");
|
|
3347
3347
|
}
|
|
3348
3348
|
return { profile: profileName, verified: true, configPath };
|
|
@@ -3438,11 +3438,8 @@ var authStatus = {
|
|
|
3438
3438
|
outputSchema: z21.any(),
|
|
3439
3439
|
annotations: { readOnlyHint: true, exposeInMcp: false },
|
|
3440
3440
|
async execute(_input, ctx) {
|
|
3441
|
-
const
|
|
3442
|
-
|
|
3443
|
-
});
|
|
3444
|
-
const projectCount = result.totalCount ?? result.items?.length ?? 0;
|
|
3445
|
-
return { profile: ctx.profileName, authenticated: true, projectCount };
|
|
3441
|
+
const organizationCount = await probeOrganizationCount(ctx.client);
|
|
3442
|
+
return { profile: ctx.profileName, authenticated: true, organizationCount };
|
|
3446
3443
|
},
|
|
3447
3444
|
formatOutput(output, format) {
|
|
3448
3445
|
if (format === "compact") return String(output.authenticated ?? "");
|
|
@@ -3735,22 +3732,29 @@ var filesGet = {
|
|
|
3735
3732
|
|
|
3736
3733
|
// src/commands/files/list.ts
|
|
3737
3734
|
import { z as z33 } from "zod";
|
|
3735
|
+
|
|
3736
|
+
// src/commands/_shared/deprecated.ts
|
|
3737
|
+
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.";
|
|
3738
|
+
function projectsRemoved(extra) {
|
|
3739
|
+
return { deprecated: true, message: PROJECTS_REMOVED_MESSAGE, ...extra };
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
// src/commands/files/list.ts
|
|
3738
3743
|
var inputSchema31 = z33.object({
|
|
3739
|
-
project: z33.string().uuid().optional().describe("
|
|
3744
|
+
project: z33.string().uuid().optional().describe("[DEPRECATED] Legacy project filter; projects were removed and this option is a no-op."),
|
|
3740
3745
|
...paginationInput
|
|
3741
3746
|
});
|
|
3742
3747
|
var filesList = {
|
|
3743
3748
|
name: "files.list",
|
|
3744
3749
|
group: "files",
|
|
3745
|
-
description: "List files in
|
|
3750
|
+
description: "List files in your workspace. (The legacy `project` filter is deprecated and no longer supported.)",
|
|
3746
3751
|
inputSchema: inputSchema31,
|
|
3747
3752
|
outputSchema: z33.any(),
|
|
3748
3753
|
annotations: { readOnlyHint: true },
|
|
3749
3754
|
async execute(input, ctx) {
|
|
3750
3755
|
if (input.project) {
|
|
3751
|
-
return
|
|
3752
|
-
|
|
3753
|
-
queryParams: { page: input.page, pageSize: input.pageSize }
|
|
3756
|
+
return projectsRemoved({
|
|
3757
|
+
hint: "Project-scoped file listing was removed. Omit --project to list every file in your workspace."
|
|
3754
3758
|
});
|
|
3755
3759
|
}
|
|
3756
3760
|
return ctx.client.get("folders_files");
|
|
@@ -3969,7 +3973,7 @@ var filesUpdate = {
|
|
|
3969
3973
|
const body = {};
|
|
3970
3974
|
if (fields.name) body.name = fields.name;
|
|
3971
3975
|
if (fields.folder) body.folderId = fields.folder;
|
|
3972
|
-
return ctx.client.
|
|
3976
|
+
return ctx.client.put("file", body, {
|
|
3973
3977
|
pathParams: { id: fileId }
|
|
3974
3978
|
});
|
|
3975
3979
|
},
|
|
@@ -4308,14 +4312,6 @@ var foldersChildren = {
|
|
|
4308
4312
|
|
|
4309
4313
|
// src/commands/folders/create.ts
|
|
4310
4314
|
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
|
|
4319
4315
|
var inputSchema49 = z51.object({
|
|
4320
4316
|
name: z51.string().min(1).describe("Folder name"),
|
|
4321
4317
|
parentId: z51.string().uuid().optional().describe("Parent folder ID (for nesting)"),
|
|
@@ -5270,7 +5266,7 @@ var orgsUpdate = {
|
|
|
5270
5266
|
"Provide at least one field to update."
|
|
5271
5267
|
);
|
|
5272
5268
|
}
|
|
5273
|
-
return ctx.client.
|
|
5269
|
+
return ctx.client.put("organization", fields, {
|
|
5274
5270
|
pathParams: { id: orgId }
|
|
5275
5271
|
});
|
|
5276
5272
|
},
|
|
@@ -6157,23 +6153,25 @@ var tasksGet = {
|
|
|
6157
6153
|
// src/commands/tasks/list.ts
|
|
6158
6154
|
import { z as z112 } from "zod";
|
|
6159
6155
|
var inputSchema109 = z112.object({
|
|
6160
|
-
project: z112.string().uuid().optional().describe("
|
|
6156
|
+
project: z112.string().uuid().optional().describe("[DEPRECATED] Legacy project filter; projects were removed and this option is a no-op."),
|
|
6161
6157
|
status: z112.enum(["active", "archived", "all"]).optional().describe("Lifecycle filter: active (default), archived, or all"),
|
|
6162
6158
|
...paginationInput
|
|
6163
6159
|
});
|
|
6164
6160
|
var tasksList = {
|
|
6165
6161
|
name: "tasks.list",
|
|
6166
6162
|
group: "tasks",
|
|
6167
|
-
description: "List tasks, optionally filtered by project
|
|
6163
|
+
description: "List tasks, optionally filtered by lifecycle status. (The legacy `project` filter is deprecated and no longer supported.)",
|
|
6168
6164
|
inputSchema: inputSchema109,
|
|
6169
6165
|
outputSchema: z112.any(),
|
|
6170
6166
|
annotations: { readOnlyHint: true },
|
|
6171
6167
|
async execute(input, ctx) {
|
|
6172
|
-
const queryParams = { page: input.page, pageSize: input.pageSize };
|
|
6173
|
-
if (input.status) queryParams.status = input.status;
|
|
6174
6168
|
if (input.project) {
|
|
6175
|
-
return
|
|
6169
|
+
return projectsRemoved({
|
|
6170
|
+
hint: "Project-scoped task listing was removed. Omit --project to list every task in your workspace."
|
|
6171
|
+
});
|
|
6176
6172
|
}
|
|
6173
|
+
const queryParams = { page: input.page, pageSize: input.pageSize };
|
|
6174
|
+
if (input.status) queryParams.status = input.status;
|
|
6177
6175
|
return ctx.client.get("tasks", { queryParams });
|
|
6178
6176
|
},
|
|
6179
6177
|
formatOutput(output, format) {
|
|
@@ -6329,7 +6327,7 @@ var tasksUpdate = {
|
|
|
6329
6327
|
"Provide at least one field to update."
|
|
6330
6328
|
);
|
|
6331
6329
|
}
|
|
6332
|
-
return ctx.client.
|
|
6330
|
+
return ctx.client.put("task", fields, {
|
|
6333
6331
|
pathParams: { id: taskId }
|
|
6334
6332
|
});
|
|
6335
6333
|
},
|