buckyos 0.7.195 → 0.7.200

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.
Files changed (65) hide show
  1. package/cli/README.md +20 -0
  2. package/cli/core/app.ts +1 -0
  3. package/cli/core/argv.ts +4 -0
  4. package/cli/dist/cli.mjs +218 -392
  5. package/cli/dist/cli.mjs.map +1 -1
  6. package/cli/modules/aiws.ts +11 -3
  7. package/cli/modules/obj.ts +70 -3
  8. package/cli/runtime/host.ts +2 -0
  9. package/cli/version.ts +1 -1
  10. package/dist/aiworkspace_client.d.ts +20 -2
  11. package/dist/aiworkspace_client.d.ts.map +1 -1
  12. package/dist/aiws_bind-4fe77108.js +2 -0
  13. package/dist/aiws_bind-4fe77108.js.map +1 -0
  14. package/dist/{aiws_bind-ec6fe2d5.mjs → aiws_bind-b851d4db.mjs} +137 -33
  15. package/dist/aiws_bind-b851d4db.mjs.map +1 -0
  16. package/dist/aiws_ext.cjs +1 -1
  17. package/dist/aiws_ext.mjs +1 -1
  18. package/dist/aiws_rrule.d.ts +3 -2
  19. package/dist/aiws_rrule.d.ts.map +1 -1
  20. package/dist/aiws_schedule.d.ts +16 -2
  21. package/dist/aiws_schedule.d.ts.map +1 -1
  22. package/dist/{aiws_write-07562abc.mjs → aiws_write-2f0baa6f.mjs} +2 -2
  23. package/dist/aiws_write-2f0baa6f.mjs.map +1 -0
  24. package/dist/{aiws_write-1f179e1c.js → aiws_write-ad97b561.js} +2 -2
  25. package/dist/aiws_write-ad97b561.js.map +1 -0
  26. package/dist/aiws_write.d.ts +1 -0
  27. package/dist/aiws_write.d.ts.map +1 -1
  28. package/dist/browser.cjs +1 -1
  29. package/dist/browser.mjs +4 -4
  30. package/dist/{content_objid-17daaa69.js → content_objid-0e63f1ff.js} +2 -2
  31. package/dist/{content_objid-17daaa69.js.map → content_objid-0e63f1ff.js.map} +1 -1
  32. package/dist/{content_objid-7605d166.mjs → content_objid-8ebeead4.mjs} +2 -2
  33. package/dist/{content_objid-7605d166.mjs.map → content_objid-8ebeead4.mjs.map} +1 -1
  34. package/dist/index.cjs +1 -1
  35. package/dist/index.mjs +4 -4
  36. package/dist/node.cjs +1 -1
  37. package/dist/node.mjs +3 -3
  38. package/dist/owner-extensions/object_extensions.toml +160 -0
  39. package/dist/owner-extensions/profiles/bindings.json +165 -0
  40. package/dist/owner-extensions/profiles/calendar.json +489 -0
  41. package/dist/owner-extensions/profiles/contacts.json +89 -0
  42. package/dist/owner-extensions/profiles/person.json +193 -0
  43. package/dist/owner-extensions/profiles/sharing.json +65 -0
  44. package/dist/owner-extensions/profiles/todo.json +493 -0
  45. package/dist/owner-extensions/scripts/bindings.mjs +9 -0
  46. package/dist/owner-extensions/scripts/calendar.mjs +3 -0
  47. package/dist/owner-extensions/scripts/contacts.mjs +9 -0
  48. package/dist/owner-extensions/scripts/free_busy.mjs +666 -0
  49. package/dist/owner-extensions/scripts/person.mjs +11 -0
  50. package/dist/owner-extensions/scripts/schedule.mjs +2618 -0
  51. package/dist/owner-extensions/scripts/sharing.mjs +8 -0
  52. package/dist/owner-extensions/scripts/todo.mjs +3 -0
  53. package/dist/owner_availability.d.ts +15 -0
  54. package/dist/owner_availability.d.ts.map +1 -0
  55. package/dist/owner_schedule.d.ts +30 -0
  56. package/dist/owner_schedule.d.ts.map +1 -0
  57. package/dist/task_mgr_client.d.ts +2 -0
  58. package/dist/task_mgr_client.d.ts.map +1 -1
  59. package/package.json +2 -2
  60. package/cli/modules/aiws_schedule.ts +0 -256
  61. package/dist/aiws_bind-1a26e3e6.js +0 -2
  62. package/dist/aiws_bind-1a26e3e6.js.map +0 -1
  63. package/dist/aiws_bind-ec6fe2d5.mjs.map +0 -1
  64. package/dist/aiws_write-07562abc.mjs.map +0 -1
  65. package/dist/aiws_write-1f179e1c.js.map +0 -1
