@analyticscli/growth-engineer 0.1.1-preview.0 → 0.1.1-preview.3
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/runtime/openclaw-growth-preflight.mjs +1 -0
- package/dist/runtime/openclaw-growth-preflight.mjs.map +1 -1
- package/dist/runtime/openclaw-growth-runner.mjs +460 -24
- package/dist/runtime/openclaw-growth-runner.mjs.map +1 -1
- package/dist/runtime/openclaw-growth-shared.mjs +1 -0
- package/dist/runtime/openclaw-growth-shared.mjs.map +1 -1
- package/dist/runtime/openclaw-growth-start.mjs +115 -92
- package/dist/runtime/openclaw-growth-start.mjs.map +1 -1
- package/dist/runtime/openclaw-growth-status.mjs +56 -36
- package/dist/runtime/openclaw-growth-status.mjs.map +1 -1
- package/dist/runtime/openclaw-growth-wizard.mjs +130 -36
- package/dist/runtime/openclaw-growth-wizard.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -290,6 +290,7 @@ function resolveRuntimeScriptPath(scriptName) {
|
|
|
290
290
|
const candidates = [
|
|
291
291
|
path.join(RUNTIME_DIR, scriptName),
|
|
292
292
|
path.resolve('scripts', scriptName),
|
|
293
|
+
path.resolve('skills/growth-engineer/scripts', scriptName),
|
|
293
294
|
path.resolve('skills/openclaw-growth-engineer/scripts', scriptName),
|
|
294
295
|
];
|
|
295
296
|
return candidates.find((candidate) => existsSync(candidate)) || path.join(RUNTIME_DIR, scriptName);
|
|
@@ -2148,98 +2149,120 @@ async function main() {
|
|
|
2148
2149
|
: 'analytics scope check failed',
|
|
2149
2150
|
status: analyticsProjectSetup.ok ? 'pass' : 'fail',
|
|
2150
2151
|
});
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
}
|
|
2171
|
-
if (
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2152
|
+
const shouldRunAscSetup = args.onlyConnectors.length === 0 ||
|
|
2153
|
+
args.onlyConnectors.includes('asc') ||
|
|
2154
|
+
Boolean(normalizeString(args.ascApp)) ||
|
|
2155
|
+
configHasEnabledAscSource(initialConfig);
|
|
2156
|
+
let ascAppSetup = {
|
|
2157
|
+
ok: true,
|
|
2158
|
+
configured: false,
|
|
2159
|
+
changed: false,
|
|
2160
|
+
appId: null,
|
|
2161
|
+
appScope: 'skipped_by_connector_filter',
|
|
2162
|
+
needsUserInput: false,
|
|
2163
|
+
};
|
|
2164
|
+
let ascAnalyticsRequestSetup = {
|
|
2165
|
+
ok: true,
|
|
2166
|
+
status: 'skipped',
|
|
2167
|
+
requestId: null,
|
|
2168
|
+
requestIds: [],
|
|
2169
|
+
detail: 'ASC connector was not selected',
|
|
2170
|
+
results: [],
|
|
2171
|
+
};
|
|
2172
|
+
if (shouldRunAscSetup) {
|
|
2173
|
+
emitProgress(args.progressJson, {
|
|
2174
|
+
phase: 'start',
|
|
2175
|
+
key: 'ascApp',
|
|
2176
|
+
label: 'ASC app scope',
|
|
2177
|
+
detail: 'resolving App Store Connect app scope',
|
|
2178
|
+
});
|
|
2179
|
+
ascAppSetup = await ensureAscAppConfigured(configPath, args.ascApp);
|
|
2180
|
+
emitProgress(args.progressJson, {
|
|
2181
|
+
phase: 'finish',
|
|
2182
|
+
key: 'ascApp',
|
|
2183
|
+
label: 'ASC app scope',
|
|
2184
|
+
detail: ascAppSetup.ok
|
|
2185
|
+
? ascAppSetup.appId
|
|
2186
|
+
? `using app ${ascAppSetup.appId}`
|
|
2187
|
+
: ascAppSetup.appScope === 'all_accessible_apps'
|
|
2188
|
+
? `using all accessible apps (${ascAppSetup.appCount || 0} found)`
|
|
2189
|
+
: 'not enabled'
|
|
2190
|
+
: describeAscAppSetupFailure(ascAppSetup.error),
|
|
2191
|
+
status: ascAppSetup.ok ? 'pass' : 'fail',
|
|
2192
|
+
});
|
|
2193
|
+
if (!ascAppSetup.ok) {
|
|
2194
|
+
process.stdout.write(`${JSON.stringify({
|
|
2195
|
+
ok: false,
|
|
2196
|
+
phase: 'asc_app_setup',
|
|
2197
|
+
configCreated: configResult.created,
|
|
2198
|
+
configPath,
|
|
2199
|
+
heartbeat,
|
|
2200
|
+
openclawCron,
|
|
2201
|
+
hermesCron,
|
|
2202
|
+
projectConfigured: projectConfigured || analyticsProjectSetup.configured,
|
|
2203
|
+
analyticsProjectId: analyticsProjectSetup.projectId || null,
|
|
2204
|
+
ascAppConfigured: false,
|
|
2205
|
+
connectorSetup,
|
|
2206
|
+
needsUserInput: false,
|
|
2207
|
+
question: null,
|
|
2208
|
+
apps: [],
|
|
2209
|
+
nextCommand: null,
|
|
2210
|
+
blockers: [
|
|
2211
|
+
{
|
|
2212
|
+
check: 'connection:asc_app',
|
|
2213
|
+
detail: describeAscAppSetupFailure(ascAppSetup.error),
|
|
2214
|
+
remediation: remediateAscAppSetupFailure(ascAppSetup.error),
|
|
2215
|
+
},
|
|
2216
|
+
],
|
|
2217
|
+
}, null, 2)}\n`);
|
|
2218
|
+
process.exitCode = 1;
|
|
2219
|
+
return;
|
|
2220
|
+
}
|
|
2221
|
+
emitProgress(args.progressJson, {
|
|
2222
|
+
phase: 'start',
|
|
2223
|
+
key: 'ascAnalyticsRequest',
|
|
2224
|
+
label: 'ASC analytics reports',
|
|
2225
|
+
detail: 'checking ongoing Analytics Report Request',
|
|
2226
|
+
});
|
|
2227
|
+
ascAnalyticsRequestSetup = await ensureAscAnalyticsRequestsForAppScope(ascAppSetup);
|
|
2228
|
+
emitProgress(args.progressJson, {
|
|
2229
|
+
phase: 'finish',
|
|
2230
|
+
key: 'ascAnalyticsRequest',
|
|
2231
|
+
label: 'ASC analytics reports',
|
|
2232
|
+
detail: ascAnalyticsRequestSetup.ok
|
|
2233
|
+
? ascAnalyticsRequestSetup.detail
|
|
2234
|
+
: `could not ensure Analytics Report Request (${truncate(ascAnalyticsRequestSetup.error, 240)})`,
|
|
2235
|
+
status: ascAnalyticsRequestSetup.ok ? 'pass' : 'fail',
|
|
2236
|
+
});
|
|
2237
|
+
if (!ascAnalyticsRequestSetup.ok) {
|
|
2238
|
+
process.stdout.write(`${JSON.stringify({
|
|
2239
|
+
ok: false,
|
|
2240
|
+
phase: 'asc_analytics_request_setup',
|
|
2241
|
+
configCreated: configResult.created,
|
|
2242
|
+
configPath,
|
|
2243
|
+
heartbeat,
|
|
2244
|
+
openclawCron,
|
|
2245
|
+
hermesCron,
|
|
2246
|
+
projectConfigured: projectConfigured || analyticsProjectSetup.configured,
|
|
2247
|
+
analyticsProjectId: analyticsProjectSetup.projectId || null,
|
|
2248
|
+
ascAppConfigured: ascAppSetup.configured,
|
|
2249
|
+
ascAppId: ascAppSetup.appId || null,
|
|
2250
|
+
ascAppScope: ascAppSetup.appScope || null,
|
|
2251
|
+
ascAnalyticsRequestResults: ascAnalyticsRequestSetup.results || [],
|
|
2252
|
+
connectorSetup,
|
|
2253
|
+
needsUserInput: false,
|
|
2254
|
+
question: null,
|
|
2255
|
+
blockers: [
|
|
2256
|
+
{
|
|
2257
|
+
check: 'connection:asc_analytics_request',
|
|
2258
|
+
detail: `Could not ensure App Store Connect Analytics Report Request: ${truncate(ascAnalyticsRequestSetup.error, 800)}`,
|
|
2259
|
+
remediation: 'Use an ASC API key with Admin for first setup so Growth Engineer can create the ongoing Analytics Report Request. After the request exists, rotate to Sales and Reports for steady-state downloads.',
|
|
2260
|
+
},
|
|
2261
|
+
],
|
|
2262
|
+
}, null, 2)}\n`);
|
|
2263
|
+
process.exitCode = 1;
|
|
2264
|
+
return;
|
|
2265
|
+
}
|
|
2243
2266
|
}
|
|
2244
2267
|
const preflightResult = await runPreflight(configPath, args.testConnections, args.progressJson, args.onlyConnectors);
|
|
2245
2268
|
const preflightPayload = preflightResult.payload;
|