@appeeky/spec 0.2.1 → 0.4.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.
- package/README.md +36 -6
- package/agents/appeeky-social.md +12 -5
- package/agents/cofounder.md +1 -1
- package/dist/appeeky-api.d.ts +6 -0
- package/dist/appeeky-api.js +14 -3
- package/dist/cli.js +196 -93
- package/dist/coding-agents.d.ts +27 -0
- package/dist/coding-agents.js +37 -0
- package/dist/output.d.ts +8 -0
- package/dist/output.js +31 -0
- package/dist/social.d.ts +253 -17
- package/dist/social.js +296 -34
- package/package.json +2 -1
- package/skills/appeeky-spec-experiments/SKILL.md +2 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentTarget } from "./agents.js";
|
|
2
|
+
/** A coding agent the setup can hand over to: its command, its id for `npx skills add`, how it takes a first prompt. */
|
|
3
|
+
export interface CodingAgent {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
bin: string;
|
|
7
|
+
/** The agent's id in the skills CLI (`npx skills add … -a <id>`). */
|
|
8
|
+
skills: string;
|
|
9
|
+
/** Where the specialist subagents and /appeeky-cofounder go, for the agents that read them. */
|
|
10
|
+
subagents?: AgentTarget;
|
|
11
|
+
/** Arguments that start an interactive session with `prompt` as the first message. */
|
|
12
|
+
launch: (prompt: string) => string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const CODING_AGENTS: CodingAgent[];
|
|
15
|
+
/** Whether `bin` is on the PATH. */
|
|
16
|
+
export declare function onPath(bin: string, env?: NodeJS.ProcessEnv): boolean;
|
|
17
|
+
/** The first message for the agent: finish what the setup could not do here, then propose one change. */
|
|
18
|
+
export declare function setupPrompt(app: {
|
|
19
|
+
name: string;
|
|
20
|
+
pulled: boolean;
|
|
21
|
+
hasTargets: boolean;
|
|
22
|
+
}): string;
|
|
23
|
+
/** Run a command quietly; resolves with its exit code and output, so a spinner can run meanwhile. */
|
|
24
|
+
export declare function runQuiet(cmd: string, args: string[], cwd: string): Promise<{
|
|
25
|
+
code: number;
|
|
26
|
+
output: string;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { delimiter, join } from "node:path";
|
|
4
|
+
export const CODING_AGENTS = [
|
|
5
|
+
{ id: "claude", label: "Claude Code", bin: "claude", skills: "claude-code", subagents: "claude", launch: (p) => [p] },
|
|
6
|
+
{ id: "codex", label: "Codex", bin: "codex", skills: "codex", launch: (p) => [p] },
|
|
7
|
+
{ id: "gemini", label: "Gemini CLI", bin: "gemini", skills: "gemini-cli", launch: (p) => ["-i", p] },
|
|
8
|
+
{ id: "opencode", label: "OpenCode", bin: "opencode", skills: "opencode", subagents: "opencode", launch: (p) => ["--prompt", p] },
|
|
9
|
+
{ id: "cursor", label: "Cursor", bin: "cursor-agent", skills: "cursor", launch: (p) => [p] },
|
|
10
|
+
];
|
|
11
|
+
/** Whether `bin` is on the PATH. */
|
|
12
|
+
export function onPath(bin, env = process.env) {
|
|
13
|
+
const exts = process.platform === "win32" ? ["", ".cmd", ".exe"] : [""];
|
|
14
|
+
return (env.PATH ?? "").split(delimiter).some((dir) => dir && exts.some((ext) => existsSync(join(dir, bin + ext))));
|
|
15
|
+
}
|
|
16
|
+
/** The first message for the agent: finish what the setup could not do here, then propose one change. */
|
|
17
|
+
export function setupPrompt(app) {
|
|
18
|
+
const steps = [
|
|
19
|
+
"run `npx @appeeky/spec doctor` and walk me through anything missing, store access first",
|
|
20
|
+
app.pulled ? undefined : "pull the live listing with `npx @appeeky/spec pull`",
|
|
21
|
+
app.hasTargets ? "check the targets with `npx @appeeky/spec coverage`" : "suggest 3 to 5 target searches and add them to appeeky.spec.yaml",
|
|
22
|
+
"propose the first listing change and show me the diff",
|
|
23
|
+
].filter(Boolean);
|
|
24
|
+
return `Finish setting up Appeeky Spec for ${app.name} in this folder with the appeeky-spec skill: ${steps.join(", then ")}. Do not push anything to the stores until I say so.`;
|
|
25
|
+
}
|
|
26
|
+
/** Run a command quietly; resolves with its exit code and output, so a spinner can run meanwhile. */
|
|
27
|
+
export function runQuiet(cmd, args, cwd) {
|
|
28
|
+
return new Promise((resolve) => {
|
|
29
|
+
const child = spawn(cmd, args, { cwd, stdio: ["ignore", "pipe", "pipe"], shell: process.platform === "win32" });
|
|
30
|
+
let output = "";
|
|
31
|
+
child.stdout.on("data", (d) => (output += d));
|
|
32
|
+
child.stderr.on("data", (d) => (output += d));
|
|
33
|
+
child.on("error", (e) => resolve({ code: 1, output: e.message }));
|
|
34
|
+
child.on("close", (code) => resolve({ code: code ?? 1, output }));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=coding-agents.js.map
|
package/dist/output.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const c: {
|
|
|
8
8
|
green: (s: string) => string;
|
|
9
9
|
yellow: (s: string) => string;
|
|
10
10
|
cyan: (s: string) => string;
|
|
11
|
+
badge: (s: string) => string;
|
|
11
12
|
};
|
|
12
13
|
export declare function printJson(value: unknown): void;
|
|
13
14
|
declare const STORE_LABEL: {
|
|
@@ -18,4 +19,11 @@ export declare const storeLabel: (s: keyof typeof STORE_LABEL) => "App Store" |
|
|
|
18
19
|
export declare function formatIssues(issues: Issue[]): string;
|
|
19
20
|
export declare function formatChanges(changes: FieldChange[]): string;
|
|
20
21
|
export declare function formatCoverage(reports: StorefrontCoverage[]): string;
|
|
22
|
+
/**
|
|
23
|
+
* Show a spinner while `task` runs, in a terminal only. Lines the task logs print above the
|
|
24
|
+
* spinner, so a command that reports as it goes still reads cleanly. Never wrap a prompt.
|
|
25
|
+
*/
|
|
26
|
+
export declare function spin<T>(label: string, task: () => Promise<T>): Promise<T>;
|
|
27
|
+
/** White on cyan, for the setup's title. */
|
|
28
|
+
export declare const badge: (s: string) => string;
|
|
21
29
|
export {};
|
package/dist/output.js
CHANGED
|
@@ -7,6 +7,7 @@ export const c = {
|
|
|
7
7
|
green: wrap(32),
|
|
8
8
|
yellow: wrap(33),
|
|
9
9
|
cyan: wrap(36),
|
|
10
|
+
badge: (s) => badge(s),
|
|
10
11
|
};
|
|
11
12
|
export function printJson(value) {
|
|
12
13
|
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
@@ -76,4 +77,34 @@ export function formatCoverage(reports) {
|
|
|
76
77
|
}
|
|
77
78
|
return out.join("\n").trimEnd();
|
|
78
79
|
}
|
|
80
|
+
const FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
81
|
+
/**
|
|
82
|
+
* Show a spinner while `task` runs, in a terminal only. Lines the task logs print above the
|
|
83
|
+
* spinner, so a command that reports as it goes still reads cleanly. Never wrap a prompt.
|
|
84
|
+
*/
|
|
85
|
+
export async function spin(label, task) {
|
|
86
|
+
if (!process.stdout.isTTY || process.env.CI)
|
|
87
|
+
return task();
|
|
88
|
+
let i = 0;
|
|
89
|
+
const draw = () => process.stdout.write(`\r\u001b[2K ${c.cyan(FRAMES[i++ % FRAMES.length])} ${c.dim(label)}`);
|
|
90
|
+
const clear = () => process.stdout.write("\r\u001b[2K");
|
|
91
|
+
const log = console.log;
|
|
92
|
+
console.log = (...args) => {
|
|
93
|
+
clear();
|
|
94
|
+
log(...args);
|
|
95
|
+
draw();
|
|
96
|
+
};
|
|
97
|
+
draw();
|
|
98
|
+
const timer = setInterval(draw, 80);
|
|
99
|
+
try {
|
|
100
|
+
return await task();
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
clearInterval(timer);
|
|
104
|
+
console.log = log;
|
|
105
|
+
clear();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** White on cyan, for the setup's title. */
|
|
109
|
+
export const badge = (s) => (useColor ? `\u001b[46m\u001b[30m${s}\u001b[0m` : s);
|
|
79
110
|
//# sourceMappingURL=output.js.map
|
package/dist/social.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type
|
|
2
|
+
import { type AppeekyApi } from "./appeeky-api.js";
|
|
3
3
|
/**
|
|
4
4
|
* Organic social media in the repo, through the accounts connected in Appeeky (APPEEKY_API_KEY,
|
|
5
5
|
* Startup plan or above):
|
|
6
6
|
*
|
|
7
7
|
* appeeky/social/accounts.yaml the connected accounts (platform, name, id)
|
|
8
|
-
* appeeky/social/posts.jsonl recent posts, one per line, with each platform's result
|
|
9
|
-
* appeeky/social/
|
|
8
|
+
* appeeky/social/posts.jsonl recent posts made through Appeeky, one per line, with each platform's result
|
|
9
|
+
* appeeky/social/native-posts.jsonl posts made in the platform's own app, with their results
|
|
10
|
+
* appeeky/social/comments.jsonl recent comments on the accounts' posts
|
|
11
|
+
* appeeky/social/insights.yaml followers and growth per account
|
|
12
|
+
* appeeky/social/summary.md the last 30 days per account and platform, and the posts that did best
|
|
10
13
|
* appeeky/social/drafts/<name>.yaml a post: drafted, reviewed in a pull request, then sent
|
|
11
14
|
*
|
|
12
15
|
* Sending creates the post in Appeeky, which publishes it right away, or at `when`.
|
|
@@ -25,8 +28,59 @@ export interface SocialPlatformResult {
|
|
|
25
28
|
url?: string;
|
|
26
29
|
publishedAt?: string;
|
|
27
30
|
error?: string;
|
|
31
|
+
/** Uploaded to the creator's TikTok inbox: they finish and post it in the app, so there is no public URL yet. */
|
|
32
|
+
draft?: boolean;
|
|
28
33
|
metrics?: Partial<Record<SocialMetric, number>>;
|
|
29
34
|
}
|
|
35
|
+
/** A post made in the platform's own app, not through Appeeky. */
|
|
36
|
+
export interface NativePost {
|
|
37
|
+
id: string;
|
|
38
|
+
account: string;
|
|
39
|
+
platform: string;
|
|
40
|
+
url?: string;
|
|
41
|
+
text: string;
|
|
42
|
+
mediaType?: string;
|
|
43
|
+
publishedAt?: string;
|
|
44
|
+
metrics?: Partial<Record<SocialMetric | "engagementRate", number>>;
|
|
45
|
+
}
|
|
46
|
+
export interface SocialComment {
|
|
47
|
+
id: string;
|
|
48
|
+
account: string;
|
|
49
|
+
platform: string;
|
|
50
|
+
postUrl?: string;
|
|
51
|
+
postId?: string;
|
|
52
|
+
platformPostId?: string;
|
|
53
|
+
text: string;
|
|
54
|
+
author?: string;
|
|
55
|
+
own?: boolean;
|
|
56
|
+
reply?: boolean;
|
|
57
|
+
at?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface AccountInsights {
|
|
60
|
+
account: string;
|
|
61
|
+
platform: string;
|
|
62
|
+
followers?: number;
|
|
63
|
+
growth?: number;
|
|
64
|
+
growthPercentage?: number;
|
|
65
|
+
stats?: Record<string, unknown>;
|
|
66
|
+
history?: Array<{
|
|
67
|
+
date: string;
|
|
68
|
+
followers: number;
|
|
69
|
+
}>;
|
|
70
|
+
updatedAt?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* What `social pull` writes. The native posts, comments and insights are left out (undefined) when
|
|
74
|
+
* the Appeeky API does not have them yet, so the files from an earlier pull are kept.
|
|
75
|
+
*/
|
|
76
|
+
export interface SocialData {
|
|
77
|
+
accounts: SocialAccount[];
|
|
78
|
+
posts: SocialPost[];
|
|
79
|
+
nativePosts?: NativePost[];
|
|
80
|
+
comments?: SocialComment[];
|
|
81
|
+
insights?: AccountInsights[];
|
|
82
|
+
warnings?: string[];
|
|
83
|
+
}
|
|
30
84
|
export interface SocialPost {
|
|
31
85
|
id: string;
|
|
32
86
|
status: string;
|
|
@@ -57,35 +111,179 @@ interface PostRow {
|
|
|
57
111
|
platform_post_url: string | null;
|
|
58
112
|
published_at: string | null;
|
|
59
113
|
error_message: string | null;
|
|
114
|
+
is_draft?: boolean | null;
|
|
60
115
|
}>;
|
|
61
116
|
}
|
|
117
|
+
interface ExternalPostRow {
|
|
118
|
+
id: string;
|
|
119
|
+
accountId: string;
|
|
120
|
+
platform: string;
|
|
121
|
+
platformPostId?: string | null;
|
|
122
|
+
platformPostUrl?: string | null;
|
|
123
|
+
content?: string | null;
|
|
124
|
+
thumbnailUrl?: string | null;
|
|
125
|
+
mediaType?: string | null;
|
|
126
|
+
publishedAt?: string | null;
|
|
127
|
+
metrics?: Record<string, unknown> | null;
|
|
128
|
+
}
|
|
129
|
+
interface CommentRow {
|
|
130
|
+
id: string;
|
|
131
|
+
accountId: string;
|
|
132
|
+
platform: string;
|
|
133
|
+
postId?: string | null;
|
|
134
|
+
platformPostId?: string | null;
|
|
135
|
+
postPermalink?: string | null;
|
|
136
|
+
text?: string | null;
|
|
137
|
+
author?: {
|
|
138
|
+
id?: string | null;
|
|
139
|
+
username?: string | null;
|
|
140
|
+
name?: string | null;
|
|
141
|
+
} | null;
|
|
142
|
+
isOwnAccount?: boolean | null;
|
|
143
|
+
isReply?: boolean | null;
|
|
144
|
+
parentCommentId?: string | null;
|
|
145
|
+
commentedAt?: string | null;
|
|
146
|
+
}
|
|
147
|
+
interface InsightsRow {
|
|
148
|
+
accountId: string;
|
|
149
|
+
platform: string;
|
|
150
|
+
followers?: number | null;
|
|
151
|
+
growth?: number | null;
|
|
152
|
+
growthPercentage?: number | null;
|
|
153
|
+
stats?: Record<string, unknown> | null;
|
|
154
|
+
history?: Array<{
|
|
155
|
+
date: string;
|
|
156
|
+
followers: number;
|
|
157
|
+
}> | null;
|
|
158
|
+
updatedAt?: string | null;
|
|
159
|
+
}
|
|
62
160
|
interface AnalyticsItem {
|
|
63
161
|
platform: string;
|
|
64
162
|
analytics: Record<string, unknown>;
|
|
65
163
|
}
|
|
66
164
|
export declare function toAccount(r: AccountRow): SocialAccount;
|
|
67
165
|
export declare function toPost(r: PostRow, analytics?: AnalyticsItem[]): SocialPost;
|
|
68
|
-
|
|
166
|
+
export declare function toNativePost(r: ExternalPostRow, accounts: SocialAccount[]): NativePost;
|
|
167
|
+
export declare function toComment(r: CommentRow, accounts: SocialAccount[]): SocialComment;
|
|
168
|
+
export declare function toInsights(r: InsightsRow, account: SocialAccount): AccountInsights;
|
|
169
|
+
/**
|
|
170
|
+
* Connected accounts and the latest posts made through Appeeky, with analytics for the ones that
|
|
171
|
+
* went out; then, per account, the posts made in the platform's app, recent comments and followers.
|
|
172
|
+
*/
|
|
69
173
|
export declare function fetchSocial(api: AppeekyApi, options?: {
|
|
70
174
|
limit?: number;
|
|
71
|
-
}): Promise<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}>;
|
|
75
|
-
export declare function summaryMarkdown(accounts: SocialAccount[], posts: SocialPost[], now?: Date): string;
|
|
76
|
-
export declare function saveSocial(root: string, data: {
|
|
77
|
-
accounts: SocialAccount[];
|
|
78
|
-
posts: SocialPost[];
|
|
79
|
-
}, now?: Date): Promise<void>;
|
|
175
|
+
}): Promise<SocialData>;
|
|
176
|
+
export declare function summaryMarkdown(accounts: SocialAccount[], posts: SocialPost[], now?: Date, more?: Pick<SocialData, "nativePosts" | "comments" | "insights">): string;
|
|
177
|
+
export declare function saveSocial(root: string, data: SocialData, now?: Date): Promise<void>;
|
|
80
178
|
export declare function readAccounts(root: string): Promise<SocialAccount[]>;
|
|
179
|
+
/** TikTok's posting options, in the words a draft uses; each maps to a key of `extra.tiktok` in the API. */
|
|
180
|
+
export declare const PRIVACY: {
|
|
181
|
+
readonly public: "PUBLIC_TO_EVERYONE";
|
|
182
|
+
readonly friends: "MUTUAL_FOLLOW_FRIENDS";
|
|
183
|
+
readonly followers: "FOLLOWER_OF_CREATOR";
|
|
184
|
+
readonly only_me: "SELF_ONLY";
|
|
185
|
+
};
|
|
186
|
+
export declare const DISCLOSURE: {
|
|
187
|
+
readonly none: "none";
|
|
188
|
+
readonly own_brand: "brand_organic";
|
|
189
|
+
readonly paid_partnership: "brand_content";
|
|
190
|
+
};
|
|
191
|
+
export declare const TIKTOK_MAX_PHOTOS = 35;
|
|
192
|
+
export declare const TIKTOK_TITLE_LIMIT = 90;
|
|
193
|
+
declare const tiktokSchema: z.ZodObject<{
|
|
194
|
+
/** Who can see it: public (default), friends, followers or only_me. */
|
|
195
|
+
privacy: z.ZodOptional<z.ZodEnum<["followers" | "public" | "friends" | "only_me", ...("followers" | "public" | "friends" | "only_me")[]]>>;
|
|
196
|
+
/** Commercial content: none (default), own_brand (promotes your own app or business) or paid_partnership. */
|
|
197
|
+
disclosure: z.ZodOptional<z.ZodEnum<["none" | "own_brand" | "paid_partnership", ...("none" | "own_brand" | "paid_partnership")[]]>>;
|
|
198
|
+
/** Upload to the creator's TikTok inbox instead of posting: they finish and post it in the app. */
|
|
199
|
+
inbox_draft: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
/** Photo posts: let TikTok add music. */
|
|
201
|
+
auto_music: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
+
/** Allow comments (default true). */
|
|
203
|
+
comments: z.ZodOptional<z.ZodBoolean>;
|
|
204
|
+
/** Photo posts: the title; the text becomes the description. */
|
|
205
|
+
title: z.ZodOptional<z.ZodString>;
|
|
206
|
+
/** Photo posts: which image is the cover, from 0. */
|
|
207
|
+
cover_index: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
/** Video posts: the frame used as the cover, in milliseconds. */
|
|
209
|
+
cover_time_ms: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
/** Video posts: an https image used as the cover. */
|
|
211
|
+
cover_image_url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
212
|
+
}, "strict", z.ZodTypeAny, {
|
|
213
|
+
title?: string | undefined;
|
|
214
|
+
comments?: boolean | undefined;
|
|
215
|
+
privacy?: "followers" | "public" | "friends" | "only_me" | undefined;
|
|
216
|
+
disclosure?: "none" | "own_brand" | "paid_partnership" | undefined;
|
|
217
|
+
inbox_draft?: boolean | undefined;
|
|
218
|
+
auto_music?: boolean | undefined;
|
|
219
|
+
cover_index?: number | undefined;
|
|
220
|
+
cover_time_ms?: number | undefined;
|
|
221
|
+
cover_image_url?: string | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
title?: string | undefined;
|
|
224
|
+
comments?: boolean | undefined;
|
|
225
|
+
privacy?: "followers" | "public" | "friends" | "only_me" | undefined;
|
|
226
|
+
disclosure?: "none" | "own_brand" | "paid_partnership" | undefined;
|
|
227
|
+
inbox_draft?: boolean | undefined;
|
|
228
|
+
auto_music?: boolean | undefined;
|
|
229
|
+
cover_index?: number | undefined;
|
|
230
|
+
cover_time_ms?: number | undefined;
|
|
231
|
+
cover_image_url?: string | undefined;
|
|
232
|
+
}>;
|
|
233
|
+
export type TikTokOptions = z.infer<typeof tiktokSchema>;
|
|
81
234
|
export declare const draftSchema: z.ZodObject<{
|
|
82
|
-
/**
|
|
235
|
+
/**
|
|
236
|
+
* Who it goes to: a platform with one connected account (`twitter`), every account on a
|
|
237
|
+
* platform (`tiktok:all`), a handle (`@sleepysounds`, `tiktok:@sleepysounds`, `u/name`) or an
|
|
238
|
+
* account id from accounts.yaml.
|
|
239
|
+
*/
|
|
83
240
|
accounts: z.ZodArray<z.ZodString, "many">;
|
|
84
241
|
text: z.ZodString;
|
|
85
242
|
/** ISO time to schedule it; without it, the post goes out when it is sent. */
|
|
86
243
|
when: z.ZodOptional<z.ZodString>;
|
|
87
244
|
/** Public image or video URLs. Instagram, TikTok and Pinterest need one. */
|
|
88
245
|
media: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
246
|
+
/** TikTok's options for the TikTok accounts it goes to. */
|
|
247
|
+
tiktok: z.ZodOptional<z.ZodObject<{
|
|
248
|
+
/** Who can see it: public (default), friends, followers or only_me. */
|
|
249
|
+
privacy: z.ZodOptional<z.ZodEnum<["followers" | "public" | "friends" | "only_me", ...("followers" | "public" | "friends" | "only_me")[]]>>;
|
|
250
|
+
/** Commercial content: none (default), own_brand (promotes your own app or business) or paid_partnership. */
|
|
251
|
+
disclosure: z.ZodOptional<z.ZodEnum<["none" | "own_brand" | "paid_partnership", ...("none" | "own_brand" | "paid_partnership")[]]>>;
|
|
252
|
+
/** Upload to the creator's TikTok inbox instead of posting: they finish and post it in the app. */
|
|
253
|
+
inbox_draft: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
/** Photo posts: let TikTok add music. */
|
|
255
|
+
auto_music: z.ZodOptional<z.ZodBoolean>;
|
|
256
|
+
/** Allow comments (default true). */
|
|
257
|
+
comments: z.ZodOptional<z.ZodBoolean>;
|
|
258
|
+
/** Photo posts: the title; the text becomes the description. */
|
|
259
|
+
title: z.ZodOptional<z.ZodString>;
|
|
260
|
+
/** Photo posts: which image is the cover, from 0. */
|
|
261
|
+
cover_index: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
/** Video posts: the frame used as the cover, in milliseconds. */
|
|
263
|
+
cover_time_ms: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
/** Video posts: an https image used as the cover. */
|
|
265
|
+
cover_image_url: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
266
|
+
}, "strict", z.ZodTypeAny, {
|
|
267
|
+
title?: string | undefined;
|
|
268
|
+
comments?: boolean | undefined;
|
|
269
|
+
privacy?: "followers" | "public" | "friends" | "only_me" | undefined;
|
|
270
|
+
disclosure?: "none" | "own_brand" | "paid_partnership" | undefined;
|
|
271
|
+
inbox_draft?: boolean | undefined;
|
|
272
|
+
auto_music?: boolean | undefined;
|
|
273
|
+
cover_index?: number | undefined;
|
|
274
|
+
cover_time_ms?: number | undefined;
|
|
275
|
+
cover_image_url?: string | undefined;
|
|
276
|
+
}, {
|
|
277
|
+
title?: string | undefined;
|
|
278
|
+
comments?: boolean | undefined;
|
|
279
|
+
privacy?: "followers" | "public" | "friends" | "only_me" | undefined;
|
|
280
|
+
disclosure?: "none" | "own_brand" | "paid_partnership" | undefined;
|
|
281
|
+
inbox_draft?: boolean | undefined;
|
|
282
|
+
auto_music?: boolean | undefined;
|
|
283
|
+
cover_index?: number | undefined;
|
|
284
|
+
cover_time_ms?: number | undefined;
|
|
285
|
+
cover_image_url?: string | undefined;
|
|
286
|
+
}>>;
|
|
89
287
|
/** Why this post, for whoever reviews the pull request. */
|
|
90
288
|
why: z.ZodOptional<z.ZodString>;
|
|
91
289
|
status: z.ZodDefault<z.ZodEnum<["draft", "sent"]>>;
|
|
@@ -95,6 +293,17 @@ export declare const draftSchema: z.ZodObject<{
|
|
|
95
293
|
status: "draft" | "sent";
|
|
96
294
|
accounts: string[];
|
|
97
295
|
text: string;
|
|
296
|
+
tiktok?: {
|
|
297
|
+
title?: string | undefined;
|
|
298
|
+
comments?: boolean | undefined;
|
|
299
|
+
privacy?: "followers" | "public" | "friends" | "only_me" | undefined;
|
|
300
|
+
disclosure?: "none" | "own_brand" | "paid_partnership" | undefined;
|
|
301
|
+
inbox_draft?: boolean | undefined;
|
|
302
|
+
auto_music?: boolean | undefined;
|
|
303
|
+
cover_index?: number | undefined;
|
|
304
|
+
cover_time_ms?: number | undefined;
|
|
305
|
+
cover_image_url?: string | undefined;
|
|
306
|
+
} | undefined;
|
|
98
307
|
when?: string | undefined;
|
|
99
308
|
media?: string[] | undefined;
|
|
100
309
|
why?: string | undefined;
|
|
@@ -104,6 +313,17 @@ export declare const draftSchema: z.ZodObject<{
|
|
|
104
313
|
accounts: string[];
|
|
105
314
|
text: string;
|
|
106
315
|
status?: "draft" | "sent" | undefined;
|
|
316
|
+
tiktok?: {
|
|
317
|
+
title?: string | undefined;
|
|
318
|
+
comments?: boolean | undefined;
|
|
319
|
+
privacy?: "followers" | "public" | "friends" | "only_me" | undefined;
|
|
320
|
+
disclosure?: "none" | "own_brand" | "paid_partnership" | undefined;
|
|
321
|
+
inbox_draft?: boolean | undefined;
|
|
322
|
+
auto_music?: boolean | undefined;
|
|
323
|
+
cover_index?: number | undefined;
|
|
324
|
+
cover_time_ms?: number | undefined;
|
|
325
|
+
cover_image_url?: string | undefined;
|
|
326
|
+
} | undefined;
|
|
107
327
|
when?: string | undefined;
|
|
108
328
|
media?: string[] | undefined;
|
|
109
329
|
why?: string | undefined;
|
|
@@ -116,12 +336,28 @@ export declare const TEXT_LIMIT: Record<string, number>;
|
|
|
116
336
|
export declare function readDrafts(root: string): Promise<Array<Draft & {
|
|
117
337
|
file: string;
|
|
118
338
|
}>>;
|
|
119
|
-
/** The
|
|
120
|
-
export declare function
|
|
339
|
+
/** The handles an account answers to: its name, and any @handle or u/name inside it ("Appeeky (@appeeky)"). */
|
|
340
|
+
export declare function accountHandles(a: SocialAccount): string[];
|
|
341
|
+
/** How an account is named in messages: its @handle or u/name when it has one. */
|
|
342
|
+
export declare const accountLabel: (a: SocialAccount) => string;
|
|
343
|
+
export interface Resolved {
|
|
121
344
|
accounts: SocialAccount[];
|
|
122
345
|
missing: string[];
|
|
123
|
-
|
|
346
|
+
/** Platform names that match more than one connected account, with the handles to pick from. */
|
|
347
|
+
ambiguous: Array<{
|
|
348
|
+
ref: string;
|
|
349
|
+
platform: string;
|
|
350
|
+
choices: string[];
|
|
351
|
+
}>;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* The connected accounts a draft goes to. A platform name is only enough when one account is
|
|
355
|
+
* connected on it; with several, the draft names one by handle or says `<platform>:all`.
|
|
356
|
+
*/
|
|
357
|
+
export declare function resolveAccounts(draft: Pick<Draft, "accounts">, accounts: SocialAccount[]): Resolved;
|
|
124
358
|
export declare function draftIssues(draft: Draft, accounts: SocialAccount[], now?: Date): string[];
|
|
359
|
+
/** A draft's `tiktok:` block as the API's `extra.tiktok`. */
|
|
360
|
+
export declare function tiktokExtra(t: TikTokOptions): Record<string, unknown>;
|
|
125
361
|
/** Create the post in Appeeky (it publishes now, or at `when`) and mark the draft sent. */
|
|
126
362
|
export declare function sendDraft(api: AppeekyApi, draft: Draft & {
|
|
127
363
|
file: string;
|