@rallycry/conveyor-agent 11.1.13 → 11.1.14

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.
@@ -8,7 +8,7 @@ import {
8
8
  readWorkspaceBytes,
9
9
  statWorkspacePath,
10
10
  workspacePathExists
11
- } from "./chunk-2JW3ILVM.js";
11
+ } from "./chunk-XSJCJGQZ.js";
12
12
  import {
13
13
  reportBootMilestone
14
14
  } from "./chunk-74BAVQKD.js";
@@ -107,7 +107,7 @@ import {
107
107
  toMemberMentionRows,
108
108
  updateRemoteToken,
109
109
  verifyGitCredential
110
- } from "./chunk-2JW3ILVM.js";
110
+ } from "./chunk-XSJCJGQZ.js";
111
111
  import {
112
112
  reportBootMilestone
113
113
  } from "./chunk-74BAVQKD.js";
@@ -8907,6 +8907,7 @@ var pullRequestContracts = [createPullRequestContract];
8907
8907
  var REGISTRY_RULE = "Only channels an admin registered as work channels in project settings are reachable \u2014 an unregistered channel is invisible here no matter what the bot can see in the workspace, and the card-sync channels are NOT automatically included.";
8908
8908
  var NO_STORAGE = "Messages are fetched live from Slack/Discord on every call and are never stored by Conveyor.";
8909
8909
  var READ_MENTIONS = "People who are Conveyor users appear in `text` as @[user:<id>] tokens instead of raw Slack or Discord ids, and `authorMention` is the author's token when the author is one. Reuse those tokens to mention people back.";
