@tangle-network/agent-app 0.60.21 → 0.60.23
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.
- package/dist/agent-profiles/d1.js +3 -3
- package/dist/agent-profiles/index.js +3 -3
- package/dist/app-auth/index.js +3 -3
- package/dist/assistant/index.js +7 -7
- package/dist/chat-routes/index.js +7 -7
- package/dist/chat-store/index.js +2 -2
- package/dist/{chunk-YWNK6OTQ.js → chunk-4DIO2LTR.js} +5 -5
- package/dist/{chunk-YWNK6OTQ.js.map → chunk-4DIO2LTR.js.map} +1 -1
- package/dist/{chunk-AKC5ZC4R.js → chunk-CN5HNTU6.js} +1 -1
- package/dist/{chunk-XPTYP3FP.js → chunk-HWJOTTEI.js} +2 -2
- package/dist/{chunk-KXGGCENC.js → chunk-J7TCMW2J.js} +2 -2
- package/dist/{chunk-MUZQUS6X.js → chunk-KC2DUXKM.js} +5 -2
- package/dist/{chunk-MUZQUS6X.js.map → chunk-KC2DUXKM.js.map} +1 -1
- package/dist/{chunk-XXUG4FS2.js → chunk-M36GXE2W.js} +3 -3
- package/dist/chunk-NV7TNF7V.js +739 -0
- package/dist/chunk-NV7TNF7V.js.map +1 -0
- package/dist/{chunk-YO6DEA5T.js → chunk-S2G5NAWV.js} +4 -4
- package/dist/{chunk-LECWJ33T.js → chunk-T2IESIJ7.js} +2 -2
- package/dist/{chunk-HTAFI247.js → chunk-WTGSLW5X.js} +4 -4
- package/dist/design-canvas-react/index.js +4 -4
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/hub-approvals/index.d.ts +28 -0
- package/dist/hub-approvals/index.js +35 -0
- package/dist/hub-approvals/index.js.map +1 -0
- package/dist/hub-approvals/present.d.ts +26 -0
- package/dist/hub-approvals/result.d.ts +22 -0
- package/dist/hub-approvals/types.d.ts +192 -0
- package/dist/hub-approvals-react/dock.d.ts +40 -0
- package/dist/hub-approvals-react/index.d.ts +22 -0
- package/dist/hub-approvals-react/index.js +704 -0
- package/dist/hub-approvals-react/index.js.map +1 -0
- package/dist/hub-approvals-react/list.d.ts +14 -0
- package/dist/hub-approvals-react/parts.d.ts +37 -0
- package/dist/hub-approvals-react/preview.d.ts +11 -0
- package/dist/hub-approvals-react/receipt.d.ts +24 -0
- package/dist/hub-approvals-react/row.d.ts +19 -0
- package/dist/preset-cloudflare/index.js +2 -2
- package/dist/public-consultation/index.js +3 -3
- package/dist/sandbox/index.js +4 -4
- package/dist/tools/index.js +4 -4
- package/dist/web-react/command-palette.d.ts +5 -1
- package/dist/web-react/index.js +15 -15
- package/dist/work-product/index.js +2 -2
- package/dist/workspace-react/companion.d.ts +7 -3
- package/dist/workspace-react/index.js +13 -6
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +14 -4
- /package/dist/{chunk-AKC5ZC4R.js.map → chunk-CN5HNTU6.js.map} +0 -0
- /package/dist/{chunk-XPTYP3FP.js.map → chunk-HWJOTTEI.js.map} +0 -0
- /package/dist/{chunk-KXGGCENC.js.map → chunk-J7TCMW2J.js.map} +0 -0
- /package/dist/{chunk-XXUG4FS2.js.map → chunk-M36GXE2W.js.map} +0 -0
- /package/dist/{chunk-YO6DEA5T.js.map → chunk-S2G5NAWV.js.map} +0 -0
- /package/dist/{chunk-LECWJ33T.js.map → chunk-T2IESIJ7.js.map} +0 -0
- /package/dist/{chunk-HTAFI247.js.map → chunk-WTGSLW5X.js.map} +0 -0
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
// src/hub-approvals/types.ts
|
|
2
|
+
var HUB_APPROVAL_OPEN_PHASES = /* @__PURE__ */ new Set(["waiting", "blocked"]);
|
|
3
|
+
var HUB_APPROVAL_ACTIVE_PHASES = /* @__PURE__ */ new Set(["queued", "running"]);
|
|
4
|
+
|
|
5
|
+
// src/hub-approvals/result.ts
|
|
6
|
+
var MAX_DEPTH = 4;
|
|
7
|
+
var MAX_KEYS = 24;
|
|
8
|
+
var MAX_ITEMS = 50;
|
|
9
|
+
var MAX_STRING = 600;
|
|
10
|
+
function asRecord(value) {
|
|
11
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
12
|
+
}
|
|
13
|
+
function unwrapHubResult(value) {
|
|
14
|
+
let current = value;
|
|
15
|
+
if (typeof current === "string") {
|
|
16
|
+
const text2 = current;
|
|
17
|
+
try {
|
|
18
|
+
current = JSON.parse(text2);
|
|
19
|
+
} catch {
|
|
20
|
+
const start = text2.indexOf("{");
|
|
21
|
+
if (start < 0) return value;
|
|
22
|
+
try {
|
|
23
|
+
current = JSON.parse(text2.slice(start));
|
|
24
|
+
} catch {
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
for (let depth = 0; depth < 3; depth++) {
|
|
30
|
+
const record = asRecord(current);
|
|
31
|
+
const keys = Object.keys(record);
|
|
32
|
+
const inner = keys.find((key) => key === "result" || key === "data");
|
|
33
|
+
if (!inner || keys.length > 3 || record[inner] === null || typeof record[inner] !== "object") break;
|
|
34
|
+
current = record[inner];
|
|
35
|
+
}
|
|
36
|
+
return current;
|
|
37
|
+
}
|
|
38
|
+
function bounded(value, depth) {
|
|
39
|
+
if (value === null || typeof value === "boolean") return value;
|
|
40
|
+
if (typeof value === "number") return Number.isFinite(value) ? value : null;
|
|
41
|
+
if (typeof value === "string") return value.length > MAX_STRING ? `${value.slice(0, MAX_STRING - 1)}\u2026` : value;
|
|
42
|
+
if (depth >= MAX_DEPTH) return void 0;
|
|
43
|
+
if (Array.isArray(value)) {
|
|
44
|
+
return value.slice(0, MAX_ITEMS).map((item) => bounded(item, depth + 1)).filter((item) => item !== void 0);
|
|
45
|
+
}
|
|
46
|
+
if (typeof value === "object") {
|
|
47
|
+
const out = {};
|
|
48
|
+
for (const [key, entry] of Object.entries(value).slice(0, MAX_KEYS)) {
|
|
49
|
+
const kept = bounded(entry, depth + 1);
|
|
50
|
+
if (kept !== void 0) out[key] = kept;
|
|
51
|
+
}
|
|
52
|
+
return out;
|
|
53
|
+
}
|
|
54
|
+
return void 0;
|
|
55
|
+
}
|
|
56
|
+
function summarizeHubResult(result) {
|
|
57
|
+
return bounded(unwrapHubResult(result), 0);
|
|
58
|
+
}
|
|
59
|
+
function readText(value, ...keys) {
|
|
60
|
+
const record = asRecord(value);
|
|
61
|
+
for (const key of keys) {
|
|
62
|
+
const found = record[key];
|
|
63
|
+
if (typeof found === "string" && found.trim()) return found.trim();
|
|
64
|
+
if (typeof found === "number" && Number.isFinite(found)) return String(found);
|
|
65
|
+
}
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
function readNumber(value, ...keys) {
|
|
69
|
+
const record = asRecord(value);
|
|
70
|
+
for (const key of keys) {
|
|
71
|
+
const found = record[key];
|
|
72
|
+
if (typeof found === "number" && Number.isFinite(found)) return found;
|
|
73
|
+
}
|
|
74
|
+
return void 0;
|
|
75
|
+
}
|
|
76
|
+
function resultLink(value) {
|
|
77
|
+
const url = readText(value, "html_url", "htmlLink", "webLink", "web_url", "permalink", "hosted_invoice_url", "url", "link");
|
|
78
|
+
return url && /^https:\/\//.test(url) ? url : void 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/hub-approvals/present.ts
|
|
82
|
+
var PROVIDER_NAMES = {
|
|
83
|
+
github: "GitHub",
|
|
84
|
+
gitlab: "GitLab",
|
|
85
|
+
gmail: "Gmail",
|
|
86
|
+
google: "Google",
|
|
87
|
+
"google-calendar": "Google Calendar",
|
|
88
|
+
"microsoft-calendar": "Outlook Calendar",
|
|
89
|
+
"outlook-mail": "Outlook",
|
|
90
|
+
outlook: "Outlook",
|
|
91
|
+
twitter: "X",
|
|
92
|
+
x: "X",
|
|
93
|
+
linkedin: "LinkedIn",
|
|
94
|
+
stripe: "Stripe",
|
|
95
|
+
phony: "ph0ny",
|
|
96
|
+
slack: "Slack",
|
|
97
|
+
notion: "Notion",
|
|
98
|
+
hubspot: "HubSpot",
|
|
99
|
+
linear: "Linear",
|
|
100
|
+
inkbox: "Inkbox",
|
|
101
|
+
resend: "Resend"
|
|
102
|
+
};
|
|
103
|
+
function hubProviderName(id) {
|
|
104
|
+
if (PROVIDER_NAMES[id]) return PROVIDER_NAMES[id];
|
|
105
|
+
const words2 = id.split(/[-_\s]+/).filter(Boolean);
|
|
106
|
+
return words2.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ") || id;
|
|
107
|
+
}
|
|
108
|
+
function splitHubActionPath(actionPath) {
|
|
109
|
+
const separator = actionPath.indexOf(".");
|
|
110
|
+
return separator < 0 ? { provider: "", action: actionPath } : { provider: actionPath.slice(0, separator), action: actionPath.slice(separator + 1) };
|
|
111
|
+
}
|
|
112
|
+
function text(value) {
|
|
113
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
114
|
+
}
|
|
115
|
+
function clipped(value, max = 80) {
|
|
116
|
+
const single = value.replace(/\s+/g, " ").trim();
|
|
117
|
+
return single.length > max ? `${single.slice(0, max - 1).trimEnd()}\u2026` : single;
|
|
118
|
+
}
|
|
119
|
+
function list(value) {
|
|
120
|
+
if (typeof value === "string") return value.split(/[,;]/).map((entry) => entry.trim()).filter(Boolean);
|
|
121
|
+
if (!Array.isArray(value)) return [];
|
|
122
|
+
return value.flatMap((entry) => {
|
|
123
|
+
if (typeof entry === "string" && entry.trim()) return [entry.trim()];
|
|
124
|
+
const record = asRecord(entry);
|
|
125
|
+
const address = text(record.email) ?? text(record.address) ?? text(asRecord(record.emailAddress).address);
|
|
126
|
+
return address ? [address] : [];
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function people(addresses) {
|
|
130
|
+
if (addresses.length === 0) return "";
|
|
131
|
+
if (addresses.length === 1) return addresses[0];
|
|
132
|
+
return `${addresses[0]} and ${addresses.length - 1} more`;
|
|
133
|
+
}
|
|
134
|
+
function shortSha(sha) {
|
|
135
|
+
return sha && /^[0-9a-f]{7,}$/i.test(sha) ? sha.slice(0, 7) : sha;
|
|
136
|
+
}
|
|
137
|
+
var PAST = {
|
|
138
|
+
add: "added",
|
|
139
|
+
approve: "approved",
|
|
140
|
+
archive: "archived",
|
|
141
|
+
assign: "assigned",
|
|
142
|
+
book: "booked",
|
|
143
|
+
cancel: "canceled",
|
|
144
|
+
capture: "captured",
|
|
145
|
+
charge: "charged",
|
|
146
|
+
clone: "cloned",
|
|
147
|
+
close: "closed",
|
|
148
|
+
comment: "commented",
|
|
149
|
+
create: "created",
|
|
150
|
+
deactivate: "deactivated",
|
|
151
|
+
delete: "deleted",
|
|
152
|
+
enroll: "enrolled",
|
|
153
|
+
export: "exported",
|
|
154
|
+
finalize: "finalized",
|
|
155
|
+
forward: "forwarded",
|
|
156
|
+
import: "imported",
|
|
157
|
+
ingest: "ingested",
|
|
158
|
+
invite: "invited",
|
|
159
|
+
like: "liked",
|
|
160
|
+
make: "made",
|
|
161
|
+
merge: "merged",
|
|
162
|
+
move: "moved",
|
|
163
|
+
open: "opened",
|
|
164
|
+
pay: "paid",
|
|
165
|
+
place: "placed",
|
|
166
|
+
post: "posted",
|
|
167
|
+
provision: "provisioned",
|
|
168
|
+
publish: "published",
|
|
169
|
+
put: "put",
|
|
170
|
+
react: "reacted",
|
|
171
|
+
refund: "refunded",
|
|
172
|
+
remove: "removed",
|
|
173
|
+
reply: "replied",
|
|
174
|
+
retweet: "reposted",
|
|
175
|
+
review: "reviewed",
|
|
176
|
+
run: "ran",
|
|
177
|
+
save: "saved",
|
|
178
|
+
schedule: "scheduled",
|
|
179
|
+
send: "sent",
|
|
180
|
+
set: "set",
|
|
181
|
+
share: "shared",
|
|
182
|
+
start: "started",
|
|
183
|
+
stop: "stopped",
|
|
184
|
+
submit: "submitted",
|
|
185
|
+
subscribe: "subscribed",
|
|
186
|
+
synthesize: "synthesized",
|
|
187
|
+
transfer: "transferred",
|
|
188
|
+
translate: "translated",
|
|
189
|
+
update: "updated",
|
|
190
|
+
upload: "uploaded",
|
|
191
|
+
upsert: "saved",
|
|
192
|
+
void: "voided",
|
|
193
|
+
watch: "watched",
|
|
194
|
+
write: "wrote"
|
|
195
|
+
};
|
|
196
|
+
function pastTense(verb) {
|
|
197
|
+
const lower = verb.toLowerCase();
|
|
198
|
+
const past = PAST[lower] ?? (lower.endsWith("e") ? `${lower}d` : `${lower}ed`);
|
|
199
|
+
return verb.charAt(0) === verb.charAt(0).toUpperCase() ? past.charAt(0).toUpperCase() + past.slice(1) : past;
|
|
200
|
+
}
|
|
201
|
+
function words(action) {
|
|
202
|
+
return action.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[._\-\s]+/).map((word) => word.toLowerCase()).filter(Boolean);
|
|
203
|
+
}
|
|
204
|
+
function singular(word) {
|
|
205
|
+
if (word.endsWith("ies")) return `${word.slice(0, -3)}y`;
|
|
206
|
+
if (word.endsWith("sses") || word.endsWith("ss")) return word;
|
|
207
|
+
return word.endsWith("s") && word.length > 3 ? word.slice(0, -1) : word;
|
|
208
|
+
}
|
|
209
|
+
function genericVerb(action) {
|
|
210
|
+
const parts = words(action);
|
|
211
|
+
const index = parts.findIndex((word) => word in PAST);
|
|
212
|
+
if (index < 0) return { verb: "", noun: parts.join(" ") };
|
|
213
|
+
const noun = [...parts.slice(0, index), ...parts.slice(index + 1)].map(singular).join(" ");
|
|
214
|
+
return { verb: parts[index], noun };
|
|
215
|
+
}
|
|
216
|
+
function sentence(verb, noun) {
|
|
217
|
+
const phrase = [verb, noun].filter(Boolean).join(" ");
|
|
218
|
+
return phrase.charAt(0).toUpperCase() + phrase.slice(1);
|
|
219
|
+
}
|
|
220
|
+
function repository(input) {
|
|
221
|
+
const owner = text(input.owner);
|
|
222
|
+
const repo = text(input.repo);
|
|
223
|
+
if (owner && repo) return `${owner}/${repo}`;
|
|
224
|
+
return repo ?? text(input.repository);
|
|
225
|
+
}
|
|
226
|
+
function branchOf(ref) {
|
|
227
|
+
return text(ref)?.replace(/^refs\/heads\//, "");
|
|
228
|
+
}
|
|
229
|
+
function hubActionFiles(actionPath, input) {
|
|
230
|
+
const fields = asRecord(input);
|
|
231
|
+
const { action } = splitHubActionPath(actionPath);
|
|
232
|
+
const entries = action === "git.createTree" ? fields.tree : fields.files;
|
|
233
|
+
if (!Array.isArray(entries)) return [];
|
|
234
|
+
return entries.flatMap((entry) => {
|
|
235
|
+
const item = asRecord(entry);
|
|
236
|
+
const path = text(item.path);
|
|
237
|
+
if (!path) return [];
|
|
238
|
+
const deleted = item.delete === true || item.sha === null && item.content === void 0;
|
|
239
|
+
return [{ path, change: deleted ? "deleted" : "modified" }];
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
function mergedFiles(declared, counted) {
|
|
243
|
+
if (!counted || counted.length === 0) return [...declared];
|
|
244
|
+
if (declared.length === 0) return [...counted];
|
|
245
|
+
const byPath = new Map(counted.map((file) => [file.path, file]));
|
|
246
|
+
return declared.map((file) => byPath.get(file.path) ?? file);
|
|
247
|
+
}
|
|
248
|
+
function emailPreview(input, reply) {
|
|
249
|
+
return {
|
|
250
|
+
kind: "email",
|
|
251
|
+
to: list(input.to ?? input.recipients),
|
|
252
|
+
cc: list(input.cc),
|
|
253
|
+
bcc: list(input.bcc),
|
|
254
|
+
subject: text(input.subject),
|
|
255
|
+
body: text(input.body) ?? text(input.text) ?? text(input.html) ?? text(input.comment),
|
|
256
|
+
html: input.html === true || text(input.bodyType)?.toLowerCase() === "html" || typeof input.html === "string",
|
|
257
|
+
reply
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function speechSeconds(input) {
|
|
261
|
+
const spoken = text(input.text);
|
|
262
|
+
if (!spoken) return void 0;
|
|
263
|
+
const speed = typeof input.speed === "number" && input.speed > 0 ? input.speed : 1;
|
|
264
|
+
return Math.max(1, Math.round(spoken.split(/\s+/).length / 2.5 / speed));
|
|
265
|
+
}
|
|
266
|
+
function voiceName(input) {
|
|
267
|
+
const voice = text(input.voiceId);
|
|
268
|
+
if (voice && !/^[0-9a-f-]{16,}$/i.test(voice) && voice.length <= 32) return voice.charAt(0).toUpperCase() + voice.slice(1);
|
|
269
|
+
return text(input.provider);
|
|
270
|
+
}
|
|
271
|
+
var CURRENCY_DIGITS = { jpy: 0, krw: 0, vnd: 0, clp: 0, bhd: 3, kwd: 3, omr: 3 };
|
|
272
|
+
function formatMinorAmount(amount, currency = "usd") {
|
|
273
|
+
const code = currency.toLowerCase();
|
|
274
|
+
const digits = CURRENCY_DIGITS[code] ?? 2;
|
|
275
|
+
try {
|
|
276
|
+
return new Intl.NumberFormat("en-US", { style: "currency", currency: code.toUpperCase(), minimumFractionDigits: digits }).format(amount / 10 ** digits);
|
|
277
|
+
} catch {
|
|
278
|
+
return `${(amount / 10 ** digits).toFixed(digits)} ${code.toUpperCase()}`;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function scalarFields(input, max = 6) {
|
|
282
|
+
return Object.entries(input).flatMap(([key, value]) => {
|
|
283
|
+
if (key.startsWith("__")) return [];
|
|
284
|
+
if (typeof value === "string" && value.trim()) return [{ label: labelOf(key), value: clipped(value, 160) }];
|
|
285
|
+
if (typeof value === "number" || typeof value === "boolean") return [{ label: labelOf(key), value: String(value) }];
|
|
286
|
+
const strings = Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
|
|
287
|
+
return strings.length > 0 ? [{ label: labelOf(key), value: clipped(strings.join(", "), 160) }] : [];
|
|
288
|
+
}).slice(0, max);
|
|
289
|
+
}
|
|
290
|
+
function labelOf(key) {
|
|
291
|
+
const spaced = key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim().toLowerCase();
|
|
292
|
+
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
|
293
|
+
}
|
|
294
|
+
function pullRequest(input, item) {
|
|
295
|
+
const repo = repository(input);
|
|
296
|
+
const title = text(input.title) ?? "Untitled change";
|
|
297
|
+
return {
|
|
298
|
+
action: "Open pull request",
|
|
299
|
+
title: `Open PR: ${clipped(title)}${repo ? ` on ${repo}` : ""}`,
|
|
300
|
+
...repo ? { target: repo } : {},
|
|
301
|
+
preview: {
|
|
302
|
+
kind: "pull-request",
|
|
303
|
+
repository: repo,
|
|
304
|
+
title,
|
|
305
|
+
body: text(input.body),
|
|
306
|
+
head: branchOf(input.branch ?? input.head),
|
|
307
|
+
base: text(input.base),
|
|
308
|
+
draft: item.actionPath.endsWith(".propose") ? true : input.draft === true,
|
|
309
|
+
files: mergedFiles(hubActionFiles(item.actionPath, input), item.files)
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
function issueLike(verb, noun) {
|
|
314
|
+
return (input) => {
|
|
315
|
+
const repo = repository(input);
|
|
316
|
+
const number = readNumber(input, "issue_number", "pull_number", "number");
|
|
317
|
+
const title = text(input.title);
|
|
318
|
+
const object = number !== void 0 ? `${noun} #${number}` : title ? `${noun}: ${clipped(title)}` : noun;
|
|
319
|
+
return {
|
|
320
|
+
action: sentence(verb, noun.toLowerCase()),
|
|
321
|
+
title: `${sentence(verb, object)}${repo ? ` on ${repo}` : ""}`,
|
|
322
|
+
...repo ? { target: repo } : {},
|
|
323
|
+
preview: {
|
|
324
|
+
kind: "issue",
|
|
325
|
+
repository: repo,
|
|
326
|
+
number,
|
|
327
|
+
title,
|
|
328
|
+
body: text(input.body),
|
|
329
|
+
verdict: text(input.event)?.toLowerCase().replace(/_/g, " ")
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function sendEmail(verb, reply = false) {
|
|
335
|
+
return (input) => {
|
|
336
|
+
const preview = emailPreview(input, reply);
|
|
337
|
+
const recipients = preview.kind === "email" ? people(preview.to) : "";
|
|
338
|
+
const action = reply ? "Send reply" : verb === "Send" ? "Send email" : "Save draft";
|
|
339
|
+
return {
|
|
340
|
+
action,
|
|
341
|
+
title: reply ? "Send reply" : `${action}${recipients ? ` to ${recipients}` : ""}`,
|
|
342
|
+
...recipients ? { target: recipients } : {},
|
|
343
|
+
preview
|
|
344
|
+
};
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function post(channel, reply = false) {
|
|
348
|
+
return (input) => {
|
|
349
|
+
const body = text(input.text) ?? text(input.commentary) ?? "";
|
|
350
|
+
const url = text(input.url);
|
|
351
|
+
const where = channel === "x" ? "X" : "LinkedIn";
|
|
352
|
+
return {
|
|
353
|
+
action: reply ? `Reply on ${where}` : `Post on ${where}`,
|
|
354
|
+
title: `${reply ? "Reply" : "Post"} on ${where}${body ? `: \u201C${clipped(body, 60)}\u201D` : ""}`,
|
|
355
|
+
target: where,
|
|
356
|
+
preview: {
|
|
357
|
+
kind: "post",
|
|
358
|
+
channel,
|
|
359
|
+
text: body,
|
|
360
|
+
...url ? { link: { url, title: text(input.title), description: text(input.description) } } : {}
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
function payment(label) {
|
|
366
|
+
return (input) => {
|
|
367
|
+
const amount = readNumber(input, "amount");
|
|
368
|
+
const currency = text(input.currency);
|
|
369
|
+
const customer = text(input.customerId) ?? text(input.customer) ?? text(input.email);
|
|
370
|
+
const formatted = amount !== void 0 ? formatMinorAmount(amount, currency) : void 0;
|
|
371
|
+
const object = formatted ? `${label} of ${formatted}` : label;
|
|
372
|
+
return {
|
|
373
|
+
action: sentence("create", label),
|
|
374
|
+
title: `${sentence("create", object)}${customer ? ` for ${customer}` : ""}`,
|
|
375
|
+
...customer ? { target: customer } : {},
|
|
376
|
+
preview: { kind: "payment", label, amount, currency, customer, description: text(input.description) }
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
function calendarEvent(input, _item) {
|
|
381
|
+
const title = text(input.summary) ?? text(input.title) ?? text(input.subject);
|
|
382
|
+
return {
|
|
383
|
+
action: "Book event",
|
|
384
|
+
title: title ? `Book \u201C${clipped(title, 60)}\u201D` : "Book an event",
|
|
385
|
+
preview: {
|
|
386
|
+
kind: "event",
|
|
387
|
+
title,
|
|
388
|
+
start: text(input.start) ?? text(asRecord(input.start).dateTime),
|
|
389
|
+
end: text(input.end) ?? text(asRecord(input.end).dateTime),
|
|
390
|
+
location: text(input.location) ?? text(asRecord(input.location).displayName),
|
|
391
|
+
attendees: list(input.attendees),
|
|
392
|
+
description: text(input.description)
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
var PRESENTERS = {
|
|
397
|
+
"github.pulls.propose": pullRequest,
|
|
398
|
+
"github.pulls.create": pullRequest,
|
|
399
|
+
"github.git.createTree": (input, item) => {
|
|
400
|
+
const repo = repository(input);
|
|
401
|
+
const files = mergedFiles(hubActionFiles(item.actionPath, input), item.files);
|
|
402
|
+
return {
|
|
403
|
+
action: "Write files",
|
|
404
|
+
title: `Write ${files.length === 1 ? files[0].path : `${files.length} files`}${repo ? ` to ${repo}` : ""}`,
|
|
405
|
+
...repo ? { target: repo } : {},
|
|
406
|
+
preview: { kind: "files", repository: repo, files }
|
|
407
|
+
};
|
|
408
|
+
},
|
|
409
|
+
"github.git.createCommit": (input) => {
|
|
410
|
+
const repo = repository(input);
|
|
411
|
+
const message = text(input.message);
|
|
412
|
+
return {
|
|
413
|
+
action: "Create commit",
|
|
414
|
+
title: `Commit${message ? ` \u201C${clipped(message, 60)}\u201D` : ""}${repo ? ` to ${repo}` : ""}`,
|
|
415
|
+
...repo ? { target: repo } : {},
|
|
416
|
+
preview: { kind: "commit", repository: repo, message, tree: text(input.tree), parents: list(input.parents) }
|
|
417
|
+
};
|
|
418
|
+
},
|
|
419
|
+
"github.git.createRef": (input) => {
|
|
420
|
+
const repo = repository(input);
|
|
421
|
+
const branch = branchOf(input.ref);
|
|
422
|
+
return {
|
|
423
|
+
action: "Create branch",
|
|
424
|
+
title: `Create branch ${branch ?? ""}${repo ? ` in ${repo}` : ""}`.replace(/\s+/g, " ").trim(),
|
|
425
|
+
...repo ? { target: repo } : {},
|
|
426
|
+
preview: { kind: "branch", repository: repo, branch, sha: text(input.sha) }
|
|
427
|
+
};
|
|
428
|
+
},
|
|
429
|
+
"github.pulls.merge": issueLike("merge", "PR"),
|
|
430
|
+
"github.pulls.reviews.create": issueLike("review", "PR"),
|
|
431
|
+
"github.issues.create": issueLike("open", "Issue"),
|
|
432
|
+
"github.issues.update": issueLike("update", "Issue"),
|
|
433
|
+
"github.issues.createComment": issueLike("comment on", "Issue"),
|
|
434
|
+
"gmail.send": sendEmail("Send"),
|
|
435
|
+
"gmail.send_reply": sendEmail("Send", true),
|
|
436
|
+
"outlook-mail.send_message": sendEmail("Send"),
|
|
437
|
+
"outlook-mail.send_draft": sendEmail("Send"),
|
|
438
|
+
"outlook-mail.create_draft": sendEmail("Save draft"),
|
|
439
|
+
"outlook-mail.send_reply": sendEmail("Send", true),
|
|
440
|
+
"inkbox.email.send": sendEmail("Send"),
|
|
441
|
+
"resend.emails.send": sendEmail("Send"),
|
|
442
|
+
"resend.emails.reply": sendEmail("Send", true),
|
|
443
|
+
"twitter.tweets.create": post("x"),
|
|
444
|
+
"twitter.tweets.reply": post("x", true),
|
|
445
|
+
"x.tweets.create": post("x"),
|
|
446
|
+
"linkedin.posts.create": post("linkedin"),
|
|
447
|
+
"linkedin.shares.create": post("linkedin"),
|
|
448
|
+
"slack.post_message": (input) => {
|
|
449
|
+
const channel = text(input.channel) ?? text(input.channelId);
|
|
450
|
+
const where = channel ? channel.startsWith("#") || /^[CDG][A-Z0-9]{6,}$/.test(channel) ? channel : `#${channel}` : void 0;
|
|
451
|
+
return {
|
|
452
|
+
action: "Post in Slack",
|
|
453
|
+
title: `Post in ${where ?? "Slack"}`,
|
|
454
|
+
...where ? { target: where } : {},
|
|
455
|
+
preview: { kind: "post", channel: "slack", text: text(input.text) ?? "", where }
|
|
456
|
+
};
|
|
457
|
+
},
|
|
458
|
+
"stripe.payment-intents.create": payment("payment"),
|
|
459
|
+
"stripe.payment-links.create": payment("payment link"),
|
|
460
|
+
"stripe.invoices.create": payment("invoice"),
|
|
461
|
+
"stripe.refunds.create": payment("refund"),
|
|
462
|
+
"stripe.subscriptions.create": payment("subscription"),
|
|
463
|
+
"phony.synthesize_speech": (input) => {
|
|
464
|
+
const seconds = speechSeconds(input);
|
|
465
|
+
const voice = voiceName(input);
|
|
466
|
+
const detail = [voice, seconds ? `${seconds} s` : void 0].filter(Boolean);
|
|
467
|
+
return {
|
|
468
|
+
action: "Create voice memo",
|
|
469
|
+
title: `Create voice memo${detail.length ? ` (${detail.join(", ")})` : ""}`,
|
|
470
|
+
preview: { kind: "speech", text: text(input.text) ?? "", voice, seconds }
|
|
471
|
+
};
|
|
472
|
+
},
|
|
473
|
+
"phony.start_outbound_call": (input) => {
|
|
474
|
+
const to = text(input.toNumber) ?? text(input.to);
|
|
475
|
+
const mission = asRecord(input.mission);
|
|
476
|
+
return {
|
|
477
|
+
action: "Start call",
|
|
478
|
+
title: to ? `Call ${to}` : "Start an outbound call",
|
|
479
|
+
...to ? { target: to } : {},
|
|
480
|
+
preview: {
|
|
481
|
+
kind: "call",
|
|
482
|
+
to,
|
|
483
|
+
from: text(input.fromNumber),
|
|
484
|
+
purpose: text(mission.goal) ?? text(mission.objective) ?? text(mission.summary) ?? text(input.missionId)
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
},
|
|
488
|
+
"google-calendar.create_event": calendarEvent,
|
|
489
|
+
"google-calendar.book_slot": calendarEvent,
|
|
490
|
+
"google-calendar.update_event": (input, item) => {
|
|
491
|
+
const event = calendarEvent(input, item);
|
|
492
|
+
const title = event.preview.kind === "event" ? event.preview.title : void 0;
|
|
493
|
+
return { ...event, action: "Update event", title: title ? `Update \u201C${clipped(title, 60)}\u201D` : "Update an event" };
|
|
494
|
+
},
|
|
495
|
+
"microsoft-calendar.book_slot": calendarEvent
|
|
496
|
+
};
|
|
497
|
+
function presentHubAction(item) {
|
|
498
|
+
const { provider: pathProvider, action } = splitHubActionPath(item.actionPath);
|
|
499
|
+
const providerId = item.providerId || pathProvider;
|
|
500
|
+
const provider = { id: providerId, name: hubProviderName(providerId) };
|
|
501
|
+
const input = asRecord(item.input);
|
|
502
|
+
const known = PRESENTERS[item.actionPath];
|
|
503
|
+
const presented = known ? known(input, item) : (() => {
|
|
504
|
+
const { verb, noun } = genericVerb(action);
|
|
505
|
+
const phrase = sentence(verb, noun) || action;
|
|
506
|
+
const object = text(input.name) ?? text(input.title) ?? text(input.subject) ?? text(input.label);
|
|
507
|
+
return {
|
|
508
|
+
action: phrase,
|
|
509
|
+
title: object ? `${phrase} \u201C${clipped(object, 60)}\u201D` : phrase,
|
|
510
|
+
preview: { kind: "fields", fields: scalarFields(input) }
|
|
511
|
+
};
|
|
512
|
+
})();
|
|
513
|
+
return { provider, ...presented, ...item.bundle ? { title: item.bundle.title } : {} };
|
|
514
|
+
}
|
|
515
|
+
function prField(result) {
|
|
516
|
+
const pull = asRecord(result.pullRequest);
|
|
517
|
+
const number = readNumber(pull, "number") ?? readNumber(result, "number");
|
|
518
|
+
if (number === void 0) return void 0;
|
|
519
|
+
return { label: "Pull request", value: `#${number}`, href: resultLink(pull) ?? resultLink(result) };
|
|
520
|
+
}
|
|
521
|
+
function receiptTitle(item, presentation, result) {
|
|
522
|
+
const { action } = splitHubActionPath(item.actionPath);
|
|
523
|
+
const input = asRecord(item.input);
|
|
524
|
+
const pull = asRecord(result.pullRequest);
|
|
525
|
+
const number = readNumber(pull, "number") ?? readNumber(result, "number");
|
|
526
|
+
switch (item.actionPath) {
|
|
527
|
+
case "github.pulls.propose":
|
|
528
|
+
case "github.pulls.create":
|
|
529
|
+
return number !== void 0 ? `Opened PR #${number}` : "Opened pull request";
|
|
530
|
+
case "github.git.createCommit": {
|
|
531
|
+
const sha = shortSha(readText(result, "sha"));
|
|
532
|
+
return sha ? `Created commit ${sha}` : "Created commit";
|
|
533
|
+
}
|
|
534
|
+
case "github.git.createTree": {
|
|
535
|
+
const files = hubActionFiles(item.actionPath, input).length;
|
|
536
|
+
return `Wrote ${files === 1 ? "1 file" : `${files} files`}`;
|
|
537
|
+
}
|
|
538
|
+
case "github.git.createRef":
|
|
539
|
+
return `Created branch ${branchOf(readText(result, "ref") ?? input.ref) ?? ""}`.trim();
|
|
540
|
+
case "github.issues.create":
|
|
541
|
+
return number !== void 0 ? `Opened issue #${number}` : "Opened issue";
|
|
542
|
+
case "github.issues.createComment": {
|
|
543
|
+
const on = readNumber(input, "issue_number");
|
|
544
|
+
return on !== void 0 ? `Commented on #${on}` : "Commented";
|
|
545
|
+
}
|
|
546
|
+
case "github.pulls.reviews.create": {
|
|
547
|
+
const on = readNumber(input, "pull_number");
|
|
548
|
+
return on !== void 0 ? `Reviewed PR #${on}` : "Reviewed pull request";
|
|
549
|
+
}
|
|
550
|
+
case "github.pulls.merge": {
|
|
551
|
+
const on = readNumber(input, "pull_number");
|
|
552
|
+
return on !== void 0 ? `Merged PR #${on}` : "Merged pull request";
|
|
553
|
+
}
|
|
554
|
+
case "phony.synthesize_speech":
|
|
555
|
+
return "Created voice memo";
|
|
556
|
+
}
|
|
557
|
+
if (presentation.preview.kind === "email") {
|
|
558
|
+
const to = people(presentation.preview.to);
|
|
559
|
+
if (presentation.preview.reply) return "Sent reply";
|
|
560
|
+
return action.includes("draft") && !action.startsWith("send") ? `Saved draft${to ? ` to ${to}` : ""}` : `Sent email${to ? ` to ${to}` : ""}`;
|
|
561
|
+
}
|
|
562
|
+
if (presentation.preview.kind === "post") {
|
|
563
|
+
return presentation.preview.channel === "slack" ? `Posted in ${presentation.preview.where ?? "Slack"}` : `Posted on ${presentation.target ?? presentation.provider.name}`;
|
|
564
|
+
}
|
|
565
|
+
if (presentation.preview.kind === "event") {
|
|
566
|
+
const verb = presentation.action === "Update event" ? "Updated" : "Booked";
|
|
567
|
+
return presentation.preview.title ? `${verb} \u201C${clipped(presentation.preview.title, 60)}\u201D` : `${verb} event`;
|
|
568
|
+
}
|
|
569
|
+
if (presentation.preview.kind === "call") return presentation.preview.to ? `Started call to ${presentation.preview.to}` : "Started call";
|
|
570
|
+
const [first = "", ...rest] = presentation.action.split(" ");
|
|
571
|
+
return [pastTense(first), ...rest].join(" ");
|
|
572
|
+
}
|
|
573
|
+
function postLink(item, result) {
|
|
574
|
+
const id = readText(result, "id", "urn", "postUrn");
|
|
575
|
+
if (!id) return resultLink(result);
|
|
576
|
+
if (item.providerId === "twitter" || item.providerId === "x") return /^\d+$/.test(id) ? `https://x.com/i/web/status/${id}` : resultLink(result);
|
|
577
|
+
if (item.providerId === "linkedin") return id.startsWith("urn:li:") ? `https://www.linkedin.com/feed/update/${id}/` : resultLink(result);
|
|
578
|
+
return resultLink(result);
|
|
579
|
+
}
|
|
580
|
+
function receiptFields(item, presentation, result) {
|
|
581
|
+
const fields = [];
|
|
582
|
+
const preview = presentation.preview;
|
|
583
|
+
switch (preview.kind) {
|
|
584
|
+
case "pull-request": {
|
|
585
|
+
const pr = prField(result);
|
|
586
|
+
if (pr) fields.push(pr);
|
|
587
|
+
const head = readText(result, "branch") ?? preview.head;
|
|
588
|
+
const base = readText(result, "base") ?? preview.base;
|
|
589
|
+
if (head && base) fields.push({ label: "Branch", value: `${head} \u2192 ${base}`, mono: true });
|
|
590
|
+
const commit = asRecord(result.commit);
|
|
591
|
+
const sha = readText(commit, "sha");
|
|
592
|
+
if (sha) fields.push({ label: "Commit", value: shortSha(sha), href: resultLink(commit), mono: true });
|
|
593
|
+
const repo = readText(result, "repository") ?? preview.repository;
|
|
594
|
+
if (repo) fields.push({ label: "Repository", value: repo, href: `https://github.com/${repo}` });
|
|
595
|
+
return fields;
|
|
596
|
+
}
|
|
597
|
+
case "commit": {
|
|
598
|
+
const sha = readText(result, "sha");
|
|
599
|
+
if (sha) fields.push({ label: "Commit", value: shortSha(sha), href: resultLink(result)?.includes("api.github.com") ? void 0 : resultLink(result), mono: true });
|
|
600
|
+
if (preview.message) fields.push({ label: "Message", value: clipped(preview.message, 120) });
|
|
601
|
+
return fields;
|
|
602
|
+
}
|
|
603
|
+
case "branch": {
|
|
604
|
+
const branch = branchOf(readText(result, "ref")) ?? preview.branch;
|
|
605
|
+
if (branch && preview.repository) fields.push({ label: "Branch", value: branch, href: `https://github.com/${preview.repository}/tree/${branch}`, mono: true });
|
|
606
|
+
return fields;
|
|
607
|
+
}
|
|
608
|
+
case "files": {
|
|
609
|
+
const sha = readText(result, "sha");
|
|
610
|
+
if (sha) fields.push({ label: "Tree", value: shortSha(sha), mono: true });
|
|
611
|
+
return fields;
|
|
612
|
+
}
|
|
613
|
+
case "email": {
|
|
614
|
+
if (preview.subject) fields.push({ label: "Subject", value: clipped(preview.subject, 120) });
|
|
615
|
+
if (preview.cc.length) fields.push({ label: "Cc", value: preview.cc.join(", ") });
|
|
616
|
+
return fields;
|
|
617
|
+
}
|
|
618
|
+
case "payment": {
|
|
619
|
+
const amount = readNumber(result, "amount", "amount_total", "total") ?? preview.amount;
|
|
620
|
+
const currency = readText(result, "currency") ?? preview.currency;
|
|
621
|
+
if (amount !== void 0) fields.push({ label: "Amount", value: formatMinorAmount(amount, currency) });
|
|
622
|
+
const customer = readText(result, "customer_email", "customer") ?? preview.customer;
|
|
623
|
+
if (customer) fields.push({ label: "Customer", value: customer, mono: customer.startsWith("cus_") });
|
|
624
|
+
const status = readText(result, "status");
|
|
625
|
+
if (status) fields.push({ label: "Status", value: status });
|
|
626
|
+
return fields;
|
|
627
|
+
}
|
|
628
|
+
case "speech": {
|
|
629
|
+
const seconds = readNumber(result, "durationSeconds", "duration");
|
|
630
|
+
if (seconds !== void 0) fields.push({ label: "Length", value: `${Math.round(seconds * 10) / 10} s` });
|
|
631
|
+
if (preview.voice) fields.push({ label: "Voice", value: preview.voice });
|
|
632
|
+
return fields;
|
|
633
|
+
}
|
|
634
|
+
case "event": {
|
|
635
|
+
if (preview.start) fields.push({ label: "When", value: formatWhen(preview.start, preview.end) });
|
|
636
|
+
if (preview.attendees.length) fields.push({ label: "Guests", value: people(preview.attendees) });
|
|
637
|
+
return fields;
|
|
638
|
+
}
|
|
639
|
+
case "call": {
|
|
640
|
+
const status = readText(asRecord(result.call), "status") ?? readText(result, "status");
|
|
641
|
+
if (status) fields.push({ label: "Status", value: status });
|
|
642
|
+
return fields;
|
|
643
|
+
}
|
|
644
|
+
default: {
|
|
645
|
+
const id = readText(result, "id", "number", "key");
|
|
646
|
+
if (id) fields.push({ label: "ID", value: id, mono: true });
|
|
647
|
+
const status = readText(result, "status", "state");
|
|
648
|
+
if (status) fields.push({ label: "Status", value: status });
|
|
649
|
+
const name = readText(result, "name", "title");
|
|
650
|
+
if (name) fields.push({ label: "Name", value: clipped(name, 80) });
|
|
651
|
+
return fields;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
function formatWhen(start, end) {
|
|
656
|
+
const from = new Date(start);
|
|
657
|
+
if (Number.isNaN(from.getTime())) return end ? `${start} \u2013 ${end}` : start;
|
|
658
|
+
const day = from.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" });
|
|
659
|
+
const time = (date) => date.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
660
|
+
const to = end ? new Date(end) : null;
|
|
661
|
+
if (!to || Number.isNaN(to.getTime())) return `${day}, ${time(from)}`;
|
|
662
|
+
return to.toDateString() === from.toDateString() ? `${day}, ${time(from)} \u2013 ${time(to)}` : `${day}, ${time(from)} \u2013 ${to.toLocaleDateString(void 0, { month: "short", day: "numeric" })}, ${time(to)}`;
|
|
663
|
+
}
|
|
664
|
+
function receiptFiles(result) {
|
|
665
|
+
if (!Array.isArray(result.files)) return void 0;
|
|
666
|
+
return result.files.flatMap((entry) => {
|
|
667
|
+
const file = asRecord(entry);
|
|
668
|
+
const path = text(file.path) ?? text(file.filename);
|
|
669
|
+
if (!path) return [];
|
|
670
|
+
const status = text(file.status);
|
|
671
|
+
const change = status === "added" ? "added" : status === "removed" || status === "deleted" ? "deleted" : "modified";
|
|
672
|
+
return [{ path, change, additions: readNumber(file, "additions"), deletions: readNumber(file, "deletions") }];
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
function hubActionReceipt(item) {
|
|
676
|
+
const presentation = presentHubAction(item);
|
|
677
|
+
const result = asRecord(unwrapHubResult(item.result));
|
|
678
|
+
const status = item.phase === "done" || item.phase === "failed" || item.phase === "denied" || item.phase === "expired" ? item.phase : item.phase === "queued" || item.phase === "running" ? "running" : "waiting";
|
|
679
|
+
const base = { provider: presentation.provider, status };
|
|
680
|
+
if (status === "denied") return { ...base, title: `Denied: ${presentation.title}`, fields: [] };
|
|
681
|
+
if (status === "expired") return { ...base, title: `Expired: ${presentation.title}`, fields: [] };
|
|
682
|
+
if (status === "failed") return { ...base, title: `Could not ${presentation.action.charAt(0).toLowerCase()}${presentation.action.slice(1)}`, fields: [], ...item.error ? { error: item.error } : {} };
|
|
683
|
+
if (status !== "done") return { ...base, title: presentation.title, fields: [] };
|
|
684
|
+
const title = receiptTitle(item, presentation, result);
|
|
685
|
+
const fields = receiptFields(item, presentation, result);
|
|
686
|
+
const pull = asRecord(result.pullRequest);
|
|
687
|
+
const href = presentation.preview.kind === "post" ? postLink(item, result) : resultLink(pull) ?? (item.actionPath.startsWith("github.git.") ? void 0 : resultLink(result));
|
|
688
|
+
const audio = readText(result, "audioUrl");
|
|
689
|
+
const seconds = readNumber(result, "durationSeconds", "duration");
|
|
690
|
+
const files = receiptFiles(result);
|
|
691
|
+
return {
|
|
692
|
+
...base,
|
|
693
|
+
title,
|
|
694
|
+
...href ? { href } : {},
|
|
695
|
+
fields,
|
|
696
|
+
...files && files.length ? { files } : {},
|
|
697
|
+
...audio && /^https:\/\//.test(audio) ? { media: { kind: "audio", src: audio, ...seconds !== void 0 ? { seconds } : {} } } : {}
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
// src/hub-approvals/index.ts
|
|
702
|
+
var HUB_APPROVAL_PHASE_LABELS = {
|
|
703
|
+
waiting: "Waiting for you",
|
|
704
|
+
blocked: "Waiting for the owner",
|
|
705
|
+
queued: "Queued",
|
|
706
|
+
running: "Running",
|
|
707
|
+
done: "Done",
|
|
708
|
+
failed: "Failed",
|
|
709
|
+
denied: "Denied",
|
|
710
|
+
expired: "Expired"
|
|
711
|
+
};
|
|
712
|
+
var HUB_APPROVAL_RESUME_PART = "hub-approval-resume";
|
|
713
|
+
function hubApprovalResumePart(parts) {
|
|
714
|
+
for (const part of parts ?? []) {
|
|
715
|
+
if (part?.type === HUB_APPROVAL_RESUME_PART && typeof part.messageId === "string" && part.messageId) {
|
|
716
|
+
return { type: HUB_APPROVAL_RESUME_PART, messageId: part.messageId };
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
return null;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
export {
|
|
723
|
+
HUB_APPROVAL_OPEN_PHASES,
|
|
724
|
+
HUB_APPROVAL_ACTIVE_PHASES,
|
|
725
|
+
unwrapHubResult,
|
|
726
|
+
summarizeHubResult,
|
|
727
|
+
hubProviderName,
|
|
728
|
+
splitHubActionPath,
|
|
729
|
+
pastTense,
|
|
730
|
+
hubActionFiles,
|
|
731
|
+
formatMinorAmount,
|
|
732
|
+
presentHubAction,
|
|
733
|
+
formatWhen,
|
|
734
|
+
hubActionReceipt,
|
|
735
|
+
HUB_APPROVAL_PHASE_LABELS,
|
|
736
|
+
HUB_APPROVAL_RESUME_PART,
|
|
737
|
+
hubApprovalResumePart
|
|
738
|
+
};
|
|
739
|
+
//# sourceMappingURL=chunk-NV7TNF7V.js.map
|