@cotal-ai/connector-hermes 0.1.1 → 0.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cotal-ai/connector-hermes",
3
- "version": "0.1.1",
3
+ "version": "0.3.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,14 +22,14 @@
22
22
  "dependencies": {
23
23
  "tsx": "^4.22.4",
24
24
  "zod": "^4.4.3",
25
- "@cotal-ai/connector-core": "0.2.0"
25
+ "@cotal-ai/connector-core": "0.3.0"
26
26
  },
27
27
  "peerDependencies": {
28
- "@cotal-ai/core": "0.1.3"
28
+ "@cotal-ai/core": ">=0.1.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "esbuild": "^0.28.0",
32
- "@cotal-ai/core": "0.1.3"
32
+ "@cotal-ai/core": "0.3.0"
33
33
  },
34
34
  "files": [
35
35
  "bin",
@@ -17919,6 +17919,15 @@ var MeshAgent = class extends import_node_events2.EventEmitter {
17919
17919
  args: { name, graceful: opts?.graceful ?? true }
17920
17920
  });
17921
17921
  }
17922
+ /** Ask the manager to purge the space's retained chat backlog (its `purge` op). Cleanup only —
17923
+ * it doesn't touch live agents or the anycast work queue. `includeDms` also clears DM history. */
17924
+ async purgeHistory(opts) {
17925
+ this.assertConnected();
17926
+ return this.ep.requestControl("manager", {
17927
+ op: "purge",
17928
+ args: { includeDms: opts?.includeDms ?? false }
17929
+ });
17930
+ }
17922
17931
  /** Define a persona and persist it as config (the manager's `definePersona` op writes
17923
17932
  * .cotal/agents/<name>.md). On success, announce it on the channel — the "send it out"
17924
17933
  * half — so peers see the new persona; `spawn(name)` then launches an agent wearing it. */
@@ -32870,6 +32879,27 @@ ${info}${caught}`);
32870
32879
  }
32871
32880
  }
32872
32881
  },
32882
+ {
32883
+ name: "cotal_purge",
32884
+ title: "Cotal: clear chat history",
32885
+ description: "Ask the manager to purge this space's retained chat backlog (channel history). Set includeDms to also clear direct-message history. Cleanup only \u2014 it does not affect live agents or the anycast work queue. Irreversible.",
32886
+ schema: {
32887
+ includeDms: external_exports.boolean().optional().describe("Default false: channel history only. true = also purge DM history.")
32888
+ },
32889
+ async run(agent, _config, { includeDms }) {
32890
+ try {
32891
+ const reply = await agent.purgeHistory({ includeDms });
32892
+ if (!reply.ok)
32893
+ return err(`Couldn't purge history: ${reply.error ?? "manager refused"}`);
32894
+ const d = reply.data;
32895
+ const chat = d?.chat ?? 0;
32896
+ const dm = d?.dm;
32897
+ return ok(`Cleared ${chat} channel message${chat === 1 ? "" : "s"}${dm === void 0 ? "" : ` and ${dm} DM${dm === 1 ? "" : "s"}`} from "${_config.space}".`);
32898
+ } catch (e) {
32899
+ return err(`Couldn't purge history: no manager reachable (${e.message}). Is the manager running?`);
32900
+ }
32901
+ }
32902
+ },
32873
32903
  {
32874
32904
  name: "cotal_persona",
32875
32905
  title: "Cotal: define a persona",