@elnora-ai/cli 1.1.3 → 1.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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +226 -188
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -56,7 +56,7 @@ elnora tasks send <task-id> --message "Focus on selectivity" --stream
56
56
  | `projects` | list, get, create, update, archive, members, add-member, update-role, remove-member, leave |
57
57
  | `tasks` | list, get, create, send (--stream, --wait), messages, update, archive |
58
58
  | `files` | list, get, content, create, upload, download, update, archive, versions, fork, promote, working-copy, commit |
59
- | `orgs` | list, get, create, update, members, billing, invite, invitations, delete |
59
+ | `orgs` | list, get, create, update, members, billing, invite, invitations, resend-invite, cancel-invite, delete |
60
60
  | `folders` | list, create, rename, move, delete |
61
61
  | `search` | tasks, files, all, file-content |
62
62
  | `library` | files, folders, create-folder, rename-folder, delete-folder |
package/dist/cli.js CHANGED
@@ -21,12 +21,13 @@ function buildUrl(endpointKey, params, baseUrl) {
21
21
  }
22
22
  return `${baseUrl ?? BASE_URL}${resolved}`;
23
23
  }
24
- var VERSION, BASE_URL, AI_SERVER_URL, ENDPOINTS, DEFAULT_HEADERS;
24
+ var VERSION, PRODUCTION_BASE_URL, BASE_URL, AI_SERVER_URL, ENDPOINTS, DEFAULT_HEADERS;
25
25
  var init_config = __esm({
26
26
  "src/lib/config.ts"() {
27
27
  "use strict";
28
28
  VERSION = typeof __APP_VERSION__ !== "undefined" ? __APP_VERSION__ : process.env.npm_package_version ?? "0.0.0-dev";
29
- BASE_URL = "https://platform.elnora.ai/api/v1";
29
+ PRODUCTION_BASE_URL = "https://platform.elnora.ai/api/v1";
30
+ BASE_URL = process.env.ELNORA_API_URL ?? PRODUCTION_BASE_URL;
30
31
  AI_SERVER_URL = process.env.ELNORA_AI_SERVER_URL ?? "https://platform.elnora.ai/ai-server";
31
32
  ENDPOINTS = {
32
33
  // Projects
@@ -75,6 +76,7 @@ var init_config = __esm({
75
76
  // Organization invitations
76
77
  org_invitations: "/organizations/{orgId}/invitations",
77
78
  org_invitation: "/organizations/{orgId}/invitations/{invId}",
79
+ org_invitation_resend: "/organizations/{orgId}/invitations/{invId}/resend",
78
80
  // Public invitations
79
81
  invitation_info: "/invitations/{token}",
80
82
  invitation_accept: "/invitations/{token}/accept",
@@ -497,7 +499,7 @@ var init_client = __esm({
497
499
  }
498
500
  url = `${url}?${qs.toString()}`;
499
501
  }
500
- if (this.baseUrl === BASE_URL) {
502
+ if (this.baseUrl === PRODUCTION_BASE_URL) {
501
503
  validateApiUrl(url);
502
504
  }
503
505
  const now = Date.now();
@@ -3456,9 +3458,12 @@ var orgsInvite = {
3456
3458
  const items = Array.isArray(existing) ? existing : existing?.items ?? [];
3457
3459
  const match = items.find((inv) => {
3458
3460
  const i = inv;
3459
- return i.email?.toLowerCase() === input.email.toLowerCase() && i.status === "Pending";
3461
+ return i.email?.toLowerCase() === input.email.toLowerCase();
3460
3462
  });
3461
- if (match) return match;
3463
+ if (match) {
3464
+ const matchId = match.id;
3465
+ return ctx.client.post("org_invitation_resend", {}, { pathParams: { orgId: input.orgId, invId: matchId } });
3466
+ }
3462
3467
  return ctx.client.post(
3463
3468
  "org_invitations",
3464
3469
  { email: input.email, role: input.role ?? "Member" },
@@ -3557,17 +3562,43 @@ var orgsRemoveMember = {
3557
3562
  }
3558
3563
  };
3559
3564
 
3560
- // src/commands/orgs/set-default.ts
3565
+ // src/commands/orgs/resend-invite.ts
3561
3566
  import { z as z70 } from "zod";
3562
3567
  var inputSchema68 = z70.object({
3563
- orgId: z70.string().uuid().describe("Organization ID to set as default")
3568
+ orgId: z70.string().uuid().describe("Organization ID"),
3569
+ invitationId: z70.string().uuid().describe("Invitation ID to resend")
3570
+ });
3571
+ var orgsResendInvite = {
3572
+ name: "orgs.resendInvite",
3573
+ group: "orgs",
3574
+ description: "Resend an organization invitation email. Regenerates the token and extends the expiry by 7 days. Works on both pending and expired invitations, preserves the invitation ID.",
3575
+ inputSchema: inputSchema68,
3576
+ outputSchema: z70.any(),
3577
+ annotations: { idempotentHint: true },
3578
+ async execute(input, ctx) {
3579
+ return ctx.client.post(
3580
+ "org_invitation_resend",
3581
+ {},
3582
+ { pathParams: { orgId: input.orgId, invId: input.invitationId } }
3583
+ );
3584
+ },
3585
+ formatOutput(output, format) {
3586
+ if (format === "compact") return output.id ?? JSON.stringify(output);
3587
+ return JSON.stringify(output, null, 2);
3588
+ }
3589
+ };
3590
+
3591
+ // src/commands/orgs/set-default.ts
3592
+ import { z as z71 } from "zod";
3593
+ var inputSchema69 = z71.object({
3594
+ orgId: z71.string().uuid().describe("Organization ID to set as default")
3564
3595
  });
3565
3596
  var orgsSetDefault = {
3566
3597
  name: "orgs.setDefault",
3567
3598
  group: "orgs",
3568
3599
  description: "Set an organization as the default",
3569
- inputSchema: inputSchema68,
3570
- outputSchema: z70.any(),
3600
+ inputSchema: inputSchema69,
3601
+ outputSchema: z71.any(),
3571
3602
  annotations: { idempotentHint: true },
3572
3603
  async execute(input, ctx) {
3573
3604
  return ctx.client.put("organization_set_default", void 0, {
@@ -3581,17 +3612,17 @@ var orgsSetDefault = {
3581
3612
  };
3582
3613
 
3583
3614
  // src/commands/orgs/set-stripe.ts
3584
- import { z as z71 } from "zod";
3585
- var inputSchema69 = z71.object({
3586
- orgId: z71.string().uuid().describe("Organization ID"),
3587
- customerId: z71.string().min(1).describe("Stripe customer ID (e.g. cus_xxx)")
3615
+ import { z as z72 } from "zod";
3616
+ var inputSchema70 = z72.object({
3617
+ orgId: z72.string().uuid().describe("Organization ID"),
3618
+ customerId: z72.string().min(1).describe("Stripe customer ID (e.g. cus_xxx)")
3588
3619
  });
3589
3620
  var orgsSetStripe = {
3590
3621
  name: "orgs.setStripe",
3591
3622
  group: "orgs",
3592
3623
  description: "Set the Stripe customer ID for an organization",
3593
- inputSchema: inputSchema69,
3594
- outputSchema: z71.any(),
3624
+ inputSchema: inputSchema70,
3625
+ outputSchema: z72.any(),
3595
3626
  annotations: { idempotentHint: true },
3596
3627
  async execute(input, ctx) {
3597
3628
  return ctx.client.put(
@@ -3608,18 +3639,18 @@ var orgsSetStripe = {
3608
3639
 
3609
3640
  // src/commands/orgs/update.ts
3610
3641
  init_errors();
3611
- import { z as z72 } from "zod";
3612
- var inputSchema70 = z72.object({
3613
- orgId: z72.string().uuid().describe("Organization ID"),
3614
- name: z72.string().min(1).optional().describe("New organization name"),
3615
- description: z72.string().optional().describe("New organization description")
3642
+ import { z as z73 } from "zod";
3643
+ var inputSchema71 = z73.object({
3644
+ orgId: z73.string().uuid().describe("Organization ID"),
3645
+ name: z73.string().min(1).optional().describe("New organization name"),
3646
+ description: z73.string().optional().describe("New organization description")
3616
3647
  });
3617
3648
  var orgsUpdate = {
3618
3649
  name: "orgs.update",
3619
3650
  group: "orgs",
3620
3651
  description: "Update an existing organization",
3621
- inputSchema: inputSchema70,
3622
- outputSchema: z72.any(),
3652
+ inputSchema: inputSchema71,
3653
+ outputSchema: z73.any(),
3623
3654
  annotations: { idempotentHint: true },
3624
3655
  async execute(input, ctx) {
3625
3656
  const { orgId, ...fields } = input;
@@ -3640,18 +3671,18 @@ var orgsUpdate = {
3640
3671
  };
3641
3672
 
3642
3673
  // src/commands/orgs/update-role.ts
3643
- import { z as z73 } from "zod";
3644
- var inputSchema71 = z73.object({
3645
- orgId: z73.string().uuid().describe("Organization ID"),
3646
- membershipId: z73.string().uuid().describe("Membership ID of the member"),
3647
- role: z73.string().min(1).describe("New role to assign")
3674
+ import { z as z74 } from "zod";
3675
+ var inputSchema72 = z74.object({
3676
+ orgId: z74.string().uuid().describe("Organization ID"),
3677
+ membershipId: z74.string().uuid().describe("Membership ID of the member"),
3678
+ role: z74.string().min(1).describe("New role to assign")
3648
3679
  });
3649
3680
  var orgsUpdateRole = {
3650
3681
  name: "orgs.updateRole",
3651
3682
  group: "orgs",
3652
3683
  description: "Update an organization member's role",
3653
- inputSchema: inputSchema71,
3654
- outputSchema: z73.any(),
3684
+ inputSchema: inputSchema72,
3685
+ outputSchema: z74.any(),
3655
3686
  annotations: { idempotentHint: true },
3656
3687
  async execute(input, ctx) {
3657
3688
  return ctx.client.put(
@@ -3683,6 +3714,7 @@ function registerOrgCommands() {
3683
3714
  orgsInvite,
3684
3715
  orgsInvitations,
3685
3716
  orgsCancelInvite,
3717
+ orgsResendInvite,
3686
3718
  orgsInvitationInfo,
3687
3719
  orgsAcceptInvite,
3688
3720
  orgsFiles,
@@ -3691,18 +3723,18 @@ function registerOrgCommands() {
3691
3723
  }
3692
3724
 
3693
3725
  // src/commands/projects/add-member.ts
3694
- import { z as z74 } from "zod";
3695
- var inputSchema72 = z74.object({
3696
- projectId: z74.string().uuid().describe("Project ID"),
3697
- userId: z74.string().uuid().describe("User ID to add"),
3698
- role: z74.string().default("Member").describe("Role to assign (default: Member)")
3726
+ import { z as z75 } from "zod";
3727
+ var inputSchema73 = z75.object({
3728
+ projectId: z75.string().uuid().describe("Project ID"),
3729
+ userId: z75.string().uuid().describe("User ID to add"),
3730
+ role: z75.string().default("Member").describe("Role to assign (default: Member)")
3699
3731
  });
3700
3732
  var projectsAddMember = {
3701
3733
  name: "projects.addMember",
3702
3734
  group: "projects",
3703
3735
  description: "Add a member to a project",
3704
- inputSchema: inputSchema72,
3705
- outputSchema: z74.any(),
3736
+ inputSchema: inputSchema73,
3737
+ outputSchema: z75.any(),
3706
3738
  async execute(input, ctx) {
3707
3739
  return ctx.client.post(
3708
3740
  "project_members",
@@ -3717,16 +3749,16 @@ var projectsAddMember = {
3717
3749
  };
3718
3750
 
3719
3751
  // src/commands/projects/archive.ts
3720
- import { z as z75 } from "zod";
3721
- var inputSchema73 = z75.object({
3722
- projectId: z75.string().uuid().describe("Project ID to archive")
3752
+ import { z as z76 } from "zod";
3753
+ var inputSchema74 = z76.object({
3754
+ projectId: z76.string().uuid().describe("Project ID to archive")
3723
3755
  });
3724
3756
  var projectsArchive = {
3725
3757
  name: "projects.archive",
3726
3758
  group: "projects",
3727
3759
  description: "Archive (delete) a project",
3728
- inputSchema: inputSchema73,
3729
- outputSchema: z75.any(),
3760
+ inputSchema: inputSchema74,
3761
+ outputSchema: z76.any(),
3730
3762
  annotations: { destructiveHint: true },
3731
3763
  async execute(input, ctx) {
3732
3764
  await ctx.client.del("project", {
@@ -3741,18 +3773,18 @@ var projectsArchive = {
3741
3773
  };
3742
3774
 
3743
3775
  // src/commands/projects/create.ts
3744
- import { z as z76 } from "zod";
3745
- var inputSchema74 = z76.object({
3746
- name: z76.string().min(1).describe("Project name"),
3747
- description: z76.string().optional().describe("Project description"),
3748
- icon: z76.string().optional().describe("Project icon")
3776
+ import { z as z77 } from "zod";
3777
+ var inputSchema75 = z77.object({
3778
+ name: z77.string().min(1).describe("Project name"),
3779
+ description: z77.string().optional().describe("Project description"),
3780
+ icon: z77.string().optional().describe("Project icon")
3749
3781
  });
3750
3782
  var projectsCreate = {
3751
3783
  name: "projects.create",
3752
3784
  group: "projects",
3753
3785
  description: "Create a new project",
3754
- inputSchema: inputSchema74,
3755
- outputSchema: z76.any(),
3786
+ inputSchema: inputSchema75,
3787
+ outputSchema: z77.any(),
3756
3788
  async execute(input, ctx) {
3757
3789
  return ctx.client.post("projects", input);
3758
3790
  },
@@ -3763,16 +3795,16 @@ var projectsCreate = {
3763
3795
  };
3764
3796
 
3765
3797
  // src/commands/projects/get.ts
3766
- import { z as z77 } from "zod";
3767
- var inputSchema75 = z77.object({
3768
- projectId: z77.string().uuid().describe("Project ID")
3798
+ import { z as z78 } from "zod";
3799
+ var inputSchema76 = z78.object({
3800
+ projectId: z78.string().uuid().describe("Project ID")
3769
3801
  });
3770
3802
  var projectsGet = {
3771
3803
  name: "projects.get",
3772
3804
  group: "projects",
3773
3805
  description: "Get details of a specific project",
3774
- inputSchema: inputSchema75,
3775
- outputSchema: z77.any(),
3806
+ inputSchema: inputSchema76,
3807
+ outputSchema: z78.any(),
3776
3808
  annotations: { readOnlyHint: true },
3777
3809
  async execute(input, ctx) {
3778
3810
  return ctx.client.get("project", {
@@ -3786,16 +3818,16 @@ var projectsGet = {
3786
3818
  };
3787
3819
 
3788
3820
  // src/commands/projects/leave.ts
3789
- import { z as z78 } from "zod";
3790
- var inputSchema76 = z78.object({
3791
- projectId: z78.string().uuid().describe("Project ID to leave")
3821
+ import { z as z79 } from "zod";
3822
+ var inputSchema77 = z79.object({
3823
+ projectId: z79.string().uuid().describe("Project ID to leave")
3792
3824
  });
3793
3825
  var projectsLeave = {
3794
3826
  name: "projects.leave",
3795
3827
  group: "projects",
3796
3828
  description: "Leave a project",
3797
- inputSchema: inputSchema76,
3798
- outputSchema: z78.any(),
3829
+ inputSchema: inputSchema77,
3830
+ outputSchema: z79.any(),
3799
3831
  annotations: { destructiveHint: true },
3800
3832
  async execute(input, ctx) {
3801
3833
  return ctx.client.post("project_leave", void 0, {
@@ -3809,16 +3841,16 @@ var projectsLeave = {
3809
3841
  };
3810
3842
 
3811
3843
  // src/commands/projects/list.ts
3812
- import { z as z79 } from "zod";
3813
- var inputSchema77 = z79.object({
3844
+ import { z as z80 } from "zod";
3845
+ var inputSchema78 = z80.object({
3814
3846
  ...paginationInput
3815
3847
  });
3816
3848
  var projectsList = {
3817
3849
  name: "projects.list",
3818
3850
  group: "projects",
3819
3851
  description: "List all projects accessible to the current user",
3820
- inputSchema: inputSchema77,
3821
- outputSchema: z79.any(),
3852
+ inputSchema: inputSchema78,
3853
+ outputSchema: z80.any(),
3822
3854
  annotations: { readOnlyHint: true },
3823
3855
  async execute(input, ctx) {
3824
3856
  return ctx.client.get("projects", {
@@ -3832,16 +3864,16 @@ var projectsList = {
3832
3864
  };
3833
3865
 
3834
3866
  // src/commands/projects/members.ts
3835
- import { z as z80 } from "zod";
3836
- var inputSchema78 = z80.object({
3837
- projectId: z80.string().uuid().describe("Project ID")
3867
+ import { z as z81 } from "zod";
3868
+ var inputSchema79 = z81.object({
3869
+ projectId: z81.string().uuid().describe("Project ID")
3838
3870
  });
3839
3871
  var projectsMembers = {
3840
3872
  name: "projects.members",
3841
3873
  group: "projects",
3842
3874
  description: "List members of a project",
3843
- inputSchema: inputSchema78,
3844
- outputSchema: z80.any(),
3875
+ inputSchema: inputSchema79,
3876
+ outputSchema: z81.any(),
3845
3877
  annotations: { readOnlyHint: true },
3846
3878
  async execute(input, ctx) {
3847
3879
  return ctx.client.get("project_members", {
@@ -3855,17 +3887,17 @@ var projectsMembers = {
3855
3887
  };
3856
3888
 
3857
3889
  // src/commands/projects/remove-member.ts
3858
- import { z as z81 } from "zod";
3859
- var inputSchema79 = z81.object({
3860
- projectId: z81.string().uuid().describe("Project ID"),
3861
- userId: z81.string().uuid().describe("User ID to remove")
3890
+ import { z as z82 } from "zod";
3891
+ var inputSchema80 = z82.object({
3892
+ projectId: z82.string().uuid().describe("Project ID"),
3893
+ userId: z82.string().uuid().describe("User ID to remove")
3862
3894
  });
3863
3895
  var projectsRemoveMember = {
3864
3896
  name: "projects.removeMember",
3865
3897
  group: "projects",
3866
3898
  description: "Remove a member from a project",
3867
- inputSchema: inputSchema79,
3868
- outputSchema: z81.any(),
3899
+ inputSchema: inputSchema80,
3900
+ outputSchema: z82.any(),
3869
3901
  annotations: { destructiveHint: true },
3870
3902
  async execute(input, ctx) {
3871
3903
  await ctx.client.del("project_member", {
@@ -3881,19 +3913,19 @@ var projectsRemoveMember = {
3881
3913
 
3882
3914
  // src/commands/projects/update.ts
3883
3915
  init_errors();
3884
- import { z as z82 } from "zod";
3885
- var inputSchema80 = z82.object({
3886
- projectId: z82.string().uuid().describe("Project ID"),
3887
- name: z82.string().min(1).optional().describe("New project name"),
3888
- description: z82.string().optional().describe("New project description"),
3889
- icon: z82.string().optional().describe("New project icon")
3916
+ import { z as z83 } from "zod";
3917
+ var inputSchema81 = z83.object({
3918
+ projectId: z83.string().uuid().describe("Project ID"),
3919
+ name: z83.string().min(1).optional().describe("New project name"),
3920
+ description: z83.string().optional().describe("New project description"),
3921
+ icon: z83.string().optional().describe("New project icon")
3890
3922
  });
3891
3923
  var projectsUpdate = {
3892
3924
  name: "projects.update",
3893
3925
  group: "projects",
3894
3926
  description: "Update an existing project",
3895
- inputSchema: inputSchema80,
3896
- outputSchema: z82.any(),
3927
+ inputSchema: inputSchema81,
3928
+ outputSchema: z83.any(),
3897
3929
  annotations: { idempotentHint: true },
3898
3930
  async execute(input, ctx) {
3899
3931
  const { projectId, ...fields } = input;
@@ -3914,18 +3946,18 @@ var projectsUpdate = {
3914
3946
  };
3915
3947
 
3916
3948
  // src/commands/projects/update-role.ts
3917
- import { z as z83 } from "zod";
3918
- var inputSchema81 = z83.object({
3919
- projectId: z83.string().uuid().describe("Project ID"),
3920
- userId: z83.string().uuid().describe("User ID of the member"),
3921
- role: z83.string().min(1).describe("New role to assign")
3949
+ import { z as z84 } from "zod";
3950
+ var inputSchema82 = z84.object({
3951
+ projectId: z84.string().uuid().describe("Project ID"),
3952
+ userId: z84.string().uuid().describe("User ID of the member"),
3953
+ role: z84.string().min(1).describe("New role to assign")
3922
3954
  });
3923
3955
  var projectsUpdateRole = {
3924
3956
  name: "projects.updateRole",
3925
3957
  group: "projects",
3926
3958
  description: "Update a project member's role",
3927
- inputSchema: inputSchema81,
3928
- outputSchema: z83.any(),
3959
+ inputSchema: inputSchema82,
3960
+ outputSchema: z84.any(),
3929
3961
  annotations: { idempotentHint: true },
3930
3962
  async execute(input, ctx) {
3931
3963
  return ctx.client.put(
@@ -3957,17 +3989,17 @@ function registerProjectCommands() {
3957
3989
  }
3958
3990
 
3959
3991
  // src/commands/search/all.ts
3960
- import { z as z84 } from "zod";
3961
- var inputSchema82 = z84.object({
3962
- query: z84.string().min(1).describe("Search query"),
3992
+ import { z as z85 } from "zod";
3993
+ var inputSchema83 = z85.object({
3994
+ query: z85.string().min(1).describe("Search query"),
3963
3995
  ...paginationInput
3964
3996
  });
3965
3997
  var searchAll = {
3966
3998
  name: "search.all",
3967
3999
  group: "search",
3968
4000
  description: "Search across all entities",
3969
- inputSchema: inputSchema82,
3970
- outputSchema: z84.any(),
4001
+ inputSchema: inputSchema83,
4002
+ outputSchema: z85.any(),
3971
4003
  annotations: { readOnlyHint: true },
3972
4004
  async execute(input, ctx) {
3973
4005
  return ctx.client.get("search_all", {
@@ -3981,18 +4013,18 @@ var searchAll = {
3981
4013
  };
3982
4014
 
3983
4015
  // src/commands/search/file-content.ts
3984
- import { z as z85 } from "zod";
3985
- var inputSchema83 = z85.object({
3986
- query: z85.string().min(1).describe("Search query"),
3987
- projectId: z85.string().uuid().optional().describe("Filter by project ID"),
4016
+ import { z as z86 } from "zod";
4017
+ var inputSchema84 = z86.object({
4018
+ query: z86.string().min(1).describe("Search query"),
4019
+ projectId: z86.string().uuid().optional().describe("Filter by project ID"),
3988
4020
  ...paginationInput
3989
4021
  });
3990
4022
  var searchFileContent = {
3991
4023
  name: "search.fileContent",
3992
4024
  group: "search",
3993
4025
  description: "Search within file contents",
3994
- inputSchema: inputSchema83,
3995
- outputSchema: z85.any(),
4026
+ inputSchema: inputSchema84,
4027
+ outputSchema: z86.any(),
3996
4028
  annotations: { readOnlyHint: true },
3997
4029
  async execute(input, ctx) {
3998
4030
  const queryParams = {
@@ -4010,17 +4042,17 @@ var searchFileContent = {
4010
4042
  };
4011
4043
 
4012
4044
  // src/commands/search/files.ts
4013
- import { z as z86 } from "zod";
4014
- var inputSchema84 = z86.object({
4015
- query: z86.string().min(1).describe("Search query"),
4045
+ import { z as z87 } from "zod";
4046
+ var inputSchema85 = z87.object({
4047
+ query: z87.string().min(1).describe("Search query"),
4016
4048
  ...paginationInput
4017
4049
  });
4018
4050
  var searchFiles = {
4019
4051
  name: "search.files",
4020
4052
  group: "search",
4021
4053
  description: "Search files by query",
4022
- inputSchema: inputSchema84,
4023
- outputSchema: z86.any(),
4054
+ inputSchema: inputSchema85,
4055
+ outputSchema: z87.any(),
4024
4056
  annotations: { readOnlyHint: true },
4025
4057
  async execute(input, ctx) {
4026
4058
  return ctx.client.get("search_files", {
@@ -4034,17 +4066,17 @@ var searchFiles = {
4034
4066
  };
4035
4067
 
4036
4068
  // src/commands/search/tasks.ts
4037
- import { z as z87 } from "zod";
4038
- var inputSchema85 = z87.object({
4039
- query: z87.string().min(1).describe("Search query"),
4069
+ import { z as z88 } from "zod";
4070
+ var inputSchema86 = z88.object({
4071
+ query: z88.string().min(1).describe("Search query"),
4040
4072
  ...paginationInput
4041
4073
  });
4042
4074
  var searchTasks = {
4043
4075
  name: "search.tasks",
4044
4076
  group: "search",
4045
4077
  description: "Search tasks by query",
4046
- inputSchema: inputSchema85,
4047
- outputSchema: z87.any(),
4078
+ inputSchema: inputSchema86,
4079
+ outputSchema: z88.any(),
4048
4080
  annotations: { readOnlyHint: true },
4049
4081
  async execute(input, ctx) {
4050
4082
  return ctx.client.get("search_tasks", {
@@ -4171,16 +4203,16 @@ function addSetupClaudeCommand(program2) {
4171
4203
  }
4172
4204
 
4173
4205
  // src/commands/tasks/archive.ts
4174
- import { z as z88 } from "zod";
4175
- var inputSchema86 = z88.object({
4176
- taskId: z88.string().uuid().describe("Task ID to archive")
4206
+ import { z as z89 } from "zod";
4207
+ var inputSchema87 = z89.object({
4208
+ taskId: z89.string().uuid().describe("Task ID to archive")
4177
4209
  });
4178
4210
  var tasksArchive = {
4179
4211
  name: "tasks.archive",
4180
4212
  group: "tasks",
4181
4213
  description: "Archive (delete) a task",
4182
- inputSchema: inputSchema86,
4183
- outputSchema: z88.any(),
4214
+ inputSchema: inputSchema87,
4215
+ outputSchema: z89.any(),
4184
4216
  annotations: { destructiveHint: true },
4185
4217
  async execute(input, ctx) {
4186
4218
  await ctx.client.del("task", {
@@ -4195,7 +4227,7 @@ var tasksArchive = {
4195
4227
  };
4196
4228
 
4197
4229
  // src/commands/tasks/create.ts
4198
- import { z as z89 } from "zod";
4230
+ import { z as z90 } from "zod";
4199
4231
 
4200
4232
  // src/lib/poll.ts
4201
4233
  init_errors();
@@ -4331,27 +4363,16 @@ var StreamRenderer = class {
4331
4363
  renderEvent(event) {
4332
4364
  switch (event.type) {
4333
4365
  case "think":
4334
- this.startSpinner("Thinking...");
4366
+ this.startSpinner(event.content);
4335
4367
  break;
4336
4368
  case "tool_start":
4337
- this.stopSpinner();
4338
- this.startSpinner(`Using ${event.tool}...`);
4369
+ this.startSpinner(`Using ${event.tool}\u2026`);
4339
4370
  break;
4340
- case "tool_end": {
4371
+ case "tool_end":
4341
4372
  this.stopSpinner();
4342
- const toolEvent = event;
4343
- const icon = toolEvent.success ? this.useColor ? pc4.green("\u2713") : "\u2713" : this.useColor ? pc4.red("\u2717") : "\u2717";
4344
- const suffix = toolEvent.result ? ` (${toolEvent.result})` : "";
4345
- process.stderr.write(` ${icon} ${toolEvent.tool}${suffix}
4346
- `);
4347
4373
  break;
4348
- }
4349
4374
  case "progress":
4350
- this.stopSpinner();
4351
- process.stderr.write(
4352
- ` ${this.useColor ? pc4.dim(event.content) : event.content}
4353
- `
4354
- );
4375
+ this.startSpinner(event.content);
4355
4376
  break;
4356
4377
  case "token":
4357
4378
  this.stopSpinner();
@@ -4409,19 +4430,19 @@ ${this.useColor ? pc4.yellow("Stream timed out.") : "Stream timed out."}
4409
4430
  };
4410
4431
 
4411
4432
  // src/commands/tasks/create.ts
4412
- var inputSchema87 = z89.object({
4413
- project: z89.string().uuid().describe("Project ID"),
4414
- title: z89.string().optional().describe("Task title"),
4415
- message: z89.string().optional().describe("Initial message"),
4416
- wait: z89.boolean().default(false).describe("Wait for agent response (polling)"),
4417
- stream: z89.boolean().default(false).describe("Stream agent response in real-time (SSE)")
4433
+ var inputSchema88 = z90.object({
4434
+ project: z90.string().uuid().describe("Project ID"),
4435
+ title: z90.string().optional().describe("Task title"),
4436
+ message: z90.string().optional().describe("Initial message"),
4437
+ wait: z90.boolean().default(false).describe("Wait for agent response (polling)"),
4438
+ stream: z90.boolean().default(false).describe("Stream agent response in real-time (SSE)")
4418
4439
  });
4419
4440
  var tasksCreate = {
4420
4441
  name: "tasks.create",
4421
4442
  group: "tasks",
4422
4443
  description: "Create a new task in a project",
4423
- inputSchema: inputSchema87,
4424
- outputSchema: z89.any(),
4444
+ inputSchema: inputSchema88,
4445
+ outputSchema: z90.any(),
4425
4446
  async execute(input, ctx) {
4426
4447
  const result = await ctx.client.post("tasks", {
4427
4448
  projectId: input.project,
@@ -4438,18 +4459,27 @@ var tasksCreate = {
4438
4459
  const apiKey = resolveApiKey(ctx.profileName);
4439
4460
  const content = await collectStreamResponse(taskId, apiKey);
4440
4461
  return { ...result, response: content };
4441
- } catch {
4462
+ } catch (err) {
4463
+ process.stderr.write(
4464
+ `Stream failed (${err instanceof Error ? err.message : String(err)}), polling fallback.
4465
+ `
4466
+ );
4442
4467
  return pollForResponse(ctx.client, taskId, sequence);
4443
4468
  }
4444
4469
  }
4445
4470
  if (input.stream) {
4446
- const apiKey = resolveApiKey(ctx.profileName);
4447
- const renderer = new StreamRenderer();
4448
- for await (const event of streamTask(taskId, apiKey)) {
4449
- renderer.renderEvent(event);
4471
+ try {
4472
+ const apiKey = resolveApiKey(ctx.profileName);
4473
+ const renderer = new StreamRenderer();
4474
+ for await (const event of streamTask(taskId, apiKey)) {
4475
+ renderer.renderEvent(event);
4476
+ }
4477
+ renderer.stopSpinner();
4478
+ return { ...result, streamed: true };
4479
+ } catch {
4480
+ process.stderr.write("Streaming failed \u2014 falling back to polling.\n");
4481
+ return pollForResponse(ctx.client, taskId, sequence);
4450
4482
  }
4451
- renderer.stopSpinner();
4452
- return { ...result, streamed: true };
4453
4483
  }
4454
4484
  return pollForResponse(ctx.client, taskId, sequence);
4455
4485
  },
@@ -4462,16 +4492,16 @@ var tasksCreate = {
4462
4492
  };
4463
4493
 
4464
4494
  // src/commands/tasks/get.ts
4465
- import { z as z90 } from "zod";
4466
- var inputSchema88 = z90.object({
4467
- taskId: z90.string().uuid().describe("Task ID")
4495
+ import { z as z91 } from "zod";
4496
+ var inputSchema89 = z91.object({
4497
+ taskId: z91.string().uuid().describe("Task ID")
4468
4498
  });
4469
4499
  var tasksGet = {
4470
4500
  name: "tasks.get",
4471
4501
  group: "tasks",
4472
4502
  description: "Get details of a specific task",
4473
- inputSchema: inputSchema88,
4474
- outputSchema: z90.any(),
4503
+ inputSchema: inputSchema89,
4504
+ outputSchema: z91.any(),
4475
4505
  annotations: { readOnlyHint: true },
4476
4506
  async execute(input, ctx) {
4477
4507
  return ctx.client.get("task", {
@@ -4485,17 +4515,17 @@ var tasksGet = {
4485
4515
  };
4486
4516
 
4487
4517
  // src/commands/tasks/list.ts
4488
- import { z as z91 } from "zod";
4489
- var inputSchema89 = z91.object({
4490
- project: z91.string().uuid().optional().describe("Project ID to filter by"),
4518
+ import { z as z92 } from "zod";
4519
+ var inputSchema90 = z92.object({
4520
+ project: z92.string().uuid().optional().describe("Project ID to filter by"),
4491
4521
  ...paginationInput
4492
4522
  });
4493
4523
  var tasksList = {
4494
4524
  name: "tasks.list",
4495
4525
  group: "tasks",
4496
4526
  description: "List tasks, optionally filtered by project",
4497
- inputSchema: inputSchema89,
4498
- outputSchema: z91.any(),
4527
+ inputSchema: inputSchema90,
4528
+ outputSchema: z92.any(),
4499
4529
  annotations: { readOnlyHint: true },
4500
4530
  async execute(input, ctx) {
4501
4531
  if (input.project) {
@@ -4515,18 +4545,18 @@ var tasksList = {
4515
4545
  };
4516
4546
 
4517
4547
  // src/commands/tasks/messages.ts
4518
- import { z as z92 } from "zod";
4519
- var inputSchema90 = z92.object({
4520
- taskId: z92.string().uuid().describe("Task ID"),
4521
- cursor: z92.string().optional().describe("Pagination cursor"),
4522
- limit: z92.number().int().min(1).max(100).default(50).describe("Results per page")
4548
+ import { z as z93 } from "zod";
4549
+ var inputSchema91 = z93.object({
4550
+ taskId: z93.string().uuid().describe("Task ID"),
4551
+ cursor: z93.string().optional().describe("Pagination cursor"),
4552
+ limit: z93.number().int().min(1).max(100).default(50).describe("Results per page")
4523
4553
  });
4524
4554
  var tasksMessages = {
4525
4555
  name: "tasks.messages",
4526
4556
  group: "tasks",
4527
4557
  description: "List messages for a task",
4528
- inputSchema: inputSchema90,
4529
- outputSchema: z92.any(),
4558
+ inputSchema: inputSchema91,
4559
+ outputSchema: z93.any(),
4530
4560
  annotations: { readOnlyHint: true },
4531
4561
  async execute(input, ctx) {
4532
4562
  const queryParams = { limit: input.limit };
@@ -4545,22 +4575,22 @@ var tasksMessages = {
4545
4575
  };
4546
4576
 
4547
4577
  // src/commands/tasks/send.ts
4548
- import { z as z93 } from "zod";
4578
+ import { z as z94 } from "zod";
4549
4579
  init_profiles();
4550
4580
  var UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4551
- var inputSchema91 = z93.object({
4552
- taskId: z93.string().uuid().describe("Task ID"),
4553
- message: z93.string().min(1).describe("Message content"),
4554
- fileRefs: z93.string().optional().describe("Comma-separated file reference UUIDs"),
4555
- wait: z93.boolean().default(false).describe("Wait for agent response (polling)"),
4556
- stream: z93.boolean().default(false).describe("Stream agent response in real-time (SSE)")
4581
+ var inputSchema92 = z94.object({
4582
+ taskId: z94.string().uuid().describe("Task ID"),
4583
+ message: z94.string().min(1).describe("Message content"),
4584
+ fileRefs: z94.string().optional().describe("Comma-separated file reference UUIDs"),
4585
+ wait: z94.boolean().default(false).describe("Wait for agent response (polling)"),
4586
+ stream: z94.boolean().default(false).describe("Stream agent response in real-time (SSE)")
4557
4587
  });
4558
4588
  var tasksSend = {
4559
4589
  name: "tasks.send",
4560
4590
  group: "tasks",
4561
4591
  description: "Send a message to a task",
4562
- inputSchema: inputSchema91,
4563
- outputSchema: z93.any(),
4592
+ inputSchema: inputSchema92,
4593
+ outputSchema: z94.any(),
4564
4594
  async execute(input, ctx) {
4565
4595
  let referencedFileIds;
4566
4596
  if (input.fileRefs) {
@@ -4574,29 +4604,37 @@ var tasksSend = {
4574
4604
  },
4575
4605
  { pathParams: { id: input.taskId } }
4576
4606
  );
4607
+ const sequence = result?.sequence ?? result?.sequenceNumber ?? 0;
4577
4608
  if (ctx.mode === "mcp") {
4578
4609
  try {
4579
4610
  const apiKey = resolveApiKey(ctx.profileName);
4580
4611
  const content = await collectStreamResponse(input.taskId, apiKey);
4581
4612
  return { sent: true, taskId: input.taskId, response: content };
4582
- } catch {
4583
- const seq = result?.sequence ?? 0;
4584
- return pollForResponse(ctx.client, input.taskId, seq);
4613
+ } catch (err) {
4614
+ process.stderr.write(
4615
+ `Stream failed (${err instanceof Error ? err.message : String(err)}), polling fallback.
4616
+ `
4617
+ );
4618
+ return pollForResponse(ctx.client, input.taskId, sequence);
4585
4619
  }
4586
4620
  }
4587
4621
  if (!input.wait && !input.stream) {
4588
4622
  return result;
4589
4623
  }
4590
4624
  if (input.stream) {
4591
- const apiKey = resolveApiKey(ctx.profileName);
4592
- const renderer = new StreamRenderer();
4593
- for await (const event of streamTask(input.taskId, apiKey)) {
4594
- renderer.renderEvent(event);
4625
+ try {
4626
+ const apiKey = resolveApiKey(ctx.profileName);
4627
+ const renderer = new StreamRenderer();
4628
+ for await (const event of streamTask(input.taskId, apiKey)) {
4629
+ renderer.renderEvent(event);
4630
+ }
4631
+ renderer.stopSpinner();
4632
+ return { sent: true, taskId: input.taskId, streamed: true };
4633
+ } catch {
4634
+ process.stderr.write("Streaming failed \u2014 falling back to polling.\n");
4635
+ return pollForResponse(ctx.client, input.taskId, sequence);
4595
4636
  }
4596
- renderer.stopSpinner();
4597
- return { sent: true, taskId: input.taskId, streamed: true };
4598
4637
  }
4599
- const sequence = result?.sequence ?? result?.sequenceNumber ?? 0;
4600
4638
  return pollForResponse(ctx.client, input.taskId, sequence);
4601
4639
  },
4602
4640
  formatOutput(output, format) {
@@ -4609,18 +4647,18 @@ var tasksSend = {
4609
4647
 
4610
4648
  // src/commands/tasks/update.ts
4611
4649
  init_errors();
4612
- import { z as z94 } from "zod";
4613
- var inputSchema92 = z94.object({
4614
- taskId: z94.string().uuid().describe("Task ID"),
4615
- title: z94.string().min(1).optional().describe("New task title"),
4616
- status: z94.string().optional().describe("New task status")
4650
+ import { z as z95 } from "zod";
4651
+ var inputSchema93 = z95.object({
4652
+ taskId: z95.string().uuid().describe("Task ID"),
4653
+ title: z95.string().min(1).optional().describe("New task title"),
4654
+ status: z95.string().optional().describe("New task status")
4617
4655
  });
4618
4656
  var tasksUpdate = {
4619
4657
  name: "tasks.update",
4620
4658
  group: "tasks",
4621
4659
  description: "Update an existing task",
4622
- inputSchema: inputSchema92,
4623
- outputSchema: z94.any(),
4660
+ inputSchema: inputSchema93,
4661
+ outputSchema: z95.any(),
4624
4662
  annotations: { idempotentHint: true },
4625
4663
  async execute(input, ctx) {
4626
4664
  const { taskId, ...fields } = input;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elnora-ai/cli",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Elnora AI Platform CLI",
5
5
  "type": "module",
6
6
  "bin": {