@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
package/README.md
CHANGED
|
@@ -24,13 +24,10 @@ Prompting doctrine that applies to more than one model lives **once**, in `skill
|
|
|
24
24
|
|
|
25
25
|
## Portable Prompt Builder export
|
|
26
26
|
|
|
27
|
-
The downloadable Claude `.skill` is
|
|
27
|
+
The downloadable Claude `.skill` is built into `exports/slates-prompt-builder/generated/`, which is gitignored and outside this package's `files`: its model, character and content-policy references are license-tier guides from the private brain (`slates-api/brain/`), so they never enter this public repo or the npm tarball. Its routing table derives from `MODEL_FACTS`; the portable wrapper (`prompt-builder.md`) owns only export-specific scope and output behavior.
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
npm run sync-prompt-builder #
|
|
31
|
-
npm run typecheck # fails if the committed export is stale
|
|
30
|
+
npm run sync-prompt-builder # build the markdown, manifest and deterministic .skill into generated/, and sync the vault mirror
|
|
32
31
|
```
|
|
33
32
|
|
|
34
|
-
`scripts/build-prompt-builder.mjs --check`
|
|
35
|
-
|
|
36
|
-
The repository verification workflow runs both typecheck and build on every pull request and push to `main`, so stale exports cannot merge through the normal GitHub path.
|
|
33
|
+
`scripts/build-prompt-builder.mjs --check` (in build and typecheck) renders the export in memory, keeps the archive byte-exact, verifies its entry set and the runtime character contract (one sheet, the canonical `IDENTITY_PLATE_HEX`, flat/shadowless light, the three-panel builder), and fails if `generated/` could publish: tracked, not ignored, or in `files`. `scripts/brain-leak-check.mjs` (root build) fails on any tracked file holding a 90-character line of the brain. The download is served from the private slates-web repo (`public/slates-prompt-builder.skill`): refresh it by copying the built `.skill` there.
|
|
@@ -29,7 +29,7 @@ export type AnalyticsKind =
|
|
|
29
29
|
| 'account'
|
|
30
30
|
/** Offers, leads and codes from the offer machine. */
|
|
31
31
|
| 'offer'
|
|
32
|
-
/** A
|
|
32
|
+
/** A failure worth counting, on the server or in the app. */
|
|
33
33
|
| 'ops';
|
|
34
34
|
export interface AnalyticsEvent {
|
|
35
35
|
readonly name: string;
|
package/dist/analytics/events.js
CHANGED
|
@@ -128,6 +128,13 @@ export const ANALYTICS_EVENTS = [
|
|
|
128
128
|
{ name: 'account_email_reverted', senders: API, kind: 'account', what: 'An email change undone' },
|
|
129
129
|
{ name: 'refund_processed', senders: API, kind: 'account', what: 'A refund taken back what its payment granted' },
|
|
130
130
|
{ name: 'dispute_opened', senders: API, kind: 'account', what: 'A chargeback opened' },
|
|
131
|
+
// ── Failures (second-brain plans/2026-10-25-slates-bug-capture.md): crashes as `$exception`, and the failures that throw nothing ──
|
|
132
|
+
{ name: '$exception', senders: [...APP, ...API], kind: 'ops', what: 'An error: posthog-js exception capture in the app, captureException in main and slates-api', library: true },
|
|
133
|
+
{ name: 'generation_failed', senders: APP, kind: 'ops', what: 'A generation turned failed: its model, error class and provider status, never the prompt' },
|
|
134
|
+
{ name: 'export_failed', senders: APP, kind: 'ops', what: 'An MP4 or XML export failed, by error class' },
|
|
135
|
+
{ name: 'agent_op_failed', senders: APP, kind: 'ops', what: "An outside agent's /agent request answered 500, or a Studio Agent tool call threw" },
|
|
136
|
+
{ name: 'action_retried', senders: APP, kind: 'ops', what: 'One action (same target, same input) failed three times inside ten minutes' },
|
|
137
|
+
{ name: 'session_ended_after_error', senders: APP, kind: 'ops', what: 'The app quit within a minute of one of the failures above' },
|
|
131
138
|
];
|
|
132
139
|
const BY_NAME = new Map(ANALYTICS_EVENTS.map((e) => [e.name, e]));
|
|
133
140
|
if (BY_NAME.size !== ANALYTICS_EVENTS.length) {
|
package/dist/auth.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export declare class MissingDesktopServerError extends Error {
|
|
|
35
35
|
code: string;
|
|
36
36
|
constructor();
|
|
37
37
|
}
|
|
38
|
+
/** A short hash of a bearer token, so a file can name which login wrote it without holding the token. */
|
|
39
|
+
export declare function tokenHash(token: string | null | undefined): string | null;
|
|
38
40
|
export declare function requireCloudToken(): string;
|
|
39
41
|
export declare function requireDesktop(): {
|
|
40
42
|
port: number;
|
package/dist/auth.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import { homedir } from 'node:os';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, } from 'node:fs';
|
|
@@ -68,6 +69,10 @@ export class MissingDesktopServerError extends Error {
|
|
|
68
69
|
super('Slates desktop is not running with its local server on. Open Slates → Settings → AI tools and connect (Send link, or Connect without the email link).');
|
|
69
70
|
}
|
|
70
71
|
}
|
|
72
|
+
/** A short hash of a bearer token, so a file can name which login wrote it without holding the token. */
|
|
73
|
+
export function tokenHash(token) {
|
|
74
|
+
return token ? createHash('sha256').update(token).digest('hex').slice(0, 16) : null;
|
|
75
|
+
}
|
|
71
76
|
export function requireCloudToken() {
|
|
72
77
|
const c = readConnection();
|
|
73
78
|
if (!c.cloud.token)
|
package/dist/clients/cloud.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare class SlatesCloudClient {
|
|
|
7
7
|
private readonly token;
|
|
8
8
|
private readonly baseUrl;
|
|
9
9
|
constructor(token?: string, baseUrl?: string);
|
|
10
|
+
/** A hash of the token this client sends: the served brain's cache names the login it fetched with by it. */
|
|
11
|
+
get credentialKey(): string | null;
|
|
10
12
|
get<T>(path: string): Promise<T>;
|
|
11
13
|
post<T>(path: string, body: unknown): Promise<T>;
|
|
12
14
|
/** Name the op's own path in the failure — "fetch failed" tells nobody which
|
package/dist/clients/cloud.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { requireCloudToken } from '../auth.js';
|
|
1
|
+
import { requireCloudToken, tokenHash } from '../auth.js';
|
|
2
2
|
import { SLATES_API_URL } from '../api-url.js';
|
|
3
3
|
const FALLBACK_CLOUD_BASE_URL = SLATES_API_URL;
|
|
4
4
|
// The slates_sk_ bearer is attached to every cloud request. SLATES_CLOUD_BASE_URL
|
|
@@ -55,6 +55,10 @@ export class SlatesCloudClient {
|
|
|
55
55
|
this.token = token;
|
|
56
56
|
this.baseUrl = baseUrl;
|
|
57
57
|
}
|
|
58
|
+
/** A hash of the token this client sends: the served brain's cache names the login it fetched with by it. */
|
|
59
|
+
get credentialKey() {
|
|
60
|
+
return tokenHash(this.token);
|
|
61
|
+
}
|
|
58
62
|
async get(path) {
|
|
59
63
|
const res = await this.fetchOrFriendly(path, `${this.baseUrl}${path}`, {
|
|
60
64
|
headers: { Authorization: `Bearer ${this.token}` },
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
export * from './auth.js';
|
|
2
2
|
export { SlatesCloudClient, type SlatesUserInfo, type CreditsBalance, type ModelRegistryResponse } from './clients/cloud.js';
|
|
3
3
|
export { SlatesDesktopClient, type DesktopHealth } from './clients/desktop.js';
|
|
4
|
-
export { SKILLS } from './skills/content.js';
|
|
4
|
+
export { BRAIN_SHAPE, SKILLS } from './skills/content.js';
|
|
5
|
+
export { BRAIN_CACHE, brainFiles, clearServedBrain, refreshServedBrain, servedBrain, useBrainSource, type LockedGuide, type ServedBrain } from './skills/served.js';
|
|
6
|
+
export { myBrainProblems, type BrainShape, type MyBrainProblem } from './skills/brain-check.js';
|
|
5
7
|
export { parseSkillMetadata, type SkillMetadata } from './skills/metadata.js';
|
|
8
|
+
export { ARCHIVE_AFTER_DAYS, archiveUnused, archiveUnusedDaily, brainSkills, loadMyBrain, myBrainDir, myBrainPreload, noteUsed, MY_BRAIN_PRELOAD_CHARS, type Brain } from './skills/my-brain.js';
|
|
6
9
|
export * as operations from './operations/index.js';
|
|
7
10
|
export { ALL_OPERATIONS, VIDEO_MODELS, AUDIO_MODELS, IMAGE_MODELS, defaultContext, OperationCancelledError, type Operation, type OperationContext, type OperationResult, type OperationAnnotations, type OperationTier, type OperationGroup } from './operations/index.js';
|
|
8
11
|
export { CONFIRM_CREDITS, DEVIATION_FACTOR, WORKING_METHOD_TOPIC } from './operations/index.js';
|
|
9
12
|
export { toolDefinitions, toolDefinition, groupFor, tierFor, OPERATION_GROUPS, GROUP_SUMMARY, STARTUP_TOOL_IDS, type ToolDefinition, } from './operations/index.js';
|
|
10
13
|
export { MODEL_FACTS, getModelFact, multimodalRefSummary, multimodalRefModels, describeRouting, SEEDANCE_TASK_INTENT_WORDS, seedanceTaskIntentWords, type ModelFact, } from './prompts/model-facts.js';
|
|
11
14
|
export { MODEL_CAPABILITIES, ALL_ASPECT_RATIOS, AGENT_ROUTE_PROVIDER, getModelCapability, aspectRatiosFor, videoResolutionsFor, defaultVideoResolutionFor, durationsFor, durationValuesFor, aspectRatioUnion, videoResolutionUnion, durationBounds, checkAspectRatio, checkVideoResolution, checkDuration, describeAspectRatios, describeVideoResolutions, describeDurations, describeReferenceImageCaps, type AspectRatio, type VideoResolution, type ModelCapability, type DurationCapability, type VideoResolutionCapability, } from './prompts/model-capabilities.js';
|
|
12
|
-
export { buildAgentDoctrine, buildMcpInstructions, type AgentSurface } from './prompts/agent-doctrine.js';
|
|
15
|
+
export { buildAgentDoctrine, buildMcpInstructions, ROUTER_NOTICE, type AgentSurface } from './prompts/agent-doctrine.js';
|
|
16
|
+
export { BRAIN_ROUTER, DIRECTOR_CARD, MY_BRAIN_TOPIC, PLAYBOOKS } from './prompts/brain.js';
|
|
13
17
|
export { BANNED_PROMPT_TOKENS, describeBannedTokens, findBannedTokens, bannedTokenWarning, refusableBannedTokens, bannedTokensForSkill, describeBannedTokensForSkill, type BannedToken, type BannedTokenScope, type BannedTokenCondition, } from './prompts/banned-tokens.js';
|
|
14
|
-
export { CRAFT_CARDS, CRAFT_CARD_CEILING, craftCard, describeCraftCard } from './prompts/craft-cards.js';
|
|
18
|
+
export { CRAFT_CARDS, CRAFT_CARD_CEILING, craftCard, craftCardOf, describeCraftCard, oversizedCraftCards } from './prompts/craft-cards.js';
|
|
15
19
|
export { PROMPTING_TIPS, getPromptingTips, type PromptingTipsEntry, type PromptingTipCard, type PromptingTipsKey } from './prompts/prompting-tips.js';
|
|
16
20
|
export { SLATES_API_URL } from './api-url.js';
|
|
17
21
|
export { APP_MANUAL, appManualIndex, appManualSections, manualReader } from './manual/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export * from './auth.js';
|
|
2
2
|
export { SlatesCloudClient } from './clients/cloud.js';
|
|
3
3
|
export { SlatesDesktopClient } from './clients/desktop.js';
|
|
4
|
-
export { SKILLS } from './skills/content.js';
|
|
4
|
+
export { BRAIN_SHAPE, SKILLS } from './skills/content.js';
|
|
5
|
+
export { BRAIN_CACHE, brainFiles, clearServedBrain, refreshServedBrain, servedBrain, useBrainSource } from './skills/served.js';
|
|
6
|
+
export { myBrainProblems } from './skills/brain-check.js';
|
|
5
7
|
export { parseSkillMetadata } from './skills/metadata.js';
|
|
8
|
+
export { ARCHIVE_AFTER_DAYS, archiveUnused, archiveUnusedDaily, brainSkills, loadMyBrain, myBrainDir, myBrainPreload, noteUsed, MY_BRAIN_PRELOAD_CHARS } from './skills/my-brain.js';
|
|
6
9
|
export * as operations from './operations/index.js';
|
|
7
10
|
export { ALL_OPERATIONS, VIDEO_MODELS, AUDIO_MODELS, IMAGE_MODELS, defaultContext, OperationCancelledError } from './operations/index.js';
|
|
8
11
|
// The spend thresholds the DESKTOP and the SKILLS both quote. `CONFIRM_CREDITS`
|
|
@@ -44,7 +47,8 @@ export { MODEL_CAPABILITIES, ALL_ASPECT_RATIOS, AGENT_ROUTE_PROVIDER, getModelCa
|
|
|
44
47
|
// stay off the public surface — an export nothing calls is an export nothing
|
|
45
48
|
// keeps honest, which is why `buildModelRouting` was deleted rather than left
|
|
46
49
|
// here "in case".
|
|
47
|
-
export { buildAgentDoctrine, buildMcpInstructions } from './prompts/agent-doctrine.js';
|
|
50
|
+
export { buildAgentDoctrine, buildMcpInstructions, ROUTER_NOTICE } from './prompts/agent-doctrine.js';
|
|
51
|
+
export { BRAIN_ROUTER, DIRECTOR_CARD, MY_BRAIN_TOPIC, PLAYBOOKS } from './prompts/brain.js';
|
|
48
52
|
// Banned prompt tokens — EXTRACTED from the skills' own never-use lists and
|
|
49
53
|
// inlined into the generate ops' descriptions. Enforcement of "load the guide"
|
|
50
54
|
// that the model cannot skip, because a description is always in context.
|
|
@@ -63,7 +67,7 @@ bannedTokensForSkill, describeBannedTokensForSkill, } from './prompts/banned-tok
|
|
|
63
67
|
// own `@card` blocks and delivered on the estimate result. The eval scorer reads
|
|
64
68
|
// CRAFT_CARDS to build its lever vocabulary, so the assertion can never be
|
|
65
69
|
// scored against a hand-retyped word list.
|
|
66
|
-
export { CRAFT_CARDS, CRAFT_CARD_CEILING, craftCard, describeCraftCard } from './prompts/craft-cards.js';
|
|
70
|
+
export { CRAFT_CARDS, CRAFT_CARD_CEILING, craftCard, craftCardOf, describeCraftCard, oversizedCraftCards } from './prompts/craft-cards.js';
|
|
67
71
|
// Per-model prompting tips — the SSOT for the desktop "See prompting tips"
|
|
68
72
|
// modals. The desktop renders these; it never hand-writes tips content.
|
|
69
73
|
export { PROMPTING_TIPS, getPromptingTips } from './prompts/prompting-tips.js';
|