package/dist/aiws_ext.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./aiws_bind-1a26e3e6.js");require("./object_url-88047ee2.js"),require("./ndn_types-5b138882.js");const t="component.json",o="composition.json",s="aiws-manifest.json",i=".aiws-build.json",n="aiws-template/1";class r extends Error{constructor(e){super(e.filter((e=>"error"===e.severity)).map((e=>`${e.file?`${e.file}: `:""}${e.message}`)).join("; ")||"invalid control source"),this.name="AiwsSourceError",this.diagnostics=e}}const a=new TextEncoder,c=new TextDecoder;function l(e,t){return`${e.replace(/\/+$/,"")}/${t}`}function d(e){return e.replace(/[/\\\u0000-\u001f]/g," ").replace(/^\.+/,"").trim().slice(0,80)||"Workspace"}async function f(e){const t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t),(e=>e.toString(16).padStart(2,"0"))).join("")}async function p(e){const t=[];for(const[o,s]of e)t.push([o,await f(s)]);return t.sort(((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0)),`sha256:${await f(a.encode(JSON.stringify(t)))}`}function m(e){return JSON.stringify([...e].sort(((e,t)=>e.name.localeCompare(t.name))).map((e=>[e.name,e.obj_id??e.etag??""])))}const u=4194304;function h(e){let t="";for(let o=0;o<e.length;o+=32768)t+=String.fromCharCode(...e.subarray(o,o+32768));return btoa(t)}async function y(e,t,o=[]){let s=e.reduce(((e,t)=>e+t.bytes.length),0);const i=new Map;if(s>u){if(!t)throw new r([{file:"",severity:"error",message:"a control's inline files are limited to 4194304 bytes per build"}]);for(const o of[...e].sort(((e,t)=>t.bytes.length-e.bytes.length))){if(s<=u)break;i.set(o.name,await t(o.name,o.bytes)),s-=o.bytes.length}}const n=[...o];for(const r of e){const e=i.get(r.name);n.push(e?{name:r.name,obj_id:e}:{name:r.name,base64:h(r.bytes)})}return n.sort(((e,t)=>e.name<t.name?-1:e.name>t.name?1:0))}async function g(e,t,o){var s;const i=[],n=[];for(const a of t)if(null==(s=a.obj_id)?void 0:s.startsWith("cyfile:"))i.push({name:a.name,obj_id:a.obj_id});else{if(!a.node_id)throw new r([{file:a.name,severity:"error",message:"the file service did not name this file"}]);n.push({name:a.name,bytes:new Uint8Array(await(await e.readFile(a.node_id)).arrayBuffer())})}return y(n,o,i)}const b=["manifest_version","ident","kind","title","description","host_api","accepts","allow_no_source","default_size","config_schema","bindings","entry","assets","catalog","agent","deps","events","actions","on_bind","on_init_control"],v=["type","enum","default","required","title","description","minimum","maximum","minLength","maxLength","properties","items"],$=/^[a-z0-9][a-z0-9._-]{0,63}$/,_=/^did:[a-z0-9]+:[^/#\s]+$/,w=/^[a-z][a-z0-9_]{0,31}$/,k=/^did:[a-z0-9]+:[^/#\s]+#[a-z0-9][a-z0-9._-]{0,63}$/,j="needs manifest_version 2 (raise it in component.json)",x="needs manifest_version 3 (raise it in component.json)",S="needs manifest_version 4 (raise it in component.json)",O="needs manifest_version 5 (raise it in component.json)",A=["string","number","boolean","object","entity"],N=["text","value","metric","bar","list","badge"],E=["kind","text","label","bind","by","format","limit"],I=["open_source","activate_editor","open_definition"],z=["text","number","select","boolean","color"];function J(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function q(e){return e.length>0&&a.encode(e).length<=255&&!e.includes("\0")&&e.split("/").every((e=>e.length>0&&!e.startsWith(".")))}function T(e){const t=J(e)?e.properties:void 0;return J(t)?t:{}}function C(e,t,o,s){for(const i of e.matchAll(/\{\{([^}]*)\}\}/g)){const e=i[1].trim();e.startsWith("config.")?e.slice(7)in o||s(`${t}: {{${e}}} names no property of config_schema`):s(`${t}: only {{config.<key>}} may be used here`)}}function W(e,t,o){if(e&&"object"==typeof e&&!Array.isArray(e))for(const[s,i]of Object.entries(e))if(v.includes(s)){if("properties"===s&&i&&"object"==typeof i)for(const[e,s]of Object.entries(i))W(s,`${t}/properties/${e}`,o);"items"===s&&W(i,`${t}/items`,o)}else o.push(`${t}/${s}: keyword ${s} is outside the supported subset`);else o.push(`${t}: a schema is an object`)}function D(e,t={},o="declarative.json"){const s=[],i=(e,t)=>s.push({file:o,severity:"error",message:e,...t?{code:t}:{}}),n=e=>s.push({file:o,severity:"warning",message:e});let r;try{const t=JSON.parse(e);if(!J(t))return i("a declarative definition is a JSON object"),s;r=t}catch(f){return i(f instanceof Error?f.message:String(f)),s}const a=J(t.bindings)?t.bindings:{},c=T(t.configSchema),l=(e,t)=>{if("string"==typeof e)C(e,t,c,i);else if(Array.isArray(e))e.forEach(((e,o)=>l(e,`${t}[${o}]`)));else if(J(e))for(const[o,s]of Object.entries(e))l(s,`${t}.${o}`)},d=(e,o)=>{void 0!==e&&(Array.isArray(e)?e.forEach(((e,s)=>{const r=`${o}[${s}]`;if(J(e))if("button"!==e.kind){"string"==typeof e.kind&&N.includes(e.kind)||i(`${r}.kind ${JSON.stringify(e.kind)}: one of ${[...N,"button"].join(", ")}`);for(const t of Object.keys(e))E.includes(t)||n(`${r}: key ${t} is ignored by the interpreter`);if(void 0===e.format||["text","number","percent","currency"].includes(e.format)||i(`${r}.format ${JSON.stringify(e.format)}: text, number, percent or currency`),"string"==typeof e.bind&&e.bind.includes(".")){const t=e.bind.slice(0,e.bind.indexOf("."));"props"===t||t in a||n(`${r}.bind ${JSON.stringify(e.bind)}: ${t} is not a declared binding, so it reads the field ${JSON.stringify(e.bind)} of the main source`)}}else((e,o)=>{void 0!==t.manifestVersion&&t.manifestVersion<3&&i(`${o}: a button ${x}`);for(const t of Object.keys(e))["kind","label","emit","params"].includes(t)||n(`${o}: key ${t} is ignored by the interpreter`);"string"==typeof e.label&&e.label||i(`${o}.label: the button's text (required)`),"string"==typeof e.emit&&e.emit?t.events&&!t.events.includes(e.emit)&&i(`${o}.emit ${e.emit}: not an event of component.json`,"EVENT_UNDECLARED"):i(`${o}.emit: the event the button raises (required)`),void 0!==e.params&&(J(e.params)?l(e.params,`${o}.params`):i(`${o}.params must be an object`))})(e,r);else i(`${r} must be an object`)})):i(`${o} must be an array`))};for(const[p,m]of Object.entries(r))"layout"===p?"stack"!==m&&"row"!==m&&i("layout: stack or row"):"items"===p?d(m,"items"):"view"===p?d(J(m)?m.items:void 0,"view.items"):"accent"===p?"string"!=typeof m&&i("accent must be a colour string"):"actions"===p?(Array.isArray(m)?m:[]).forEach(((e,t)=>{const o=J(e)?e:{};"string"==typeof o.command&&I.includes(o.command)||i(`actions[${t}].command: one of ${I.join(", ")}`),"string"==typeof o.id&&"string"==typeof o.label||i(`actions[${t}] needs id and label`)})):"inspector"===p?(Array.isArray(m)?m:[]).forEach(((e,t)=>{const o=J(e)?e:{};"string"==typeof o.kind&&z.includes(o.kind)||i(`inspector[${t}].kind: one of ${z.join(", ")}`),"string"==typeof o.key&&"string"==typeof o.label||i(`inspector[${t}] needs key and label`)})):n(`key ${p} is not part of the declarative vocabulary`);return void 0===r.items&&void 0===r.view&&n("no items: the control draws nothing"),s}function B(e,t,s=o,i={}){const n=[],r=(e,t)=>n.push({file:s,severity:"error",message:e,...t?{code:t}:{}});let c;try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return r("a composition is a JSON object { layout, slots, chrome?, events? }"),n;c=t}catch(g){return r(g instanceof Error?g.message:String(g)),n}const l=T(t),d=(e,t)=>C(e,t,l,r),f=(e,t,o)=>{"number"==typeof e&&e>=0&&e<=o||("string"==typeof e&&/^\s*\{\{.*\}\}\s*$/.test(e)?d(e,t):r(`${t}: a number in [0, ${o}] or {{config.<key>}}`))},p=void 0!==i.manifestVersion&&i.manifestVersion<4;for(const o of Object.keys(c))["layout","slots","chrome","events","projections","media"].includes(o)?"projections"!==o&&"media"!==o||!p||r(`${o} ${S}`):r(`unknown key ${o} (a composition says layout, slots, chrome, events, projections and media)`);const m=c.layout;let u="stack";if(m&&"object"==typeof m){"stack"===m.algorithm||"fixed"===m.algorithm||"grid"===m.algorithm?u=m.algorithm:r(`layout.algorithm ${JSON.stringify(m.algorithm)}: stack, fixed or grid (the algorithms the host ships)`);for(const[e,t]of Object.entries(m))if("algorithm"!==e)if("direction"!==e&&"spacing"!==e||"stack"===u)if("columns"!==e&&"gap"!==e||"grid"===u)if("direction"===e)"column"!==t&&"row"!==t&&r("layout.direction: column or row");else if("spacing"===e)f(t,"layout.spacing",2e3);else if("columns"===e)(!Number.isInteger(t)||t<1||t>12)&&r("layout.columns: an integer in [1, 12]");else if("gap"===e)f(t,"layout.gap",2e3);else if("padding"===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const[o,s]of Object.entries(t))["t","r","b","l"].includes(o)||r(`layout.padding.${o}: t, r, b or l`),f(s,`layout.padding.${o}`,2e3);else f(t,"layout.padding",2e3);else r(`layout: unknown key ${e}`);else r(`layout.${e} belongs to the grid layout`);else r(`layout.${e} belongs to the stack layout`);"grid"===u&&void 0===m.columns&&r("layout.columns (1…12) required: the cells of a grid row")}else r("layout { algorithm: stack | fixed | grid } required");const h=c.slots&&"object"==typeof c.slots&&!Array.isArray(c.slots)?c.slots:null;if(h){Object.keys(h).length>16&&r("at most 16 slots");for(const[e,t]of Object.entries(h)){const o=`slots.${e}`;if(w.test(e)||r(`${o}: a slot name is [a-z][a-z0-9_]{0,31}`),!t||"object"!=typeof t||Array.isArray(t)){r(`${o} must be an object`);continue}const s=t;for(const[e,t]of Object.entries(s))if("accepts"===e){if(!Array.isArray(t)||0===t.length||t.length>32){r(`${o}.accepts: 1…32 entries (cell:<ident>, a view type, container)`);continue}for(const e of t)"string"==typeof e&&e.startsWith("cell:")?(!k.test(e.slice(5))||a.encode(e.slice(5)).length>128)&&r(`${o}.accepts ${JSON.stringify(e)}: cell:<author_did>#<name>`):"container"===e||"string"==typeof e&&$.test(e)||r(`${o}.accepts ${JSON.stringify(e)}: cell:<ident>, a view type or container`)}else if("min"===e)(!Number.isInteger(t)||t<0||t>64)&&r(`${o}.min: an integer in [0, 64]`);else if("max"===e)(!Number.isInteger(t)||t<1||t>1e3)&&r(`${o}.max: an integer in [1, 1000]`);else if("placement"===e)"stack"!==t&&"top"!==t&&"bottom"!==t&&"free"!==t?r(`${o}.placement: stack, top, bottom or free`):"fixed"===u&&"free"!==t?r(`${o}.placement: a fixed layout keeps every child where it is (free)`):"grid"===u&&"stack"!==t&&r(`${o}.placement: a grid fills its cells with the slots' children in slot order (stack)`);else if("title"===e)("string"!=typeof t||t.length>256)&&r(`${o}.title: at most 256 characters`);else if("visible"===e){if(p){r(`${o}.visible ${S}`);continue}const e=t;!J(e)||"first_open"!==e.from||Object.keys(e).some((e=>"from"!==e&&"for_ms"!==e))?r(`${o}.visible: { from: "first_open", for_ms }`):"string"==typeof e.for_ms?d(e.for_ms,`${o}.visible.for_ms`):(!Number.isInteger(e.for_ms)||e.for_ms<1||e.for_ms>316224e5)&&r(`${o}.visible.for_ms: milliseconds (≤ a year) or {{config.<key>}}`)}else r(`${o}: unknown key ${e}`);Number.isInteger(s.min)&&Number.isInteger(s.max)&&s.min>s.max&&r(`${o}: min exceeds max`)}}else r("slots { <name>: { accepts?, min?, max?, placement? } } required");const y=c.chrome;if(void 0!==y)if(!y||"object"!=typeof y||Array.isArray(y))r("chrome must be an object");else for(const[o,a]of Object.entries(y)){const e=`chrome.${o}`;if("background"===o||"border"===o)"string"==typeof a&&a.length<=64?d(a,e):r(`${e}: a colour (≤ 64 characters) or {{config.<key>}}`);else if("radius"===o)f(a,e,200);else if("empty"===o)"string"==typeof a&&a.length<=1e3?d(a,e):r(`${e}: a text of at most 1000 characters`);else if("title"===o){const t=a;if(!t||"object"!=typeof t||Array.isArray(t)){r(`${e}: { text, slot? }`);continue}for(const[e,o]of Object.entries(t))"text"===e?"string"==typeof o&&o.length<=256?d(o,"chrome.title.text"):r("chrome.title.text: at most 256 characters"):"slot"===e?"string"==typeof o&&h&&o in h||r(`chrome.title.slot ${JSON.stringify(o)}: a slot of this composition`):r(`chrome.title: unknown key ${e}`);"string"!=typeof t.text&&r("chrome.title.text required")}else r(`chrome: unknown key ${o} (background, radius, border, title, empty)`)}if(void 0!==c.events)if(void 0!==i.manifestVersion&&i.manifestVersion<3&&r(`events ${x}`),J(c.events)){Object.keys(c.events).length>16&&r("events: at most 16");for(const[e,t]of Object.entries(c.events)){const o=`events.${e}`;if(w.test(e)||r(`${o}: an event name is [a-z][a-z0-9_]{0,31}`),!J(t)){r(`${o} must be an object { from: { slot, event }, title?, description? }`);continue}for(const[e,i]of Object.entries(t))if("title"===e)("string"!=typeof i||i.length>256)&&r(`${o}.title: at most 256 characters`);else if("description"===e)("string"!=typeof i||i.length>4e3)&&r(`${o}.description: at most 4000 characters`);else if("on"===e){const e=Array.isArray(i)?i:[i];p?r(`${o}.on ${S}`):(0===e.length||e.length>4||e.some((e=>!J(e)||!["write","wish","open","notify"].includes(String(e.kind)))))&&r(`${o}.on: a handler (write, wish, open, notify) or 1…4 of them`)}else"from"!==e&&r(`${o}: unknown key ${e} (from, title, description, on)`);const s=t.from;if(!J(s)){r(`${o}.from { slot, event } required: the child event it re-raises`);continue}if(void 0!==s.projection){if(p){r(`${o}.from.projection ${S}`);continue}const e=J(c.projections)?c.projections:{};"string"==typeof s.projection&&s.projection in e||r(`${o}.from.projection ${JSON.stringify(s.projection)}: a projection of this composition`),void 0===s.role||"string"==typeof s.role&&w.test(s.role)||r(`${o}.from.role: a role name of its template`);for(const t of Object.keys(s))"projection"!==t&&"role"!==t&&r(`${o}.from: unknown key ${t} (projection, role)`);continue}for(const e of Object.keys(s))"slot"!==e&&"event"!==e&&r(`${o}.from: unknown key ${e} (slot, event)`);const n="string"==typeof s.event&&w.test(s.event)?s.event:void 0;n||r(`${o}.from.event: an event name [a-z][a-z0-9_]{0,31}`);const a="string"==typeof s.slot&&h?h[s.slot]:void 0;if(!J(a)){r(`${o}.from.slot ${JSON.stringify(s.slot)}: a slot of this composition`);continue}if(!n)continue;const l=(Array.isArray(a.accepts)?a.accepts:[]).filter((e=>"string"==typeof e&&e.startsWith("cell:"))).map((e=>e.slice(5)));if(0===l.length){r(`${o}: slot ${s.slot} accepts no cell:<ident>, so no control there declares ${n}`,"EVENT_UNDECLARED");continue}l.map((e=>{var t;return null==(t=i.cellEvents)?void 0:t.call(i,e)})).every((e=>void 0!==e&&!e.includes(n)))&&r(`${o}: no control slot ${s.slot} accepts (${l.join(", ")}) declares the event ${n}`,"EVENT_UNDECLARED")}}else r("events must be an object { <name>: { from: { slot, event }, title?, description? } }");if(void 0!==c.projections&&!p)if(!J(c.projections)||Object.keys(c.projections).length>8)r("projections: at most 8 of name → { source, template, layout }");else for(const[o,a]of Object.entries(c.projections)){const e=`projections.${o}`;if(w.test(o)||r(`${e}: a projection name is [a-z][a-z0-9_]{0,31}`),!J(a)){r(`${e} must be an object`);continue}for(const o of Object.keys(a))["source","mark","template","layout","placement","max_items"].includes(o)||r(`${e}: unknown key ${o} (source, mark, template, layout, placement, max_items)`);const t=a.source,s=J(t)?t.kind:void 0;(!J(t)||!["records","members","counts","viewer"].includes(String(s))||"viewer"!==s&&"string"!=typeof t.binding||"counts"===s&&"string"!=typeof t.field)&&r(`${e}.source: { kind: records | members | counts | viewer, binding (a binding name), field? (counts) }`);const i=J(a.template)&&Array.isArray(a.template.nodes)?a.template.nodes:null;!i||0===i.length||i.length>32?r(`${e}.template: { nodes: [1…32 of { id, view: label | shape | asset, box?, config?, when?, role? }] }`):i.forEach(((t,o)=>{J(t)&&"string"==typeof t.id&&w.test(t.id)?["label","shape","asset"].includes(String(t.view))||r(`${e}.template.nodes[${o}].view: label, shape or asset`):r(`${e}.template.nodes[${o}].id: a name [a-z][a-z0-9_]{0,31}`)}));const n=a.layout;!J(n)||"list"!==n.algorithm&&"grid"!==n.algorithm||!J(n.item)||void 0===n.item.h?r(`${e}.layout: { algorithm: list | grid, columns? (grid), gap?, item: { w?, h } }`):"grid"===n.algorithm&&void 0===n.columns&&r(`${e}.layout.columns required (grid)`),void 0===a.placement||["top","stack","bottom"].includes(String(a.placement))||r(`${e}.placement: top, stack or bottom`)}if(void 0!==c.media&&!p){const e=c.media;(!J(e)||"string"!=typeof e.slot||!h||!(e.slot in h)||"string"!=typeof e.anchor||Object.keys(l).length>0&&!(e.anchor in l))&&r("media: { slot (a slot of this composition), anchor (a config property), loop? (a config property) }")}return n}function L(o,s,i,n){const r=[],c=t,l=e=>r.push({file:c,severity:"error",message:e});let d;try{const e=JSON.parse(o);if(!e||"object"!=typeof e||Array.isArray(e))return l("must be a JSON object"),r;d=e}catch(E){return l(E instanceof Error?E.message:String(E)),r}for(const e of Object.keys(d))b.includes(e)||l(`unknown key ${e}`);const f=d.manifest_version,p="number"==typeof f&&Number.isInteger(f)&&f>=1?f:0;void 0!==d.actions&&(p>0&&p<4?l(`actions ${S}`):!Array.isArray(d.actions)||d.actions.length>16?l("actions: at most 16 of { id, title, icon?, modes?, needs?, run }"):d.actions.forEach(((e,t)=>{if(J(e)&&"string"==typeof e.id&&w.test(e.id)&&"string"==typeof e.title&&e.title){const o=Array.isArray(e.run)?e.run:[e.run];(0===o.length||o.length>4||o.some((e=>!J(e)||!["write","wish","open","notify","config","forward"].includes(String(e.kind)))))&&l(`actions[${t}].run: a handler (write, wish, open, notify, config, forward) or 1…4 of them`)}else l(`actions[${t}]: { id, title, run } (id a name [a-z][a-z0-9_]{0,31})`)}))),p?p>5&&l(`manifest_version ${f} is newer than this client reads (5)`):l("manifest_version (1…5) required");const m=p>0&&p<3,u=d.ident;let h="";u&&"object"==typeof u?("string"==typeof u.author_did&&_.test(u.author_did)||l("ident.author_did must be a DID (did:<method>:<id>)"),"string"==typeof u.name&&$.test(u.name)||l("ident.name must be [a-z0-9][a-z0-9._-]{0,63}"),"string"==typeof u.author_did&&"string"==typeof u.name&&(h=`${u.author_did}#${u.name}`,a.encode(h).length>128&&l("an identity is at most 128 bytes"))):l("ident { author_did, name } required");const y="composite"===d.kind;if("declarative"===d.kind||"html"===d.kind||y||l("kind must be declarative, html or composite"),y&&1===p&&l(`kind composite ${j}`),y)for(const e of["accepts","allow_no_source"])void 0!==d[e]&&l(`${e}: a composite is a container of Blocks, not a Cell showing data`);if(("string"!=typeof d.title||!d.title||d.title.length>256)&&l("title: 1…256 characters"),void 0!==d.config_schema){const e=[];W(d.config_schema,"config_schema",e),e.forEach(l)}if(void 0!==d.bindings)if(d.bindings&&"object"==typeof d.bindings)for(const[e,t]of Object.entries(d.bindings))if(w.test(e)&&"props"!==e||l(`binding name ${e}: [a-z][a-z0-9_]{0,31}, not props`),J(t)){for(const o of Object.keys(t))["accepts","required","many","schema_id","title","description"].includes(o)||l(`binding ${e}: unknown key ${o}`);void 0!==t.many&&"boolean"!=typeof t.many&&l(`binding ${e}.many: true or false`),void 0!==t.schema_id&&("string"!=typeof t.schema_id||!t.schema_id||t.schema_id.length>128)&&l(`binding ${e}.schema_id: a schema id such as buckyos.todo@1`)}else l(`binding ${e} must be an object`);else l("bindings must be an object");if(void 0!==d.on_bind||void 0!==d.on_init_control)if(p>0&&p<5)l(`on_bind / on_init_control ${O}`);else if("html"===d.kind){for(const[e,t]of[["on_bind","bind"],["on_init_control","init_control"]])void 0!==d[e]&&"script"!==d[e]&&l(`${e}: an HTML control writes "script" (its behavior.js handles aiws.on('${t}'))`);"number"==typeof d.host_api&&d.host_api>=5||l("on_bind / on_init_control \"script\": aiws.on('bind') / aiws.on('init_control') need host_api 5")}else if("composite"!==d.kind)l('on_bind / on_init_control: declared steps are for a composite, "script" for an HTML control');else{const t=Array.isArray(d.actions)?d.actions.filter(J).map((e=>String(e.id))):[];e.checkBindSteps(d.on_bind,d.on_init_control,J(d.bindings)?d.bindings:{},t).forEach(l)}if(void 0!==d.deps)if(!Array.isArray(d.deps)||d.deps.length>32)l("deps: at most 32 identities <author_did>#<name>");else if(d.deps.length>0&&1===p)l(`deps ${j}`);else{const e=new Set;for(const t of d.deps)"string"==typeof t&&k.test(t)?t===h?l("deps: a control cannot depend on itself"):e.has(t)&&l(`deps lists ${t} twice`):l(`deps: ${JSON.stringify(t)} is not an identity <author_did>#<name>`),e.add(String(t))}let g=[];if(void 0!==d.events){if(y)l("events: a composite declares its events in composition.json (events.<name>.from re-raises an event of a child)");else if(m)l(`events ${x}`);else{const e=[];!function(e,t){if(J(e)){Object.keys(e).length>16&&t.push("events: at most 16");for(const[o,s]of Object.entries(e)){const e=`events.${o}`;if(w.test(o)||t.push(`${e}: an event name is [a-z][a-z0-9_]{0,31}`),J(s)){for(const[o,i]of Object.entries(s))"title"===o?("string"!=typeof i||i.length>256)&&t.push(`${e}.title: at most 256 characters`):"description"===o?("string"!=typeof i||i.length>4e3)&&t.push(`${e}.description: at most 4000 characters`):"params"!==o&&t.push(`${e}: unknown key ${o} (title, description, params)`);if(void 0!==s.params)if(J(s.params)){Object.keys(s.params).length>16&&t.push(`${e}.params: at most 16`);for(const[o,i]of Object.entries(s.params)){const s=`${e}.params.${o}`;if(w.test(o)||t.push(`${s}: a param name is [a-z][a-z0-9_]{0,31}`),J(i)){for(const[e,o]of Object.entries(i))"type"===e?"string"==typeof o&&A.includes(o)||t.push(`${s}.type: ${A.join(", ")}`):"required"===e?"boolean"!=typeof o&&t.push(`${s}.required must be a boolean`):"description"===e?("string"!=typeof o||o.length>1e3)&&t.push(`${s}.description: at most 1000 characters`):t.push(`${s}: unknown key ${e} (type, required, description)`);void 0===i.type&&t.push(`${s}.type required`)}else t.push(`${s} must be an object { type, required?, description? }`)}}else t.push(`${e}.params must be an object { <param>: { type, required?, description? } }`)}else t.push(`${e} must be an object { title?, description?, params? }`)}}else t.push("events must be an object { <name>: { title?, description?, params? } }")}(d.events,e),e.forEach(l)}!y&&J(d.events)&&(g=Object.keys(d.events))}const v=e=>"string"==typeof e&&s.includes(e),N=new Set([c]);if("html"===d.kind){const e=d.entry;if(e&&"object"==typeof e&&"string"==typeof e.html)for(const[t,o]of Object.entries(e))v(o)?N.add(String(o)):l(`entry.${t} ${JSON.stringify(o)} is not in the directory`);else l("entry must be { html, css?, js? }");void 0===d.host_api||[2,3,4,5,6].includes(d.host_api)?(5===d.host_api||6===d.host_api)&&p<5?l(`host_api ${d.host_api} ${O}`):4===d.host_api&&p<4?l(`host_api 4 ${S}`):3===d.host_api&&m&&l(`host_api 3 ${x}`):l("host_api: the HTML Block host speaks API 2, 3, 4, 5 and 6"),g.length>0&&!("number"==typeof d.host_api&&d.host_api>=3)&&r.push({file:c,severity:"warning",message:"events: an HTML control raises them with aiws.emit, which is host API 3 (set host_api to 3 or later)"})}else if("declarative"===d.kind||y){if(v(d.entry)){N.add(String(d.entry));const e=null==i?void 0:i(String(d.entry)),t=p||void 0;void 0!==e&&y?r.push(...B(e,d.config_schema,String(d.entry),{manifestVersion:t,cellEvents:n})):void 0!==e&&r.push(...D(e,{bindings:d.bindings,events:g,configSchema:d.config_schema,manifestVersion:t},String(d.entry)))}else l(`entry ${JSON.stringify(d.entry)} is not in the directory`);y&&void 0!==d.host_api&&l("host_api: a composite runs no code of its own (its layout and chrome are the host's)"),y||void 0===d.host_api||1===d.host_api||l("host_api: the declarative interpreter is version 1")}for(const e of Array.isArray(d.assets)?d.assets:[])v(e)?N.add(String(e)):l(`asset ${JSON.stringify(e)} is not in the directory`);void 0!==d.agent&&(v(d.agent)?N.add(String(d.agent)):l(`agent ${JSON.stringify(d.agent)} is not in the directory`));for(const e of s)q(e)?N.has(e)||r.push({file:e,severity:"warning",message:"not named by component.json: kept in the source snapshot only"}):r.push({file:e,severity:"error",message:"a file of a source directory: a relative path whose parts do not start with '.'"});return r}function M(e){if(!e||"object"!=typeof e)throw new r([{file:s,severity:"error",message:"must be a JSON object"}]);const t=e,o=t.manifest_version;if("number"!=typeof o||o<1)throw new r([{file:s,severity:"error",message:"manifest_version required"}]);if(o>5)throw new r([{file:s,severity:"error",message:`manifest_version ${o} needs a newer client (this one reads 5)`}]);if("aiws"!==t.purpose)throw new r([{file:s,severity:"error",message:"purpose must be aiws"}]);if(!Array.isArray(t.controls))throw new r([{file:s,severity:"error",message:"controls must be an array"}]);return{manifest_version:o,purpose:"aiws",host_api:t.host_api??{},controls:t.controls,workspace_templates:Array.isArray(t.workspace_templates)?t.workspace_templates:[]}}const F=/^[a-z0-9][a-z0-9-]{0,63}$/;function V(e){return`templates/${e}/`}async function R(e,t){const o=V(t),s=[];for(const[i,n]of e)i.startsWith(o)&&s.push([i.slice(o.length),n]);return p(s)}function P(e,t){if(!J(e))return["a template is an object { id, title, snapshot, digest, requires, description?, params?, reset? }"];const o=[];for(const i of Object.keys(e))["id","title","description","snapshot","digest","requires","params","reset"].includes(i)||o.push(`unknown key ${i}`);"string"==typeof e.id&&F.test(e.id)?e.snapshot!==`${V(e.id)}snapshot.json`&&o.push(`snapshot must be ${V(e.id)}snapshot.json`):o.push("id: [a-z0-9][a-z0-9-]{0,63}"),("string"!=typeof e.title||!e.title||e.title.length>256)&&o.push("title: 1…256 characters"),void 0!==e.description&&("string"!=typeof e.description||e.description.length>4e3)&&o.push("description: at most 4000 characters"),"string"==typeof e.digest&&/^sha256:[0-9a-f]{64}$/.test(e.digest)||o.push("digest: sha256:<64 hex digits>");const s=e.requires;if(J(s)){for(const e of Object.keys(s))"host_api"!==e&&"controls"!==e&&o.push(`requires: unknown key ${e}`);if(void 0!==s.host_api)if(J(s.host_api))for(const[e,t]of Object.entries(s.host_api))("html"!==e&&"declarative"!==e||!Number.isInteger(t)||t<1)&&o.push(`requires.host_api.${e}: html or declarative, a positive integer`);else o.push("requires.host_api must be an object { html?, declarative? }");if(!Array.isArray(s.controls)||s.controls.length>256)o.push("requires.controls: at most 256 identities");else{const e=new Set;for(const i of s.controls)"string"==typeof i&&t.has(i)?e.has(i)&&o.push(`requires.controls lists ${i} twice`):o.push(`requires.controls: ${JSON.stringify(i)} is not a control of this manifest`),e.add(i)}}else o.push("requires { host_api?, controls } required");if(void 0!==e.params)if(!J(e.params)||Object.keys(e.params).length>32)o.push("params: an object of at most 32 { type, title?, default? }");else for(const[i,n]of Object.entries(e.params)){const e=`params.${i}`;if(w.test(i)||o.push(`${e}: a param name is [a-z][a-z0-9_]{0,31}`),J(n)){for(const[t,s]of Object.entries(n))"type"===t?"string"!==s&&"number"!==s&&"boolean"!==s&&o.push(`${e}.type: string, number or boolean`):"title"===t?("string"!=typeof s||s.length>256)&&o.push(`${e}.title: at most 256 characters`):"default"===t?["string","number","boolean"].includes(typeof s)||o.push(`${e}.default: a string, number or boolean`):o.push(`${e}: unknown key ${t} (type, title, default)`);void 0===n.type&&o.push(`${e}.type required`)}else o.push(`${e} must be an object { type, title?, default? }`)}if(void 0!==e.reset){const t=J(e.reset)?e.reset.tables:void 0;!J(e.reset)||Object.keys(e.reset).some((e=>"tables"!==e))?o.push("reset: { tables }"):void 0!==t&&(!Array.isArray(t)||t.length>64||new Set(t).size!==t.length||t.some((e=>"string"!=typeof e||!/^[a-z0-9][a-z0-9_-]{0,63}$/.test(e))))&&o.push("reset.tables: at most 64 distinct table ids")}return o}async function U(e,t,o){const s=/[*?[\]\\]/.test(o)?void 0:o;return(await e.list("string"==typeof t?t:{ref:t},{limit:s?10:1e3,...s?{filter:{name_glob:s}}:{}},["base","ident"])).entries.find((e=>e.name===o))}async function G(e,t){const o=t.split("/").filter(Boolean);if(0===o.length)throw new Error(`not a folder path: ${t}`);let s=(await e.stat(`/${o[0]}`)).ref;for(const i of o.slice(1)){const o=await U(e,s,i);if(o&&"dir"!==o.target.kind)throw new r([{file:i,severity:"error",message:`${i} in ${t} is not a folder`}]);s=o?o.target.ref:(await e.mkdir({ref:s},i)).ref}return s}async function H(e,t){const o=t.split("/").filter(Boolean);if(0===o.length)return null;let s=(await e.stat(`/${o[0]}`)).ref;for(const i of o.slice(1)){const t=await U(e,s,i);if(!t||"dir"!==t.target.kind)return null;s=t.target.ref}return s}async function K(e,o){const s=await H(e,o);return null!==s&&void 0!==await U(e,s,t)}async function X(e,t,o,s){const i="string"==typeof t?await G(e,t):t;await e.uploadFile(i,o,s,{overwrite:!0})}const Y=e=>new Promise((t=>setTimeout(t,e)));async function Q(e,t){const o=[],s=[],i=async(t,n,r)=>{var a,c,l;let d;do{const f=await e.list("string"==typeof t?t:{ref:t},{limit:500,...d?{cursor:d}:{}},["base","ident"]);for(const e of f.entries){if(e.name.startsWith("."))continue;const t=`${n}${e.name}`;if("dir"===e.target.kind){r>=8?s.push({file:t,severity:"error",message:"sub-folders nest at most 8 levels"}):await i(e.target.ref,`${t}/`,r+1);continue}if("file"!==e.target.kind){s.push({file:t,severity:"error",message:"only files and folders belong to a control source"});continue}const d=e.target.ref,f="object"===d.type?d.obj_id:"string"==typeof(null==(a=e.target.attrs)?void 0:a.obj_id)?e.target.attrs.obj_id:void 0;o.push({name:t,...f?{obj_id:f}:{},..."live"===d.type?{node_id:d.node_id}:{},..."string"==typeof(null==(c=e.target.attrs)?void 0:c.etag)?{etag:e.target.attrs.etag}:{},..."number"==typeof(null==(l=e.target.attrs)?void 0:l.size)?{size:e.target.attrs.size}:{}})}d=f.truncated?f.next_cursor:void 0}while(d)};if(await i(t,"",0),0===o.length&&s.push({file:"",severity:"error",message:`${t} holds no files`}),o.length>64&&s.push({file:"",severity:"error",message:"a control holds at most 64 files"}),s.some((e=>"error"===e.severity)))throw new r(s);return o.sort(((e,t)=>e.name<t.name?-1:e.name>t.name?1:0))}async function Z(e,t,o,s){const i=o.lastIndexOf("/");await X(e,i<0?t:l(t,o.slice(0,i)),i<0?o:o.slice(i+1),s)}async function ee(e,t){const o=[];for(const s of t){if(!s.node_id)throw new r([{file:s.name,severity:"error",message:"the file service did not name this file"}]);o.push([s.name,new Uint8Array(await(await e.readFile(s.node_id)).arrayBuffer())])}return p(o)}async function te(e,t){try{const o=await U(e,t,i),s="live"===(null==o?void 0:o.target.ref.type)?o.target.ref.node_id:void 0;if(!s)return null;const n=await e.readFile(s);return await n.json()}catch{return null}}async function oe(e,t,o){await X(e,t,i,a.encode(`${JSON.stringify(o,null,2)}\n`))}exports.AIWS_BUILD_STATE_FILE=i,exports.AIWS_COMPONENT_FILE=t,exports.AIWS_COMPOSITION_FILE=o,exports.AIWS_DECLARATIVE_API_VERSION=1,exports.AIWS_HTML_API_VERSION=6,exports.AIWS_MANIFEST_FILE=s,exports.AIWS_MANIFEST_VERSION=5,exports.AIWS_MAX_INLINE_BYTES=u,exports.AIWS_MAX_SOURCE_FILES=64,exports.AIWS_TEMPLATE_FORMAT=n,exports.AiwsSourceError=r,exports.aiwsContentDigest=p,exports.aiwsTemplateDigest=R,exports.buildControl=async function(e,t,o,s,i={}){const n=await Q(t,s),r=await te(t,s),a=r&&r.workspace_id===o?{def_rev:r.def_rev,dir_rev:r.dir_rev}:void 0,c=await e.extBuild(o,{files:await g(t,n,i.upload),...i.folderId?{folder_id:i.folderId}:{},...a?{expect:a}:{},...i.force?{force:!0}:{},...i.dryRun?{dry_run:!0}:{},...i.migration?{migration:i.migration}:{}});return i.dryRun||"string"!=typeof c.def_entity_id||"number"!=typeof c.def_rev||await oe(t,s,{workspace_id:o,def_entity_id:c.def_entity_id,def_rev:c.def_rev,dir_rev:Number(c.dir_rev??0),ident:String(c.ident??""),at:(new Date).toISOString()}),{...c,files:n}},exports.buildFiles=g,exports.checkComponent=L,exports.checkComposition=B,exports.checkDeclarative=D,exports.collectSources=Q,exports.compatManifest=M,exports.controlSkeleton=function(e){const s=e.title??e.name;if("composite"===e.kind){const i="fixed"===e.algorithm,n=e.slots??{items:{placement:i?"free":"stack",title:"Items"}},r={layout:i?{algorithm:"fixed",padding:12}:{algorithm:"stack",direction:"column",spacing:"{{config.gap}}",padding:12},slots:n,chrome:{background:"{{config.background}}",radius:12,title:{text:"{{config.title}}"},empty:"Drop Blocks here"}},a={manifest_version:5,ident:{author_did:e.authorDid,name:e.name},kind:"composite",title:s,description:`${s}: a panel of Blocks`,default_size:{w:320,h:360},config_schema:{type:"object",properties:{title:{type:"string",title:"Title",default:s},background:{type:"string",title:"Background",default:"#f6f7fb"},gap:{type:"integer",title:"Gap (px)",default:8,minimum:0,maximum:64}}},entry:o,deps:e.deps??[],catalog:{group:"custom",description:`${s}`},agent:"AGENT.md"},c=Object.keys(n).map((e=>`\`${e}\``)).join(", ");return{[t]:`${JSON.stringify(a,null,2)}\n`,[o]:`${JSON.stringify(r,null,2)}\n`,"AGENT.md":`# ${s}\n\nA composite: an instance is a \`buckyos.container { kind: "composite", def_ref }\`; put Blocks under it with \`slot\` set to one of ${c}. Config: \`title\`, \`background\`, \`gap\`.\n`}}const i={manifest_version:5,ident:{author_did:e.authorDid,name:e.name},kind:e.kind??"declarative",title:s,description:`${s}: a control of this Workspace`,accepts:["buckyos.table-source","buckyos.record"],allow_no_source:!0,default_size:{w:260,h:140},config_schema:{type:"object",properties:{label:{type:"string",title:"Label",default:s}}},bindings:{data:{accepts:["buckyos.table-source"],title:"Data",description:"The table this control summarizes"}},catalog:{group:"custom",description:`${s}`},agent:"AGENT.md"},n=`# ${s}\n\nBind \`data\` to a table. Config: \`label\` (text).\n`;if("html"===e.kind){const e={clicked:{title:"Clicked",description:"Raised when someone clicks the button (in run mode)",params:{count:{type:"number",description:"Rows of the bound table"}}}};return{[t]:`${JSON.stringify({...i,host_api:6,events:e,entry:{html:"view.html",css:"style.css",js:"behavior.js"}},null,2)}\n`,"view.html":'<div class="card"><div class="label" id="label"></div><div class="value" id="value">—</div><button id="go" type="button">Go</button></div>\n',"style.css":".card{font:14px system-ui;padding:12px}.label{opacity:.7}.value{font-size:28px;font-weight:600}\n","behavior.js":["document.getElementById('label').textContent = (aiws.context.config || {}).label || ''","var count = 0","if (aiws.bindings.data) aiws.input('data').rows().then(function (rows) { count = rows.length; document.getElementById('value').textContent = String(count) })","// the public event of component.json: an instance binds handlers to it in its `on` (host API 3)","document.getElementById('go').addEventListener('click', function () { aiws.emit('clicked', { count: count }) })",""].join("\n"),"AGENT.md":`${n}Event: \`clicked\` (\`count\`), raised by its button; bind handlers to it in the instance's \`on\`.\n`}}return{[t]:`${JSON.stringify({...i,entry:"declarative.json"},null,2)}\n`,"declarative.json":`${JSON.stringify({layout:"stack",items:[{kind:"metric",label:s,bind:"data.count",format:"number"},{kind:"text",text:"Rows of the bound table"}]},null,2)}\n`,"AGENT.md":n}},exports.createControlSource=async function(e,o,s){const i=await G(e,o),n=await e.list({ref:i},{limit:500},["base"]).catch((()=>null));if(null==n?void 0:n.entries.some((e=>e.name===t)))throw new r([{file:t,severity:"error",message:`${o} already holds a control`}]);for(const[t,r]of Object.entries(s))await X(e,i,t,a.encode(r));return i},exports.ensureFolder=G,exports.exportBundle=async function(e,t,o,i){const n=await e.extExport(t,o,"package"),r=new Map;r.set(s,a.encode(`${JSON.stringify(n.manifest,null,2)}\n`));for(const s of n.files)r.set(s.path,void 0!==s.text?a.encode(s.text):await i(t,String(s.obj_id)));return{manifest:M(n.manifest),files:r,controls:n.controls}},exports.findFolder=H,exports.folderName=d,exports.hasControlSource=K,exports.homeControlDir=function(e,t,o){return`/home/${e}/AI Workspace/${d(t)}/controls/${o}`},exports.homeExportDir=function(e,t){return`/home/${e}/AI Workspace/exports/${t}`},exports.isSourcePath=q,exports.joinPath=l,exports.packBuildFiles=y,exports.pullControl=async function(e,t,o,s,i,n){const r=(await e.extExport(o,[s],"pull")).controls[0];await G(t,i);for(const l of r.files)await Z(t,i,l.name,void 0!==l.text?a.encode(l.text):await n(o,String(l.obj_id)));const c={workspace_id:o,def_entity_id:r.entity_id,def_rev:r.def_rev,dir_rev:r.dir_rev,ident:r.ident,at:(new Date).toISOString()};return await oe(t,i,c),{files:r.files.map((e=>e.name)),state:c}},exports.readBuildState=te,exports.slotCells=function(e){const t=new Set;for(const o of Object.values(e.slots??{}))for(const e of o.accepts??[])e.startsWith("cell:")&&t.add(e.slice(5));return[...t].sort()},exports.sourceStateKey=function(e){return`aiws:src:${e}`},exports.sourcesDigest=ee,exports.sourcesKey=m,exports.templateDir=V,exports.unbuiltChanges=async function(e,t,o,s,i){var n;if(!(await K(t,i)))return null;const r=await ee(t,await Q(t,i)),a=await e.extExport(o,[s],"pull"),c=String((null==(n=a.controls[0])?void 0:n.digest)??"");return{changed:r!==c,home:r,built:c}},exports.verifyBundle=async function(e){var o,i;const a=e.get(s);if(!a)throw new r([{file:s,severity:"error",message:"missing"}]);let l;try{l=JSON.parse(c.decode(a))}catch(g){throw new r([{file:s,severity:"error",message:String(g)}])}const d=M(l),f=[],m=d.workspace_templates;m.length>0&&d.manifest_version<3&&f.push({file:s,severity:"error",message:`Workspace templates need manifest_version 3 (raise it in ${s})`}),m.length>32&&f.push({file:s,severity:"error",message:"at most 32 Workspace templates"}),0===d.controls.length&&0===m.length&&f.push({file:s,severity:"error",message:"lists no control"});const u=new Map;for(const s of d.controls){const o="string"==typeof s.dir?e.get(`${s.dir}${t}`):void 0;try{const e=o?JSON.parse(c.decode(o)):void 0;J(e)&&u.set(s.ident,J(e.events)?Object.keys(e.events):[])}catch{}}const h=new Set;for(const n of d.controls){if("string"!=typeof n.dir||!/^controls\/[a-z0-9][a-z0-9._-]{0,70}\/$/.test(n.dir)||h.has(n.dir)){f.push({file:s,severity:"error",message:`control ${n.ident}: bad or repeated dir`});continue}h.add(n.dir);const r=[...e].filter((([e])=>e.startsWith(n.dir))).map((([e,t])=>[e.slice(n.dir.length),t]));await p(r)!==n.digest&&f.push({file:n.dir,severity:"error",message:"the files do not match the manifest digest"});const a=r.find((([e])=>e===t));if(!a){f.push({file:`${n.dir}${t}`,severity:"error",message:"missing"});continue}const l=e=>{const t=r.find((([t])=>t===e));return t?c.decode(t[1]):void 0};for(const e of L(c.decode(a[1]),r.map((([e])=>e)),l,(e=>u.get(e))))f.push({...e,file:`${n.dir}${e.file}`});try{const e=JSON.parse(c.decode(a[1]));`${null==(o=e.ident)?void 0:o.author_did}#${null==(i=e.ident)?void 0:i.name}`===n.ident&&e.kind===n.kind||f.push({file:n.dir,severity:"error",message:"ident and kind must match its component.json"}),JSON.stringify([...e.deps??[]].sort())!==JSON.stringify([...n.deps??[]].sort())&&f.push({file:n.dir,severity:"error",message:"deps must match its component.json"})}catch{}}const y=new Set(d.controls.map((e=>e.ident)));for(const t of d.controls)for(const e of t.deps??[])y.has(e)||f.push({file:s,severity:"error",message:`${t.ident} depends on ${e}, which the bundle does not carry`});for(const[t,r]of m.entries()){const o=J(r)&&"string"==typeof r.id?`template ${r.id}`:`workspace_templates[${t}]`;for(const e of P(r,y))f.push({file:s,severity:"error",message:`${o}: ${e}`});if(!J(r)||"string"!=typeof r.id||!F.test(r.id))continue;const i=V(r.id);if(h.has(i)){f.push({file:s,severity:"error",message:`${o} is listed twice`});continue}h.add(i);const a=e.get(`${i}snapshot.json`);let l;try{l=a?JSON.parse(c.decode(a)).format:void 0}catch{l=void 0}a?l!==n&&f.push({file:`${i}snapshot.json`,severity:"error",message:`not a template snapshot (format ${n})`}):f.push({file:`${i}snapshot.json`,severity:"error",message:"missing"}),await R(e,r.id)!==r.digest&&f.push({file:i,severity:"error",message:"the files do not match the template digest"})}for(const t of e.keys())t===s||[...h].some((e=>t.startsWith(e)))||f.push({file:t,severity:"error",message:"belongs to no control or template of the manifest"});return{manifest:d,diagnostics:f}},exports.watchControl=async function(e,t,o,s={}){var i,n;let r,a="",c=Promise.resolve();const l=()=>{c=c.then((async()=>{let s;try{s=await Q(e,t)}catch{return}const i=m(s);i!==a&&(a=i,await o(s))})).catch((()=>{}))};for(l();!(null==(i=s.signal)?void 0:i.aborted);){const o=await e.list(t,{limit:1},["base"]),i=e.watch({tokens:o.watch_token?[o.watch_token]:[],signal:s.signal});try{for await(const e of i)r&&clearTimeout(r),r=setTimeout(l,s.debounceMs??500)}catch{if(null==(n=s.signal)?void 0:n.aborted)break;await Y(2e3)}finally{i.close()}}r&&clearTimeout(r),await c},exports.writeBuildState=oe,exports.writeHomeFile=X,exports.writeSourceFile=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./aiws_bind-4fe77108.js");require("./object_url-88047ee2.js"),require("./ndn_types-5b138882.js");const t="component.json",o="composition.json",s="aiws-manifest.json",i=".aiws-build.json",n="aiws-template/1";class r extends Error{constructor(e){super(e.filter((e=>"error"===e.severity)).map((e=>`${e.file?`${e.file}: `:""}${e.message}`)).join("; ")||"invalid control source"),this.name="AiwsSourceError",this.diagnostics=e}}const a=new TextEncoder,c=new TextDecoder;function l(e,t){return`${e.replace(/\/+$/,"")}/${t}`}function d(e){return e.replace(/[/\\\u0000-\u001f]/g," ").replace(/^\.+/,"").trim().slice(0,80)||"Workspace"}async function f(e){const t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t),(e=>e.toString(16).padStart(2,"0"))).join("")}async function p(e){const t=[];for(const[o,s]of e)t.push([o,await f(s)]);return t.sort(((e,t)=>e[0]<t[0]?-1:e[0]>t[0]?1:0)),`sha256:${await f(a.encode(JSON.stringify(t)))}`}function m(e){return JSON.stringify([...e].sort(((e,t)=>e.name.localeCompare(t.name))).map((e=>[e.name,e.obj_id??e.etag??""])))}const u=4194304;function h(e){let t="";for(let o=0;o<e.length;o+=32768)t+=String.fromCharCode(...e.subarray(o,o+32768));return btoa(t)}async function y(e,t,o=[]){let s=e.reduce(((e,t)=>e+t.bytes.length),0);const i=new Map;if(s>u){if(!t)throw new r([{file:"",severity:"error",message:"a control's inline files are limited to 4194304 bytes per build"}]);for(const o of[...e].sort(((e,t)=>t.bytes.length-e.bytes.length))){if(s<=u)break;i.set(o.name,await t(o.name,o.bytes)),s-=o.bytes.length}}const n=[...o];for(const r of e){const e=i.get(r.name);n.push(e?{name:r.name,obj_id:e}:{name:r.name,base64:h(r.bytes)})}return n.sort(((e,t)=>e.name<t.name?-1:e.name>t.name?1:0))}async function g(e,t,o){var s;const i=[],n=[];for(const a of t)if(null==(s=a.obj_id)?void 0:s.startsWith("cyfile:"))i.push({name:a.name,obj_id:a.obj_id});else{if(!a.node_id)throw new r([{file:a.name,severity:"error",message:"the file service did not name this file"}]);n.push({name:a.name,bytes:new Uint8Array(await(await e.readFile(a.node_id)).arrayBuffer())})}return y(n,o,i)}const b=["manifest_version","ident","kind","title","description","host_api","accepts","allow_no_source","default_size","config_schema","bindings","entry","assets","catalog","agent","deps","events","actions","on_bind","on_init_control"],v=["type","enum","default","required","title","description","minimum","maximum","minLength","maxLength","properties","items"],$=/^[a-z0-9][a-z0-9._-]{0,63}$/,_=/^did:[a-z0-9]+:[^/#\s]+$/,w=/^[a-z][a-z0-9_]{0,31}$/,k=/^did:[a-z0-9]+:[^/#\s]+#[a-z0-9][a-z0-9._-]{0,63}$/,j="needs manifest_version 2 (raise it in component.json)",x="needs manifest_version 3 (raise it in component.json)",S="needs manifest_version 4 (raise it in component.json)",O="needs manifest_version 5 (raise it in component.json)",A=["string","number","boolean","object","entity"],N=["text","value","metric","bar","list","badge"],E=["kind","text","label","bind","by","format","limit"],I=["open_source","activate_editor","open_definition"],z=["text","number","select","boolean","color"];function J(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function q(e){return e.length>0&&a.encode(e).length<=255&&!e.includes("\0")&&e.split("/").every((e=>e.length>0&&!e.startsWith(".")))}function T(e){const t=J(e)?e.properties:void 0;return J(t)?t:{}}function C(e,t,o,s){for(const i of e.matchAll(/\{\{([^}]*)\}\}/g)){const e=i[1].trim();e.startsWith("config.")?e.slice(7)in o||s(`${t}: {{${e}}} names no property of config_schema`):s(`${t}: only {{config.<key>}} may be used here`)}}function W(e,t,o){if(e&&"object"==typeof e&&!Array.isArray(e))for(const[s,i]of Object.entries(e))if(v.includes(s)){if("properties"===s&&i&&"object"==typeof i)for(const[e,s]of Object.entries(i))W(s,`${t}/properties/${e}`,o);"items"===s&&W(i,`${t}/items`,o)}else o.push(`${t}/${s}: keyword ${s} is outside the supported subset`);else o.push(`${t}: a schema is an object`)}function D(e,t={},o="declarative.json"){const s=[],i=(e,t)=>s.push({file:o,severity:"error",message:e,...t?{code:t}:{}}),n=e=>s.push({file:o,severity:"warning",message:e});let r;try{const t=JSON.parse(e);if(!J(t))return i("a declarative definition is a JSON object"),s;r=t}catch(f){return i(f instanceof Error?f.message:String(f)),s}const a=J(t.bindings)?t.bindings:{},c=T(t.configSchema),l=(e,t)=>{if("string"==typeof e)C(e,t,c,i);else if(Array.isArray(e))e.forEach(((e,o)=>l(e,`${t}[${o}]`)));else if(J(e))for(const[o,s]of Object.entries(e))l(s,`${t}.${o}`)},d=(e,o)=>{void 0!==e&&(Array.isArray(e)?e.forEach(((e,s)=>{const r=`${o}[${s}]`;if(J(e))if("button"!==e.kind){"string"==typeof e.kind&&N.includes(e.kind)||i(`${r}.kind ${JSON.stringify(e.kind)}: one of ${[...N,"button"].join(", ")}`);for(const t of Object.keys(e))E.includes(t)||n(`${r}: key ${t} is ignored by the interpreter`);if(void 0===e.format||["text","number","percent","currency"].includes(e.format)||i(`${r}.format ${JSON.stringify(e.format)}: text, number, percent or currency`),"string"==typeof e.bind&&e.bind.includes(".")){const t=e.bind.slice(0,e.bind.indexOf("."));"props"===t||t in a||n(`${r}.bind ${JSON.stringify(e.bind)}: ${t} is not a declared binding, so it reads the field ${JSON.stringify(e.bind)} of the main source`)}}else((e,o)=>{void 0!==t.manifestVersion&&t.manifestVersion<3&&i(`${o}: a button ${x}`);for(const t of Object.keys(e))["kind","label","emit","params"].includes(t)||n(`${o}: key ${t} is ignored by the interpreter`);"string"==typeof e.label&&e.label||i(`${o}.label: the button's text (required)`),"string"==typeof e.emit&&e.emit?t.events&&!t.events.includes(e.emit)&&i(`${o}.emit ${e.emit}: not an event of component.json`,"EVENT_UNDECLARED"):i(`${o}.emit: the event the button raises (required)`),void 0!==e.params&&(J(e.params)?l(e.params,`${o}.params`):i(`${o}.params must be an object`))})(e,r);else i(`${r} must be an object`)})):i(`${o} must be an array`))};for(const[p,m]of Object.entries(r))"layout"===p?"stack"!==m&&"row"!==m&&i("layout: stack or row"):"items"===p?d(m,"items"):"view"===p?d(J(m)?m.items:void 0,"view.items"):"accent"===p?"string"!=typeof m&&i("accent must be a colour string"):"actions"===p?(Array.isArray(m)?m:[]).forEach(((e,t)=>{const o=J(e)?e:{};"string"==typeof o.command&&I.includes(o.command)||i(`actions[${t}].command: one of ${I.join(", ")}`),"string"==typeof o.id&&"string"==typeof o.label||i(`actions[${t}] needs id and label`)})):"inspector"===p?(Array.isArray(m)?m:[]).forEach(((e,t)=>{const o=J(e)?e:{};"string"==typeof o.kind&&z.includes(o.kind)||i(`inspector[${t}].kind: one of ${z.join(", ")}`),"string"==typeof o.key&&"string"==typeof o.label||i(`inspector[${t}] needs key and label`)})):n(`key ${p} is not part of the declarative vocabulary`);return void 0===r.items&&void 0===r.view&&n("no items: the control draws nothing"),s}function B(e,t,s=o,i={}){const n=[],r=(e,t)=>n.push({file:s,severity:"error",message:e,...t?{code:t}:{}});let c;try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return r("a composition is a JSON object { layout, slots, chrome?, events? }"),n;c=t}catch(g){return r(g instanceof Error?g.message:String(g)),n}const l=T(t),d=(e,t)=>C(e,t,l,r),f=(e,t,o)=>{"number"==typeof e&&e>=0&&e<=o||("string"==typeof e&&/^\s*\{\{.*\}\}\s*$/.test(e)?d(e,t):r(`${t}: a number in [0, ${o}] or {{config.<key>}}`))},p=void 0!==i.manifestVersion&&i.manifestVersion<4;for(const o of Object.keys(c))["layout","slots","chrome","events","projections","media"].includes(o)?"projections"!==o&&"media"!==o||!p||r(`${o} ${S}`):r(`unknown key ${o} (a composition says layout, slots, chrome, events, projections and media)`);const m=c.layout;let u="stack";if(m&&"object"==typeof m){"stack"===m.algorithm||"fixed"===m.algorithm||"grid"===m.algorithm?u=m.algorithm:r(`layout.algorithm ${JSON.stringify(m.algorithm)}: stack, fixed or grid (the algorithms the host ships)`);for(const[e,t]of Object.entries(m))if("algorithm"!==e)if("direction"!==e&&"spacing"!==e||"stack"===u)if("columns"!==e&&"gap"!==e||"grid"===u)if("direction"===e)"column"!==t&&"row"!==t&&r("layout.direction: column or row");else if("spacing"===e)f(t,"layout.spacing",2e3);else if("columns"===e)(!Number.isInteger(t)||t<1||t>12)&&r("layout.columns: an integer in [1, 12]");else if("gap"===e)f(t,"layout.gap",2e3);else if("padding"===e)if(t&&"object"==typeof t&&!Array.isArray(t))for(const[o,s]of Object.entries(t))["t","r","b","l"].includes(o)||r(`layout.padding.${o}: t, r, b or l`),f(s,`layout.padding.${o}`,2e3);else f(t,"layout.padding",2e3);else r(`layout: unknown key ${e}`);else r(`layout.${e} belongs to the grid layout`);else r(`layout.${e} belongs to the stack layout`);"grid"===u&&void 0===m.columns&&r("layout.columns (1…12) required: the cells of a grid row")}else r("layout { algorithm: stack | fixed | grid } required");const h=c.slots&&"object"==typeof c.slots&&!Array.isArray(c.slots)?c.slots:null;if(h){Object.keys(h).length>16&&r("at most 16 slots");for(const[e,t]of Object.entries(h)){const o=`slots.${e}`;if(w.test(e)||r(`${o}: a slot name is [a-z][a-z0-9_]{0,31}`),!t||"object"!=typeof t||Array.isArray(t)){r(`${o} must be an object`);continue}const s=t;for(const[e,t]of Object.entries(s))if("accepts"===e){if(!Array.isArray(t)||0===t.length||t.length>32){r(`${o}.accepts: 1…32 entries (cell:<ident>, a view type, container)`);continue}for(const e of t)"string"==typeof e&&e.startsWith("cell:")?(!k.test(e.slice(5))||a.encode(e.slice(5)).length>128)&&r(`${o}.accepts ${JSON.stringify(e)}: cell:<author_did>#<name>`):"container"===e||"string"==typeof e&&$.test(e)||r(`${o}.accepts ${JSON.stringify(e)}: cell:<ident>, a view type or container`)}else if("min"===e)(!Number.isInteger(t)||t<0||t>64)&&r(`${o}.min: an integer in [0, 64]`);else if("max"===e)(!Number.isInteger(t)||t<1||t>1e3)&&r(`${o}.max: an integer in [1, 1000]`);else if("placement"===e)"stack"!==t&&"top"!==t&&"bottom"!==t&&"free"!==t?r(`${o}.placement: stack, top, bottom or free`):"fixed"===u&&"free"!==t?r(`${o}.placement: a fixed layout keeps every child where it is (free)`):"grid"===u&&"stack"!==t&&r(`${o}.placement: a grid fills its cells with the slots' children in slot order (stack)`);else if("title"===e)("string"!=typeof t||t.length>256)&&r(`${o}.title: at most 256 characters`);else if("visible"===e){if(p){r(`${o}.visible ${S}`);continue}const e=t;!J(e)||"first_open"!==e.from||Object.keys(e).some((e=>"from"!==e&&"for_ms"!==e))?r(`${o}.visible: { from: "first_open", for_ms }`):"string"==typeof e.for_ms?d(e.for_ms,`${o}.visible.for_ms`):(!Number.isInteger(e.for_ms)||e.for_ms<1||e.for_ms>316224e5)&&r(`${o}.visible.for_ms: milliseconds (≤ a year) or {{config.<key>}}`)}else r(`${o}: unknown key ${e}`);Number.isInteger(s.min)&&Number.isInteger(s.max)&&s.min>s.max&&r(`${o}: min exceeds max`)}}else r("slots { <name>: { accepts?, min?, max?, placement? } } required");const y=c.chrome;if(void 0!==y)if(!y||"object"!=typeof y||Array.isArray(y))r("chrome must be an object");else for(const[o,a]of Object.entries(y)){const e=`chrome.${o}`;if("background"===o||"border"===o)"string"==typeof a&&a.length<=64?d(a,e):r(`${e}: a colour (≤ 64 characters) or {{config.<key>}}`);else if("radius"===o)f(a,e,200);else if("empty"===o)"string"==typeof a&&a.length<=1e3?d(a,e):r(`${e}: a text of at most 1000 characters`);else if("title"===o){const t=a;if(!t||"object"!=typeof t||Array.isArray(t)){r(`${e}: { text, slot? }`);continue}for(const[e,o]of Object.entries(t))"text"===e?"string"==typeof o&&o.length<=256?d(o,"chrome.title.text"):r("chrome.title.text: at most 256 characters"):"slot"===e?"string"==typeof o&&h&&o in h||r(`chrome.title.slot ${JSON.stringify(o)}: a slot of this composition`):r(`chrome.title: unknown key ${e}`);"string"!=typeof t.text&&r("chrome.title.text required")}else r(`chrome: unknown key ${o} (background, radius, border, title, empty)`)}if(void 0!==c.events)if(void 0!==i.manifestVersion&&i.manifestVersion<3&&r(`events ${x}`),J(c.events)){Object.keys(c.events).length>16&&r("events: at most 16");for(const[e,t]of Object.entries(c.events)){const o=`events.${e}`;if(w.test(e)||r(`${o}: an event name is [a-z][a-z0-9_]{0,31}`),!J(t)){r(`${o} must be an object { from: { slot, event }, title?, description? }`);continue}for(const[e,i]of Object.entries(t))if("title"===e)("string"!=typeof i||i.length>256)&&r(`${o}.title: at most 256 characters`);else if("description"===e)("string"!=typeof i||i.length>4e3)&&r(`${o}.description: at most 4000 characters`);else if("on"===e){const e=Array.isArray(i)?i:[i];p?r(`${o}.on ${S}`):(0===e.length||e.length>4||e.some((e=>!J(e)||!["write","wish","open","notify"].includes(String(e.kind)))))&&r(`${o}.on: a handler (write, wish, open, notify) or 1…4 of them`)}else"from"!==e&&r(`${o}: unknown key ${e} (from, title, description, on)`);const s=t.from;if(!J(s)){r(`${o}.from { slot, event } required: the child event it re-raises`);continue}if(void 0!==s.projection){if(p){r(`${o}.from.projection ${S}`);continue}const e=J(c.projections)?c.projections:{};"string"==typeof s.projection&&s.projection in e||r(`${o}.from.projection ${JSON.stringify(s.projection)}: a projection of this composition`),void 0===s.role||"string"==typeof s.role&&w.test(s.role)||r(`${o}.from.role: a role name of its template`);for(const t of Object.keys(s))"projection"!==t&&"role"!==t&&r(`${o}.from: unknown key ${t} (projection, role)`);continue}for(const e of Object.keys(s))"slot"!==e&&"event"!==e&&r(`${o}.from: unknown key ${e} (slot, event)`);const n="string"==typeof s.event&&w.test(s.event)?s.event:void 0;n||r(`${o}.from.event: an event name [a-z][a-z0-9_]{0,31}`);const a="string"==typeof s.slot&&h?h[s.slot]:void 0;if(!J(a)){r(`${o}.from.slot ${JSON.stringify(s.slot)}: a slot of this composition`);continue}if(!n)continue;const l=(Array.isArray(a.accepts)?a.accepts:[]).filter((e=>"string"==typeof e&&e.startsWith("cell:"))).map((e=>e.slice(5)));if(0===l.length){r(`${o}: slot ${s.slot} accepts no cell:<ident>, so no control there declares ${n}`,"EVENT_UNDECLARED");continue}l.map((e=>{var t;return null==(t=i.cellEvents)?void 0:t.call(i,e)})).every((e=>void 0!==e&&!e.includes(n)))&&r(`${o}: no control slot ${s.slot} accepts (${l.join(", ")}) declares the event ${n}`,"EVENT_UNDECLARED")}}else r("events must be an object { <name>: { from: { slot, event }, title?, description? } }");if(void 0!==c.projections&&!p)if(!J(c.projections)||Object.keys(c.projections).length>8)r("projections: at most 8 of name → { source, template, layout }");else for(const[o,a]of Object.entries(c.projections)){const e=`projections.${o}`;if(w.test(o)||r(`${e}: a projection name is [a-z][a-z0-9_]{0,31}`),!J(a)){r(`${e} must be an object`);continue}for(const o of Object.keys(a))["source","mark","template","layout","placement","max_items"].includes(o)||r(`${e}: unknown key ${o} (source, mark, template, layout, placement, max_items)`);const t=a.source,s=J(t)?t.kind:void 0;(!J(t)||!["records","members","counts","viewer"].includes(String(s))||"viewer"!==s&&"string"!=typeof t.binding||"counts"===s&&"string"!=typeof t.field)&&r(`${e}.source: { kind: records | members | counts | viewer, binding (a binding name), field? (counts) }`);const i=J(a.template)&&Array.isArray(a.template.nodes)?a.template.nodes:null;!i||0===i.length||i.length>32?r(`${e}.template: { nodes: [1…32 of { id, view: label | shape | asset, box?, config?, when?, role? }] }`):i.forEach(((t,o)=>{J(t)&&"string"==typeof t.id&&w.test(t.id)?["label","shape","asset"].includes(String(t.view))||r(`${e}.template.nodes[${o}].view: label, shape or asset`):r(`${e}.template.nodes[${o}].id: a name [a-z][a-z0-9_]{0,31}`)}));const n=a.layout;!J(n)||"list"!==n.algorithm&&"grid"!==n.algorithm||!J(n.item)||void 0===n.item.h?r(`${e}.layout: { algorithm: list | grid, columns? (grid), gap?, item: { w?, h } }`):"grid"===n.algorithm&&void 0===n.columns&&r(`${e}.layout.columns required (grid)`),void 0===a.placement||["top","stack","bottom"].includes(String(a.placement))||r(`${e}.placement: top, stack or bottom`)}if(void 0!==c.media&&!p){const e=c.media;(!J(e)||"string"!=typeof e.slot||!h||!(e.slot in h)||"string"!=typeof e.anchor||Object.keys(l).length>0&&!(e.anchor in l))&&r("media: { slot (a slot of this composition), anchor (a config property), loop? (a config property) }")}return n}function L(o,s,i,n){const r=[],c=t,l=e=>r.push({file:c,severity:"error",message:e});let d;try{const e=JSON.parse(o);if(!e||"object"!=typeof e||Array.isArray(e))return l("must be a JSON object"),r;d=e}catch(E){return l(E instanceof Error?E.message:String(E)),r}for(const e of Object.keys(d))b.includes(e)||l(`unknown key ${e}`);const f=d.manifest_version,p="number"==typeof f&&Number.isInteger(f)&&f>=1?f:0;void 0!==d.actions&&(p>0&&p<4?l(`actions ${S}`):!Array.isArray(d.actions)||d.actions.length>16?l("actions: at most 16 of { id, title, icon?, modes?, needs?, run }"):d.actions.forEach(((e,t)=>{if(J(e)&&"string"==typeof e.id&&w.test(e.id)&&"string"==typeof e.title&&e.title){const o=Array.isArray(e.run)?e.run:[e.run];(0===o.length||o.length>4||o.some((e=>!J(e)||!["write","wish","open","notify","config","forward"].includes(String(e.kind)))))&&l(`actions[${t}].run: a handler (write, wish, open, notify, config, forward) or 1…4 of them`)}else l(`actions[${t}]: { id, title, run } (id a name [a-z][a-z0-9_]{0,31})`)}))),p?p>5&&l(`manifest_version ${f} is newer than this client reads (5)`):l("manifest_version (1…5) required");const m=p>0&&p<3,u=d.ident;let h="";u&&"object"==typeof u?("string"==typeof u.author_did&&_.test(u.author_did)||l("ident.author_did must be a DID (did:<method>:<id>)"),"string"==typeof u.name&&$.test(u.name)||l("ident.name must be [a-z0-9][a-z0-9._-]{0,63}"),"string"==typeof u.author_did&&"string"==typeof u.name&&(h=`${u.author_did}#${u.name}`,a.encode(h).length>128&&l("an identity is at most 128 bytes"))):l("ident { author_did, name } required");const y="composite"===d.kind;if("declarative"===d.kind||"html"===d.kind||y||l("kind must be declarative, html or composite"),y&&1===p&&l(`kind composite ${j}`),y)for(const e of["accepts","allow_no_source"])void 0!==d[e]&&l(`${e}: a composite is a container of Blocks, not a Cell showing data`);if(("string"!=typeof d.title||!d.title||d.title.length>256)&&l("title: 1…256 characters"),void 0!==d.config_schema){const e=[];W(d.config_schema,"config_schema",e),e.forEach(l)}if(void 0!==d.bindings)if(d.bindings&&"object"==typeof d.bindings)for(const[e,t]of Object.entries(d.bindings))if(w.test(e)&&"props"!==e||l(`binding name ${e}: [a-z][a-z0-9_]{0,31}, not props`),J(t)){for(const o of Object.keys(t))["accepts","required","many","schema_id","title","description"].includes(o)||l(`binding ${e}: unknown key ${o}`);void 0!==t.many&&"boolean"!=typeof t.many&&l(`binding ${e}.many: true or false`),void 0!==t.schema_id&&("string"!=typeof t.schema_id||!t.schema_id||t.schema_id.length>128)&&l(`binding ${e}.schema_id: a schema id such as buckyos.todo@1`)}else l(`binding ${e} must be an object`);else l("bindings must be an object");if(void 0!==d.on_bind||void 0!==d.on_init_control)if(p>0&&p<5)l(`on_bind / on_init_control ${O}`);else if("html"===d.kind){for(const[e,t]of[["on_bind","bind"],["on_init_control","init_control"]])void 0!==d[e]&&"script"!==d[e]&&l(`${e}: an HTML control writes "script" (its behavior.js handles aiws.on('${t}'))`);"number"==typeof d.host_api&&d.host_api>=5||l("on_bind / on_init_control \"script\": aiws.on('bind') / aiws.on('init_control') need host_api 5")}else if("composite"!==d.kind)l('on_bind / on_init_control: declared steps are for a composite, "script" for an HTML control');else{const t=Array.isArray(d.actions)?d.actions.filter(J).map((e=>String(e.id))):[];e.checkBindSteps(d.on_bind,d.on_init_control,J(d.bindings)?d.bindings:{},t).forEach(l)}if(void 0!==d.deps)if(!Array.isArray(d.deps)||d.deps.length>32)l("deps: at most 32 identities <author_did>#<name>");else if(d.deps.length>0&&1===p)l(`deps ${j}`);else{const e=new Set;for(const t of d.deps)"string"==typeof t&&k.test(t)?t===h?l("deps: a control cannot depend on itself"):e.has(t)&&l(`deps lists ${t} twice`):l(`deps: ${JSON.stringify(t)} is not an identity <author_did>#<name>`),e.add(String(t))}let g=[];if(void 0!==d.events){if(y)l("events: a composite declares its events in composition.json (events.<name>.from re-raises an event of a child)");else if(m)l(`events ${x}`);else{const e=[];!function(e,t){if(J(e)){Object.keys(e).length>16&&t.push("events: at most 16");for(const[o,s]of Object.entries(e)){const e=`events.${o}`;if(w.test(o)||t.push(`${e}: an event name is [a-z][a-z0-9_]{0,31}`),J(s)){for(const[o,i]of Object.entries(s))"title"===o?("string"!=typeof i||i.length>256)&&t.push(`${e}.title: at most 256 characters`):"description"===o?("string"!=typeof i||i.length>4e3)&&t.push(`${e}.description: at most 4000 characters`):"params"!==o&&t.push(`${e}: unknown key ${o} (title, description, params)`);if(void 0!==s.params)if(J(s.params)){Object.keys(s.params).length>16&&t.push(`${e}.params: at most 16`);for(const[o,i]of Object.entries(s.params)){const s=`${e}.params.${o}`;if(w.test(o)||t.push(`${s}: a param name is [a-z][a-z0-9_]{0,31}`),J(i)){for(const[e,o]of Object.entries(i))"type"===e?"string"==typeof o&&A.includes(o)||t.push(`${s}.type: ${A.join(", ")}`):"required"===e?"boolean"!=typeof o&&t.push(`${s}.required must be a boolean`):"description"===e?("string"!=typeof o||o.length>1e3)&&t.push(`${s}.description: at most 1000 characters`):t.push(`${s}: unknown key ${e} (type, required, description)`);void 0===i.type&&t.push(`${s}.type required`)}else t.push(`${s} must be an object { type, required?, description? }`)}}else t.push(`${e}.params must be an object { <param>: { type, required?, description? } }`)}else t.push(`${e} must be an object { title?, description?, params? }`)}}else t.push("events must be an object { <name>: { title?, description?, params? } }")}(d.events,e),e.forEach(l)}!y&&J(d.events)&&(g=Object.keys(d.events))}const v=e=>"string"==typeof e&&s.includes(e),N=new Set([c]);if("html"===d.kind){const e=d.entry;if(e&&"object"==typeof e&&"string"==typeof e.html)for(const[t,o]of Object.entries(e))v(o)?N.add(String(o)):l(`entry.${t} ${JSON.stringify(o)} is not in the directory`);else l("entry must be { html, css?, js? }");void 0===d.host_api||[2,3,4,5,6].includes(d.host_api)?(5===d.host_api||6===d.host_api)&&p<5?l(`host_api ${d.host_api} ${O}`):4===d.host_api&&p<4?l(`host_api 4 ${S}`):3===d.host_api&&m&&l(`host_api 3 ${x}`):l("host_api: the HTML Block host speaks API 2, 3, 4, 5 and 6"),g.length>0&&!("number"==typeof d.host_api&&d.host_api>=3)&&r.push({file:c,severity:"warning",message:"events: an HTML control raises them with aiws.emit, which is host API 3 (set host_api to 3 or later)"})}else if("declarative"===d.kind||y){if(v(d.entry)){N.add(String(d.entry));const e=null==i?void 0:i(String(d.entry)),t=p||void 0;void 0!==e&&y?r.push(...B(e,d.config_schema,String(d.entry),{manifestVersion:t,cellEvents:n})):void 0!==e&&r.push(...D(e,{bindings:d.bindings,events:g,configSchema:d.config_schema,manifestVersion:t},String(d.entry)))}else l(`entry ${JSON.stringify(d.entry)} is not in the directory`);y&&void 0!==d.host_api&&l("host_api: a composite runs no code of its own (its layout and chrome are the host's)"),y||void 0===d.host_api||1===d.host_api||l("host_api: the declarative interpreter is version 1")}for(const e of Array.isArray(d.assets)?d.assets:[])v(e)?N.add(String(e)):l(`asset ${JSON.stringify(e)} is not in the directory`);void 0!==d.agent&&(v(d.agent)?N.add(String(d.agent)):l(`agent ${JSON.stringify(d.agent)} is not in the directory`));for(const e of s)q(e)?N.has(e)||r.push({file:e,severity:"warning",message:"not named by component.json: kept in the source snapshot only"}):r.push({file:e,severity:"error",message:"a file of a source directory: a relative path whose parts do not start with '.'"});return r}function M(e){if(!e||"object"!=typeof e)throw new r([{file:s,severity:"error",message:"must be a JSON object"}]);const t=e,o=t.manifest_version;if("number"!=typeof o||o<1)throw new r([{file:s,severity:"error",message:"manifest_version required"}]);if(o>5)throw new r([{file:s,severity:"error",message:`manifest_version ${o} needs a newer client (this one reads 5)`}]);if("aiws"!==t.purpose)throw new r([{file:s,severity:"error",message:"purpose must be aiws"}]);if(!Array.isArray(t.controls))throw new r([{file:s,severity:"error",message:"controls must be an array"}]);return{manifest_version:o,purpose:"aiws",host_api:t.host_api??{},controls:t.controls,workspace_templates:Array.isArray(t.workspace_templates)?t.workspace_templates:[]}}const F=/^[a-z0-9][a-z0-9-]{0,63}$/;function V(e){return`templates/${e}/`}async function R(e,t){const o=V(t),s=[];for(const[i,n]of e)i.startsWith(o)&&s.push([i.slice(o.length),n]);return p(s)}function P(e,t){if(!J(e))return["a template is an object { id, title, snapshot, digest, requires, description?, params?, reset? }"];const o=[];for(const i of Object.keys(e))["id","title","description","snapshot","digest","requires","params","reset"].includes(i)||o.push(`unknown key ${i}`);"string"==typeof e.id&&F.test(e.id)?e.snapshot!==`${V(e.id)}snapshot.json`&&o.push(`snapshot must be ${V(e.id)}snapshot.json`):o.push("id: [a-z0-9][a-z0-9-]{0,63}"),("string"!=typeof e.title||!e.title||e.title.length>256)&&o.push("title: 1…256 characters"),void 0!==e.description&&("string"!=typeof e.description||e.description.length>4e3)&&o.push("description: at most 4000 characters"),"string"==typeof e.digest&&/^sha256:[0-9a-f]{64}$/.test(e.digest)||o.push("digest: sha256:<64 hex digits>");const s=e.requires;if(J(s)){for(const e of Object.keys(s))"host_api"!==e&&"controls"!==e&&o.push(`requires: unknown key ${e}`);if(void 0!==s.host_api)if(J(s.host_api))for(const[e,t]of Object.entries(s.host_api))("html"!==e&&"declarative"!==e||!Number.isInteger(t)||t<1)&&o.push(`requires.host_api.${e}: html or declarative, a positive integer`);else o.push("requires.host_api must be an object { html?, declarative? }");if(!Array.isArray(s.controls)||s.controls.length>256)o.push("requires.controls: at most 256 identities");else{const e=new Set;for(const i of s.controls)"string"==typeof i&&t.has(i)?e.has(i)&&o.push(`requires.controls lists ${i} twice`):o.push(`requires.controls: ${JSON.stringify(i)} is not a control of this manifest`),e.add(i)}}else o.push("requires { host_api?, controls } required");if(void 0!==e.params)if(!J(e.params)||Object.keys(e.params).length>32)o.push("params: an object of at most 32 { type, title?, default? }");else for(const[i,n]of Object.entries(e.params)){const e=`params.${i}`;if(w.test(i)||o.push(`${e}: a param name is [a-z][a-z0-9_]{0,31}`),J(n)){for(const[t,s]of Object.entries(n))"type"===t?"string"!==s&&"number"!==s&&"boolean"!==s&&o.push(`${e}.type: string, number or boolean`):"title"===t?("string"!=typeof s||s.length>256)&&o.push(`${e}.title: at most 256 characters`):"default"===t?["string","number","boolean"].includes(typeof s)||o.push(`${e}.default: a string, number or boolean`):o.push(`${e}: unknown key ${t} (type, title, default)`);void 0===n.type&&o.push(`${e}.type required`)}else o.push(`${e} must be an object { type, title?, default? }`)}if(void 0!==e.reset){const t=J(e.reset)?e.reset.tables:void 0;!J(e.reset)||Object.keys(e.reset).some((e=>"tables"!==e))?o.push("reset: { tables }"):void 0!==t&&(!Array.isArray(t)||t.length>64||new Set(t).size!==t.length||t.some((e=>"string"!=typeof e||!/^[a-z0-9][a-z0-9_-]{0,63}$/.test(e))))&&o.push("reset.tables: at most 64 distinct table ids")}return o}async function U(e,t,o){const s=/[*?[\]\\]/.test(o)?void 0:o;return(await e.list("string"==typeof t?t:{ref:t},{limit:s?10:1e3,...s?{filter:{name_glob:s}}:{}},["base","ident"])).entries.find((e=>e.name===o))}async function G(e,t){const o=t.split("/").filter(Boolean);if(0===o.length)throw new Error(`not a folder path: ${t}`);let s=(await e.stat(`/${o[0]}`)).ref;for(const i of o.slice(1)){const o=await U(e,s,i);if(o&&"dir"!==o.target.kind)throw new r([{file:i,severity:"error",message:`${i} in ${t} is not a folder`}]);s=o?o.target.ref:(await e.mkdir({ref:s},i)).ref}return s}async function H(e,t){const o=t.split("/").filter(Boolean);if(0===o.length)return null;let s=(await e.stat(`/${o[0]}`)).ref;for(const i of o.slice(1)){const t=await U(e,s,i);if(!t||"dir"!==t.target.kind)return null;s=t.target.ref}return s}async function K(e,o){const s=await H(e,o);return null!==s&&void 0!==await U(e,s,t)}async function X(e,t,o,s){const i="string"==typeof t?await G(e,t):t;await e.uploadFile(i,o,s,{overwrite:!0})}const Y=e=>new Promise((t=>setTimeout(t,e)));async function Q(e,t){const o=[],s=[],i=async(t,n,r)=>{var a,c,l;let d;do{const f=await e.list("string"==typeof t?t:{ref:t},{limit:500,...d?{cursor:d}:{}},["base","ident"]);for(const e of f.entries){if(e.name.startsWith("."))continue;const t=`${n}${e.name}`;if("dir"===e.target.kind){r>=8?s.push({file:t,severity:"error",message:"sub-folders nest at most 8 levels"}):await i(e.target.ref,`${t}/`,r+1);continue}if("file"!==e.target.kind){s.push({file:t,severity:"error",message:"only files and folders belong to a control source"});continue}const d=e.target.ref,f="object"===d.type?d.obj_id:"string"==typeof(null==(a=e.target.attrs)?void 0:a.obj_id)?e.target.attrs.obj_id:void 0;o.push({name:t,...f?{obj_id:f}:{},..."live"===d.type?{node_id:d.node_id}:{},..."string"==typeof(null==(c=e.target.attrs)?void 0:c.etag)?{etag:e.target.attrs.etag}:{},..."number"==typeof(null==(l=e.target.attrs)?void 0:l.size)?{size:e.target.attrs.size}:{}})}d=f.truncated?f.next_cursor:void 0}while(d)};if(await i(t,"",0),0===o.length&&s.push({file:"",severity:"error",message:`${t} holds no files`}),o.length>64&&s.push({file:"",severity:"error",message:"a control holds at most 64 files"}),s.some((e=>"error"===e.severity)))throw new r(s);return o.sort(((e,t)=>e.name<t.name?-1:e.name>t.name?1:0))}async function Z(e,t,o,s){const i=o.lastIndexOf("/");await X(e,i<0?t:l(t,o.slice(0,i)),i<0?o:o.slice(i+1),s)}async function ee(e,t){const o=[];for(const s of t){if(!s.node_id)throw new r([{file:s.name,severity:"error",message:"the file service did not name this file"}]);o.push([s.name,new Uint8Array(await(await e.readFile(s.node_id)).arrayBuffer())])}return p(o)}async function te(e,t){try{const o=await U(e,t,i),s="live"===(null==o?void 0:o.target.ref.type)?o.target.ref.node_id:void 0;if(!s)return null;const n=await e.readFile(s);return await n.json()}catch{return null}}async function oe(e,t,o){await X(e,t,i,a.encode(`${JSON.stringify(o,null,2)}\n`))}exports.AIWS_BUILD_STATE_FILE=i,exports.AIWS_COMPONENT_FILE=t,exports.AIWS_COMPOSITION_FILE=o,exports.AIWS_DECLARATIVE_API_VERSION=1,exports.AIWS_HTML_API_VERSION=6,exports.AIWS_MANIFEST_FILE=s,exports.AIWS_MANIFEST_VERSION=5,exports.AIWS_MAX_INLINE_BYTES=u,exports.AIWS_MAX_SOURCE_FILES=64,exports.AIWS_TEMPLATE_FORMAT=n,exports.AiwsSourceError=r,exports.aiwsContentDigest=p,exports.aiwsTemplateDigest=R,exports.buildControl=async function(e,t,o,s,i={}){const n=await Q(t,s),r=await te(t,s),a=r&&r.workspace_id===o?{def_rev:r.def_rev,dir_rev:r.dir_rev}:void 0,c=await e.extBuild(o,{files:await g(t,n,i.upload),...i.folderId?{folder_id:i.folderId}:{},...a?{expect:a}:{},...i.force?{force:!0}:{},...i.dryRun?{dry_run:!0}:{},...i.migration?{migration:i.migration}:{}});return i.dryRun||"string"!=typeof c.def_entity_id||"number"!=typeof c.def_rev||await oe(t,s,{workspace_id:o,def_entity_id:c.def_entity_id,def_rev:c.def_rev,dir_rev:Number(c.dir_rev??0),ident:String(c.ident??""),at:(new Date).toISOString()}),{...c,files:n}},exports.buildFiles=g,exports.checkComponent=L,exports.checkComposition=B,exports.checkDeclarative=D,exports.collectSources=Q,exports.compatManifest=M,exports.controlSkeleton=function(e){const s=e.title??e.name;if("composite"===e.kind){const i="fixed"===e.algorithm,n=e.slots??{items:{placement:i?"free":"stack",title:"Items"}},r={layout:i?{algorithm:"fixed",padding:12}:{algorithm:"stack",direction:"column",spacing:"{{config.gap}}",padding:12},slots:n,chrome:{background:"{{config.background}}",radius:12,title:{text:"{{config.title}}"},empty:"Drop Blocks here"}},a={manifest_version:5,ident:{author_did:e.authorDid,name:e.name},kind:"composite",title:s,description:`${s}: a panel of Blocks`,default_size:{w:320,h:360},config_schema:{type:"object",properties:{title:{type:"string",title:"Title",default:s},background:{type:"string",title:"Background",default:"#f6f7fb"},gap:{type:"integer",title:"Gap (px)",default:8,minimum:0,maximum:64}}},entry:o,deps:e.deps??[],catalog:{group:"custom",description:`${s}`},agent:"AGENT.md"},c=Object.keys(n).map((e=>`\`${e}\``)).join(", ");return{[t]:`${JSON.stringify(a,null,2)}\n`,[o]:`${JSON.stringify(r,null,2)}\n`,"AGENT.md":`# ${s}\n\nA composite: an instance is a \`buckyos.container { kind: "composite", def_ref }\`; put Blocks under it with \`slot\` set to one of ${c}. Config: \`title\`, \`background\`, \`gap\`.\n`}}const i={manifest_version:5,ident:{author_did:e.authorDid,name:e.name},kind:e.kind??"declarative",title:s,description:`${s}: a control of this Workspace`,accepts:["buckyos.table-source","buckyos.record"],allow_no_source:!0,default_size:{w:260,h:140},config_schema:{type:"object",properties:{label:{type:"string",title:"Label",default:s}}},bindings:{data:{accepts:["buckyos.table-source"],title:"Data",description:"The table this control summarizes"}},catalog:{group:"custom",description:`${s}`},agent:"AGENT.md"},n=`# ${s}\n\nBind \`data\` to a table. Config: \`label\` (text).\n`;if("html"===e.kind){const e={clicked:{title:"Clicked",description:"Raised when someone clicks the button (in run mode)",params:{count:{type:"number",description:"Rows of the bound table"}}}};return{[t]:`${JSON.stringify({...i,host_api:6,events:e,entry:{html:"view.html",css:"style.css",js:"behavior.js"}},null,2)}\n`,"view.html":'<div class="card"><div class="label" id="label"></div><div class="value" id="value">—</div><button id="go" type="button">Go</button></div>\n',"style.css":".card{font:14px system-ui;padding:12px}.label{opacity:.7}.value{font-size:28px;font-weight:600}\n","behavior.js":["document.getElementById('label').textContent = (aiws.context.config || {}).label || ''","var count = 0","if (aiws.bindings.data) aiws.input('data').rows().then(function (rows) { count = rows.length; document.getElementById('value').textContent = String(count) })","// the public event of component.json: an instance binds handlers to it in its `on` (host API 3)","document.getElementById('go').addEventListener('click', function () { aiws.emit('clicked', { count: count }) })",""].join("\n"),"AGENT.md":`${n}Event: \`clicked\` (\`count\`), raised by its button; bind handlers to it in the instance's \`on\`.\n`}}return{[t]:`${JSON.stringify({...i,entry:"declarative.json"},null,2)}\n`,"declarative.json":`${JSON.stringify({layout:"stack",items:[{kind:"metric",label:s,bind:"data.count",format:"number"},{kind:"text",text:"Rows of the bound table"}]},null,2)}\n`,"AGENT.md":n}},exports.createControlSource=async function(e,o,s){const i=await G(e,o),n=await e.list({ref:i},{limit:500},["base"]).catch((()=>null));if(null==n?void 0:n.entries.some((e=>e.name===t)))throw new r([{file:t,severity:"error",message:`${o} already holds a control`}]);for(const[t,r]of Object.entries(s))await X(e,i,t,a.encode(r));return i},exports.ensureFolder=G,exports.exportBundle=async function(e,t,o,i){const n=await e.extExport(t,o,"package"),r=new Map;r.set(s,a.encode(`${JSON.stringify(n.manifest,null,2)}\n`));for(const s of n.files)r.set(s.path,void 0!==s.text?a.encode(s.text):await i(t,String(s.obj_id)));return{manifest:M(n.manifest),files:r,controls:n.controls}},exports.findFolder=H,exports.folderName=d,exports.hasControlSource=K,exports.homeControlDir=function(e,t,o){return`/home/${e}/AI Workspace/${d(t)}/controls/${o}`},exports.homeExportDir=function(e,t){return`/home/${e}/AI Workspace/exports/${t}`},exports.isSourcePath=q,exports.joinPath=l,exports.packBuildFiles=y,exports.pullControl=async function(e,t,o,s,i,n){const r=(await e.extExport(o,[s],"pull")).controls[0];await G(t,i);for(const l of r.files)await Z(t,i,l.name,void 0!==l.text?a.encode(l.text):await n(o,String(l.obj_id)));const c={workspace_id:o,def_entity_id:r.entity_id,def_rev:r.def_rev,dir_rev:r.dir_rev,ident:r.ident,at:(new Date).toISOString()};return await oe(t,i,c),{files:r.files.map((e=>e.name)),state:c}},exports.readBuildState=te,exports.slotCells=function(e){const t=new Set;for(const o of Object.values(e.slots??{}))for(const e of o.accepts??[])e.startsWith("cell:")&&t.add(e.slice(5));return[...t].sort()},exports.sourceStateKey=function(e){return`aiws:src:${e}`},exports.sourcesDigest=ee,exports.sourcesKey=m,exports.templateDir=V,exports.unbuiltChanges=async function(e,t,o,s,i){var n;if(!(await K(t,i)))return null;const r=await ee(t,await Q(t,i)),a=await e.extExport(o,[s],"pull"),c=String((null==(n=a.controls[0])?void 0:n.digest)??"");return{changed:r!==c,home:r,built:c}},exports.verifyBundle=async function(e){var o,i;const a=e.get(s);if(!a)throw new r([{file:s,severity:"error",message:"missing"}]);let l;try{l=JSON.parse(c.decode(a))}catch(g){throw new r([{file:s,severity:"error",message:String(g)}])}const d=M(l),f=[],m=d.workspace_templates;m.length>0&&d.manifest_version<3&&f.push({file:s,severity:"error",message:`Workspace templates need manifest_version 3 (raise it in ${s})`}),m.length>32&&f.push({file:s,severity:"error",message:"at most 32 Workspace templates"}),0===d.controls.length&&0===m.length&&f.push({file:s,severity:"error",message:"lists no control"});const u=new Map;for(const s of d.controls){const o="string"==typeof s.dir?e.get(`${s.dir}${t}`):void 0;try{const e=o?JSON.parse(c.decode(o)):void 0;J(e)&&u.set(s.ident,J(e.events)?Object.keys(e.events):[])}catch{}}const h=new Set;for(const n of d.controls){if("string"!=typeof n.dir||!/^controls\/[a-z0-9][a-z0-9._-]{0,70}\/$/.test(n.dir)||h.has(n.dir)){f.push({file:s,severity:"error",message:`control ${n.ident}: bad or repeated dir`});continue}h.add(n.dir);const r=[...e].filter((([e])=>e.startsWith(n.dir))).map((([e,t])=>[e.slice(n.dir.length),t]));await p(r)!==n.digest&&f.push({file:n.dir,severity:"error",message:"the files do not match the manifest digest"});const a=r.find((([e])=>e===t));if(!a){f.push({file:`${n.dir}${t}`,severity:"error",message:"missing"});continue}const l=e=>{const t=r.find((([t])=>t===e));return t?c.decode(t[1]):void 0};for(const e of L(c.decode(a[1]),r.map((([e])=>e)),l,(e=>u.get(e))))f.push({...e,file:`${n.dir}${e.file}`});try{const e=JSON.parse(c.decode(a[1]));`${null==(o=e.ident)?void 0:o.author_did}#${null==(i=e.ident)?void 0:i.name}`===n.ident&&e.kind===n.kind||f.push({file:n.dir,severity:"error",message:"ident and kind must match its component.json"}),JSON.stringify([...e.deps??[]].sort())!==JSON.stringify([...n.deps??[]].sort())&&f.push({file:n.dir,severity:"error",message:"deps must match its component.json"})}catch{}}const y=new Set(d.controls.map((e=>e.ident)));for(const t of d.controls)for(const e of t.deps??[])y.has(e)||f.push({file:s,severity:"error",message:`${t.ident} depends on ${e}, which the bundle does not carry`});for(const[t,r]of m.entries()){const o=J(r)&&"string"==typeof r.id?`template ${r.id}`:`workspace_templates[${t}]`;for(const e of P(r,y))f.push({file:s,severity:"error",message:`${o}: ${e}`});if(!J(r)||"string"!=typeof r.id||!F.test(r.id))continue;const i=V(r.id);if(h.has(i)){f.push({file:s,severity:"error",message:`${o} is listed twice`});continue}h.add(i);const a=e.get(`${i}snapshot.json`);let l;try{l=a?JSON.parse(c.decode(a)).format:void 0}catch{l=void 0}a?l!==n&&f.push({file:`${i}snapshot.json`,severity:"error",message:`not a template snapshot (format ${n})`}):f.push({file:`${i}snapshot.json`,severity:"error",message:"missing"}),await R(e,r.id)!==r.digest&&f.push({file:i,severity:"error",message:"the files do not match the template digest"})}for(const t of e.keys())t===s||[...h].some((e=>t.startsWith(e)))||f.push({file:t,severity:"error",message:"belongs to no control or template of the manifest"});return{manifest:d,diagnostics:f}},exports.watchControl=async function(e,t,o,s={}){var i,n;let r,a="",c=Promise.resolve();const l=()=>{c=c.then((async()=>{let s;try{s=await Q(e,t)}catch{return}const i=m(s);i!==a&&(a=i,await o(s))})).catch((()=>{}))};for(l();!(null==(i=s.signal)?void 0:i.aborted);){const o=await e.list(t,{limit:1},["base"]),i=e.watch({tokens:o.watch_token?[o.watch_token]:[],signal:s.signal});try{for await(const e of i)r&&clearTimeout(r),r=setTimeout(l,s.debounceMs??500)}catch{if(null==(n=s.signal)?void 0:n.aborted)break;await Y(2e3)}finally{i.close()}}r&&clearTimeout(r),await c},exports.writeBuildState=oe,exports.writeHomeFile=X,exports.writeSourceFile=Z;
2
2
  //# sourceMappingURL=aiws_ext.cjs.map
