@ronakgajjar/paperclip-plugin-gchat 0.1.1 → 0.1.2
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 +11 -18
- package/dist/manifest.js.map +2 -2
- package/dist/worker.js +5 -7
- package/dist/worker.js.map +3 -3
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
|
@@ -7,26 +7,19 @@ 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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ui: "./dist/ui"
|
|
10
|
+
capabilities: ["plugin.state.read", "plugin.state.write", "ui.dashboardWidget.register"],
|
|
11
|
+
config: {
|
|
12
|
+
schema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
webhookUrl: { type: "string", title: "Google Chat Webhook URL" }
|
|
16
|
+
},
|
|
17
|
+
required: ["webhookUrl"]
|
|
18
|
+
}
|
|
20
19
|
},
|
|
20
|
+
entrypoints: { worker: "./dist/worker.js", ui: "./dist/ui" },
|
|
21
21
|
ui: {
|
|
22
|
-
slots: [
|
|
23
|
-
{
|
|
24
|
-
type: "dashboardWidget",
|
|
25
|
-
id: "health-widget",
|
|
26
|
-
displayName: "Google Chat Plugin Health",
|
|
27
|
-
exportName: "DashboardWidget"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
22
|
+
slots: [{ type: "dashboardWidget", id: "health-widget", displayName: "Google Chat Plugin Health", exportName: "DashboardWidget" }]
|
|
30
23
|
}
|
|
31
24
|
};
|
|
32
25
|
var manifest_default = manifest;
|
package/dist/manifest.js.map
CHANGED
|
@@ -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: [\
|
|
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,
|
|
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 config: {\n schema: {\n type: \"object\",\n properties: {\n webhookUrl: { type: \"string\", title: \"Google Chat Webhook URL\" }\n },\n required: [\"webhookUrl\"]\n }\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,QAAQ;AAAA,IACN,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,YAAY;AAAA,QACV,YAAY,EAAE,MAAM,UAAU,OAAO,0BAA0B;AAAA,MACjE;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,IACzB;AAAA,EACF;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
|
|
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: "
|
|
29360
|
+
return { status: "ok", message: "running" };
|
|
29363
29361
|
}
|
|
29364
29362
|
});
|
|
29365
29363
|
var worker_default = plugin;
|