@cotal-ai/connector-opencode 0.2.0 → 1.0.0-next-20260614011207

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