paperclip-plugin-google-chat 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/README.md +17 -0
- package/dist/constants.d.ts +9 -5
- package/dist/constants.js +9 -5
- package/dist/events.js +10 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,23 @@ src/
|
|
|
73
73
|
|
|
74
74
|
Pure logic (formatting, parsing, routing, validation) is separated from the SDK-facing worker so it is unit-tested without a running Paperclip (`tests/`).
|
|
75
75
|
|
|
76
|
+
## Adapter compatibility (important)
|
|
77
|
+
|
|
78
|
+
The plugin's **worker-side** features work with **any** adapter, because they run in the
|
|
79
|
+
plugin worker, not the agent:
|
|
80
|
+
|
|
81
|
+
- ✅ **Event notifications** (`events.subscribe` → Chat)
|
|
82
|
+
- ✅ **Inbound slash commands** (`webhooks.receive`)
|
|
83
|
+
- ✅ **Daily digest job** (`jobs.schedule`)
|
|
84
|
+
|
|
85
|
+
The **agent tools** (`post_to_google_chat`, `escalate_to_human`, `send_briefing`) are only
|
|
86
|
+
callable by adapters whose tool calls are routed **through Paperclip's tool dispatcher**. They
|
|
87
|
+
are **not available to `claude_local` / `codex_local` "process" adapters**, which run the CLI
|
|
88
|
+
(e.g. `claude -p`) as a black-box subprocess — Paperclip captures stdout but never sees the
|
|
89
|
+
agent's individual tool calls, so plugin tools can't be surfaced to them. For a CLI-based
|
|
90
|
+
fleet, drive Chat via the event/webhook features above, or give the agent its own posting
|
|
91
|
+
mechanism (an MCP server, or a direct webhook `curl`).
|
|
92
|
+
|
|
76
93
|
## Develop
|
|
77
94
|
|
|
78
95
|
```bash
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* the same convention).
|
|
5
5
|
*/
|
|
6
6
|
export declare const PLUGIN_ID = "google-chat";
|
|
7
|
-
export declare const PLUGIN_VERSION = "0.1.
|
|
7
|
+
export declare const PLUGIN_VERSION = "0.1.2";
|
|
8
8
|
/** Webhook endpoint keys declared in the manifest and matched in `onWebhook`. */
|
|
9
9
|
export declare const WEBHOOK_KEYS: {
|
|
10
10
|
/** Google Chat app events (MESSAGE, ADDED_TO_SPACE, CARD_CLICKED, …) POST here. */
|
|
@@ -21,13 +21,17 @@ export declare const JOB_KEYS: {
|
|
|
21
21
|
readonly dailyDigest: "daily-digest";
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Domain events we translate into Google Chat notifications.
|
|
25
|
-
*
|
|
24
|
+
* Domain events we translate into Google Chat notifications. These are exact
|
|
25
|
+
* members of the host's `PLUGIN_EVENT_TYPES` catalog (@paperclipai/shared),
|
|
26
|
+
* verified against the deployed release. The host has NO `issue.completed` or
|
|
27
|
+
* `approval.requested`: completion is an `issue.updated` to a terminal status,
|
|
28
|
+
* and an approval request is `approval.created`.
|
|
26
29
|
*/
|
|
27
30
|
export declare const DOMAIN_EVENTS: {
|
|
28
31
|
readonly issueCreated: "issue.created";
|
|
29
32
|
readonly issueUpdated: "issue.updated";
|
|
30
|
-
readonly
|
|
31
|
-
readonly approvalRequested: "approval.requested";
|
|
33
|
+
readonly approvalCreated: "approval.created";
|
|
32
34
|
readonly agentRunFailed: "agent.run.failed";
|
|
33
35
|
};
|
|
36
|
+
/** Issue statuses treated as "completed" for notification purposes. */
|
|
37
|
+
export declare const TERMINAL_ISSUE_STATUSES: Set<string>;
|
package/dist/constants.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* the same convention).
|
|
5
5
|
*/
|
|
6
6
|
export const PLUGIN_ID = "google-chat";
|
|
7
|
-
export const PLUGIN_VERSION = "0.1.
|
|
7
|
+
export const PLUGIN_VERSION = "0.1.2";
|
|
8
8
|
/** Webhook endpoint keys declared in the manifest and matched in `onWebhook`. */
|
|
9
9
|
export const WEBHOOK_KEYS = {
|
|
10
10
|
/** Google Chat app events (MESSAGE, ADDED_TO_SPACE, CARD_CLICKED, …) POST here. */
|
|
@@ -21,13 +21,17 @@ export const JOB_KEYS = {
|
|
|
21
21
|
dailyDigest: "daily-digest",
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Domain events we translate into Google Chat notifications.
|
|
25
|
-
*
|
|
24
|
+
* Domain events we translate into Google Chat notifications. These are exact
|
|
25
|
+
* members of the host's `PLUGIN_EVENT_TYPES` catalog (@paperclipai/shared),
|
|
26
|
+
* verified against the deployed release. The host has NO `issue.completed` or
|
|
27
|
+
* `approval.requested`: completion is an `issue.updated` to a terminal status,
|
|
28
|
+
* and an approval request is `approval.created`.
|
|
26
29
|
*/
|
|
27
30
|
export const DOMAIN_EVENTS = {
|
|
28
31
|
issueCreated: "issue.created",
|
|
29
32
|
issueUpdated: "issue.updated",
|
|
30
|
-
|
|
31
|
-
approvalRequested: "approval.requested",
|
|
33
|
+
approvalCreated: "approval.created",
|
|
32
34
|
agentRunFailed: "agent.run.failed",
|
|
33
35
|
};
|
|
36
|
+
/** Issue statuses treated as "completed" for notification purposes. */
|
|
37
|
+
export const TERMINAL_ISSUE_STATUSES = new Set(["done", "completed", "closed"]);
|
package/dist/events.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* gated by the per-event config toggles. The mapping is pure so it can be tested
|
|
7
7
|
* without the SDK; the worker performs the actual `postToWebhook`.
|
|
8
8
|
*/
|
|
9
|
-
import { DOMAIN_EVENTS } from "./constants.js";
|
|
9
|
+
import { DOMAIN_EVENTS, TERMINAL_ISSUE_STATUSES } from "./constants.js";
|
|
10
10
|
import { formatAgentRunFailed, formatApprovalRequested, formatIssueCompleted, formatIssueCreated, } from "./google-chat.js";
|
|
11
11
|
function asIssue(data) {
|
|
12
12
|
const d = data ?? {};
|
|
@@ -27,11 +27,17 @@ export function mapEventToNotification(event, config) {
|
|
|
27
27
|
if (!config.notifyOnIssueCreated)
|
|
28
28
|
return null;
|
|
29
29
|
return { routeKey: "default", text: formatIssueCreated(asIssue(event.data)) };
|
|
30
|
-
case DOMAIN_EVENTS.
|
|
30
|
+
case DOMAIN_EVENTS.issueUpdated: {
|
|
31
|
+
// The host has no `issue.completed`; completion surfaces as an update to a
|
|
32
|
+
// terminal status. Only notify on that transition, not every edit.
|
|
31
33
|
if (!config.notifyOnIssueCompleted)
|
|
32
34
|
return null;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const issue = asIssue(event.data);
|
|
36
|
+
if (!issue.status || !TERMINAL_ISSUE_STATUSES.has(issue.status.toLowerCase()))
|
|
37
|
+
return null;
|
|
38
|
+
return { routeKey: "default", text: formatIssueCompleted(issue) };
|
|
39
|
+
}
|
|
40
|
+
case DOMAIN_EVENTS.approvalCreated:
|
|
35
41
|
if (!config.notifyOnApprovalRequested)
|
|
36
42
|
return null;
|
|
37
43
|
return { routeKey: "approvals", text: formatApprovalRequested(asIssue(event.data)) };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paperclip-plugin-google-chat",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Bidirectional Google Chat integration for Paperclip — post agent/issue notifications to spaces and drive Paperclip from Chat slash commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|