@slatesvideo/shared 0.7.7 → 0.7.8
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 +3 -6
- package/dist/analytics/events.d.ts +1 -1
- package/dist/analytics/events.js +7 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +5 -0
- package/dist/clients/cloud.d.ts +2 -0
- package/dist/clients/cloud.js +5 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -3
- package/dist/manual/content.d.ts +1 -1
- package/dist/manual/content.js +1 -1
- package/dist/operations/index.d.ts +587 -161
- package/dist/operations/index.js +663 -57
- package/dist/operations/surface.d.ts +2 -2
- package/dist/operations/surface.js +18 -5
- package/dist/prompts/agent-doctrine.d.ts +12 -2
- package/dist/prompts/agent-doctrine.js +56 -28
- package/dist/prompts/banned-tokens.js +23 -13
- package/dist/prompts/brain.d.ts +29 -0
- package/dist/prompts/brain.js +72 -0
- package/dist/prompts/craft-cards.d.ts +15 -4
- package/dist/prompts/craft-cards.js +71 -9
- package/dist/prompts/generation-policy.d.ts +1 -1
- package/dist/prompts/guide-discovery.d.ts +6 -6
- package/dist/prompts/guide-retrieval.d.ts +7 -1
- package/dist/prompts/guide-retrieval.js +33 -5
- package/dist/prompts/partials.generated.js +1 -13
- package/dist/prompts/shot-grammar.d.ts +1 -1
- package/dist/prompts/shot-grammar.js +1 -1
- package/dist/skills/brain-check.d.ts +44 -0
- package/dist/skills/brain-check.js +172 -0
- package/dist/skills/content.d.ts +3 -0
- package/dist/skills/content.js +81 -44
- package/dist/skills/hyperframes-content.js +4 -4
- package/dist/skills/my-brain.d.ts +52 -0
- package/dist/skills/my-brain.js +218 -0
- package/dist/skills/served.d.ts +52 -0
- package/dist/skills/served.js +202 -0
- package/package.json +2 -4
- package/skills/hyperframes/NOTICE +19 -3
- package/skills/hyperframes/SLATES-MAPPING.md +1 -1
- package/skills/hyperframes/embedded-captions/CATALOG.md +3 -0
- package/skills/hyperframes/embedded-captions/SKILL.md +6 -6
- package/skills/hyperframes/embedded-captions/assets/fonts/char-widths.json +227 -1
- package/skills/hyperframes/embedded-captions/modes/standard/fonts/build-fonts-css.cjs +19 -2
- package/skills/hyperframes/embedded-captions/modes/standard/fonts/files/archivo-latin-wdth-italic.woff2 +0 -0
- package/skills/hyperframes/embedded-captions/modes/standard/fonts/files/archivo-latin-wdth-normal.woff2 +0 -0
- package/skills/hyperframes/embedded-captions/scripts/make-theme.cjs +438 -3
- package/skills/hyperframes/embedded-captions/scripts/make-theme.test.mjs +1 -0
- package/skills/hyperframes/embedded-captions/themes/README.md +26 -1
- package/skills/hyperframes/embedded-captions/themes/lesson.json +31 -0
- package/skills/slates-start-here.md +78 -0
- package/exports/slates-chatgpt-images/generated/SKILL.md +0 -113
- package/exports/slates-chatgpt-images/generated/slates-chatgpt-images.skill +0 -0
- package/exports/slates-prompt-builder/generated/SKILL.md +0 -71
- package/exports/slates-prompt-builder/generated/reference-character.md +0 -92
- package/exports/slates-prompt-builder/generated/reference-content-policy.md +0 -81
- package/exports/slates-prompt-builder/generated/reference-gpt-image-2-5.md +0 -191
- package/exports/slates-prompt-builder/generated/reference-kling.md +0 -295
- package/exports/slates-prompt-builder/generated/reference-nano-banana.md +0 -240
- package/exports/slates-prompt-builder/generated/reference-omni-flash.md +0 -97
- package/exports/slates-prompt-builder/generated/reference-seedance-2-5.md +0 -392
- package/exports/slates-prompt-builder/generated/reference-seedance.md +0 -441
- package/exports/slates-prompt-builder/generated/slates-prompt-builder-manifest.json +0 -133
- package/exports/slates-prompt-builder/generated/slates-prompt-builder.skill +0 -0
- package/skills/_partials/blender-action-curves.md +0 -24
- package/skills/_partials/cinematic-card.md +0 -8
- package/skills/_partials/decision-log.md +0 -1
- package/skills/_partials/image-defaults.md +0 -9
- package/skills/_partials/iteration-diagnosis.md +0 -5
- package/skills/_partials/living-performance.md +0 -22
- package/skills/_partials/model-routing.md +0 -35
- package/skills/_partials/references-read-literally.md +0 -11
- package/skills/_partials/seedance-25-timestamps.md +0 -34
- package/skills/_partials/sheet-tool-defaults.md +0 -6
- package/skills/_partials/still-gate.md +0 -3
- package/skills/_partials/thresholds.md +0 -19
- package/skills/slates-blocking-to-prompt.md +0 -279
- package/skills/slates-camera-language.md +0 -234
- package/skills/slates-captions.md +0 -81
- package/skills/slates-character-identity.md +0 -117
- package/skills/slates-chatgpt-images.md +0 -113
- package/skills/slates-cinematic-look.md +0 -237
- package/skills/slates-content-policy.md +0 -88
- package/skills/slates-cost-discipline.md +0 -150
- package/skills/slates-cuts.md +0 -46
- package/skills/slates-dialogue-blocking.md +0 -134
- package/skills/slates-direct-response-ad.md +0 -26
- package/skills/slates-edit-and-iterate.md +0 -76
- package/skills/slates-layer-brand-captions.md +0 -87
- package/skills/slates-layer-lower-third.md +0 -85
- package/skills/slates-layer-title.md +0 -82
- package/skills/slates-model-selection.md +0 -129
- package/skills/slates-motion.md +0 -57
- package/skills/slates-one-prompt-film.md +0 -38
- package/skills/slates-previs-blocking.md +0 -186
- package/skills/slates-project-organization.md +0 -42
- package/skills/slates-prompting-elevenlabs.md +0 -128
- package/skills/slates-prompting-flux-3.md +0 -157
- package/skills/slates-prompting-gpt-image-2-5.md +0 -196
- package/skills/slates-prompting-inworld-tts.md +0 -174
- package/skills/slates-prompting-kling-v3.md +0 -303
- package/skills/slates-prompting-lip-sync.md +0 -216
- package/skills/slates-prompting-ltx-2-5.md +0 -245
- package/skills/slates-prompting-minimax-h3.md +0 -383
- package/skills/slates-prompting-motion-transfer.md +0 -202
- package/skills/slates-prompting-nano-banana-2-1.md +0 -250
- package/skills/slates-prompting-omni-flash.md +0 -117
- package/skills/slates-prompting-seed-audio.md +0 -168
- package/skills/slates-prompting-seedance-2-5.md +0 -420
- package/skills/slates-prompting-seedance.md +0 -462
- package/skills/slates-prompting-seedream-5-lite.md +0 -122
- package/skills/slates-prompting-wan-3.md +0 -143
- package/skills/slates-restyle-from-blocking.md +0 -121
- package/skills/slates-script-craft.md +0 -45
- package/skills/slates-shot-variety.md +0 -24
- package/skills/slates-storyboard-from-script.md +0 -32
- package/skills/slates-style-prompting.md +0 -56
- package/skills/slates-transitions.md +0 -40
- package/skills/slates-ugc-influencer-ad.md +0 -32
- package/skills/slates-vision-feedback-loop.md +0 -118
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare function myBrainDir(): string;
|
|
2
|
+
export interface Brain {
|
|
3
|
+
/** The bundled skills with the user's files laid over them: a same-name file over the shared guide, a new name as itself. */
|
|
4
|
+
skills: Readonly<Record<string, string>>;
|
|
5
|
+
/** Names served from the user's folder, the ones laid over a shared guide included. */
|
|
6
|
+
mine: ReadonlySet<string>;
|
|
7
|
+
/** Files that were not loaded, each with why. */
|
|
8
|
+
skipped: ReadonlyArray<{
|
|
9
|
+
file: string;
|
|
10
|
+
reason: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The user's files, read fresh on each call (a handful of small files; an edit applies at once). A file loads only
|
|
15
|
+
* when it passes the shape (brain-check.ts), the profile checked first so the folder's cap never drops it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadMyBrain(dir?: string): {
|
|
18
|
+
files: Record<string, string>;
|
|
19
|
+
skipped: Array<{
|
|
20
|
+
file: string;
|
|
21
|
+
reason: string;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
24
|
+
/** The whole brain this user's agents read: bundled, then theirs on top (over a shared guide of the same name). */
|
|
25
|
+
export declare function brainSkills(dir?: string): Brain;
|
|
26
|
+
/** About 3,000 tokens (plan § My brain): what an agent reads of the user's brain before the router. */
|
|
27
|
+
export declare const MY_BRAIN_PRELOAD_CHARS = 12000;
|
|
28
|
+
/** The user's profile, by this name, leads the preload whole. */
|
|
29
|
+
export declare const MY_BRAIN_PROFILE = "profile";
|
|
30
|
+
/**
|
|
31
|
+
* What an agent reads of the user's brain before the router: the profile, then one line per other file
|
|
32
|
+
* (its operative summary's first bullet, else its description), cut at MY_BRAIN_PRELOAD_CHARS. Empty when
|
|
33
|
+
* the folder holds nothing. Director puts it in its system prompt; the MCP server sends it with the router
|
|
34
|
+
* on a connection's first result. Each file itself is served whole by name.
|
|
35
|
+
*/
|
|
36
|
+
export declare function myBrainPreload(dir?: string): string;
|
|
37
|
+
export declare const ARCHIVE_AFTER_DAYS = 60;
|
|
38
|
+
/** Record that an agent loaded one of the user's files. Never throws: the date is housekeeping, serving the guide matters more. */
|
|
39
|
+
export declare function noteUsed(name: string, dir?: string, now?: Date): void;
|
|
40
|
+
/**
|
|
41
|
+
* Move every file unused for ARCHIVE_AFTER_DAYS into archive/, whole. A file's last use is the later of its last
|
|
42
|
+
* load and its last edit, so an edit counts as use. Nothing moves while the usage record is unreadable. Returns
|
|
43
|
+
* the names moved.
|
|
44
|
+
*/
|
|
45
|
+
export declare function archiveUnused(dir?: string, now?: Date): string[];
|
|
46
|
+
/**
|
|
47
|
+
* archiveUnused at most once a day, for a surface to call as it starts (the MCP server does): a server starts with
|
|
48
|
+
* every client session, and a sweep of the folder per session is waste. Never throws, so a bad folder never stops a
|
|
49
|
+
* server starting; a run that fails still counts, so a broken folder is not retried on every start.
|
|
50
|
+
*/
|
|
51
|
+
export declare function archiveUnusedDaily(dir?: string, now?: Date): string[];
|
|
52
|
+
//# sourceMappingURL=my-brain.d.ts.map
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// MY BRAIN: the user's own layer of the brain (second-brain
|
|
3
|
+
// plans/2026-10-25-slates-brain.md § My brain).
|
|
4
|
+
//
|
|
5
|
+
// Markdown files in the bundled skills' shape (frontmatter, then an
|
|
6
|
+
// operative summary), in one folder on the user's machine. The loader reads
|
|
7
|
+
// it as a second root beside the bundled SKILLS: a file named like a bundled
|
|
8
|
+
// skill adds to it for this user (their file first, as the rules that win where
|
|
9
|
+
// they differ, then the shared guide, so a later fix to the shared guide still
|
|
10
|
+
// reaches them: prompts/brain.ts, overlayGuide), a new name adds one. Nothing
|
|
11
|
+
// here leaves the machine.
|
|
12
|
+
//
|
|
13
|
+
// The folder is ~/.slates/my-brain (SLATES_MY_BRAIN_DIR overrides it), beside
|
|
14
|
+
// the connection file every surface on the machine already reads, so the MCP
|
|
15
|
+
// server, the CLI and the desktop's Director see the same brain.
|
|
16
|
+
//
|
|
17
|
+
// What goes unused leaves (§ Keeping it from turning into chaos, rule 8): each
|
|
18
|
+
// file's last use is kept in .usage.json beside it, and archiveUnused moves a
|
|
19
|
+
// file nothing has loaded in 60 days into archive/, whole, its sources with it.
|
|
20
|
+
// The app's idle consolidation (plan step 5) calls it; nothing here deletes.
|
|
21
|
+
//
|
|
22
|
+
// The router is never replaced: it is the shared brain's front door and its
|
|
23
|
+
// job list is Eric's call (§ Keeping it from turning into chaos). Every load
|
|
24
|
+
// holds the files to the shape (brain-check.ts: a summary, the caps in
|
|
25
|
+
// scripts/brain-shape.json caps.mine, one home per lesson), the same code
|
|
26
|
+
// scripts/brain-lint.mjs runs on this folder (`--root <dir> --mine`), which
|
|
27
|
+
// adds the summary's exact shape and a source on every block.
|
|
28
|
+
// ============================================================
|
|
29
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
|
|
30
|
+
import { join } from 'node:path';
|
|
31
|
+
import { AGENT_DIR } from '../auth.js';
|
|
32
|
+
import { BRAIN_ROUTER, MY_BRAIN_TOPIC, ROUTER_ALIASES, overlayGuide } from '../prompts/brain.js';
|
|
33
|
+
import { myBrainProblems } from './brain-check.js';
|
|
34
|
+
import { BRAIN_SHAPE } from './content.js';
|
|
35
|
+
import { brainFiles } from './served.js';
|
|
36
|
+
import { parseSkillMetadata } from './metadata.js';
|
|
37
|
+
/** The shared brain's front door, every name that opens it, and the topic that serves this folder: no local file takes one. */
|
|
38
|
+
const RESERVED = new Set([BRAIN_ROUTER, ...ROUTER_ALIASES, MY_BRAIN_TOPIC]);
|
|
39
|
+
/** A file past this is not a lesson; it is skipped and named. */
|
|
40
|
+
const MAX_FILE_BYTES = 64 * 1024;
|
|
41
|
+
const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
42
|
+
export function myBrainDir() {
|
|
43
|
+
return process.env.SLATES_MY_BRAIN_DIR || join(AGENT_DIR, 'my-brain');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The user's files, read fresh on each call (a handful of small files; an edit applies at once). A file loads only
|
|
47
|
+
* when it passes the shape (brain-check.ts), the profile checked first so the folder's cap never drops it.
|
|
48
|
+
*/
|
|
49
|
+
export function loadMyBrain(dir = myBrainDir()) {
|
|
50
|
+
const files = {};
|
|
51
|
+
const skipped = [];
|
|
52
|
+
if (!existsSync(dir))
|
|
53
|
+
return { files, skipped };
|
|
54
|
+
let names;
|
|
55
|
+
try {
|
|
56
|
+
names = readdirSync(dir).filter((f) => f.endsWith('.md')).sort();
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
// A folder that cannot be read (a file in its place, no permission) leaves the shared brain working.
|
|
60
|
+
skipped.push({ file: dir, reason: `the folder could not be read: ${error instanceof Error ? error.message : String(error)}` });
|
|
61
|
+
return { files, skipped };
|
|
62
|
+
}
|
|
63
|
+
for (const file of names) {
|
|
64
|
+
const name = file.slice(0, -3);
|
|
65
|
+
const path = join(dir, file);
|
|
66
|
+
try {
|
|
67
|
+
if (!NAME_RE.test(name))
|
|
68
|
+
throw new Error('the name must be lowercase words joined by hyphens');
|
|
69
|
+
if (RESERVED.has(name))
|
|
70
|
+
throw new Error(name === MY_BRAIN_TOPIC ? 'the name is the topic that serves this folder' : 'the router belongs to the shared brain');
|
|
71
|
+
if (statSync(path).size > MAX_FILE_BYTES)
|
|
72
|
+
throw new Error(`over ${MAX_FILE_BYTES / 1024} KB`);
|
|
73
|
+
const body = readFileSync(path, 'utf8');
|
|
74
|
+
parseSkillMetadata(body, name);
|
|
75
|
+
files[name] = body;
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
skipped.push({ file, reason: error instanceof Error ? error.message : String(error) });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const order = Object.keys(files).sort((a, b) => Number(b === MY_BRAIN_PROFILE) - Number(a === MY_BRAIN_PROFILE));
|
|
82
|
+
for (const { name, reason } of myBrainProblems(files, { shape: BRAIN_SHAPE, bundled: brainFiles(), order })) {
|
|
83
|
+
delete files[name];
|
|
84
|
+
skipped.push({ file: `${name}.md`, reason });
|
|
85
|
+
}
|
|
86
|
+
return { files, skipped };
|
|
87
|
+
}
|
|
88
|
+
/** The whole brain this user's agents read: bundled, then theirs on top (over a shared guide of the same name). */
|
|
89
|
+
export function brainSkills(dir = myBrainDir()) {
|
|
90
|
+
const { files, skipped } = loadMyBrain(dir);
|
|
91
|
+
// The shared brain: the public card and router, then the files the account's tier opens (skills/served.ts).
|
|
92
|
+
const shared = brainFiles();
|
|
93
|
+
const own = Object.fromEntries(Object.entries(files).map(([name, text]) => [name, Object.hasOwn(shared, name) ? overlayGuide(text, shared[name]) : text]));
|
|
94
|
+
return { skills: { ...shared, ...own }, mine: new Set(Object.keys(files)), skipped };
|
|
95
|
+
}
|
|
96
|
+
/** About 3,000 tokens (plan § My brain): what an agent reads of the user's brain before the router. */
|
|
97
|
+
export const MY_BRAIN_PRELOAD_CHARS = 12_000;
|
|
98
|
+
/** The user's profile, by this name, leads the preload whole. */
|
|
99
|
+
export const MY_BRAIN_PROFILE = 'profile';
|
|
100
|
+
/**
|
|
101
|
+
* What an agent reads of the user's brain before the router: the profile, then one line per other file
|
|
102
|
+
* (its operative summary's first bullet, else its description), cut at MY_BRAIN_PRELOAD_CHARS. Empty when
|
|
103
|
+
* the folder holds nothing. Director puts it in its system prompt; the MCP server sends it with the router
|
|
104
|
+
* on a connection's first result. Each file itself is served whole by name.
|
|
105
|
+
*/
|
|
106
|
+
export function myBrainPreload(dir = myBrainDir()) {
|
|
107
|
+
const { files, skipped } = loadMyBrain(dir);
|
|
108
|
+
const names = Object.keys(files);
|
|
109
|
+
// A file that did not load is named, so the user hears why their rule is not being followed.
|
|
110
|
+
const notLoaded = skipped.length ? ['', 'Not loaded from their brain (tell them, so they can fix it):', ...skipped.map((s) => `- ${s.file}: ${s.reason}`)] : [];
|
|
111
|
+
if (!names.length)
|
|
112
|
+
return notLoaded.length ? ["The user's own brain (My brain) has files that did not load.", ...notLoaded].join('\n') : '';
|
|
113
|
+
const body = (name) => files[name].replace(/^?---\r?\n[\s\S]*?\r?\n---\r?\n/, '').replace(/<!--[\s\S]*?-->/g, '').trim();
|
|
114
|
+
const line = (name) => {
|
|
115
|
+
const summary = /<!--\s*@operative:start\s*-->([\s\S]*?)<!--\s*@operative:end\s*-->/.exec(files[name])?.[1];
|
|
116
|
+
const first = summary?.split('\n').map((l) => l.replace(/^\s*-\s*/, '').trim()).find((l) => l && !/^\*\*Operative summary/.test(l));
|
|
117
|
+
return `- \`${name}\`${Object.hasOwn(brainFiles(), name) ? ' (adds to the shared guide of this name, and wins where they differ)' : ''}: ${first ?? parseSkillMetadata(files[name], name).description}`;
|
|
118
|
+
};
|
|
119
|
+
// The profile is read whole here, so this is its use; the files below are only named, and date themselves when served.
|
|
120
|
+
if (names.includes(MY_BRAIN_PROFILE))
|
|
121
|
+
noteUsed(MY_BRAIN_PROFILE, dir);
|
|
122
|
+
const parts = [
|
|
123
|
+
"The user's own brain (My brain): their rules and presets, which win over the shared brain where they differ. Read a file whole with slates_get_prompting_guide (topic: its name) when the job touches it.",
|
|
124
|
+
...(names.includes(MY_BRAIN_PROFILE) ? ['', `Their profile:\n${body(MY_BRAIN_PROFILE)}`] : []),
|
|
125
|
+
...(names.some((n) => n !== MY_BRAIN_PROFILE) ? ['', 'Their files:', ...names.filter((n) => n !== MY_BRAIN_PROFILE).map(line)] : []),
|
|
126
|
+
...notLoaded,
|
|
127
|
+
];
|
|
128
|
+
const text = parts.join('\n');
|
|
129
|
+
return text.length <= MY_BRAIN_PRELOAD_CHARS ? text : `${text.slice(0, MY_BRAIN_PRELOAD_CHARS)}\n[cut at about 3,000 tokens; ask for a file by name]`;
|
|
130
|
+
}
|
|
131
|
+
const USAGE_FILE = '.usage.json';
|
|
132
|
+
export const ARCHIVE_AFTER_DAYS = 60;
|
|
133
|
+
function readUsage(dir) {
|
|
134
|
+
try {
|
|
135
|
+
return JSON.parse(readFileSync(join(dir, USAGE_FILE), 'utf8'));
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
// No file yet is an empty record; a file that will not parse is unknown, and nothing archives on it.
|
|
139
|
+
return error?.code === 'ENOENT' ? {} : null;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/** Record that an agent loaded one of the user's files. Never throws: the date is housekeeping, serving the guide matters more. */
|
|
143
|
+
export function noteUsed(name, dir = myBrainDir(), now = new Date()) {
|
|
144
|
+
try {
|
|
145
|
+
const usage = readUsage(dir);
|
|
146
|
+
if (!usage)
|
|
147
|
+
return;
|
|
148
|
+
usage[name] = now.toISOString();
|
|
149
|
+
// Written aside and renamed in, so a surface reading at the same moment never sees half a file.
|
|
150
|
+
const temp = join(dir, `${USAGE_FILE}.${process.pid}.tmp`);
|
|
151
|
+
writeFileSync(temp, JSON.stringify(usage, null, 2));
|
|
152
|
+
renameSync(temp, join(dir, USAGE_FILE));
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
// A read-only folder keeps no dates; archiveUnused then goes by each file's last edit.
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Move every file unused for ARCHIVE_AFTER_DAYS into archive/, whole. A file's last use is the later of its last
|
|
160
|
+
* load and its last edit, so an edit counts as use. Nothing moves while the usage record is unreadable. Returns
|
|
161
|
+
* the names moved.
|
|
162
|
+
*/
|
|
163
|
+
export function archiveUnused(dir = myBrainDir(), now = new Date()) {
|
|
164
|
+
if (!existsSync(dir))
|
|
165
|
+
return [];
|
|
166
|
+
const usage = readUsage(dir);
|
|
167
|
+
if (!usage)
|
|
168
|
+
return [];
|
|
169
|
+
const cutoff = now.getTime() - ARCHIVE_AFTER_DAYS * 24 * 60 * 60 * 1000;
|
|
170
|
+
const moved = [];
|
|
171
|
+
for (const file of readdirSync(dir).filter((f) => f.endsWith('.md'))) {
|
|
172
|
+
const name = file.slice(0, -3);
|
|
173
|
+
const loaded = Date.parse(usage[name] ?? '');
|
|
174
|
+
const last = Math.max(Number.isFinite(loaded) ? loaded : 0, statSync(join(dir, file)).mtimeMs);
|
|
175
|
+
if (last >= cutoff)
|
|
176
|
+
continue;
|
|
177
|
+
mkdirSync(join(dir, 'archive'), { recursive: true });
|
|
178
|
+
// An earlier archived copy of the same name is kept: the newer one takes a dated name beside it.
|
|
179
|
+
const target = existsSync(join(dir, 'archive', file)) ? `${name}.${now.toISOString().slice(0, 10)}.md` : file;
|
|
180
|
+
renameSync(join(dir, file), join(dir, 'archive', target));
|
|
181
|
+
moved.push(name);
|
|
182
|
+
}
|
|
183
|
+
return moved;
|
|
184
|
+
}
|
|
185
|
+
/** When archiveUnused last ran from a surface's start, beside the usage record so it travels with the folder. */
|
|
186
|
+
const ARCHIVE_RUN_FILE = '.archive-run';
|
|
187
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
188
|
+
/**
|
|
189
|
+
* archiveUnused at most once a day, for a surface to call as it starts (the MCP server does): a server starts with
|
|
190
|
+
* every client session, and a sweep of the folder per session is waste. Never throws, so a bad folder never stops a
|
|
191
|
+
* server starting; a run that fails still counts, so a broken folder is not retried on every start.
|
|
192
|
+
*/
|
|
193
|
+
export function archiveUnusedDaily(dir = myBrainDir(), now = new Date()) {
|
|
194
|
+
try {
|
|
195
|
+
if (!existsSync(dir))
|
|
196
|
+
return [];
|
|
197
|
+
const runFile = join(dir, ARCHIVE_RUN_FILE);
|
|
198
|
+
let last = Number.NaN;
|
|
199
|
+
try {
|
|
200
|
+
last = Date.parse(readFileSync(runFile, 'utf8').trim());
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
// No record yet: run now.
|
|
204
|
+
}
|
|
205
|
+
if (Number.isFinite(last) && now.getTime() - last < DAY_MS && last <= now.getTime())
|
|
206
|
+
return [];
|
|
207
|
+
try {
|
|
208
|
+
return archiveUnused(dir, now);
|
|
209
|
+
}
|
|
210
|
+
finally {
|
|
211
|
+
writeFileSync(runFile, now.toISOString());
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
return [];
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=my-brain.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface LockedGuide {
|
|
2
|
+
name: string;
|
|
3
|
+
/** The tier that opens it: `license` or `bump`. */
|
|
4
|
+
tier: string;
|
|
5
|
+
description: string;
|
|
6
|
+
/** What the agent tells the user about it, in the server's words (slates-api lib/brain.ts lockedNotice). */
|
|
7
|
+
notice?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ServedBrain {
|
|
10
|
+
/** slates-api's approved version (`<commit>.<hash>`); null from a folder or with nothing. */
|
|
11
|
+
version: string | null;
|
|
12
|
+
/** The tiers the account opens. */
|
|
13
|
+
tiers: readonly string[];
|
|
14
|
+
/** Name → markdown, every file the tiers open. */
|
|
15
|
+
files: Readonly<Record<string, string>>;
|
|
16
|
+
/** Files past the account's tiers, by name and description only. */
|
|
17
|
+
locked: readonly LockedGuide[];
|
|
18
|
+
source: 'dir' | 'server' | 'cache' | 'none';
|
|
19
|
+
/** The account it was served to (slates-api user id); null from a folder or with nothing. */
|
|
20
|
+
account?: string | null;
|
|
21
|
+
/** Why the last refresh did not reach the server, for the guide op to say. */
|
|
22
|
+
problem?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const BRAIN_CACHE: string;
|
|
25
|
+
/** The brain this process holds now. */
|
|
26
|
+
export declare function servedBrain(): ServedBrain;
|
|
27
|
+
/** Every skill an agent can read here: the public card and router, then the served brain. */
|
|
28
|
+
export declare function brainFiles(): Readonly<Record<string, string>>;
|
|
29
|
+
interface CloudGet {
|
|
30
|
+
get<T>(path: string): Promise<T>;
|
|
31
|
+
/** The hash of the credential it sends (SlatesCloudClient); without one, the CLI login's is assumed. */
|
|
32
|
+
readonly credentialKey?: string | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Bring the brain up to the account's tiers and the approved version, one request in flight and at most every
|
|
36
|
+
* REFRESH_EVERY_MS unless forced. A failure keeps what is held (the cache works offline) and records why; a folder
|
|
37
|
+
* source never refreshes.
|
|
38
|
+
*/
|
|
39
|
+
export declare function refreshServedBrain(cloud: () => CloudGet, { force }?: {
|
|
40
|
+
force?: boolean | undefined;
|
|
41
|
+
}): Promise<ServedBrain>;
|
|
42
|
+
/**
|
|
43
|
+
* Signing out: drop the served brain in this process, and the cache when the login signing out received it. The
|
|
44
|
+
* cache has two writers. `slates logout` passes 'cli', before its token goes, and deletes a cache that login
|
|
45
|
+
* received. The desktop app (the default, which the published desktop already calls) deletes any cache the CLI
|
|
46
|
+
* login did not receive: its own, and one written before 2026-10-25, tagged with the CLI token's hash or none.
|
|
47
|
+
*/
|
|
48
|
+
export declare function clearServedBrain(signingOut?: 'cli' | 'desktop'): void;
|
|
49
|
+
/** Point this process at a folder of brain files (or back to the cache) without a restart: tests and evals. */
|
|
50
|
+
export declare function useBrainSource(dir?: string): ServedBrain;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=served.d.ts.map
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// The Slates brain's deep layers, served by slates-api by the account's tier (second-brain
|
|
2
|
+
// plans/2026-10-25-slates-brain.md step 4). This public package carries only the Director card and the router
|
|
3
|
+
// (`slates-start-here`, SKILLS); every playbook, rule and model guide lives in the private slates-api `brain/` and
|
|
4
|
+
// reaches an agent from the account it is connected with (slates-api src/lib/brain.ts says who reads which).
|
|
5
|
+
//
|
|
6
|
+
// Where this process gets them:
|
|
7
|
+
// SLATES_BRAIN_DIR a folder of brain files with every tier open: builds, evals and checks. Never set on a
|
|
8
|
+
// user's machine. When set it is the only source; nothing refreshes it.
|
|
9
|
+
// BRAIN_CACHE otherwise, the last bundle this machine received (by this login, or by the desktop app when
|
|
10
|
+
// there is no login here), read at load so a cold or offline start has the brain.
|
|
11
|
+
// the server GET /brain (version, tiers, account), then /brain/bundle when any changed, through the
|
|
12
|
+
// connected account; it replaces what the cache gave and is written back to BRAIN_CACHE.
|
|
13
|
+
// refreshServedBrain runs it at server start and before a guide answer, at most every
|
|
14
|
+
// REFRESH_EVERY_MS. A 401 or 403 drops what that credential was served, here and in the
|
|
15
|
+
// cache it wrote; a cache another login wrote stays (the desktop app's, which a
|
|
16
|
+
// desktop-connected server goes on serving). Signing out does the same (clearServedBrain).
|
|
17
|
+
// With none of them, only the card and the router are here, and the guide op says why.
|
|
18
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
import { AGENT_DIR, readConnection, tokenHash } from '../auth.js';
|
|
21
|
+
import { SKILLS } from './content.js';
|
|
22
|
+
export const BRAIN_CACHE = join(AGENT_DIR, 'brain-cache.json');
|
|
23
|
+
const REFRESH_TIMEOUT_MS = 5_000;
|
|
24
|
+
const REFRESH_EVERY_MS = 10 * 60_000;
|
|
25
|
+
const EMPTY = { version: null, tiers: [], files: {}, locked: [], source: 'none' };
|
|
26
|
+
function fromDir(dir) {
|
|
27
|
+
const files = {};
|
|
28
|
+
for (const f of readdirSync(dir).filter((f) => f.endsWith('.md')).sort())
|
|
29
|
+
files[f.slice(0, -3)] = readFileSync(join(dir, f), 'utf8');
|
|
30
|
+
return { version: null, tiers: ['license', 'bump'], files, locked: [], source: 'dir' };
|
|
31
|
+
}
|
|
32
|
+
/** This machine's CLI login (`slates login`), as the hash a cache it received carries. */
|
|
33
|
+
function cliKey() {
|
|
34
|
+
return tokenHash(readConnection().cloud.token);
|
|
35
|
+
}
|
|
36
|
+
/** The desktop app's local server is in the connection file, so the cache it writes is its signed-in account's. */
|
|
37
|
+
function desktopConnected() {
|
|
38
|
+
const { desktop } = readConnection();
|
|
39
|
+
return desktop.enabled && !!desktop.port && !!desktop.token;
|
|
40
|
+
}
|
|
41
|
+
function fromCache() {
|
|
42
|
+
try {
|
|
43
|
+
const c = JSON.parse(readFileSync(BRAIN_CACHE, 'utf8'));
|
|
44
|
+
if (typeof c.version !== 'string' || !c.files || typeof c.files !== 'object')
|
|
45
|
+
return null;
|
|
46
|
+
return { version: c.version, tiers: c.tiers ?? [], files: c.files, locked: c.locked ?? [], source: 'cache', account: c.account ?? null, token: c.token ?? null };
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The cache this process may serve before the server answers. With no cloud token here (an MCP server the desktop
|
|
54
|
+
* connected, which has only the desktop's port and token), it is the brain the desktop app last received for its
|
|
55
|
+
* signed-in account on this machine. With one, only a cache that login received: another login's waits, as `held`,
|
|
56
|
+
* until the server names the same account.
|
|
57
|
+
*/
|
|
58
|
+
function startingCache() {
|
|
59
|
+
const cached = fromCache();
|
|
60
|
+
if (!cached)
|
|
61
|
+
return { state: EMPTY, held: null };
|
|
62
|
+
const key = cliKey();
|
|
63
|
+
return !key || cached.token === key ? { state: cached, held: null } : { state: EMPTY, held: cached };
|
|
64
|
+
}
|
|
65
|
+
let state = EMPTY;
|
|
66
|
+
let held = null;
|
|
67
|
+
if (process.env.SLATES_BRAIN_DIR)
|
|
68
|
+
state = fromDir(process.env.SLATES_BRAIN_DIR);
|
|
69
|
+
else
|
|
70
|
+
({ state, held } = startingCache());
|
|
71
|
+
let checkedAt = 0;
|
|
72
|
+
let inflight;
|
|
73
|
+
/** The brain this process holds now. */
|
|
74
|
+
export function servedBrain() {
|
|
75
|
+
return state;
|
|
76
|
+
}
|
|
77
|
+
/** Every skill an agent can read here: the public card and router, then the served brain. */
|
|
78
|
+
export function brainFiles() {
|
|
79
|
+
return state.files === EMPTY.files ? SKILLS : { ...SKILLS, ...state.files };
|
|
80
|
+
}
|
|
81
|
+
/** Write what this process holds to BRAIN_CACHE, tagged with the credential that fetched it. */
|
|
82
|
+
function writeCache(key) {
|
|
83
|
+
const tmp = `${BRAIN_CACHE}.tmp`;
|
|
84
|
+
try {
|
|
85
|
+
mkdirSync(AGENT_DIR, { recursive: true });
|
|
86
|
+
writeFileSync(tmp, JSON.stringify({ ...state, token: key, fetchedAt: new Date().toISOString() }), { mode: 0o600 });
|
|
87
|
+
// Owner-only: the brain is the account's, not every user's on the machine. `mode` applies only when the file is
|
|
88
|
+
// created (a .tmp a crash left keeps its old mode), so it is set on every write. Windows has no POSIX modes;
|
|
89
|
+
// there the cache relies on the user-profile folder's ACL.
|
|
90
|
+
if (process.platform !== 'win32')
|
|
91
|
+
chmodSync(tmp, 0o600);
|
|
92
|
+
renameSync(tmp, BRAIN_CACHE);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
// A cache that cannot be written leaves this process served; the next start fetches again.
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Bring the brain up to the account's tiers and the approved version, one request in flight and at most every
|
|
100
|
+
* REFRESH_EVERY_MS unless forced. A failure keeps what is held (the cache works offline) and records why; a folder
|
|
101
|
+
* source never refreshes.
|
|
102
|
+
*/
|
|
103
|
+
export function refreshServedBrain(cloud, { force = false } = {}) {
|
|
104
|
+
if (state.source === 'dir')
|
|
105
|
+
return Promise.resolve(state);
|
|
106
|
+
if (!force && Date.now() - checkedAt < REFRESH_EVERY_MS)
|
|
107
|
+
return Promise.resolve(state);
|
|
108
|
+
inflight ??= (async () => {
|
|
109
|
+
let timer;
|
|
110
|
+
const timeout = (p) => Promise.race([p, new Promise((_, reject) => { timer = setTimeout(() => reject(new Error('the brain check timed out')), REFRESH_TIMEOUT_MS); })])
|
|
111
|
+
.finally(() => clearTimeout(timer));
|
|
112
|
+
let key = null;
|
|
113
|
+
try {
|
|
114
|
+
const client = cloud();
|
|
115
|
+
key = client.credentialKey ?? cliKey();
|
|
116
|
+
const index = await timeout(client.get('/brain'));
|
|
117
|
+
const same = (b) => index.version === b.version && index.tiers.join() === b.tiers.join() && (index.account ?? null) === (b.account ?? null);
|
|
118
|
+
if (held && same(held))
|
|
119
|
+
state = { ...held, source: 'server' };
|
|
120
|
+
held = null;
|
|
121
|
+
if (!same(state)) {
|
|
122
|
+
const bundle = await timeout(client.get('/brain/bundle'));
|
|
123
|
+
if (!bundle?.files || typeof bundle.files !== 'object')
|
|
124
|
+
throw new Error('the brain bundle was malformed');
|
|
125
|
+
state = { version: bundle.version, tiers: bundle.tiers, files: bundle.files, locked: bundle.locked ?? [], source: 'server', account: bundle.account ?? null };
|
|
126
|
+
writeCache(key);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
state = { ...state, source: 'server', problem: undefined };
|
|
130
|
+
// A cache another login's sign-out deleted under this process is written back, so a server the desktop
|
|
131
|
+
// connected finds the brain again without waiting for the next version.
|
|
132
|
+
if (!existsSync(BRAIN_CACHE))
|
|
133
|
+
writeCache(key);
|
|
134
|
+
}
|
|
135
|
+
checkedAt = Date.now();
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
// Offline or signed out: the held brain stands, and the next try waits a minute, not a full interval.
|
|
139
|
+
checkedAt = Date.now() - REFRESH_EVERY_MS + 60_000;
|
|
140
|
+
const code = error;
|
|
141
|
+
if (code.status === 401 || code.status === 403) {
|
|
142
|
+
// This credential is refused: what it was served goes, here and in the cache if it wrote it, and the
|
|
143
|
+
// minute's wait stands. A cache another login wrote stays on disk; when it is the desktop app's (not the CLI
|
|
144
|
+
// login's, with the desktop connected) this process serves it, as it does with no login here, so a revoked
|
|
145
|
+
// CLI key cannot take a signed-in desktop's brain from the agent.
|
|
146
|
+
state = EMPTY;
|
|
147
|
+
held = null;
|
|
148
|
+
const cached = fromCache();
|
|
149
|
+
if (cached && key && cached.token === key)
|
|
150
|
+
rmSync(BRAIN_CACHE, { force: true });
|
|
151
|
+
else if (cached && cached.token !== cliKey() && desktopConnected())
|
|
152
|
+
state = cached;
|
|
153
|
+
}
|
|
154
|
+
else if (code.code === 'CLOUD_TOKEN_MISSING') {
|
|
155
|
+
// No login here: the brain is the one the desktop app last received, which may be newer than this
|
|
156
|
+
// process's, and none once that cache is gone (`slates logout`, a desktop sign-out).
|
|
157
|
+
state = fromCache() ?? EMPTY;
|
|
158
|
+
}
|
|
159
|
+
state = {
|
|
160
|
+
...state,
|
|
161
|
+
problem: code.code === 'CLOUD_TOKEN_MISSING' ? 'not connected to a Slates account' : error instanceof Error ? error.message : String(error),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return state;
|
|
165
|
+
})().finally(() => {
|
|
166
|
+
// Cleared after the assignment: a refresh with nothing to await (no login, so `cloud()` throws at once) used to
|
|
167
|
+
// clear it inside the body, before `??=` stored the settled promise, and every later call got that first answer.
|
|
168
|
+
inflight = undefined;
|
|
169
|
+
});
|
|
170
|
+
return inflight;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Signing out: drop the served brain in this process, and the cache when the login signing out received it. The
|
|
174
|
+
* cache has two writers. `slates logout` passes 'cli', before its token goes, and deletes a cache that login
|
|
175
|
+
* received. The desktop app (the default, which the published desktop already calls) deletes any cache the CLI
|
|
176
|
+
* login did not receive: its own, and one written before 2026-10-25, tagged with the CLI token's hash or none.
|
|
177
|
+
*/
|
|
178
|
+
export function clearServedBrain(signingOut = 'desktop') {
|
|
179
|
+
if (state.source === 'dir')
|
|
180
|
+
return;
|
|
181
|
+
state = EMPTY;
|
|
182
|
+
held = null;
|
|
183
|
+
checkedAt = 0;
|
|
184
|
+
const cli = cliKey();
|
|
185
|
+
const cliReceived = !!cli && fromCache()?.token === cli;
|
|
186
|
+
if (cliReceived === (signingOut === 'cli'))
|
|
187
|
+
rmSync(BRAIN_CACHE, { force: true });
|
|
188
|
+
}
|
|
189
|
+
/** Point this process at a folder of brain files (or back to the cache) without a restart: tests and evals. */
|
|
190
|
+
export function useBrainSource(dir) {
|
|
191
|
+
if (dir) {
|
|
192
|
+
state = fromDir(dir);
|
|
193
|
+
held = null;
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
;
|
|
197
|
+
({ state, held } = startingCache());
|
|
198
|
+
}
|
|
199
|
+
checkedAt = 0;
|
|
200
|
+
return state;
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=served.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slatesvideo/shared",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"description": "Shared operations layer for the Slates MCP server and CLI: auth, cloud/desktop clients, and the single tool surface both consume. Most users want @slatesvideo/mcp-server or @slatesvideo/cli instead.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,6 @@
|
|
|
44
44
|
"dist",
|
|
45
45
|
"!dist/**/*.map",
|
|
46
46
|
"skills",
|
|
47
|
-
"exports/slates-prompt-builder/generated",
|
|
48
|
-
"exports/slates-chatgpt-images/generated",
|
|
49
47
|
"README.md"
|
|
50
48
|
],
|
|
51
49
|
"scripts": {
|
|
@@ -55,7 +53,7 @@
|
|
|
55
53
|
"build-chatgpt-skill": "node scripts/build-chatgpt-skill.mjs",
|
|
56
54
|
"build": "node scripts/build-chatgpt-skill.mjs --check && node scripts/sync-partials.mjs --check && node scripts/build-prompt-builder.mjs --check && node scripts/embed-skills.mjs && tsc && node scripts/render-capability-partials.mjs --check && node scripts/update-check-check.mjs",
|
|
57
55
|
"typecheck": "node scripts/sync-partials.mjs --check && node scripts/build-prompt-builder.mjs --check && node scripts/embed-skills.mjs && tsc --noEmit",
|
|
58
|
-
"prepublishOnly": "npm run build && node ../../scripts/cinematic-catalogue-check.mjs && node ../../scripts/prompt-control-check.mjs",
|
|
56
|
+
"prepublishOnly": "npm run build && node ../../scripts/brain-review.mjs --check && node ../../scripts/brain-lint.mjs --self-test && node ../../scripts/brain-eval/tokens.mjs && node ../../scripts/cinematic-catalogue-check.mjs && node ../../scripts/prompt-control-check.mjs",
|
|
59
57
|
"render-partials": "node scripts/render-capability-partials.mjs"
|
|
60
58
|
},
|
|
61
59
|
"repository": {
|
|
@@ -2,7 +2,7 @@ HyperFrames skills
|
|
|
2
2
|
Copyright 2026 HeyGen, Inc.
|
|
3
3
|
|
|
4
4
|
The 21 folders in this directory are the agent skills of HyperFrames, copied
|
|
5
|
-
|
|
5
|
+
from the HyperFrames repository:
|
|
6
6
|
|
|
7
7
|
Repository: https://github.com/heygen-com/hyperframes
|
|
8
8
|
Tag: v0.8.140
|
|
@@ -13,8 +13,24 @@ They are licensed under the Apache License, Version 2.0. The full license text
|
|
|
13
13
|
is in LICENSE-hyperframes beside this file, or at
|
|
14
14
|
http://www.apache.org/licenses/LICENSE-2.0.
|
|
15
15
|
|
|
16
|
-
Every file in those folders is byte for byte the file at that commit
|
|
17
|
-
|
|
16
|
+
Every file in those folders is byte for byte the file at that commit, except
|
|
17
|
+
the files listed below, which Slates changed or added (2026-10-24) to give the
|
|
18
|
+
embedded-captions skill a `lesson` caption identity:
|
|
19
|
+
|
|
20
|
+
embedded-captions/SKILL.md, CATALOG.md, themes/README.md (changed: the
|
|
21
|
+
identity documented and routed)
|
|
22
|
+
embedded-captions/scripts/make-theme.cjs, scripts/make-theme.test.mjs
|
|
23
|
+
(changed: the `stack` body paradigm and its test entry)
|
|
24
|
+
embedded-captions/modes/standard/fonts/build-fonts-css.cjs (changed:
|
|
25
|
+
variable-font faces)
|
|
26
|
+
embedded-captions/assets/fonts/char-widths.json (changed: the Archivo
|
|
27
|
+
italic measured)
|
|
28
|
+
embedded-captions/themes/lesson.json (added)
|
|
29
|
+
embedded-captions/modes/standard/fonts/files/archivo-latin-wdth-normal.woff2,
|
|
30
|
+
archivo-latin-wdth-italic.woff2 (added: SIL Open Font License fonts from
|
|
31
|
+
Fontsource)
|
|
32
|
+
|
|
33
|
+
Slates' other additions sit beside them and are not part
|
|
18
34
|
of HyperFrames: this NOTICE, LICENSE-hyperframes (the upstream LICENSE file,
|
|
19
35
|
renamed) and SLATES-MAPPING.md (how the commands and surfaces these skills name
|
|
20
36
|
map onto Slates).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# HyperFrames in Slates: what each command and Studio surface is here
|
|
2
2
|
|
|
3
|
-
The folders beside this file are HyperFrames' own skills, unmodified
|
|
3
|
+
The folders beside this file are HyperFrames' own skills, unmodified apart from the files `NOTICE` lists. They were
|
|
4
4
|
written for HyperFrames' CLI and its Studio, and they say `npx hyperframes <command>` and "the Studio
|
|
5
5
|
timeline" throughout. Inside Slates there is no HyperFrames project folder and no CLI to run: an HTML
|
|
6
6
|
clip is one HyperFrames composition (an HTML document with a GSAP timeline registered on
|
|
@@ -53,6 +53,7 @@ Routing procedure (replaces any mode decision):
|
|
|
53
53
|
| `brush` | washi paper-band rail + sumi-e brush-gesture apex | sumi-e study — a deckle-edged washi paper band swipes in behind a traveling brush-head shadow; body words are brush-WIPED on in a Mincho serif (clip reveal behind a per-word brush head, seeded ±1° tilt), emphasis gets a double curved ink underline, and spent lines are wiped OFF right-to-left like a wet cloth (erase brush head riding the wipe); the apex: a warm paper wash charges behind the subject and the hero word is written in ONE violent calligraphic gesture — pressure-tapered wet brush (four stacked stroke widths, blurred bleed underneath), start-SPLAT at the first pen contact with ink flecks kicking past the subject, spatter droplets ejected at the sharpest curves — then the ink BLEEDS into the paper through the hold (the work breathes) and a vermilion SEAL chop (観) stamps beside the ink with the plate punch | calm-authority explainers, craft / design / philosophy / Japan-adjacent content, tea / meditation / writing channels, elegant brand films, "水墨/毛笔/书法字幕" asks | mid/bright scene band (dark ink + its paper wash carry the contrast); needs `python3` (stroke-path gen) | theme.json → make-theme |
|
|
54
54
|
| `inkwater` | three-row ink rail + ink-drop bloom apex | sumi ink dropped in still water — paper-white radial washes back the text zones, Mincho-serif ink words BLEED into three fixed reading rows (blur+scale bleed over a paper-glow halo, dark blurred halo overshoots then tightens, an ink-settling hairline under each line, emphasis sheds a curling ink wisp) and spent lines re-dissolve upward like dispersing ink; the apex: a dark drop falls behind the subject, hits an invisible water surface at the word point and BLOOMS (three stacked blurred ink ellipses at counter-rotating rates + two thin ripple rings) while the world stills under a gentle vignette — the hero words resolve out of the blob on their own spoken times, breathe at the glyph edges through the hold, then re-dissolve before the next thought needs the reader | contemplative / literary / scientific-wonder narration, astronomy / nature / memory / essay films, poetry and slow-craft channels — one liquid meditative event instead of an impact, "水墨滴落/墨水字幕" asks | mid/bright scene band (dark ink + its paper washes carry the contrast) | theme.json → make-theme |
|
|
55
55
|
| `ransom` | cutout-chip collage rail + ransom-note slam apex | kidnapper's collage — every word is a chip clipped from a different page (cream Anton / black Inter / newsprint typewriter / accent-yellow marker, torn edges, hard offset shadows) PASTED crooked on the rail with misaligned baselines (the apex slam at low amplitude); emphasis words get a 1-frame RE-PASTE lift (shadow grows, rotation flips sign for good) and spent chips are RIPPED off one by one under 1-frame paper-tear flashes; the apex: a collage scrim darkens the sky and the hero word slams in letter by letter as a ransom note BEHIND the subject — each letter a different cutout chip, flight shadow popping tight on contact — the whole word JOLTS as the last letter lands (the plate punches with it), looms crooked through the hold, then is torn off chip by chip while the closing line speaks | true crime, mystery / thriller, heist energy, punk / DIY zine aesthetics, edgy drops, unhinged-comedy hooks, "勒索信/剪贴/拼贴字幕" asks | any (solid chip backgrounds carry their own contrast; the apex scrim guards bright skies) | theme.json → make-theme |
|
|
56
|
+
| `lesson` | two-tier spoken stacks beside the face + chapter card + quoted-prompt lower thirds | the prompt lesson, cloned from a proven tip-listicle ad: a small setup line over a payoff 1.84× its size in Archivo Black Italic at its narrowest, white caps with tight tracking and a soft shadow, placed shot by shot beside the speaker; nothing animates, every caption cuts on with its first word and off at the next stack or the cut. A chapter card (giant numeral, title over subtitle, outline bookmark) answers the save ask; each technique gets a lower third on its result shot, an orange number over the name in Archivo Black at its widest, the prompt quoted under it | educational and tip-listicle ads cut from many shots ("N things", prompt lessons, how-tos) — **where the quotable line must hold on screen** | multi-shot is the point: cuts are detected and every exit snaps to one; stacks are placed per shot (authored `{x, y, s, p}`, else from the matte) | theme.json (`chapter`, `items`) → make-theme |
|
|
56
57
|
|
|
57
58
|
## Shortlisting heuristics (identity-level, not category-level)
|
|
58
59
|
|
|
@@ -65,6 +66,8 @@ Routing procedure (replaces any mode decision):
|
|
|
65
66
|
every beat (`loud`).
|
|
66
67
|
- **Named worlds** → direct hits: 控制台/终端 → `terminal`; 霓虹/招牌 → `neonsign`;
|
|
67
68
|
诗/星尘/记忆 → `stardust`; 军事/重击 → `ordnance`; 预言/未来/悬念揭示 → `lastpage`;
|
|
69
|
+
- **A lesson, a tip list, "N things", a prompt the viewer should screenshot** → `lesson`
|
|
70
|
+
(the only identity built for a multi-shot edit: interview set plus demo inserts).
|
|
68
71
|
- **Scene constraints veto last**: luma > 180 kills cream/screen column looks
|
|
69
72
|
(→ `ink` or a rail/panel surface); dusk/dark unlocks `neon`/`neonsign`.
|
|
70
73
|
- **Unsure** → `anchor` (the conservative default: words read, scene safe, zero spectacle).
|