@anthusai/papyrus 5.135.0-next.3 → 5.135.0-next.5

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.
@@ -90,7 +90,8 @@ export const announcementsSchemaDefinitions = {
90
90
  /**
91
91
  * A Delivery: one channel's version of an Announcement (docs/announcement-records.md). The words and any picture are files in S3 (textKey, imageKey, contentHash);
92
92
  * the row never holds text. id is `<announcement>#<channel>#<account>#g<generation>`, created with a condition: one live Delivery for each Announcement, channel and
93
- * account, and a correction is the next generation, written with `supersedes`. Approval lives here, per Delivery. Every wait is a named time (releaseAt, lockAt,
93
+ * account, and a correction is the next generation, written with `supersedes`. Every edit is a new version: `versions` is the log (each version's file, key, hash, who saved it and which
94
+ * version it replaced; the words themselves are files in S3) and `candidates` the texts and pictures kept beside the draft. Approval lives here, per Delivery. Every wait is a named time (releaseAt, lockAt,
94
95
  * nextAttemptAt with waitingFor); dueAt is the earliest of them and, with dueKey, is present only while one is pending, so the due index is sparse.
95
96
  */
96
97
  Delivery: a
@@ -112,6 +113,8 @@ export const announcementsSchemaDefinitions = {
112
113
  contentHash: a.string(),
113
114
  draftedBy: a.string(),
114
115
  checks: a.json(),
116
+ versions: a.json(),
117
+ candidates: a.json(),
115
118
  approval: a.string().required(),
116
119
  approvalPolicy: a.string().required(),
117
120
  approvedVersion: a.integer(),
@@ -121,6 +124,7 @@ export const announcementsSchemaDefinitions = {
121
124
  lockAt: a.datetime().required(),
122
125
  lockedAt: a.datetime(),
123
126
  lockedVersion: a.integer(),
127
+ preferredVersion: a.integer(),
124
128
  nextAttemptAt: a.datetime(),
125
129
  waitingFor: a.string(),
126
130
  dueAt: a.datetime(),
@@ -93,7 +93,8 @@ export const announcementsSchemaDefinitions = {
93
93
  /**
94
94
  * A Delivery: one channel's version of an Announcement (docs/announcement-records.md). The words and any picture are files in S3 (textKey, imageKey, contentHash);
95
95
  * the row never holds text. id is `<announcement>#<channel>#<account>#g<generation>`, created with a condition: one live Delivery for each Announcement, channel and
96
- * account, and a correction is the next generation, written with `supersedes`. Approval lives here, per Delivery. Every wait is a named time (releaseAt, lockAt,
96
+ * account, and a correction is the next generation, written with `supersedes`. Every edit is a new version: `versions` is the log (each version's file, key, hash, who saved it and which
97
+ * version it replaced; the words themselves are files in S3) and `candidates` the texts and pictures kept beside the draft. Approval lives here, per Delivery. Every wait is a named time (releaseAt, lockAt,
97
98
  * nextAttemptAt with waitingFor); dueAt is the earliest of them and, with dueKey, is present only while one is pending, so the due index is sparse.
98
99
  */
99
100
  Delivery: a
@@ -115,6 +116,8 @@ export const announcementsSchemaDefinitions = {
115
116
  contentHash: a.string(),
116
117
  draftedBy: a.string(),
117
118
  checks: a.json(),
119
+ versions: a.json(),
120
+ candidates: a.json(),
118
121
  approval: a.string().required(),
119
122
  approvalPolicy: a.string().required(),
120
123
  approvedVersion: a.integer(),
@@ -124,6 +127,7 @@ export const announcementsSchemaDefinitions = {
124
127
  lockAt: a.datetime().required(),
125
128
  lockedAt: a.datetime(),
126
129
  lockedVersion: a.integer(),
130
+ preferredVersion: a.integer(),
127
131
  nextAttemptAt: a.datetime(),
128
132
  waitingFor: a.string(),
129
133
  dueAt: a.datetime(),
@@ -45,6 +45,8 @@ export type ImageOperationName =
45
45
  | "announcements_review_set"
46
46
  | "announcements_delivery_review_set"
47
47
  | "announcements_draft"
48
+ | "announcements_candidate_choose"
49
+ | "announcements_versions"
48
50
  | "announcements_pinned_change"
49
51
  | "announcements_release"
50
52
  | "announcements_unlock"
@@ -78,6 +80,7 @@ export type ImageErrorCode =
78
80
  | "spend_ceiling_exceeded"
79
81
  | "batch_expired"
80
82
  | "stale_version"
83
+ | "locked"
81
84
  | "candidate_not_ready"
82
85
  | "candidate_closed"
83
86
  | "settings_refused"
@@ -1135,6 +1138,16 @@ export type AnnouncementsSettingsShowResult = {
1135
1138
  spacing?: Record<string, unknown>;
1136
1139
  /** paused, reason (budget, disconnected or manual), detail, by and at. */
1137
1140
  pause?: Record<string, unknown>;
1141
+ editWindows?: {
1142
+ /** The kind of Announcement, such as story_published or roundup. Absent: every kind. */
1143
+ kind?: string;
1144
+ /** The channel, such as x or email. Absent: every channel. */
1145
+ channel?: string;
1146
+ /** Minutes from the Delivery's creation to its release: how long it stays a draft that people edit. */
1147
+ windowMinutes: number;
1148
+ /** Minutes before the release that the Delivery locks for the send job. At most the window; 0 is no separate lock. */
1149
+ lockLeadMinutes?: number;
1150
+ }[];
1138
1151
  };
1139
1152
  /** The X connection's status: connection, handle, accountId and refresh health. Never a secret. */
1140
1153
  connection: Record<string, unknown>;
@@ -1162,6 +1175,17 @@ export type AnnouncementsSettingsSetInput = {
1162
1175
  labelConfirmed?: boolean;
1163
1176
  /** Minutes between one post and the next on a channel account, by account (<channel>#<account>, such as x#handle). A number sets it, null takes it away; an account that is not named keeps what it has. Empty by default: no spacing. */
1164
1177
  spacing?: Record<string, unknown>;
1178
+ /** How long a Delivery stays a draft that people edit, and how long before its release it locks, for each kind of Announcement and channel. The narrowest entry that fits wins. This replaces the whole list; an empty list means no window. */
1179
+ editWindows?: {
1180
+ /** The kind of Announcement, such as story_published or roundup. Absent: every kind. */
1181
+ kind?: string;
1182
+ /** The channel, such as x or email. Absent: every channel. */
1183
+ channel?: string;
1184
+ /** Minutes from the Delivery's creation to its release: how long it stays a draft that people edit. */
1185
+ windowMinutes: number;
1186
+ /** Minutes before the release that the Delivery locks for the send job. At most the window; 0 is no separate lock. */
1187
+ lockLeadMinutes?: number;
1188
+ }[];
1165
1189
  };
1166
1190
 
1167
1191
  export type AnnouncementsSettingsSetResult = {
@@ -1179,6 +1203,16 @@ export type AnnouncementsSettingsSetResult = {
1179
1203
  spacing?: Record<string, unknown>;
1180
1204
  /** paused, reason (budget, disconnected or manual), detail, by and at. */
1181
1205
  pause?: Record<string, unknown>;
1206
+ editWindows?: {
1207
+ /** The kind of Announcement, such as story_published or roundup. Absent: every kind. */
1208
+ kind?: string;
1209
+ /** The channel, such as x or email. Absent: every channel. */
1210
+ channel?: string;
1211
+ /** Minutes from the Delivery's creation to its release: how long it stays a draft that people edit. */
1212
+ windowMinutes: number;
1213
+ /** Minutes before the release that the Delivery locks for the send job. At most the window; 0 is no separate lock. */
1214
+ lockLeadMinutes?: number;
1215
+ }[];
1182
1216
  };
1183
1217
  released: Record<string, unknown>[];
1184
1218
  };
@@ -1253,24 +1287,113 @@ export type AnnouncementsDeliveryReviewSetResult = {
1253
1287
  approvedBy?: string | null;
1254
1288
  };
1255
1289
 
1256
- /** Draft a Delivery, add a candidate text or picture, or edit a block nobody pinned. */
1290
+ /** Save a Delivery's words as the next version, or keep a text or picture beside the draft as a candidate. */
1257
1291
  export type AnnouncementsDraftInput = {
1258
1292
  /** The Delivery's id. */
1259
1293
  delivery: string;
1294
+ /** The version of the Delivery you read. Refused as stale_version, naming the version that replaced it, when the Delivery has moved on. */
1295
+ replaces?: number;
1296
+ /** The words. A person's save marks the blocks it changed as theirs and pinned; an agent's redraft keeps every pinned block as it is. */
1297
+ text?: string;
1298
+ /** The picture of the version, or of the candidate. */
1299
+ imageKey?: string;
1300
+ /** Keep this text or picture beside the draft as a candidate (nothing goes out differently) instead of saving a version. No replaces is needed. */
1301
+ candidate?: boolean;
1260
1302
  };
1261
1303
 
1262
1304
  export type AnnouncementsDraftResult = {
1263
1305
  id: string;
1306
+ /** saved: a new version. preferred: saved while an attempt is open, so it never changes that attempt. unchanged: the words are the ones you read. dropped: a machine's redraft that the person's newer version outranks. candidate: kept beside the draft. */
1307
+ status: "saved" | "preferred" | "unchanged" | "dropped" | "candidate";
1308
+ version?: number;
1309
+ replaces?: number | null;
1310
+ reason?: string;
1311
+ /** The candidate's id, when one was kept. */
1312
+ candidate?: string;
1313
+ approvedVersion?: number | null;
1314
+ lockedVersion?: number | null;
1315
+ preferredVersion?: number | null;
1316
+ /** Each block's owner (human or machine) and whether it is pinned. */
1317
+ blocks?: Record<string, unknown>[];
1264
1318
  };
1265
1319
 
1266
- /** Change or unpin a block a person pinned. */
1320
+ /** Choose one candidate as the Delivery's words: a new version. The other candidates are kept. */
1321
+ export type AnnouncementsCandidateChooseInput = {
1322
+ /** The Delivery's id. */
1323
+ delivery: string;
1324
+ /** The candidate's id, such as c1. */
1325
+ candidate: string;
1326
+ /** The version of the Delivery you read. */
1327
+ replaces: number;
1328
+ };
1329
+
1330
+ export type AnnouncementsCandidateChooseResult = {
1331
+ id: string;
1332
+ /** saved: a new version. preferred: saved while an attempt is open, so it never changes that attempt. unchanged: the words are the ones you read. dropped: a machine's redraft that the person's newer version outranks. candidate: kept beside the draft. */
1333
+ status: "saved" | "preferred" | "unchanged" | "dropped" | "candidate";
1334
+ version?: number;
1335
+ replaces?: number | null;
1336
+ reason?: string;
1337
+ /** The candidate's id, when one was kept. */
1338
+ candidate?: string;
1339
+ approvedVersion?: number | null;
1340
+ lockedVersion?: number | null;
1341
+ preferredVersion?: number | null;
1342
+ /** Each block's owner (human or machine) and whether it is pinned. */
1343
+ blocks?: Record<string, unknown>[];
1344
+ };
1345
+
1346
+ /** List a Delivery's versions and candidates: who saved each, when, what it replaced and which blocks are pinned. With a version or a candidate, its words. */
1347
+ export type AnnouncementsVersionsInput = {
1348
+ /** The Delivery's id. */
1349
+ delivery: string;
1350
+ /** Show the words of this version. */
1351
+ version?: number;
1352
+ /** Show the words of this candidate. */
1353
+ candidate?: string;
1354
+ };
1355
+
1356
+ export type AnnouncementsVersionsResult = {
1357
+ id: string;
1358
+ version: number;
1359
+ approvedVersion?: number | null;
1360
+ lockedVersion?: number | null;
1361
+ lockedAt?: string | null;
1362
+ preferredVersion?: number | null;
1363
+ versions: Record<string, unknown>[];
1364
+ candidates: Record<string, unknown>[];
1365
+ /** The words asked for. */
1366
+ text?: string;
1367
+ };
1368
+
1369
+ /** Change or unpin a block a person pinned, as the next version. */
1267
1370
  export type AnnouncementsPinnedChangeInput = {
1268
1371
  /** The Delivery's id. */
1269
1372
  delivery: string;
1373
+ /** The version of the Delivery you read. */
1374
+ replaces: number;
1375
+ /** The block, counting from 1. */
1376
+ block: number;
1377
+ /** The block's new words, one paragraph. It stays pinned. */
1378
+ text?: string;
1379
+ /** Unpin the block, so a later redraft may rewrite it. */
1380
+ unpin?: boolean;
1270
1381
  };
1271
1382
 
1272
1383
  export type AnnouncementsPinnedChangeResult = {
1273
1384
  id: string;
1385
+ /** saved: a new version. preferred: saved while an attempt is open, so it never changes that attempt. unchanged: the words are the ones you read. dropped: a machine's redraft that the person's newer version outranks. candidate: kept beside the draft. */
1386
+ status: "saved" | "preferred" | "unchanged" | "dropped" | "candidate";
1387
+ version?: number;
1388
+ replaces?: number | null;
1389
+ reason?: string;
1390
+ /** The candidate's id, when one was kept. */
1391
+ candidate?: string;
1392
+ approvedVersion?: number | null;
1393
+ lockedVersion?: number | null;
1394
+ preferredVersion?: number | null;
1395
+ /** Each block's owner (human or machine) and whether it is pinned. */
1396
+ blocks?: Record<string, unknown>[];
1274
1397
  };
1275
1398
 
1276
1399
  /** Release a Delivery: hand it to its channel now. */
@@ -1287,10 +1410,17 @@ export type AnnouncementsReleaseResult = {
1287
1410
  export type AnnouncementsUnlockInput = {
1288
1411
  /** The Delivery's id. */
1289
1412
  delivery: string;
1413
+ /** When it locks again (UTC), after now and no later than the release. By default the release time. */
1414
+ lockAt?: string;
1415
+ /** A new release time (UTC), when the old one has passed. */
1416
+ releaseAt?: string;
1290
1417
  };
1291
1418
 
1292
1419
  export type AnnouncementsUnlockResult = {
1293
1420
  id: string;
1421
+ lockAt: string;
1422
+ releaseAt: string;
1423
+ lockedVersion?: number | null;
1294
1424
  };
1295
1425
 
1296
1426
  /** Correct a Delivery that went with a new public text: the next generation, which supersedes the one that went. */
@@ -1586,6 +1716,8 @@ export interface ImageOperations {
1586
1716
  announcements_review_set: { input: AnnouncementsReviewSetInput; result: AnnouncementsReviewSetResult };
1587
1717
  announcements_delivery_review_set: { input: AnnouncementsDeliveryReviewSetInput; result: AnnouncementsDeliveryReviewSetResult };
1588
1718
  announcements_draft: { input: AnnouncementsDraftInput; result: AnnouncementsDraftResult };
1719
+ announcements_candidate_choose: { input: AnnouncementsCandidateChooseInput; result: AnnouncementsCandidateChooseResult };
1720
+ announcements_versions: { input: AnnouncementsVersionsInput; result: AnnouncementsVersionsResult };
1589
1721
  announcements_pinned_change: { input: AnnouncementsPinnedChangeInput; result: AnnouncementsPinnedChangeResult };
1590
1722
  announcements_release: { input: AnnouncementsReleaseInput; result: AnnouncementsReleaseResult };
1591
1723
  announcements_unlock: { input: AnnouncementsUnlockInput; result: AnnouncementsUnlockResult };
@@ -1642,6 +1774,8 @@ export const IMAGE_OPERATIONS = {
1642
1774
  announcements_review_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements review set" },
1643
1775
  announcements_delivery_review_set: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements delivery review" },
1644
1776
  announcements_draft: { effect: "write", agentAllowed: true, agentRung: "draft", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements draft" },
1777
+ announcements_candidate_choose: { effect: "write", agentAllowed: true, agentRung: "draft", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements candidate choose" },
1778
+ announcements_versions: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements versions" },
1645
1779
  announcements_pinned_change: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "blocked", group: "announcements", command: "papyrus announcements pinned" },
1646
1780
  announcements_release: { effect: "write", agentAllowed: true, agentRung: "publish_auto", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements release" },
1647
1781
  announcements_unlock: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements unlock" },
package/package.json CHANGED
@@ -650,7 +650,7 @@
650
650
  "optional": true
651
651
  }
652
652
  },
653
- "version": "5.135.0-next.3",
653
+ "version": "5.135.0-next.5",
654
654
  "dependencies": {
655
655
  "@aws-amplify/adapter-nextjs": "^1.7.3",
656
656
  "@aws-crypto/sha256-js": "5.2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.135.0-next.3",
2
+ "version": "5.135.0-next.5",
3
3
  "routes": [
4
4
  {
5
5
  "file": "app/%5F_preview/[[...path]]/route.ts",