@slatesvideo/shared 0.7.21 → 0.7.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/events.js +4 -4
- package/dist/auth.d.ts +11 -11
- package/dist/auth.js +54 -18
- package/dist/clients/cloud.d.ts +1 -0
- package/dist/clients/cloud.js +4 -1
- package/dist/clients/desktop.d.ts +15 -0
- package/dist/clients/desktop.js +37 -12
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/manual/content.d.ts +1 -1
- package/dist/manual/content.js +1 -1
- package/dist/operations/index.d.ts +335 -230
- package/dist/operations/index.js +972 -457
- package/dist/operations/parse-input.d.ts +47 -0
- package/dist/operations/parse-input.js +100 -0
- package/dist/operations/surface.js +1 -0
- package/dist/prompts/banned-tokens.d.ts +2 -14
- package/dist/prompts/banned-tokens.js +5 -48
- package/dist/prompts/guide-bans.d.ts +16 -0
- package/dist/prompts/guide-bans.js +40 -0
- package/dist/prompts/model-capabilities.d.ts +149 -27
- package/dist/prompts/model-capabilities.js +307 -150
- package/dist/prompts/model-facts.d.ts +14 -0
- package/dist/prompts/model-facts.js +35 -23
- package/dist/prompts/prompting-tips.d.ts +1 -1
- package/dist/prompts/prompting-tips.js +49 -66
- package/dist/prompts/retired-models.d.ts +34 -0
- package/dist/prompts/retired-models.js +67 -0
- package/dist/prompts/shot-spec.d.ts +6 -1
- package/dist/prompts/shot-spec.js +12 -1
- package/dist/skills/content.js +2 -2
- package/dist/update-check.js +15 -6
- package/package.json +1 -1
package/dist/analytics/events.js
CHANGED
|
@@ -45,15 +45,12 @@ export const ANALYTICS_EVENTS = [
|
|
|
45
45
|
{ name: 'credit_boost_purchased', senders: API, kind: 'purchase', what: 'The credit boost upsell' },
|
|
46
46
|
{ name: 'credits_purchased', senders: API, kind: 'purchase', what: 'A credit pack bought on its own' },
|
|
47
47
|
{ name: 'vault_purchased', senders: API, kind: 'purchase', what: 'The legacy vault SKU (unrouted since 2026-07-09)' },
|
|
48
|
-
{ name: 'thumbs_purchased', senders: API, kind: 'purchase', what: 'A Thumbs purchase' },
|
|
49
|
-
{ name: 'thumbs_oto2_purchased', senders: API, kind: 'purchase', what: 'Thumbs as the /letsgo OTO2 (unrouted since 2026-07-09)' },
|
|
50
48
|
// ── Funnel ──
|
|
51
49
|
{ name: '$pageview', senders: WEB, kind: 'funnel', what: 'A page view, sent by hand on each route change' },
|
|
52
50
|
{ name: '$pageleave', senders: APP, kind: 'funnel', what: "posthog-js's own leave event in the app (capture_pageleave)", library: true },
|
|
53
51
|
{ name: 'view_content', senders: WEB, kind: 'funnel', what: 'A sales page seen; browser pixel and PostHog with one id' },
|
|
54
52
|
{ name: 'initiate_checkout', senders: WEB, kind: 'funnel', what: 'The checkout opened; browser pixel and PostHog with one id' },
|
|
55
53
|
{ name: 'checkout_started', senders: API, kind: 'funnel', what: "A checkout first learns the buyer's email: the lead post (lead_source) or the PaymentIntent attach (payment_intent_id), whichever comes first, once per email an hour; carries utm_*, ft_utm_* and lp_*" },
|
|
56
|
-
{ name: 'thumbs_checkout_started', senders: API, kind: 'funnel', what: 'A Thumbs checkout created' },
|
|
57
54
|
{ name: 'checkout_payment_intent_failed', senders: WEB, kind: 'funnel', what: 'The checkout could not create its PaymentIntent' },
|
|
58
55
|
{ name: 'headline_variant_shown', senders: WEB, kind: 'funnel', what: 'The sales page hero headline arm shown' },
|
|
59
56
|
{ name: 'funnel_step', senders: WEB, kind: 'funnel', what: 'An upsell or success page reached' },
|
|
@@ -127,9 +124,12 @@ export const ANALYTICS_EVENTS = [
|
|
|
127
124
|
{ 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 },
|
|
128
125
|
{ name: 'generation_failed', senders: APP, kind: 'ops', what: 'A generation turned failed: its model, error class and provider status, never the prompt' },
|
|
129
126
|
{ name: 'export_failed', senders: APP, kind: 'ops', what: 'An MP4 or XML export failed, by error class' },
|
|
130
|
-
{ name: 'agent_op_failed', senders: APP, kind: 'ops', what: "An outside agent's /agent request
|
|
127
|
+
{ name: 'agent_op_failed', senders: APP, kind: 'ops', what: "An outside agent's /agent request failed (reason: missing_id, unknown_id, invalid_input, auth, upstream or internal), or a Studio Agent tool call threw" },
|
|
131
128
|
{ name: 'action_retried', senders: APP, kind: 'ops', what: 'One action (same target, same input) failed three times inside ten minutes' },
|
|
132
129
|
{ name: 'session_ended_after_error', senders: APP, kind: 'ops', what: 'The app quit within a minute of one of the failures above' },
|
|
130
|
+
{ name: 'payment_checkout_input', senders: API, kind: 'ops', what: 'An expected checkout step such as incomplete card details, 3DS or a saved-card fallback' },
|
|
131
|
+
{ name: 'payment_report_unverified', senders: API, kind: 'ops', what: 'A browser reported an error without a verified recent unpaid intent' },
|
|
132
|
+
{ name: 'payment_failed', senders: API, kind: 'ops', what: 'A payment failed at any step (create, confirm, upsell, webhook, grant), on an anonymous distinct id: step, error_code, amount in minor units, currency, payment_intent_id; never card data or the email' },
|
|
133
133
|
];
|
|
134
134
|
const BY_NAME = new Map(ANALYTICS_EVENTS.map((e) => [e.name, e]));
|
|
135
135
|
if (BY_NAME.size !== ANALYTICS_EVENTS.length) {
|
package/dist/auth.d.ts
CHANGED
|
@@ -9,19 +9,9 @@ export interface AgentConnectionFile {
|
|
|
9
9
|
port: number | null;
|
|
10
10
|
token: string | null;
|
|
11
11
|
};
|
|
12
|
-
/**
|
|
13
|
-
* The project `slates use` selected, filled into any op that takes
|
|
14
|
-
* `projectId` and was called without one.
|
|
15
|
-
*
|
|
16
|
-
* 🚨 CLI-OWNED, AND ONLY A DEFAULT. The desktop app owns the `desktop` half
|
|
17
|
-
* of this file and must never write here; an explicit `--projectId` always
|
|
18
|
-
* wins. It exists because every workspace op takes a UUID and an agent had to
|
|
19
|
-
* carry that UUID through the whole session by hand — which is exactly the
|
|
20
|
-
* kind of state a shell session is bad at holding.
|
|
21
|
-
*/
|
|
22
|
-
defaultProjectId?: string | null;
|
|
23
12
|
}
|
|
24
13
|
export declare function readConnection(): AgentConnectionFile;
|
|
14
|
+
export declare const CLI_STATE_FILE: string;
|
|
25
15
|
export declare function setDefaultProjectId(projectId: string | null): void;
|
|
26
16
|
export declare function readDefaultProjectId(): string | null;
|
|
27
17
|
export declare function writeConnection(data: AgentConnectionFile): void;
|
|
@@ -35,6 +25,16 @@ export declare class MissingDesktopServerError extends Error {
|
|
|
35
25
|
code: string;
|
|
36
26
|
constructor();
|
|
37
27
|
}
|
|
28
|
+
/** The desktop's local server was configured and did not answer: the app is closed, or its port moved. */
|
|
29
|
+
export declare class DesktopUnreachableError extends Error {
|
|
30
|
+
code: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Whether a failure means "open the Slates app", by the error's code and never its wording: the
|
|
34
|
+
* cloud's revoked-token message also names Settings → AI tools, and a host that matched on the
|
|
35
|
+
* words sent a signed-out user to open an app that was already open (2026-11-24).
|
|
36
|
+
*/
|
|
37
|
+
export declare function isDesktopDown(err: unknown): boolean;
|
|
38
38
|
/** A short hash of a bearer token, so a file can name which login wrote it without holding the token. */
|
|
39
39
|
export declare function tokenHash(token: string | null | undefined): string | null;
|
|
40
40
|
export declare function requireCloudToken(): string;
|
package/dist/auth.js
CHANGED
|
@@ -16,32 +16,53 @@ export const CONNECTION_FILE = join(AGENT_DIR, 'agent-connection.json');
|
|
|
16
16
|
const EMPTY = {
|
|
17
17
|
cloud: { token: null },
|
|
18
18
|
desktop: { enabled: false, port: null, token: null },
|
|
19
|
-
defaultProjectId: null,
|
|
20
19
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return { ...EMPTY, cloud: { ...EMPTY.cloud }, desktop: { ...EMPTY.desktop } };
|
|
20
|
+
/** A JSON object file as written, or {} when it is missing or unreadable. */
|
|
21
|
+
function readJsonObject(file) {
|
|
24
22
|
try {
|
|
25
|
-
const parsed = JSON.parse(readFileSync(
|
|
26
|
-
return {
|
|
27
|
-
cloud: { token: parsed.cloud?.token ?? null },
|
|
28
|
-
desktop: {
|
|
29
|
-
enabled: !!parsed.desktop?.enabled,
|
|
30
|
-
port: parsed.desktop?.port ?? null,
|
|
31
|
-
token: parsed.desktop?.token ?? null,
|
|
32
|
-
},
|
|
33
|
-
defaultProjectId: parsed.defaultProjectId ?? null,
|
|
34
|
-
};
|
|
23
|
+
const parsed = JSON.parse(readFileSync(file, 'utf-8'));
|
|
24
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
|
|
35
25
|
}
|
|
36
26
|
catch {
|
|
37
|
-
return {
|
|
27
|
+
return {};
|
|
38
28
|
}
|
|
39
29
|
}
|
|
30
|
+
export function readConnection() {
|
|
31
|
+
const parsed = readJsonObject(CONNECTION_FILE);
|
|
32
|
+
return {
|
|
33
|
+
cloud: { token: parsed.cloud?.token ?? null },
|
|
34
|
+
desktop: {
|
|
35
|
+
enabled: !!parsed.desktop?.enabled,
|
|
36
|
+
port: parsed.desktop?.port ?? null,
|
|
37
|
+
token: parsed.desktop?.token ?? null,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// ~/.slates/cli.json — what the CLI alone remembers: the project `slates use` selected, filled
|
|
42
|
+
// into any op that takes `projectId` and was called without one. An explicit `--projectId` wins.
|
|
43
|
+
//
|
|
44
|
+
// Its own file because the desktop app rewrites the connection file whole on every start, sign-in
|
|
45
|
+
// and agent-server toggle, which erased the default each time (2026-11-24). One writer per file.
|
|
46
|
+
export const CLI_STATE_FILE = join(AGENT_DIR, 'cli.json');
|
|
40
47
|
export function setDefaultProjectId(projectId) {
|
|
41
|
-
|
|
48
|
+
mkdirSync(AGENT_DIR, { recursive: true, mode: 0o700 });
|
|
49
|
+
writeFileSync(CLI_STATE_FILE, JSON.stringify({ ...readJsonObject(CLI_STATE_FILE), defaultProjectId: projectId }, null, 2));
|
|
42
50
|
}
|
|
43
51
|
export function readDefaultProjectId() {
|
|
44
|
-
|
|
52
|
+
const state = readJsonObject(CLI_STATE_FILE);
|
|
53
|
+
if ('defaultProjectId' in state)
|
|
54
|
+
return typeof state.defaultProjectId === 'string' ? state.defaultProjectId : null;
|
|
55
|
+
// An earlier CLI kept it in the connection file. Carry a surviving one over once.
|
|
56
|
+
const legacy = readJsonObject(CONNECTION_FILE).defaultProjectId;
|
|
57
|
+
if (typeof legacy !== 'string')
|
|
58
|
+
return null;
|
|
59
|
+
try {
|
|
60
|
+
setDefaultProjectId(legacy);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// A read-only home still answers with the default it found.
|
|
64
|
+
}
|
|
65
|
+
return legacy;
|
|
45
66
|
}
|
|
46
67
|
/**
|
|
47
68
|
* Windows: leave the current user the only entry on `path`. `/reset` first, because `/inheritance:r`
|
|
@@ -78,7 +99,9 @@ export function writeConnection(data) {
|
|
|
78
99
|
if (existsSync(CONNECTION_FILE))
|
|
79
100
|
chmodSync(CONNECTION_FILE, 0o600);
|
|
80
101
|
}
|
|
81
|
-
|
|
102
|
+
// Laid over the file as it stands: a field another writer added (a newer app or CLI) survives.
|
|
103
|
+
const merged = { ...readJsonObject(CONNECTION_FILE), cloud: data.cloud, desktop: data.desktop };
|
|
104
|
+
writeFileSync(CONNECTION_FILE, JSON.stringify(merged, null, 2), { mode: 0o600 });
|
|
82
105
|
}
|
|
83
106
|
export function setCloudToken(token) {
|
|
84
107
|
const cur = readConnection();
|
|
@@ -102,6 +125,19 @@ export class MissingDesktopServerError extends Error {
|
|
|
102
125
|
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).');
|
|
103
126
|
}
|
|
104
127
|
}
|
|
128
|
+
/** The desktop's local server was configured and did not answer: the app is closed, or its port moved. */
|
|
129
|
+
export class DesktopUnreachableError extends Error {
|
|
130
|
+
code = 'DESKTOP_UNREACHABLE';
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Whether a failure means "open the Slates app", by the error's code and never its wording: the
|
|
134
|
+
* cloud's revoked-token message also names Settings → AI tools, and a host that matched on the
|
|
135
|
+
* words sent a signed-out user to open an app that was already open (2026-11-24).
|
|
136
|
+
*/
|
|
137
|
+
export function isDesktopDown(err) {
|
|
138
|
+
const code = err?.code;
|
|
139
|
+
return code === 'DESKTOP_SERVER_MISSING' || code === 'DESKTOP_UNREACHABLE';
|
|
140
|
+
}
|
|
105
141
|
/** A short hash of a bearer token, so a file can name which login wrote it without holding the token. */
|
|
106
142
|
export function tokenHash(token) {
|
|
107
143
|
return token ? createHash('sha256').update(token).digest('hex').slice(0, 16) : null;
|
package/dist/clients/cloud.d.ts
CHANGED
package/dist/clients/cloud.js
CHANGED
|
@@ -101,7 +101,10 @@ export class SlatesCloudClient {
|
|
|
101
101
|
parsed = text ? JSON.parse(text) : null;
|
|
102
102
|
}
|
|
103
103
|
catch {
|
|
104
|
-
//
|
|
104
|
+
// A success whose body cannot be read is not an answer: a paid submit treats it as lost and asks for its
|
|
105
|
+
// job by id, where a `null` result would read as nothing and skip that.
|
|
106
|
+
if (res.ok)
|
|
107
|
+
throw new Error(`slates-api ${path} answered ${res.status} with a body that is not JSON, so its result is unknown.`);
|
|
105
108
|
}
|
|
106
109
|
if (!res.ok) {
|
|
107
110
|
// 401 = the slates_sk_ token is missing, expired, or was revoked
|
|
@@ -6,6 +6,12 @@ export interface DesktopHealth {
|
|
|
6
6
|
agentApiVersion?: number;
|
|
7
7
|
capabilities?: string[];
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* The longest URL `get` sends. Node's HTTP server refuses a request whose
|
|
11
|
+
* headers pass 16,384 bytes (its default `--max-http-header-size`) with a bare
|
|
12
|
+
* 431, and the request line counts toward that; this leaves room for the rest.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MAX_GET_URL_LENGTH = 12000;
|
|
9
15
|
export declare class SlatesDesktopClient {
|
|
10
16
|
private readonly token;
|
|
11
17
|
private readonly port;
|
|
@@ -16,6 +22,15 @@ export declare class SlatesDesktopClient {
|
|
|
16
22
|
private get baseUrl();
|
|
17
23
|
healthz(): Promise<DesktopHealth>;
|
|
18
24
|
requireCapability(cap: string, friendlyFeature: string): Promise<void>;
|
|
25
|
+
/** Whether this desktop advertises `cap`: for an op that has an older route to fall back to. */
|
|
26
|
+
hasCapability(cap: string): Promise<boolean>;
|
|
27
|
+
private cachedHealth;
|
|
28
|
+
/**
|
|
29
|
+
* A quote route: the request rides the JSON body as `{ [field]: request }`
|
|
30
|
+
* where the desktop advertises 'quote-post'. An older desktop reads it as a
|
|
31
|
+
* JSON string in the query, which `get` holds to a safe length.
|
|
32
|
+
*/
|
|
33
|
+
quote<T>(path: string, field: string, request: unknown): Promise<T>;
|
|
19
34
|
get<T>(path: string, params?: Record<string, string | number | boolean | null | undefined>): Promise<T>;
|
|
20
35
|
post<T>(path: string, body: unknown): Promise<T>;
|
|
21
36
|
private fetchOrFriendly;
|
package/dist/clients/desktop.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { requireDesktop } from '../auth.js';
|
|
2
|
+
import { DesktopUnreachableError, requireDesktop } from '../auth.js';
|
|
3
3
|
// One agent session per process (an MCP server's connection, or one CLI run): the desktop counts
|
|
4
4
|
// what it spends against the person's per-session spend limit (`slates_get_spend_limits`).
|
|
5
5
|
const AGENT_SESSION = randomUUID();
|
|
@@ -56,6 +56,12 @@ function fetchErrorCodes(err) {
|
|
|
56
56
|
// short enough that an app update mid-session is picked up. Keyed by port
|
|
57
57
|
// (each desktop instance = one port).
|
|
58
58
|
const HEALTH_CACHE_TTL_MS = 60_000;
|
|
59
|
+
/**
|
|
60
|
+
* The longest URL `get` sends. Node's HTTP server refuses a request whose
|
|
61
|
+
* headers pass 16,384 bytes (its default `--max-http-header-size`) with a bare
|
|
62
|
+
* 431, and the request line counts toward that; this leaves room for the rest.
|
|
63
|
+
*/
|
|
64
|
+
export const MAX_GET_URL_LENGTH = 12_000;
|
|
59
65
|
const healthCache = new Map();
|
|
60
66
|
export class SlatesDesktopClient {
|
|
61
67
|
token;
|
|
@@ -87,21 +93,35 @@ export class SlatesDesktopClient {
|
|
|
87
93
|
// error — this check turns that into an actionable "update Slates"
|
|
88
94
|
// message BEFORE the op's first real request.
|
|
89
95
|
async requireCapability(cap, friendlyFeature) {
|
|
90
|
-
const
|
|
91
|
-
let health;
|
|
92
|
-
if (cached && Date.now() - cached.fetchedAt < HEALTH_CACHE_TTL_MS) {
|
|
93
|
-
health = cached.health;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
health = await this.healthz();
|
|
97
|
-
healthCache.set(this.port, { health, fetchedAt: Date.now() });
|
|
98
|
-
}
|
|
96
|
+
const health = await this.cachedHealth();
|
|
99
97
|
if (health.agentApiVersion === undefined || !health.capabilities?.includes(cap)) {
|
|
100
98
|
throw new Error(`Your Slates desktop app doesn't support ${friendlyFeature} yet ` +
|
|
101
99
|
`(agent API v${health.agentApiVersion ?? 1}, need v2 with '${cap}'). ` +
|
|
102
100
|
`Update Slates (Settings → Check for Updates) and retry.`);
|
|
103
101
|
}
|
|
104
102
|
}
|
|
103
|
+
/** Whether this desktop advertises `cap`: for an op that has an older route to fall back to. */
|
|
104
|
+
async hasCapability(cap) {
|
|
105
|
+
return (await this.cachedHealth()).capabilities?.includes(cap) ?? false;
|
|
106
|
+
}
|
|
107
|
+
async cachedHealth() {
|
|
108
|
+
const cached = healthCache.get(this.port);
|
|
109
|
+
if (cached && Date.now() - cached.fetchedAt < HEALTH_CACHE_TTL_MS)
|
|
110
|
+
return cached.health;
|
|
111
|
+
const health = await this.healthz();
|
|
112
|
+
healthCache.set(this.port, { health, fetchedAt: Date.now() });
|
|
113
|
+
return health;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A quote route: the request rides the JSON body as `{ [field]: request }`
|
|
117
|
+
* where the desktop advertises 'quote-post'. An older desktop reads it as a
|
|
118
|
+
* JSON string in the query, which `get` holds to a safe length.
|
|
119
|
+
*/
|
|
120
|
+
async quote(path, field, request) {
|
|
121
|
+
if (await this.hasCapability('quote-post'))
|
|
122
|
+
return this.post(path, { [field]: request });
|
|
123
|
+
return this.get(path, { [field]: JSON.stringify(request) });
|
|
124
|
+
}
|
|
105
125
|
async get(path, params) {
|
|
106
126
|
const url = new URL(`${this.baseUrl}${path}`);
|
|
107
127
|
if (params) {
|
|
@@ -111,7 +131,12 @@ export class SlatesDesktopClient {
|
|
|
111
131
|
url.searchParams.set(k, String(v));
|
|
112
132
|
}
|
|
113
133
|
}
|
|
114
|
-
const
|
|
134
|
+
const href = url.toString();
|
|
135
|
+
if (href.length > MAX_GET_URL_LENGTH) {
|
|
136
|
+
throw new Error(`This request is too long to send to this version of Slates (${href.length} characters, limit ${MAX_GET_URL_LENGTH}). ` +
|
|
137
|
+
'Update Slates (Settings → Check for Updates), or send fewer items at once.');
|
|
138
|
+
}
|
|
139
|
+
const res = await this.fetchOrFriendly(href, {
|
|
115
140
|
headers: { Authorization: `Bearer ${this.token}`, ...sessionHeaders() },
|
|
116
141
|
});
|
|
117
142
|
return this.handle(path, res);
|
|
@@ -142,7 +167,7 @@ export class SlatesDesktopClient {
|
|
|
142
167
|
catch (err) {
|
|
143
168
|
const codes = fetchErrorCodes(err);
|
|
144
169
|
if (codes.some((c) => CONNECTION_ERROR_CODES.has(c))) {
|
|
145
|
-
throw new
|
|
170
|
+
throw new DesktopUnreachableError(DESKTOP_UNREACHABLE_MESSAGE);
|
|
146
171
|
}
|
|
147
172
|
const name = err?.name;
|
|
148
173
|
if (name === 'AbortError' || codes.some((c) => TIMEOUT_ERROR_CODES.has(c))) {
|
package/dist/index.d.ts
CHANGED
|
@@ -8,11 +8,12 @@ export { parseSkillMetadata, type SkillMetadata } from './skills/metadata.js';
|
|
|
8
8
|
export { MY_BRAIN_RULES, myBrainLearning, myBrainLessons, remember, setMyBrainLearning, type MyBrainLesson, type RememberInput, type RememberResult } from './skills/my-brain-write.js';
|
|
9
9
|
export { ARCHIVE_AFTER_DAYS, archiveUnused, archiveUnusedDaily, brainSkills, loadMyBrain, myBrainDir, myBrainPreload, noteUsed, MY_BRAIN_PRELOAD_CHARS, type Brain } from './skills/my-brain.js';
|
|
10
10
|
export * as operations from './operations/index.js';
|
|
11
|
+
export { flattenZodError, parseOperationInput, prepareOperation, runOperation, type ParsedInput, type PreparedOperation } from './operations/parse-input.js';
|
|
11
12
|
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';
|
|
12
13
|
export { CONFIRM_CREDITS, DEVIATION_FACTOR, WORKING_METHOD_TOPIC } from './operations/index.js';
|
|
13
14
|
export { toolDefinitions, toolDefinition, groupFor, tierFor, OPERATION_GROUPS, GROUP_SUMMARY, STARTUP_TOOL_IDS, type ToolDefinition, } from './operations/index.js';
|
|
14
15
|
export { MODEL_FACTS, getModelFact, multimodalRefSummary, multimodalRefModels, describeRouting, SEEDANCE_TASK_INTENT_WORDS, seedanceTaskIntentWords, type ModelFact, } from './prompts/model-facts.js';
|
|
15
|
-
export { MODEL_CAPABILITIES, ALL_ASPECT_RATIOS, AGENT_ROUTE_PROVIDER, getModelCapability, aspectRatiosFor, videoResolutionsFor, defaultVideoResolutionFor, durationsFor, durationValuesFor, aspectRatioUnion, videoResolutionUnion, durationBounds, checkAspectRatio, checkVideoResolution, checkDuration, checkReferenceShape, maxReferenceVideosFor, lastFrameMaxSecondsFor, describeAspectRatios, describeVideoResolutions, describeDurations, describeReferenceImageCaps, type AspectRatio, type VideoResolution, type ModelCapability, type DurationCapability, type VideoResolutionCapability, } from './prompts/model-capabilities.js';
|
|
16
|
+
export { MODEL_CAPABILITIES, ALL_ASPECT_RATIOS, AGENT_ROUTE_PROVIDER, getModelCapability, aspectRatiosFor, videoResolutionsFor, defaultVideoResolutionFor, durationsFor, durationValuesFor, aspectRatioUnion, videoResolutionUnion, durationBounds, checkAspectRatio, checkVideoResolution, checkDuration, checkReferenceShape, checkVideoParams, checkReferenceSeconds, checkFramesWithReferenceMedia, billedReferenceSeconds, referenceClipInBounds, referenceSecondsBounds, REFERENCE_SECONDS_TOLERANCE, maxIngredientImagesFor, aspectRatioApplies, maxReferenceVideosFor, lastFrameMaxSecondsFor, describeAspectRatios, describeVideoResolutions, describeDurations, describeReferenceImageCaps, type AspectRatio, type VideoResolution, type ModelCapability, type DurationCapability, type VideoResolutionCapability, type ReferenceSecondsVerdict, } from './prompts/model-capabilities.js';
|
|
16
17
|
export { buildAgentDoctrine, buildMcpInstructions, ROUTER_NOTICE, type AgentSurface } from './prompts/agent-doctrine.js';
|
|
17
18
|
export { BRAIN_ROUTER, DIRECTOR_CARD, MY_BRAIN_TOPIC, PLAYBOOKS } from './prompts/brain.js';
|
|
18
19
|
export { BANNED_PROMPT_TOKENS, describeBannedTokens, findBannedTokens, bannedTokenWarning, refusableBannedTokens, bannedTokensForSkill, describeBannedTokensForSkill, type BannedToken, type BannedTokenScope, type BannedTokenCondition, } from './prompts/banned-tokens.js';
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,8 @@ export { parseSkillMetadata } from './skills/metadata.js';
|
|
|
8
8
|
export { MY_BRAIN_RULES, myBrainLearning, myBrainLessons, remember, setMyBrainLearning } from './skills/my-brain-write.js';
|
|
9
9
|
export { ARCHIVE_AFTER_DAYS, archiveUnused, archiveUnusedDaily, brainSkills, loadMyBrain, myBrainDir, myBrainPreload, noteUsed, MY_BRAIN_PRELOAD_CHARS } from './skills/my-brain.js';
|
|
10
10
|
export * as operations from './operations/index.js';
|
|
11
|
+
// Every host turns raw tool arguments into an op call through these, so the schema applies everywhere.
|
|
12
|
+
export { flattenZodError, parseOperationInput, prepareOperation, runOperation } from './operations/parse-input.js';
|
|
11
13
|
export { ALL_OPERATIONS, VIDEO_MODELS, AUDIO_MODELS, IMAGE_MODELS, defaultContext, OperationCancelledError } from './operations/index.js';
|
|
12
14
|
// The spend thresholds the DESKTOP and the SKILLS both quote. `CONFIRM_CREDITS`
|
|
13
15
|
// is the op-level confirm gate; `DEVIATION_FACTOR` is the Studio Agent's
|
|
@@ -33,7 +35,7 @@ SEEDANCE_TASK_INTENT_WORDS, seedanceTaskIntentWords, } from './prompts/model-fac
|
|
|
33
35
|
// `slate/src/shared/pricing.ts` spreads these into every MODEL_REGISTRY entry;
|
|
34
36
|
// the op surface validates against them and GENERATES its `.describe()` prose
|
|
35
37
|
// from them. Never hand-type a capability fact an LLM will read.
|
|
36
|
-
export { MODEL_CAPABILITIES, ALL_ASPECT_RATIOS, AGENT_ROUTE_PROVIDER, getModelCapability, aspectRatiosFor, videoResolutionsFor, defaultVideoResolutionFor, durationsFor, durationValuesFor, aspectRatioUnion, videoResolutionUnion, durationBounds, checkAspectRatio, checkVideoResolution, checkDuration, checkReferenceShape, maxReferenceVideosFor, lastFrameMaxSecondsFor, describeAspectRatios, describeVideoResolutions, describeDurations, describeReferenceImageCaps, } from './prompts/model-capabilities.js';
|
|
38
|
+
export { MODEL_CAPABILITIES, ALL_ASPECT_RATIOS, AGENT_ROUTE_PROVIDER, getModelCapability, aspectRatiosFor, videoResolutionsFor, defaultVideoResolutionFor, durationsFor, durationValuesFor, aspectRatioUnion, videoResolutionUnion, durationBounds, checkAspectRatio, checkVideoResolution, checkDuration, checkReferenceShape, checkVideoParams, checkReferenceSeconds, checkFramesWithReferenceMedia, billedReferenceSeconds, referenceClipInBounds, referenceSecondsBounds, REFERENCE_SECONDS_TOLERANCE, maxIngredientImagesFor, aspectRatioApplies, maxReferenceVideosFor, lastFrameMaxSecondsFor, describeAspectRatios, describeVideoResolutions, describeDurations, describeReferenceImageCaps, } from './prompts/model-capabilities.js';
|
|
37
39
|
// 🚨 AGENT GUIDANCE SSOT — the working method, the hard rules and the guide
|
|
38
40
|
// index, as ONE string both surfaces consume: the desktop Studio Agent's whole
|
|
39
41
|
// system prompt (slate/src/main/studio-agent/context.ts) and the MCP server's
|