@avocadostudio-ai/cli 0.13.1 → 0.15.0

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/index.js CHANGED
@@ -13886,10 +13886,18 @@ function registerBlock(type, config2) {
13886
13886
  }
13887
13887
  }
13888
13888
  _blockMeta[type] = config2.meta;
13889
+ _imageFieldsCache.delete(type);
13890
+ _listImageFieldsCache.delete(type);
13891
+ _imageFieldMapCache.delete(type);
13892
+ _mediaFieldsCache.delete(type);
13889
13893
  if (!config2.meta.chrome && !allowedBlockTypes.includes(type)) {
13890
13894
  allowedBlockTypes.push(type);
13891
13895
  }
13892
13896
  }
13897
+ var _imageFieldsCache = /* @__PURE__ */ new Map();
13898
+ var _listImageFieldsCache = /* @__PURE__ */ new Map();
13899
+ var _imageFieldMapCache = /* @__PURE__ */ new Map();
13900
+ var _mediaFieldsCache = /* @__PURE__ */ new Map();
13893
13901
  var allowedBlockTypes = G.__ase_allowedBlockTypes ?? (G.__ase_allowedBlockTypes = []);
13894
13902
  var blockInstanceSchemaLenient = external_exports.object({
13895
13903
  id: external_exports.string().min(1),
@@ -14954,7 +14962,8 @@ var updatePropsSchema = external_exports.object({
14954
14962
  op: external_exports.literal("update_props"),
14955
14963
  pageSlug: external_exports.string().min(1),
14956
14964
  blockId: external_exports.string().min(1),
14957
- patch: external_exports.record(external_exports.string(), external_exports.unknown())
14965
+ patch: external_exports.record(external_exports.string(), external_exports.unknown()),
14966
+ imageQuery: external_exports.string().optional()
14958
14967
  });
14959
14968
  var removeBlockSchema = external_exports.object({
14960
14969
  op: external_exports.literal("remove_block"),
@@ -15281,6 +15290,23 @@ var assistantResponseSchema = external_exports.object({
15281
15290
  updatedSlug: external_exports.string().optional(),
15282
15291
  undoSlug: external_exports.string().optional(),
15283
15292
  suggestions: external_exports.array(external_exports.string()).optional(),
15293
+ /**
15294
+ * The ranked form of `suggestions`. Additive: `suggestions` remains the
15295
+ * published shape every integrator reads, and is this field's projection.
15296
+ *
15297
+ * `passthrough()` would carry an unknown key through, but not typed — and the
15298
+ * editor has to read `label`, `prompt` and `id` off each entry, so the schema
15299
+ * has to know them.
15300
+ */
15301
+ suggestionsV2: external_exports.array(external_exports.object({
15302
+ id: external_exports.string(),
15303
+ label: external_exports.string(),
15304
+ prompt: external_exports.string(),
15305
+ kind: external_exports.string(),
15306
+ source: external_exports.string(),
15307
+ score: external_exports.number(),
15308
+ evidence: external_exports.string().optional()
15309
+ }).passthrough()).optional(),
15284
15310
  variations: variationsSchema.optional(),
15285
15311
  debug: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
15286
15312
  error: external_exports.string().optional()
@@ -15552,19 +15578,34 @@ Received ${signal}, shutting down.
15552
15578
  function printHelp() {
15553
15579
  process.stdout.write(
15554
15580
  [
15555
- "avocadostudio - self-host launcher for the Avocado Studio editor",
15581
+ "avocado-studio - self-host launcher for the Avocado Studio editor",
15556
15582
  "",
15557
15583
  "Usage:",
15558
- " avocadostudio start [options] Boot the editor against a running orchestrator",
15559
- " avocadostudio --help Show this help",
15584
+ " avocado-studio start [options] Boot the editor against a running orchestrator",
15585
+ " avocado-studio --help Show this help",
15560
15586
  "",
15561
15587
  "start options:",
15562
15588
  " --orchestrator <url> Orchestrator base URL (env AVOCADO_ORCHESTRATOR_URL, default http://localhost:4200)",
15563
15589
  " --preview <url> Default preview site origin (env AVOCADO_SITE_ORIGIN, default http://localhost:3000)",
15564
15590
  " --publish-token <tok> Forward x-publish-token header (env AVOCADO_PUBLISH_TOKEN)",
15565
- " --draft-secret <s> Site DRAFT_MODE_SECRET; required for editing in production (env DRAFT_MODE_SECRET)",
15591
+ " --draft-secret <s> Site DRAFT_MODE_SECRET; required for editing in production",
15592
+ " (env AVOCADO_SITE_DRAFT_SECRET, then DRAFT_MODE_SECRET)",
15566
15593
  " --port <n> Port to serve the editor on (env PORT, default 4100)",
15567
- " --host <addr> Bind address (default 127.0.0.1)",
15594
+ " --host <addr> Bind address (env HOST, default 127.0.0.1)",
15595
+ "",
15596
+ "The other Avocado commands:",
15597
+ " npm create avocado-site Scaffold a demo, or wire Avocado into this project",
15598
+ " npx @avocadostudio-ai/skills Install the agent skills into this project",
15599
+ " npx avocado-scope <url> See what a live page becomes as blocks",
15600
+ " npx avocado-register Register this site with an orchestrator",
15601
+ " npx avocado-mcp The MCP server (stdio); avocado-mcp-http for HTTP",
15602
+ "",
15603
+ "Docs: https://docs.avocadostudio.dev/reference/cli",
15604
+ "",
15605
+ // `avocadostudio` was the original name and keeps working. It is the odd
15606
+ // one out of five commands that otherwise share the `avocado-` prefix,
15607
+ // which is the whole reason for the rename; breaking it would buy nothing.
15608
+ "`avocadostudio` is an alias for this command and is not going away.",
15568
15609
  ""
15569
15610
  ].join("\n")
15570
15611
  );
@@ -1 +1 @@
1
- import{P as b}from"./chunk-2CNEFIQP-puIR_CEe.js";import{u as y,a as j,E as L,_ as m,L as M,b as p,o as P,i as A}from"./PuckPrototypeRoute-_6Min3Bi.js";import{r as s,j as g}from"./index-t4GQF_RE.js";import{E as N,u as U}from"./index-Dj-sefm6.js";import"./index-5d4qIjDD.js";A();A();function C({content:a,onChange:x,extensions:v,editable:d=!0,onFocusChange:o,name:c}){const[i,E]=P(null,50,{leading:!0,maxWait:200}),l=s.useRef(!1),S=s.useRef(""),f=s.useRef(null),R=!!f.current,_=j(t=>t.state.ui.field.focus===c),T=t=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{S.current===t&&(f.current=null)},200)},u=y(),e=U({extensions:v,content:a,editable:d,immediatelyRender:!1,parseOptions:{preserveWhitespace:"full"},onUpdate:({editor:t})=>{if(l.current||!_){u.getState().setUi({field:{focus:c}});return}const r=t.getHTML(),{from:n,to:h}=t.state.selection;E({from:n,to:h,html:r}),T(r),S.current=r}});return s.useEffect(()=>{if(!e)return;const t=()=>{o==null||o(e)};return e.on("focus",t),()=>{e.off("focus",t)}},[e,o]),s.useEffect(()=>{if(i){const{ui:t}=u.getState().state;x(i.html,{field:m(p({},t.field),{metadata:{from:i.from,to:i.to}})})}},[e,i,x,u,c]),s.useEffect(()=>{e==null||e.setEditable(d)},[e,d]),s.useEffect(()=>{var t;if(!e||R||e.getHTML()===a)return;l.current=!0,e.commands.setContent(a,{emitUpdate:!1});const{ui:n}=u.getState().state;typeof((t=n.field.metadata)==null?void 0:t.from)<"u"&&e.commands.setTextSelection({from:n.field.metadata.from,to:n.field.metadata.to}),l.current=!1},[a,e,u]),e}var F=s.memo(a=>{const{onChange:x,content:v,readOnly:d=!1,field:o,inline:c=!1,onFocus:i,id:E,name:l}=a,{tiptap:S={},options:f}=o,{extensions:R=[]}=S,_=s.useMemo(()=>[b.configure(f),...R],[o,R]),T=y(),u=`${l}${c?"::inline":""}`,e=C({content:v,onChange:x,extensions:_,editable:!d,name:u,onFocusChange:r=>{if(r){const n=T.getState();T.setState({currentRichText:{field:o,editor:r,id:E,inline:c},state:m(p({},n.state),{ui:m(p({},n.state.ui),{field:m(p({},n.state.ui.field),{focus:u})})})}),i==null||i(r)}}}),t=j(r=>{var n,h;return!c&&((n=r.currentRichText)==null?void 0:n.id)===E&&((h=r.currentRichText)!=null&&h.inlineComponentId)?r.currentRichText.editor:e});return e?g.jsx(L,m(p({},a),{editor:e,menu:g.jsx(M,{field:o,editor:t,readOnly:d}),children:g.jsx(N,{editor:e,className:"rich-text"})})):null});F.displayName="Editor";export{F as Editor};
1
+ import{P as b}from"./chunk-2CNEFIQP-Cn4f9wJw.js";import{u as y,a as j,E as L,_ as m,L as M,b as p,o as P,i as A}from"./PuckPrototypeRoute-Dmpe2zrx.js";import{r as s,j as g}from"./index-p97Tzq7e.js";import{E as N,u as U}from"./index-C1VYJ4VW.js";import"./index-D6JZizp6.js";A();A();function C({content:a,onChange:x,extensions:v,editable:d=!0,onFocusChange:o,name:c}){const[i,E]=P(null,50,{leading:!0,maxWait:200}),l=s.useRef(!1),S=s.useRef(""),f=s.useRef(null),R=!!f.current,_=j(t=>t.state.ui.field.focus===c),T=t=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{S.current===t&&(f.current=null)},200)},u=y(),e=U({extensions:v,content:a,editable:d,immediatelyRender:!1,parseOptions:{preserveWhitespace:"full"},onUpdate:({editor:t})=>{if(l.current||!_){u.getState().setUi({field:{focus:c}});return}const r=t.getHTML(),{from:n,to:h}=t.state.selection;E({from:n,to:h,html:r}),T(r),S.current=r}});return s.useEffect(()=>{if(!e)return;const t=()=>{o==null||o(e)};return e.on("focus",t),()=>{e.off("focus",t)}},[e,o]),s.useEffect(()=>{if(i){const{ui:t}=u.getState().state;x(i.html,{field:m(p({},t.field),{metadata:{from:i.from,to:i.to}})})}},[e,i,x,u,c]),s.useEffect(()=>{e==null||e.setEditable(d)},[e,d]),s.useEffect(()=>{var t;if(!e||R||e.getHTML()===a)return;l.current=!0,e.commands.setContent(a,{emitUpdate:!1});const{ui:n}=u.getState().state;typeof((t=n.field.metadata)==null?void 0:t.from)<"u"&&e.commands.setTextSelection({from:n.field.metadata.from,to:n.field.metadata.to}),l.current=!1},[a,e,u]),e}var F=s.memo(a=>{const{onChange:x,content:v,readOnly:d=!1,field:o,inline:c=!1,onFocus:i,id:E,name:l}=a,{tiptap:S={},options:f}=o,{extensions:R=[]}=S,_=s.useMemo(()=>[b.configure(f),...R],[o,R]),T=y(),u=`${l}${c?"::inline":""}`,e=C({content:v,onChange:x,extensions:_,editable:!d,name:u,onFocusChange:r=>{if(r){const n=T.getState();T.setState({currentRichText:{field:o,editor:r,id:E,inline:c},state:m(p({},n.state),{ui:m(p({},n.state.ui),{field:m(p({},n.state.ui.field),{focus:u})})})}),i==null||i(r)}}}),t=j(r=>{var n,h;return!c&&((n=r.currentRichText)==null?void 0:n.id)===E&&((h=r.currentRichText)!=null&&h.inlineComponentId)?r.currentRichText.editor:e});return e?g.jsx(L,m(p({},a),{editor:e,menu:g.jsx(M,{field:o,editor:t,readOnly:d}),children:g.jsx(N,{editor:e,className:"rich-text"})})):null});F.displayName="Editor";export{F as Editor};