@ronakgajjar/paperclip-plugin-gchat 0.1.1 → 0.1.3

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/manifest.js CHANGED
@@ -7,26 +7,17 @@ var manifest = {
7
7
  description: "Sends agent output to a Google Chat space via webhook",
8
8
  author: "Your Name",
9
9
  categories: ["connector"],
10
- capabilities: [
11
- "events.subscribe",
12
- "plugin.state.read",
13
- "plugin.state.write",
14
- "secrets.read",
15
- "ui.dashboardWidget.register"
16
- ],
17
- entrypoints: {
18
- worker: "./dist/worker.js",
19
- ui: "./dist/ui"
10
+ capabilities: ["plugin.state.read", "plugin.state.write", "ui.dashboardWidget.register"],
11
+ instanceConfigSchema: {
12
+ type: "object",
13
+ properties: {
14
+ webhookUrl: { type: "string", title: "Google Chat Webhook URL" }
15
+ },
16
+ required: ["webhookUrl"]
20
17
  },
18
+ entrypoints: { worker: "./dist/worker.js", ui: "./dist/ui" },
21
19
  ui: {
22
- slots: [
23
- {
24
- type: "dashboardWidget",
25
- id: "health-widget",
26
- displayName: "Google Chat Plugin Health",
27
- exportName: "DashboardWidget"
28
- }
29
- ]
20
+ slots: [{ type: "dashboardWidget", id: "health-widget", displayName: "Google Chat Plugin Health", exportName: "DashboardWidget" }]
30
21
  }
31
22
  };
32
23
  var manifest_default = manifest;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/manifest.ts"],
4
- "sourcesContent": ["import type { PaperclipPluginManifestV1 } from \"@paperclipai/plugin-sdk\";\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: \"paperclip-plugin-gchat\",\n apiVersion: 1,\n version: \"0.1.0\",\n displayName: \"Google Chat Notifier\",\n description: \"Sends agent output to a Google Chat space via webhook\",\n author: \"Your Name\",\n categories: [\"connector\"],\n capabilities: [\n \"events.subscribe\",\n \"plugin.state.read\",\n \"plugin.state.write\",\n \"secrets.read\",\n \"ui.dashboardWidget.register\"\n ],\n entrypoints: {\n worker: \"./dist/worker.js\",\n ui: \"./dist/ui\"\n },\n ui: {\n slots: [\n {\n type: \"dashboardWidget\",\n id: \"health-widget\",\n displayName: \"Google Chat Plugin Health\",\n exportName: \"DashboardWidget\"\n }\n ]\n }\n};\nexport default manifest;\n"],
5
- "mappings": ";AAEA,IAAM,WAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY,CAAC,WAAW;AAAA,EACxB,cAAc;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,aAAa;AAAA,IACX,QAAQ;AAAA,IACR,IAAI;AAAA,EACN;AAAA,EACA,IAAI;AAAA,IACF,OAAO;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,IAAI;AAAA,QACJ,aAAa;AAAA,QACb,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;AACA,IAAO,mBAAQ;",
4
+ "sourcesContent": ["import type { PaperclipPluginManifestV1 } from \"@paperclipai/plugin-sdk\";\n\nconst manifest: PaperclipPluginManifestV1 = {\n id: \"paperclip-plugin-gchat\",\n apiVersion: 1,\n version: \"0.1.0\",\n displayName: \"Google Chat Notifier\",\n description: \"Sends agent output to a Google Chat space via webhook\",\n author: \"Your Name\",\n categories: [\"connector\"],\n capabilities: [\"plugin.state.read\", \"plugin.state.write\", \"ui.dashboardWidget.register\"],\n instanceConfigSchema: {\n type: \"object\",\n properties: {\n webhookUrl: { type: \"string\", title: \"Google Chat Webhook URL\" }\n },\n required: [\"webhookUrl\"]\n },\n entrypoints: { worker: \"./dist/worker.js\", ui: \"./dist/ui\" },\n ui: {\n slots: [{ type: \"dashboardWidget\", id: \"health-widget\", displayName: \"Google Chat Plugin Health\", exportName: \"DashboardWidget\" }]\n }\n};\nexport default manifest;\n"],
5
+ "mappings": ";AAEA,IAAM,WAAsC;AAAA,EAC1C,IAAI;AAAA,EACJ,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,aAAa;AAAA,EACb,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,YAAY,CAAC,WAAW;AAAA,EACxB,cAAc,CAAC,qBAAqB,sBAAsB,6BAA6B;AAAA,EACvF,sBAAsB;AAAA,IACpB,MAAM;AAAA,IACN,YAAY;AAAA,MACV,YAAY,EAAE,MAAM,UAAU,OAAO,0BAA0B;AAAA,IACjE;AAAA,IACA,UAAU,CAAC,YAAY;AAAA,EACzB;AAAA,EACA,aAAa,EAAE,QAAQ,oBAAoB,IAAI,YAAY;AAAA,EAC3D,IAAI;AAAA,IACF,OAAO,CAAC,EAAE,MAAM,mBAAmB,IAAI,iBAAiB,aAAa,6BAA6B,YAAY,kBAAkB,CAAC;AAAA,EACnI;AACF;AACA,IAAO,mBAAQ;",
6
6
  "names": []
7
7
  }
package/dist/worker.js CHANGED
@@ -29344,22 +29344,20 @@ function startWorkerRpcHost(options) {
29344
29344
  var plugin = definePlugin({
29345
29345
  async setup(ctx) {
29346
29346
  ctx.actions.register("send_google_chat", async (params) => {
29347
- const { message } = params;
29348
- const webhookUrl = await ctx.secrets.get("GOOGLE_CHAT_WEBHOOK_URL");
29347
+ const { message, companyId } = params;
29348
+ const config2 = await ctx.config.get(companyId);
29349
+ const webhookUrl = config2.webhookUrl;
29349
29350
  const res = await fetch(webhookUrl, {
29350
29351
  method: "POST",
29351
29352
  headers: { "Content-Type": "application/json" },
29352
29353
  body: JSON.stringify({ text: message })
29353
29354
  });
29354
- ctx.logger.info("Sent Google Chat message", { ok: res.ok });
29355
29355
  return { sent: res.ok };
29356
29356
  });
29357
- ctx.data.register("health", async () => {
29358
- return { status: "ok", checkedAt: (/* @__PURE__ */ new Date()).toISOString() };
29359
- });
29357
+ ctx.data.register("health", async () => ({ status: "ok", checkedAt: (/* @__PURE__ */ new Date()).toISOString() }));
29360
29358
  },
29361
29359
  async onHealth() {
29362
- return { status: "ok", message: "Google Chat plugin worker is running" };
29360
+ return { status: "ok", message: "running" };
29363
29361
  }
29364
29362
  });
29365
29363
  var worker_default = plugin;