package/dist/aiws_ext.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { av as checkBindSteps } from "./aiws_bind-ec6fe2d5.mjs";
1
+ import { av as checkBindSteps } from "./aiws_bind-b851d4db.mjs";
2
2
  import "./object_url-20e94b67.mjs";
3
3
  import "./ndn_types-0fac2499.mjs";
4
4
  const AIWS_COMPONENT_FILE = "component.json";
@@ -81,6 +81,7 @@ export interface ExpandOptions {
81
81
  viewerTz?: string;
82
82
  /** At most this many occurrences (default 2000). */
83
83
  limit?: number;
84
+ onTruncated?: () => void;
84
85
  }
85
86
  /** The occurrences of a series overlapping the window `[fromMs, toMs)`, in order. DTSTART is always the first
86
87
  * occurrence (as mainstream calendars show it), counted by COUNT. Excluded originals (EXDATE) are left out but still
@@ -108,8 +109,8 @@ export declare function parseOccurrenceId(id: string): {
108
109
  original: string | null;
109
110
  };
110
111
  /** The languages rules are described in: Simplified Chinese ('zh'), Traditional Chinese, English, Japanese,
111
- * Korean, French, German, Spanish, Russian. Any other value reads English. */
112
- export type RecurrenceLocale = 'zh' | 'zh-TW' | 'en' | 'ja' | 'ko' | 'fr' | 'de' | 'es' | 'ru';
112
+ * Korean, French, German, Spanish, Russian and Arabic. Any other value reads English. */
113
+ export type RecurrenceLocale = 'zh' | 'zh-TW' | 'en' | 'ja' | 'ko' | 'fr' | 'de' | 'es' | 'ru' | 'ar';
113
114
  /** A sentence for a rule ("每个工作日", "每月最后一个周五", "every 2 weeks on Monday, Wednesday, 10 times"). */
