stillmade-sdk 0.1.23 → 0.1.24
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/package.json
CHANGED
|
@@ -12,6 +12,10 @@ import {packageFromPortableFiles,withOriginalSource} from '../block-sdk/portable
|
|
|
12
12
|
import {readPortableArchive,writePortableArchive} from '../block-sdk/portable-archive.js';
|
|
13
13
|
const require=createRequire(import.meta.url);
|
|
14
14
|
function archiveCodec(){try{return require('fflate');}catch{return createRequire(new URL('../../client/package.json',import.meta.url))('fflate');}}
|
|
15
|
+
// The importer opens .stillmade-block and .zip files as ZIP archives, so a JSON package never takes
|
|
16
|
+
// those names (October 20, 2026: a Block packed to key-moment-finder.stillmade-block failed
|
|
17
|
+
// import with "Expected a complete single ZIP archive").
|
|
18
|
+
const jsonOutput=(extra,fallback)=>{const output=resolve(extra||fallback),archive=/\.(stillmade-block|zip)$/i.exec(output);if(archive)throw new Error(`Only a complete portable package can use the ${archive[0]} extension. Leave the output name out to write ${fallback}, then import that file in StillMade.`);return output;};
|
|
15
19
|
import {realpathSync} from 'node:fs';
|
|
16
20
|
import {numberedTakes} from '../block-sdk/state-example.js';
|
|
17
21
|
import {initialBlockState,validateBlockState} from '../block-sdk/state.js';
|
|
@@ -274,14 +278,14 @@ export async function main(rawArgs) {
|
|
|
274
278
|
const scan=scanPackage(dependency);
|
|
275
279
|
if(!scan.passed)throw Object.assign(new Error(`${dependency.manifest.name}: Static validation failed`),{report:scan});
|
|
276
280
|
}
|
|
277
|
-
const output=
|
|
281
|
+
const output=jsonOutput(extra,`${pkg.id}-${pkg.version}.stillmade.json`);
|
|
278
282
|
await writeFile(output,JSON.stringify(pkg,null,2),{flag:'wx'});
|
|
279
283
|
return {file:output,digest:await digest(pkg),tests:0,...review,message:'Project Type source packaged without execution. In StillMade, review every embedded hosted Block in StillMade (including ComfyUI backend fixtures and samples), then confirm the import after local admission checks. The connected workflow has not run.'};
|
|
280
284
|
}
|
|
281
285
|
const report = await testProjectType(pkg);
|
|
282
286
|
if (!report.passed) throw Object.assign(new Error('Project Type validation or execution checks need attention'), { report:{...report,...(hosted ? {reviewRequired:true,liveVerified:false} : {})} });
|
|
283
287
|
if (command === 'test') return report;
|
|
284
|
-
const output =
|
|
288
|
+
const output = jsonOutput(extra,`${pkg.id}-${pkg.version}.stillmade.json`);
|
|
285
289
|
await writeFile(output, JSON.stringify(pkg, null, 2), { flag: 'wx' });
|
|
286
290
|
return { file: output, digest: report.digest, tests: (pkg.packages || []).reduce((count,dependency)=>count+dependency.tests.length,0), workflowComplete:report.workflowComplete, workflowStatus:report.workflowStatus };
|
|
287
291
|
}
|
|
@@ -332,14 +336,14 @@ export async function main(rawArgs) {
|
|
|
332
336
|
if(requiresDesktopExecution(pkg)&&['test','pack'].includes(command)){
|
|
333
337
|
const report=await admitLocalPackage(pkg);if(!report.passed)throw Object.assign(new Error('Desktop source admission failed'),{report});
|
|
334
338
|
if(command==='test')return report;
|
|
335
|
-
const output=
|
|
339
|
+
const output=jsonOutput(extra,`${pkg.manifest.id}-${pkg.manifest.version}.stillmade.json`);
|
|
336
340
|
await writeFile(output,JSON.stringify(pkg,null,2),{flag:'wx'});
|
|
337
341
|
return {file:output,digest:report.digest,tests:0,fixtureContracts:pkg.tests.length,execution:'not-run',liveVerified:false,reviewRequired:true,admission:report,message:'Source packaged without native execution. Run and review the declared action through its approved StillMade Desktop adapter.'};
|
|
338
342
|
}
|
|
339
343
|
if(command === 'pack' && ['comfyui','capability'].includes(pkg.manifest.runtime)) {
|
|
340
344
|
const scan=scanPackage(pkg);
|
|
341
345
|
if(!scan.passed)throw Object.assign(new Error('Static validation failed'),{report:scan});
|
|
342
|
-
const output=
|
|
346
|
+
const output=jsonOutput(extra,`${pkg.manifest.id}-${pkg.manifest.version}.stillmade.json`);
|
|
343
347
|
await writeFile(output,JSON.stringify(pkg,null,2),{flag:'wx'});
|
|
344
348
|
return {file:output,digest:await digest(pkg),tests:0,reviewRequired:true,...(pkg.manifest.runtime==='capability'?{liveVerified:false}:{}),message:pkg.manifest.runtime==='capability'?'Source packaged without provider execution. Import into StillMade, choose a model and payment method, and approve the fixtures and sample before confirming installation.':'Source packaged. Import into StillMade to run all fixtures and preview on your connected ComfyUI backend before confirming installation.'};
|
|
345
349
|
}
|
|
@@ -359,7 +363,7 @@ export async function main(rawArgs) {
|
|
|
359
363
|
await writeFile(output,JSON.stringify(createModuleBundle(pkg,files)),{flag:'wx'});
|
|
360
364
|
return {file:output,digest:report.digest,tests:report.results.length,files:Object.keys(pkg.module?.files||{}).length+Object.keys(pkg.view?.files?.files||{}).length,...standInNote(mock),message:'Import this bundle in StillMade (Create, then Import). StillMade checks every file digest and uploads the files once before saving the Block.'};
|
|
361
365
|
}
|
|
362
|
-
const output =
|
|
366
|
+
const output = jsonOutput(extra,`${pkg.manifest.id}-${pkg.manifest.version}.stillmade.json`);
|
|
363
367
|
await writeFile(output, JSON.stringify(pkg, null, 2), { flag: 'wx' });
|
|
364
368
|
return { file: output, digest: report.digest, tests: report.results.length };
|
|
365
369
|
}
|