@anthusai/papyrus 5.135.0-next.4 → 5.135.0-next.6
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.
|
@@ -20,50 +20,11 @@ export const announcementsSchemaDefinitions = {
|
|
|
20
20
|
})
|
|
21
21
|
.disableOperations(["subscriptions"])
|
|
22
22
|
.authorization((allow) => [allow.group("admin").to(["read"])]),
|
|
23
|
-
/**
|
|
24
|
-
* One announcement of a Story on the publication's X account: the audit row (who, what, when, post id, cost, mode, outcome). id = "<accountId>#<storyLineageId>",
|
|
25
|
-
* created with a condition so a Story is announced once per account. The post text is in S3 (ModelAttachment role announcement_document). Editors and admins read;
|
|
26
|
-
* the announcement pipeline writes.
|
|
27
|
-
*/
|
|
28
|
-
Announcement: a
|
|
29
|
-
.model({
|
|
30
|
-
id: a.id().required(),
|
|
31
|
-
accountId: a.string().required(),
|
|
32
|
-
accountHandle: a.string(),
|
|
33
|
-
storyLineageId: a.id().required(),
|
|
34
|
-
storyItemId: a.id(),
|
|
35
|
-
storyVersionNumber: a.integer(),
|
|
36
|
-
channel: a.string().required(),
|
|
37
|
-
state: a.string().required(),
|
|
38
|
-
blockedReason: a.string(),
|
|
39
|
-
mode: a.string().required(),
|
|
40
|
-
trigger: a.string(),
|
|
41
|
-
link: a.string(),
|
|
42
|
-
weight: a.integer(),
|
|
43
|
-
draftedBy: a.string(),
|
|
44
|
-
checks: a.json(),
|
|
45
|
-
postId: a.string(),
|
|
46
|
-
postedAt: a.datetime(),
|
|
47
|
-
cost: a.string(),
|
|
48
|
-
attempts: a.integer(),
|
|
49
|
-
round: a.integer(),
|
|
50
|
-
error: a.string(),
|
|
51
|
-
history: a.json(),
|
|
52
|
-
withdrawnBy: a.string(),
|
|
53
|
-
withdrawnAt: a.datetime(),
|
|
54
|
-
createdAt: a.datetime().required(),
|
|
55
|
-
updatedAt: a.datetime().required(),
|
|
56
|
-
})
|
|
57
|
-
.secondaryIndexes((index) => [
|
|
58
|
-
index("accountId").sortKeys(["createdAt"]).queryField("listAnnouncementsByAccountAndCreatedAt"),
|
|
59
|
-
])
|
|
60
|
-
.disableOperations(["subscriptions"])
|
|
61
|
-
.authorization((allow) => [allow.groups(editors).to(["read"])]),
|
|
62
23
|
/**
|
|
63
24
|
* An Announcement: the decision to say something about one or more Stories (docs/announcement-records.md). It knows nothing about channels and holds no approval;
|
|
64
25
|
* a Delivery holds both. id is made from the once-only key (dedupeKey), and created with a condition, so a decision is made once. The Stories it is about are
|
|
65
|
-
* `announces` relations, with the version looked at. Short fields only: no text.
|
|
66
|
-
*
|
|
26
|
+
* `announces` relations, with the version looked at. Short fields only: no text. The model named `Announcement` (the old X row shape, with its
|
|
27
|
+
* account index and round counter) is gone: an X post is an Announcement with one Delivery. Editors and admins read; the announcement pipeline writes.
|
|
67
28
|
*/
|
|
68
29
|
AnnouncementDecision: a
|
|
69
30
|
.model({
|
|
@@ -23,50 +23,11 @@ export const announcementsSchemaDefinitions = {
|
|
|
23
23
|
})
|
|
24
24
|
.disableOperations(["subscriptions"])
|
|
25
25
|
.authorization((allow) => [allow.group("admin").to(["read"])]),
|
|
26
|
-
/**
|
|
27
|
-
* One announcement of a Story on the publication's X account: the audit row (who, what, when, post id, cost, mode, outcome). id = "<accountId>#<storyLineageId>",
|
|
28
|
-
* created with a condition so a Story is announced once per account. The post text is in S3 (ModelAttachment role announcement_document). Editors and admins read;
|
|
29
|
-
* the announcement pipeline writes.
|
|
30
|
-
*/
|
|
31
|
-
Announcement: a
|
|
32
|
-
.model({
|
|
33
|
-
id: a.id().required(),
|
|
34
|
-
accountId: a.string().required(),
|
|
35
|
-
accountHandle: a.string(),
|
|
36
|
-
storyLineageId: a.id().required(),
|
|
37
|
-
storyItemId: a.id(),
|
|
38
|
-
storyVersionNumber: a.integer(),
|
|
39
|
-
channel: a.string().required(),
|
|
40
|
-
state: a.string().required(),
|
|
41
|
-
blockedReason: a.string(),
|
|
42
|
-
mode: a.string().required(),
|
|
43
|
-
trigger: a.string(),
|
|
44
|
-
link: a.string(),
|
|
45
|
-
weight: a.integer(),
|
|
46
|
-
draftedBy: a.string(),
|
|
47
|
-
checks: a.json(),
|
|
48
|
-
postId: a.string(),
|
|
49
|
-
postedAt: a.datetime(),
|
|
50
|
-
cost: a.string(),
|
|
51
|
-
attempts: a.integer(),
|
|
52
|
-
round: a.integer(),
|
|
53
|
-
error: a.string(),
|
|
54
|
-
history: a.json(),
|
|
55
|
-
withdrawnBy: a.string(),
|
|
56
|
-
withdrawnAt: a.datetime(),
|
|
57
|
-
createdAt: a.datetime().required(),
|
|
58
|
-
updatedAt: a.datetime().required(),
|
|
59
|
-
})
|
|
60
|
-
.secondaryIndexes((index) => [
|
|
61
|
-
index("accountId").sortKeys(["createdAt"]).queryField("listAnnouncementsByAccountAndCreatedAt"),
|
|
62
|
-
])
|
|
63
|
-
.disableOperations(["subscriptions"])
|
|
64
|
-
.authorization((allow) => [allow.groups(editors).to(["read"])]),
|
|
65
26
|
/**
|
|
66
27
|
* An Announcement: the decision to say something about one or more Stories (docs/announcement-records.md). It knows nothing about channels and holds no approval;
|
|
67
28
|
* a Delivery holds both. id is made from the once-only key (dedupeKey), and created with a condition, so a decision is made once. The Stories it is about are
|
|
68
|
-
* `announces` relations, with the version looked at. Short fields only: no text.
|
|
69
|
-
*
|
|
29
|
+
* `announces` relations, with the version looked at. Short fields only: no text. The model named `Announcement` (the old X row shape, with its
|
|
30
|
+
* account index and round counter) is gone: an X post is an Announcement with one Delivery. Editors and admins read; the announcement pipeline writes.
|
|
70
31
|
*/
|
|
71
32
|
AnnouncementDecision: a
|
|
72
33
|
.model({
|
|
@@ -24,7 +24,6 @@ const MAX_GRAPH_EXPORT_ATTACHMENT_BYTES = 512 * 1024 * 1024;
|
|
|
24
24
|
const UPLOAD_EXPIRES_SECONDS = 10 * 60;
|
|
25
25
|
const DOWNLOAD_EXPIRES_SECONDS = 10 * 60;
|
|
26
26
|
const ALLOWED_OWNER_KINDS = new Set([
|
|
27
|
-
"announcement",
|
|
28
27
|
"assignment",
|
|
29
28
|
"assignmentEvent",
|
|
30
29
|
"delivery",
|
|
@@ -61,7 +60,6 @@ const ALLOWED_ROLES = new Set([
|
|
|
61
60
|
"visual_negative",
|
|
62
61
|
"image_record",
|
|
63
62
|
"image_candidate_file",
|
|
64
|
-
"announcement_document",
|
|
65
63
|
"delivery_text", // a Delivery's words, one file in S3 (src/papyrus_content/announcements/deliveries.py)
|
|
66
64
|
"doctrine_document",
|
|
67
65
|
"doctrine_asset",
|
|
@@ -293,7 +291,6 @@ function uploadIdFor(input: ReturnType<typeof normalizeAttachmentInput>): string
|
|
|
293
291
|
}
|
|
294
292
|
|
|
295
293
|
function ownerModelName(ownerKind: string): string {
|
|
296
|
-
if (ownerKind === "announcement") return "Announcement";
|
|
297
294
|
if (ownerKind === "assignment") return "Assignment";
|
|
298
295
|
if (ownerKind === "assignmentEvent") return "AssignmentEvent";
|
|
299
296
|
if (ownerKind === "delivery") return "Delivery";
|
|
@@ -33,8 +33,6 @@ export type ImageOperationName =
|
|
|
33
33
|
| "guidelines_diff"
|
|
34
34
|
| "guidelines_save"
|
|
35
35
|
| "guidelines_history"
|
|
36
|
-
| "announcements_list"
|
|
37
|
-
| "announcements_show"
|
|
38
36
|
| "announcements_dry_run"
|
|
39
37
|
| "announcements_pause"
|
|
40
38
|
| "announcements_resume"
|
|
@@ -992,96 +990,6 @@ export type GuidelinesHistoryResult = {
|
|
|
992
990
|
})[];
|
|
993
991
|
};
|
|
994
992
|
|
|
995
|
-
/** List the account's announcements, newest first, optionally one state. */
|
|
996
|
-
export type AnnouncementsListInput = {
|
|
997
|
-
/** One state of an announcement. */
|
|
998
|
-
state?: "posting" | "posted" | "failed" | "blocked" | "dry_run" | "withdrawn";
|
|
999
|
-
/** How many to return; 50 when left out. */
|
|
1000
|
-
limit?: number;
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
export type AnnouncementsListResult = {
|
|
1004
|
-
announcements: ({
|
|
1005
|
-
id: string;
|
|
1006
|
-
accountId?: string;
|
|
1007
|
-
storyLineageId?: string;
|
|
1008
|
-
storyVersionNumber?: number;
|
|
1009
|
-
/** One state of an announcement. */
|
|
1010
|
-
state: "posting" | "posted" | "failed" | "blocked" | "dry_run" | "withdrawn";
|
|
1011
|
-
/** The state in plain words, such as Dry run: not sent. */
|
|
1012
|
-
label: string;
|
|
1013
|
-
blockedReason?: string;
|
|
1014
|
-
mode?: string;
|
|
1015
|
-
link?: string;
|
|
1016
|
-
weight?: number;
|
|
1017
|
-
draftedBy?: string;
|
|
1018
|
-
checks?: {
|
|
1019
|
-
name: string;
|
|
1020
|
-
passed: boolean;
|
|
1021
|
-
}[];
|
|
1022
|
-
postId?: string;
|
|
1023
|
-
postedAt?: string;
|
|
1024
|
-
/** Dollars Caducus charged on this announcement so far, as a decimal string. */
|
|
1025
|
-
cost?: string;
|
|
1026
|
-
attempts?: number;
|
|
1027
|
-
error?: string;
|
|
1028
|
-
history?: {
|
|
1029
|
-
at: string;
|
|
1030
|
-
by: string;
|
|
1031
|
-
state: string;
|
|
1032
|
-
note: string;
|
|
1033
|
-
}[];
|
|
1034
|
-
withdrawnBy?: string;
|
|
1035
|
-
createdAt?: string;
|
|
1036
|
-
updatedAt?: string;
|
|
1037
|
-
})[];
|
|
1038
|
-
};
|
|
1039
|
-
|
|
1040
|
-
/** Show one Story's announcement: its row, its history, and the post text and checks kept in S3. */
|
|
1041
|
-
export type AnnouncementsShowInput = {
|
|
1042
|
-
/** The lineage id of the Story. */
|
|
1043
|
-
story: string;
|
|
1044
|
-
};
|
|
1045
|
-
|
|
1046
|
-
export type AnnouncementsShowResult = {
|
|
1047
|
-
announcement: {
|
|
1048
|
-
id: string;
|
|
1049
|
-
accountId?: string;
|
|
1050
|
-
storyLineageId?: string;
|
|
1051
|
-
storyVersionNumber?: number;
|
|
1052
|
-
/** One state of an announcement. */
|
|
1053
|
-
state: "posting" | "posted" | "failed" | "blocked" | "dry_run" | "withdrawn";
|
|
1054
|
-
/** The state in plain words, such as Dry run: not sent. */
|
|
1055
|
-
label: string;
|
|
1056
|
-
blockedReason?: string;
|
|
1057
|
-
mode?: string;
|
|
1058
|
-
link?: string;
|
|
1059
|
-
weight?: number;
|
|
1060
|
-
draftedBy?: string;
|
|
1061
|
-
checks?: {
|
|
1062
|
-
name: string;
|
|
1063
|
-
passed: boolean;
|
|
1064
|
-
}[];
|
|
1065
|
-
postId?: string;
|
|
1066
|
-
postedAt?: string;
|
|
1067
|
-
/** Dollars Caducus charged on this announcement so far, as a decimal string. */
|
|
1068
|
-
cost?: string;
|
|
1069
|
-
attempts?: number;
|
|
1070
|
-
error?: string;
|
|
1071
|
-
history?: {
|
|
1072
|
-
at: string;
|
|
1073
|
-
by: string;
|
|
1074
|
-
state: string;
|
|
1075
|
-
note: string;
|
|
1076
|
-
}[];
|
|
1077
|
-
withdrawnBy?: string;
|
|
1078
|
-
createdAt?: string;
|
|
1079
|
-
updatedAt?: string;
|
|
1080
|
-
};
|
|
1081
|
-
/** The stored post: text, post, link, weight, model and every check's problems. */
|
|
1082
|
-
document?: Record<string, unknown>;
|
|
1083
|
-
};
|
|
1084
|
-
|
|
1085
993
|
/** Build the exact post a Story would get (text, link with its UTM tags, length, every check) without sending or recording anything. */
|
|
1086
994
|
export type AnnouncementsDryRunInput = {
|
|
1087
995
|
/** The lineage id of the Story. */
|
|
@@ -1102,7 +1010,7 @@ export type AnnouncementsDryRunResult = {
|
|
|
1102
1010
|
sent: boolean;
|
|
1103
1011
|
};
|
|
1104
1012
|
|
|
1105
|
-
/** Pause announcements: nothing is posted, and
|
|
1013
|
+
/** Pause announcements: nothing is posted, and an X Delivery that comes due waits as Blocked: paused. */
|
|
1106
1014
|
export type AnnouncementsPauseInput = Record<string, unknown>;
|
|
1107
1015
|
|
|
1108
1016
|
export type AnnouncementsPauseResult = {
|
|
@@ -1112,7 +1020,7 @@ export type AnnouncementsPauseResult = {
|
|
|
1112
1020
|
pauseReason?: string;
|
|
1113
1021
|
};
|
|
1114
1022
|
|
|
1115
|
-
/** Resume announcements and
|
|
1023
|
+
/** Resume announcements and put back the X Deliveries that waited. */
|
|
1116
1024
|
export type AnnouncementsResumeInput = Record<string, unknown>;
|
|
1117
1025
|
|
|
1118
1026
|
export type AnnouncementsResumeResult = {
|
|
@@ -1465,7 +1373,7 @@ export type AnnouncementsRecordManualResult = {
|
|
|
1465
1373
|
attempt: Record<string, unknown>;
|
|
1466
1374
|
};
|
|
1467
1375
|
|
|
1468
|
-
/** Withdraw a Delivery that went
|
|
1376
|
+
/** Withdraw a Delivery: stop one that has not gone, or take back one that went where the channel can (a post on X is deleted). */
|
|
1469
1377
|
export type AnnouncementsWithdrawInput = {
|
|
1470
1378
|
/** The Delivery's id. */
|
|
1471
1379
|
delivery: string;
|
|
@@ -1473,6 +1381,14 @@ export type AnnouncementsWithdrawInput = {
|
|
|
1473
1381
|
|
|
1474
1382
|
export type AnnouncementsWithdrawResult = {
|
|
1475
1383
|
id: string;
|
|
1384
|
+
/** The Delivery's state afterwards: withdrawn. */
|
|
1385
|
+
state: string;
|
|
1386
|
+
/** Who withdrew it. */
|
|
1387
|
+
withdrawnBy: string;
|
|
1388
|
+
/** What Caducus has charged for the post in all, deletion included, when a post was deleted. */
|
|
1389
|
+
cost?: string | null;
|
|
1390
|
+
/** The Announcement's state afterwards: withdrawn once every Delivery is, cancelled when none had gone. */
|
|
1391
|
+
announcementState: string;
|
|
1476
1392
|
};
|
|
1477
1393
|
|
|
1478
1394
|
/** Where a Story was announced: each Announcement that announces it, with one line for each live Delivery. */
|
|
@@ -1704,8 +1620,6 @@ export interface ImageOperations {
|
|
|
1704
1620
|
guidelines_diff: { input: GuidelinesDiffInput; result: GuidelinesDiffResult };
|
|
1705
1621
|
guidelines_save: { input: GuidelinesSaveInput; result: GuidelinesSaveResult };
|
|
1706
1622
|
guidelines_history: { input: GuidelinesHistoryInput; result: GuidelinesHistoryResult };
|
|
1707
|
-
announcements_list: { input: AnnouncementsListInput; result: AnnouncementsListResult };
|
|
1708
|
-
announcements_show: { input: AnnouncementsShowInput; result: AnnouncementsShowResult };
|
|
1709
1623
|
announcements_dry_run: { input: AnnouncementsDryRunInput; result: AnnouncementsDryRunResult };
|
|
1710
1624
|
announcements_pause: { input: AnnouncementsPauseInput; result: AnnouncementsPauseResult };
|
|
1711
1625
|
announcements_resume: { input: AnnouncementsResumeInput; result: AnnouncementsResumeResult };
|
|
@@ -1762,8 +1676,6 @@ export const IMAGE_OPERATIONS = {
|
|
|
1762
1676
|
guidelines_diff: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "guidelines", command: "papyrus guidelines diff" },
|
|
1763
1677
|
guidelines_save: { effect: "write", agentAllowed: true, agentRung: "prepare", agentRefusal: "human_required", group: "guidelines", command: "papyrus guidelines save" },
|
|
1764
1678
|
guidelines_history: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "guidelines", command: "papyrus guidelines history" },
|
|
1765
|
-
announcements_list: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements list" },
|
|
1766
|
-
announcements_show: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements show" },
|
|
1767
1679
|
announcements_dry_run: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements dry-run" },
|
|
1768
1680
|
announcements_pause: { effect: "write", agentAllowed: true, agentRung: "propose", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements pause" },
|
|
1769
1681
|
announcements_resume: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements resume" },
|
|
@@ -1781,7 +1693,7 @@ export const IMAGE_OPERATIONS = {
|
|
|
1781
1693
|
announcements_unlock: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements unlock" },
|
|
1782
1694
|
announcements_correct: { effect: "write", agentAllowed: true, agentRung: "prepare", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements correct" },
|
|
1783
1695
|
announcements_record_manual: { effect: "write", agentAllowed: false, agentRung: "person", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements record-manual" },
|
|
1784
|
-
announcements_withdraw: { effect: "write", agentAllowed:
|
|
1696
|
+
announcements_withdraw: { effect: "write", agentAllowed: true, agentRung: "prepare", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements withdraw" },
|
|
1785
1697
|
announcements_where: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements where" },
|
|
1786
1698
|
announcements_recent: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements recent" },
|
|
1787
1699
|
announcements_explain: { effect: "read", agentAllowed: true, agentRung: "observe", agentRefusal: "human_required", group: "announcements", command: "papyrus announcements explain" },
|
package/package.json
CHANGED
package/routes.manifest.json
CHANGED