114
115
  export declare function describeRRule(rule: RRule, locale?: RecurrenceLocale): string;
115
116
  export interface RecurrencePreset {
@@ -1 +1 @@
1
- {"version":3,"file":"aiws_rrule.d.ts","sourceRoot":"","sources":["../src/aiws_rrule.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;AAC5D,wDAAwD;AACxD,eAAO,MAAM,QAAQ,qDAAsD,CAAA;AAC3E,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/C,MAAM,WAAW,KAAK;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE;AAE5D,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,KAAK,EAAE,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI5B;AAmCD,iHAAiH;AACjH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CA8D9C;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAW/C;AAID,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAKzC;AACD,eAAO,MAAM,MAAM,MAAO,MAAM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AM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,CAAA;IACxG,KAAK,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,kHAAkH;AAClH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,gBAAuB,GAAG,gBAAgB,EAAE,CAmBnG"}
@@ -11,13 +11,14 @@ export type Json = null | boolean | number | string | Json[] | {
11
11
  };
12
12
  export type Op = Record<string, Json>;
13
13
  /** The languages standard tables are named in: Simplified Chinese ('zh'), Traditional Chinese, English, Japanese,
14
- * Korean, French, German, Spanish, Russian (any other value reads English). */
15
- export type ScheduleLocale = 'zh' | 'zh-TW' | 'en' | 'ja' | 'ko' | 'fr' | 'de' | 'es' | 'ru';
14
+ * Korean, French, German, Spanish, Russian and Arabic (any other value reads English). */
15
+ export type ScheduleLocale = 'zh' | 'zh-TW' | 'en' | 'ja' | 'ko' | 'fr' | 'de' | 'es' | 'ru' | 'ar';
16
16
  export interface FieldDef {
17
17
  field_id: string;
18
18
  name: string;
19
19
  type: string;
20
20
  required?: boolean;
21
+ default?: Json;
21
22
  nullable?: boolean;
22
23
  options?: {
23
24
  option_id: string;
@@ -45,6 +46,7 @@ export declare function orderKeysBetween(a: string | null, b: string | null, cou
45
46
  /** A record as `doc.read` (`table_record`) and the SQL `_record` column answer it. */
46
47
  export interface RowLike {
47
48
  record_id: string;
49
+ created_seq?: number;
48
50
  rev?: number;
49
51
  revs?: Record<string, number>;
50
52
  values: Record<string, Json | undefined>;
@@ -176,6 +178,7 @@ export declare function calendarOccurrences(rows: RowLike[], window: {
176
178
  }, opts?: {
177
179
  viewerTz?: string;
178
180
  limit?: number;
181
+ onTruncated?: () => void;
179
182
  }): EventOccurrence[];
180
183
  /** A new event: timed (`start` / `end` ISO) or all-day (`start_date` / `end_date`). */
181
184
  export declare function eventAddOps(sourceId: string, input: EventValues & {
@@ -243,13 +246,21 @@ export interface ScheduleTransport {
243
246
  * `calendar` (fixed ids), and a page showing both, created the first time. Agents and commands use it by name. */
244
247
  export declare class ScheduleClient {
245
248
  readonly aiws: ScheduleTransport;
249
+ private readonly opts;
246
250
  private handle;
247
251
  private readonly locale;
248
252
  constructor(aiws: ScheduleTransport, opts?: {
249
253
  locale?: ScheduleLocale;
254
+ idempotencyKey?: string;
255
+ newRecordId?: () => string;
250
256
  });
251
257
  /** The schedule Workspace with its two tables (created when missing; concurrent first uses converge). */
252
258
  ensure(): Promise<ScheduleHandle>;
259
+ open(ws: {
260
+ workspace_id: string;
261
+ epoch: string;
262
+ created?: boolean;
263
+ }, initialize?: boolean): Promise<ScheduleHandle>;
253
264
  private commitTo;
254
265
  /** Commit operations into the schedule; a refusal or conflict throws with the service's reason. */
255
266
  commit(operations: Op[], message: string): Promise<CommitResult>;
@@ -261,10 +272,12 @@ export declare class ScheduleClient {
261
272
  }): Promise<TodoItem[]>;
262
273
  addTodo(input: TodoValues & {
263
274
  title: string;
275
+ record_id?: string;
264
276
  }, place?: {
265
277
  after?: string;
266
278
  before?: string;
267
279
  }): Promise<TodoItem>;
280
+ private commitRowChange;
268
281
  completeTodo(recordId: string, done?: boolean): Promise<void>;
269
282
  updateTodo(recordId: string, changes: TodoValues & {
270
283
  ext_merge?: Record<string, Json | null>;
@@ -284,6 +297,7 @@ export declare class ScheduleClient {
284
297
  }): Promise<EventOccurrence[]>;
285
298
  addEvent(input: EventValues & {
286
299
  title: string;
300
+ record_id?: string;
287
301
  }): Promise<string>;
288
302
  /** The occurrence an id names (`record_id` or `<master>@<original>`), from all rows. */
289
303
  occurrence(id: string): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"aiws_schedule.d.ts","sourceRoot":"","sources":["../src/aiws_schedule.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,cAAc,mBAAmB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Q,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAA;IAC/E,SAAS,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CACxE;AAWD;iCACiC;AACjC,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,CA0B3E;AAED,+GAA+G;AAC/G,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,cAAqB,GAAG,EAAE,EAAE,CAWpE;AAED,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA"}
@@ -39,7 +39,7 @@ import { R as RPCError, k as kRPCClient } from "./krpc_client-673448e5.mjs";
39
39
  import { s as DID, N as NODE_IDENTITY_SCHEMA_V2, e as isBuckyOSLocalNodeIdentityConfig, l as parseBuckyOSOwnerDocument, t as canonicalize, u as signJwtEdDSA, F as FileObject, A as ACTION_TYPE_DOWNLOAD, v as ACTION_TYPE_INSTALLED, w as ACTION_TYPE_LIKED, x as ACTION_TYPE_PURCHASED, y as ACTION_TYPE_SHARED, z as ACTION_TYPE_UNLIKED, B as ACTION_TYPE_VIEWED, C as BaseContentObject, E as CYFS_CONTENT_TYPE_NAMED_OBJECT_JSON, G as CYFS_CONTENT_TYPE_NAMED_OBJECT_JWT, H as ChunkId, I as ChunkType, J as DEFAULT_HASH_METHOD, K as DirObject, L as HashMethod, M as InclusionProof, O as KnownStandardObject, P as MSG_OBJECT_RESERVED_KEYS, Q as MSG_REACTION_KEY_MAX_BYTES, R as MSG_SESSION_ID_MAX_CHARS, S as NamedObjectBase, T as NdnError, U as OBJ_TYPE_ACTION, V as OBJ_TYPE_CHUNK_LIST, W as OBJ_TYPE_DIR, X as OBJ_TYPE_FILE, Y as OBJ_TYPE_INCLUSION_PROOF, Z as OBJ_TYPE_LIST, _ as OBJ_TYPE_MSG, $ as OBJ_TYPE_OBJMAP, a0 as OBJ_TYPE_PACK, a1 as OBJ_TYPE_PATH, a2 as OBJ_TYPE_PKG, a3 as OBJ_TYPE_RECEIPT, a4 as OBJ_TYPE_RELATION, a5 as ObjId, a6 as PathObject, a7 as RELATION_TYPE_PART_OF, a8 as RELATION_TYPE_SAME, a9 as RelationObject, aa as SimpleChunkList, ab as SimpleMapItem, ac as SimpleObjectMap, ad as actionObjectFromJson, ae as base32Decode, af as base32Encode, ag as buildNamedObjectByJson, ah as buildNamedObjectByJwt, ai as buildObjId, aj as bytesToHex$2, ak as calcPkgMetaObjId, al as canonicalizeJson, am as decodeMsgObjectJwt, an as extractObjIdByPath, ao as hexToBytes$1, ap as isCyfsNamedObjectContentType, aq as isValidMsgSessionId, ar as loadNamedObj, as as loadNamedObjAndVerify, at as loadNamedObjectFromObjStr, au as msgJwtKidDid, av as msgObjectFromJsonChecked, aw as namedObjectEncodingFromContentType, ax as normalizePackageMetaForObjId, ay as randomMsgNonce, az as receiptObjFromJson, aA as sha256Bytes, aB as sha256Utf8, aC as toCanonicalJsonString, aD as validateMsgObject, aE as varintDecode, aF as varintEncode, aG as verifyMsgObjectJwt, aH as verifyNamedObject, aI as verifyNamedObjectFromJwt, aJ as verifyNamedObjectFromStr } from "./ndn_types-0fac2499.mjs";
40
40
  import { s as sniffMagic, m as mediaTypeFromExtension, e as extensionOf, a as stripMediaTypeParams, h as heifImageSize, i as isoBoxes } from "./content_mime-e42d5f8d.mjs";
41
41
  import { g as getBrowserIdentityRaw, c as clearBrowserUserInfo, s as saveBrowserIdentity, a as saveBrowserUserInfo, b as getBrowserUserInfo, d as clearBrowserIdentity, h as hashPassword, e as saveLocalAccountInfo, f as cleanLocalAccountInfo } from "./account-7a7bde6f.mjs";
42
- import { i as AiWorkspaceClient, A as AIWORKSPACE_SERVICE_NAME, Y as newRecordId, _ as insertRecordOp, Z as setValuesOps, $ as deleteRecordsOp, V as orderKeyBetween, g as commitOverLimit, M as AIWS_PROTOCOL_VERSION, a as AiwsFailure, h as commitWithParts } from "./aiws_bind-ec6fe2d5.mjs";
42
+ import { i as AiWorkspaceClient, A as AIWORKSPACE_SERVICE_NAME, Y as newRecordId, _ as insertRecordOp, Z as setValuesOps, $ as deleteRecordsOp, V as orderKeyBetween, g as commitOverLimit, M as AIWS_PROTOCOL_VERSION, a as AiwsFailure, h as commitWithParts } from "./aiws_bind-b851d4db.mjs";
43
43
  import { a as objEventKey } from "./object_url-20e94b67.mjs";
44
44
  function ensureSSOEnvironment() {
45
45
  if (typeof window === "undefined" || typeof window.location === "undefined") {
@@ -32271,4 +32271,4 @@ export {
32271
32271
  NOTIFY_CHOICE_CONTROL_ID as y,
32272
32272
  NOTIFY_TEXT_CONTROL_ID as z
32273
32273
  };
32274
- //# sourceMappingURL=aiws_write-07562abc.mjs.map
32274
+ //# sourceMappingURL=aiws_write-2f0baa6f.mjs.map