8910
+ var READ_FILES = "A message with attachments lists them in `files` (fileId, name, type, size); open one with get_channel_file, passing the message's `id` and `threadTs`. A file whose `unavailable` is set cannot be opened, and the value says why.";
8910
8911
  var listProjectIntegrationsContract = defineToolContract({
8911
8912
  name: "list_project_integrations",
8912
8913
  agent: {
@@ -8937,11 +8938,11 @@ var CHANNEL_ID_DESC = "Provider channel id, exactly as list_project_channels rep
8937
8938
  var LIMIT_DESC = "How many messages to return, newest first. Defaults to 25, maximum 50. Prefer a small read plus a follow-up over one large one \u2014 channel history spends context fast.";
8938
8939
  var BEFORE_DESC = "Page further back: return messages older than this cursor. Pass the `olderCursor` from a previous call; a null cursor there means you have reached the start of the channel.";
8939
8940
  var AFTER_DESC = "Return only messages newer than this cursor. Use to catch up on a channel.";
8940
- var THREAD_DESC = "Read one thread instead of the channel surface. Pass a `threadTs` seen on a message from a previous read.";
8941
+ var THREAD_DESC = "Read one thread instead of the channel surface. Pass the `threadTs` a previous read reported on a message: the thread that message lives in, or the one it started.";
8941
8942
  var readChannelMessagesContract = defineToolContract({
8942
8943
  name: "read_channel_messages",
8943
8944
  agent: {
8944
- description: `Read recent messages from a registered work channel, newest first \u2014 to catch up on a discussion, find the context behind a decision, or check whether something was already raised. Each message reports its author, whether that author is a bot (Conveyor's own card feed posts show up here too, so check this before treating a message as a teammate's), its text, and a cursor for paging further back. ${READ_MENTIONS} ${REGISTRY_RULE} ${NO_STORAGE}`,
8945
+ description: `Read recent messages from a registered work channel, newest first \u2014 to catch up on a discussion, find the context behind a decision, or check whether something was already raised. Each message reports its author, whether that author is a bot (Conveyor's own card feed posts show up here too, so check this before treating a message as a teammate's), its text, and a cursor for paging further back. ${READ_MENTIONS} ${READ_FILES} ${REGISTRY_RULE} ${NO_STORAGE}`,
8945
8946
  fields: {
8946
8947
  channelId: f.string({ desc: CHANNEL_ID_DESC }),
8947
8948
  limit: f.optional(f.number({ desc: LIMIT_DESC, int: true, min: 1, max: 50 })),
@@ -8951,7 +8952,7 @@ var readChannelMessagesContract = defineToolContract({
8951
8952
  }
8952
8953
  },
8953
8954
  mcp: {
8954
- description: `Read recent messages from a project's registered work channel, newest first. Each message carries author name, a bot flag, text, a provider-native cursor, and a timestamp; the response carries an olderCursor for paging back. ${READ_MENTIONS} ${REGISTRY_RULE} ${NO_STORAGE} Pass projectId to target a specific project; otherwise the configured default project is used.`,
8955
+ description: `Read recent messages from a project's registered work channel, newest first. Each message carries author name, a bot flag, text, a provider-native cursor, and a timestamp; the response carries an olderCursor for paging back. ${READ_MENTIONS} ${READ_FILES} ${REGISTRY_RULE} ${NO_STORAGE} Pass projectId to target a specific project; otherwise the configured default project is used.`,
8955
8956
  fields: {
8956
8957
  projectId: mcpProjectId,
8957
8958
  channelId: f.string({ desc: CHANNEL_ID_DESC }),
@@ -8962,6 +8963,32 @@ var readChannelMessagesContract = defineToolContract({
8962
8963
  }
8963
8964
  }
8964
8965
  });
8966
+ var FILE_MESSAGE_DESC = "The `id` of the message the file is attached to, exactly as read_channel_messages reported it.";
8967
+ var FILE_ID_DESC = "The file's `fileId` from that message's `files` list.";
8968
+ var FILE_THREAD_DESC = "The message's `threadTs`, exactly as read_channel_messages reported it. Pass it whenever the message had one: a file on a thread reply cannot be found without it.";
8969
+ var FILE_RULES = "Reading must be enabled for the channel: the same grant read_channel_messages needs. A file whose `unavailable` was set on the read cannot be opened (a canvas, an external link, a deleted or hidden file, or one over 25 MB). The file is fetched live from Slack/Discord on every call and Conveyor never stores it.";
8970
+ var getChannelFileContract = defineToolContract({
8971
+ name: "get_channel_file",
8972
+ agent: {
8973
+ description: `Open a file attached to a message in a registered work channel \u2014 a PDF, a screenshot, a log a teammate shared \u2014 after read_channel_messages listed it in the message's \`files\`. The file is saved into this workspace and the tool returns its path: open it with the Read tool (images and PDFs render there) or process it with Bash. ${FILE_RULES} ${REGISTRY_RULE}`,
8974
+ fields: {
8975
+ channelId: f.string({ desc: CHANNEL_ID_DESC, min: 1, max: 100 }),
8976
+ messageId: f.string({ desc: FILE_MESSAGE_DESC, min: 1, max: 100 }),
8977
+ fileId: f.string({ desc: FILE_ID_DESC, min: 1, max: 100 }),
8978
+ threadTs: f.optional(f.string({ desc: FILE_THREAD_DESC, max: 100 }))
8979
+ }
8980
+ },
8981
+ mcp: {
8982
+ description: `Download a file attached to a message in a project's registered work channel, after read_channel_messages listed it in the message's \`files\`. The file is saved under the system temp directory and the result names its path; a small image is also shown inline, and a small text file is inlined. ${FILE_RULES} ${REGISTRY_RULE} Pass projectId to target a specific project; otherwise the configured default project is used.`,
8983
+ fields: {
8984
+ projectId: mcpProjectId,
8985
+ channelId: f.string({ desc: CHANNEL_ID_DESC, min: 1, max: 100 }),
8986
+ messageId: f.string({ desc: FILE_MESSAGE_DESC, min: 1, max: 100 }),
8987
+ fileId: f.string({ desc: FILE_ID_DESC, min: 1, max: 100 }),
8988
+ threadTs: f.optional(f.string({ desc: FILE_THREAD_DESC, max: 100 }))
8989
+ }
8990
+ }
8991
+ });
8965
8992
  var POST_TEXT_DESC = `What to say, in plain text or light markdown. An attribution footer naming you is appended automatically, so do not sign the message yourself. ${CHANNEL_MENTION_GUIDANCE} Channel-wide and group pings (@everyone, @here, <!channel>, <!subteam^\u2026>) are rendered as ordinary text and will not notify anyone.`;
8966
8993
  var POST_THREAD_DESC = "Reply inside a thread rather than to the channel. Prefer this when responding to a specific message \u2014 pass the `threadTs` from the message you are answering.";
8967
8994
  var POST_WARNING = "This is visible to everyone in the channel and cannot be edited or deleted afterwards. Posting requires a per-channel grant that is OFF by default, separate from read access, so most registered channels will refuse it.";
@@ -9010,6 +9037,7 @@ var integrationsContracts = [
9010
9037
  listProjectIntegrationsContract,
9011
9038
  listProjectChannelsContract,
9012
9039
  readChannelMessagesContract,
9040
+ getChannelFileContract,
9013
9041
  postChannelMessageContract,
9014
9042
  getAnalyticsSummaryContract
9015
9043
  ];
@@ -12220,6 +12248,43 @@ function buildReadChannelMessagesTool(connection, projectId) {
12220
12248
  }
12221
12249
  });
12222
12250
  }
12251
+ function buildGetChannelFileTool(connection, projectId) {
12252
+ return defineContractTool(getChannelFileContract, async (input) => {
12253
+ let located;
12254
+ try {
12255
+ located = await connection.call("getChannelFile", {
12256
+ projectId,
12257
+ channelId: input.channelId,
12258
+ messageId: input.messageId,
12259
+ fileId: input.fileId,
12260
+ threadTs: input.threadTs
12261
+ });
12262
+ } catch (error) {
12263
+ return errText3("Failed to get the channel file", error);
12264
+ }
12265
+ const { agentDownloadUrl, ...shown } = located;
12266
+ const header = JSON.stringify(shown, null, 2);
12267
+ try {
12268
+ const saved = await saveAttachmentToDisk({
12269
+ url: agentDownloadUrl,
12270
+ fileId: `ch-${located.provider}-${located.file.fileId}`,
12271
+ fileName: located.file.name
12272
+ });
12273
+ return textResult(
12274
+ `${header}
12275
+
12276
+ Saved to ${saved.path} (${saved.bytes} bytes). Open it with the Read tool (images and PDFs render there; a PDF over 10 pages needs the pages parameter) or process it with Bash.`
12277
+ );
12278
+ } catch (error) {
12279
+ const code = error instanceof AttachmentSaveError ? error.code : "network";
12280
+ return textResult(
12281
+ `${header}
12282
+
12283
+ Could not save the file (${code}). Call get_channel_file again; each call mints a fresh 5-minute link.`
12284
+ );
12285
+ }
12286
+ });
12287
+ }
12223
12288
  function buildPostChannelMessageTool(connection, projectId) {
12224
12289
  return defineContractTool(postChannelMessageContract, async (input) => {
12225
12290
  try {
@@ -12256,6 +12321,7 @@ function buildChannelTools(connection, projectId) {
12256
12321
  return [
12257
12322
  buildListProjectChannelsTool(connection, projectId),
12258
12323
  buildReadChannelMessagesTool(connection, projectId),
12324
+ buildGetChannelFileTool(connection, projectId),
12259
12325
  buildPostChannelMessageTool(connection, projectId)
12260
12326
  ];
12261
12327
  }
@@ -2283,6 +2283,15 @@ var PostChannelMessageRequestSchema = z11.object({
2283
2283
  /** Reply inside a thread rather than to the channel. */
2284
2284
  threadTs: z11.string().max(100).optional()
2285
2285
  });
2286
+ var ChannelFileIdSchema = z11.string().min(1).max(100).regex(/^[A-Za-z0-9._-]+$/);
2287
+ var GetChannelFileRequestSchema = z11.object({
2288
+ projectId: ChannelFileIdSchema,
2289
+ channelId: ChannelFileIdSchema,
2290
+ messageId: ChannelFileIdSchema,
2291
+ fileId: ChannelFileIdSchema,
2292
+ /** The thread the message lives in, as the read reported it. */
2293
+ threadTs: ChannelFileIdSchema.optional()
2294
+ });
2286
2295
  var GET_ANALYTICS_SUMMARY_MAX_RANGE_DAYS = 90;
2287
2296
  var GetProjectAnalyticsSummaryRequestSchema = z11.object({
2288
2297
  projectId: z11.string(),
@@ -5619,6 +5628,18 @@ var agentSettingsSchema = schemaOf()(
5619
5628
  var agentSummarySchema2 = schemaOf()(
5620
5629
  z30.object({ id: z30.string(), name: z30.string(), image: z30.string().nullable() })
5621
5630
  );
5631
+ var channelFileUnavailableReasonSchema = schemaOf()(
5632
+ z30.enum(["external", "canvas", "deleted", "hidden", "too_large", "no_access"])
5633
+ );
5634
+ var channelFileDTOSchema = schemaOf()(
5635
+ z30.object({
5636
+ fileId: z30.string(),
5637
+ name: z30.string(),
5638
+ mimeType: z30.string().nullable(),
5639
+ sizeBytes: z30.number().nullable(),
5640
+ unavailable: channelFileUnavailableReasonSchema.optional()
5641
+ })
5642
+ );
5622
5643
  var channelMessageDTOSchema = schemaOf()(
5623
5644
  z30.object({
5624
5645
  id: z30.string(),
@@ -5629,7 +5650,9 @@ var channelMessageDTOSchema = schemaOf()(
5629
5650
  ts: z30.string(),
5630
5651
  createdAt: z30.string(),
5631
5652
  threadTs: z30.string().optional(),
5632
- replyCount: z30.number().optional()
5653
+ replyToId: z30.string().optional(),
5654
+ replyCount: z30.number().optional(),
5655
+ files: z30.array(channelFileDTOSchema).optional()
5633
5656
  })
5634
5657
  );
5635
5658
  var repoCreationErrorCodeSchema = schemaOf()(
@@ -5668,6 +5691,15 @@ var forgeConfigDTOSchema = schemaOf()(
5668
5691
  repositoryUrl: z30.string().optional()
5669
5692
  })
5670
5693
  );
5694
+ var getChannelFileResponseSchema = schemaOf()(
5695
+ z30.object({
5696
+ channelId: z30.string(),
5697
+ provider: z30.enum(["slack", "discord"]),
5698
+ messageId: z30.string(),
5699
+ file: channelFileDTOSchema,
5700
+ agentDownloadUrl: z30.string()
5701
+ })
5702
+ );
5671
5703
  var integrationsOverviewDTOSchema = schemaOf()(
5672
5704
  z30.object({
5673
5705
  repository: z30.enum(["github", "forgejo"]).nullable(),
@@ -9142,6 +9174,7 @@ var editProjectMeetingChecklistItemResponseSchema = schemaOf()(meetingChecklistI
9142
9174
  var endReviewSessionResponseSchema = schemaOf()(z63.object({ sessionId: z63.string(), ended: z63.boolean(), endedAt: z63.string() }));
9143
9175
  var evaluateQuestionsResponseSchema2 = schemaOf()(evaluateQuestionsResponseSchema);
9144
9176
  var getActiveAuditSessionsResponseSchema = schemaOf()(activeAuditSessionsSchema);
9177
+ var getChannelFileResponseSchema2 = schemaOf()(getChannelFileResponseSchema);
9145
9178
  var getConnectionContextResponseSchema = schemaOf()(connectionContextDTOSchema);
9146
9179
  var getMeetingResponseSchema = schemaOf()(meetingForAgentSchema);
9147
9180
  var getProjectAnalyticsSummaryResponseSchema = schemaOf()(gaAnalyticsSummaryDTOSchema);
@@ -10185,7 +10218,12 @@ var agentSessionContract = defineContract("agentSessionService", {
10185
10218
  readChannelMessages: query({
10186
10219
  input: ReadChannelMessagesRequestSchema,
10187
10220
  output: standard(readChannelMessagesResponseSchema2),
10188
- describe: "Reads recent messages, newest first, from a readable registered work channel or one of its threads, for a card's agent and the conveyor-mcp server. Messages are fetched live and never stored."
10221
+ describe: "Reads recent messages, newest first, from a readable registered work channel or one of its threads, for a card's agent and the conveyor-mcp server. Each message lists its attached files. Messages are fetched live and never stored."
10222
+ }),
10223
+ getChannelFile: query({
10224
+ input: GetChannelFileRequestSchema,
10225
+ output: standard(getChannelFileResponseSchema2),
10226
+ describe: "Finds one file attached to a message in a readable registered work channel, for a card's agent and the conveyor-mcp server, and answers its metadata with a five-minute link the tool downloads it from. The message is read again from Slack or Discord, and nothing is stored."
10189
10227
  }),
10190
10228
  postChannelMessage: mutation({
10191
10229
  input: PostChannelMessageRequestSchema,
package/dist/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  WorkspaceCommandSupervisor,
8
8
  startWorkspaceCommandsAfterConnect,
9
9
  stopWorkspaceCommands
10
- } from "./chunk-CWGU7HVC.js";
10
+ } from "./chunk-UQ6RRH4Y.js";
11
11
  import {
12
12
  PtyHarness,
13
13
  SessionRunner,
@@ -25,7 +25,7 @@ import {
25
25
  resolveTuiKindFromEnv,
26
26
  sampleKeyUsage,
27
27
  usesNativeUsageReporting
28
- } from "./chunk-6FEFEVVF.js";
28
+ } from "./chunk-VRHVMKIK.js";
29
29
  import "./chunk-VYE7XV6U.js";
30
30
  import {
31
31
  inheritedEnv,
@@ -41,7 +41,7 @@ import {
41
41
  createServiceLogger,
42
42
  loadAndAnnotateDiscoveredPorts,
43
43
  loadConveyorConfig
44
- } from "./chunk-2JW3ILVM.js";
44
+ } from "./chunk-XSJCJGQZ.js";
45
45
  import "./chunk-74BAVQKD.js";
46
46
  import "./chunk-W4LZ7R6Z.js";
47
47
  import "./chunk-372R6E4C.js";
@@ -1424,7 +1424,7 @@ if (!RUNNER_MODES.includes(CONVEYOR_MODE)) {
1424
1424
  process.exit(1);
1425
1425
  }
1426
1426
  if (CONVEYOR_MODE === "serving") {
1427
- const { runServingSession } = await import("./serve-boot-MHESEHYF.js");
1427
+ const { runServingSession } = await import("./serve-boot-X3N62MJB.js");
1428
1428
  exitContext.runnerMode = "serving";
1429
1429
  exitContext.sessionId = process.env.CONVEYOR_SESSION_ID ?? exitContext.sessionId;
1430
1430
  const outcome = await runServingSession({
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SessionRunner,
3
3
  unshallowRepo
4
- } from "./chunk-6FEFEVVF.js";
4
+ } from "./chunk-VRHVMKIK.js";
5
5
  import "./chunk-VYE7XV6U.js";
6
6
  import "./chunk-76JCOHPE.js";
7
7
  import {
@@ -17,7 +17,7 @@ import {
17
17
  stageAndCommit,
18
18
  updateRemoteToken,
19
19
  workspacePathExists
20
- } from "./chunk-2JW3ILVM.js";
20
+ } from "./chunk-XSJCJGQZ.js";
21
21
  import "./chunk-74BAVQKD.js";
22
22
  import {
23
23
  runAuthTokenCommand,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  WorkspaceCommandSupervisor
3
- } from "./chunk-CWGU7HVC.js";
3
+ } from "./chunk-UQ6RRH4Y.js";
4
4
  import {
5
5
  AgentConnection,
6
6
  DEFAULT_LIFECYCLE_CONFIG,
@@ -11,7 +11,7 @@ import {
11
11
  ensureOnTaskBranch,
12
12
  loadAndAnnotateDiscoveredPorts,
13
13
  loadConveyorConfig
14
- } from "./chunk-2JW3ILVM.js";
14
+ } from "./chunk-XSJCJGQZ.js";
15
15
  import "./chunk-74BAVQKD.js";
16
16
  import "./chunk-W4LZ7R6Z.js";
17
17
  import "./chunk-L2E4EMEP.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rallycry/conveyor-agent",
3
- "version": "11.1.13",
3
+ "version": "11.1.14",
4
4
  "description": "Conveyor Agent Runner v10 - PTY harness for the task chat (SDK harness for audit/project-chat). Agent-as-User architecture with BaseService patterns. Works locally too.",
5
5
  "keywords": [
6
6
  "agent",
@@ -29,7 +29,7 @@ Announce a one-line plan naming the sources you found, then sweep. **Say what yo
29
29
 
30
30
  | Source | How |
31
31
  | ------ | --- |
32
- | Work channels | `read_channel_messages` per registered readable channel, paging back with `olderCursor` until the window covers the question. `authorIsBot` separates the team's discussion from Conveyor's own card feed — check it before treating a message as a teammate's. Read thread replies (`threadTs`) where a thread carries the argument. |
32
+ | Work channels | `read_channel_messages` per registered readable channel, paging back with `olderCursor` until the window covers the question. `authorIsBot` separates the team's discussion from Conveyor's own card feed — check it before treating a message as a teammate's. Read thread replies (`threadTs`) where a thread carries the argument. A message's `files` lists what was shared with it; open a PDF, screenshot or export with `get_channel_file` when it carries the evidence. |
33
33
  | Conveyor cards | `search_tasks` with ALL `typeFilters` (task, incident, suggestion) and several keyword variants — the term, the term plus symptom words, the adjacent nouns people actually use. Incidents carry fingerprint dedup, so an incident's upvote count is itself a frequency signal. |
34
34
  | Decisions | `list_decisions` — open ones are the questions on the table, Decided ones carry their resolution and are the project's own record of what it already settled. A verdict that contradicts a Decided decision has to say so and say why. `list_project_integrations` reports `decisions.openCount` / `decidedCount`, so you know whether there is a log here before you search it. |
35
35
  | Tags | `list_tags` then `get_tag` on the relevant ones — the overview is the project's own domain vocabulary, and it names the subsystems your categories should line up with. |