gooseworks 0.3.13 → 0.3.15
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/auth/oauth-server.d.ts +8 -1
- package/dist/auth/oauth-server.d.ts.map +1 -1
- package/dist/auth/oauth-server.js +14 -2
- package/dist/auth/oauth-server.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +2 -1
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/log.d.ts +15 -0
- package/dist/commands/log.d.ts.map +1 -0
- package/dist/commands/log.js +121 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +4 -3
- package/dist/commands/login.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/skills/master-skill.d.ts.map +1 -1
- package/dist/skills/master-skill.js +92 -11
- package/dist/skills/master-skill.js.map +1 -1
- package/package.json +1 -1
- package/skills/goose-ads/SKILL.md +4 -0
- package/skills/goose-video/SKILL.md +88 -11
|
@@ -6,6 +6,13 @@ interface OAuthResult {
|
|
|
6
6
|
default_agent_id?: string;
|
|
7
7
|
mcp_server_url?: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @param creatorRef Creator Program referral code (from `--ref`). Forwarded to
|
|
11
|
+
* the `/cli/auth` page as `?creator_ref=`, which passes it onto `/auth/google`
|
|
12
|
+
* so the backend attributes a first-time signup to that creator's cash rail.
|
|
13
|
+
* No-op for users who are already signed in (attribution only lands on the
|
|
14
|
+
* OAuth signup, not on token re-exchange).
|
|
15
|
+
*/
|
|
16
|
+
export declare function runOAuthFlow(apiBase: string, creatorRef?: string): Promise<OAuthResult>;
|
|
10
17
|
export {};
|
|
11
18
|
//# sourceMappingURL=oauth-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-server.d.ts","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":"AAUA,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,YAAY,
|
|
1
|
+
{"version":3,"file":"oauth-server.d.ts","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":"AAUA,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,CAAC,CAkItB"}
|
|
@@ -44,7 +44,14 @@ const credentials_1 = require("./credentials");
|
|
|
44
44
|
const logger = __importStar(require("../utils/logger"));
|
|
45
45
|
const config_1 = require("../config");
|
|
46
46
|
const OAUTH_TIMEOUT_MS = 120_000;
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @param creatorRef Creator Program referral code (from `--ref`). Forwarded to
|
|
49
|
+
* the `/cli/auth` page as `?creator_ref=`, which passes it onto `/auth/google`
|
|
50
|
+
* so the backend attributes a first-time signup to that creator's cash rail.
|
|
51
|
+
* No-op for users who are already signed in (attribution only lands on the
|
|
52
|
+
* OAuth signup, not on token re-exchange).
|
|
53
|
+
*/
|
|
54
|
+
async function runOAuthFlow(apiBase, creatorRef) {
|
|
48
55
|
const state = crypto.randomBytes(16).toString('hex');
|
|
49
56
|
const frontendBase = config_1.FRONTEND_URL;
|
|
50
57
|
return new Promise((resolve, reject) => {
|
|
@@ -132,7 +139,12 @@ async function runOAuthFlow(apiBase) {
|
|
|
132
139
|
// Pass api_base so the frontend can route Google OAuth back through the
|
|
133
140
|
// correct backend (e.g. http://localhost:5999 for local dev vs. the
|
|
134
141
|
// ngrok/prod URL baked into NEXT_PUBLIC_API_URL).
|
|
135
|
-
|
|
142
|
+
let authUrl = `${frontendBase}/cli/auth?callback_port=${port}&state=${state}&api_base=${encodeURIComponent(apiBase)}`;
|
|
143
|
+
// Carry the creator referral code through so the frontend can forward it
|
|
144
|
+
// to /auth/google as ?creator_ref= for signup attribution.
|
|
145
|
+
if (creatorRef) {
|
|
146
|
+
authUrl += `&creator_ref=${encodeURIComponent(creatorRef)}`;
|
|
147
|
+
}
|
|
136
148
|
logger.info('Opening browser for Google sign-in...');
|
|
137
149
|
(0, open_1.default)(authUrl).catch(() => {
|
|
138
150
|
logger.warn(`Could not open browser. Please visit:\n ${authUrl}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-server.js","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"oauth-server.js","sourceRoot":"","sources":["../../src/auth/oauth-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,oCAqIC;AA/JD,2CAA6B;AAE7B,+CAAiC;AACjC,gDAAwB;AACxB,+CAAkE;AAClE,wDAA0C;AAC1C,sCAAyC;AAEzC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAWjC;;;;;;GAMG;AACI,KAAK,UAAU,YAAY,CAChC,OAAe,EACf,UAAmB;IAEnB,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CA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.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,wBAAgB,oBAAoB,IAAI,OAAO,CA0J9C;AAED,eAAO,MAAM,cAAc,SAAyB,CAAC"}
|
package/dist/commands/install.js
CHANGED
|
@@ -61,6 +61,7 @@ Examples:
|
|
|
61
61
|
.option('--mcp', 'Also register the GooseWorks MCP server')
|
|
62
62
|
.option('--with <skill-slug>', 'Also install a standalone GooseWorks skill (repeatable)', collectSkillSlug, [])
|
|
63
63
|
.option('--api-base <url>', 'API base URL', config_1.API_BASE)
|
|
64
|
+
.option('--ref <code>', 'Creator referral code — attributes your signup to the GooseWorks creator who referred you')
|
|
64
65
|
.action(async (opts) => {
|
|
65
66
|
logger.banner((0, version_1.getVersion)());
|
|
66
67
|
const targetAgents = resolveTargetAgents(opts);
|
|
@@ -72,7 +73,7 @@ Examples:
|
|
|
72
73
|
const wantMcp = !!(opts.mcp || opts.all);
|
|
73
74
|
// Step 1: Authenticate
|
|
74
75
|
logger.step(1, 3, 'Authenticating...');
|
|
75
|
-
const creds = await (0, login_1.ensureLoggedIn)(opts.apiBase);
|
|
76
|
+
const creds = await (0, login_1.ensureLoggedIn)(opts.apiBase, opts.ref);
|
|
76
77
|
logger.success(`Logged in as ${creds.email}`);
|
|
77
78
|
// Step 2: Install entry skills (clean old skills first)
|
|
78
79
|
logger.step(2, 3, 'Installing GooseWorks skills...');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":";;;;;;;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nostic event for the current skill/CLI run
|
|
4
|
+
* (GOOSE-2862). This is the SHELL-side writer, alongside the agent's
|
|
5
|
+
* `log_cli_event` MCP tool and the Python `gw_log()` helper in `media_proxy.py`.
|
|
6
|
+
* All three POST to `/api/internal/cli-logs` and land in the same `cli_run_logs`
|
|
7
|
+
* table, grouped by run id.
|
|
8
|
+
*
|
|
9
|
+
* Use it in a skill's shell steps whenever something is off — an API is failing,
|
|
10
|
+
* a required input/asset is missing, an instruction is ambiguous, a step is
|
|
11
|
+
* blocked — or just to mark progress. Best-effort: a POST failure warns and
|
|
12
|
+
* exits 0 so it never breaks the script that called it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const logCommand: Command;
|
|
15
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/commands/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,SA6FpB,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.logCommand = void 0;
|
|
37
|
+
const commander_1 = require("commander");
|
|
38
|
+
const credentials_1 = require("../auth/credentials");
|
|
39
|
+
const http_1 = require("../utils/http");
|
|
40
|
+
const logger = __importStar(require("../utils/logger"));
|
|
41
|
+
/**
|
|
42
|
+
* `gooseworks log` — record one diagnostic event for the current skill/CLI run
|
|
43
|
+
* (GOOSE-2862). This is the SHELL-side writer, alongside the agent's
|
|
44
|
+
* `log_cli_event` MCP tool and the Python `gw_log()` helper in `media_proxy.py`.
|
|
45
|
+
* All three POST to `/api/internal/cli-logs` and land in the same `cli_run_logs`
|
|
46
|
+
* table, grouped by run id.
|
|
47
|
+
*
|
|
48
|
+
* Use it in a skill's shell steps whenever something is off — an API is failing,
|
|
49
|
+
* a required input/asset is missing, an instruction is ambiguous, a step is
|
|
50
|
+
* blocked — or just to mark progress. Best-effort: a POST failure warns and
|
|
51
|
+
* exits 0 so it never breaks the script that called it.
|
|
52
|
+
*/
|
|
53
|
+
exports.logCommand = new commander_1.Command('log')
|
|
54
|
+
.description('Record a diagnostic event for the current run (broken API, missing input, ' +
|
|
55
|
+
'confusion, or a progress note). Visible to the GooseWorks team.')
|
|
56
|
+
.argument('<message>', 'Plain-language description of what happened / what is wrong')
|
|
57
|
+
.option('--event-type <type>', 'info | step | generation | api_failure | error | blocker | missing_input | confusion', 'info')
|
|
58
|
+
.option('--level <level>', 'debug | info | warn | error', 'info')
|
|
59
|
+
.option('--skill <name>', 'Skill/capability being run (default: $GW_SKILL)')
|
|
60
|
+
.option('--run-id <id>', 'Run id to group events (default: $GW_RUN_ID)')
|
|
61
|
+
.option('--project-id <id>', 'Ad project id (default: $GW_PROJECT_ID)')
|
|
62
|
+
.option('--provider <name>', 'e.g. "fal", "elevenlabs"')
|
|
63
|
+
.option('--model <id>', 'Model id, when the event is about a generation')
|
|
64
|
+
.option('--duration-ms <n>', 'Duration of the operation, in milliseconds')
|
|
65
|
+
.option('--details <json>', 'Free-form JSON context (error text, request/response, step…)')
|
|
66
|
+
.option('--quiet', 'Do not print a confirmation line')
|
|
67
|
+
.action(async (message, opts) => {
|
|
68
|
+
const creds = (0, credentials_1.getCredentials)();
|
|
69
|
+
if (!creds) {
|
|
70
|
+
logger.error('Not logged in. Run "gooseworks login" first.');
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
let details;
|
|
74
|
+
if (opts.details !== undefined) {
|
|
75
|
+
try {
|
|
76
|
+
details = JSON.parse(opts.details);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
logger.error(`--details must be valid JSON: ${err.message}`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const runId = opts.runId ?? process.env.GW_RUN_ID;
|
|
84
|
+
if (!runId) {
|
|
85
|
+
logger.error('No run id. Pass --run-id or set GW_RUN_ID in the environment.');
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
const projectId = opts.projectId ?? process.env.GW_PROJECT_ID;
|
|
89
|
+
const durationMs = opts.durationMs !== undefined ? Number(opts.durationMs) : undefined;
|
|
90
|
+
try {
|
|
91
|
+
const res = await (0, http_1.requestJson)({
|
|
92
|
+
apiBase: creds.api_base,
|
|
93
|
+
apiKey: creds.api_key,
|
|
94
|
+
method: 'POST',
|
|
95
|
+
path: '/api/internal/cli-logs',
|
|
96
|
+
query: projectId ? { project_id: projectId } : undefined,
|
|
97
|
+
body: {
|
|
98
|
+
run_id: runId,
|
|
99
|
+
message,
|
|
100
|
+
event_type: opts.eventType,
|
|
101
|
+
level: opts.level,
|
|
102
|
+
skill: opts.skill ?? process.env.GW_SKILL,
|
|
103
|
+
provider: opts.provider,
|
|
104
|
+
model: opts.model,
|
|
105
|
+
duration_ms: durationMs !== undefined && Number.isFinite(durationMs)
|
|
106
|
+
? durationMs
|
|
107
|
+
: undefined,
|
|
108
|
+
details,
|
|
109
|
+
source: 'cli',
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
if (!opts.quiet) {
|
|
113
|
+
logger.success(`Logged ${opts.eventType ?? 'info'} event${res.id ? ` (${res.id})` : ''}`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
// Diagnostics must never break the caller — warn and exit 0.
|
|
118
|
+
logger.warn(`Could not record log event: ${err.message}`);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
//# sourceMappingURL=log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/commands/log.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAoC;AACpC,qDAAqD;AACrD,wCAA4C;AAC5C,wDAA0C;AAE1C;;;;;;;;;;;GAWG;AACU,QAAA,UAAU,GAAG,IAAI,mBAAO,CAAC,KAAK,CAAC;KACzC,WAAW,CACV,4EAA4E;IAC1E,iEAAiE,CACpE;KACA,QAAQ,CAAC,WAAW,E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CAAC,CAAC,KAAK,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5F,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,6DAA6D;QAC7D,MAAM,CAAC,IAAI,CAAC,+BAAgC,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC,CACF,CAAC"}
|
package/dist/commands/login.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export declare const loginCommand: Command;
|
|
|
4
4
|
* Ensures the user is logged in, running OAuth if needed.
|
|
5
5
|
* Returns credentials or exits the process.
|
|
6
6
|
*/
|
|
7
|
-
export declare function ensureLoggedIn(apiBase?: string): Promise<import("../auth/credentials").Credentials>;
|
|
7
|
+
export declare function ensureLoggedIn(apiBase?: string, creatorRef?: string): Promise<import("../auth/credentials").Credentials>;
|
|
8
8
|
//# sourceMappingURL=login.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+DpC,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+DpC,eAAO,MAAM,YAAY,SA0BrB,CAAC;AAEL;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,GAAE,MAAiB,EAAE,UAAU,CAAC,EAAE,MAAM,sDAcnF"}
|
package/dist/commands/login.js
CHANGED
|
@@ -102,6 +102,7 @@ function showNextSteps() {
|
|
|
102
102
|
exports.loginCommand = new commander_1.Command('login')
|
|
103
103
|
.description('Sign in to GooseWorks with Google')
|
|
104
104
|
.option('--api-base <url>', 'API base URL', config_1.API_BASE)
|
|
105
|
+
.option('--ref <code>', 'Creator referral code — attributes your signup to the GooseWorks creator who referred you')
|
|
105
106
|
.action(async (opts) => {
|
|
106
107
|
const existing = (0, credentials_1.getCredentials)();
|
|
107
108
|
if (existing) {
|
|
@@ -112,7 +113,7 @@ exports.loginCommand = new commander_1.Command('login')
|
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
115
|
try {
|
|
115
|
-
const result = await (0, oauth_server_1.runOAuthFlow)(opts.apiBase);
|
|
116
|
+
const result = await (0, oauth_server_1.runOAuthFlow)(opts.apiBase, opts.ref);
|
|
116
117
|
logger.success(`Logged in as ${result.email}`);
|
|
117
118
|
refreshEntrySkillsOnLogin();
|
|
118
119
|
syncMcpRegistration();
|
|
@@ -129,11 +130,11 @@ exports.loginCommand = new commander_1.Command('login')
|
|
|
129
130
|
* Ensures the user is logged in, running OAuth if needed.
|
|
130
131
|
* Returns credentials or exits the process.
|
|
131
132
|
*/
|
|
132
|
-
async function ensureLoggedIn(apiBase = config_1.API_BASE) {
|
|
133
|
+
async function ensureLoggedIn(apiBase = config_1.API_BASE, creatorRef) {
|
|
133
134
|
const existing = (0, credentials_1.getCredentials)();
|
|
134
135
|
if (existing)
|
|
135
136
|
return existing;
|
|
136
|
-
const result = await (0, oauth_server_1.runOAuthFlow)(apiBase);
|
|
137
|
+
const result = await (0, oauth_server_1.runOAuthFlow)(apiBase, creatorRef);
|
|
137
138
|
const creds = (0, credentials_1.getCredentials)();
|
|
138
139
|
if (!creds) {
|
|
139
140
|
logger.error('Failed to save credentials after login');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,wCAcC;AA7GD,yCAAoC;AACpC,g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AAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL;;;GAGG;AACI,KAAK,UAAU,cAAc,CAAC,UAAkB,iBAAQ,EAAE,UAAmB;IAClF,MAAM,QAAQ,GAAG,IAAA,4BAAc,GAAE,CAAC;IAClC,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAY,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,IAAA,4BAAc,GAAE,CAAC;IAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,2EAA2E;IAC3E,0EAA0E;IAC1E,cAAc,EAAE,CAAC;IACjB,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ const orthogonal_1 = require("./commands/orthogonal");
|
|
|
16
16
|
const styles_1 = require("./commands/styles");
|
|
17
17
|
const formats_1 = require("./commands/formats");
|
|
18
18
|
const doctor_1 = require("./commands/doctor");
|
|
19
|
+
const log_1 = require("./commands/log");
|
|
19
20
|
const version_1 = require("./version");
|
|
20
21
|
const program = new commander_1.Command();
|
|
21
22
|
program
|
|
@@ -36,5 +37,6 @@ program.addCommand(orthogonal_1.orthogonalCommand);
|
|
|
36
37
|
program.addCommand(styles_1.stylesCommand);
|
|
37
38
|
program.addCommand(formats_1.formatsCommand);
|
|
38
39
|
program.addCommand(doctor_1.doctorCommand);
|
|
40
|
+
program.addCommand(log_1.logCommand);
|
|
39
41
|
program.parse();
|
|
40
42
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACp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],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oDAAoD;AACpD,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAM7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CA8N9C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"master-skill.d.ts","sourceRoot":"","sources":["../../src/skills/master-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,UAAU;IACzB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oDAAoD;AACpD,wBAAgB,cAAc,IAAI,UAAU,EAAE,CAM7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CA8N9C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CA0UhD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CA2blD"}
|
|
@@ -584,6 +584,10 @@ run through the \`gooseworks\` CLI (\`gooseworks fetch\` / \`gooseworks call\`),
|
|
|
584
584
|
immediately.
|
|
585
585
|
- **Don't busy-loop** — poll \`get_remix_batch\` on a sensible interval (~20-30s); a \`queued\`
|
|
586
586
|
batch is waiting on research and will start on its own.
|
|
587
|
+
- **Report problems so we can fix them** — when a batch fails/is rejected and you can't resolve it,
|
|
588
|
+
a required brand input/asset is missing, or a recipe/instruction is ambiguous or contradictory,
|
|
589
|
+
call the **\`log_cli_event\`** MCP tool (\`event_type\`: \`error\`/\`blocker\`/\`missing_input\`/\`confusion\`,
|
|
590
|
+
with the real error + step in \`details\`) so the team gets visibility. Still tell the user too.
|
|
587
591
|
`;
|
|
588
592
|
}
|
|
589
593
|
/**
|
|
@@ -606,11 +610,12 @@ description: >
|
|
|
606
610
|
GooseWorks video ads — remix a video ad template (iMessage chat-reveal, more coming) into a
|
|
607
611
|
branded video ad for the user's product. Renders LOCALLY on the user's machine (Playwright +
|
|
608
612
|
ffmpeg + GooseWorks media proxies) and saves the finished MP4 back to the project over MCP.
|
|
609
|
-
Use when the user says "make the video for project <id>",
|
|
610
|
-
template, or asks to remix a video ad. Unlike goose-ads (static images,
|
|
611
|
-
video renders locally and reports progress + the result back through the
|
|
613
|
+
Use when the user says "make the video for project <id>", "for video batch <id>", references a
|
|
614
|
+
video ad project/batch or template, or asks to remix a video ad. Unlike goose-ads (static images,
|
|
615
|
+
generated server-side), video renders locally and reports progress + the result back through the
|
|
616
|
+
gooseworks MCP tools.
|
|
612
617
|
category: ads
|
|
613
|
-
version: 0.
|
|
618
|
+
version: 0.3.0
|
|
614
619
|
author: GooseWorks
|
|
615
620
|
tags: [gooseworks, ads, video, remix, imessage, local-render, byoa]
|
|
616
621
|
---
|
|
@@ -645,6 +650,26 @@ says to shell out, use the MCP equivalent:
|
|
|
645
650
|
- \`gooseworks credits\` → the **\`get_ad_credits\`** MCP tool.
|
|
646
651
|
- \`gooseworks doctor\` → do the manual toolchain check in the preflight below.
|
|
647
652
|
|
|
653
|
+
## Report problems so we can fix them (telemetry — do this, don't skip it)
|
|
654
|
+
|
|
655
|
+
If anything blocks or degrades this run — a media/proxy call fails or errors, a required input or
|
|
656
|
+
asset is missing, a recipe instruction is ambiguous or contradictory, the render toolchain won't set
|
|
657
|
+
up, or you hit a bug you can't work around — **report it** so the team gets visibility and can fix
|
|
658
|
+
the skill. It's fire-and-forget, never counts against you, and never blocks your work.
|
|
659
|
+
|
|
660
|
+
- **First, set a stable run id** so every event (yours + the auto-logged media calls) groups together:
|
|
661
|
+
\`export GW_RUN_ID="vid-<project_or_batch_id>"\` (and \`export GW_SKILL="<recipe-slug>"\`) in the
|
|
662
|
+
shell you render from. The media proxies read \`GW_RUN_ID\` automatically.
|
|
663
|
+
- **CLI present →** \`gooseworks log "<what happened>" --event-type <type> --level error --details '{"error":"...","step":"...","model":"..."}'\`
|
|
664
|
+
- **No CLI (cowork / headless) →** the **\`log_cli_event\`** MCP tool with the same fields (pass \`run_id\`).
|
|
665
|
+
- \`--event-type\`: \`api_failure\` (a proxy/model call failed) · \`missing_input\` · \`blocker\` ·
|
|
666
|
+
\`confusion\` (unclear/contradictory instruction) · \`error\` (a bug) · \`step\`/\`info\` (progress notes).
|
|
667
|
+
- Put the **real error text + the step you were on** in \`--details\`. Paid FAL/ElevenLabs calls
|
|
668
|
+
ALREADY auto-log their own failures, so focus your manual logs on what the proxy can't see:
|
|
669
|
+
missing inputs, confusing/contradictory recipe instructions, toolchain/setup failures, and bugs.
|
|
670
|
+
- Logging is FOR US — it does not replace telling the user. When a problem blocks the run, still
|
|
671
|
+
explain it to the user (and ask if you need a decision); just also \`log\` it so we can fix the skill.
|
|
672
|
+
|
|
648
673
|
## Prerequisite — MCP + a render toolchain (Phase 0 preflight)
|
|
649
674
|
|
|
650
675
|
- The \`mcp__gooseworks__*\` tools are REQUIRED. If they're unavailable, stop and tell the user
|
|
@@ -705,11 +730,63 @@ says to shell out, use the MCP equivalent:
|
|
|
705
730
|
re-submit on a guess (that double-bills). The final-video QC gate (Step 4.3) then sits between
|
|
706
731
|
that master and PINNING it. Call \`get_ad_credits\` first; the user can check \`gooseworks credits\`.
|
|
707
732
|
|
|
733
|
+
## Step 0 — project id, or video BATCH id? (fan out before anything else)
|
|
734
|
+
|
|
735
|
+
The handoff you were pasted is EITHER a single \`project <id>\` OR a \`video batch <id>\`. A batch is
|
|
736
|
+
the app's "N concepts" flow: one composer submission fans out into **N independent concept projects**
|
|
737
|
+
(the user picked a concept count, default 3), and the app expects EACH to be rendered. **Handle both:**
|
|
738
|
+
|
|
739
|
+
- **\`project <id>\`** → you have one project. Treat it as a batch of one and continue to Step 1.
|
|
740
|
+
- **\`video batch <id>\`** → call \`get_ad_video_batch { video_batch_id }\`. It returns every child
|
|
741
|
+
concept under \`projects[]\` — each is a normal project with its own \`id\`, \`variant_index\`
|
|
742
|
+
(Concept 1..N), and its own \`creative_brief\` (the per-concept angle/hook/offer/message). **You
|
|
743
|
+
MUST process every concept, not just the first** — dropping concepts 2..N is the #1 batch bug.
|
|
744
|
+
|
|
745
|
+
**Loop shape (one agent, sequential, ONE approval for the whole batch):**
|
|
746
|
+
1. Run **Step 1 + Step 1.5 + Step 2 + Step 3-assemble** for EACH concept project (each has its own
|
|
747
|
+
\`project_id\`, brief, and \`working/\` folder — never cross-write between concepts).
|
|
748
|
+
2. Mirror EVERY concept's review set (Step 3's \`update_ad_project_script\` per project), then stop
|
|
749
|
+
for **ONE** approval that covers all concepts — show the per-concept credit estimate and the
|
|
750
|
+
batch total. Set the batch to \`review\` (\`update_ad_video_batch { status: "review" }\`).
|
|
751
|
+
3. On approval, set the batch to \`rendering\` and run **Step 4 (the expensive render)** for each
|
|
752
|
+
concept **sequentially** (finish Concept 1's master before starting Concept 2 — one machine can't
|
|
753
|
+
render them in parallel). Deliver each (Step 5). When all concepts are pinned, set the batch to
|
|
754
|
+
\`complete\`.
|
|
755
|
+
|
|
756
|
+
If a single concept fails, keep going with the rest, mark that concept blocked, and report which
|
|
757
|
+
ones shipped — never abort the whole batch on one bad concept. Everything below (Steps 1–5) is
|
|
758
|
+
written per-project; a batch just runs it N times with the shared approval gate above.
|
|
759
|
+
|
|
708
760
|
## Step 1 — resolve the project, source, brand
|
|
709
761
|
|
|
710
|
-
1. \`get_ad_project { project_id }\` → keep \`brand_id\`, \`source_sample_id\`, \`name\`, \`status\`,
|
|
711
|
-
|
|
712
|
-
|
|
762
|
+
1. \`get_ad_project { project_id }\` → keep \`brand_id\`, \`source_sample_id\`, \`name\`, \`status\`, the
|
|
763
|
+
**top-level** \`app_url\` + \`brand_url\` (returned alongside \`project\`, NOT inside it — the links
|
|
764
|
+
you hand the user for the in-app review in Step 3 and delivery in Step 5), AND the user's
|
|
765
|
+
**\`creative_brief\`**, project **\`assets\`**, \`character_id\`, \`default_voice_id\` — these are the
|
|
766
|
+
authoritative inputs the user chose in the composer (see Step 1.5). Do NOT discard them.
|
|
767
|
+
|
|
768
|
+
### Step 1.5 — the project brief is AUTHORITATIVE (honor it; don't re-ask)
|
|
769
|
+
|
|
770
|
+
The composer already collected the user's creative direction onto the project. **Read it and treat
|
|
771
|
+
it as ground truth — it OVERRIDES the template recipe's defaults, and it REPLACES the clarifying
|
|
772
|
+
questions you would otherwise ask.** Only fall back to the recipe default (then, last, to asking)
|
|
773
|
+
for a field the brief leaves empty. Map the fields you WILL honor:
|
|
774
|
+
|
|
775
|
+
- \`creative_brief.productName\` / \`.offer\` / \`.angle\` → the product, offer/code, and angle. Do
|
|
776
|
+
**not** ask "which product / what offer / what angle" if these are set.
|
|
777
|
+
- \`creative_brief.concept\` (on a batch child) → this concept's **\`angle\` / \`hook\` / \`offer\` /
|
|
778
|
+
\`message\` / \`note\`** — the per-concept differentiator. Honor it verbatim; it's WHY the user asked
|
|
779
|
+
for N concepts. \`angle: "auto"\` or empty means "you choose."
|
|
780
|
+
- Project \`assets\` + \`creative_brief.reference_image_urls\` → the user's **own reference images**.
|
|
781
|
+
Use them as the product/brand refs (alongside the brand kit), don't ignore them for generic recipe
|
|
782
|
+
assets.
|
|
783
|
+
- \`character_id\` → the avatar/creator to use. \`default_voice_id\` → the voice for any VO (put its
|
|
784
|
+
NAME in the review \`subtitle\`). Use these instead of picking your own.
|
|
785
|
+
- \`creative_brief.ratio\` / \`.durationSeconds\` → target aspect ratio + length. Honor when the
|
|
786
|
+
format's render pipeline supports it; if the format physically can't (e.g. a fixed phone-mockup
|
|
787
|
+
aspect), keep the format's native value and note the constraint in the review rather than silently
|
|
788
|
+
ignoring the request.
|
|
789
|
+
- \`polish_policy\` (\`standard\` | \`extra\`) → \`extra\` means spend the extra pass on QC/polish.
|
|
713
790
|
2. \`get_ad_template { template_id: source_sample_id }\` → the source video: \`media_url\`,
|
|
714
791
|
\`recipe\`, \`format\` (e.g. "imessage"), \`extracted_script\`, \`how_to\`, \`remix_spec\`.
|
|
715
792
|
3. Brand gate: \`get_brand_kit { brand_id }\`. If \`researchStatus\` is \`complete\`, REUSE it —
|
|
@@ -791,9 +868,10 @@ ingredient here is only a genuinely separate SOURCE clip the format needs (e.g.
|
|
|
791
868
|
the **exact prompt/spec** (and any ref image URLs) in the tile's \`text\` / \`subtitle\` so the
|
|
792
869
|
user reviews what will be spent on. No \`path\` yet — it's generated in Step 4.
|
|
793
870
|
Include the **estimated cost in CREDITS** (never dollars) of the cheap pieces already generated +
|
|
794
|
-
the pending render, so the user approves knowing the total spend.
|
|
795
|
-
|
|
796
|
-
|
|
871
|
+
the pending render, so the user approves knowing the total spend. **Answer clarifying questions
|
|
872
|
+
from the project brief FIRST (Step 1.5)** — only ask the user for a field (angle, which product,
|
|
873
|
+
offer/code) the \`creative_brief\` leaves empty AND the recipe can't default. Do not re-ask for
|
|
874
|
+
anything the composer already captured.
|
|
797
875
|
2. **Mirror the whole ingredient set for review** — \`update_ad_project_script { project_id,
|
|
798
876
|
script_drafts, script }\`. \`script_drafts\` is a structured payload of **container-tagged
|
|
799
877
|
ingredients** so the app renders each piece the right way:
|
|
@@ -961,7 +1039,10 @@ path. (\`fal-storage-proxy\` may 404 depending on the install; don't block on it
|
|
|
961
1039
|
- **Verify a real, non-empty MP4** (watch it) before marking the render complete.
|
|
962
1040
|
- **Reuse the brand** when its research is complete; never re-research.
|
|
963
1041
|
- On a hard error (auth/quota/model/timeout) set the render \`failed\` with a short
|
|
964
|
-
\`error_message\` and stop — don't ship the source unchanged.
|
|
1042
|
+
\`error_message\` and stop — don't ship the source unchanged. **Also \`log\` it** (\`gooseworks log\`
|
|
1043
|
+
/ \`log_cli_event\`, \`--event-type api_failure|error\`) so we can see + fix it (see "Report problems").
|
|
1044
|
+
- **Report blockers/bugs/confusing instructions via telemetry** (\`gooseworks log\` or the
|
|
1045
|
+
\`log_cli_event\` MCP tool) — not just to the user. Set \`GW_RUN_ID\` once so events group.
|
|
965
1046
|
- Always end a successful run with \`app_url\` + \`brand_url\`, verbatim.
|
|
966
1047
|
`;
|
|
967
1048
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"master-skill.js","sourceRoot":"","sources":["../../src/skills/master-skill.ts"],"names":[],"mappings":";;AA4BA,wCAMC;AAWD,sDA8NC;AAiBD,
|
|
1
|
+
{"version":3,"file":"master-skill.js","sourceRoot":"","sources":["../../src/skills/master-skill.ts"],"names":[],"mappings":";;AA4BA,wCAMC;AAWD,sDA8NC;AAiBD,0DA0UC;AAcD,8DA2bC;AAphCD,oDAAoD;AACpD,SAAgB,cAAc;IAC5B,OAAO;QACL,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,qBAAqB,EAAE,EAAE;QACxD,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,uBAAuB,EAAE,EAAE;QACzD,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,yBAAyB,EAAE,EAAE;KAC9D,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4NR,CAAC;AACF,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAgB,uBAAuB;IACrC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwUR,CAAC;AACF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,yBAAyB;IACvC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAybR,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -322,3 +322,7 @@ run through the `gooseworks` CLI (`gooseworks fetch` / `gooseworks call`), like
|
|
|
322
322
|
immediately.
|
|
323
323
|
- **Don't busy-loop** — poll `get_remix_batch` on a sensible interval (~20-30s); a `queued`
|
|
324
324
|
batch is waiting on research and will start on its own.
|
|
325
|
+
- **Report problems so we can fix them** — when a batch fails/is rejected and you can't resolve it,
|
|
326
|
+
a required brand input/asset is missing, or a recipe/instruction is ambiguous or contradictory,
|
|
327
|
+
call the **`log_cli_event`** MCP tool (`event_type`: `error`/`blocker`/`missing_input`/`confusion`,
|
|
328
|
+
with the real error + step in `details`) so the team gets visibility. Still tell the user too.
|
|
@@ -5,11 +5,12 @@ description: >
|
|
|
5
5
|
GooseWorks video ads — remix a video ad template (iMessage chat-reveal, more coming) into a
|
|
6
6
|
branded video ad for the user's product. Renders LOCALLY on the user's machine (Playwright +
|
|
7
7
|
ffmpeg + GooseWorks media proxies) and saves the finished MP4 back to the project over MCP.
|
|
8
|
-
Use when the user says "make the video for project <id>",
|
|
9
|
-
template, or asks to remix a video ad. Unlike goose-ads (static images,
|
|
10
|
-
video renders locally and reports progress + the result back through the
|
|
8
|
+
Use when the user says "make the video for project <id>", "for video batch <id>", references a
|
|
9
|
+
video ad project/batch or template, or asks to remix a video ad. Unlike goose-ads (static images,
|
|
10
|
+
generated server-side), video renders locally and reports progress + the result back through the
|
|
11
|
+
gooseworks MCP tools.
|
|
11
12
|
category: ads
|
|
12
|
-
version: 0.
|
|
13
|
+
version: 0.3.0
|
|
13
14
|
author: GooseWorks
|
|
14
15
|
tags: [gooseworks, ads, video, remix, imessage, local-render, byoa]
|
|
15
16
|
---
|
|
@@ -44,6 +45,26 @@ says to shell out, use the MCP equivalent:
|
|
|
44
45
|
- `gooseworks credits` → the **`get_ad_credits`** MCP tool.
|
|
45
46
|
- `gooseworks doctor` → do the manual toolchain check in the preflight below.
|
|
46
47
|
|
|
48
|
+
## Report problems so we can fix them (telemetry — do this, don't skip it)
|
|
49
|
+
|
|
50
|
+
If anything blocks or degrades this run — a media/proxy call fails or errors, a required input or
|
|
51
|
+
asset is missing, a recipe instruction is ambiguous or contradictory, the render toolchain won't set
|
|
52
|
+
up, or you hit a bug you can't work around — **report it** so the team gets visibility and can fix
|
|
53
|
+
the skill. It's fire-and-forget, never counts against you, and never blocks your work.
|
|
54
|
+
|
|
55
|
+
- **First, set a stable run id** so every event (yours + the auto-logged media calls) groups together:
|
|
56
|
+
`export GW_RUN_ID="vid-<project_or_batch_id>"` (and `export GW_SKILL="<recipe-slug>"`) in the
|
|
57
|
+
shell you render from. The media proxies read `GW_RUN_ID` automatically.
|
|
58
|
+
- **CLI present →** `gooseworks log "<what happened>" --event-type <type> --level error --details '{"error":"...","step":"...","model":"..."}'`
|
|
59
|
+
- **No CLI (cowork / headless) →** the **`log_cli_event`** MCP tool with the same fields (pass `run_id`).
|
|
60
|
+
- `--event-type`: `api_failure` (a proxy/model call failed) · `missing_input` · `blocker` ·
|
|
61
|
+
`confusion` (unclear/contradictory instruction) · `error` (a bug) · `step`/`info` (progress notes).
|
|
62
|
+
- Put the **real error text + the step you were on** in `--details`. Paid FAL/ElevenLabs calls
|
|
63
|
+
ALREADY auto-log their own failures, so focus your manual logs on what the proxy can't see:
|
|
64
|
+
missing inputs, confusing/contradictory recipe instructions, toolchain/setup failures, and bugs.
|
|
65
|
+
- Logging is FOR US — it does not replace telling the user. When a problem blocks the run, still
|
|
66
|
+
explain it to the user (and ask if you need a decision); just also `log` it so we can fix the skill.
|
|
67
|
+
|
|
47
68
|
## Prerequisite — MCP + a render toolchain (Phase 0 preflight)
|
|
48
69
|
|
|
49
70
|
- The `mcp__gooseworks__*` tools are REQUIRED. If they're unavailable, stop and tell the user
|
|
@@ -104,11 +125,63 @@ says to shell out, use the MCP equivalent:
|
|
|
104
125
|
re-submit on a guess (that double-bills). The final-video QC gate (Step 4.3) then sits between
|
|
105
126
|
that master and PINNING it. Call `get_ad_credits` first; the user can check `gooseworks credits`.
|
|
106
127
|
|
|
128
|
+
## Step 0 — project id, or video BATCH id? (fan out before anything else)
|
|
129
|
+
|
|
130
|
+
The handoff you were pasted is EITHER a single `project <id>` OR a `video batch <id>`. A batch is
|
|
131
|
+
the app's "N concepts" flow: one composer submission fans out into **N independent concept projects**
|
|
132
|
+
(the user picked a concept count, default 3), and the app expects EACH to be rendered. **Handle both:**
|
|
133
|
+
|
|
134
|
+
- **`project <id>`** → you have one project. Treat it as a batch of one and continue to Step 1.
|
|
135
|
+
- **`video batch <id>`** → call `get_ad_video_batch { video_batch_id }`. It returns every child
|
|
136
|
+
concept under `projects[]` — each is a normal project with its own `id`, `variant_index`
|
|
137
|
+
(Concept 1..N), and its own `creative_brief` (the per-concept angle/hook/offer/message). **You
|
|
138
|
+
MUST process every concept, not just the first** — dropping concepts 2..N is the #1 batch bug.
|
|
139
|
+
|
|
140
|
+
**Loop shape (one agent, sequential, ONE approval for the whole batch):**
|
|
141
|
+
1. Run **Step 1 + Step 1.5 + Step 2 + Step 3-assemble** for EACH concept project (each has its own
|
|
142
|
+
`project_id`, brief, and `working/` folder — never cross-write between concepts).
|
|
143
|
+
2. Mirror EVERY concept's review set (Step 3's `update_ad_project_script` per project), then stop
|
|
144
|
+
for **ONE** approval that covers all concepts — show the per-concept credit estimate and the
|
|
145
|
+
batch total. Set the batch to `review` (`update_ad_video_batch { status: "review" }`).
|
|
146
|
+
3. On approval, set the batch to `rendering` and run **Step 4 (the expensive render)** for each
|
|
147
|
+
concept **sequentially** (finish Concept 1's master before starting Concept 2 — one machine can't
|
|
148
|
+
render them in parallel). Deliver each (Step 5). When all concepts are pinned, set the batch to
|
|
149
|
+
`complete`.
|
|
150
|
+
|
|
151
|
+
If a single concept fails, keep going with the rest, mark that concept blocked, and report which
|
|
152
|
+
ones shipped — never abort the whole batch on one bad concept. Everything below (Steps 1–5) is
|
|
153
|
+
written per-project; a batch just runs it N times with the shared approval gate above.
|
|
154
|
+
|
|
107
155
|
## Step 1 — resolve the project, source, brand
|
|
108
156
|
|
|
109
|
-
1. `get_ad_project { project_id }` → keep `brand_id`, `source_sample_id`, `name`, `status`,
|
|
110
|
-
|
|
111
|
-
|
|
157
|
+
1. `get_ad_project { project_id }` → keep `brand_id`, `source_sample_id`, `name`, `status`, the
|
|
158
|
+
**top-level** `app_url` + `brand_url` (returned alongside `project`, NOT inside it — the links
|
|
159
|
+
you hand the user for the in-app review in Step 3 and delivery in Step 5), AND the user's
|
|
160
|
+
**`creative_brief`**, project **`assets`**, `character_id`, `default_voice_id` — these are the
|
|
161
|
+
authoritative inputs the user chose in the composer (see Step 1.5). Do NOT discard them.
|
|
162
|
+
|
|
163
|
+
### Step 1.5 — the project brief is AUTHORITATIVE (honor it; don't re-ask)
|
|
164
|
+
|
|
165
|
+
The composer already collected the user's creative direction onto the project. **Read it and treat
|
|
166
|
+
it as ground truth — it OVERRIDES the template recipe's defaults, and it REPLACES the clarifying
|
|
167
|
+
questions you would otherwise ask.** Only fall back to the recipe default (then, last, to asking)
|
|
168
|
+
for a field the brief leaves empty. Map the fields you WILL honor:
|
|
169
|
+
|
|
170
|
+
- `creative_brief.productName` / `.offer` / `.angle` → the product, offer/code, and angle. Do
|
|
171
|
+
**not** ask "which product / what offer / what angle" if these are set.
|
|
172
|
+
- `creative_brief.concept` (on a batch child) → this concept's **`angle` / `hook` / `offer` /
|
|
173
|
+
`message` / `note`** — the per-concept differentiator. Honor it verbatim; it's WHY the user asked
|
|
174
|
+
for N concepts. `angle: "auto"` or empty means "you choose."
|
|
175
|
+
- Project `assets` + `creative_brief.reference_image_urls` → the user's **own reference images**.
|
|
176
|
+
Use them as the product/brand refs (alongside the brand kit), don't ignore them for generic recipe
|
|
177
|
+
assets.
|
|
178
|
+
- `character_id` → the avatar/creator to use. `default_voice_id` → the voice for any VO (put its
|
|
179
|
+
NAME in the review `subtitle`). Use these instead of picking your own.
|
|
180
|
+
- `creative_brief.ratio` / `.durationSeconds` → target aspect ratio + length. Honor when the
|
|
181
|
+
format's render pipeline supports it; if the format physically can't (e.g. a fixed phone-mockup
|
|
182
|
+
aspect), keep the format's native value and note the constraint in the review rather than silently
|
|
183
|
+
ignoring the request.
|
|
184
|
+
- `polish_policy` (`standard` | `extra`) → `extra` means spend the extra pass on QC/polish.
|
|
112
185
|
2. `get_ad_template { template_id: source_sample_id }` → the source video: `media_url`,
|
|
113
186
|
`recipe`, `format` (e.g. "imessage"), `extracted_script`, `how_to`, `remix_spec`.
|
|
114
187
|
3. Brand gate: `get_brand_kit { brand_id }`. If `researchStatus` is `complete`, REUSE it —
|
|
@@ -190,9 +263,10 @@ ingredient here is only a genuinely separate SOURCE clip the format needs (e.g.
|
|
|
190
263
|
the **exact prompt/spec** (and any ref image URLs) in the tile's `text` / `subtitle` so the
|
|
191
264
|
user reviews what will be spent on. No `path` yet — it's generated in Step 4.
|
|
192
265
|
Include the **estimated cost in CREDITS** (never dollars) of the cheap pieces already generated +
|
|
193
|
-
the pending render, so the user approves knowing the total spend.
|
|
194
|
-
|
|
195
|
-
|
|
266
|
+
the pending render, so the user approves knowing the total spend. **Answer clarifying questions
|
|
267
|
+
from the project brief FIRST (Step 1.5)** — only ask the user for a field (angle, which product,
|
|
268
|
+
offer/code) the `creative_brief` leaves empty AND the recipe can't default. Do not re-ask for
|
|
269
|
+
anything the composer already captured.
|
|
196
270
|
2. **Mirror the whole ingredient set for review** — `update_ad_project_script { project_id,
|
|
197
271
|
script_drafts, script }`. `script_drafts` is a structured payload of **container-tagged
|
|
198
272
|
ingredients** so the app renders each piece the right way:
|
|
@@ -360,5 +434,8 @@ path. (`fal-storage-proxy` may 404 depending on the install; don't block on it
|
|
|
360
434
|
- **Verify a real, non-empty MP4** (watch it) before marking the render complete.
|
|
361
435
|
- **Reuse the brand** when its research is complete; never re-research.
|
|
362
436
|
- On a hard error (auth/quota/model/timeout) set the render `failed` with a short
|
|
363
|
-
`error_message` and stop — don't ship the source unchanged.
|
|
437
|
+
`error_message` and stop — don't ship the source unchanged. **Also `log` it** (`gooseworks log`
|
|
438
|
+
/ `log_cli_event`, `--event-type api_failure|error`) so we can see + fix it (see "Report problems").
|
|
439
|
+
- **Report blockers/bugs/confusing instructions via telemetry** (`gooseworks log` or the
|
|
440
|
+
`log_cli_event` MCP tool) — not just to the user. Set `GW_RUN_ID` once so events group.
|
|
364
441
|
- Always end a successful run with `app_url` + `brand_url`, verbatim.
|