@assemblyline-agents/notion 1.0.0 → 3.0.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/events.d.ts +3 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +38 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
- package/skills/notion/SKILL.md +0 -8
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Official Assembly Line Notion connection plugin.
|
|
4
4
|
|
|
5
|
-
It connects agents to Notion, exposing workspace page and database tools through Notion's MCP server. The package exports `defineNotionConnection(options)` to declare the connection in an agent definition and an `assemblyLinePlugin` module so the Assembly Line CLI and compiler can discover the plugin's connection metadata.
|
|
5
|
+
It connects agents to Notion, exposing workspace page and database tools through Notion's MCP server. The package exports `defineNotionConnection(options)` to declare the connection in an agent definition and an `assemblyLinePlugin` module so the Assembly Line CLI and compiler can discover the plugin's connection metadata.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,4BAA4B,EAElC,MAAM,2BAA2B,CAAC;AAEnC,eAAO,MAAM,YAAY,EAAE,4BAkC1B,CAAC"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ConnectionEventError, headerValue, parseConnectionEventJson, stringField, verifyHmacSha256 } from "@assemblyline-agents/core";
|
|
2
|
+
export const notionEvents = {
|
|
3
|
+
reconcile(context) {
|
|
4
|
+
const verificationToken = stringField(context.state ?? {}, "verificationToken");
|
|
5
|
+
return {
|
|
6
|
+
status: "needs_setup",
|
|
7
|
+
...(context.state ? { state: context.state } : {}),
|
|
8
|
+
instructions: verificationToken
|
|
9
|
+
? "Paste the received verification token shown by `assembly-line connections check` into the Notion connection's Webhooks tab."
|
|
10
|
+
: `In the Notion connection's Webhooks tab, create a subscription for ${context.callbackUrl}. Assembly Line will capture its verification token.`,
|
|
11
|
+
detail: verificationToken ? "Notion verification token has been received; finish verification in Notion." : "Create the Notion webhook subscription to begin verification."
|
|
12
|
+
};
|
|
13
|
+
},
|
|
14
|
+
check(context) {
|
|
15
|
+
const verificationToken = stringField(context.state ?? {}, "verificationToken");
|
|
16
|
+
return verificationToken
|
|
17
|
+
? { status: "needs_setup", detail: `Notion verification token: ${verificationToken}` }
|
|
18
|
+
: { status: "needs_setup", detail: "Waiting for Notion to send its verification token." };
|
|
19
|
+
},
|
|
20
|
+
ingress(request, context) {
|
|
21
|
+
const payload = parseConnectionEventJson(request.body);
|
|
22
|
+
const challengeToken = stringField(payload, "verification_token");
|
|
23
|
+
if (challengeToken) {
|
|
24
|
+
return { events: [], state: { ...(context.state ?? {}), verificationToken: challengeToken }, response: { status: 200, body: { ok: true } }, audit: { challenge: true } };
|
|
25
|
+
}
|
|
26
|
+
const verificationToken = stringField(context.state ?? {}, "verificationToken");
|
|
27
|
+
if (!verificationToken || !verifyHmacSha256({ secret: verificationToken, body: request.body, signature: headerValue(request.headers, "x-notion-signature"), prefix: "sha256=" })) {
|
|
28
|
+
throw new ConnectionEventError("Notion webhook signature is invalid.", 401);
|
|
29
|
+
}
|
|
30
|
+
const event = stringField(payload, "type");
|
|
31
|
+
const eventId = stringField(payload, "id");
|
|
32
|
+
if (!event || !eventId)
|
|
33
|
+
throw new ConnectionEventError("Notion webhook omitted type or id.");
|
|
34
|
+
const occurredAt = stringField(payload, "timestamp");
|
|
35
|
+
return { events: [{ event, eventId, payload: payload, ...(occurredAt ? { occurredAt } : {}) }], response: { status: 200, body: { ok: true } }, audit: { event } };
|
|
36
|
+
}
|
|
37
|
+
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AAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC;IAClL,CAAC;CACF,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmG,KAAK,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAG7K,MAAM,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AACjE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,yEAAkN;AACzR,eAAO,MAAM,kBAAkB,kDAA0C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { connectionPluginMetadata, defineMcpPluginConnection, definePlugin } from "@assemblyline-agents/core";
|
|
1
|
+
import { connectionPluginMetadata, defineConnectionPluginEvents, defineMcpPluginConnection, definePlugin } from "@assemblyline-agents/core";
|
|
2
|
+
import { notionEvents } from "./events.js";
|
|
2
3
|
const PLUGIN = connectionPluginMetadata("notion");
|
|
3
|
-
export function defineNotionConnection(options) {
|
|
4
|
+
export function defineNotionConnection(options) { const definition = defineMcpPluginConnection(PLUGIN, options); const events = defineConnectionPluginEvents(PLUGIN, options.events, notionEvents); if (events)
|
|
5
|
+
definition.events = events; return definition; }
|
|
4
6
|
export const assemblyLinePlugin = definePlugin({ connections: [PLUGIN] });
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,YAAY,EAAmC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,YAAY,EAAmC,MAAM,2BAA2B,CAAC;AAC7K,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,MAAM,MAAM,GAAG,wBAAwB,CAAC,QAAQ,CAAE,CAAC;AAEnD,MAAM,UAAU,sBAAsB,CAAC,OAAgC,IAAI,MAAM,UAAU,GAAG,yBAAyB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,GAAG,4BAA4B,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,MAAM;IAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC;AACzR,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assemblyline-agents/notion",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -9,12 +9,11 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@assemblyline-agents/core": "
|
|
12
|
+
"@assemblyline-agents/core": "3.0.0"
|
|
13
13
|
},
|
|
14
14
|
"description": "Official Assembly Line Notion connection plugin.",
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
17
|
-
"skills"
|
|
16
|
+
"dist"
|
|
18
17
|
],
|
|
19
18
|
"engines": {
|
|
20
19
|
"node": ">=22.19.0"
|
package/skills/notion/SKILL.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: notion
|
|
3
|
-
description: Use configured Notion tools for pages, databases, comments, users, and search.
|
|
4
|
-
---
|
|
5
|
-
# Notion
|
|
6
|
-
Search the workspace first, then fetch only the pages or data sources needed. Preserve page and database structure when summarizing.
|
|
7
|
-
|
|
8
|
-
The deployment owner configures Notion authorization. The scaffold is read-only; page, database, comment, or property mutations require writes to be enabled with the configured approval gate.
|