@meistrari/remy-cli 1.19.0 → 1.20.0-rc.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.
Files changed (2) hide show
  1. package/dist/remy.js +99 -14
  2. package/package.json +1 -1
package/dist/remy.js CHANGED
@@ -32252,13 +32252,35 @@ function decodeJsonKey(value) {
32252
32252
  // ../../packages/agents-protocol/src/agent-notification.ts
32253
32253
  var agentNotificationSchema = jsonValueSchema;
32254
32254
  var agentNotificationsSchema = zod_default2.array(agentNotificationSchema).min(1).max(20);
32255
+ var agentNotificationInstructionSchema = zod_default2.string().trim().min(1).max(4096);
32255
32256
  var agentNotificationToolOutputMaxBytes = 64 * 1024;
32257
+ var notificationTransportEnvelopeType = "coding_agent.notification_command.v1";
32256
32258
  var textEncoder = new TextEncoder;
32259
+ var notificationTransportEnvelopeSchema = zod_default2.object({
32260
+ type: zod_default2.literal(notificationTransportEnvelopeType),
32261
+ commandId: zod_default2.string().min(1),
32262
+ instruction: agentNotificationInstructionSchema.nullable(),
32263
+ notifications: agentNotificationsSchema
32264
+ }).strict();
32265
+ function notificationTransportEnvelope(input) {
32266
+ return {
32267
+ type: notificationTransportEnvelopeType,
32268
+ commandId: input.commandId,
32269
+ instruction: input.instruction,
32270
+ notifications: [...input.notifications]
32271
+ };
32272
+ }
32257
32273
  function isAgentNotificationToolOutputWithinSizeLimit(input) {
32258
- return textEncoder.encode(JSON.stringify(input)).byteLength <= agentNotificationToolOutputMaxBytes;
32274
+ const canonicalBytes = textEncoder.encode(JSON.stringify(input)).byteLength;
32275
+ const compatibilityBytes = textEncoder.encode(JSON.stringify({
32276
+ commandId: input.commandId,
32277
+ notifications: [notificationTransportEnvelope(input)]
32278
+ })).byteLength;
32279
+ return Math.max(canonicalBytes, compatibilityBytes) <= agentNotificationToolOutputMaxBytes;
32259
32280
  }
32260
32281
  var agentNotificationToolOutputSchema = zod_default2.object({
32261
32282
  commandId: zod_default2.string().min(1),
32283
+ instruction: agentNotificationInstructionSchema.nullable(),
32262
32284
  notifications: agentNotificationsSchema
32263
32285
  }).strict().superRefine((output, context) => {
32264
32286
  if (isAgentNotificationToolOutputWithinSizeLimit(output))
@@ -32321,10 +32343,12 @@ var sendPromptCommandSchema = runningCommandBaseSchema.extend({
32321
32343
  var agentNotifyCommandSchema = runningCommandBaseSchema.extend({
32322
32344
  type: zod_default2.literal("agent.notify"),
32323
32345
  commandId: commandIdSchema,
32346
+ instruction: agentNotificationInstructionSchema.nullable(),
32324
32347
  notifications: agentNotificationsSchema
32325
32348
  }).strict().superRefine((command, context) => {
32326
32349
  if (isAgentNotificationToolOutputWithinSizeLimit({
32327
32350
  commandId: command.commandId,
32351
+ instruction: command.instruction,
32328
32352
  notifications: command.notifications
32329
32353
  })) {
32330
32354
  return;
@@ -34606,26 +34630,73 @@ function projectRetainedEvent({
34606
34630
  }
34607
34631
  return projected;
34608
34632
  }
34633
+ function sessionSystemObservationPresentation(notifications) {
34634
+ if (notifications.length !== 1)
34635
+ return { kind: "technical" };
34636
+ const notification = notifications[0];
34637
+ if (!isJsonObject(notification) || typeof notification.message !== "string" || !isJsonObject(notification.repository) || typeof notification.repository.fullName !== "string" || notification.repository.fullName.trim().length === 0 || !isJsonObject(notification.pullRequest) || typeof notification.pullRequest.number !== "number" || !Number.isSafeInteger(notification.pullRequest.number) || notification.pullRequest.number <= 0) {
34638
+ return { kind: "technical" };
34639
+ }
34640
+ const pullRequestUrl = safeExternalUrl(notification.pullRequest.url);
34641
+ const commentUrl = safeExternalUrl(notification.commentUrl);
34642
+ if (!pullRequestUrl || !commentUrl)
34643
+ return { kind: "technical" };
34644
+ const repository = notification.repository.fullName;
34645
+ const pullRequest = `#${notification.pullRequest.number}`;
34646
+ if (notification.type === "github.pull-request-review-available") {
34647
+ return {
34648
+ kind: "github-pull-request-review",
34649
+ summary: `Greptile posted a review on ${repository} pull request ${pullRequest}.`,
34650
+ actionLabel: "View review",
34651
+ actionUrl: commentUrl,
34652
+ pullRequestUrl
34653
+ };
34654
+ }
34655
+ if (notification.type === "github.pull-request-preview-available") {
34656
+ return {
34657
+ kind: "github-pull-request-preview",
34658
+ summary: `Cebo created a preview for ${repository} pull request ${pullRequest}.`,
34659
+ actionLabel: "View preview comment",
34660
+ actionUrl: commentUrl,
34661
+ pullRequestUrl
34662
+ };
34663
+ }
34664
+ return { kind: "technical" };
34665
+ }
34666
+ function isJsonObject(value) {
34667
+ return typeof value === "object" && value !== null && !Array.isArray(value);
34668
+ }
34669
+ function safeExternalUrl(value) {
34670
+ if (typeof value !== "string")
34671
+ return null;
34672
+ try {
34673
+ const url3 = new URL(value);
34674
+ return url3.protocol === "https:" && url3.hostname === "github.com" ? url3.href : null;
34675
+ } catch {
34676
+ return null;
34677
+ }
34678
+ }
34609
34679
  function projectSessionNotificationCreated({
34610
34680
  state,
34611
34681
  event,
34612
34682
  occurredAt,
34613
34683
  eventUrl
34614
34684
  }) {
34615
- if (state.transcript.some((item) => item.kind === "notification" && item.commandId === event.payload.commandId))
34685
+ if (state.transcript.some((item) => item.kind === "system-observation" && item.commandId === event.payload.commandId))
34616
34686
  return state;
34617
34687
  const turnId = state.notificationTurns?.[event.payload.commandId];
34618
34688
  return {
34619
34689
  ...state,
34620
34690
  transcript: [...state.transcript, {
34621
- kind: "notification",
34691
+ kind: "system-observation",
34622
34692
  commandId: event.payload.commandId,
34623
34693
  ...turnId === undefined ? {} : { turnId },
34624
34694
  ...eventUrl === undefined ? {} : { eventUrl },
34625
34695
  occurredAt,
34626
34696
  creator: event.payload.creator,
34627
34697
  source: event.payload.source,
34628
- notifications: event.payload.notifications
34698
+ notifications: event.payload.notifications,
34699
+ presentation: sessionSystemObservationPresentation(event.payload.notifications)
34629
34700
  }]
34630
34701
  };
34631
34702
  }
@@ -34639,7 +34710,7 @@ function projectSessionNotificationTurnAssociated({
34639
34710
  ...state.notificationTurns,
34640
34711
  [event.payload.commandId]: event.payload.turnId
34641
34712
  },
34642
- transcript: state.transcript.map((item) => item.kind === "notification" && item.commandId === event.payload.commandId ? { ...item, turnId: event.payload.turnId } : item)
34713
+ transcript: state.transcript.map((item) => item.kind === "system-observation" && item.commandId === event.payload.commandId ? { ...item, turnId: event.payload.turnId } : item)
34643
34714
  };
34644
34715
  }
34645
34716
  function projectSessionMessageCreated({ state, event, occurredAt }) {
@@ -40020,23 +40091,37 @@ function renderTimeline({ state, activityExpanded }) {
40020
40091
  `);
40021
40092
  }
40022
40093
  function renderTimelineItem(item, activityExpanded) {
40023
- if (item.kind === "notification") {
40094
+ if (item.kind === "system-observation") {
40024
40095
  const actorId = terminalSafeText(item.creator.id).replace(/\s+/g, " ").trim();
40025
40096
  const actorName = terminalSafeText(item.creator.name).replace(/\s+/g, " ").trim() || actorId;
40026
40097
  const sourceProvider = terminalSafeText(item.source.provider).replace(/\s+/g, " ").trim();
40027
40098
  const sourceLabel = terminalSafeText(item.source.label).replace(/\s+/g, " ").trim() || sourceProvider;
40099
+ const header = new StyledText9([
40100
+ renderTimestampChunk(item.occurredAt),
40101
+ renderRoleLabel({ label: actorName, role: "system" }),
40102
+ dim7(fg10(PALETTE.dimText)(` \xB7 ${sourceLabel} \xB7 System observation`))
40103
+ ]);
40104
+ const eventLink = item.eventUrl ? [new StyledText9([dim7(fg10(PALETTE.dimText)(`View event in Web: ${terminalSafeText(item.eventUrl)}`))])] : [];
40105
+ if (item.presentation.kind !== "technical") {
40106
+ const actionUrl = terminalSafeText(item.presentation.actionUrl);
40107
+ const pullRequestUrl = terminalSafeText(item.presentation.pullRequestUrl);
40108
+ return joinStyled([
40109
+ header,
40110
+ new StyledText9([fg10(PALETTE.bodyText)(terminalSafeText(item.presentation.summary))]),
40111
+ new StyledText9([fg10(PALETTE.tool)(link2(actionUrl)(`${item.presentation.actionLabel}: ${actionUrl}`))]),
40112
+ ...pullRequestUrl === actionUrl ? [] : [new StyledText9([dim7(fg10(PALETTE.dimText)(link2(pullRequestUrl)(`View pull request: ${pullRequestUrl}`)))])],
40113
+ ...eventLink
40114
+ ], `
40115
+ `);
40116
+ }
40028
40117
  const sourceUrl = item.source.url ? terminalSafeText(item.source.url) : null;
40029
- const notificationData = JSON.stringify(item.notifications, null, 2);
40118
+ const notificationData = terminalSafeText(JSON.stringify(item.notifications, null, 2));
40030
40119
  return joinStyled([
40031
- new StyledText9([
40032
- renderTimestampChunk(item.occurredAt),
40033
- renderRoleLabel({ label: actorName, role: "system" }),
40034
- dim7(fg10(PALETTE.dimText)(` \xB7 System notification (${sourceLabel})`))
40035
- ]),
40120
+ header,
40036
40121
  new StyledText9([dim7(fg10(PALETTE.dimText)(`Actor ID: ${actorId} \xB7 Source: ${sourceProvider}`))]),
40037
40122
  ...sourceUrl ? [new StyledText9([dim7(fg10(PALETTE.dimText)(`Source URL: ${sourceUrl}`))])] : [],
40038
40123
  new StyledText9([fg10(PALETTE.dimText)(notificationData)]),
40039
- ...item.eventUrl ? [new StyledText9([dim7(fg10(PALETTE.dimText)(`View event in Web: ${item.eventUrl}`))])] : []
40124
+ ...eventLink
40040
40125
  ], `
40041
40126
  `);
40042
40127
  }
@@ -40654,7 +40739,7 @@ var compactMarkRows = 9;
40654
40739
  var compactMinWidth = 48;
40655
40740
  var compactMinHeight = 20;
40656
40741
  var markBrightnessGain = 4.2;
40657
- var remyCliVersion = "1.19.0";
40742
+ var remyCliVersion = "1.20.0-rc.0";
40658
40743
  async function showRemySplash({
40659
40744
  createRenderer = createRemyRenderer,
40660
40745
  durationMs = splashDurationMs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/remy-cli",
3
- "version": "1.19.0",
3
+ "version": "1.20.0-rc.0",
4
4
  "description": "Remy, the Coding Agent terminal client.",
5
5
  "type": "module",
6
6
  "bin": {