castle-web-cli 0.4.206 → 0.4.207
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/agent-prompts.js
CHANGED
|
@@ -987,6 +987,7 @@ Operating rules:
|
|
|
987
987
|
- The USER is the verifier -- the whole tasks system exists so the user playtests every change themselves. Your first priority is to finish as soon as possible with the change genuinely in place and reachable in the running deck, so the user can test it right away. Do NOT run verification (screenshots especially) unless ${opts.playtest ? "this task's brief asks for it or " : ""}you are really sure it will catch something a re-read of your own change cannot -- and even then at most one cheap check, never a retry loop. Time spent verifying is time the user is left waiting.
|
|
988
988
|
- The moment implementation is complete and you switch to verifying, write 90 to the progress file -- verification time must not read as stalled progress.
|
|
989
989
|
- Do this one task completely, then stop. Do not expand scope.
|
|
990
|
+
- A fix that comes down to choosing a new number for a value already in the code is a tune, and a tune is a guess the user will keep adjusting. Make that value a key in the file's \`PARAMS\` object as part of the same edit -- the new value as its default, read through \`PARAMS.key\` at the use site, a \`PARAMS_META\` range where one is obvious -- so it reaches the Parameters panel and your notes can link it. Move only the value you tuned, not the file's other constants, and only a value the whole deck shares: a setting each placed thing carries for itself, so two of them can differ, stays where the deck's guide puts it and never goes in \`PARAMS\`. A number the user stated goes in the same way, set exactly as they said it.
|
|
990
991
|
- If the task is to SHOW HOW something is done or to give an example, answer it -- in your streamed output and notes, with a standalone snippet if that helps -- and do NOT insert a demo behavior, blueprint, or actor into their scene; that only happens when the user asked for it in their game. Anything you did add to a scene must be named in your notes by file path and by the actor or blueprint it attached to, so they can find it and take it out.${planRules}
|
|
991
992
|
- SAVE A VERSION when your change is done, so the user can see and undo it: \`castle-web save-version -m "<short description of what you changed>" <each path you touched>\`. Name those paths explicitly -- a bare \`save-version\` with no paths records the WHOLE deck, including files a sibling agent is still working on. One version for the whole task, at the end; not one per file.
|
|
992
993
|
- Overlap with the other agents working in this deck is fine and expected -- do not try to avoid it or wait for them. Saving only your own paths is all that is asked of you; nothing anyone has written is lost by your save.
|
package/dist/serve.js
CHANGED
|
@@ -547,8 +547,32 @@ window.__castleShellOrigin=(function(){
|
|
|
547
547
|
(function(){
|
|
548
548
|
var role=new URLSearchParams(location.search).get('edit')==='0'?'play':'edit';
|
|
549
549
|
var target=window.__castleShellOrigin||'*';
|
|
550
|
+
// How this page's own load went, measured once it has loaded: the host logs it
|
|
551
|
+
// beside its click-to-frame-ready timing, to tell network fan-out (request count,
|
|
552
|
+
// bytes) apart from the deck's own startup work (script time before load).
|
|
553
|
+
var metrics=null;
|
|
554
|
+
var measure=function(){
|
|
555
|
+
try{
|
|
556
|
+
var n=performance.getEntriesByType('navigation')[0];
|
|
557
|
+
if(!n||!n.loadEventEnd)return null;
|
|
558
|
+
var r=performance.getEntriesByType('resource');
|
|
559
|
+
var scripts=0,bytes=0;
|
|
560
|
+
for(var i=0;i<r.length;i++){if(r[i].initiatorType==='script')scripts++;bytes+=r[i].transferSize||0;}
|
|
561
|
+
var fcp=performance.getEntriesByName('first-contentful-paint')[0];
|
|
562
|
+
var ms=function(v){return Math.max(0,Math.round(v));};
|
|
563
|
+
return {ttfbMs:ms(n.responseStart),domContentLoadedMs:ms(n.domContentLoadedEventEnd),loadMs:ms(n.loadEventEnd),firstContentfulPaintMs:fcp?ms(fcp.startTime):null,resources:r.length,scripts:scripts,transferKb:ms(bytes/1024)};
|
|
564
|
+
}catch(e){return null;}
|
|
565
|
+
};
|
|
550
566
|
var announce=function(){
|
|
551
567
|
if(window.parent===window)return;
|
|
568
|
+
if(!metrics)metrics=measure();
|
|
569
|
+
// Deck code ran first and may have replaced performance with something that
|
|
570
|
+
// does not clone; a measurement that cannot be posted must never cost the
|
|
571
|
+
// readiness announcement itself.
|
|
572
|
+
if(metrics){
|
|
573
|
+
try{window.parent.postMessage({type:'castle-content-frame-ready',role:role,metrics:metrics},target);return;}
|
|
574
|
+
catch(e){metrics=null;}
|
|
575
|
+
}
|
|
552
576
|
window.parent.postMessage({type:'castle-content-frame-ready',role:role},target);
|
|
553
577
|
};
|
|
554
578
|
window.addEventListener('message',function(event){
|