@assemblyline-agents/slack 5.0.9 → 6.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGjG,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC;CAC1C;AAED,gFAAgF;AAChF,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,gBAAqB,GAAG,cAAc,CAyD1F"}
package/dist/tools.js ADDED
@@ -0,0 +1,65 @@
1
+ import { defineTool } from "@assemblyline-agents/core";
2
+ const SLACK_FILE_ID = /^F[A-Z0-9]+$/u;
3
+ /** Agent tool: retrieve an existing private Slack file into the run sandbox. */
4
+ export function defineSlackRetrieveFileTool(options = {}) {
5
+ const definition = defineTool({
6
+ description: "Retrieve an existing Slack file by file id into /workspace for analysis or delivery. This is a read-only fallback for files referenced in Slack history.",
7
+ sideEffect: "idempotent",
8
+ timeoutMs: 120_000,
9
+ inputSchema: {
10
+ type: "object",
11
+ additionalProperties: false,
12
+ properties: {
13
+ fileId: { type: "string", description: "Slack file id, for example F012ABCDEF." },
14
+ filename: { type: "string", description: "Optional preferred filename. Slack's filename is used by default." },
15
+ teamId: { type: "string", description: "Optional Slack workspace id for multi-workspace installations." }
16
+ },
17
+ required: ["fileId"]
18
+ },
19
+ async execute(input, ctx) {
20
+ const values = input;
21
+ const fileId = values.fileId.trim().toUpperCase();
22
+ if (!SLACK_FILE_ID.test(fileId)) {
23
+ throw new Error("slack_retrieve_file requires a valid Slack file id beginning with F.");
24
+ }
25
+ if (!ctx.channel?.perform)
26
+ throw new Error("Slack file retrieval requires a host-owned Slack channel capability.");
27
+ const retrieved = await ctx.channel.perform("retrieve_file", {
28
+ fileId,
29
+ ...(values.filename ? { filename: values.filename } : {}),
30
+ ...(values.teamId ? { teamId: values.teamId } : {})
31
+ });
32
+ if (retrieved.ok !== true)
33
+ return retrieved;
34
+ const filename = String(retrieved.filename);
35
+ const bytes = Buffer.from(String(retrieved.bytesBase64), "base64");
36
+ const path = `/workspace/slack-files/${fileId}-${filename}`;
37
+ const sandbox = await ctx.getSandbox();
38
+ await sandbox.writeFile(path, bytes);
39
+ await ctx.emit("slack.file_retrieved", {
40
+ fileId,
41
+ filename,
42
+ path,
43
+ sizeBytes: bytes.byteLength,
44
+ contentType: String(retrieved.contentType),
45
+ idempotencyKey: ctx.idempotencyKey(`slack:file:${fileId}`)
46
+ });
47
+ return {
48
+ ok: true,
49
+ fileId,
50
+ filename,
51
+ path,
52
+ sizeBytes: bytes.byteLength,
53
+ nextStep: ctx.agentSurface === "root"
54
+ ? `Call deliver_artifact with path ${path} when the file should be sent to the user.`
55
+ : `Call handoff_artifact with path ${path} to return the file to the parent.`
56
+ };
57
+ }
58
+ });
59
+ if (options.description)
60
+ definition.description = options.description;
61
+ if (options.needsApproval !== undefined)
62
+ definition.needsApproval = options.needsApproval;
63
+ return definition;
64
+ }
65
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4C,MAAM,2BAA2B,CAAC;AACjG,MAAM,aAAa,GAAG,eAAe,CAAC;AAOtC,gFAAgF;AAChF,MAAM,UAAU,2BAA2B,CAAC,UAA4B,EAAE;IACxE,MAAM,UAAU,GAAG,UAAU,CAAC;QAC5B,WAAW,EAAE,0JAA0J;QACvK,UAAU,EAAE,YAAY;QACxB,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,oBAAoB,EAAE,KAAK;YAC3B,UAAU,EAAE;gBACV,MA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,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,CAAC;YACnE,MAAM,IAAI,GAAG,0BAA0B,MAAM,IAAI,QAAQ,EAAE,CAAC;YAC5D,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;YACvC,MAAM,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACrC,MAAM,GAAG,CAAC,IAAI,CAAC,sBAAsB,EAAE;gBACrC,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,SAAS,EAAE,KAAK,CAAC,UAAU;gBAC3B,WAAW,EAAE,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC;gBAC1C,cAAc,EAAE,GAAG,CAAC,cAAc,CAAC,cAAc,MAAM,EAAE,CAAC;aAC3D,CAAC,CAAC;YACH,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,SAAS,EAAE,KAAK,CAAC,UAAU;gBAC3B,QAAQ,EAAE,GAAG,CAAC,YAAY,KAAK,MAAM;oBACnC,CAAC,CAAC,mCAAmC,IAAI,4CAA4C;oBACrF,CAAC,CAAC,mCAAmC,IAAI,oCAAoC;aAChF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,WAAW;QAAE,UAAU,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACtE,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS;QAAE,UAAU,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC1F,OAAO,UAA4B,CAAC;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assemblyline-agents/slack",
3
- "version": "5.0.9",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -12,12 +12,15 @@
12
12
  "node": ">=22.19.0"
13
13
  },
14
14
  "dependencies": {
15
- "@assemblyline-agents/core": "5.0.9",
16
- "@assemblyline-agents/runtime": "5.0.9"
15
+ "@assemblyline-agents/core": "6.0.0",
16
+ "@assemblyline-agents/runtime": "6.0.0",
17
+ "@assemblyline-agents/audio": "6.0.0"
17
18
  },
18
19
  "description": "Official Assembly Line Slack channel plugin.",
19
20
  "files": [
20
21
  "dist",
22
+ "plugin.json",
23
+ "ai.assemblyline",
21
24
  "templates"
22
25
  ],
23
26
  "license": "MIT",
package/plugin.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
+ "name": "slack",
4
+ "version": "6.0.0",
5
+ "description": "Official Assembly Line Slack channel plugin.",
6
+ "extensions": {
7
+ "ai.assemblyline": {
8
+ "entry": "./ai.assemblyline/index.cjs"
9
+ }
10
+ }
11
+ }
@@ -28,7 +28,10 @@
28
28
  "files:read",
29
29
  "files:write",
30
30
  "groups:history",
31
- "im:history"
31
+ "im:history",
32
+ "im:write",
33
+ "users:read",
34
+ "users:read.email"
32
35
  ]
33
36
  }
34
37
  },