@erdoai/cli 0.110.0 → 0.111.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/index.js +19 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1067,6 +1067,14 @@ var ErdoClient = class {
1067
1067
  input
1068
1068
  );
1069
1069
  }
1070
+ async deleteThread(threadID) {
1071
+ try {
1072
+ await this.request("DELETE", `/v1/threads/${encodeURIComponent(threadID)}`);
1073
+ } catch (err) {
1074
+ if (err instanceof ErdoApiError && err.status === 404) return;
1075
+ throw err;
1076
+ }
1077
+ }
1070
1078
  sendMessage(threadID, input) {
1071
1079
  return this.request(
1072
1080
  "POST",
@@ -3967,17 +3975,26 @@ agentCmd.command("wait <threadId>").description("Re-attach to a thread's latest
3967
3975
  fail(e);
3968
3976
  }
3969
3977
  });
3970
- agentCmd.command("thread").description("Create a thread; prints its id").option("-n, --name <name>", "thread name").option("-d, --datasets <csv>", "dataset UUIDs to attach").action(async (opts) => {
3978
+ agentCmd.command("thread").description("Create a thread; prints its id").option("-n, --name <name>", "thread name").option("-d, --datasets <csv>", "dataset UUIDs to attach").option("--hidden", "keep the thread out of the organization's thread list (for diagnostic or scripted threads)").action(async (opts) => {
3971
3979
  try {
3972
3980
  const res = await new ErdoClient().createThread({
3973
3981
  name: opts.name,
3974
- dataset_ids: opts.datasets ? opts.datasets.split(",").map((s) => s.trim()) : void 0
3982
+ dataset_ids: opts.datasets ? opts.datasets.split(",").map((s) => s.trim()) : void 0,
3983
+ visibility: opts.hidden ? "hidden" : void 0
3975
3984
  });
3976
3985
  console.log(res.id);
3977
3986
  } catch (e) {
3978
3987
  fail(e);
3979
3988
  }
3980
3989
  });
3990
+ agentCmd.command("delete").description("Permanently delete a thread and its messages (needs admin on the thread: you created it, or you are an org admin)").argument("<threadId>", "thread UUID").action(async (threadId) => {
3991
+ try {
3992
+ await new ErdoClient().deleteThread(threadId);
3993
+ console.log(`deleted ${threadId}`);
3994
+ } catch (e) {
3995
+ fail(e);
3996
+ }
3997
+ });
3981
3998
  agentCmd.command("threads").description("List threads (default: your own; --scope org/shared for organization-wide)").option("-s, --scope <scope>", "own (default) | org | shared \u2014 org/shared require org membership").option(
3982
3999
  "--order-by <order>",
3983
4000
  "created_at (default) | activity (last message time) \u2014 scope=org/shared only"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.110.0",
3
+ "version": "0.111.0",
4
4
  "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {